react-native-screen-transitions 3.4.0-alpha.2 → 3.4.0-alpha.4

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 (334) hide show
  1. package/lib/commonjs/component-stack/components/component-screen.js +1 -1
  2. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
  3. package/lib/commonjs/shared/animation/snap-to.js +6 -3
  4. package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +47 -4
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +2 -2
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/index.js +4 -18
  12. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-transition-aware-component.js +1 -2
  14. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  15. package/lib/commonjs/shared/components/native-screen.js +3 -3
  16. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  17. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
  18. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  19. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  20. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-container/index.js +7 -4
  22. package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
  23. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +8 -5
  24. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  25. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  26. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +17 -24
  27. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  28. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  29. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  30. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  31. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  32. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  33. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  34. package/lib/commonjs/shared/components/screen-lifecycle/index.js +5 -3
  35. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  36. package/lib/commonjs/shared/configs/presets.js +9 -10
  37. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  38. package/lib/commonjs/shared/constants.js +26 -6
  39. package/lib/commonjs/shared/constants.js.map +1 -1
  40. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +11 -36
  41. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  42. package/lib/commonjs/shared/index.js +4 -10
  43. package/lib/commonjs/shared/index.js.map +1 -1
  44. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +12 -9
  45. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  46. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  47. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  48. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  49. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  50. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js +1 -1
  51. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js.map +1 -1
  52. package/lib/commonjs/shared/providers/register-bounds.provider.js +5 -5
  53. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js +17 -0
  55. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  56. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +72 -0
  57. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  60. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +42 -0
  61. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  62. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +50 -0
  63. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  64. package/lib/commonjs/shared/providers/screen/styles.provider.js +34 -10
  65. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  66. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  67. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  68. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  69. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  70. package/lib/commonjs/shared/stores/animation.store.js +12 -40
  71. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  72. package/lib/commonjs/shared/stores/gesture.store.js +13 -33
  73. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  74. package/lib/commonjs/shared/stores/system.store.js +31 -0
  75. package/lib/commonjs/shared/stores/system.store.js.map +1 -0
  76. package/lib/commonjs/shared/types/bounds.types.js +1 -3
  77. package/lib/commonjs/shared/types/bounds.types.js.map +1 -1
  78. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +2 -2
  79. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +2 -2
  81. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/index.js +23 -50
  83. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/zoom/build.js +100 -363
  85. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  86. package/lib/commonjs/shared/utils/bounds/zoom/config.js +15 -101
  87. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
  88. package/lib/commonjs/shared/utils/bounds/zoom/math.js +154 -0
  89. package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -0
  90. package/lib/commonjs/shared/utils/bounds/zoom/types.js +1 -3
  91. package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -1
  92. package/lib/commonjs/shared/utils/create-store.js +54 -0
  93. package/lib/commonjs/shared/utils/create-store.js.map +1 -0
  94. package/lib/module/component-stack/components/component-screen.js +1 -1
  95. package/lib/module/component-stack/components/component-screen.js.map +1 -1
  96. package/lib/module/shared/animation/snap-to.js +6 -3
  97. package/lib/module/shared/animation/snap-to.js.map +1 -1
  98. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
  99. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +48 -5
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +2 -2
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
  104. package/lib/module/shared/components/create-boundary-component/index.js +4 -18
  105. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  106. package/lib/module/shared/components/create-transition-aware-component.js +1 -2
  107. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  108. package/lib/module/shared/components/native-screen.js +3 -3
  109. package/lib/module/shared/components/native-screen.js.map +1 -1
  110. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
  111. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
  112. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  113. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  114. package/lib/module/shared/components/screen-container/index.js +7 -4
  115. package/lib/module/shared/components/screen-container/index.js.map +1 -1
  116. package/lib/module/shared/components/screen-container/layers/backdrop.js +8 -5
  117. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  118. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  119. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +20 -27
  120. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  121. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  122. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  123. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  124. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  125. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  126. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  127. package/lib/module/shared/components/screen-lifecycle/index.js +5 -3
  128. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  129. package/lib/module/shared/configs/presets.js +10 -11
  130. package/lib/module/shared/configs/presets.js.map +1 -1
  131. package/lib/module/shared/constants.js +25 -5
  132. package/lib/module/shared/constants.js.map +1 -1
  133. package/lib/module/shared/hooks/animation/use-associated-style.js +12 -37
  134. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  135. package/lib/module/shared/index.js +1 -1
  136. package/lib/module/shared/index.js.map +1 -1
  137. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +12 -9
  138. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  139. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  140. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  141. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  142. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  143. package/lib/module/shared/providers/gestures/use-build-gestures.js +1 -1
  144. package/lib/module/shared/providers/gestures/use-build-gestures.js.map +1 -1
  145. package/lib/module/shared/providers/register-bounds.provider.js +5 -5
  146. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  147. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js +12 -0
  148. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  149. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +67 -0
  150. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  151. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  152. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  153. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +37 -0
  154. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  155. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +44 -0
  156. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
  157. package/lib/module/shared/providers/screen/styles.provider.js +33 -11
  158. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  159. package/lib/module/shared/providers/stack/direct.provider.js +1 -1
  160. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  161. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  162. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  163. package/lib/module/shared/stores/animation.store.js +12 -40
  164. package/lib/module/shared/stores/animation.store.js.map +1 -1
  165. package/lib/module/shared/stores/gesture.store.js +13 -33
  166. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  167. package/lib/module/shared/stores/system.store.js +27 -0
  168. package/lib/module/shared/stores/system.store.js.map +1 -0
  169. package/lib/module/shared/types/bounds.types.js +9 -1
  170. package/lib/module/shared/types/bounds.types.js.map +1 -1
  171. package/lib/module/shared/utils/animation/animate-to-progress.js +2 -2
  172. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  173. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +3 -3
  174. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
  175. package/lib/module/shared/utils/bounds/index.js +23 -50
  176. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  177. package/lib/module/shared/utils/bounds/zoom/build.js +94 -357
  178. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  179. package/lib/module/shared/utils/bounds/zoom/config.js +12 -98
  180. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
  181. package/lib/module/shared/utils/bounds/zoom/math.js +136 -0
  182. package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -0
  183. package/lib/module/shared/utils/bounds/zoom/types.js +1 -1
  184. package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -1
  185. package/lib/module/shared/utils/create-store.js +50 -0
  186. package/lib/module/shared/utils/create-store.js.map +1 -0
  187. package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
  188. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +1 -2
  189. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
  190. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
  191. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
  195. package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
  196. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  199. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  201. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +2 -1
  204. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts +2 -1
  206. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  207. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  208. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  209. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  210. package/lib/typescript/shared/constants.d.ts +9 -3
  211. package/lib/typescript/shared/constants.d.ts.map +1 -1
  212. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
  213. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  214. package/lib/typescript/shared/index.d.ts +4 -4
  215. package/lib/typescript/shared/index.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  217. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
  218. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -1
  219. package/lib/typescript/shared/providers/gestures/use-build-gestures.d.ts.map +1 -1
  220. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  221. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts +8 -0
  222. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts.map +1 -0
  223. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +22 -0
  224. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -0
  225. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +4 -2
  226. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  227. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +21 -0
  228. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -0
  229. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +14 -0
  230. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
  231. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
  232. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  233. package/lib/typescript/shared/stores/animation.store.d.ts +10 -17
  234. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  235. package/lib/typescript/shared/stores/gesture.store.d.ts +24 -14
  236. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  237. package/lib/typescript/shared/stores/system.store.d.ts +27 -0
  238. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -0
  239. package/lib/typescript/shared/types/animation.types.d.ts +40 -6
  240. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  241. package/lib/typescript/shared/types/bounds.types.d.ts +14 -42
  242. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  243. package/lib/typescript/shared/types/index.d.ts +2 -2
  244. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  245. package/lib/typescript/shared/types/screen.types.d.ts +16 -0
  246. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  247. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +3 -1
  248. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  249. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
  250. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  251. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -3
  252. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  253. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -3
  254. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  255. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +15 -41
  256. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
  257. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +44 -0
  258. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -0
  259. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +8 -13
  260. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
  261. package/lib/typescript/shared/utils/create-store.d.ts +14 -0
  262. package/lib/typescript/shared/utils/create-store.d.ts.map +1 -0
  263. package/package.json +1 -1
  264. package/src/component-stack/components/component-screen.tsx +1 -1
  265. package/src/shared/animation/snap-to.ts +10 -4
  266. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +1 -1
  267. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +82 -10
  268. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +2 -5
  269. package/src/shared/components/create-boundary-component/index.tsx +3 -23
  270. package/src/shared/components/create-transition-aware-component.tsx +0 -1
  271. package/src/shared/components/native-screen.tsx +3 -9
  272. package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
  273. package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
  274. package/src/shared/components/screen-container/index.tsx +5 -2
  275. package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
  276. package/src/shared/components/screen-container/layers/content.tsx +3 -0
  277. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +30 -32
  278. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +4 -2
  279. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +8 -0
  280. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +21 -10
  281. package/src/shared/components/screen-lifecycle/index.tsx +8 -2
  282. package/src/shared/configs/presets.ts +18 -17
  283. package/src/shared/constants.ts +19 -3
  284. package/src/shared/hooks/animation/use-associated-style.ts +12 -62
  285. package/src/shared/index.ts +4 -3
  286. package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
  287. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
  288. package/src/shared/providers/gestures/helpers/register-direction-claims.ts +1 -1
  289. package/src/shared/providers/gestures/use-build-gestures.ts +1 -3
  290. package/src/shared/providers/register-bounds.provider.tsx +5 -11
  291. package/src/shared/providers/screen/animation/helpers/has-transitions-enabled.ts +14 -0
  292. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +108 -0
  293. package/src/shared/providers/screen/animation/helpers/pipeline.ts +37 -199
  294. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +77 -0
  295. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +61 -0
  296. package/src/shared/providers/screen/styles.provider.tsx +99 -72
  297. package/src/shared/providers/stack/direct.provider.tsx +1 -1
  298. package/src/shared/providers/stack/helpers/use-processed-routes.ts +1 -1
  299. package/src/shared/stores/animation.store.ts +11 -61
  300. package/src/shared/stores/gesture.store.ts +25 -45
  301. package/src/shared/stores/system.store.ts +44 -0
  302. package/src/shared/types/animation.types.ts +43 -6
  303. package/src/shared/types/bounds.types.ts +25 -25
  304. package/src/shared/types/index.ts +2 -0
  305. package/src/shared/types/screen.types.ts +17 -0
  306. package/src/shared/utils/animation/animate-to-progress.ts +4 -2
  307. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -3
  308. package/src/shared/utils/bounds/index.ts +26 -75
  309. package/src/shared/utils/bounds/zoom/build.ts +174 -497
  310. package/src/shared/utils/bounds/zoom/config.ts +14 -164
  311. package/src/shared/utils/bounds/zoom/math.ts +193 -0
  312. package/src/shared/utils/bounds/zoom/types.ts +15 -17
  313. package/src/shared/utils/create-store.ts +62 -0
  314. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +0 -6
  315. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +0 -1
  316. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +0 -54
  317. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +0 -1
  318. package/lib/commonjs/shared/utils/bounds/zoom/index.js +0 -20
  319. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +0 -1
  320. package/lib/module/shared/utils/bounds/types/frame-props.js +0 -4
  321. package/lib/module/shared/utils/bounds/types/frame-props.js.map +0 -1
  322. package/lib/module/shared/utils/bounds/zoom/accessor.js +0 -49
  323. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +0 -1
  324. package/lib/module/shared/utils/bounds/zoom/index.js +0 -5
  325. package/lib/module/shared/utils/bounds/zoom/index.js.map +0 -1
  326. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +0 -5
  327. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +0 -1
  328. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +0 -17
  329. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +0 -1
  330. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +0 -3
  331. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +0 -1
  332. package/src/shared/utils/bounds/types/frame-props.ts +0 -5
  333. package/src/shared/utils/bounds/zoom/accessor.ts +0 -69
  334. package/src/shared/utils/bounds/zoom/index.ts +0 -2
@@ -6,6 +6,7 @@ import {
6
6
  useDescriptors,
7
7
  } from "../../../providers/screen/descriptors";
8
8
  import { AnimationStore } from "../../../stores/animation.store";
9
+ import { SystemStore } from "../../../stores/system.store";
9
10
  import { animateToProgress } from "../../../utils/animation/animate-to-progress";
10
11
 
11
12
  export function useContentLayout() {
@@ -13,15 +14,19 @@ export function useContentLayout() {
13
14
  const { isFirstKey } = useDescriptorDerivations();
14
15
  const { height: screenHeight } = useWindowDimensions();
15
16
  const routeKey = current.route.key;
16
- const animations = AnimationStore.getRouteAnimations(routeKey);
17
- const autoSnapPointValue = AnimationStore.getAnimation(
17
+ const animations = AnimationStore.getBag(routeKey);
18
+ const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
19
+ const resolvedAutoSnapPointValue = SystemStore.getValue(
18
20
  routeKey,
19
- "autoSnapPoint",
21
+ "resolvedAutoSnapPoint",
20
22
  );
21
- const contentLayoutValue = AnimationStore.getAnimation(
23
+ const measuredContentLayoutValue = SystemStore.getValue(
22
24
  routeKey,
23
- "contentLayout",
25
+ "measuredContentLayout",
24
26
  );
27
+ const experimental_animateOnInitialMount =
28
+ current.options.experimental_animateOnInitialMount;
29
+ const transitionSpec = current.options.transitionSpec;
25
30
 
26
31
  return useCallback(
27
32
  (event: LayoutChangeEvent) => {
@@ -29,54 +34,48 @@ export function useContentLayout() {
29
34
  if (width <= 0 || height <= 0) return;
30
35
 
31
36
  const fraction = Math.min(height / screenHeight, 1);
32
- const transitionSpec = current.options.transitionSpec;
33
37
 
34
- runOnUI(
35
- (
36
- nextWidth: number,
37
- nextHeight: number,
38
- nextFraction: number,
39
- isInitialScreen: boolean,
40
- spec: typeof transitionSpec,
41
- ) => {
42
- "worklet";
43
- contentLayoutValue.value = {
44
- width: nextWidth,
45
- height: nextHeight,
46
- };
38
+ runOnUI((nextWidth: number, nextHeight: number, nextFraction: number) => {
39
+ "worklet";
40
+ measuredContentLayoutValue.value = {
41
+ width: nextWidth,
42
+ height: nextHeight,
43
+ };
47
44
 
48
- const isFirstMeasurement = autoSnapPointValue.value <= 0;
49
- autoSnapPointValue.value = nextFraction;
45
+ const isFirstMeasurement = resolvedAutoSnapPointValue.value <= 0;
46
+ resolvedAutoSnapPointValue.value = nextFraction;
50
47
 
51
- if (
52
- !isFirstMeasurement ||
53
- animations.progress.value !== 0 ||
54
- animations.animating.value !== 0
55
- ) {
56
- return;
57
- }
48
+ if (
49
+ !isFirstMeasurement ||
50
+ animations.progress.value !== 0 ||
51
+ animations.animating.value !== 0
52
+ ) {
53
+ return;
54
+ }
58
55
 
59
- if (isInitialScreen) {
60
- animations.targetProgress.value = nextFraction;
61
- animations.progress.value = nextFraction;
62
- return;
63
- }
56
+ if (isFirstKey && !experimental_animateOnInitialMount) {
57
+ targetProgressValue.value = nextFraction;
58
+ animations.progress.value = nextFraction;
59
+ return;
60
+ }
64
61
 
65
- animateToProgress({
66
- target: nextFraction,
67
- spec,
68
- animations,
69
- });
70
- },
71
- )(width, height, fraction, isFirstKey, transitionSpec);
62
+ animateToProgress({
63
+ target: nextFraction,
64
+ spec: transitionSpec,
65
+ animations,
66
+ targetProgress: targetProgressValue,
67
+ });
68
+ })(width, height, fraction);
72
69
  },
73
70
  [
74
71
  animations,
75
- autoSnapPointValue,
76
- contentLayoutValue,
77
- current.options.transitionSpec,
72
+ targetProgressValue,
73
+ resolvedAutoSnapPointValue,
74
+ measuredContentLayoutValue,
78
75
  isFirstKey,
79
76
  screenHeight,
77
+ experimental_animateOnInitialMount,
78
+ transitionSpec,
80
79
  ],
81
80
  );
82
81
  }
@@ -1,5 +1,6 @@
1
1
  import { memo } from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
+ import { DeferredVisibilityHost } from "./deferred-visibility-host";
3
4
  import { useBackdropPointerEvents } from "./hooks/use-backdrop-pointer-events";
4
5
  import { BackdropLayer } from "./layers/backdrop";
5
6
  import { ContentLayer } from "./layers/content";
@@ -13,8 +14,10 @@ export const ScreenContainer = memo(({ children }: Props) => {
13
14
 
14
15
  return (
15
16
  <View style={styles.container} pointerEvents={pointerEvents}>
16
- <BackdropLayer />
17
- <ContentLayer>{children}</ContentLayer>
17
+ <DeferredVisibilityHost>
18
+ <BackdropLayer />
19
+ <ContentLayer>{children}</ContentLayer>
20
+ </DeferredVisibilityHost>
18
21
  </View>
19
22
  );
20
23
  });
@@ -12,6 +12,7 @@ import { useDescriptors } from "../../../providers/screen/descriptors";
12
12
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
13
13
  import { AnimationStore } from "../../../stores/animation.store";
14
14
  import { GestureStore } from "../../../stores/gesture.store";
15
+ import { SystemStore } from "../../../stores/system.store";
15
16
  import { animateToProgress } from "../../../utils/animation/animate-to-progress";
16
17
  import { findCollapseTarget } from "../../../utils/gesture/find-collapse-target";
17
18
  import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
@@ -24,10 +25,11 @@ export const BackdropLayer = memo(function BackdropLayer() {
24
25
 
25
26
  const BackdropComponent = current.options.backdropComponent;
26
27
  const routeKey = current.route.key;
27
- const animations = AnimationStore.getRouteAnimations(routeKey);
28
- const autoSnapPointValue = AnimationStore.getAnimation(
28
+ const animations = AnimationStore.getBag(routeKey);
29
+ const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
30
+ const resolvedAutoSnapPointValue = SystemStore.getValue(
29
31
  routeKey,
30
- "autoSnapPoint",
32
+ "resolvedAutoSnapPoint",
31
33
  );
32
34
 
33
35
  const AnimatedBackdropComponent = useMemo(
@@ -53,13 +55,15 @@ export const BackdropLayer = memo(function BackdropLayer() {
53
55
  return;
54
56
  }
55
57
 
56
- const gestures = GestureStore.getRouteGestures(routeKey);
58
+ const gestures = GestureStore.getBag(routeKey);
57
59
  const transitionSpec = current.options.transitionSpec;
58
60
 
59
61
  runOnUI(() => {
60
62
  "worklet";
61
63
  const resolvedSnaps = rawSnapPoints
62
- .map((point) => (point === "auto" ? autoSnapPointValue.value : point))
64
+ .map((point) =>
65
+ point === "auto" ? resolvedAutoSnapPointValue.value : point,
66
+ )
63
67
  .filter((point): point is number => typeof point === "number");
64
68
 
65
69
  const { target, shouldDismiss } = findCollapseTarget(
@@ -84,13 +88,15 @@ export const BackdropLayer = memo(function BackdropLayer() {
84
88
  target,
85
89
  spec,
86
90
  animations,
91
+ targetProgress: targetProgressValue,
87
92
  onAnimationFinish: shouldDismiss ? dismissScreen : undefined,
88
93
  });
89
94
  })();
90
95
  }
91
96
  }, [
92
97
  animations,
93
- autoSnapPointValue,
98
+ targetProgressValue,
99
+ resolvedAutoSnapPointValue,
94
100
  backdropBehavior,
95
101
  current,
96
102
  dismissScreen,
@@ -24,11 +24,14 @@ export const ContentLayer = memo(({ children }: Props) => {
24
24
  const { stylesMap } = useScreenStyles();
25
25
  const { current } = useDescriptors();
26
26
  const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
27
+
27
28
  const gestureContext = useGestureContext();
28
29
  const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
29
30
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
31
+
30
32
  const hasAutoSnapPoint =
31
33
  current.options.snapPoints?.includes("auto") ?? false;
34
+
32
35
  const handleContentLayout = useContentLayout();
33
36
 
34
37
  const animatedContentStyle = useAnimatedStyle(() => {
@@ -1,9 +1,9 @@
1
- import { memo, useEffect } from "react";
2
- import { Platform, StyleSheet, View, type ViewProps } from "react-native";
1
+ import { memo, useCallback } from "react";
2
+ import { StyleSheet, View, type ViewProps } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
4
  import {
5
- NAVIGATION_CONTAINER_STYLE_ID,
6
- NAVIGATION_MASK_STYLE_ID,
5
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
6
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
7
7
  NO_STYLES,
8
8
  } from "../../../constants";
9
9
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
@@ -24,22 +24,26 @@ try {
24
24
  }
25
25
 
26
26
  let hasWarnedMissingMaskedView = false;
27
- const IS_ANDROID = Platform.OS === "android";
28
27
 
29
28
  export const MaybeMaskedNavigationContainer = memo(
30
29
  ({ enabled, children, pointerEvents }: Props) => {
31
30
  const { stylesMap } = useScreenStyles();
32
- const animatedNavigationContainerStyle = useAnimatedStyle(() => {
31
+
32
+ const animatedNavigationMaskStyle = useAnimatedStyle(() => {
33
33
  "worklet";
34
- return stylesMap.value[NAVIGATION_CONTAINER_STYLE_ID]?.style || NO_STYLES;
34
+ return (
35
+ stylesMap.value[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES
36
+ );
35
37
  });
36
38
 
37
- const animatedNavigationMaskStyle = useAnimatedStyle(() => {
39
+ const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
38
40
  "worklet";
39
- return stylesMap.value[NAVIGATION_MASK_STYLE_ID]?.style || NO_STYLES;
41
+ return (
42
+ stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
43
+ );
40
44
  });
41
45
 
42
- useEffect(() => {
46
+ const maybeLogWarning = useCallback(() => {
43
47
  if (!enabled) return;
44
48
  if (LazyMaskedView !== View) return;
45
49
  if (hasWarnedMissingMaskedView) return;
@@ -50,24 +54,8 @@ export const MaybeMaskedNavigationContainer = memo(
50
54
  );
51
55
  }, [enabled]);
52
56
 
53
- const navigationContainer = (
54
- <Animated.View
55
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
56
- pointerEvents={pointerEvents}
57
- collapsable={false}
58
- renderToHardwareTextureAndroid={IS_ANDROID && !enabled}
59
- needsOffscreenAlphaCompositing={IS_ANDROID && !enabled}
60
- >
61
- {children}
62
- </Animated.View>
63
- );
64
-
65
- // Navigation zoom uses the root container transform even when the mask
66
- // wrapper is disabled. Only the mask element itself is optional.
67
- if (!enabled) return navigationContainer;
68
-
69
- if (LazyMaskedView === View) {
70
- return navigationContainer;
57
+ if (!enabled || LazyMaskedView === View) {
58
+ return children;
71
59
  }
72
60
 
73
61
  return (
@@ -81,8 +69,18 @@ export const MaybeMaskedNavigationContainer = memo(
81
69
  />
82
70
  }
83
71
  pointerEvents={pointerEvents}
72
+ onLayout={maybeLogWarning}
84
73
  >
85
- {navigationContainer}
74
+ <Animated.View
75
+ style={[
76
+ styles.navigationContainer,
77
+ animatedNavigationMaskContainerStyle,
78
+ ]}
79
+ pointerEvents={pointerEvents}
80
+ collapsable={false}
81
+ >
82
+ {children}
83
+ </Animated.View>
86
84
  </LazyMaskedView>
87
85
  );
88
86
  },
@@ -92,10 +90,10 @@ const styles = StyleSheet.create({
92
90
  navigationMaskedRoot: {
93
91
  flex: 1,
94
92
  },
95
- navigationMaskElement: {
96
- backgroundColor: "white",
97
- },
98
93
  navigationContainer: {
99
94
  flex: 1,
100
95
  },
96
+ navigationMaskElement: {
97
+ backgroundColor: "white",
98
+ },
101
99
  });
@@ -2,14 +2,16 @@ import { runOnUI } from "react-native-reanimated";
2
2
  import { AnimationStore } from "../../../../../stores/animation.store";
3
3
  import { BoundStore } from "../../../../../stores/bounds";
4
4
  import { GestureStore } from "../../../../../stores/gesture.store";
5
+ import { SystemStore } from "../../../../../stores/system.store";
5
6
 
6
7
  export const resetStoresForScreen = (
7
8
  routeKey: string,
8
9
  isBranchScreen: boolean,
9
10
  branchNavigatorKey?: string,
10
11
  ) => {
11
- AnimationStore.clear(routeKey);
12
- GestureStore.clear(routeKey);
12
+ AnimationStore.clearBag(routeKey);
13
+ GestureStore.clearBag(routeKey);
14
+ SystemStore.clearBag(routeKey);
13
15
 
14
16
  runOnUI(() => {
15
17
  "worklet";
@@ -1,6 +1,7 @@
1
1
  import { useLayoutEffect } from "react";
2
2
  import {
3
3
  runOnJS,
4
+ type SharedValue,
4
5
  useAnimatedReaction,
5
6
  useDerivedValue,
6
7
  } from "react-native-reanimated";
@@ -23,6 +24,7 @@ import { useNavigatorHistoryRegistry } from "./helpers/use-navigator-history-reg
23
24
  interface CloseHookParams {
24
25
  current: BaseDescriptor;
25
26
  animations: AnimationStoreMap;
27
+ targetProgress: SharedValue<number>;
26
28
  activate: () => void;
27
29
  deactivate: () => void;
28
30
  resetStores: () => void;
@@ -35,6 +37,7 @@ interface CloseHookParams {
35
37
  const useManagedClose = ({
36
38
  current,
37
39
  animations,
40
+ targetProgress,
38
41
  activate,
39
42
  deactivate,
40
43
  resetStores,
@@ -66,6 +69,7 @@ const useManagedClose = ({
66
69
  target: "close",
67
70
  spec: transitionSpec,
68
71
  animations,
72
+ targetProgress,
69
73
  onAnimationFinish: handleCloseEnd,
70
74
  });
71
75
  },
@@ -78,6 +82,7 @@ const useManagedClose = ({
78
82
  const useNativeStackClose = ({
79
83
  current,
80
84
  animations,
85
+ targetProgress,
81
86
  activate,
82
87
  deactivate,
83
88
  resetStores,
@@ -119,6 +124,7 @@ const useNativeStackClose = ({
119
124
  target: "close",
120
125
  spec: current.options.transitionSpec,
121
126
  animations,
127
+ targetProgress,
122
128
  onAnimationFinish: (finished: boolean) => {
123
129
  deactivate();
124
130
  if (finished) {
@@ -143,6 +149,7 @@ const useNativeStackClose = ({
143
149
  export function useCloseTransition(
144
150
  current: BaseDescriptor,
145
151
  animations: AnimationStoreMap,
152
+ targetProgress: SharedValue<number>,
146
153
  activate: () => void,
147
154
  deactivate: () => void,
148
155
  ) {
@@ -159,6 +166,7 @@ export function useCloseTransition(
159
166
  const closeParams: CloseHookParams = {
160
167
  current,
161
168
  animations,
169
+ targetProgress,
162
170
  activate,
163
171
  deactivate,
164
172
  resetStores,
@@ -1,4 +1,5 @@
1
1
  import { useLayoutEffect } from "react";
2
+ import type { SharedValue } from "react-native-reanimated";
2
3
  import type { BaseDescriptor } from "../../../providers/screen/descriptors";
3
4
  import type { AnimationStoreMap } from "../../../stores/animation.store";
4
5
  import type { SnapPoint } from "../../../types/screen.types";
@@ -35,6 +36,7 @@ function getInitialProgress({
35
36
  export function useOpenTransition(
36
37
  current: BaseDescriptor,
37
38
  animations: AnimationStoreMap,
39
+ targetProgressValue: SharedValue<number>,
38
40
  isFirstKey: boolean,
39
41
  ) {
40
42
  const { activateHighRefreshRate, deactivateHighRefreshRate } =
@@ -42,16 +44,24 @@ export function useOpenTransition(
42
44
 
43
45
  // biome-ignore lint/correctness/useExhaustiveDependencies: Must only run once on mount
44
46
  useLayoutEffect(() => {
45
- const { snapPoints, initialSnapIndex = 0 } = current.options;
46
- const targetProgress = getInitialProgress({ snapPoints, initialSnapIndex });
47
+ const {
48
+ snapPoints,
49
+ initialSnapIndex = 0,
50
+ experimental_animateOnInitialMount,
51
+ } = current.options;
47
52
 
48
- if (isFirstKey) {
49
- if (targetProgress === "auto") {
50
- animations.targetProgress.set(0);
53
+ const initialProgress = getInitialProgress({
54
+ snapPoints,
55
+ initialSnapIndex,
56
+ });
57
+
58
+ if (isFirstKey && !experimental_animateOnInitialMount) {
59
+ if (initialProgress === "auto") {
60
+ targetProgressValue.set(0);
51
61
  animations.progress.set(0);
52
62
  } else {
53
- const target = targetProgress ?? 1;
54
- animations.targetProgress.set(target);
63
+ const target = initialProgress ?? 1;
64
+ targetProgressValue.set(target);
55
65
  animations.progress.set(target);
56
66
  }
57
67
  animations.animating.set(0);
@@ -61,16 +71,17 @@ export function useOpenTransition(
61
71
  }
62
72
 
63
73
  // When the initial snap point is 'auto', defer the opening animation until
64
- // ScreenContainer has measured the content and set autoSnapPoint.
65
- if (targetProgress === "auto") {
74
+ // ScreenContainer has measured the content and set resolvedAutoSnapPoint.
75
+ if (initialProgress === "auto") {
66
76
  return;
67
77
  }
68
78
 
69
79
  activateHighRefreshRate();
70
80
  animateToProgress({
71
- target: targetProgress ?? "open",
81
+ target: initialProgress ?? "open",
72
82
  spec: current.options.transitionSpec,
73
83
  animations,
84
+ targetProgress: targetProgressValue,
74
85
  onAnimationFinish: deactivateHighRefreshRate,
75
86
  });
76
87
  }, []);
@@ -3,6 +3,7 @@ import {
3
3
  useDescriptors,
4
4
  } from "../../providers/screen/descriptors";
5
5
  import { AnimationStore } from "../../stores/animation.store";
6
+ import { SystemStore } from "../../stores/system.store";
6
7
  import { useCloseTransition } from "./hooks/use-close-transition";
7
8
  import { useOpenTransition } from "./hooks/use-open-transition";
8
9
  import { useScreenEvents } from "./hooks/use-screen-events";
@@ -18,14 +19,19 @@ interface Props {
18
19
  export const ScreenLifecycle = ({ children }: Props) => {
19
20
  const { current, previous } = useDescriptors();
20
21
  const { isFirstKey } = useDescriptorDerivations();
21
- const animations = AnimationStore.getRouteAnimations(current.route.key);
22
+ const animations = AnimationStore.getBag(current.route.key);
23
+ const targetProgress = SystemStore.getValue(
24
+ current.route.key,
25
+ "targetProgress",
26
+ );
22
27
 
23
28
  const { activateHighRefreshRate, deactivateHighRefreshRate } =
24
- useOpenTransition(current, animations, isFirstKey);
29
+ useOpenTransition(current, animations, targetProgress, isFirstKey);
25
30
 
26
31
  useCloseTransition(
27
32
  current,
28
33
  animations,
34
+ targetProgress,
29
35
  activateHighRefreshRate,
30
36
  deactivateHighRefreshRate,
31
37
  );
@@ -5,8 +5,8 @@ import {
5
5
  interpolateColor,
6
6
  } from "react-native-reanimated";
7
7
  import {
8
- NAVIGATION_CONTAINER_STYLE_ID,
9
- NAVIGATION_MASK_STYLE_ID,
8
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
9
+ NAVIGATION_MASK_ELEMENT_STYLE_ID,
10
10
  } from "../constants";
11
11
  import type { ScreenTransitionConfig } from "../types/screen.types";
12
12
  import { normalizeInterpolatedStyle } from "../utils/normalize-interpolated-style";
@@ -277,19 +277,19 @@ export const SharedIGImage = ({
277
277
  const dragXScale = interpolate(normX, [0, 1], [1, 0.8]);
278
278
  const dragYScale = interpolate(normY, [0, 1], [1, 0.8]);
279
279
 
280
- const navigationStyles = bounds({
281
- id: sharedBoundTag,
282
- scaleMode: "uniform",
283
- }).navigation.zoom();
280
+ const navigationStyles =
281
+ bounds({
282
+ id: sharedBoundTag,
283
+ }).navigation.zoom() ?? {};
284
284
 
285
285
  // Extract raw style values from bounds result (legacy format)
286
286
  const sourceStyle = navigationStyles[sharedBoundTag] as
287
287
  | Record<string, unknown>
288
288
  | undefined;
289
- const containerStyle = navigationStyles[NAVIGATION_CONTAINER_STYLE_ID] as
290
- | Record<string, unknown>
291
- | undefined;
292
- const maskStyle = navigationStyles[NAVIGATION_MASK_STYLE_ID] as
289
+ const containerStyle = navigationStyles[
290
+ NAVIGATION_MASK_CONTAINER_STYLE_ID
291
+ ] as Record<string, unknown> | undefined;
292
+ const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
293
293
  | Record<string, unknown>
294
294
  | undefined;
295
295
 
@@ -317,7 +317,7 @@ export const SharedIGImage = ({
317
317
  ],
318
318
  },
319
319
  },
320
- [NAVIGATION_CONTAINER_STYLE_ID]: containerStyle
320
+ [NAVIGATION_MASK_CONTAINER_STYLE_ID]: containerStyle
321
321
  ? {
322
322
  style: {
323
323
  ...containerStyle,
@@ -329,7 +329,7 @@ export const SharedIGImage = ({
329
329
  },
330
330
  }
331
331
  : undefined,
332
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
332
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
333
333
  ? {
334
334
  style: {
335
335
  ...maskStyle,
@@ -620,10 +620,11 @@ export const SharedXImage = ({
620
620
 
621
621
  if (!focused) return {};
622
622
 
623
- const navigationStyles = bounds({
624
- id: sharedBoundTag,
625
- }).navigation.zoom();
626
- const maskStyle = navigationStyles[NAVIGATION_MASK_STYLE_ID] as
623
+ const navigationStyles =
624
+ bounds({
625
+ id: sharedBoundTag,
626
+ }).navigation.zoom() ?? {};
627
+ const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
627
628
  | Record<string, unknown>
628
629
  | undefined;
629
630
 
@@ -654,7 +655,7 @@ export const SharedXImage = ({
654
655
 
655
656
  return {
656
657
  ...normalizedNav,
657
- [NAVIGATION_MASK_STYLE_ID]: maskStyle
658
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]: maskStyle
658
659
  ? {
659
660
  style: {
660
661
  ...maskStyle,
@@ -8,6 +8,7 @@ import type { BaseStackRoute } from "./types/stack.types";
8
8
 
9
9
  /**
10
10
  * Masked view integration
11
+ * @deprecated No longer in use. Use {@link NAVIGATION_MASK_ELEMENT_STYLE_ID} and {@link NAVIGATION_MASK_CONTAINER_STYLE_ID} instead.
11
12
  */
12
13
  export const MASK_STYLE_ID = "_ROOT_MASKED";
13
14
  export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
@@ -15,14 +16,15 @@ export const CONTAINER_STYLE_ID = "_ROOT_CONTAINER";
15
16
  /**
16
17
  * Navigation mask integration
17
18
  */
18
- export const NAVIGATION_MASK_HOST_FLAG_STYLE_ID = "_NAVIGATION_MASK_HOST";
19
- export const NAVIGATION_MASK_STYLE_ID = "_NAVIGATION_ROOT_MASK";
20
- export const NAVIGATION_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
19
+ export const NAVIGATION_MASK_ELEMENT_STYLE_ID = "_NAVIGATION_ROOT_MASK";
20
+ export const NAVIGATION_MASK_CONTAINER_STYLE_ID = "_NAVIGATION_ROOT_CONTAINER";
21
21
 
22
22
  /**
23
23
  * Styles
24
24
  */
25
25
  export const NO_STYLES = Object.freeze({});
26
+ export const HIDDEN_STYLE = Object.freeze({ opacity: 0 });
27
+ export const VISIBLE_STYLE = Object.freeze({ opacity: 1 });
26
28
  export const NO_PROPS = Object.freeze({});
27
29
 
28
30
  /**
@@ -59,6 +61,13 @@ export const createScreenTransitionState = (
59
61
  gesture: { ...DEFAULT_GESTURE_VALUES },
60
62
  route,
61
63
  meta,
64
+ layouts: {
65
+ screen: {
66
+ width: 0,
67
+ height: 0,
68
+ },
69
+ },
70
+ snapIndex: -1,
62
71
  });
63
72
 
64
73
  /**
@@ -73,6 +82,13 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
73
82
  entering: 0,
74
83
  gesture: DEFAULT_GESTURE_VALUES,
75
84
  route: {} as RouteProp<ParamListBase>,
85
+ layouts: {
86
+ screen: {
87
+ width: 0,
88
+ height: 0,
89
+ },
90
+ },
91
+ snapIndex: -1,
76
92
  });
77
93
 
78
94
  /**