react-native-screen-transitions 3.11.2 → 3.12.0

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 (457) hide show
  1. package/lib/commonjs/blank-stack/components/stack-view.js +1 -2
  2. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  3. package/lib/commonjs/component-stack/components/stack-view.js +1 -2
  4. package/lib/commonjs/component-stack/components/stack-view.js.map +1 -1
  5. package/lib/commonjs/native-stack/views/NativeStackView.native.js +3 -4
  6. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  7. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
  8. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js +36 -0
  10. package/lib/commonjs/shared/components/boundary/components/boundary-lifecycle.js.map +1 -0
  11. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
  12. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
  14. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +3 -2
  16. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +9 -2
  18. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +7 -4
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +25 -43
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +13 -0
  26. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -31
  28. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
  29. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +14 -19
  30. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  31. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +8 -0
  32. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +19 -47
  34. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  36. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
  37. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
  38. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +19 -17
  39. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  40. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +19 -5
  41. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  42. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +30 -0
  43. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
  44. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +40 -22
  45. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  46. package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js +21 -0
  47. package/lib/commonjs/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
  48. package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +41 -0
  49. package/lib/commonjs/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
  50. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js +85 -0
  51. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
  52. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +14 -65
  53. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  54. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +89 -16
  55. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  56. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +11 -7
  57. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  58. package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +31 -0
  59. package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
  60. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-completion.js +26 -0
  61. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
  62. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +64 -87
  63. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  64. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
  65. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  66. package/lib/commonjs/shared/components/screen-lifecycle/index.js +9 -6
  67. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  68. package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js +28 -6
  69. package/lib/commonjs/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
  70. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +1 -2
  71. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  72. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +10 -7
  73. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
  75. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  76. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +8 -2
  77. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +9 -5
  79. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +10 -5
  81. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  82. package/lib/commonjs/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +36 -50
  83. package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
  84. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
  85. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  86. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
  87. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  88. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
  89. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  90. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
  91. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  92. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +9 -5
  93. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  94. package/lib/commonjs/shared/providers/screen/styles/constants.js +1 -0
  95. package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
  96. package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js +20 -1
  97. package/lib/commonjs/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
  98. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
  99. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  100. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +34 -11
  101. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  102. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +18 -29
  103. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  104. package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js +5 -1
  105. package/lib/commonjs/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
  106. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +18 -0
  107. package/lib/commonjs/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
  108. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js +2 -1
  109. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -1
  110. package/lib/commonjs/shared/stores/bounds/internals/links.js +1 -1
  111. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  112. package/lib/commonjs/shared/stores/system.store.js +1 -2
  113. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  114. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +0 -22
  115. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  116. package/lib/commonjs/shared/utils/create-provider.js +119 -10
  117. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  118. package/lib/commonjs/shared/utils/navigation/close-action-replay.js +22 -0
  119. package/lib/commonjs/shared/utils/navigation/close-action-replay.js.map +1 -0
  120. package/lib/module/blank-stack/components/stack-view.js +1 -2
  121. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  122. package/lib/module/component-stack/components/stack-view.js +1 -2
  123. package/lib/module/component-stack/components/stack-view.js.map +1 -1
  124. package/lib/module/native-stack/views/NativeStackView.native.js +3 -4
  125. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  126. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -1
  127. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  128. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js +32 -0
  129. package/lib/module/shared/components/boundary/components/boundary-lifecycle.js.map +1 -0
  130. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
  131. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  132. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
  133. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
  134. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +3 -2
  135. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  136. package/lib/module/shared/components/boundary/hooks/use-measurer.js +9 -2
  137. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  138. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +7 -4
  139. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  140. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
  141. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  142. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +27 -45
  143. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  144. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +8 -0
  145. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
  146. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -32
  147. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
  148. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +15 -20
  149. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  150. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +8 -0
  151. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  152. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +20 -48
  153. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
  154. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  155. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
  156. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
  157. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +20 -18
  158. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  159. package/lib/module/shared/components/boundary/utils/refresh-signals.js +19 -5
  160. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  161. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +25 -0
  162. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -0
  163. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +37 -21
  164. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  165. package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js +17 -0
  166. package/lib/module/shared/components/overlay/helpers/retain-ready-overlay-resources.js.map +1 -0
  167. package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js +36 -0
  168. package/lib/module/shared/components/overlay/helpers/run-overlay-slot-interpolator.js.map +1 -0
  169. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js +80 -0
  170. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -0
  171. package/lib/module/shared/components/overlay/variations/float-overlay.js +15 -66
  172. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  173. package/lib/module/shared/components/overlay/variations/overlay-host.js +90 -18
  174. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  175. package/lib/module/shared/components/screen-container/layers/backdrop.js +12 -8
  176. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  177. package/lib/module/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +25 -0
  178. package/lib/module/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
  179. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-completion.js +21 -0
  180. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
  181. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +64 -86
  182. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  183. package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
  184. package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  185. package/lib/module/shared/components/screen-lifecycle/index.js +9 -6
  186. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  187. package/lib/module/shared/hooks/navigation/use-navigation-helpers.js +29 -7
  188. package/lib/module/shared/hooks/navigation/use-navigation-helpers.js.map +1 -1
  189. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +1 -2
  190. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  191. package/lib/module/shared/providers/screen/animation/animation.provider.js +10 -7
  192. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  193. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -8
  194. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  195. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +8 -2
  196. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  197. package/lib/module/shared/providers/screen/gestures/gestures.provider.js +10 -6
  198. package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  199. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +10 -5
  200. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  201. package/lib/module/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.js → gesture-ownership-bridge.js} +35 -49
  202. package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -0
  203. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
  204. package/lib/module/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  205. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
  206. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  207. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
  208. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  209. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
  210. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  211. package/lib/module/shared/providers/screen/gestures/shared/policy.js +9 -5
  212. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  213. package/lib/module/shared/providers/screen/styles/constants.js +1 -0
  214. package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
  215. package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js +18 -0
  216. package/lib/module/shared/providers/screen/styles/helpers/transition-visual-state.js.map +1 -1
  217. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +14 -15
  218. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  219. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +35 -12
  220. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  221. package/lib/module/shared/providers/screen/styles/slot.provider.js +19 -30
  222. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  223. package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js +5 -1
  224. package/lib/module/shared/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
  225. package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js +14 -0
  226. package/lib/module/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.js.map +1 -0
  227. package/lib/module/shared/providers/stack/blank-stack.provider.js +2 -1
  228. package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -1
  229. package/lib/module/shared/stores/bounds/internals/links.js +1 -1
  230. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  231. package/lib/module/shared/stores/system.store.js +1 -2
  232. package/lib/module/shared/stores/system.store.js.map +1 -1
  233. package/lib/module/shared/types/animation.types.js.map +1 -1
  234. package/lib/module/shared/utils/animation/animate-to-progress.js +0 -22
  235. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  236. package/lib/module/shared/utils/create-provider.js +119 -10
  237. package/lib/module/shared/utils/create-provider.js.map +1 -1
  238. package/lib/module/shared/utils/navigation/close-action-replay.js +16 -0
  239. package/lib/module/shared/utils/navigation/close-action-replay.js.map +1 -0
  240. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  241. package/lib/typescript/blank-stack/types.d.ts +1 -1
  242. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  243. package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -1
  244. package/lib/typescript/component-stack/types.d.ts +1 -1
  245. package/lib/typescript/component-stack/types.d.ts.map +1 -1
  246. package/lib/typescript/native-stack/types.d.ts +1 -1
  247. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  248. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  249. package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts +18 -0
  250. package/lib/typescript/shared/components/boundary/components/boundary-lifecycle.d.ts.map +1 -0
  251. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +1 -2
  252. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  253. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
  254. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +3 -2
  255. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  256. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -2
  257. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  258. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  259. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
  260. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts +5 -1
  261. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  262. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -0
  263. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -0
  264. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts +4 -17
  265. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -1
  266. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +3 -1
  267. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
  268. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  269. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts +5 -9
  270. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
  271. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +2 -1
  272. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  273. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +2 -1
  274. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  275. package/lib/typescript/shared/components/boundary/types.d.ts +6 -0
  276. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  277. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts +1 -0
  278. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  279. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts +7 -0
  280. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts.map +1 -0
  281. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +17 -7
  282. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
  283. package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts +11 -0
  284. package/lib/typescript/shared/components/overlay/helpers/retain-ready-overlay-resources.d.ts.map +1 -0
  285. package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts +8 -0
  286. package/lib/typescript/shared/components/overlay/helpers/run-overlay-slot-interpolator.d.ts.map +1 -0
  287. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +15 -0
  288. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -0
  289. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  290. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +7 -6
  292. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  293. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  294. package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts +27 -0
  295. package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts.map +1 -0
  296. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-completion.d.ts +7 -0
  297. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-completion.d.ts.map +1 -0
  298. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +2 -7
  299. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
  300. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +1 -3
  301. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
  302. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  303. package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts +1 -0
  304. package/lib/typescript/shared/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
  305. package/lib/typescript/shared/index.d.ts +12 -12
  306. package/lib/typescript/shared/index.d.ts.map +1 -1
  307. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +4 -0
  308. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts +4 -1
  310. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  311. package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
  313. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts +2 -2
  314. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts +3 -0
  316. package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts.map +1 -0
  317. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts +1 -1
  318. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  320. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  321. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  323. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +2 -1
  324. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  325. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
  326. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  327. package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
  328. package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts +7 -0
  329. package/lib/typescript/shared/providers/screen/styles/helpers/transition-visual-state.d.ts.map +1 -1
  330. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
  331. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +1 -1
  332. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  333. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +5 -5
  334. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  335. package/lib/typescript/shared/providers/stack/blank-stack-state/blank-stack-controller.d.ts.map +1 -1
  336. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts +3 -0
  337. package/lib/typescript/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.d.ts.map +1 -0
  338. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -1
  339. package/lib/typescript/shared/stores/system.store.d.ts +1 -2
  340. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  341. package/lib/typescript/shared/types/animation.types.d.ts +8 -0
  342. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  343. package/lib/typescript/shared/types/index.d.ts +1 -1
  344. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  345. package/lib/typescript/shared/types/overlay.types.d.ts +26 -11
  346. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
  347. package/lib/typescript/shared/types/screen.types.d.ts +2 -2
  348. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  349. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -3
  350. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  351. package/lib/typescript/shared/utils/create-provider.d.ts +21 -6
  352. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  353. package/lib/typescript/shared/utils/navigation/close-action-replay.d.ts +4 -0
  354. package/lib/typescript/shared/utils/navigation/close-action-replay.d.ts.map +1 -0
  355. package/package.json +1 -1
  356. package/src/blank-stack/components/stack-view.tsx +1 -4
  357. package/src/blank-stack/types.ts +8 -2
  358. package/src/component-stack/components/stack-view.tsx +1 -4
  359. package/src/component-stack/types.ts +8 -2
  360. package/src/native-stack/types.ts +8 -2
  361. package/src/native-stack/views/NativeStackView.native.tsx +6 -10
  362. package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +1 -1
  363. package/src/shared/components/boundary/components/boundary-lifecycle.tsx +53 -0
  364. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -14
  365. package/src/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +13 -2
  366. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +7 -2
  367. package/src/shared/components/boundary/hooks/use-measurer.ts +11 -1
  368. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +9 -4
  369. package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +13 -11
  370. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +44 -55
  371. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +10 -0
  372. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts +11 -55
  373. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +20 -24
  374. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +11 -0
  375. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +20 -67
  376. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -0
  377. package/src/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +3 -2
  378. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +29 -20
  379. package/src/shared/components/boundary/types.ts +9 -0
  380. package/src/shared/components/boundary/utils/refresh-signals.ts +39 -6
  381. package/src/shared/components/overlay/helpers/create-overlay-interpolator-frame.ts +29 -0
  382. package/src/shared/components/overlay/helpers/get-active-overlay.ts +62 -20
  383. package/src/shared/components/overlay/helpers/retain-ready-overlay-resources.ts +38 -0
  384. package/src/shared/components/overlay/helpers/run-overlay-slot-interpolator.ts +48 -0
  385. package/src/shared/components/overlay/hooks/use-overlay-slot.ts +103 -0
  386. package/src/shared/components/overlay/variations/float-overlay.tsx +22 -64
  387. package/src/shared/components/overlay/variations/overlay-host.tsx +135 -28
  388. package/src/shared/components/screen-container/layers/backdrop.tsx +11 -7
  389. package/src/shared/components/screen-lifecycle/hooks/helpers/close-interception-rules.ts +64 -0
  390. package/src/shared/components/screen-lifecycle/hooks/use-close-completion.ts +28 -0
  391. package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +72 -109
  392. package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +0 -12
  393. package/src/shared/components/screen-lifecycle/index.tsx +8 -4
  394. package/src/shared/hooks/navigation/use-navigation-helpers.ts +39 -7
  395. package/src/shared/index.ts +1 -0
  396. package/src/shared/providers/helpers/measured-bounds-writes.ts +1 -1
  397. package/src/shared/providers/screen/animation/animation.provider.tsx +24 -11
  398. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +15 -9
  399. package/src/shared/providers/screen/animation/use-screen-animation.tsx +12 -2
  400. package/src/shared/providers/screen/gestures/gestures.provider.tsx +18 -7
  401. package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +13 -5
  402. package/src/shared/providers/screen/gestures/ownership/{use-walk-up-and-register-shadowing-claims.ts → gesture-ownership-bridge.tsx} +44 -54
  403. package/src/shared/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +4 -6
  404. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -3
  405. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +4 -6
  406. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +2 -8
  407. package/src/shared/providers/screen/gestures/shared/policy.ts +17 -6
  408. package/src/shared/providers/screen/gestures/types.ts +2 -0
  409. package/src/shared/providers/screen/styles/constants.ts +1 -0
  410. package/src/shared/providers/screen/styles/helpers/transition-visual-state.ts +26 -0
  411. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +17 -5
  412. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +51 -12
  413. package/src/shared/providers/screen/styles/slot.provider.tsx +46 -70
  414. package/src/shared/providers/stack/blank-stack-state/blank-stack-controller.ts +5 -1
  415. package/src/shared/providers/stack/blank-stack-state/helpers/resolve-presented-index.ts +22 -0
  416. package/src/shared/providers/stack/blank-stack.provider.tsx +6 -1
  417. package/src/shared/stores/bounds/internals/links.ts +1 -1
  418. package/src/shared/stores/system.store.ts +1 -2
  419. package/src/shared/types/animation.types.ts +8 -0
  420. package/src/shared/types/index.ts +1 -1
  421. package/src/shared/types/overlay.types.ts +41 -14
  422. package/src/shared/types/screen.types.ts +2 -2
  423. package/src/shared/utils/animation/animate-to-progress.ts +1 -22
  424. package/src/shared/utils/create-provider.tsx +221 -19
  425. package/src/shared/utils/navigation/close-action-replay.ts +25 -0
  426. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -30
  427. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
  428. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -47
  429. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
  430. package/lib/commonjs/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
  431. package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -28
  432. package/lib/commonjs/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
  433. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +0 -53
  434. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
  435. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -25
  436. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
  437. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -40
  438. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
  439. package/lib/module/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.js.map +0 -1
  440. package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js +0 -24
  441. package/lib/module/shared/providers/screen/styles/components/floating-overlay-layer.js.map +0 -1
  442. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +0 -47
  443. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +0 -1
  444. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts +0 -9
  445. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts.map +0 -1
  446. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts +0 -9
  447. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +0 -1
  448. package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts +0 -14
  449. package/lib/typescript/shared/providers/screen/gestures/ownership/use-walk-up-and-register-shadowing-claims.d.ts.map +0 -1
  450. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +0 -7
  451. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +0 -1
  452. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +0 -6
  453. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +0 -1
  454. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/active-pair.ts +0 -36
  455. package/src/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.ts +0 -45
  456. package/src/shared/providers/screen/styles/components/floating-overlay-layer.tsx +0 -29
  457. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +0 -72
@@ -1,16 +1,23 @@
1
- import { StackActions } from "@react-navigation/native";
1
+ import {
2
+ StackActions,
3
+ usePreventRemoveContext,
4
+ } from "@react-navigation/native";
2
5
  import { useCallback } from "react";
3
6
  import { useDescriptorsStore } from "../../providers/screen/descriptors";
7
+ import { AnimationStore } from "../../stores/animation.store";
8
+ import {
9
+ LifecycleTransitionRequestKind,
10
+ SystemStore,
11
+ } from "../../stores/system.store";
12
+ import { dispatchCloseAction } from "../../utils/navigation/close-action-replay";
4
13
  import { useStack } from "./use-stack";
5
14
 
6
15
  export function useNavigationHelpers() {
7
16
  const route = useDescriptorsStore((store) => store.current.route);
8
17
  const navigation = useDescriptorsStore((store) => store.current.navigation);
9
18
  const requestStackDismiss = useStack((stack) => stack.requestDismiss);
10
-
11
- const requestDismiss = useCallback((): boolean => {
12
- return requestStackDismiss?.({ route }) ?? false;
13
- }, [route, requestStackDismiss]);
19
+ const { preventedRoutes } = usePreventRemoveContext();
20
+ const isRemovePrevented = preventedRoutes[route.key]?.preventRemove === true;
14
21
 
15
22
  const dismissScreen = useCallback((): boolean => {
16
23
  const state = navigation.getState();
@@ -20,13 +27,38 @@ export function useNavigationHelpers() {
20
27
  const routeStillPresent = routeIndex !== -1;
21
28
  if (!routeStillPresent || routeIndex === 0) return false;
22
29
 
23
- navigation.dispatch({
30
+ const action = {
24
31
  ...StackActions.pop(),
25
32
  source: route.key,
26
33
  target: state.key,
34
+ };
35
+ dispatchCloseAction(action, (closeAction) => {
36
+ navigation.dispatch(closeAction);
27
37
  });
28
38
  return true;
29
39
  }, [navigation, route.key]);
30
40
 
31
- return { dismissScreen, requestDismiss };
41
+ const requestDismiss = useCallback((): boolean => {
42
+ if (isRemovePrevented) return false;
43
+
44
+ if (requestStackDismiss) {
45
+ if (!requestStackDismiss({ route })) return false;
46
+ } else {
47
+ const state = navigation.getState();
48
+ const routeIndex = state.routes.findIndex(
49
+ (stateRoute) => stateRoute.key === route.key,
50
+ );
51
+ if (routeIndex <= 0) return false;
52
+ }
53
+
54
+ if (!AnimationStore.getValue(route.key, "closing").get()) {
55
+ SystemStore.getBag(route.key).actions.requestLifecycleTransition(
56
+ LifecycleTransitionRequestKind.Close,
57
+ 0,
58
+ );
59
+ }
60
+ return true;
61
+ }, [isRemovePrevented, navigation, route, requestStackDismiss]);
62
+
63
+ return { dismissScreen, isRemovePrevented, requestDismiss };
32
64
  }
@@ -71,6 +71,7 @@ export type {
71
71
  BoundsNavigationZoomStyle,
72
72
  GestureHandoffValues,
73
73
  InactiveBehavior,
74
+ OverlayComponent,
74
75
  OverlayProps,
75
76
  RawGestureValues,
76
77
  ScreenBackdropComponent,
@@ -67,7 +67,7 @@ export const applyMeasuredBoundsWrites = (
67
67
  measured,
68
68
  preparedStyles,
69
69
  group,
70
- { handoff, escapeClipping },
70
+ { handoff },
71
71
  );
72
72
  }
73
73
  };
@@ -2,6 +2,7 @@ import { type ReactNode, useCallback, useLayoutEffect, useMemo } from "react";
2
2
  import { useSharedValue } from "react-native-reanimated";
3
3
  import { createBoundsAccessor } from "../../../utils/bounds";
4
4
  import createProvider from "../../../utils/create-provider";
5
+ import { useDescriptorsStore } from "../descriptors";
5
6
  import { useScreenAnimationPipeline } from "./helpers/pipeline";
6
7
  import type {
7
8
  RegisterScreenAnimationDescendant,
@@ -25,25 +26,36 @@ export type ScreenAnimationContextValue = ReturnType<
25
26
  };
26
27
 
27
28
  export type ScreenAnimationContextResult = {
29
+ key: string;
28
30
  value: ScreenAnimationContextValue;
29
31
  };
30
32
 
31
33
  export const { ScreenAnimationProvider, useScreenAnimationStore } =
32
34
  createProvider("ScreenAnimation", {
33
35
  guarded: true,
36
+ global: true,
34
37
  })<Props, ScreenAnimationContextValue>(
35
38
  (_props, { useParentStore }): ScreenAnimationContextResult => {
36
- const parentContext = useParentStore();
37
- const parentScreenInterpolatorProps =
38
- parentContext?.screenInterpolatorProps;
39
- const parentScreenInterpolatorPropsRevision =
40
- parentContext?.screenInterpolatorPropsRevision;
41
- const parentAncestorScreenAnimationSources =
42
- parentContext?.ancestorScreenAnimationSources;
43
- const parentRegisterDescendantScreenAnimationSource =
44
- parentContext?.registerDescendantScreenAnimationSource;
45
- const parentAncestorDescendantScreenAnimationRegistrars =
46
- parentContext?.ancestorDescendantScreenAnimationRegistrars;
39
+ const currentScreenKey = useDescriptorsStore(
40
+ (store) => store.derivations.currentScreenKey,
41
+ );
42
+ const parentScreenInterpolatorProps = useParentStore(
43
+ (parentContext) => parentContext?.screenInterpolatorProps,
44
+ );
45
+ const parentScreenInterpolatorPropsRevision = useParentStore(
46
+ (parentContext) => parentContext?.screenInterpolatorPropsRevision,
47
+ );
48
+ const parentAncestorScreenAnimationSources = useParentStore(
49
+ (parentContext) => parentContext?.ancestorScreenAnimationSources,
50
+ );
51
+ const parentRegisterDescendantScreenAnimationSource = useParentStore(
52
+ (parentContext) =>
53
+ parentContext?.registerDescendantScreenAnimationSource,
54
+ );
55
+ const parentAncestorDescendantScreenAnimationRegistrars = useParentStore(
56
+ (parentContext) =>
57
+ parentContext?.ancestorDescendantScreenAnimationRegistrars,
58
+ );
47
59
 
48
60
  const {
49
61
  screenInterpolatorProps,
@@ -192,6 +204,7 @@ export const { ScreenAnimationProvider, useScreenAnimationStore } =
192
204
  ]);
193
205
 
194
206
  return {
207
+ key: currentScreenKey,
195
208
  value: {
196
209
  screenInterpolatorProps,
197
210
  screenInterpolatorPropsRevision,
@@ -4,7 +4,7 @@ import type {
4
4
  ScreenTransitionTarget,
5
5
  } from "../../../../../types/animation.types";
6
6
  import { createBoundsAccessor } from "../../../../../utils/bounds";
7
- import { useScreenAnimationStore } from "../../animation.provider";
7
+ import type { ScreenAnimationContextValue } from "../../animation.provider";
8
8
  import type {
9
9
  ScreenAnimationDescendantSources,
10
10
  ScreenAnimationSource,
@@ -15,6 +15,14 @@ type TransitionSourceIndex = number;
15
15
 
16
16
  export type TransitionAccessorSource = ScreenAnimationTransitionSource;
17
17
 
18
+ type TransitionAccessorStore = Pick<
19
+ ScreenAnimationContextValue,
20
+ | "screenInterpolatorProps"
21
+ | "screenInterpolatorPropsRevision"
22
+ | "ancestorScreenAnimationSources"
23
+ | "descendantScreenAnimationSources"
24
+ >;
25
+
18
26
  const resolveTargetIndex = (
19
27
  target: ScreenTransitionTarget | undefined,
20
28
  currentIndex: TransitionSourceIndex,
@@ -118,14 +126,12 @@ const buildSourceBoundsAccessor = (source: ScreenAnimationSource) => {
118
126
  });
119
127
  };
120
128
 
121
- export const useBuildTransitionAccessor = () => {
122
- const {
123
- screenInterpolatorProps,
124
- screenInterpolatorPropsRevision,
125
- ancestorScreenAnimationSources,
126
- descendantScreenAnimationSources,
127
- } = useScreenAnimationStore();
128
-
129
+ export const useBuildTransitionAccessor = ({
130
+ screenInterpolatorProps,
131
+ screenInterpolatorPropsRevision,
132
+ ancestorScreenAnimationSources,
133
+ descendantScreenAnimationSources,
134
+ }: TransitionAccessorStore) => {
129
135
  return useMemo(() => {
130
136
  const selfSource = {
131
137
  screenInterpolatorProps,
@@ -1,3 +1,4 @@
1
+ import { useRoute } from "@react-navigation/native";
1
2
  import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
2
3
  import type {
3
4
  ScreenInterpolationProps,
@@ -33,12 +34,21 @@ export function useScreenAnimation(
33
34
  ):
34
35
  | DerivedValue<ScreenInterpolationProps>
35
36
  | DerivedValue<ScreenInterpolationProps | null> {
37
+ const route = useRoute();
38
+ const screenAnimationStore = useScreenAnimationStore(route.key);
39
+
40
+ if (!screenAnimationStore) {
41
+ throw new Error(
42
+ `ScreenAnimation store for route "${route.key}" was not found`,
43
+ );
44
+ }
45
+
36
46
  const {
37
47
  screenInterpolatorPropsRevision,
38
48
  ancestorScreenAnimationSources,
39
49
  descendantScreenAnimationSources,
40
- } = useScreenAnimationStore();
41
- const transition = useBuildTransitionAccessor();
50
+ } = screenAnimationStore;
51
+ const transition = useBuildTransitionAccessor(screenAnimationStore);
42
52
  const transitionTarget = normalizeScreenAnimationTarget(
43
53
  target,
44
54
  ancestorScreenAnimationSources.length,
@@ -1,11 +1,11 @@
1
- import { useMemo } from "react";
1
+ import { Fragment, useMemo } from "react";
2
2
  import { Gesture } from "react-native-gesture-handler";
3
3
  import { useSharedValue } from "react-native-reanimated";
4
4
  import { ScrollStore } from "../../../stores/scroll.store";
5
5
  import createProvider from "../../../utils/create-provider";
6
6
  import { useDescriptorsStore } from "../descriptors";
7
7
  import { useScreenGestureConfig } from "./hooks/use-screen-gesture-config";
8
- import { useWalkUpAndRegisterShadowingClaims } from "./ownership/use-walk-up-and-register-shadowing-claims";
8
+ import { GestureOwnershipBridge } from "./ownership/gesture-ownership-bridge";
9
9
  import { useBuildPanGesture } from "./pan/use-build-pan-gesture";
10
10
  import { useBuildPinchGesture } from "./pinch/use-build-pinch-gesture";
11
11
  import {
@@ -28,11 +28,16 @@ export const { ScreenGestureProvider, useScreenGestureStore: useGestureStore } =
28
28
  { children },
29
29
  { useParentStore },
30
30
  ): { value: GestureContextType; children: React.ReactNode } => {
31
- const gestureContext = useParentStore();
32
- const gestureConfig = useScreenGestureConfig();
33
31
  const currentScreenKey = useDescriptorsStore(
34
32
  (store) => store.derivations.currentScreenKey,
35
33
  );
34
+ const isTopMostScreen = useDescriptorsStore(
35
+ (store) => store.derivations.isTopMostScreen,
36
+ );
37
+ const gestureContext = useParentStore((parentContext) =>
38
+ isTopMostScreen ? parentContext : null,
39
+ );
40
+ const gestureConfig = useScreenGestureConfig(gestureContext);
36
41
 
37
42
  const scrollState = ScrollStore.getValue(
38
43
  currentScreenKey,
@@ -89,13 +94,19 @@ export const { ScreenGestureProvider, useScreenGestureStore: useGestureStore } =
89
94
  ],
90
95
  );
91
96
 
92
- useWalkUpAndRegisterShadowingClaims(
93
- gestureConfig.participation.claimedDirections,
97
+ const content = useMemo(
98
+ () => (
99
+ <Fragment>
100
+ <GestureOwnershipBridge />
101
+ {children}
102
+ </Fragment>
103
+ ),
104
+ [children],
94
105
  );
95
106
 
96
107
  return {
97
108
  value,
98
- children,
109
+ children: content,
99
110
  };
100
111
  },
101
112
  );
@@ -1,15 +1,22 @@
1
+ import { usePreventRemoveContext } from "@react-navigation/native";
1
2
  import { useMemo } from "react";
2
3
  import { useDescriptorsStore } from "../../descriptors";
3
- import { useGestureStore } from "../gestures.provider";
4
4
  import { resolveScreenGestureConfig } from "../shared/policy";
5
- import type { ScreenGestureConfig } from "../types";
5
+ import type { GestureContextType, ScreenGestureConfig } from "../types";
6
6
 
7
- export function useScreenGestureConfig(): ScreenGestureConfig {
8
- const gestureContext = useGestureStore();
7
+ export function useScreenGestureConfig(
8
+ gestureContext: GestureContextType | null,
9
+ ): ScreenGestureConfig {
9
10
  const options = useDescriptorsStore((store) => store.options);
10
11
  const isFirstKey = useDescriptorsStore(
11
12
  (store) => store.derivations.isFirstKey,
12
13
  );
14
+ const currentScreenKey = useDescriptorsStore(
15
+ (store) => store.derivations.currentScreenKey,
16
+ );
17
+ const { preventedRoutes } = usePreventRemoveContext();
18
+ const isRemovePrevented =
19
+ preventedRoutes[currentScreenKey]?.preventRemove === true;
13
20
 
14
21
  return useMemo(
15
22
  () =>
@@ -17,7 +24,8 @@ export function useScreenGestureConfig(): ScreenGestureConfig {
17
24
  options,
18
25
  isFirstKey,
19
26
  gestureContext,
27
+ isRemovePrevented,
20
28
  }),
21
- [isFirstKey, options, gestureContext],
29
+ [isFirstKey, options, gestureContext, isRemovePrevented],
22
30
  );
23
31
  }
@@ -30,9 +30,9 @@ const findShadowedDirections = (
30
30
  ) => {
31
31
  const shadowedDirections: Direction[] = [];
32
32
 
33
- for (const dir of DIRECTIONS) {
34
- if (claimedDirections[dir] && ancestorDirections[dir]) {
35
- shadowedDirections.push(dir);
33
+ for (const direction of DIRECTIONS) {
34
+ if (claimedDirections[direction] && ancestorDirections[direction]) {
35
+ shadowedDirections.push(direction);
36
36
  }
37
37
  }
38
38
 
@@ -70,8 +70,8 @@ const registerShadowingClaims = (
70
70
 
71
71
  for (const { ancestor, directions } of shadowedAncestors) {
72
72
  const newClaims = { ...ancestor.childDirectionClaims.get() };
73
- for (const dir of directions) {
74
- newClaims[dir] = { routeKey: currentScreenKey, isDismissing };
73
+ for (const direction of directions) {
74
+ newClaims[direction] = { routeKey: currentScreenKey, isDismissing };
75
75
  }
76
76
  ancestor.childDirectionClaims.set(newClaims);
77
77
  }
@@ -86,10 +86,9 @@ const clearShadowingClaims = (
86
86
  const newClaims = { ...currentClaims };
87
87
  let needsUpdate = false;
88
88
 
89
- for (const dir of directions) {
90
- // Only remove claims written by this screen; a newer descendant may own it now.
91
- if (currentClaims[dir]?.routeKey === currentScreenKey) {
92
- newClaims[dir] = null;
89
+ for (const direction of directions) {
90
+ if (currentClaims[direction]?.routeKey === currentScreenKey) {
91
+ newClaims[direction] = null;
93
92
  needsUpdate = true;
94
93
  }
95
94
  }
@@ -121,51 +120,32 @@ const getDescriptorClaimedDirections = (
121
120
  }).participation.claimedDirections;
122
121
  };
123
122
 
124
- /**
125
- * Registers this screen with ancestors that claim the same direction.
126
- *
127
- * Example, when C is top-most:
128
- * A claims vertical
129
- * └─ B claims horizontal
130
- * └─ C claims vertical
131
- *
132
- * C walks up the tree and writes itself into A.childDirectionClaims.vertical.
133
- * B is skipped because it does not claim vertical.
134
- */
135
- export function useWalkUpAndRegisterShadowingClaims(
136
- claimedDirections: ClaimedDirections,
137
- ): void {
138
- const parentContext = useGestureStore();
123
+ const requireGestureContext = (
124
+ gestureContext: GestureContextType | null,
125
+ ): GestureContextType => {
126
+ if (!gestureContext) {
127
+ throw new Error(
128
+ "GestureOwnershipBridge must be rendered within a ScreenGestureProvider",
129
+ );
130
+ }
131
+
132
+ return gestureContext;
133
+ };
134
+
135
+ function ActiveGestureOwnershipBridge() {
136
+ const gestureContext = requireGestureContext(useGestureStore());
139
137
  const previous = useDescriptorsStore((store) => store.previous);
140
- const isTopMostScreen = useDescriptorsStore(
141
- (store) => store.derivations.isTopMostScreen,
142
- );
143
- const currentScreenKey = useDescriptorsStore(
144
- (store) => store.derivations.currentScreenKey,
145
- );
146
138
  const isCurrentScreenClosing = useBlankStackStore(
147
- (store) => store?.scenesByKey[currentScreenKey]?.activity === "closing",
139
+ (store) =>
140
+ store?.scenesByKey[gestureContext.routeKey]?.activity === "closing",
148
141
  );
149
-
150
- /*
151
- * We want to calculate effective claimed directions as claimedDirections is not enough for us.
152
- * What this solves is lingering claimed directions when a screen is closing.
153
- *
154
- * Overlay claims horizontal
155
- * └─ A has no local horizontal claim
156
- * └─ B claims horizontal (closing)
157
- * └─ C claims horizontal (closing)
158
- *
159
- * Closing screens are still mounted, so they can still block parent gestures.
160
- * But they cannot receive touches anymore.
161
- *
162
- * So when B/C are closing and the user is really touching A, B/C should not
163
- * keep blocking the parent with their own gesture config.
164
- *
165
- * A closing screen should act like the visible screen underneath it:
166
- * - if the screen underneath claims the gesture, keep blocking the parent
167
- * - if the screen underneath does not claim it, let the parent handle it
168
- */
142
+ const {
143
+ claimedDirections,
144
+ gestureContext: parentContext,
145
+ routeKey: currentScreenKey,
146
+ } = gestureContext;
147
+ // A retained closing screen cannot receive touches, so its ownership must
148
+ // mirror the visible screen underneath instead of blocking an ancestor.
169
149
  const effectiveClaimedDirections = useMemo(
170
150
  () =>
171
151
  resolveShadowingClaimDirections({
@@ -178,14 +158,13 @@ export function useWalkUpAndRegisterShadowingClaims(
178
158
  }),
179
159
  [isCurrentScreenClosing, claimedDirections, previous, parentContext],
180
160
  );
181
-
182
161
  const shadowedAncestors = useMemo(
183
162
  () => findShadowedAncestors(parentContext, effectiveClaimedDirections),
184
163
  [parentContext, effectiveClaimedDirections],
185
164
  );
186
165
 
187
166
  useLayoutEffect(() => {
188
- if (!isTopMostScreen || !shadowedAncestors.length) {
167
+ if (!shadowedAncestors.length) {
189
168
  return;
190
169
  }
191
170
 
@@ -194,5 +173,16 @@ export function useWalkUpAndRegisterShadowingClaims(
194
173
  return () => {
195
174
  clearShadowingClaims(shadowedAncestors, currentScreenKey);
196
175
  };
197
- }, [shadowedAncestors, currentScreenKey, isTopMostScreen]);
176
+ }, [shadowedAncestors, currentScreenKey]);
177
+
178
+ return null;
179
+ }
180
+
181
+ /** Keeps gesture ownership subscriptions attached only to participating screens. */
182
+ export function GestureOwnershipBridge() {
183
+ const isTopMostScreen = useDescriptorsStore(
184
+ (store) => store.derivations.isTopMostScreen,
185
+ );
186
+
187
+ return isTopMostScreen ? <ActiveGestureOwnershipBridge /> : null;
198
188
  }
@@ -89,7 +89,6 @@ export const trackPanGesture = (
89
89
  export const finalizePanRelease = (
90
90
  release: PanReleaseResult,
91
91
  runtime: PanGestureRuntime,
92
- dismissScreen: ((finished: boolean) => void) | undefined,
93
92
  dimensions: GestureDimensions,
94
93
  rawEvent: PanGestureEvent,
95
94
  requestDismiss?: () => void,
@@ -150,13 +149,8 @@ export const finalizePanRelease = (
150
149
  return;
151
150
  }
152
151
 
153
- if (plan.shouldDismiss && requestDismiss) {
154
- runOnJS(requestDismiss)();
155
- }
156
-
157
152
  animateToProgress({
158
153
  target: plan.target,
159
- onAnimationFinish: plan.shouldDismiss ? dismissScreen : undefined,
160
154
  spec: plan.transitionSpec,
161
155
  emitWillAnimate: false,
162
156
  markEntering: false,
@@ -165,4 +159,8 @@ export const finalizePanRelease = (
165
159
  animations,
166
160
  initialVelocity: plan.progressVelocity,
167
161
  });
162
+
163
+ if (plan.shouldDismiss && requestDismiss) {
164
+ runOnJS(requestDismiss)();
165
+ }
168
166
  };
@@ -31,7 +31,7 @@ export const usePanBehavior = (
31
31
  gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
32
32
  pendingDirection: SharedValue<Direction | null>,
33
33
  ): PanBehavior => {
34
- const { dismissScreen, requestDismiss } = useNavigationHelpers();
34
+ const { requestDismiss } = useNavigationHelpers();
35
35
  const { withSensitivity, resetSensitivity } =
36
36
  usePanGestureSensitivity(screenOptions);
37
37
 
@@ -109,7 +109,6 @@ export const usePanBehavior = (
109
109
  finalizePanRelease(
110
110
  release,
111
111
  latestRuntime,
112
- dismissScreen,
113
112
  dimensions,
114
113
  rawEvent,
115
114
  requestDismiss,
@@ -124,7 +123,6 @@ export const usePanBehavior = (
124
123
  runtime,
125
124
  screenOptions,
126
125
  dimensions,
127
- dismissScreen,
128
126
  requestDismiss,
129
127
  withSensitivity,
130
128
  gestureCompositionOwner,
@@ -61,7 +61,6 @@ export const trackPinchGesture = (
61
61
  export const finalizePinchRelease = (
62
62
  release: PinchReleaseResult,
63
63
  runtime: PinchGestureRuntime,
64
- dismissScreen: ((finished: boolean) => void) | undefined,
65
64
  requestDismiss?: () => void,
66
65
  ) => {
67
66
  "worklet";
@@ -91,10 +90,6 @@ export const finalizePinchRelease = (
91
90
  resetValuesImmediately: release.resetValuesImmediately,
92
91
  });
93
92
 
94
- if (release.shouldDismiss && requestDismiss) {
95
- runOnJS(requestDismiss)();
96
- }
97
-
98
93
  if (!release.shouldDismiss && progressAlreadyAtTarget) {
99
94
  system.targetProgress.set(release.target);
100
95
  return;
@@ -102,7 +97,6 @@ export const finalizePinchRelease = (
102
97
 
103
98
  animateToProgress({
104
99
  target: release.target,
105
- onAnimationFinish: release.shouldDismiss ? dismissScreen : undefined,
106
100
  spec: release.transitionSpec,
107
101
  emitWillAnimate: false,
108
102
  markEntering: false,
@@ -111,4 +105,8 @@ export const finalizePinchRelease = (
111
105
  animationProgress: system.animationProgress,
112
106
  initialVelocity: release.initialVelocity,
113
107
  });
108
+
109
+ if (release.shouldDismiss && requestDismiss) {
110
+ runOnJS(requestDismiss)();
111
+ }
114
112
  };
@@ -26,7 +26,7 @@ export const usePinchBehavior = (
26
26
  screenOptions: ScreenOptionsContextValue,
27
27
  gestureCompositionOwner: SharedValue<GestureCompositionOwner>,
28
28
  ): PinchBehavior => {
29
- const { dismissScreen, requestDismiss } = useNavigationHelpers();
29
+ const { requestDismiss } = useNavigationHelpers();
30
30
  const { withSensitivity, resetSensitivity } =
31
31
  usePinchGestureSensitivity(screenOptions);
32
32
 
@@ -68,18 +68,12 @@ export const usePinchBehavior = (
68
68
  .hasSnapPoints
69
69
  ? resolveSnapPinchRelease(event, latestRuntime)
70
70
  : resolvePinchRelease(event, latestRuntime);
71
- finalizePinchRelease(
72
- release,
73
- latestRuntime,
74
- dismissScreen,
75
- requestDismiss,
76
- );
71
+ finalizePinchRelease(release, latestRuntime, requestDismiss);
77
72
  gestureCompositionOwner.set(null);
78
73
  },
79
74
  [
80
75
  runtime,
81
76
  screenOptions,
82
- dismissScreen,
83
77
  requestDismiss,
84
78
  withSensitivity,
85
79
  gestureCompositionOwner,
@@ -306,15 +306,19 @@ const resolveGestureParticipation = ({
306
306
  options,
307
307
  isFirstKey,
308
308
  gestureContext,
309
+ isRemovePrevented,
309
310
  }: {
310
311
  options: GesturePolicyOptions;
311
312
  isFirstKey: boolean;
312
313
  gestureContext: GestureContextType | null;
314
+ isRemovePrevented: boolean;
313
315
  }): ScreenGestureParticipation => {
314
- const canDismiss = resolveGestureCanDismiss({
315
- isFirstKey,
316
- gestureEnabled: options.gestureEnabled,
317
- });
316
+ const canDismiss =
317
+ !isRemovePrevented &&
318
+ resolveGestureCanDismiss({
319
+ isFirstKey,
320
+ gestureEnabled: options.gestureEnabled,
321
+ });
318
322
  const effectiveSnapPoints = validateSnapPoints({
319
323
  snapPoints: options.snapPoints,
320
324
  canDismiss,
@@ -333,6 +337,7 @@ const resolveGestureParticipation = ({
333
337
 
334
338
  return {
335
339
  isFirstKey,
340
+ isRemovePrevented,
336
341
  canDismiss,
337
342
  canTrackGesture,
338
343
  effectiveSnapPoints,
@@ -345,15 +350,18 @@ export const resolveScreenGestureConfig = ({
345
350
  options,
346
351
  isFirstKey,
347
352
  gestureContext,
353
+ isRemovePrevented = false,
348
354
  }: {
349
355
  options: ScreenTransitionConfig;
350
356
  isFirstKey: boolean;
351
357
  gestureContext: GestureContextType | null;
358
+ isRemovePrevented?: boolean;
352
359
  }): ScreenGestureConfig => {
353
360
  const participation = resolveGestureParticipation({
354
361
  options,
355
362
  isFirstKey,
356
363
  gestureContext,
364
+ isRemovePrevented,
357
365
  });
358
366
  const hasSnapPoints = participation.effectiveSnapPoints.hasSnapPoints;
359
367
 
@@ -365,11 +373,14 @@ export const resolveScreenGestureConfig = ({
365
373
  };
366
374
 
367
375
  function resolveRuntimeCanDismiss(
368
- participation: Pick<ScreenGestureParticipation, "isFirstKey" | "canDismiss">,
376
+ participation: Pick<
377
+ ScreenGestureParticipation,
378
+ "isFirstKey" | "isRemovePrevented" | "canDismiss"
379
+ >,
369
380
  options: GesturePolicyOptions,
370
381
  ) {
371
382
  "worklet";
372
- if (participation.isFirstKey) {
383
+ if (participation.isFirstKey || participation.isRemovePrevented) {
373
384
  return false;
374
385
  }
375
386
 
@@ -85,6 +85,8 @@ export interface GestureContextType {
85
85
  export interface ScreenGestureParticipation {
86
86
  /** Whether this route is the first route in its stack. First routes never track gestures. */
87
87
  isFirstKey: boolean;
88
+ /** Whether React Navigation currently blocks removal of this route. */
89
+ isRemovePrevented: boolean;
88
90
  /** Whether this route can dismiss to progress 0 from a gesture release. */
89
91
  canDismiss: boolean;
90
92
  /** Whether recognizers can activate to expose gesture values to interpolators. */
@@ -65,6 +65,7 @@ export const PROP_RESET_VALUES: Record<string, unknown> = {
65
65
  };
66
66
 
67
67
  const RESERVED_STYLE_SLOT_IDS = {
68
+ overlay: true,
68
69
  content: true,
69
70
  backdrop: true,
70
71
  surface: true,