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
@@ -42,3 +42,29 @@ export const hasCloseTransitionFinished = ({
42
42
  "worklet";
43
43
  return !!closing && animationProgress === 0;
44
44
  };
45
+
46
+ export const isScreenInterpolatorReady = ({
47
+ hasInterpolator,
48
+ opening,
49
+ closing,
50
+ pendingLifecycleStartBlockCount,
51
+ animationProgress,
52
+ }: {
53
+ hasInterpolator: boolean;
54
+ opening: boolean;
55
+ closing: number;
56
+ pendingLifecycleStartBlockCount: number;
57
+ animationProgress: number;
58
+ }) => {
59
+ "worklet";
60
+
61
+ return (
62
+ hasInterpolator &&
63
+ !isOpenTransitionBlocked({
64
+ opening,
65
+ pendingLifecycleStartBlockCount,
66
+ animationProgress,
67
+ }) &&
68
+ !hasCloseTransitionFinished({ closing, animationProgress })
69
+ );
70
+ };
@@ -1,3 +1,4 @@
1
+ import { useRoute } from "@react-navigation/native";
1
2
  import { useMemo } from "react";
2
3
  import { useAnimatedProps, useAnimatedStyle } from "react-native-reanimated";
3
4
  import { NO_PROPS, NO_STYLES } from "../../../../constants";
@@ -7,8 +8,19 @@ import {
7
8
  } from "../helpers/compose-slot-style";
8
9
  import { useScreenSlots } from "../slot.provider";
9
10
 
11
+ const useCurrentScreenSlotsMap = () => {
12
+ const route = useRoute();
13
+ const slotsMap = useScreenSlots(route.key, (store) => store.slotsMap);
14
+
15
+ if (!slotsMap) {
16
+ throw new Error(`ScreenSlot store for route "${route.key}" was not found`);
17
+ }
18
+
19
+ return slotsMap;
20
+ };
21
+
10
22
  export const useSlotStyles = (slotId: string | undefined) => {
11
- const { slotsMap } = useScreenSlots();
23
+ const slotsMap = useCurrentScreenSlotsMap();
12
24
 
13
25
  return useAnimatedStyle(() => {
14
26
  const slot = slotId ? slotsMap.get()[slotId] : undefined;
@@ -26,7 +38,7 @@ export const useComposedSlotStyles = (
26
38
  slotId: string | undefined,
27
39
  style: unknown,
28
40
  ) => {
29
- const { slotsMap } = useScreenSlots();
41
+ const slotsMap = useCurrentScreenSlotsMap();
30
42
  const localTransform = useMemo(
31
43
  () => getLocalTransformForSlotComposition(style),
32
44
  [style],
@@ -50,7 +62,7 @@ export const useComposedSlotStyles = (
50
62
  * target takes the full associated style. Yields `NO_STYLES` when neither is set.
51
63
  */
52
64
  export const useSlotStackingStyles = (slotId: string | undefined) => {
53
- const { slotsMap } = useScreenSlots();
65
+ const slotsMap = useCurrentScreenSlotsMap();
54
66
 
55
67
  return useAnimatedStyle(() => {
56
68
  const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
@@ -66,7 +78,7 @@ export const useSlotStackingStyles = (slotId: string | undefined) => {
66
78
  };
67
79
 
68
80
  export const useSlotLayoutStyles = (slotId: string | undefined) => {
69
- const { slotsMap } = useScreenSlots();
81
+ const slotsMap = useCurrentScreenSlotsMap();
70
82
 
71
83
  return useAnimatedStyle(() => {
72
84
  const baseStyle = slotId ? slotsMap.get()[slotId]?.style : undefined;
@@ -103,7 +115,7 @@ export const useSlotLayoutStyles = (slotId: string | undefined) => {
103
115
  };
104
116
 
105
117
  export const useSlotProps = (slotId: string | undefined) => {
106
- const { slotsMap } = useScreenSlots();
118
+ const slotsMap = useCurrentScreenSlotsMap();
107
119
 
108
120
  return useAnimatedProps(() => {
109
121
  return (slotId ? slotsMap.get()[slotId]?.props : undefined) ?? NO_PROPS;
@@ -40,6 +40,7 @@ import { stripInterpolatorOptions } from "../helpers/strip-interpolator-options"
40
40
  import {
41
41
  hasCloseTransitionFinished,
42
42
  isOpenTransitionBlocked,
43
+ isScreenInterpolatorReady,
43
44
  } from "../helpers/transition-visual-state";
44
45
  import { resolveInitialDestinationStyleGate } from "../helpers/visibility-gate";
45
46
 
@@ -144,17 +145,59 @@ export const useInterpolatedStylesMap = ({
144
145
  (s) => s.derivations.destinationPairKey,
145
146
  );
146
147
  const screenOptions = useScreenOptionsStore();
147
- const {
148
+ const screenInterpolatorProps = useScreenAnimationStore(
149
+ (store) => store.screenInterpolatorProps,
150
+ );
151
+ const screenInterpolatorPropsRevision = useScreenAnimationStore(
152
+ (store) => store.screenInterpolatorPropsRevision,
153
+ );
154
+ const selectedInterpolatorOptions = useScreenAnimationStore(
155
+ (store) => store.selectedInterpolatorOptions,
156
+ );
157
+ const nextInterpolator = useScreenAnimationStore(
158
+ (store) => store.nextInterpolator,
159
+ );
160
+ const currentInterpolator = useScreenAnimationStore(
161
+ (store) => store.currentInterpolator,
162
+ );
163
+ const ancestorScreenAnimationSources = useScreenAnimationStore(
164
+ (store) => store.ancestorScreenAnimationSources,
165
+ );
166
+ const descendantScreenAnimationSources = useScreenAnimationStore(
167
+ (store) => store.descendantScreenAnimationSources,
168
+ );
169
+ const transition = useBuildTransitionAccessor({
148
170
  screenInterpolatorProps,
149
171
  screenInterpolatorPropsRevision,
150
- selectedInterpolatorOptions,
151
- nextInterpolator,
152
- currentInterpolator,
153
172
  ancestorScreenAnimationSources,
154
173
  descendantScreenAnimationSources,
155
- } = useScreenAnimationStore();
156
- const transition = useBuildTransitionAccessor();
157
- const nextInterpolatorReady = useSharedValue(0);
174
+ });
175
+ const hasCurrentInterpolator = !!currentInterpolator;
176
+ const { closing: currentClosing, entering: currentEntering } =
177
+ AnimationStore.getBag(currentScreenKey);
178
+ const {
179
+ animationProgress: currentAnimationProgress,
180
+ pendingLifecycleRequestKind: currentPendingLifecycleRequestKind,
181
+ pendingLifecycleStartBlockCount: currentPendingLifecycleStartBlockCount,
182
+ } = SystemStore.getBag(currentScreenKey);
183
+ const interpolatorReady = useDerivedValue<number>(() => {
184
+ "worklet";
185
+ const isPendingOpen =
186
+ currentPendingLifecycleRequestKind.get() ===
187
+ LifecycleTransitionRequestKind.Open;
188
+ const opening = isPendingOpen || !!currentEntering.get();
189
+
190
+ return isScreenInterpolatorReady({
191
+ hasInterpolator: hasCurrentInterpolator,
192
+ opening,
193
+ closing: currentClosing.get(),
194
+ pendingLifecycleStartBlockCount:
195
+ currentPendingLifecycleStartBlockCount.get(),
196
+ animationProgress: currentAnimationProgress.get(),
197
+ })
198
+ ? 1
199
+ : 0;
200
+ });
158
201
 
159
202
  // In some cases, a user may want to use external shared values to drive animations in the interpoaltor.
160
203
  // We can now support this by collecting those shared values and reading them here to trigger an update.
@@ -249,10 +292,6 @@ export const useInterpolatedStylesMap = ({
249
292
  !nextInterpolator ||
250
293
  isOpeningBlocked ||
251
294
  hasCloseFinished;
252
- const nextReady = currentOwnsInterpolator ? 0 : 1;
253
-
254
- nextInterpolatorReady.set(nextReady);
255
-
256
295
  const interpolatorOptionsOwner = currentOwnsInterpolator
257
296
  ? "current"
258
297
  : "next";
@@ -328,7 +367,7 @@ export const useInterpolatedStylesMap = ({
328
367
  });
329
368
 
330
369
  return {
370
+ interpolatorReady,
331
371
  localStylesMaps,
332
- nextInterpolatorReady,
333
372
  };
334
373
  };
@@ -1,4 +1,4 @@
1
- import { type ReactNode, useLayoutEffect, useMemo } from "react";
1
+ import { type ReactNode, useMemo } from "react";
2
2
  import { StyleSheet } from "react-native";
3
3
  import Animated, { type SharedValue } from "react-native-reanimated";
4
4
  import type {
@@ -8,22 +8,16 @@ import type {
8
8
  import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
9
9
  import createProvider from "../../../utils/create-provider";
10
10
  import { useDescriptorsStore } from "../descriptors";
11
- import { FloatingOverlayLayer } from "./components/floating-overlay-layer";
12
- import type { LocalStyleLayers } from "./helpers/resolve-slot-styles";
13
11
  import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
14
12
  import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
15
13
  import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
16
- import {
17
- registerScreenSlots,
18
- unregisterScreenSlots,
19
- } from "./stores/slot-references.store";
20
14
 
21
15
  type Props = {
22
16
  children: ReactNode;
23
- isFloatingOverlay?: boolean;
24
17
  };
25
18
 
26
19
  export type ScreenSlotName =
20
+ | "overlay"
27
21
  | "content"
28
22
  | "backdrop"
29
23
  | "surface"
@@ -31,8 +25,7 @@ export type ScreenSlotName =
31
25
  | typeof NAVIGATION_MASK_ELEMENT_STYLE_ID;
32
26
 
33
27
  export type ScreenSlotContextValue = {
34
- localStylesMaps: SharedValue<LocalStyleLayers>;
35
- nextInterpolatorReady: SharedValue<number>;
28
+ interpolatorReady: SharedValue<number>;
36
29
  slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
37
30
  visibilityBlocked: SharedValue<boolean>;
38
31
  };
@@ -40,69 +33,52 @@ export type ScreenSlotContextValue = {
40
33
  export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
41
34
  createProvider("ScreenSlot", {
42
35
  guarded: true,
43
- })<Props, ScreenSlotContextValue>(
44
- ({ children, isFloatingOverlay }, { useParentStore }) => {
45
- const parentContext = useParentStore();
46
- const currentScreenKey = useDescriptorsStore(
47
- (s) => s.derivations.currentScreenKey,
48
- );
36
+ global: true,
37
+ })<Props, ScreenSlotContextValue>(({ children }, { useParentStore }) => {
38
+ const ancestorStylesMap = useParentStore(
39
+ (parentContext) => parentContext?.slotsMap,
40
+ );
41
+ const currentScreenKey = useDescriptorsStore(
42
+ (store) => store.derivations.currentScreenKey,
43
+ );
44
+ const { animatedStyle, animatedProps, shouldBlockVisibility } =
45
+ useMaybeBlockVisibility();
49
46
 
50
- const { animatedStyle, animatedProps, shouldBlockVisibility } =
51
- useMaybeBlockVisibility(isFloatingOverlay);
47
+ const { interpolatorReady, localStylesMaps } = useInterpolatedStylesMap({
48
+ enabled: true,
49
+ visibilityBlocked: shouldBlockVisibility,
50
+ });
52
51
 
53
- const { localStylesMaps, nextInterpolatorReady } =
54
- useInterpolatedStylesMap({
55
- enabled: !isFloatingOverlay,
56
- visibilityBlocked: shouldBlockVisibility,
57
- });
52
+ const slotsMap = useResolvedStylesMap({
53
+ localStylesMaps,
54
+ ancestorStylesMap,
55
+ });
56
+ const value = useMemo(
57
+ () => ({
58
+ interpolatorReady,
59
+ slotsMap,
60
+ visibilityBlocked: shouldBlockVisibility,
61
+ }),
62
+ [interpolatorReady, shouldBlockVisibility, slotsMap],
63
+ );
64
+ const content = useMemo(
65
+ () => (
66
+ <Animated.View
67
+ style={[styles.container, animatedStyle]}
68
+ animatedProps={animatedProps}
69
+ >
70
+ {children}
71
+ </Animated.View>
72
+ ),
73
+ [children, animatedStyle, animatedProps],
74
+ );
58
75
 
59
- const slotsMap = useResolvedStylesMap({
60
- localStylesMaps,
61
- ancestorStylesMap: parentContext?.slotsMap,
62
- });
63
- const value = useMemo(
64
- () => ({
65
- localStylesMaps,
66
- nextInterpolatorReady,
67
- slotsMap,
68
- visibilityBlocked: shouldBlockVisibility,
69
- }),
70
- [
71
- localStylesMaps,
72
- nextInterpolatorReady,
73
- shouldBlockVisibility,
74
- slotsMap,
75
- ],
76
- );
77
-
78
- useLayoutEffect(() => {
79
- registerScreenSlots(currentScreenKey, value);
80
-
81
- return () => {
82
- unregisterScreenSlots(currentScreenKey, value);
83
- };
84
- }, [currentScreenKey, value]);
85
-
86
- const content = useMemo(
87
- () => (
88
- <FloatingOverlayLayer enabled={isFloatingOverlay}>
89
- <Animated.View
90
- style={[styles.container, animatedStyle]}
91
- animatedProps={animatedProps}
92
- >
93
- {children}
94
- </Animated.View>
95
- </FloatingOverlayLayer>
96
- ),
97
- [children, animatedStyle, isFloatingOverlay, animatedProps],
98
- );
99
-
100
- return {
101
- value,
102
- children: content,
103
- };
104
- },
105
- );
76
+ return {
77
+ key: currentScreenKey,
78
+ value,
79
+ children: content,
80
+ };
81
+ });
106
82
 
107
83
  const styles = StyleSheet.create({
108
84
  container: { flex: 1 },
@@ -5,6 +5,7 @@ import type {
5
5
  BaseStackNavigation,
6
6
  BaseStackRoute,
7
7
  } from "../../../types/stack.types";
8
+ import { dispatchCloseAction } from "../../../utils/navigation/close-action-replay";
8
9
  import { buildBlankStackState } from "./helpers/build-blank-stack-state";
9
10
  import { deriveBlankStackState } from "./helpers/derive-blank-stack-state";
10
11
  import type {
@@ -86,10 +87,13 @@ export const createBlankStackController = <
86
87
  const { state, navigation } = props;
87
88
 
88
89
  if (state.routes.some((candidate) => candidate.key === route.key)) {
89
- navigation.dispatch({
90
+ const action = {
90
91
  ...StackActions.pop(),
91
92
  source: route.key,
92
93
  target: state.key,
94
+ };
95
+ dispatchCloseAction(action, (closeAction) => {
96
+ navigation.dispatch(closeAction);
93
97
  });
94
98
  return;
95
99
  }
@@ -0,0 +1,22 @@
1
+ import type { BaseStackRoute } from "../../../../types/stack.types";
2
+
3
+ export function resolvePresentedIndex(
4
+ routes: BaseStackRoute[],
5
+ focusedRouteKey: string | undefined,
6
+ closingRouteKeys: ReadonlySet<string>,
7
+ ): number {
8
+ const focusedIndex = focusedRouteKey
9
+ ? routes.findIndex((route) => route.key === focusedRouteKey)
10
+ : routes.length - 1;
11
+ const resolvedFocusedIndex =
12
+ focusedIndex >= 0 ? focusedIndex : routes.length - 1;
13
+
14
+ for (let index = resolvedFocusedIndex; index >= 0; index -= 1) {
15
+ const route = routes[index];
16
+ if (route && !closingRouteKeys.has(route.key)) {
17
+ return index;
18
+ }
19
+ }
20
+
21
+ return resolvedFocusedIndex;
22
+ }
@@ -15,6 +15,7 @@ import type {
15
15
  } from "../../types/stack.types";
16
16
  import createProvider from "../../utils/create-provider";
17
17
  import { useBlankStackState } from "./blank-stack-state";
18
+ import { resolvePresentedIndex } from "./blank-stack-state/helpers/resolve-presented-index";
18
19
  import { useStackCoreStore } from "./core.provider";
19
20
 
20
21
  type InternalBlankStackProviderProps = BlankStackProviderProps<
@@ -58,7 +59,11 @@ function BlankStackProvider({
58
59
  state: stackState,
59
60
  });
60
61
  const navigatorKey = stackState.key;
61
- const focusedIndex = stackState.index;
62
+ const focusedIndex = resolvePresentedIndex(
63
+ state.routes,
64
+ state.focusedRouteKey,
65
+ state.closingRouteKeys,
66
+ );
62
67
  const scenesByKey = useMemo(
63
68
  () => createScenesByKey(state.scenes),
64
69
  [state.scenes],
@@ -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 = {
@@ -384,6 +384,14 @@ export type TransitionInterpolatedStyle = {
384
384
  * This reserved key is stripped before style slot normalization.
385
385
  */
386
386
  options?: TransitionInterpolatorOptions;
387
+ /**
388
+ * Animated style and props for the route-owned floating overlay.
389
+ *
390
+ * Visible overlays form their own adjacency chain. A route that returns this
391
+ * slot controls the previous visible overlay and, when it owns an overlay,
392
+ * its entering overlay.
393
+ */
394
+ overlay?: TransitionSlotStyle;
387
395
  /** Animated style and props for the main screen content view. */
388
396
  content?: TransitionSlotStyle;
389
397
  /** Animated style and props for the backdrop layer between screens. */
@@ -51,7 +51,7 @@ export type {
51
51
  ScrollMetadataState,
52
52
  SideActivation,
53
53
  } from "./gesture.types";
54
- export type { OverlayProps } from "./overlay.types";
54
+ export type { OverlayComponent, OverlayProps } from "./overlay.types";
55
55
  export type {
56
56
  GestureTracking,
57
57
  InactiveBehavior,
@@ -1,28 +1,44 @@
1
- import type { Route } from "@react-navigation/native";
1
+ import type {
2
+ ParamListBase,
3
+ ParamListRoute,
4
+ RouteProp,
5
+ } from "@react-navigation/native";
6
+ import type { ReactNode } from "react";
2
7
  import type { DerivedValue } from "react-native-reanimated";
3
8
  import type { ScreenTransitionConfig } from "./screen.types";
4
9
 
5
10
  /**
6
- * Props passed to overlay components.
7
- * Generic over the navigation type since different stacks have different navigation props.
11
+ * Overlay state without the animated progress value.
8
12
  */
13
+ export type OverlayScreenState<
14
+ TNavigation = unknown,
15
+ TParamList extends ParamListBase = ParamListBase,
16
+ TOwnerRouteName extends keyof TParamList = keyof TParamList,
17
+ > = Omit<OverlayProps<TNavigation, TParamList, TOwnerRouteName>, "progress"> & {
18
+ snapTo: (index: number) => void;
19
+ };
20
+
9
21
  /**
10
- * Overlay screen state passed to overlay host for rendering.
11
- * Generic over navigation type — defaults to `unknown` for flexibility.
22
+ * Props passed to a floating overlay component.
23
+ *
24
+ * `route` and `index` identify the screen that owns the overlay. Focused
25
+ * values may describe a later screen while that overlay remains visible.
12
26
  */
13
- export type OverlayScreenState<TNavigation = unknown> = Omit<
14
- OverlayProps<TNavigation>,
15
- "progress"
16
- > & {
27
+ export type OverlayProps<
28
+ TNavigation = unknown,
29
+ TParamList extends ParamListBase = ParamListBase,
30
+ TOwnerRouteName extends keyof TParamList = keyof TParamList,
31
+ > = {
32
+ /** Route that declared this overlay. */
33
+ route: RouteProp<TParamList, TOwnerRouteName>;
34
+
35
+ /** Index of the route that declared this overlay. */
17
36
  index: number;
18
- snapTo: (index: number) => void;
19
- };
20
37
 
21
- export type OverlayProps<TNavigation = unknown> = {
22
38
  /**
23
39
  * Route of the currently focused screen in the stack.
24
40
  */
25
- focusedRoute: Route<string>;
41
+ focusedRoute: ParamListRoute<TParamList>;
26
42
 
27
43
  /**
28
44
  * Index of the focused route in the stack.
@@ -32,7 +48,7 @@ export type OverlayProps<TNavigation = unknown> = {
32
48
  /**
33
49
  * All routes currently in the stack.
34
50
  */
35
- routes: Route<string>[];
51
+ routes: ParamListRoute<TParamList>[];
36
52
 
37
53
  /**
38
54
  * Custom metadata from the focused screen's options.
@@ -55,3 +71,14 @@ export type OverlayProps<TNavigation = unknown> = {
55
71
  */
56
72
  progress: DerivedValue<number>;
57
73
  };
74
+
75
+ /**
76
+ * Component rendered for a floating screen overlay.
77
+ *
78
+ * The callback is bivariant because React Navigation stores overlay components
79
+ * in navigator-wide screen options while applications annotate them for one
80
+ * specific route.
81
+ */
82
+ export type OverlayComponent = {
83
+ bivarianceHack(props: OverlayProps): ReactNode;
84
+ }["bivarianceHack"];
@@ -11,7 +11,7 @@ import type {
11
11
  GestureProgressMode,
12
12
  ScrollMetadataState,
13
13
  } from "./gesture.types";
14
- import type { OverlayProps } from "./overlay.types";
14
+ import type { OverlayComponent } from "./overlay.types";
15
15
 
16
16
  export type Layout = {
17
17
  width: number;
@@ -336,7 +336,7 @@ export type ScreenTransitionConfig = {
336
336
  /**
337
337
  * Function that returns a React Element to display as an overlay.
338
338
  */
339
- overlay?: (props: OverlayProps) => React.ReactNode;
339
+ overlay?: OverlayComponent;
340
340
 
341
341
  /**
342
342
  * Whether to show the overlay. The overlay is shown by default when `overlay` is provided.
@@ -1,4 +1,4 @@
1
- import { runOnJS, type SharedValue } from "react-native-reanimated";
1
+ import type { SharedValue } from "react-native-reanimated";
2
2
  import { FALSE, TRUE } from "../../constants";
3
3
  import {
4
4
  type AnimationStoreMap,
@@ -16,7 +16,6 @@ interface AnimateToProgressProps {
16
16
  */
17
17
  target: "open" | "close" | number;
18
18
  spec?: TransitionSpec;
19
- onAnimationFinish?: (finished: boolean) => void;
20
19
  animations: AnimationStoreMap;
21
20
  targetProgress: SharedValue<number>;
22
21
  animationProgress: SharedValue<number>;
@@ -61,7 +60,6 @@ export const resolveAnimationProgressRange = (
61
60
  export const animateToProgress = ({
62
61
  target,
63
62
  spec,
64
- onAnimationFinish,
65
63
  animations,
66
64
  targetProgress,
67
65
  animationProgress,
@@ -112,9 +110,6 @@ export const animateToProgress = ({
112
110
  entering.set(FALSE);
113
111
  }
114
112
 
115
- if (onAnimationFinish) {
116
- runOnJS(onAnimationFinish)(true);
117
- }
118
113
  return;
119
114
  }
120
115
 
@@ -141,23 +136,7 @@ export const animateToProgress = ({
141
136
 
142
137
  if (isClosing) {
143
138
  progressAnimating.set(FALSE);
144
-
145
- if (onAnimationFinish) {
146
- // Paint the terminal UI-thread host/style state before React
147
- // removes the closing route and its native portal host.
148
- requestAnimationFrame(() => {
149
- "worklet";
150
- requestAnimationFrame(() => {
151
- "worklet";
152
- runOnJS(onAnimationFinish)(state.finished);
153
- });
154
- });
155
- }
156
139
  } else {
157
- if (onAnimationFinish) {
158
- runOnJS(onAnimationFinish)(state.finished);
159
- }
160
-
161
140
  // Delay clearing progress animation by one frame to ensure final frame is painted
162
141
  requestAnimationFrame(() => {
163
142
  progressAnimating.set(FALSE);