react-native-screen-transitions 3.13.0-beta.0 → 3.13.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 (433) hide show
  1. package/README.md +14 -0
  2. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -2
  3. package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  4. package/lib/commonjs/shared/components/activity/helpers.js +50 -1
  5. package/lib/commonjs/shared/components/activity/helpers.js.map +1 -1
  6. package/lib/commonjs/shared/components/activity/variants/activity-screen.js +16 -67
  7. package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
  8. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +1 -1
  9. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  10. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +5 -1
  11. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  12. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +2 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  14. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
  15. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  16. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +3 -4
  17. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -6
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  20. package/lib/commonjs/shared/components/boundary/portal/teleport.js +1 -13
  21. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  22. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +6 -6
  23. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  24. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +9 -2
  25. package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -1
  26. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +16 -4
  27. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  28. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js +11 -6
  29. package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -1
  30. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +5 -4
  31. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
  32. package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -3
  33. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +8 -6
  35. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  36. package/lib/commonjs/shared/factories/screen-topology/create-screen-topology.js +147 -0
  37. package/lib/commonjs/shared/factories/screen-topology/create-screen-topology.js.map +1 -0
  38. package/lib/commonjs/shared/factories/screen-topology/index.js +45 -0
  39. package/lib/commonjs/shared/factories/screen-topology/index.js.map +1 -0
  40. package/lib/commonjs/shared/factories/screen-topology/types.js +2 -0
  41. package/lib/commonjs/shared/factories/screen-topology/types.js.map +1 -0
  42. package/lib/commonjs/shared/factories/screen-topology/use-screen-relationships.js +15 -0
  43. package/lib/commonjs/shared/factories/screen-topology/use-screen-relationships.js.map +1 -0
  44. package/lib/commonjs/shared/factories/screen-topology/worklet.js +55 -0
  45. package/lib/commonjs/shared/factories/screen-topology/worklet.js.map +1 -0
  46. package/lib/commonjs/shared/hooks/navigation/use-screen-state.js.map +1 -1
  47. package/lib/commonjs/shared/hooks/navigation/use-stack.js +16 -16
  48. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  49. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +26 -98
  50. package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
  51. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -52
  52. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  53. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +14 -25
  54. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +4 -13
  56. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  57. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +10 -26
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +0 -1
  60. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/animation/index.js +6 -0
  62. package/lib/commonjs/shared/providers/screen/animation/index.js.map +1 -1
  63. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +8 -7
  64. package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +40 -25
  66. package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -4
  68. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +24 -19
  70. package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +3 -3
  72. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  73. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture.js +2 -3
  74. package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture.js.map +1 -1
  75. package/lib/commonjs/shared/providers/screen/gestures/index.js +8 -2
  76. package/lib/commonjs/shared/providers/screen/gestures/index.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js +11 -18
  78. package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -1
  79. package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js +5 -7
  80. package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +4 -1
  82. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +5 -8
  84. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -1
  85. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +5 -4
  86. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js +1 -3
  88. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js.map +1 -1
  89. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +4 -4
  90. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  91. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +4 -2
  92. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  93. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -8
  94. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  95. package/lib/commonjs/shared/providers/screen/styles/index.js +8 -2
  96. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  97. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +17 -19
  98. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  99. package/lib/commonjs/shared/providers/screen/use-current-screen-relationships.js +14 -0
  100. package/lib/commonjs/shared/providers/screen/use-current-screen-relationships.js.map +1 -0
  101. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js +13 -5
  102. package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -1
  103. package/lib/commonjs/shared/providers/stack/core.provider.js +1 -3
  104. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
  105. package/lib/commonjs/shared/providers/stack/direct.provider.js +2 -5
  106. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  107. package/lib/commonjs/shared/stores/animation.store.js +0 -2
  108. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  109. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js +23 -9
  110. package/lib/commonjs/shared/stores/bounds/internals/coordinator.js.map +1 -1
  111. package/lib/commonjs/shared/stores/bounds/internals/links.js +2 -2
  112. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  113. package/lib/commonjs/shared/stores/bounds/internals/state.js +1 -1
  114. package/lib/commonjs/shared/utils/create-provider.js +51 -100
  115. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  116. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -2
  117. package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
  118. package/lib/module/shared/components/activity/helpers.js +48 -0
  119. package/lib/module/shared/components/activity/helpers.js.map +1 -1
  120. package/lib/module/shared/components/activity/variants/activity-screen.js +17 -68
  121. package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
  122. package/lib/module/shared/components/boundary/components/boundary-target.js +2 -2
  123. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  124. package/lib/module/shared/components/boundary/create-boundary-component.js +6 -2
  125. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  126. package/lib/module/shared/components/boundary/hooks/use-measurer.js +3 -2
  127. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  128. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
  129. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
  130. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +4 -5
  131. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
  132. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +2 -7
  133. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
  134. package/lib/module/shared/components/boundary/portal/teleport.js +1 -14
  135. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  136. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +5 -6
  137. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  138. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +7 -1
  139. package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -1
  140. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +16 -4
  141. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
  142. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js +12 -7
  143. package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -1
  144. package/lib/module/shared/components/overlay/variations/overlay-host.js +7 -6
  145. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
  146. package/lib/module/shared/components/screen-container/layers/content.js +2 -3
  147. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  148. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +9 -7
  149. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
  150. package/lib/module/shared/factories/screen-topology/create-screen-topology.js +142 -0
  151. package/lib/module/shared/factories/screen-topology/create-screen-topology.js.map +1 -0
  152. package/lib/module/shared/factories/screen-topology/index.js +6 -0
  153. package/lib/module/shared/factories/screen-topology/index.js.map +1 -0
  154. package/lib/module/shared/factories/screen-topology/types.js +2 -0
  155. package/lib/module/shared/factories/screen-topology/types.js.map +1 -0
  156. package/lib/module/shared/factories/screen-topology/use-screen-relationships.js +10 -0
  157. package/lib/module/shared/factories/screen-topology/use-screen-relationships.js.map +1 -0
  158. package/lib/module/shared/factories/screen-topology/worklet.js +48 -0
  159. package/lib/module/shared/factories/screen-topology/worklet.js.map +1 -0
  160. package/lib/module/shared/hooks/navigation/use-screen-state.js.map +1 -1
  161. package/lib/module/shared/hooks/navigation/use-stack.js +17 -18
  162. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  163. package/lib/module/shared/providers/screen/animation/animation.provider.js +25 -98
  164. package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
  165. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -52
  166. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  167. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +16 -27
  168. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  169. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +4 -13
  170. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  171. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +9 -24
  172. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  173. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +0 -1
  174. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  175. package/lib/module/shared/providers/screen/animation/index.js +1 -1
  176. package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
  177. package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -8
  178. package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
  179. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +43 -27
  180. package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
  181. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -4
  182. package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
  183. package/lib/module/shared/providers/screen/gestures/gestures.provider.js +21 -17
  184. package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
  185. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +3 -3
  186. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
  187. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture.js +3 -4
  188. package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture.js.map +1 -1
  189. package/lib/module/shared/providers/screen/gestures/index.js +1 -1
  190. package/lib/module/shared/providers/screen/gestures/index.js.map +1 -1
  191. package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js +13 -20
  192. package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -1
  193. package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js +5 -7
  194. package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
  195. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +4 -1
  196. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  197. package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +4 -8
  198. package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -1
  199. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +7 -6
  200. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  201. package/lib/module/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js +1 -3
  202. package/lib/module/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js.map +1 -1
  203. package/lib/module/shared/providers/screen/gestures/shared/policy.js +4 -4
  204. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  205. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +5 -3
  206. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
  207. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -8
  208. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  209. package/lib/module/shared/providers/screen/styles/index.js +1 -1
  210. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  211. package/lib/module/shared/providers/screen/styles/slot.provider.js +14 -16
  212. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  213. package/lib/module/shared/providers/screen/use-current-screen-relationships.js +9 -0
  214. package/lib/module/shared/providers/screen/use-current-screen-relationships.js.map +1 -0
  215. package/lib/module/shared/providers/stack/blank-stack.provider.js +12 -5
  216. package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -1
  217. package/lib/module/shared/providers/stack/core.provider.js +1 -3
  218. package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
  219. package/lib/module/shared/providers/stack/direct.provider.js +2 -5
  220. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  221. package/lib/module/shared/stores/animation.store.js +0 -2
  222. package/lib/module/shared/stores/animation.store.js.map +1 -1
  223. package/lib/module/shared/stores/bounds/internals/coordinator.js +18 -4
  224. package/lib/module/shared/stores/bounds/internals/coordinator.js.map +1 -1
  225. package/lib/module/shared/stores/bounds/internals/links.js +1 -1
  226. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  227. package/lib/module/shared/stores/bounds/internals/state.js +1 -1
  228. package/lib/module/shared/utils/create-provider.js +51 -100
  229. package/lib/module/shared/utils/create-provider.js.map +1 -1
  230. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +1 -1
  231. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  232. package/lib/typescript/shared/components/activity/helpers.d.ts +16 -0
  233. package/lib/typescript/shared/components/activity/helpers.d.ts.map +1 -1
  234. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +2 -4
  235. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  236. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  237. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  238. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +2 -1
  239. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +1 -1
  240. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
  241. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
  242. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
  243. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  244. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  245. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +3 -0
  246. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  247. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts +1 -0
  248. package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts.map +1 -1
  249. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
  250. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +3 -2
  251. package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -1
  252. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  253. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  254. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +1 -1
  255. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
  256. package/lib/typescript/shared/factories/screen-topology/create-screen-topology.d.ts +4 -0
  257. package/lib/typescript/shared/factories/screen-topology/create-screen-topology.d.ts.map +1 -0
  258. package/lib/typescript/shared/factories/screen-topology/index.d.ts +5 -0
  259. package/lib/typescript/shared/factories/screen-topology/index.d.ts.map +1 -0
  260. package/lib/typescript/shared/factories/screen-topology/types.d.ts +20 -0
  261. package/lib/typescript/shared/factories/screen-topology/types.d.ts.map +1 -0
  262. package/lib/typescript/shared/factories/screen-topology/use-screen-relationships.d.ts +5 -0
  263. package/lib/typescript/shared/factories/screen-topology/use-screen-relationships.d.ts.map +1 -0
  264. package/lib/typescript/shared/factories/screen-topology/worklet.d.ts +5 -0
  265. package/lib/typescript/shared/factories/screen-topology/worklet.d.ts.map +1 -0
  266. package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts.map +1 -1
  267. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +2 -0
  268. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  269. package/lib/typescript/shared/index.d.ts +0 -6
  270. package/lib/typescript/shared/index.d.ts.map +1 -1
  271. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +14 -12
  272. package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
  273. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts +4 -4
  274. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  275. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +0 -1
  276. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  277. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -2
  278. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  279. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts +2 -2
  280. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
  281. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +5 -2
  282. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  283. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +0 -1
  284. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  285. package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
  286. package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
  287. package/lib/typescript/shared/providers/screen/animation/types.d.ts +1 -13
  288. package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -1
  289. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +5 -2
  290. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  291. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +1 -4
  292. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
  293. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts +16 -4
  294. package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
  295. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts +2 -2
  296. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
  297. package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture.d.ts.map +1 -1
  298. package/lib/typescript/shared/providers/screen/gestures/index.d.ts +1 -1
  299. package/lib/typescript/shared/providers/screen/gestures/index.d.ts.map +1 -1
  300. package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts.map +1 -1
  301. package/lib/typescript/shared/providers/screen/gestures/ownership/resolve-ownership.d.ts +2 -3
  302. package/lib/typescript/shared/providers/screen/gestures/ownership/resolve-ownership.d.ts.map +1 -1
  303. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  304. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.d.ts +5 -3
  305. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.d.ts.map +1 -1
  306. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  307. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.d.ts +2 -2
  308. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +3 -3
  310. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  311. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +4 -2
  312. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  313. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
  314. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  316. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
  317. package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
  318. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +9 -4
  320. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  321. package/lib/typescript/shared/providers/screen/use-current-screen-relationships.d.ts +5 -0
  322. package/lib/typescript/shared/providers/screen/use-current-screen-relationships.d.ts.map +1 -0
  323. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts +4 -1
  324. package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -1
  325. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
  326. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
  327. package/lib/typescript/shared/stores/animation.store.d.ts +0 -1
  328. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  329. package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts.map +1 -1
  330. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  331. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +1 -1
  332. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  333. package/lib/typescript/shared/stores/bounds/types.d.ts +0 -1
  334. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  335. package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts +1 -0
  336. package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts.map +1 -1
  337. package/lib/typescript/shared/types/screen.types.d.ts +0 -9
  338. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  339. package/lib/typescript/shared/utils/create-provider.d.ts +24 -24
  340. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  341. package/package.json +2 -2
  342. package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +1 -2
  343. package/src/shared/components/activity/helpers.ts +59 -0
  344. package/src/shared/components/activity/variants/activity-screen.tsx +28 -93
  345. package/src/shared/components/boundary/components/boundary-target.tsx +2 -2
  346. package/src/shared/components/boundary/create-boundary-component.tsx +10 -2
  347. package/src/shared/components/boundary/hooks/use-measurer.ts +3 -2
  348. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +22 -0
  349. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +7 -3
  350. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +2 -6
  351. package/src/shared/components/boundary/portal/teleport.ts +2 -23
  352. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +10 -6
  353. package/src/shared/components/overlay/helpers/create-overlay-interpolator-frame.ts +14 -1
  354. package/src/shared/components/overlay/helpers/get-active-overlay.ts +29 -4
  355. package/src/shared/components/overlay/hooks/use-overlay-slot.ts +26 -8
  356. package/src/shared/components/overlay/variations/overlay-host.tsx +11 -6
  357. package/src/shared/components/screen-container/layers/content.tsx +3 -4
  358. package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +8 -12
  359. package/src/shared/factories/screen-topology/create-screen-topology.ts +199 -0
  360. package/src/shared/factories/screen-topology/index.ts +16 -0
  361. package/src/shared/factories/screen-topology/types.ts +22 -0
  362. package/src/shared/factories/screen-topology/use-screen-relationships.ts +15 -0
  363. package/src/shared/factories/screen-topology/worklet.ts +60 -0
  364. package/src/shared/hooks/navigation/use-screen-state.ts +2 -7
  365. package/src/shared/hooks/navigation/use-stack.tsx +28 -31
  366. package/src/shared/providers/screen/animation/animation.provider.tsx +73 -212
  367. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +10 -81
  368. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +0 -1
  369. package/src/shared/providers/screen/animation/helpers/pipeline.ts +45 -70
  370. package/src/shared/providers/screen/animation/helpers/read-screen-animation-revisions.ts +6 -30
  371. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +13 -32
  372. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +0 -2
  373. package/src/shared/providers/screen/animation/index.tsx +1 -0
  374. package/src/shared/providers/screen/animation/types.ts +1 -23
  375. package/src/shared/providers/screen/animation/use-screen-animation.tsx +10 -14
  376. package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +56 -35
  377. package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +0 -6
  378. package/src/shared/providers/screen/gestures/gestures.provider.tsx +96 -85
  379. package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +4 -4
  380. package/src/shared/providers/screen/gestures/hooks/use-screen-gesture.ts +3 -4
  381. package/src/shared/providers/screen/gestures/index.tsx +2 -1
  382. package/src/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.tsx +16 -29
  383. package/src/shared/providers/screen/gestures/ownership/resolve-ownership.ts +5 -8
  384. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +2 -3
  385. package/src/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.tsx +6 -9
  386. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +11 -7
  387. package/src/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.ts +12 -12
  388. package/src/shared/providers/screen/gestures/shared/policy.ts +7 -7
  389. package/src/shared/providers/screen/gestures/types.ts +5 -2
  390. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +10 -3
  391. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +7 -17
  392. package/src/shared/providers/screen/styles/index.tsx +2 -1
  393. package/src/shared/providers/screen/styles/slot.provider.tsx +25 -24
  394. package/src/shared/providers/screen/use-current-screen-relationships.ts +10 -0
  395. package/src/shared/providers/stack/blank-stack.provider.tsx +19 -6
  396. package/src/shared/providers/stack/core.provider.tsx +0 -1
  397. package/src/shared/providers/stack/direct.provider.tsx +2 -4
  398. package/src/shared/stores/animation.store.ts +0 -3
  399. package/src/shared/stores/bounds/internals/coordinator.ts +20 -8
  400. package/src/shared/stores/bounds/internals/links.ts +1 -1
  401. package/src/shared/stores/bounds/internals/state.ts +1 -1
  402. package/src/shared/stores/bounds/types.ts +0 -1
  403. package/src/shared/types/providers/blank-stack-provider.types.ts +1 -0
  404. package/src/shared/types/screen.types.ts +0 -10
  405. package/src/shared/utils/create-provider.tsx +135 -200
  406. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js +0 -9
  407. package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js.map +0 -1
  408. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +0 -12
  409. package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +0 -1
  410. package/lib/commonjs/shared/providers/screen/gestures/shared/ancestors.js +0 -23
  411. package/lib/commonjs/shared/providers/screen/gestures/shared/ancestors.js.map +0 -1
  412. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js +0 -45
  413. package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js.map +0 -1
  414. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js +0 -4
  415. package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js.map +0 -1
  416. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +0 -7
  417. package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +0 -1
  418. package/lib/module/shared/providers/screen/gestures/shared/ancestors.js +0 -19
  419. package/lib/module/shared/providers/screen/gestures/shared/ancestors.js.map +0 -1
  420. package/lib/module/shared/stores/bounds/internals/screen-graph.js +0 -39
  421. package/lib/module/shared/stores/bounds/internals/screen-graph.js.map +0 -1
  422. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts +0 -3
  423. package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts.map +0 -1
  424. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts +0 -5
  425. package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts.map +0 -1
  426. package/lib/typescript/shared/providers/screen/gestures/shared/ancestors.d.ts +0 -11
  427. package/lib/typescript/shared/providers/screen/gestures/shared/ancestors.d.ts.map +0 -1
  428. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts +0 -5
  429. package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts.map +0 -1
  430. package/src/shared/providers/screen/animation/helpers/interpolator-participation.ts +0 -6
  431. package/src/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.ts +0 -13
  432. package/src/shared/providers/screen/gestures/shared/ancestors.ts +0 -27
  433. package/src/shared/stores/bounds/internals/screen-graph.ts +0 -45
@@ -73,7 +73,7 @@ function buildTransitionStackState({
73
73
  const routes = state.routes as BaseStackRoute[];
74
74
  const preloadedRoutes = getPreloadedRoutes(state) as BaseStackRoute[];
75
75
  const allRoutes = routes.concat(preloadedRoutes);
76
- const routeKeys: string[] = [];
76
+ const routeKeys = routes.map((route) => route.key);
77
77
  const scenes: ScreenTransitionsAdapterScene[] = [];
78
78
  const routeIndexByKey = new Map<string, number>();
79
79
  let shouldShowFloatOverlay = false;
@@ -112,7 +112,6 @@ function buildTransitionStackState({
112
112
  descriptor: normalizedDescriptor,
113
113
  previousDescriptor,
114
114
  });
115
- routeKeys.push(route.key);
116
115
  routeIndexByKey.set(route.key, sceneIndex);
117
116
 
118
117
  if (
@@ -1,8 +1,67 @@
1
1
  import { IS_WEB } from "../../constants";
2
2
  import type { InactiveBehavior } from "../../types/screen.types";
3
+ import type { StackSceneActivity } from "../../types/stack.types";
3
4
 
4
5
  export type { InactiveBehavior } from "../../types/screen.types";
5
6
 
6
7
  export const DEFAULT_INACTIVE_BEHAVIOR: InactiveBehavior = IS_WEB
7
8
  ? "unmount"
8
9
  : "hide";
10
+
11
+ type ActivityState = 0 | 1 | 2;
12
+
13
+ const ActivityStateByActivity = {
14
+ active: 2,
15
+ inert: 1,
16
+ inactive: 0,
17
+ closing: 1,
18
+ } satisfies Record<StackSceneActivity, ActivityState>;
19
+
20
+ const PointerEventsByActivity = {
21
+ active: "auto",
22
+ inert: "auto",
23
+ inactive: "none",
24
+ closing: "none",
25
+ } as const satisfies Record<StackSceneActivity, "auto" | "none">;
26
+
27
+ export const HIDDEN_ACTIVITY_SCREEN_STYLE = { display: "none" } as const;
28
+
29
+ export function resolveActivityScreenPresentation({
30
+ activity,
31
+ inactiveBehavior,
32
+ waitForPaintDriver,
33
+ }: {
34
+ activity: StackSceneActivity;
35
+ inactiveBehavior: InactiveBehavior;
36
+ waitForPaintDriver: boolean;
37
+ }) {
38
+ let activityState: ActivityState = ActivityStateByActivity[activity];
39
+ let shouldFreeze = false;
40
+ let visible = activity !== "inactive";
41
+
42
+ if (activity === "inactive") {
43
+ if (inactiveBehavior === "keep") {
44
+ activityState = 1;
45
+ visible = true;
46
+ } else if (waitForPaintDriver) {
47
+ activityState = 1;
48
+ visible = true;
49
+ } else if (inactiveBehavior === "pause") {
50
+ activityState = 1;
51
+ shouldFreeze = true;
52
+ visible = true;
53
+ } else {
54
+ activityState = 0;
55
+ shouldFreeze = true;
56
+ visible = false;
57
+ }
58
+ }
59
+
60
+ return {
61
+ activityState,
62
+ freezeOnBlur: true,
63
+ pointerEvents: PointerEventsByActivity[activity],
64
+ shouldFreeze,
65
+ visible,
66
+ };
67
+ }
@@ -1,6 +1,6 @@
1
1
  import type * as React from "react";
2
2
  import { memo } from "react";
3
- import { StyleSheet, View, type ViewProps } from "react-native";
3
+ import { StyleSheet, View } from "react-native";
4
4
  import { useDerivedValue } from "react-native-reanimated";
5
5
  import { Screen } from "react-native-screens";
6
6
  import { IS_WEB } from "../../../constants";
@@ -8,71 +8,40 @@ import { useStack } from "../../../hooks/navigation/use-stack";
8
8
  import { useSharedValueState } from "../../../hooks/reanimated/use-shared-value-state";
9
9
  import { useBlankStackStore } from "../../../providers/stack/blank-stack.provider";
10
10
  import { AnimationStore } from "../../../stores/animation.store";
11
- import type { StackSceneActivity } from "../../../types/stack.types";
12
- import { DEFAULT_INACTIVE_BEHAVIOR, type InactiveBehavior } from "../helpers";
13
-
14
- type ActivityState = 0 | 1 | 2;
15
- const ActivityStateByActivity = {
16
- active: 2,
17
- inert: 1,
18
- inactive: 0,
19
- closing: 1,
20
- } satisfies Record<StackSceneActivity, ActivityState>;
21
-
22
- const PointerEventsByActivity = {
23
- active: "auto",
24
- inert: "auto",
25
- inactive: "none",
26
- closing: "none",
27
- } satisfies Record<StackSceneActivity, ViewProps["pointerEvents"]>;
11
+ import {
12
+ DEFAULT_INACTIVE_BEHAVIOR,
13
+ HIDDEN_ACTIVITY_SCREEN_STYLE,
14
+ type InactiveBehavior,
15
+ resolveActivityScreenPresentation,
16
+ } from "../helpers";
28
17
 
29
18
  interface ActivityScreenProps {
30
- activity?: StackSceneActivity;
31
19
  children: React.ReactNode;
32
20
  inactiveBehavior?: InactiveBehavior;
33
21
  paintDriverRouteKey?: string;
34
22
  hasNestedState?: boolean;
35
- routeKey?: string;
23
+ routeKey: string;
36
24
  }
37
25
 
38
26
  export const ActivityScreen = memo(function ActivityScreen({
39
- activity,
40
27
  children,
41
28
  inactiveBehavior,
42
29
  paintDriverRouteKey,
43
30
  hasNestedState,
44
31
  routeKey,
45
32
  }: ActivityScreenProps) {
46
- const stackActivity = useBlankStackStore((store) =>
47
- routeKey ? store?.scenesByKey[routeKey]?.activity : undefined,
48
- );
49
- const stackInactiveBehavior = useBlankStackStore((store) =>
50
- routeKey
51
- ? (
52
- store?.scenesByKey[routeKey]?.descriptor.options as
53
- | { inactiveBehavior?: InactiveBehavior }
54
- | undefined
55
- )?.inactiveBehavior
56
- : undefined,
57
- );
58
- const stackRoute = useBlankStackStore((store) =>
59
- routeKey ? store?.scenesByKey[routeKey]?.route : undefined,
33
+ const scene = useBlankStackStore((store) => store.scenesByKey[routeKey]);
34
+ const stackPaintDriverRouteKey = useBlankStackStore((store) =>
35
+ store.paintDriverRouteKeyByRouteKey.get(routeKey),
60
36
  );
61
- const stackPaintDriverRouteKey = useBlankStackStore((store) => {
62
- if (!routeKey || !store) {
63
- return undefined;
64
- }
65
-
66
- const routeIndex = store.routeKeys.indexOf(routeKey);
67
- return store.routeKeys[routeIndex + 2];
68
- });
69
- const resolvedActivity = activity ?? stackActivity ?? "active";
37
+ const stackInactiveBehavior = (
38
+ scene.descriptor.options as { inactiveBehavior?: InactiveBehavior }
39
+ ).inactiveBehavior;
70
40
  const resolvedInactiveBehavior =
71
41
  inactiveBehavior ?? stackInactiveBehavior ?? DEFAULT_INACTIVE_BEHAVIOR;
72
42
  const resolvedPaintDriverRouteKey =
73
43
  paintDriverRouteKey ?? stackPaintDriverRouteKey;
74
- const resolvedHasNestedState =
75
- hasNestedState ?? (stackRoute ? "state" in stackRoute : false);
44
+ const resolvedHasNestedState = hasNestedState ?? "state" in scene.route;
76
45
  const nativeScreenDisabled = useStack((s) => s.flags.DISABLE_NATIVE_SCREENS);
77
46
  const paintDriverAnimations = resolvedPaintDriverRouteKey
78
47
  ? AnimationStore.getBag(resolvedPaintDriverRouteKey)
@@ -97,42 +66,18 @@ export const ActivityScreen = memo(function ActivityScreen({
97
66
 
98
67
  const isPaintDriverSettledOnJS = useSharedValueState(isPaintDriverSettled);
99
68
 
100
- let activityState: ActivityState = ActivityStateByActivity[resolvedActivity];
101
- let shouldFreeze = false;
102
- let visible = resolvedActivity !== "inactive";
103
-
104
- const shouldWaitForPaintDriver = !isPaintDriverSettledOnJS;
105
-
106
- if (resolvedActivity === "inactive") {
107
- if (resolvedInactiveBehavior === "keep") {
108
- activityState = 1;
109
- visible = true;
110
- } else if (shouldWaitForPaintDriver) {
111
- // Delay hiding until the paint driver has settled to avoid
112
- // a blank frame during the transition.
113
- activityState = 1;
114
- visible = true;
115
- } else if (resolvedInactiveBehavior === "pause") {
116
- activityState = 1;
117
- shouldFreeze = true;
118
- visible = true;
119
- } else {
120
- // `hide` freezes and hides native presentation. Non-nested
121
- // `unmount` removes the React subtree through the JS guard below.
122
- activityState = 0;
123
- shouldFreeze = true;
124
- visible = false;
125
- }
126
- }
69
+ const { visible, ...screenPresentation } = resolveActivityScreenPresentation({
70
+ activity: scene.activity,
71
+ inactiveBehavior: resolvedInactiveBehavior,
72
+ waitForPaintDriver: !isPaintDriverSettledOnJS,
73
+ });
127
74
 
128
75
  const shouldUnmount =
129
76
  resolvedInactiveBehavior === "unmount" &&
130
- resolvedActivity === "inactive" &&
77
+ scene.activity === "inactive" &&
131
78
  !resolvedHasNestedState &&
132
79
  isPaintDriverSettledOnJS;
133
80
 
134
- const pointerEvents = PointerEventsByActivity[resolvedActivity];
135
-
136
81
  if (shouldUnmount) {
137
82
  return null;
138
83
  }
@@ -141,33 +86,23 @@ export const ActivityScreen = memo(function ActivityScreen({
141
86
 
142
87
  if (IS_WEB || nativeScreenDisabled) {
143
88
  return (
144
- <View style={style} pointerEvents={pointerEvents} collapsable={false}>
89
+ <View
90
+ style={style}
91
+ pointerEvents={screenPresentation.pointerEvents}
92
+ collapsable={false}
93
+ >
145
94
  {children}
146
95
  </View>
147
96
  );
148
97
  }
149
98
 
150
99
  return (
151
- <Screen
152
- style={style}
153
- activityState={activityState}
154
- shouldFreeze={shouldFreeze}
155
- pointerEvents={pointerEvents}
156
- collapsable={false}
157
- >
100
+ <Screen {...screenPresentation} style={style} collapsable={false}>
158
101
  {children}
159
102
  </Screen>
160
103
  );
161
104
  });
162
105
 
163
- const HIDDEN_SCREEN_OFFSET = 10_000;
164
106
  const styles = StyleSheet.create({
165
- hidden: {
166
- // NOTE:
167
- // When setting a screen to display:"none", the gesture detector will not recognize anymore. Since I believe
168
- // rngh is attaching itself to its nearest native view, this of course would kill the detector.
169
- // To avoid this, we use a transform to move the screen off-screen instead of display: "none". This isn't my favorite approach,
170
- // but i'm hoping react 19's activity could mitigate this better and avoid dependence on rns.
171
- transform: [{ translateY: HIDDEN_SCREEN_OFFSET }],
172
- },
107
+ hidden: HIDDEN_ACTIVITY_SCREEN_STYLE,
173
108
  });
@@ -13,7 +13,7 @@ import {
13
13
  import { BoundaryPortal } from "../portal/components/boundary-portal";
14
14
  import {
15
15
  TARGET_OUTSIDE_ROOT_WARNING,
16
- useBoundaryRootStore,
16
+ useOptionalBoundaryRootStore,
17
17
  } from "../providers/boundary-root.provider";
18
18
 
19
19
  type BoundaryTargetProps = Omit<
@@ -36,7 +36,7 @@ const BoundaryTargetInner = (props: InternalBoundaryTargetProps) => {
36
36
  style,
37
37
  ...rest
38
38
  } = props;
39
- const rootContext = useBoundaryRootStore();
39
+ const rootContext = useOptionalBoundaryRootStore();
40
40
  const boundaryId = rootContext?.boundTag.tag;
41
41
  const isActiveTarget = active === true && rootContext !== null;
42
42
  const portalRuntime = rootContext?.portalRuntime;
@@ -10,7 +10,10 @@ import {
10
10
  BOUNDARY_TARGET_ACTIVE_PROP,
11
11
  BoundaryTarget,
12
12
  } from "./components/boundary-target";
13
- import { BoundaryContentPortalHost } from "./portal/components/boundary-content-portal";
13
+ import {
14
+ BoundaryContentPortal,
15
+ BoundaryContentPortalHost,
16
+ } from "./portal/components/boundary-content-portal";
14
17
  import { BoundaryPortal } from "./portal/components/boundary-portal";
15
18
  import { BoundaryRootProvider } from "./providers/boundary-root.provider";
16
19
  import type { BoundaryComponentProps } from "./types";
@@ -91,7 +94,12 @@ export function createBoundaryComponent<P extends object>(
91
94
  enabled={root.shouldRenderHandoffHost}
92
95
  screenKey={root.currentScreenKey}
93
96
  >
94
- {targetResolution.children}
97
+ <BoundaryContentPortal
98
+ boundaryId={root.boundTag.tag}
99
+ enabled={root.shouldRenderHandoffHost}
100
+ >
101
+ {targetResolution.children}
102
+ </BoundaryContentPortal>
95
103
  </BoundaryContentPortalHost>
96
104
  </AnimatedComponent>
97
105
  </BoundaryPortal>
@@ -3,7 +3,7 @@ import type { View } from "react-native";
3
3
  import { useWindowDimensions } from "react-native";
4
4
  import type { AnimatedRef, StyleProps } from "react-native-reanimated";
5
5
  import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
6
- import { useScreenSlots } from "../../../providers/screen/styles";
6
+ import { useScreenSlotStore } from "../../../providers/screen/styles";
7
7
  import type { BoundTag } from "../../../stores/bounds/types";
8
8
  import { ScrollStore } from "../../../stores/scroll.store";
9
9
  import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
@@ -41,7 +41,8 @@ export const useMeasurer = ({
41
41
 
42
42
  const scrollState = ScrollStore.getValue(currentScreenKey, "coordination");
43
43
  const scrollMetadata = ScrollStore.getValue(currentScreenKey, "metadata");
44
- const { visibilityBlocked } = useScreenSlots();
44
+ const screenSlotStore = useScreenSlotStore();
45
+ const { visibilityBlocked } = screenSlotStore;
45
46
 
46
47
  return useCallback(
47
48
  (target) => {
@@ -74,6 +74,7 @@ export const resolveHandoffAttachmentCandidate = ({
74
74
  interpolatorReady,
75
75
  pairChangedDuringClose = false,
76
76
  pairDestinationScreenKey,
77
+ pairHasBoundaryLink,
77
78
  previousReceiverScreenKey,
78
79
  }: {
79
80
  activeReceiverClosing: boolean;
@@ -83,9 +84,20 @@ export const resolveHandoffAttachmentCandidate = ({
83
84
  interpolatorReady: boolean;
84
85
  pairChangedDuringClose?: boolean;
85
86
  pairDestinationScreenKey: string | null;
87
+ pairHasBoundaryLink?: boolean;
86
88
  previousReceiverScreenKey: string | null;
87
89
  }) => {
88
90
  "worklet";
91
+ const currentPairHasBoundaryLink =
92
+ pairHasBoundaryLink ?? pairDestinationScreenKey !== null;
93
+
94
+ if (
95
+ activeReceiverClosing &&
96
+ attachedReceiverScreenKey !== activeReceiverScreenKey &&
97
+ !currentPairHasBoundaryLink
98
+ ) {
99
+ return attachedReceiverScreenKey;
100
+ }
89
101
 
90
102
  if (
91
103
  activeReceiverClosing &&
@@ -96,6 +108,16 @@ export const resolveHandoffAttachmentCandidate = ({
96
108
  return pairDestinationScreenKey;
97
109
  }
98
110
 
111
+ if (
112
+ activeReceiverClosing &&
113
+ pairChangedDuringClose &&
114
+ !currentPairHasBoundaryLink
115
+ ) {
116
+ return hasActiveCloseFinished
117
+ ? previousReceiverScreenKey
118
+ : attachedReceiverScreenKey;
119
+ }
120
+
99
121
  if (
100
122
  hasActiveCloseFinished &&
101
123
  attachedReceiverScreenKey === activeReceiverScreenKey
@@ -1,7 +1,10 @@
1
1
  import { useAnimatedProps, useSharedValue } from "react-native-reanimated";
2
2
  import { useStack } from "../../../../../../hooks/navigation/use-stack";
3
3
  import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
4
- import { useScreenSlots } from "../../../../../../providers/screen/styles";
4
+ import {
5
+ useOptionalScreenSlotStore,
6
+ useScreenSlotStore,
7
+ } from "../../../../../../providers/screen/styles";
5
8
  import { hasCloseTransitionFinished } from "../../../../../../providers/screen/styles/helpers/transition-visual-state";
6
9
  import { AnimationStore } from "../../../../../../stores/animation.store";
7
10
  import { getLinkKeyFromTag } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
@@ -26,7 +29,7 @@ interface UseBoundaryContentPortalAttachmentParams {
26
29
  export const useBoundaryContentPortalAttachment = ({
27
30
  boundaryId,
28
31
  }: UseBoundaryContentPortalAttachmentParams) => {
29
- const { slotsMap } = useScreenSlots();
32
+ const slotsMap = useScreenSlotStore((store) => store.slotsMap);
30
33
 
31
34
  const currentScreenKey = useDescriptorsStore(
32
35
  (s) => s.derivations.currentScreenKey,
@@ -43,7 +46,7 @@ export const useBoundaryContentPortalAttachment = ({
43
46
  const resolvedSourcePairKey = sourcePairKey ?? transitionSourcePairKey;
44
47
  const resolvedDestinationScreenKey =
45
48
  nextScreenKey ?? transitionDestinationScreenKey;
46
- const destinationSlots = useScreenSlots(
49
+ const destinationSlots = useOptionalScreenSlotStore(
47
50
  resolvedDestinationScreenKey ?? currentScreenKey,
48
51
  );
49
52
  const unavailableInterpolatorReady = useSharedValue(0);
@@ -146,6 +149,7 @@ export const useBoundaryContentPortalAttachment = ({
146
149
  interpolatorReady: !!isInterpolatorReady,
147
150
  pairChangedDuringClose,
148
151
  pairDestinationScreenKey: pairDestination,
152
+ pairHasBoundaryLink: link !== undefined,
149
153
  previousReceiverScreenKey,
150
154
  });
151
155
 
@@ -1,7 +1,7 @@
1
1
  import { useIsFocused } from "@react-navigation/native";
2
2
  import { useAnimatedProps, useSharedValue } from "react-native-reanimated";
3
3
  import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
4
- import { useScreenSlots } from "../../../../../../providers/screen/styles";
4
+ import { useScreenSlotStore } from "../../../../../../providers/screen/styles";
5
5
  import { pairs } from "../../../../../../stores/bounds/internals/state";
6
6
  import { useBoundaryRootStore } from "../../../../providers/boundary-root.provider";
7
7
  import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
@@ -18,10 +18,6 @@ export const useBoundaryPortalAttachment = ({
18
18
  boundaryId,
19
19
  }: UseBoundaryPortalAttachmentParams) => {
20
20
  const localMeasurement = useBoundaryRootStore((root) => {
21
- if (!root) {
22
- throw new Error("Boundary portal attachment requires a boundary root.");
23
- }
24
-
25
21
  return root.localMeasurement;
26
22
  });
27
23
  const currentScreenKey = useDescriptorsStore(
@@ -31,7 +27,7 @@ export const useBoundaryPortalAttachment = ({
31
27
  // A leaf that is still selected in its own one-screen stack becomes unfocused
32
28
  // when any ancestor route is covered.
33
29
  const focused = useIsFocused();
34
- const { slotsMap } = useScreenSlots();
30
+ const slotsMap = useScreenSlotStore((store) => store.slotsMap);
35
31
  const portalHostName = useSharedValue<string | null>(null);
36
32
  const portalHostReady = useSharedValue<string | null>(null);
37
33
  const escapeHostKey = useActiveHostKey(currentScreenKey);
@@ -1,4 +1,4 @@
1
- import { type ComponentType, createElement, type ReactNode } from "react";
1
+ import type { ComponentType, ReactNode } from "react";
2
2
 
3
3
  /**
4
4
  * `react-native-teleport` is an optional peer dependency. The require sits in a
@@ -9,33 +9,12 @@ import { type ComponentType, createElement, type ReactNode } from "react";
9
9
  * inline rendering; everything else keeps working.
10
10
  */
11
11
  let mod: any = null;
12
- let managerMod: any = null;
13
- let providerViewMod: any = null;
14
12
  try {
15
13
  mod = require("react-native-teleport");
16
- managerMod = require("react-native-teleport/lib/module/contexts/PortalManager");
17
- providerViewMod = require("react-native-teleport/lib/module/views/PortalProvider");
18
14
  } catch {}
19
15
 
20
- const NativePortalProviderView: ComponentType<{ children: ReactNode }> | null =
21
- providerViewMod?.default ?? null;
22
- const PortalManagerProvider: ComponentType<{ children: ReactNode }> | null =
23
- managerMod?.PortalManagerProvider ?? null;
24
-
25
16
  const SafeNativePortalProvider: ComponentType<{ children: ReactNode }> | null =
26
- PortalManagerProvider
27
- ? ({ children }: { children: ReactNode }) => {
28
- const managedChildren = createElement(
29
- PortalManagerProvider,
30
- null,
31
- children,
32
- );
33
-
34
- return NativePortalProviderView
35
- ? createElement(NativePortalProviderView, null, managedChildren)
36
- : managedChildren;
37
- }
38
- : null;
17
+ mod?.PortalProvider ?? null;
39
18
 
40
19
  export const isTeleportAvailable =
41
20
  mod !== null && SafeNativePortalProvider !== null;
@@ -14,7 +14,7 @@ import {
14
14
  useComposedSlotStyles,
15
15
  useSlotStackingStyles,
16
16
  } from "../../../providers/screen/styles";
17
- import { useBlankStackStore } from "../../../providers/stack/blank-stack.provider";
17
+ import { useOptionalBlankStackStore } from "../../../providers/stack/blank-stack.provider";
18
18
  import { createBoundTag } from "../../../stores/bounds/helpers/link-pairs.helpers";
19
19
  import type { BoundTag } from "../../../stores/bounds/types";
20
20
  import createProvider from "../../../utils/create-provider";
@@ -68,10 +68,14 @@ type BoundaryRootProviderProps = Pick<
68
68
  targetStyle?: unknown;
69
69
  };
70
70
 
71
- export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
72
- "BoundaryRoot",
73
- { guarded: false },
74
- )<BoundaryRootProviderProps, BoundaryRootContextValue>(
71
+ export const {
72
+ BoundaryRootProvider,
73
+ useBoundaryRootStore,
74
+ useOptionalBoundaryRootStore,
75
+ } = createProvider("BoundaryRoot")<
76
+ BoundaryRootProviderProps,
77
+ BoundaryRootContextValue
78
+ >(
75
79
  ({
76
80
  children,
77
81
  config,
@@ -98,7 +102,7 @@ export const { BoundaryRootProvider, useBoundaryRootStore } = createProvider(
98
102
  const currentScreenKey = useDescriptorsStore(
99
103
  (s) => s.derivations.currentScreenKey,
100
104
  );
101
- const isCurrentScreenClosing = useBlankStackStore(
105
+ const isCurrentScreenClosing = useOptionalBlankStackStore(
102
106
  (store) =>
103
107
  portalRuntime.handoff &&
104
108
  store?.scenesByKey[currentScreenKey]?.activity === "closing",
@@ -1,6 +1,19 @@
1
1
  import { updateDerivations } from "../../../providers/screen/animation/helpers/derivations";
2
2
  import type { ScreenInterpolatorFrame } from "../../../providers/screen/animation/helpers/pipeline";
3
3
 
4
+ export const shouldUseOverlayGestureDriver = (
5
+ overlayFrame: ScreenInterpolatorFrame,
6
+ driverFrame: ScreenInterpolatorFrame,
7
+ ): boolean => {
8
+ "worklet";
9
+ const gesture = overlayFrame.current.gesture;
10
+
11
+ return (
12
+ driverFrame.current.route.key !== overlayFrame.current.route.key &&
13
+ !!(gesture.dragging || gesture.dismissing || gesture.settling)
14
+ );
15
+ };
16
+
4
17
  export const createOverlayInterpolatorFrame = ({
5
18
  overlayFrame,
6
19
  driverFrame,
@@ -22,7 +35,7 @@ export const createOverlayInterpolatorFrame = ({
22
35
  };
23
36
 
24
37
  updateDerivations(frame);
25
- frame.stackProgress = frame.progress;
38
+ frame.stackProgress = overlayFrame.stackProgress;
26
39
  frame.logicallySettled = frame.active.settled;
27
40
 
28
41
  return frame;
@@ -74,8 +74,33 @@ export function getFloatOverlayTransitions(
74
74
  ): FloatOverlayTransitionEntry[] {
75
75
  const topScene = scenes[scenes.length - 1];
76
76
 
77
- return overlayStack.map((entry, index) => ({
78
- ...entry,
79
- driverScene: overlayStack[index + 1]?.scene ?? topScene ?? entry.scene,
80
- }));
77
+ return overlayStack.map((entry, index) => {
78
+ const nextEntry = overlayStack[index + 1];
79
+ let nextPresentedEntry: FloatOverlayEntry | undefined;
80
+
81
+ for (
82
+ let nextIndex = index + 1;
83
+ nextIndex < overlayStack.length;
84
+ nextIndex++
85
+ ) {
86
+ const candidate = overlayStack[nextIndex];
87
+ if (candidate?.scene.activity !== "closing") {
88
+ nextPresentedEntry = candidate;
89
+ break;
90
+ }
91
+ }
92
+
93
+ const driverScene =
94
+ entry.scene.activity === "closing" && nextEntry
95
+ ? entry.scene
96
+ : (nextPresentedEntry?.scene ??
97
+ nextEntry?.scene ??
98
+ topScene ??
99
+ entry.scene);
100
+
101
+ return {
102
+ ...entry,
103
+ driverScene,
104
+ };
105
+ });
81
106
  }
@@ -15,11 +15,15 @@ import type {
15
15
  ScreenStyleInterpolator,
16
16
  } from "../../../types/animation.types";
17
17
  import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
18
- import { createOverlayInterpolatorFrame } from "../helpers/create-overlay-interpolator-frame";
18
+ import {
19
+ createOverlayInterpolatorFrame,
20
+ shouldUseOverlayGestureDriver,
21
+ } from "../helpers/create-overlay-interpolator-frame";
19
22
  import { runOverlaySlotInterpolator } from "../helpers/run-overlay-slot-interpolator";
20
23
 
21
24
  export const useOverlaySlot = ({
22
25
  overlayAnimationStore,
26
+ overlayInterpolator,
23
27
  driverAnimationStore,
24
28
  previousOverlayAnimationStore,
25
29
  driverInterpolator,
@@ -27,6 +31,7 @@ export const useOverlaySlot = ({
27
31
  isIncoming,
28
32
  }: {
29
33
  overlayAnimationStore: ScreenAnimationContextValue;
34
+ overlayInterpolator: ScreenStyleInterpolator | undefined;
30
35
  driverAnimationStore: ScreenAnimationContextValue;
31
36
  previousOverlayAnimationStore?: ScreenAnimationContextValue;
32
37
  driverInterpolator: ScreenStyleInterpolator | undefined;
@@ -34,11 +39,16 @@ export const useOverlaySlot = ({
34
39
  isIncoming: boolean;
35
40
  }) => {
36
41
  const { height } = useWindowDimensions();
37
- const transition = useBuildTransitionAccessor(driverAnimationStore);
42
+ const overlayTransition = useBuildTransitionAccessor(overlayAnimationStore);
43
+ const driverTransition = useBuildTransitionAccessor(driverAnimationStore);
38
44
 
39
45
  const interpolatorSharedValues = useMemo(
40
- () => collectInterpolatorSharedValues([driverInterpolator]),
41
- [driverInterpolator],
46
+ () =>
47
+ collectInterpolatorSharedValues([
48
+ overlayInterpolator,
49
+ driverInterpolator,
50
+ ]),
51
+ [overlayInterpolator, driverInterpolator],
42
52
  );
43
53
 
44
54
  const overlaySlot = useDerivedValue<
@@ -53,17 +63,25 @@ export const useOverlaySlot = ({
53
63
  interpolatorSharedValues[index]?.get();
54
64
  }
55
65
 
66
+ const overlayFrame = overlayAnimationStore.screenInterpolatorProps.get();
67
+ const driverFrame = driverAnimationStore.screenInterpolatorProps.get();
68
+ const overlayOwnsGesture = shouldUseOverlayGestureDriver(
69
+ overlayFrame,
70
+ driverFrame,
71
+ );
56
72
  const frame = createOverlayInterpolatorFrame({
57
- overlayFrame: overlayAnimationStore.screenInterpolatorProps.get(),
58
- driverFrame: driverAnimationStore.screenInterpolatorProps.get(),
73
+ overlayFrame,
74
+ driverFrame: overlayOwnsGesture ? overlayFrame : driverFrame,
59
75
  previousOverlayFrame:
60
76
  previousOverlayAnimationStore?.screenInterpolatorProps.get(),
61
77
  });
62
78
 
63
79
  return runOverlaySlotInterpolator({
64
80
  frame,
65
- interpolator: driverInterpolator,
66
- transition,
81
+ interpolator: overlayOwnsGesture
82
+ ? overlayInterpolator
83
+ : driverInterpolator,
84
+ transition: overlayOwnsGesture ? overlayTransition : driverTransition,
67
85
  });
68
86
  });
69
87