react-native-screen-transitions 3.4.0-alpha.3 → 3.4.0-alpha.5

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 (328) 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 +6 -6
  12. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  13. package/lib/commonjs/shared/components/native-screen.js +3 -3
  14. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  15. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +1 -1
  16. package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
  17. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  18. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  19. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +8 -5
  20. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-container/layers/content.js +12 -28
  22. package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
  23. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +17 -4
  24. package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  25. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  26. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  27. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  28. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  29. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  30. package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  31. package/lib/commonjs/shared/components/screen-lifecycle/index.js +5 -3
  32. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  33. package/lib/commonjs/shared/configs/presets.js +3 -4
  34. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  35. package/lib/commonjs/shared/constants.js +16 -2
  36. package/lib/commonjs/shared/constants.js.map +1 -1
  37. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
  38. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  39. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +12 -9
  40. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  41. package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js +3 -2
  42. package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
  43. package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js +7 -5
  44. package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
  45. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  46. package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  47. package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js +9 -6
  48. package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
  49. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  50. package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  51. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js +1 -1
  52. package/lib/commonjs/shared/providers/gestures/use-build-gestures.js.map +1 -1
  53. package/lib/commonjs/shared/providers/register-bounds.provider.js +5 -5
  54. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  55. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js +17 -0
  56. package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  57. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +72 -0
  58. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  59. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  60. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  61. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +42 -0
  62. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  63. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +17 -3
  64. package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
  65. package/lib/commonjs/shared/providers/screen/styles.provider.js +4 -1
  66. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
  67. package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
  68. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
  69. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  70. package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  71. package/lib/commonjs/shared/stores/animation.store.js +12 -40
  72. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  73. package/lib/commonjs/shared/stores/gesture.store.js +13 -33
  74. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  75. package/lib/commonjs/shared/stores/system.store.js +31 -0
  76. package/lib/commonjs/shared/stores/system.store.js.map +1 -0
  77. package/lib/commonjs/shared/types/bounds.types.js +1 -3
  78. package/lib/commonjs/shared/types/bounds.types.js.map +1 -1
  79. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +2 -2
  80. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  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 +108 -362
  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 +6 -6
  105. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  106. package/lib/module/shared/components/native-screen.js +3 -3
  107. package/lib/module/shared/components/native-screen.js.map +1 -1
  108. package/lib/module/shared/components/screen-container/deferred-visibility-host.js +2 -2
  109. package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
  110. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +18 -14
  111. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  112. package/lib/module/shared/components/screen-container/layers/backdrop.js +8 -5
  113. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  114. package/lib/module/shared/components/screen-container/layers/content.js +13 -29
  115. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  116. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +19 -6
  117. package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
  118. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
  119. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
  120. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
  121. package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
  122. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +13 -11
  123. package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
  124. package/lib/module/shared/components/screen-lifecycle/index.js +5 -3
  125. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  126. package/lib/module/shared/configs/presets.js +3 -4
  127. package/lib/module/shared/configs/presets.js.map +1 -1
  128. package/lib/module/shared/constants.js +16 -2
  129. package/lib/module/shared/constants.js.map +1 -1
  130. package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
  131. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  132. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +12 -9
  133. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  134. package/lib/module/shared/providers/gestures/helpers/gesture-physics.js +3 -2
  135. package/lib/module/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
  136. package/lib/module/shared/providers/gestures/helpers/gesture-reset.js +7 -5
  137. package/lib/module/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
  138. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
  139. package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
  140. package/lib/module/shared/providers/gestures/helpers/gesture-targets.js +9 -6
  141. package/lib/module/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
  142. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
  143. package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
  144. package/lib/module/shared/providers/gestures/use-build-gestures.js +1 -1
  145. package/lib/module/shared/providers/gestures/use-build-gestures.js.map +1 -1
  146. package/lib/module/shared/providers/register-bounds.provider.js +5 -5
  147. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  148. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js +12 -0
  149. package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
  150. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +67 -0
  151. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
  152. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +22 -108
  153. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  154. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +37 -0
  155. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
  156. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +15 -2
  157. package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
  158. package/lib/module/shared/providers/screen/styles.provider.js +5 -2
  159. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
  160. package/lib/module/shared/providers/stack/direct.provider.js +1 -1
  161. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
  162. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +1 -1
  163. package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
  164. package/lib/module/shared/stores/animation.store.js +12 -40
  165. package/lib/module/shared/stores/animation.store.js.map +1 -1
  166. package/lib/module/shared/stores/gesture.store.js +13 -33
  167. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  168. package/lib/module/shared/stores/system.store.js +27 -0
  169. package/lib/module/shared/stores/system.store.js.map +1 -0
  170. package/lib/module/shared/types/bounds.types.js +9 -1
  171. package/lib/module/shared/types/bounds.types.js.map +1 -1
  172. package/lib/module/shared/utils/animation/animate-to-progress.js +2 -2
  173. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  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 +101 -355
  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/native-screen.d.ts.map +1 -1
  193. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  195. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  196. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  197. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +2 -1
  199. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts +2 -1
  201. package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  203. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  204. package/lib/typescript/shared/constants.d.ts.map +1 -1
  205. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  206. package/lib/typescript/shared/index.d.ts +3 -3
  207. package/lib/typescript/shared/index.d.ts.map +1 -1
  208. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  209. package/lib/typescript/shared/providers/gestures/helpers/gesture-physics.d.ts.map +1 -1
  210. package/lib/typescript/shared/providers/gestures/helpers/gesture-reset.d.ts.map +1 -1
  211. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
  212. package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -1
  213. package/lib/typescript/shared/providers/gestures/helpers/gesture-targets.d.ts.map +1 -1
  214. package/lib/typescript/shared/providers/gestures/use-build-gestures.d.ts.map +1 -1
  215. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  216. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts +8 -0
  217. package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts.map +1 -0
  218. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +22 -0
  219. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +4 -2
  221. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +21 -0
  223. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -0
  224. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +6 -2
  225. package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -1
  226. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
  227. package/lib/typescript/shared/stores/animation.store.d.ts +10 -17
  228. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  229. package/lib/typescript/shared/stores/gesture.store.d.ts +24 -14
  230. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  231. package/lib/typescript/shared/stores/system.store.d.ts +27 -0
  232. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -0
  233. package/lib/typescript/shared/types/animation.types.d.ts +38 -9
  234. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  235. package/lib/typescript/shared/types/bounds.types.d.ts +14 -42
  236. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  237. package/lib/typescript/shared/types/index.d.ts +2 -2
  238. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  239. package/lib/typescript/shared/types/screen.types.d.ts +11 -0
  240. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +3 -1
  242. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
  244. package/lib/typescript/shared/utils/bounds/index.d.ts +2 -3
  245. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -3
  247. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +15 -41
  249. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
  250. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +44 -0
  251. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -0
  252. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +8 -13
  253. package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
  254. package/lib/typescript/shared/utils/create-store.d.ts +14 -0
  255. package/lib/typescript/shared/utils/create-store.d.ts.map +1 -0
  256. package/package.json +1 -1
  257. package/src/component-stack/components/component-screen.tsx +1 -1
  258. package/src/shared/animation/snap-to.ts +10 -4
  259. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +1 -1
  260. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +82 -10
  261. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +2 -5
  262. package/src/shared/components/create-boundary-component/index.tsx +6 -12
  263. package/src/shared/components/native-screen.tsx +3 -9
  264. package/src/shared/components/screen-container/deferred-visibility-host.tsx +2 -2
  265. package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
  266. package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
  267. package/src/shared/components/screen-container/layers/content.tsx +17 -49
  268. package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +26 -5
  269. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +4 -2
  270. package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +8 -0
  271. package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +21 -10
  272. package/src/shared/components/screen-lifecycle/index.tsx +8 -2
  273. package/src/shared/configs/presets.ts +8 -7
  274. package/src/shared/constants.ts +14 -0
  275. package/src/shared/hooks/animation/use-associated-style.ts +2 -8
  276. package/src/shared/index.ts +2 -0
  277. package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
  278. package/src/shared/providers/gestures/helpers/gesture-physics.ts +4 -2
  279. package/src/shared/providers/gestures/helpers/gesture-reset.ts +9 -5
  280. package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
  281. package/src/shared/providers/gestures/helpers/gesture-targets.ts +14 -6
  282. package/src/shared/providers/gestures/helpers/register-direction-claims.ts +1 -1
  283. package/src/shared/providers/gestures/use-build-gestures.ts +1 -3
  284. package/src/shared/providers/register-bounds.provider.tsx +5 -11
  285. package/src/shared/providers/screen/animation/helpers/has-transitions-enabled.ts +14 -0
  286. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +108 -0
  287. package/src/shared/providers/screen/animation/helpers/pipeline.ts +37 -199
  288. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +77 -0
  289. package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +24 -4
  290. package/src/shared/providers/screen/styles.provider.tsx +5 -1
  291. package/src/shared/providers/stack/direct.provider.tsx +1 -1
  292. package/src/shared/providers/stack/helpers/use-processed-routes.ts +1 -1
  293. package/src/shared/stores/animation.store.ts +11 -61
  294. package/src/shared/stores/gesture.store.ts +25 -45
  295. package/src/shared/stores/system.store.ts +44 -0
  296. package/src/shared/types/animation.types.ts +41 -9
  297. package/src/shared/types/bounds.types.ts +25 -25
  298. package/src/shared/types/index.ts +2 -0
  299. package/src/shared/types/screen.types.ts +12 -0
  300. package/src/shared/utils/animation/animate-to-progress.ts +4 -2
  301. package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +0 -1
  302. package/src/shared/utils/bounds/index.ts +26 -75
  303. package/src/shared/utils/bounds/zoom/build.ts +179 -502
  304. package/src/shared/utils/bounds/zoom/config.ts +14 -164
  305. package/src/shared/utils/bounds/zoom/math.ts +193 -0
  306. package/src/shared/utils/bounds/zoom/types.ts +15 -17
  307. package/src/shared/utils/create-store.ts +62 -0
  308. package/lib/commonjs/shared/utils/bounds/types/frame-props.js +0 -6
  309. package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +0 -1
  310. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +0 -54
  311. package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +0 -1
  312. package/lib/commonjs/shared/utils/bounds/zoom/index.js +0 -20
  313. package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +0 -1
  314. package/lib/module/shared/utils/bounds/types/frame-props.js +0 -4
  315. package/lib/module/shared/utils/bounds/types/frame-props.js.map +0 -1
  316. package/lib/module/shared/utils/bounds/zoom/accessor.js +0 -49
  317. package/lib/module/shared/utils/bounds/zoom/accessor.js.map +0 -1
  318. package/lib/module/shared/utils/bounds/zoom/index.js +0 -5
  319. package/lib/module/shared/utils/bounds/zoom/index.js.map +0 -1
  320. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +0 -5
  321. package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +0 -1
  322. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +0 -17
  323. package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +0 -1
  324. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +0 -3
  325. package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +0 -1
  326. package/src/shared/utils/bounds/types/frame-props.ts +0 -5
  327. package/src/shared/utils/bounds/zoom/accessor.ts +0 -69
  328. 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
  }
@@ -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,
@@ -6,11 +6,7 @@ import Animated, {
6
6
  useAnimatedProps,
7
7
  useAnimatedStyle,
8
8
  } from "react-native-reanimated";
9
- import {
10
- NAVIGATION_MASK_CONTAINER_STYLE_ID,
11
- NO_PROPS,
12
- NO_STYLES,
13
- } from "../../../constants";
9
+ import { NO_PROPS, NO_STYLES } from "../../../constants";
14
10
  import { useGestureContext } from "../../../providers/gestures";
15
11
  import { useDescriptors } from "../../../providers/screen/descriptors";
16
12
  import { useScreenStyles } from "../../../providers/screen/styles.provider";
@@ -28,9 +24,11 @@ export const ContentLayer = memo(({ children }: Props) => {
28
24
  const { stylesMap } = useScreenStyles();
29
25
  const { current } = useDescriptors();
30
26
  const { pointerEvents, isBackdropActive } = useBackdropPointerEvents();
27
+
31
28
  const gestureContext = useGestureContext();
32
29
  const isNavigationMaskEnabled = resolveNavigationMaskEnabled(current.options);
33
30
  const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
31
+
34
32
  const hasAutoSnapPoint =
35
33
  current.options.snapPoints?.includes("auto") ?? false;
36
34
 
@@ -41,51 +39,11 @@ export const ContentLayer = memo(({ children }: Props) => {
41
39
  return stylesMap.value.content?.style || NO_STYLES;
42
40
  });
43
41
 
44
- const animatedNavigationContainerStyle = useAnimatedStyle(() => {
45
- "worklet";
46
- return (
47
- stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
48
- );
49
- });
50
-
51
42
  const animatedContentProps = useAnimatedProps(() => {
52
43
  "worklet";
53
44
  return stylesMap.value.content?.props ?? NO_PROPS;
54
45
  });
55
46
 
56
- const surfaceChildren = (
57
- <SurfaceContainer pointerEvents={contentPointerEvents}>
58
- {hasAutoSnapPoint ? (
59
- <View collapsable={false} onLayout={handleContentLayout}>
60
- {children}
61
- </View>
62
- ) : (
63
- children
64
- )}
65
- </SurfaceContainer>
66
- );
67
-
68
- const navigationContainer = (
69
- <Animated.View
70
- style={[styles.navigationContainer, animatedNavigationContainerStyle]}
71
- pointerEvents={contentPointerEvents}
72
- collapsable={false}
73
- >
74
- {surfaceChildren}
75
- </Animated.View>
76
- );
77
-
78
- const navigationScopedChildren = isNavigationMaskEnabled ? (
79
- <MaybeMaskedNavigationContainer
80
- pointerEvents={contentPointerEvents}
81
- enabled={isNavigationMaskEnabled}
82
- >
83
- {navigationContainer}
84
- </MaybeMaskedNavigationContainer>
85
- ) : (
86
- navigationContainer
87
- );
88
-
89
47
  return (
90
48
  <GestureDetector gesture={gestureContext!.panGesture}>
91
49
  <Animated.View
@@ -93,7 +51,20 @@ export const ContentLayer = memo(({ children }: Props) => {
93
51
  animatedProps={animatedContentProps}
94
52
  pointerEvents={contentPointerEvents}
95
53
  >
96
- {navigationScopedChildren}
54
+ <MaybeMaskedNavigationContainer
55
+ pointerEvents={contentPointerEvents}
56
+ enabled={isNavigationMaskEnabled}
57
+ >
58
+ <SurfaceContainer pointerEvents={contentPointerEvents}>
59
+ {hasAutoSnapPoint ? (
60
+ <View collapsable={false} onLayout={handleContentLayout}>
61
+ {children}
62
+ </View>
63
+ ) : (
64
+ children
65
+ )}
66
+ </SurfaceContainer>
67
+ </MaybeMaskedNavigationContainer>
97
68
  </Animated.View>
98
69
  </GestureDetector>
99
70
  );
@@ -103,7 +74,4 @@ const styles = StyleSheet.create({
103
74
  content: {
104
75
  flex: 1,
105
76
  },
106
- navigationContainer: {
107
- flex: 1,
108
- },
109
77
  });
@@ -1,7 +1,8 @@
1
- import { memo, useEffect } from "react";
1
+ import { memo, useCallback } from "react";
2
2
  import { StyleSheet, View, type ViewProps } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
4
  import {
5
+ NAVIGATION_MASK_CONTAINER_STYLE_ID,
5
6
  NAVIGATION_MASK_ELEMENT_STYLE_ID,
6
7
  NO_STYLES,
7
8
  } from "../../../constants";
@@ -27,6 +28,7 @@ let hasWarnedMissingMaskedView = false;
27
28
  export const MaybeMaskedNavigationContainer = memo(
28
29
  ({ enabled, children, pointerEvents }: Props) => {
29
30
  const { stylesMap } = useScreenStyles();
31
+
30
32
  const animatedNavigationMaskStyle = useAnimatedStyle(() => {
31
33
  "worklet";
32
34
  return (
@@ -34,7 +36,14 @@ export const MaybeMaskedNavigationContainer = memo(
34
36
  );
35
37
  });
36
38
 
37
- useEffect(() => {
39
+ const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
40
+ "worklet";
41
+ return (
42
+ stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES
43
+ );
44
+ });
45
+
46
+ const maybeLogWarning = useCallback(() => {
38
47
  if (!enabled) return;
39
48
  if (LazyMaskedView !== View) return;
40
49
  if (hasWarnedMissingMaskedView) return;
@@ -44,9 +53,8 @@ export const MaybeMaskedNavigationContainer = memo(
44
53
  "navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.",
45
54
  );
46
55
  }, [enabled]);
47
- if (!enabled) return children;
48
56
 
49
- if (LazyMaskedView === View) {
57
+ if (!enabled || LazyMaskedView === View) {
50
58
  return children;
51
59
  }
52
60
 
@@ -61,8 +69,18 @@ export const MaybeMaskedNavigationContainer = memo(
61
69
  />
62
70
  }
63
71
  pointerEvents={pointerEvents}
72
+ onLayout={maybeLogWarning}
64
73
  >
65
- {children}
74
+ <Animated.View
75
+ style={[
76
+ styles.navigationContainer,
77
+ animatedNavigationMaskContainerStyle,
78
+ ]}
79
+ pointerEvents={pointerEvents}
80
+ collapsable={false}
81
+ >
82
+ {children}
83
+ </Animated.View>
66
84
  </LazyMaskedView>
67
85
  );
68
86
  },
@@ -72,6 +90,9 @@ const styles = StyleSheet.create({
72
90
  navigationMaskedRoot: {
73
91
  flex: 1,
74
92
  },
93
+ navigationContainer: {
94
+ flex: 1,
95
+ },
75
96
  navigationMaskElement: {
76
97
  backgroundColor: "white",
77
98
  },
@@ -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
  );
@@ -277,10 +277,10 @@ 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
@@ -620,9 +620,10 @@ export const SharedXImage = ({
620
620
 
621
621
  if (!focused) return {};
622
622
 
623
- const navigationStyles = bounds({
624
- id: sharedBoundTag,
625
- }).navigation.zoom();
623
+ const navigationStyles =
624
+ bounds({
625
+ id: sharedBoundTag,
626
+ }).navigation.zoom() ?? {};
626
627
  const maskStyle = navigationStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] as
627
628
  | Record<string, unknown>
628
629
  | undefined;
@@ -61,6 +61,13 @@ export const createScreenTransitionState = (
61
61
  gesture: { ...DEFAULT_GESTURE_VALUES },
62
62
  route,
63
63
  meta,
64
+ layouts: {
65
+ screen: {
66
+ width: 0,
67
+ height: 0,
68
+ },
69
+ },
70
+ snapIndex: -1,
64
71
  });
65
72
 
66
73
  /**
@@ -75,6 +82,13 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
75
82
  entering: 0,
76
83
  gesture: DEFAULT_GESTURE_VALUES,
77
84
  route: {} as RouteProp<ParamListBase>,
85
+ layouts: {
86
+ screen: {
87
+ width: 0,
88
+ height: 0,
89
+ },
90
+ },
91
+ snapIndex: -1,
78
92
  });
79
93
 
80
94
  /**
@@ -149,14 +149,8 @@ export const useAssociatedStyles = ({
149
149
  const { stylesMap, ancestorStylesMaps } = useScreenStyles();
150
150
  const { previousScreenKey, currentScreenKey, hasConfiguredInterpolator } =
151
151
  useDescriptorDerivations();
152
- const isAnimating = AnimationStore.getRouteAnimation(
153
- currentScreenKey,
154
- "animating",
155
- );
156
- const isClosing = AnimationStore.getRouteAnimation(
157
- currentScreenKey,
158
- "closing",
159
- );
152
+ const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
153
+ const isClosing = AnimationStore.getValue(currentScreenKey, "closing");
160
154
  const previousAppliedKeys = useSharedValue<Record<string, true>>({});
161
155
  const emptyGraceFrameCount = useSharedValue(0);
162
156
  const lastResolvedBase = useSharedValue<Record<string, any> | null>(null);
@@ -48,6 +48,8 @@ export type {
48
48
  AnimationConfig,
49
49
  BoundsNavigationAccessor,
50
50
  BoundsNavigationZoomOptions,
51
+ BoundsNavigationZoomStyle,
52
+ DeferredScreenStyleSignal,
51
53
  OverlayProps,
52
54
  ScreenInterpolationProps,
53
55
  ScreenStyleInterpolator,