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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (344) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +10 -10
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +45 -101
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +103 -0
  6. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  8. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  10. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  12. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -8
  14. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  16. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +2 -2
  18. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  19. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  20. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +5 -2
  21. package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  22. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +10 -7
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  24. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +36 -0
  25. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/teleport.js +23 -0
  27. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +21 -23
  29. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +33 -2
  31. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  32. package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
  33. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  34. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
  35. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
  36. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
  37. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  38. package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
  39. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  40. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -15
  41. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  42. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +4 -16
  43. package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/navigation/use-stack.js +17 -2
  45. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +142 -33
  47. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
  49. package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
  53. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
  55. package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  56. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  57. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  59. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
  60. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
  62. package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  63. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +23 -36
  64. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  66. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  67. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
  68. package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  69. package/lib/commonjs/shared/providers/screen/styles/index.js +25 -7
  70. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +103 -0
  72. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
  73. package/lib/commonjs/shared/stores/animation.store.js +2 -0
  74. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  75. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +16 -1
  76. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
  78. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
  80. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  81. package/lib/commonjs/shared/utils/logger.js +11 -0
  82. package/lib/commonjs/shared/utils/logger.js.map +1 -1
  83. package/lib/module/shared/components/boundary/components/boundary-target.js +10 -10
  84. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  85. package/lib/module/shared/components/boundary/create-boundary-component.js +47 -103
  86. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  87. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +98 -0
  88. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
  89. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
  90. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
  91. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
  92. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
  93. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
  94. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
  95. package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -8
  96. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  97. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
  98. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
  99. package/lib/module/shared/components/boundary/index.js +2 -2
  100. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
  101. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  102. package/lib/module/shared/components/boundary/portal/components/portal-provider.js +4 -1
  103. package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
  104. package/lib/module/shared/components/boundary/portal/components/portal.js +11 -8
  105. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  106. package/lib/module/shared/components/boundary/portal/resolve-portal.js +31 -0
  107. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +1 -0
  108. package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
  109. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
  110. package/lib/module/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +18 -20
  111. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
  112. package/lib/module/shared/components/boundary/utils/destination-signals.js +33 -2
  113. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  114. package/lib/module/shared/components/create-transition-aware-component.js +4 -22
  115. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  116. package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
  117. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
  118. package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
  119. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  120. package/lib/module/shared/components/screen-container/layers/content.js +4 -16
  121. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  122. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +5 -16
  123. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  124. package/lib/module/shared/components/screen-container/layers/surface-container.js +4 -16
  125. package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
  126. package/lib/module/shared/hooks/navigation/use-stack.js +19 -4
  127. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -35
  129. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
  131. package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
  132. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
  133. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  134. package/lib/module/shared/providers/screen/screen-composer.js +2 -2
  135. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
  136. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
  137. package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
  138. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -8
  139. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  140. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  141. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
  142. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
  143. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
  144. package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
  145. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +22 -35
  146. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  147. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
  148. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  149. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
  150. package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/index.js +1 -1
  152. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  153. package/lib/module/shared/providers/screen/styles/slot.provider.js +91 -0
  154. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
  155. package/lib/module/shared/stores/animation.store.js +2 -0
  156. package/lib/module/shared/stores/animation.store.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +14 -0
  158. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  159. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
  160. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  161. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
  162. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  163. package/lib/module/shared/utils/logger.js +11 -0
  164. package/lib/module/shared/utils/logger.js.map +1 -1
  165. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +2 -1
  166. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  167. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  168. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  169. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +2 -1
  170. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  171. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  172. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  173. package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
  174. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  175. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  176. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  177. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  178. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  179. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  181. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  183. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  185. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  187. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +32 -0
  188. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
  189. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +2 -1
  190. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +3 -2
  192. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +2 -2
  194. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -5
  196. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +3 -3
  198. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/boundary/index.d.ts +7 -211
  200. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  201. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  202. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
  204. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  206. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  207. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +1 -1
  208. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  209. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +14 -0
  210. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
  212. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/boundary/providers/{boundary-owner.provider.d.ts → boundary-root.provider.d.ts} +12 -14
  214. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
  215. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
  216. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  217. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +5 -6
  218. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  219. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  220. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  221. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  222. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  223. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  224. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  225. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  226. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  227. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  228. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  229. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  230. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  231. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  232. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  234. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  235. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  236. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  237. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  238. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  239. package/lib/typescript/shared/index.d.ts +663 -919
  240. package/lib/typescript/shared/index.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
  242. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
  243. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  244. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +2 -1
  245. package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
  246. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
  247. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  248. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  249. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  250. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  251. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  252. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  253. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  254. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
  255. package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
  256. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
  257. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  258. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  259. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
  260. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
  261. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
  262. package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
  263. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +0 -5
  264. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  265. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -3
  266. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  267. package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
  268. package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
  269. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  270. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +23 -0
  271. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
  272. package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
  273. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  274. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +6 -1
  275. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  276. package/lib/typescript/shared/stores/bounds/types.d.ts +13 -0
  277. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  278. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  279. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
  280. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  281. package/lib/typescript/shared/utils/logger.d.ts +6 -0
  282. package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
  283. package/package.json +6 -1
  284. package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
  285. package/src/shared/components/boundary/create-boundary-component.tsx +59 -142
  286. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +127 -0
  287. package/src/shared/components/boundary/hooks/use-boundary-presence.ts +7 -5
  288. package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +27 -11
  289. package/src/shared/components/boundary/hooks/use-initial-source-measurement.ts +5 -5
  290. package/src/shared/components/boundary/hooks/use-measurer.ts +11 -14
  291. package/src/shared/components/boundary/hooks/use-refresh-boundary.ts +5 -5
  292. package/src/shared/components/boundary/index.tsx +2 -2
  293. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +10 -3
  294. package/src/shared/components/boundary/portal/components/portal-provider.tsx +5 -1
  295. package/src/shared/components/boundary/portal/components/portal.tsx +15 -10
  296. package/src/shared/components/boundary/portal/resolve-portal.ts +40 -0
  297. package/src/shared/components/boundary/portal/teleport.ts +21 -0
  298. package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +27 -32
  299. package/src/shared/components/boundary/utils/destination-signals.ts +53 -2
  300. package/src/shared/components/create-transition-aware-component.tsx +3 -25
  301. package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
  302. package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
  303. package/src/shared/components/screen-container/layers/content.tsx +4 -16
  304. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
  305. package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
  306. package/src/shared/hooks/navigation/use-stack.tsx +32 -1
  307. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
  308. package/src/shared/providers/screen/animation/helpers/pipeline.ts +253 -77
  309. package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
  310. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
  311. package/src/shared/providers/screen/screen-composer.tsx +3 -3
  312. package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
  313. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +8 -10
  314. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +0 -1
  315. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
  316. package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
  317. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +29 -37
  318. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
  319. package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
  320. package/src/shared/providers/screen/styles/index.tsx +8 -4
  321. package/src/shared/providers/screen/styles/slot.provider.tsx +111 -0
  322. package/src/shared/stores/animation.store.ts +3 -0
  323. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +17 -0
  324. package/src/shared/stores/bounds/types.ts +14 -0
  325. package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
  326. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
  327. package/src/shared/utils/logger.ts +12 -0
  328. package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  329. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
  330. package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  331. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +0 -61
  332. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
  333. package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
  334. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
  335. package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
  336. package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
  337. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
  338. package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
  339. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
  340. package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
  341. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
  342. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
  343. package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
  344. package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
@@ -5,10 +5,14 @@ import {
5
5
  useCallback,
6
6
  useContext,
7
7
  useLayoutEffect,
8
+ useMemo,
8
9
  useRef,
9
10
  useSyncExternalStore,
10
11
  } from "react";
12
+ import { useDerivedValue } from "react-native-reanimated";
13
+ import { syncStackProgressValues } from "../../providers/screen/animation/helpers/stack-progress";
11
14
  import type { StackCoreContextValue } from "../../providers/stack/core.provider";
15
+ import { AnimationStore } from "../../stores/animation.store";
12
16
  import type { OverlayProps } from "../../types/overlay.types";
13
17
  import type {
14
18
  BaseStackDescriptor,
@@ -87,6 +91,30 @@ const createStackStore = (
87
91
  const StackContext = createContext<StackStoreApi | null>(null);
88
92
  StackContext.displayName = "Stack";
89
93
 
94
+ function StackProgressOwner({ routeKeys }: { routeKeys: string[] }) {
95
+ const visualProgressValues = useMemo(
96
+ () =>
97
+ routeKeys.map((routeKey) =>
98
+ AnimationStore.getValue(routeKey, "visualProgress"),
99
+ ),
100
+ [routeKeys],
101
+ );
102
+
103
+ const stackProgressValues = useMemo(
104
+ () =>
105
+ routeKeys.map((routeKey) =>
106
+ AnimationStore.getValue(routeKey, "stackProgress"),
107
+ ),
108
+ [routeKeys],
109
+ );
110
+
111
+ useDerivedValue(() => {
112
+ syncStackProgressValues(visualProgressValues, stackProgressValues);
113
+ });
114
+
115
+ return null;
116
+ }
117
+
90
118
  export function StackProvider({
91
119
  children,
92
120
  value,
@@ -116,7 +144,10 @@ export function StackProvider({
116
144
  });
117
145
 
118
146
  return (
119
- <StackContext.Provider value={store}>{children}</StackContext.Provider>
147
+ <StackContext.Provider value={store}>
148
+ <StackProgressOwner routeKeys={value.routeKeys} />
149
+ {children}
150
+ </StackContext.Provider>
120
151
  );
121
152
  }
122
153
 
@@ -11,6 +11,7 @@ import type { BaseStackRoute } from "../../../../../types/stack.types";
11
11
  export type BuiltState = {
12
12
  transitionProgress: SharedValue<number>;
13
13
  visualProgress: SharedValue<number>;
14
+ stackProgress: SharedValue<number>;
14
15
  willAnimate: SharedValue<number>;
15
16
  closing: SharedValue<number>;
16
17
  progressAnimating: SharedValue<number>;
@@ -7,21 +7,26 @@ import {
7
7
  useSharedValue,
8
8
  } from "react-native-reanimated";
9
9
  import { useSafeAreaInsets } from "react-native-safe-area-context";
10
- import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../../../constants";
10
+ import {
11
+ createScreenTransitionState,
12
+ DEFAULT_SCREEN_TRANSITION_STATE,
13
+ } from "../../../../constants";
11
14
  import { useStack } from "../../../../hooks/navigation/use-stack";
12
- import { AnimationStore } from "../../../../stores/animation.store";
13
15
  import type {
14
16
  ScreenInterpolationProps,
15
17
  ScreenStyleInterpolator,
18
+ ScreenTransitionState,
16
19
  } from "../../../../types/animation.types";
17
20
 
18
- import { useDescriptors } from "../../descriptors";
21
+ import { type BaseDescriptor, useDescriptors } from "../../descriptors";
22
+ import { buildScreenTransitionOptions } from "./build-screen-transition-options";
19
23
  import { updateDerivations } from "./derivations";
20
24
  import { hasTransitionsEnabled } from "./has-transitions-enabled";
21
25
  import { hydrateTransitionState } from "./hydrate-transition-state";
22
26
  import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
23
- import { deriveStackProgress } from "./stack-progress";
27
+ import { resolveStackProgress } from "./stack-progress";
24
28
  import { useBuildTransitionState } from "./use-build-transition-state";
29
+ import { toPlainRoute, toPlainValue } from "./worklet";
25
30
 
26
31
  export type ScreenInterpolatorFrame = Omit<
27
32
  ScreenInterpolationProps,
@@ -36,21 +41,148 @@ interface ScreenAnimationPipeline {
36
41
  currentInterpolator: ScreenStyleInterpolator | undefined;
37
42
  }
38
43
 
39
- const createInitialBaseInterpolatorProps = (
40
- dimensions: ScreenInterpolatorFrame["layouts"]["screen"],
41
- insets: ScreenInterpolatorFrame["insets"],
42
- ): ScreenInterpolatorFrame => {
43
- const current = {
44
- ...DEFAULT_SCREEN_TRANSITION_STATE,
45
- layouts: { screen: dimensions },
46
- };
44
+ const getInitialSettledProgress = (descriptor: BaseDescriptor) => {
45
+ const { snapPoints, initialSnapIndex = 0 } = descriptor.options;
47
46
 
48
- return {
47
+ if (!snapPoints?.length) {
48
+ return 1;
49
+ }
50
+
51
+ const clampedIndex = Math.min(
52
+ Math.max(0, initialSnapIndex),
53
+ snapPoints.length - 1,
54
+ );
55
+ const snapPoint = snapPoints[clampedIndex];
56
+
57
+ return typeof snapPoint === "number" ? snapPoint : 0;
58
+ };
59
+
60
+ const applyInitialProgress = ({
61
+ state,
62
+ dimensions,
63
+ progress,
64
+ entering = 0,
65
+ closing = 0,
66
+ animating = 0,
67
+ willAnimate = 0,
68
+ settled = entering || closing || animating ? 0 : 1,
69
+ }: {
70
+ state: ScreenTransitionState;
71
+ dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
72
+ progress: number;
73
+ entering?: number;
74
+ closing?: number;
75
+ animating?: number;
76
+ willAnimate?: number;
77
+ settled?: number;
78
+ }) => {
79
+ state.progress = progress;
80
+ state.transitionProgress = progress;
81
+ state.entering = entering;
82
+ state.closing = closing;
83
+ state.animating = animating;
84
+ state.willAnimate = willAnimate;
85
+ state.settled = settled;
86
+ state.logicallySettled = settled;
87
+ state.layouts.screen = dimensions;
88
+
89
+ return state;
90
+ };
91
+
92
+ const createInitialTransitionState = ({
93
+ descriptor,
94
+ dimensions,
95
+ progress,
96
+ entering,
97
+ animating,
98
+ willAnimate,
99
+ settled,
100
+ }: {
101
+ descriptor: BaseDescriptor;
102
+ dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
103
+ progress: number;
104
+ entering?: number;
105
+ animating?: number;
106
+ willAnimate?: number;
107
+ settled?: number;
108
+ }) => {
109
+ const meta = descriptor.options.meta
110
+ ? (toPlainValue(descriptor.options.meta) as Record<string, unknown>)
111
+ : undefined;
112
+ const state = createScreenTransitionState(
113
+ toPlainRoute(descriptor.route),
114
+ meta,
115
+ buildScreenTransitionOptions(descriptor.options),
116
+ );
117
+
118
+ return applyInitialProgress({
119
+ state,
120
+ dimensions,
121
+ progress,
122
+ entering,
123
+ animating,
124
+ willAnimate,
125
+ settled,
126
+ });
127
+ };
128
+
129
+ const createInitialInterpolatorProps = ({
130
+ dimensions,
131
+ insets,
132
+ currentDescriptor,
133
+ nextDescriptor,
134
+ prevDescriptor,
135
+ }: {
136
+ dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
137
+ insets: ScreenInterpolatorFrame["insets"];
138
+ currentDescriptor: BaseDescriptor;
139
+ nextDescriptor?: BaseDescriptor;
140
+ prevDescriptor?: BaseDescriptor;
141
+ }): ScreenInterpolatorFrame => {
142
+ const hasIncomingNext = !!nextDescriptor;
143
+ const isFocusedEntering = !!prevDescriptor && !nextDescriptor;
144
+ const shouldAnimateInitialMount =
145
+ !prevDescriptor &&
146
+ !nextDescriptor &&
147
+ !!currentDescriptor.options.experimental_animateOnInitialMount;
148
+ const currentProgress =
149
+ hasIncomingNext || (!isFocusedEntering && !shouldAnimateInitialMount)
150
+ ? getInitialSettledProgress(currentDescriptor)
151
+ : 0;
152
+ const currentEntering =
153
+ isFocusedEntering || shouldAnimateInitialMount ? 1 : 0;
154
+ const current = createInitialTransitionState({
155
+ descriptor: currentDescriptor,
156
+ dimensions,
157
+ progress: currentProgress,
158
+ entering: currentEntering,
159
+ animating: currentEntering,
160
+ willAnimate: currentEntering,
161
+ });
162
+ const previous = prevDescriptor
163
+ ? createInitialTransitionState({
164
+ descriptor: prevDescriptor,
165
+ dimensions,
166
+ progress: getInitialSettledProgress(prevDescriptor),
167
+ })
168
+ : undefined;
169
+ const next = nextDescriptor
170
+ ? createInitialTransitionState({
171
+ descriptor: nextDescriptor,
172
+ dimensions,
173
+ progress: 0,
174
+ entering: 1,
175
+ animating: 1,
176
+ willAnimate: 1,
177
+ settled: 0,
178
+ })
179
+ : undefined;
180
+ const frame: ScreenInterpolatorFrame = {
49
181
  layouts: current.layouts,
50
182
  insets,
51
- previous: undefined,
183
+ previous,
52
184
  current,
53
- next: undefined,
185
+ next,
54
186
  progress: 0,
55
187
  stackProgress: 0,
56
188
  logicallySettled: 1,
@@ -58,13 +190,94 @@ const createInitialBaseInterpolatorProps = (
58
190
  active: current,
59
191
  inactive: undefined,
60
192
  };
193
+
194
+ updateDerivations(frame);
195
+ frame.stackProgress = frame.progress;
196
+ frame.logicallySettled = frame.active.settled;
197
+
198
+ return frame;
199
+ };
200
+
201
+ type BuiltTransitionState = NonNullable<
202
+ ReturnType<typeof useBuildTransitionState>
203
+ >;
204
+
205
+ const hydrateInterpolatorFrame = <TFrame extends ScreenInterpolatorFrame>({
206
+ frame,
207
+ dimensions,
208
+ insets,
209
+ currentAnimation,
210
+ nextAnimation,
211
+ prevAnimation,
212
+ nextHasTransitions,
213
+ interpolatorOptions,
214
+ }: {
215
+ frame: TFrame;
216
+ dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
217
+ insets: ScreenInterpolatorFrame["insets"];
218
+ currentAnimation: BuiltTransitionState | undefined;
219
+ nextAnimation: BuiltTransitionState | undefined;
220
+ prevAnimation: BuiltTransitionState | undefined;
221
+ nextHasTransitions: boolean;
222
+ interpolatorOptions: SelectedInterpolatorOptions;
223
+ }): TFrame => {
224
+ "worklet";
225
+ const shouldApplyOptionsToCurrent = interpolatorOptions.owner === "current";
226
+ const shouldApplyOptionsToNext =
227
+ interpolatorOptions.owner === "next" &&
228
+ !!nextAnimation &&
229
+ nextHasTransitions;
230
+ const previousCurrentProgress = currentAnimation?.visualProgress.get();
231
+ const previousNextProgress =
232
+ nextAnimation && nextHasTransitions
233
+ ? nextAnimation.visualProgress.get()
234
+ : undefined;
235
+
236
+ frame.previous = prevAnimation
237
+ ? hydrateTransitionState(prevAnimation, dimensions)
238
+ : undefined;
239
+
240
+ frame.current = currentAnimation
241
+ ? hydrateTransitionState(
242
+ currentAnimation,
243
+ dimensions,
244
+ shouldApplyOptionsToCurrent ? interpolatorOptions.options : undefined,
245
+ )
246
+ : DEFAULT_SCREEN_TRANSITION_STATE;
247
+
248
+ frame.next =
249
+ nextAnimation && nextHasTransitions
250
+ ? hydrateTransitionState(
251
+ nextAnimation,
252
+ dimensions,
253
+ shouldApplyOptionsToNext ? interpolatorOptions.options : undefined,
254
+ )
255
+ : undefined;
256
+
257
+ frame.layouts = frame.current.layouts;
258
+ frame.insets = insets;
259
+
260
+ updateDerivations(frame);
261
+
262
+ frame.stackProgress = resolveStackProgress(
263
+ currentAnimation?.stackProgress,
264
+ frame.progress,
265
+ frame.current.progress,
266
+ previousCurrentProgress,
267
+ frame.next?.progress,
268
+ previousNextProgress,
269
+ );
270
+ frame.logicallySettled = frame.active.settled;
271
+
272
+ return frame;
61
273
  };
62
274
 
63
275
  export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
64
- const { flags, routeKeys } = useStack();
276
+ const transitionsAlwaysOn = useStack(
277
+ (stack) => stack.flags.TRANSITIONS_ALWAYS_ON,
278
+ );
65
279
  const dimensions = useWindowDimensions();
66
280
  const insets = useSafeAreaInsets();
67
- const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
68
281
 
69
282
  const {
70
283
  current: currDescriptor,
@@ -76,84 +289,47 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
76
289
  const nextAnimation = useBuildTransitionState(nextDescriptor);
77
290
  const prevAnimation = useBuildTransitionState(prevDescriptor);
78
291
 
79
- const currentRouteKey = currDescriptor?.route?.key;
80
- const currentIndex = routeKeys.indexOf(currentRouteKey);
81
- const visualProgressValues = useMemo(() => {
82
- return routeKeys.map((routeKey) =>
83
- AnimationStore.getValue(routeKey, "visualProgress"),
84
- );
85
- }, [routeKeys]);
86
-
87
292
  const nextRouteKey = nextDescriptor?.route?.key;
88
293
  const nextHasTransitions =
89
294
  !!nextRouteKey &&
90
295
  hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
91
296
 
92
- const screenInterpolatorProps = useSharedValue(
93
- createInitialBaseInterpolatorProps(dimensions, insets),
297
+ const initialInterpolatorProps = useMemo(
298
+ () =>
299
+ createInitialInterpolatorProps({
300
+ dimensions,
301
+ insets,
302
+ currentDescriptor: currDescriptor,
303
+ nextDescriptor,
304
+ prevDescriptor,
305
+ }),
306
+ [dimensions, insets, currDescriptor, nextDescriptor, prevDescriptor],
94
307
  );
308
+
309
+ const screenInterpolatorProps = useSharedValue(initialInterpolatorProps);
95
310
  const selectedInterpolatorOptions =
96
311
  useSharedValue<SelectedInterpolatorOptions>({
97
312
  owner: "current",
98
313
  });
99
314
 
100
315
  const propsRevisionState = useSharedValue({ value: 0 });
316
+
101
317
  const screenInterpolatorPropsRevision = useDerivedValue<number>(() => {
102
318
  "worklet";
103
319
 
104
320
  screenInterpolatorProps.modify((frame) => {
105
321
  "worklet";
106
322
  const interpolatorOptions = selectedInterpolatorOptions.get();
107
- const shouldApplyOptionsToCurrent =
108
- interpolatorOptions.owner === "current";
109
- const shouldApplyOptionsToNext =
110
- interpolatorOptions.owner === "next" &&
111
- !!nextAnimation &&
112
- nextHasTransitions;
113
-
114
- frame.previous = prevAnimation
115
- ? hydrateTransitionState(prevAnimation, dimensions)
116
- : undefined;
117
-
118
- frame.current = currentAnimation
119
- ? hydrateTransitionState(
120
- currentAnimation,
121
- dimensions,
122
- shouldApplyOptionsToCurrent
123
- ? interpolatorOptions.options
124
- : undefined,
125
- )
126
- : DEFAULT_SCREEN_TRANSITION_STATE;
127
-
128
- frame.next =
129
- nextAnimation && nextHasTransitions
130
- ? hydrateTransitionState(
131
- nextAnimation,
132
- dimensions,
133
- shouldApplyOptionsToNext
134
- ? interpolatorOptions.options
135
- : undefined,
136
- )
137
- : undefined;
138
-
139
- frame.layouts = frame.current.layouts;
140
- frame.insets = insets;
141
-
142
- updateDerivations(frame);
143
-
144
- frame.stackProgress = deriveStackProgress(
145
- routeKeys,
146
- visualProgressValues,
147
- currentIndex,
148
- frame.progress,
149
- currentRouteKey,
150
- frame.current.progress,
151
- nextRouteKey,
152
- frame.next?.progress,
153
- );
154
- frame.logicallySettled = frame.active.settled;
155
-
156
- return frame;
323
+ return hydrateInterpolatorFrame({
324
+ frame,
325
+ dimensions,
326
+ insets,
327
+ currentAnimation,
328
+ nextAnimation,
329
+ prevAnimation,
330
+ nextHasTransitions,
331
+ interpolatorOptions,
332
+ });
157
333
  }, false);
158
334
 
159
335
  // Critical reactive dependency for `screenInterpolatorProps`.
@@ -1,28 +1,43 @@
1
1
  import type { SharedValue } from "react-native-reanimated";
2
2
 
3
- export const deriveStackProgress = (
4
- routeKeys: string[],
3
+ export const syncStackProgressValues = (
5
4
  visualProgressValues: SharedValue<number>[],
6
- currentIndex: number,
5
+ stackProgressValues: SharedValue<number>[],
6
+ ) => {
7
+ "worklet";
8
+ let total = 0;
9
+
10
+ for (let i = visualProgressValues.length - 1; i >= 0; i--) {
11
+ total += visualProgressValues[i]?.get() ?? 0;
12
+ const stackProgress = stackProgressValues[i];
13
+
14
+ if (stackProgress && stackProgress.get() !== total) {
15
+ stackProgress.set(total);
16
+ }
17
+ }
18
+ };
19
+
20
+ export const resolveStackProgress = (
21
+ stackProgress: SharedValue<number> | undefined,
7
22
  fallbackProgress: number,
8
- currentRouteKey: string | undefined,
9
23
  currentProgress: number,
10
- nextRouteKey: string | undefined,
24
+ previousCurrentProgress: number | undefined,
11
25
  nextProgress: number | undefined,
26
+ previousNextProgress: number | undefined,
12
27
  ) => {
13
28
  "worklet";
14
- if (currentIndex < 0) return fallbackProgress;
29
+ if (!stackProgress) {
30
+ return fallbackProgress;
31
+ }
15
32
 
16
- let total = 0;
17
- for (let i = currentIndex; i < visualProgressValues.length; i++) {
18
- const routeKey = routeKeys[i];
19
- if (routeKey === currentRouteKey) {
20
- total += currentProgress;
21
- } else if (routeKey === nextRouteKey && nextProgress !== undefined) {
22
- total += nextProgress;
23
- } else {
24
- total += visualProgressValues[i].get();
25
- }
33
+ let total = stackProgress.get();
34
+
35
+ if (previousCurrentProgress !== undefined) {
36
+ total += currentProgress - previousCurrentProgress;
37
+ }
38
+
39
+ if (nextProgress !== undefined && previousNextProgress !== undefined) {
40
+ total += nextProgress - previousNextProgress;
26
41
  }
27
42
 
28
43
  return total;
@@ -22,6 +22,7 @@ import { toPlainRoute, toPlainValue } from "./worklet";
22
22
  type BuiltState = {
23
23
  transitionProgress: SharedValue<number>;
24
24
  visualProgress: SharedValue<number>;
25
+ stackProgress: SharedValue<number>;
25
26
  willAnimate: SharedValue<number>;
26
27
  closing: SharedValue<number>;
27
28
  progressAnimating: SharedValue<number>;
@@ -67,6 +68,7 @@ export const useBuildTransitionState = (
67
68
  return {
68
69
  transitionProgress: AnimationStore.getValue(key, "transitionProgress"),
69
70
  visualProgress: AnimationStore.getValue(key, "visualProgress"),
71
+ stackProgress: AnimationStore.getValue(key, "stackProgress"),
70
72
  willAnimate: AnimationStore.getValue(key, "willAnimate"),
71
73
  closing: AnimationStore.getValue(key, "closing"),
72
74
  entering: AnimationStore.getValue(key, "entering"),
@@ -5,7 +5,7 @@ import { ScreenAnimationProvider } from "./animation";
5
5
  import { type BaseDescriptor, DescriptorsProvider } from "./descriptors";
6
6
  import { ScreenGestureProvider } from "./gestures";
7
7
  import { ScreenOptionsProvider } from "./options";
8
- import { ScreenStylesProvider } from "./styles";
8
+ import { ScreenSlotProvider } from "./styles";
9
9
 
10
10
  type Props<TDescriptor extends BaseDescriptor> = {
11
11
  previous?: TDescriptor;
@@ -26,9 +26,9 @@ export function ScreenComposer<TDescriptor extends BaseDescriptor>({
26
26
  <ScreenOptionsProvider>
27
27
  <ScreenGestureProvider>
28
28
  <ScreenAnimationProvider>
29
- <ScreenStylesProvider>
29
+ <ScreenSlotProvider>
30
30
  <ScreenContainer>{children}</ScreenContainer>
31
- </ScreenStylesProvider>
31
+ </ScreenSlotProvider>
32
32
  </ScreenAnimationProvider>
33
33
  </ScreenGestureProvider>
34
34
  </ScreenOptionsProvider>
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The "pre-start" window of an opening transition: the screen has committed to
3
+ * opening (`entering`) but `transitionProgress` has not yet moved past 0, so no
4
+ * transformed frame has been produced yet.
5
+ *
6
+ * This window is a quarantine, and two source-level guards key off it:
7
+ * - the visibility gate keeps the entering screen hidden (it must not be SEEN), and
8
+ * - interpolator ownership stays on "current" so the entering screen does not
9
+ * DRIVE other screens' styles until its transition is actually live.
10
+ *
11
+ * Both must agree on when the open transition has started, so the threshold
12
+ * lives here in one place rather than being re-derived at each site.
13
+ */
14
+ export const hasOpenTransitionStarted = (transitionProgress: number) => {
15
+ "worklet";
16
+ return transitionProgress > 0;
17
+ };
18
+
19
+ export const isOpeningBeforeStart = (
20
+ entering: number,
21
+ transitionProgress: number,
22
+ ) => {
23
+ "worklet";
24
+ return !!entering && !hasOpenTransitionStarted(transitionProgress);
25
+ };
@@ -35,6 +35,11 @@ const getForwardedSlot = (
35
35
  return slot;
36
36
  };
37
37
 
38
+ const hasDefinedBucketValue = (value: unknown) => {
39
+ "worklet";
40
+ return value !== undefined && value !== null;
41
+ };
42
+
38
43
  const hasEitherResetPatch = (
39
44
  hasStyleResetPatch: boolean,
40
45
  hasPropResetPatch: boolean,
@@ -43,11 +48,6 @@ const hasEitherResetPatch = (
43
48
  return hasStyleResetPatch || hasPropResetPatch;
44
49
  };
45
50
 
46
- const hasDefinedBucketValue = (value: unknown) => {
47
- "worklet";
48
- return value !== undefined && value !== null;
49
- };
50
-
51
51
  const hasResettableDisappearedKeys = (
52
52
  previousKeys: Record<string, true> | undefined,
53
53
  previousResetValues: Record<string, unknown> | undefined,
@@ -81,7 +81,6 @@ const getResolvedSlotOutput = ({
81
81
  }) => {
82
82
  "worklet";
83
83
  const state = getResolvedSlotState(slot);
84
-
85
84
  const hasStyleResetPatch = hasResettableDisappearedKeys(
86
85
  previousState?.styleKeys,
87
86
  previousState?.styleResetValues,
@@ -459,10 +458,9 @@ const appendPreviousSlots = (context: ResolveSlotStylesContext) => {
459
458
  };
460
459
 
461
460
  /**
462
- * Resolves slot styles for the current screen pass and resets keys a slot
463
- * emitted previously but no longer returns. Reanimated does not reliably clear
464
- * animated values with undefined, so known keys and numeric values are reset to
465
- * concrete identity values.
461
+ * Resolves slot styles for the current screen pass and emits reset values for
462
+ * transition-owned keys that existed in the previous resolved map but no longer
463
+ * exist in the current one.
466
464
  */
467
465
  export const resolveSlotStyles = ({
468
466
  localStylesMaps,
@@ -139,7 +139,6 @@ export const materializeResolvedSlot = ({
139
139
  hasAnyStyleKeys,
140
140
  hasStyleResetPatch,
141
141
  });
142
-
143
142
  const resolvedProps = materializeResolvedProps({
144
143
  baseProps,
145
144
  previousState,
@@ -2,11 +2,6 @@ import type { NormalizedTransitionSlotStyle } from "../../../../../types/animati
2
2
  import { getPropResetValue, getStyleResetValue } from "./reset-values";
3
3
  import type { ResettableStyleState } from "./types";
4
4
 
5
- const hasTrackedKey = (keys: Record<string, true> | undefined, key: string) => {
6
- "worklet";
7
- return keys !== undefined && keys[key] === true;
8
- };
9
-
10
5
  const isDefinedStyleValue = (value: unknown) => {
11
6
  "worklet";
12
7
  return value !== undefined && value !== null;
@@ -52,25 +47,6 @@ const collectDefinedKeys = ({
52
47
  };
53
48
  };
54
49
 
55
- export const hasDisappearedKeys = (
56
- previousKeys: Record<string, true> | undefined,
57
- currentKeys: Record<string, true> | undefined,
58
- ) => {
59
- "worklet";
60
-
61
- if (!previousKeys) {
62
- return false;
63
- }
64
-
65
- for (const key in previousKeys) {
66
- if (!hasTrackedKey(currentKeys, key)) {
67
- return true;
68
- }
69
- }
70
-
71
- return false;
72
- };
73
-
74
50
  const hasEitherKeySet = (
75
51
  styleKeys: Record<string, true> | undefined,
76
52
  propKeys: Record<string, true> | undefined,