react-native-screen-transitions 4.0.0-alpha.6 → 4.0.0-alpha.7

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 (266) hide show
  1. package/lib/commonjs/components/boundary/components/boundary-lifecycle.js +36 -0
  2. package/lib/commonjs/components/boundary/components/boundary-lifecycle.js.map +1 -0
  3. package/lib/commonjs/components/boundary/components/boundary-target.js +1 -0
  4. package/lib/commonjs/components/boundary/components/boundary-target.js.map +1 -1
  5. package/lib/commonjs/components/boundary/create-boundary-component.js +1 -0
  6. package/lib/commonjs/components/boundary/create-boundary-component.js.map +1 -1
  7. package/lib/commonjs/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
  8. package/lib/commonjs/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  9. package/lib/commonjs/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
  10. package/lib/commonjs/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
  11. package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js +3 -2
  12. package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  13. package/lib/commonjs/components/boundary/hooks/use-measurer.js +9 -2
  14. package/lib/commonjs/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
  16. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  17. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +25 -43
  18. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  19. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +13 -0
  20. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
  21. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -31
  22. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
  23. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +14 -19
  24. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  25. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -1
  26. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  27. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +19 -48
  28. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
  29. package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js +6 -2
  30. package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  31. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
  32. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
  33. package/lib/commonjs/components/boundary/providers/boundary-root.provider.js +19 -17
  34. package/lib/commonjs/components/boundary/providers/boundary-root.provider.js.map +1 -1
  35. package/lib/commonjs/components/boundary/utils/refresh-signals.js +19 -5
  36. package/lib/commonjs/components/boundary/utils/refresh-signals.js.map +1 -1
  37. package/lib/commonjs/components/screen-container/layers/backdrop.js +11 -7
  38. package/lib/commonjs/components/screen-container/layers/backdrop.js.map +1 -1
  39. package/lib/commonjs/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +32 -0
  40. package/lib/commonjs/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
  41. package/lib/commonjs/components/screen-lifecycle/hooks/use-close-completion.js +27 -0
  42. package/lib/commonjs/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
  43. package/lib/commonjs/components/screen-lifecycle/hooks/use-close-transition-intent.js +61 -86
  44. package/lib/commonjs/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  45. package/lib/commonjs/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
  46. package/lib/commonjs/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  47. package/lib/commonjs/components/screen-lifecycle/index.js +9 -6
  48. package/lib/commonjs/components/screen-lifecycle/index.js.map +1 -1
  49. package/lib/commonjs/hooks/navigation/use-navigation-helpers.js +30 -13
  50. package/lib/commonjs/hooks/navigation/use-navigation-helpers.js.map +1 -1
  51. package/lib/commonjs/providers/helpers/measured-bounds-writes.js +1 -2
  52. package/lib/commonjs/providers/helpers/measured-bounds-writes.js.map +1 -1
  53. package/lib/commonjs/providers/screen/gestures/hooks/use-screen-gesture-config.js +9 -2
  54. package/lib/commonjs/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  55. package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
  56. package/lib/commonjs/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  57. package/lib/commonjs/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
  58. package/lib/commonjs/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  59. package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
  60. package/lib/commonjs/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  61. package/lib/commonjs/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
  62. package/lib/commonjs/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  63. package/lib/commonjs/providers/screen/gestures/shared/policy.js +9 -5
  64. package/lib/commonjs/providers/screen/gestures/shared/policy.js.map +1 -1
  65. package/lib/commonjs/providers/stack/blank-stack-state/blank-stack-controller.js +7 -9
  66. package/lib/commonjs/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
  67. package/lib/commonjs/stores/bounds/internals/links.js +1 -1
  68. package/lib/commonjs/stores/bounds/internals/links.js.map +1 -1
  69. package/lib/commonjs/stores/system.store.js +1 -2
  70. package/lib/commonjs/stores/system.store.js.map +1 -1
  71. package/lib/commonjs/utils/animation/animate-to-progress.js +0 -22
  72. package/lib/commonjs/utils/animation/animate-to-progress.js.map +1 -1
  73. package/lib/commonjs/utils/navigation/close-action-replay.js +22 -0
  74. package/lib/commonjs/utils/navigation/close-action-replay.js.map +1 -0
  75. package/lib/module/components/boundary/components/boundary-lifecycle.js +32 -0
  76. package/lib/module/components/boundary/components/boundary-lifecycle.js.map +1 -0
  77. package/lib/module/components/boundary/components/boundary-target.js +1 -0
  78. package/lib/module/components/boundary/components/boundary-target.js.map +1 -1
  79. package/lib/module/components/boundary/create-boundary-component.js +1 -0
  80. package/lib/module/components/boundary/create-boundary-component.js.map +1 -1
  81. package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +1 -13
  82. package/lib/module/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  83. package/lib/module/components/boundary/hooks/lifecycles/use-refresh-boundary.js +9 -2
  84. package/lib/module/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -1
  85. package/lib/module/components/boundary/hooks/use-boundary-measurement.js +3 -2
  86. package/lib/module/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  87. package/lib/module/components/boundary/hooks/use-measurer.js +9 -2
  88. package/lib/module/components/boundary/hooks/use-measurer.js.map +1 -1
  89. package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js +5 -12
  90. package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
  91. package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +27 -45
  92. package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
  93. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +8 -0
  94. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +1 -0
  95. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js +8 -32
  96. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -1
  97. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +15 -20
  98. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +1 -1
  99. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +3 -1
  100. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  101. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +19 -48
  102. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -1
  103. package/lib/module/components/boundary/portal/components/boundary-portal/index.js +6 -2
  104. package/lib/module/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
  105. package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js +1 -1
  106. package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -1
  107. package/lib/module/components/boundary/providers/boundary-root.provider.js +20 -18
  108. package/lib/module/components/boundary/providers/boundary-root.provider.js.map +1 -1
  109. package/lib/module/components/boundary/utils/refresh-signals.js +19 -5
  110. package/lib/module/components/boundary/utils/refresh-signals.js.map +1 -1
  111. package/lib/module/components/screen-container/layers/backdrop.js +12 -8
  112. package/lib/module/components/screen-container/layers/backdrop.js.map +1 -1
  113. package/lib/module/components/screen-lifecycle/hooks/helpers/close-interception-rules.js +26 -0
  114. package/lib/module/components/screen-lifecycle/hooks/helpers/close-interception-rules.js.map +1 -0
  115. package/lib/module/components/screen-lifecycle/hooks/use-close-completion.js +22 -0
  116. package/lib/module/components/screen-lifecycle/hooks/use-close-completion.js.map +1 -0
  117. package/lib/module/components/screen-lifecycle/hooks/use-close-transition-intent.js +61 -85
  118. package/lib/module/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  119. package/lib/module/components/screen-lifecycle/hooks/use-transition-start-controller.js +1 -5
  120. package/lib/module/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -1
  121. package/lib/module/components/screen-lifecycle/index.js +9 -6
  122. package/lib/module/components/screen-lifecycle/index.js.map +1 -1
  123. package/lib/module/hooks/navigation/use-navigation-helpers.js +30 -13
  124. package/lib/module/hooks/navigation/use-navigation-helpers.js.map +1 -1
  125. package/lib/module/providers/helpers/measured-bounds-writes.js +1 -2
  126. package/lib/module/providers/helpers/measured-bounds-writes.js.map +1 -1
  127. package/lib/module/providers/screen/gestures/hooks/use-screen-gesture-config.js +9 -2
  128. package/lib/module/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  129. package/lib/module/providers/screen/gestures/pan/behavior/pan-lifecycle.js +4 -5
  130. package/lib/module/providers/screen/gestures/pan/behavior/pan-lifecycle.js.map +1 -1
  131. package/lib/module/providers/screen/gestures/pan/behavior/use-pan-behavior.js +2 -3
  132. package/lib/module/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  133. package/lib/module/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -5
  134. package/lib/module/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  135. package/lib/module/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -3
  136. package/lib/module/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  137. package/lib/module/providers/screen/gestures/shared/policy.js +9 -5
  138. package/lib/module/providers/screen/gestures/shared/policy.js.map +1 -1
  139. package/lib/module/providers/stack/blank-stack-state/blank-stack-controller.js +7 -9
  140. package/lib/module/providers/stack/blank-stack-state/blank-stack-controller.js.map +1 -1
  141. package/lib/module/stores/bounds/internals/links.js +1 -1
  142. package/lib/module/stores/bounds/internals/links.js.map +1 -1
  143. package/lib/module/stores/system.store.js +1 -2
  144. package/lib/module/stores/system.store.js.map +1 -1
  145. package/lib/module/utils/animation/animate-to-progress.js +0 -22
  146. package/lib/module/utils/animation/animate-to-progress.js.map +1 -1
  147. package/lib/module/utils/navigation/close-action-replay.js +16 -0
  148. package/lib/module/utils/navigation/close-action-replay.js.map +1 -0
  149. package/lib/typescript/components/boundary/components/boundary-lifecycle.d.ts +18 -0
  150. package/lib/typescript/components/boundary/components/boundary-lifecycle.d.ts.map +1 -0
  151. package/lib/typescript/components/boundary/components/boundary-target.d.ts.map +1 -1
  152. package/lib/typescript/components/boundary/create-boundary-component.d.ts.map +1 -1
  153. package/lib/typescript/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +1 -2
  154. package/lib/typescript/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  155. package/lib/typescript/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -1
  156. package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts +3 -2
  157. package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  158. package/lib/typescript/components/boundary/hooks/use-measurer.d.ts +3 -2
  159. package/lib/typescript/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  160. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
  161. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts +5 -1
  162. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
  163. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +4 -0
  164. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +1 -0
  165. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts +4 -17
  166. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -1
  167. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +3 -1
  168. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -1
  169. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +3 -1
  170. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  171. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts +5 -9
  172. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -1
  173. package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts +3 -1
  174. package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
  175. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts +2 -1
  176. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  177. package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts +2 -1
  178. package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  179. package/lib/typescript/components/boundary/types.d.ts +6 -0
  180. package/lib/typescript/components/boundary/types.d.ts.map +1 -1
  181. package/lib/typescript/components/boundary/utils/refresh-signals.d.ts +1 -0
  182. package/lib/typescript/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  183. package/lib/typescript/components/screen-container/layers/backdrop.d.ts.map +1 -1
  184. package/lib/typescript/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts +28 -0
  185. package/lib/typescript/components/screen-lifecycle/hooks/helpers/close-interception-rules.d.ts.map +1 -0
  186. package/lib/typescript/components/screen-lifecycle/hooks/use-close-completion.d.ts +7 -0
  187. package/lib/typescript/components/screen-lifecycle/hooks/use-close-completion.d.ts.map +1 -0
  188. package/lib/typescript/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +2 -7
  189. package/lib/typescript/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
  190. package/lib/typescript/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +1 -3
  191. package/lib/typescript/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -1
  192. package/lib/typescript/components/screen-lifecycle/index.d.ts.map +1 -1
  193. package/lib/typescript/hooks/navigation/use-navigation-helpers.d.ts +1 -0
  194. package/lib/typescript/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
  195. package/lib/typescript/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
  196. package/lib/typescript/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts +1 -1
  197. package/lib/typescript/providers/screen/gestures/pan/behavior/pan-lifecycle.d.ts.map +1 -1
  198. package/lib/typescript/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  199. package/lib/typescript/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  200. package/lib/typescript/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  201. package/lib/typescript/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  202. package/lib/typescript/providers/screen/gestures/shared/policy.d.ts +2 -1
  203. package/lib/typescript/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  204. package/lib/typescript/providers/screen/gestures/types.d.ts +2 -0
  205. package/lib/typescript/providers/screen/gestures/types.d.ts.map +1 -1
  206. package/lib/typescript/providers/stack/blank-stack-state/blank-stack-controller.d.ts.map +1 -1
  207. package/lib/typescript/stores/system.store.d.ts +1 -2
  208. package/lib/typescript/stores/system.store.d.ts.map +1 -1
  209. package/lib/typescript/utils/animation/animate-to-progress.d.ts +1 -2
  210. package/lib/typescript/utils/animation/animate-to-progress.d.ts.map +1 -1
  211. package/lib/typescript/utils/navigation/close-action-replay.d.ts +4 -0
  212. package/lib/typescript/utils/navigation/close-action-replay.d.ts.map +1 -0
  213. package/package.json +1 -1
  214. package/src/components/boundary/components/boundary-lifecycle.tsx +53 -0
  215. package/src/components/boundary/components/boundary-target.tsx +1 -0
  216. package/src/components/boundary/create-boundary-component.tsx +1 -0
  217. package/src/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +0 -14
  218. package/src/components/boundary/hooks/lifecycles/use-refresh-boundary.ts +13 -2
  219. package/src/components/boundary/hooks/use-boundary-measurement.ts +7 -2
  220. package/src/components/boundary/hooks/use-measurer.ts +11 -1
  221. package/src/components/boundary/portal/components/boundary-portal/components/host.tsx +13 -11
  222. package/src/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +44 -55
  223. package/src/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +10 -0
  224. package/src/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts +11 -55
  225. package/src/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +20 -24
  226. package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +6 -0
  227. package/src/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +20 -68
  228. package/src/components/boundary/portal/components/boundary-portal/index.tsx +19 -3
  229. package/src/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts +3 -2
  230. package/src/components/boundary/providers/boundary-root.provider.tsx +29 -20
  231. package/src/components/boundary/types.ts +9 -0
  232. package/src/components/boundary/utils/refresh-signals.ts +39 -6
  233. package/src/components/screen-container/layers/backdrop.tsx +11 -7
  234. package/src/components/screen-lifecycle/hooks/helpers/close-interception-rules.ts +66 -0
  235. package/src/components/screen-lifecycle/hooks/use-close-completion.ts +25 -0
  236. package/src/components/screen-lifecycle/hooks/use-close-transition-intent.ts +68 -108
  237. package/src/components/screen-lifecycle/hooks/use-transition-start-controller.ts +0 -12
  238. package/src/components/screen-lifecycle/index.tsx +8 -4
  239. package/src/hooks/navigation/use-navigation-helpers.ts +40 -12
  240. package/src/providers/helpers/measured-bounds-writes.ts +1 -1
  241. package/src/providers/screen/gestures/hooks/use-screen-gesture-config.ts +9 -1
  242. package/src/providers/screen/gestures/pan/behavior/pan-lifecycle.ts +4 -6
  243. package/src/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +1 -3
  244. package/src/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +4 -6
  245. package/src/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +2 -8
  246. package/src/providers/screen/gestures/shared/policy.ts +17 -6
  247. package/src/providers/screen/gestures/types.ts +2 -0
  248. package/src/providers/stack/blank-stack-state/blank-stack-controller.ts +7 -7
  249. package/src/stores/bounds/internals/links.ts +1 -1
  250. package/src/stores/system.store.ts +1 -2
  251. package/src/utils/animation/animate-to-progress.ts +0 -23
  252. package/src/utils/navigation/close-action-replay.ts +25 -0
  253. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -30
  254. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
  255. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -47
  256. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
  257. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/active-pair.js +0 -25
  258. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/active-pair.js.map +0 -1
  259. package/lib/module/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js +0 -40
  260. package/lib/module/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +0 -1
  261. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts +0 -9
  262. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/active-pair.d.ts.map +0 -1
  263. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts +0 -9
  264. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +0 -1
  265. package/src/components/boundary/portal/components/boundary-portal/helpers/active-pair.ts +0 -36
  266. package/src/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.ts +0 -45
@@ -1,6 +1,7 @@
1
- /** biome-ignore-all lint/correctness/useHookAtTopLevel: STACK_TYPE is stable per navigator */
2
1
  import { useLayoutEffect, useMemo, useRef } from "react";
2
+ import { useNavigationHelpers } from "../../../hooks/navigation/use-navigation-helpers";
3
3
  import useStableCallback from "../../../hooks/use-stable-callback";
4
+ import { hasTransitionsEnabled } from "../../../providers/screen/animation/helpers/has-transitions-enabled";
4
5
  import {
5
6
  type BaseDescriptor,
6
7
  useDescriptorsStore,
@@ -8,68 +9,34 @@ import {
8
9
  import { useBlankStackStore } from "../../../providers/stack/blank-stack.provider";
9
10
  import { useStackCoreStore } from "../../../providers/stack/core.provider";
10
11
  import { GestureStore } from "../../../stores/gesture.store";
11
- import {
12
- LifecycleTransitionRequestKind,
13
- type SystemStoreActions,
14
- type SystemStoreMap,
15
- } from "../../../stores/system.store";
16
12
  import { StackType } from "../../../types/stack.types";
13
+ import {
14
+ dispatchCloseAction,
15
+ isCloseActionReplay,
16
+ } from "../../../utils/navigation/close-action-replay";
17
+ import {
18
+ doesNavigatorOwnCloseAction,
19
+ shouldInterceptClose,
20
+ } from "./helpers/close-interception-rules";
17
21
  import { resetStoresForScreen } from "./helpers/reset-stores-for-screen";
18
22
 
19
- interface CloseHookParams {
20
- current: BaseDescriptor;
21
- requestLifecycleTransition: SystemStoreActions["requestLifecycleTransition"];
22
- resetStores: () => void;
23
- }
24
-
25
- const useBlankStackClose = ({
26
- current,
27
- requestLifecycleTransition,
28
- resetStores,
29
- }: CloseHookParams) => {
23
+ export function useCloseTransitionIntent(current: BaseDescriptor): {
24
+ completeClose: () => void;
25
+ } {
26
+ const routeKey = current.route.key;
27
+ const { STACK_TYPE: stackType, TRANSITIONS_ALWAYS_ON: transitionsAlwaysOn } =
28
+ useStackCoreStore((store) => store.flags);
30
29
  const handleCloseRoute = useBlankStackStore(
31
30
  (store) => store?.handleCloseRoute,
32
31
  );
33
- const isClosing = useBlankStackStore(
34
- (store) => store?.scenesByKey[current.route.key]?.activity === "closing",
32
+ const isBlankStackClosing = useBlankStackStore(
33
+ (store) => store?.scenesByKey[routeKey]?.activity === "closing",
35
34
  );
36
-
37
- useLayoutEffect(() => {
38
- if (!isClosing) {
39
- return;
40
- }
41
-
42
- requestLifecycleTransition(
43
- LifecycleTransitionRequestKind.BlankStackClose,
44
- 0,
45
- );
46
- }, [isClosing, requestLifecycleTransition]);
47
-
48
- const handleBlankStackCloseEnd = useStableCallback((finished: boolean) => {
49
- if (!finished) return;
50
- if (!handleCloseRoute) {
51
- throw new Error("Blank stack close handler was not found.");
52
- }
53
- handleCloseRoute({ route: current.route });
54
- requestAnimationFrame(() => {
55
- resetStores();
56
- });
57
- });
58
-
59
- return { handleBlankStackCloseEnd };
60
- };
61
-
62
- /**
63
- * Native stack close - listens to beforeRemove navigation event.
64
- */
65
- const useNativeStackClose = ({
66
- current,
67
- requestLifecycleTransition,
68
- resetStores,
69
- }: CloseHookParams) => {
70
- const parentScreenKey = useDescriptorsStore(
71
- (store) => store.derivations.parentScreenKey,
35
+ const ancestorKeys = useDescriptorsStore(
36
+ (store) => store.derivations.ancestorKeys,
72
37
  );
38
+ const parentScreenKey = ancestorKeys[0];
39
+ const { dismissScreen, requestDismiss } = useNavigationHelpers();
73
40
  const pendingActionRef = useRef<any>(null);
74
41
 
75
42
  const nearestAncestorDismissing = useMemo(() => {
@@ -78,38 +45,63 @@ const useNativeStackClose = ({
78
45
  return GestureStore.peekBag(parentScreenKey)?.dismissing ?? null;
79
46
  }, [parentScreenKey]);
80
47
 
81
- const handleNativeCloseEnd = useStableCallback((finished: boolean) => {
82
- if (!finished || !pendingActionRef.current) {
83
- pendingActionRef.current = null;
84
- return;
48
+ useLayoutEffect(() => {
49
+ if (isBlankStackClosing) {
50
+ requestDismiss();
85
51
  }
52
+ }, [isBlankStackClosing, requestDismiss]);
86
53
 
87
- current.navigation.dispatch(pendingActionRef.current);
54
+ const completeClose = useStableCallback(() => {
55
+ const pendingAction = pendingActionRef.current;
88
56
  pendingActionRef.current = null;
89
- requestAnimationFrame(() => {
90
- resetStores();
91
- });
57
+
58
+ if (pendingAction) {
59
+ dispatchCloseAction(pendingAction, (action) => {
60
+ current.navigation.dispatch(action);
61
+ });
62
+ } else if (stackType !== StackType.NATIVE && handleCloseRoute) {
63
+ handleCloseRoute({ route: current.route });
64
+ } else {
65
+ dismissScreen();
66
+ }
67
+
68
+ resetStoresForScreen(routeKey);
92
69
  });
93
70
 
94
- const handleBeforeRemove = useStableCallback((e: any) => {
95
- const options = current.options as { enableTransitions?: boolean };
96
- const isEnabled = options.enableTransitions;
97
- const navigation = current.navigation;
98
- const routeKey = current.route.key;
99
- const state = navigation.getState();
71
+ const handleBeforeRemove = useStableCallback((event: any) => {
72
+ if (isCloseActionReplay(event.data.action)) {
73
+ return;
74
+ }
75
+
76
+ const state = current.navigation.getState();
100
77
  const routeIndex = state.routes.findIndex(
101
78
  (route) => route.key === routeKey,
102
79
  );
103
- const isFirstScreen = routeIndex <= 0;
80
+ const action = event.data.action;
81
+ const ownsAction = doesNavigatorOwnCloseAction({
82
+ state,
83
+ action,
84
+ isNested: ancestorKeys.length > 0,
85
+ });
86
+ const shouldIntercept = shouldInterceptClose({
87
+ enabled: hasTransitionsEnabled(current.options, transitionsAlwaysOn),
88
+ ownsAction,
89
+ ancestorDismissing: !!nearestAncestorDismissing?.get(),
90
+ routeIndex,
91
+ focusedIndex: state.index,
92
+ });
93
+
94
+ if (!shouldIntercept) {
95
+ return;
96
+ }
104
97
 
105
- if (!isEnabled || nearestAncestorDismissing?.get() || isFirstScreen) {
106
- resetStores();
98
+ pendingActionRef.current ??= event.data.action;
99
+ if (!requestDismiss()) {
100
+ pendingActionRef.current = null;
107
101
  return;
108
102
  }
109
103
 
110
- e.preventDefault();
111
- pendingActionRef.current = e.data.action;
112
- requestLifecycleTransition(LifecycleTransitionRequestKind.NativeClose, 0);
104
+ event.preventDefault();
113
105
  });
114
106
 
115
107
  // biome-ignore lint/correctness/useExhaustiveDependencies: navigation listener should only rebind when the navigator instance changes
@@ -117,37 +109,5 @@ const useNativeStackClose = ({
117
109
  return current.navigation.addListener?.("beforeRemove", handleBeforeRemove);
118
110
  }, [current.navigation]);
119
111
 
120
- return { handleNativeCloseEnd };
121
- };
122
-
123
- /**
124
- * Handles close transition intent and returns finish callbacks for cleanup.
125
- */
126
- export function useCloseTransitionIntent(
127
- current: BaseDescriptor,
128
- system: SystemStoreMap,
129
- ): {
130
- handleBlankStackCloseEnd?: (finished: boolean) => void;
131
- handleNativeCloseEnd?: (finished: boolean) => void;
132
- } {
133
- const routeKey = current.route.key;
134
- const stackType = useStackCoreStore((store) => store.flags.STACK_TYPE);
135
- const isNativeStack = stackType === StackType.NATIVE;
136
- const { requestLifecycleTransition } = system.actions;
137
-
138
- const resetStores = useStableCallback(() => {
139
- resetStoresForScreen(routeKey);
140
- });
141
-
142
- const closeParams: CloseHookParams = {
143
- current,
144
- requestLifecycleTransition,
145
- resetStores,
146
- };
147
-
148
- if (isNativeStack) {
149
- return useNativeStackClose(closeParams);
150
- }
151
-
152
- return useBlankStackClose(closeParams);
112
+ return { completeClose };
153
113
  }
@@ -12,14 +12,10 @@ export const useTransitionStartController = ({
12
12
  current,
13
13
  animations,
14
14
  system,
15
- onBlankStackCloseFinish,
16
- onNativeCloseFinish,
17
15
  }: {
18
16
  current: BaseDescriptor;
19
17
  animations: AnimationStoreMap;
20
18
  system: SystemStoreMap;
21
- onBlankStackCloseFinish?: (finished: boolean) => void;
22
- onNativeCloseFinish?: (finished: boolean) => void;
23
19
  }) => {
24
20
  const {
25
21
  targetProgress,
@@ -53,13 +49,6 @@ export const useTransitionStartController = ({
53
49
  return;
54
50
  }
55
51
 
56
- const onAnimationFinish =
57
- kind === LifecycleTransitionRequestKind.BlankStackClose
58
- ? onBlankStackCloseFinish
59
- : kind === LifecycleTransitionRequestKind.NativeClose
60
- ? onNativeCloseFinish
61
- : undefined;
62
-
63
52
  animateToProgress({
64
53
  target,
65
54
  spec: transitionSpec,
@@ -69,7 +58,6 @@ export const useTransitionStartController = ({
69
58
  animations,
70
59
  targetProgress,
71
60
  animationProgress,
72
- onAnimationFinish,
73
61
  isDragging,
74
62
  });
75
63
 
@@ -2,6 +2,7 @@ import { useDescriptorsStore } from "../../providers/screen/descriptors";
2
2
  import { AnimationStore } from "../../stores/animation.store";
3
3
  import { SystemStore } from "../../stores/system.store";
4
4
  import { useScreenHistory } from "./hooks/history/use-screen-history";
5
+ import { useCloseCompletion } from "./hooks/use-close-completion";
5
6
  import { useCloseTransitionIntent } from "./hooks/use-close-transition-intent";
6
7
  import { useOpenTransitionIntent } from "./hooks/use-open-transition-intent";
7
8
  import { useTransitionStartController } from "./hooks/use-transition-start-controller";
@@ -21,8 +22,7 @@ export const ScreenLifecycle = ({ children }: Props) => {
21
22
  const animations = AnimationStore.getBag(current.route.key);
22
23
  const system = SystemStore.getBag(current.route.key);
23
24
 
24
- const { handleBlankStackCloseEnd, handleNativeCloseEnd } =
25
- useCloseTransitionIntent(current, system);
25
+ const { completeClose } = useCloseTransitionIntent(current);
26
26
 
27
27
  useOpenTransitionIntent(current, animations, system);
28
28
 
@@ -30,8 +30,12 @@ export const ScreenLifecycle = ({ children }: Props) => {
30
30
  current,
31
31
  animations,
32
32
  system,
33
- onBlankStackCloseFinish: handleBlankStackCloseEnd,
34
- onNativeCloseFinish: handleNativeCloseEnd,
33
+ });
34
+
35
+ useCloseCompletion({
36
+ closing: animations.closing,
37
+ animationProgress: system.animationProgress,
38
+ onComplete: completeClose,
35
39
  });
36
40
 
37
41
  useScreenHistory(current, previous, animations);
@@ -1,20 +1,23 @@
1
+ import {
2
+ StackActions,
3
+ usePreventRemoveContext,
4
+ } from "@react-navigation/native";
1
5
  import { useCallback } from "react";
2
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";
3
13
  import { useStack } from "./use-stack";
4
14
 
5
- const createPopAction = () => ({
6
- type: "POP",
7
- payload: { count: 1 },
8
- });
9
-
10
15
  export function useNavigationHelpers() {
11
16
  const route = useDescriptorsStore((store) => store.current.route);
12
17
  const navigation = useDescriptorsStore((store) => store.current.navigation);
13
18
  const requestStackDismiss = useStack((stack) => stack.requestDismiss);
14
-
15
- const requestDismiss = useCallback((): boolean => {
16
- return requestStackDismiss?.({ route }) ?? false;
17
- }, [route, requestStackDismiss]);
19
+ const { preventedRoutes } = usePreventRemoveContext();
20
+ const isRemovePrevented = preventedRoutes[route.key]?.preventRemove === true;
18
21
 
19
22
  const dismissScreen = useCallback((): boolean => {
20
23
  const state = navigation.getState();
@@ -24,13 +27,38 @@ export function useNavigationHelpers() {
24
27
  const routeStillPresent = routeIndex !== -1;
25
28
  if (!routeStillPresent || routeIndex === 0) return false;
26
29
 
27
- navigation.dispatch({
28
- ...createPopAction(),
30
+ const action = {
31
+ ...StackActions.pop(),
29
32
  source: route.key,
30
33
  target: state.key,
34
+ };
35
+ dispatchCloseAction(action, (closeAction) => {
36
+ navigation.dispatch(closeAction);
31
37
  });
32
38
  return true;
33
39
  }, [navigation, route.key]);
34
40
 
35
- 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 };
36
64
  }
@@ -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
  };
@@ -1,3 +1,4 @@
1
+ import { usePreventRemoveContext } from "@react-navigation/native";
1
2
  import { useMemo } from "react";
2
3
  import { useDescriptorsStore } from "../../descriptors";
3
4
  import { useGestureStore } from "../gestures.provider";
@@ -10,6 +11,12 @@ export function useScreenGestureConfig(): ScreenGestureConfig {
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
  }
@@ -90,7 +90,6 @@ export const trackPanGesture = (
90
90
  export const finalizePanRelease = (
91
91
  release: PanReleaseResult,
92
92
  runtime: PanGestureRuntime,
93
- dismissScreen: ((finished: boolean) => void) | undefined,
94
93
  dimensions: GestureDimensions,
95
94
  rawEvent: PanGestureEvent,
96
95
  requestDismiss?: () => void,
@@ -151,13 +150,8 @@ export const finalizePanRelease = (
151
150
  return;
152
151
  }
153
152
 
154
- if (plan.shouldDismiss && requestDismiss) {
155
- scheduleOnRN(requestDismiss);
156
- }
157
-
158
153
  animateToProgress({
159
154
  target: plan.target,
160
- onAnimationFinish: plan.shouldDismiss ? dismissScreen : undefined,
161
155
  spec: plan.transitionSpec,
162
156
  emitWillAnimate: false,
163
157
  markEntering: false,
@@ -166,4 +160,8 @@ export const finalizePanRelease = (
166
160
  animations,
167
161
  initialVelocity: plan.progressVelocity,
168
162
  });
163
+
164
+ if (plan.shouldDismiss && requestDismiss) {
165
+ scheduleOnRN(requestDismiss);
166
+ }
169
167
  };
@@ -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,
@@ -62,7 +62,6 @@ export const trackPinchGesture = (
62
62
  export const finalizePinchRelease = (
63
63
  release: PinchReleaseResult,
64
64
  runtime: PinchGestureRuntime,
65
- dismissScreen: ((finished: boolean) => void) | undefined,
66
65
  requestDismiss?: () => void,
67
66
  ) => {
68
67
  "worklet";
@@ -92,10 +91,6 @@ export const finalizePinchRelease = (
92
91
  resetValuesImmediately: release.resetValuesImmediately,
93
92
  });
94
93
 
95
- if (release.shouldDismiss && requestDismiss) {
96
- scheduleOnRN(requestDismiss);
97
- }
98
-
99
94
  if (!release.shouldDismiss && progressAlreadyAtTarget) {
100
95
  system.targetProgress.set(release.target);
101
96
  return;
@@ -103,7 +98,6 @@ export const finalizePinchRelease = (
103
98
 
104
99
  animateToProgress({
105
100
  target: release.target,
106
- onAnimationFinish: release.shouldDismiss ? dismissScreen : undefined,
107
101
  spec: release.transitionSpec,
108
102
  emitWillAnimate: false,
109
103
  markEntering: false,
@@ -112,4 +106,8 @@ export const finalizePinchRelease = (
112
106
  animationProgress: system.animationProgress,
113
107
  initialVelocity: release.initialVelocity,
114
108
  });
109
+
110
+ if (release.shouldDismiss && requestDismiss) {
111
+ scheduleOnRN(requestDismiss);
112
+ }
115
113
  };
@@ -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. */
@@ -1,9 +1,11 @@
1
+ import { StackActions } from "@react-navigation/native";
1
2
  import type { BlankStackProviderProps } from "../../../types/providers/blank-stack-provider.types";
2
3
  import type {
3
4
  BaseStackDescriptor,
4
5
  BaseStackNavigation,
5
6
  BaseStackRoute,
6
7
  } from "../../../types/stack.types";
8
+ import { dispatchCloseAction } from "../../../utils/navigation/close-action-replay";
7
9
  import { buildBlankStackState } from "./helpers/build-blank-stack-state";
8
10
  import { deriveBlankStackState } from "./helpers/derive-blank-stack-state";
9
11
  import type {
@@ -14,11 +16,6 @@ import type {
14
16
 
15
17
  export type { BlankStackController } from "./helpers/types";
16
18
 
17
- const createPopAction = () => ({
18
- type: "POP",
19
- payload: { count: 1 },
20
- });
21
-
22
19
  /**
23
20
  * Maintains the stack-local route snapshot used while blank stack transitions run.
24
21
  *
@@ -90,10 +87,13 @@ export const createBlankStackController = <
90
87
  const { state, navigation } = props;
91
88
 
92
89
  if (state.routes.some((candidate) => candidate.key === route.key)) {
93
- navigation.dispatch({
94
- ...createPopAction(),
90
+ const action = {
91
+ ...StackActions.pop(),
95
92
  source: route.key,
96
93
  target: state.key,
94
+ };
95
+ dispatchCloseAction(action, (closeAction) => {
96
+ navigation.dispatch(closeAction);
97
97
  });
98
98
  return;
99
99
  }
@@ -242,7 +242,7 @@ const writeDestination = (
242
242
 
243
243
  writePairLink(state, pairKey, linkKey, link);
244
244
 
245
- if (link.group) {
245
+ if (link.group && !state[pairKey]?.groups?.[link.group]) {
246
246
  writeGroup(state, pairKey, link.group, linkKey);
247
247
  }
248
248
  };
@@ -9,8 +9,7 @@ import { createStore } from "../utils/create-store";
9
9
  export enum LifecycleTransitionRequestKind {
10
10
  None = 0,
11
11
  Open = 1,
12
- BlankStackClose = 2,
13
- NativeClose = 3,
12
+ Close = 2,
14
13
  }
15
14
 
16
15
  type SystemStoreState = {