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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACX,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,2BAA2B,GAC3B,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EACX,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,GACb,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACX,iBAAiB,EACjB,eAAe,EACf,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EACX,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,GACb,MAAM,eAAe,CAAC"}
@@ -173,6 +173,17 @@ export type ScreenTransitionConfig = {
173
173
  * @default false
174
174
  */
175
175
  experimental_enableHighRefreshRate?: boolean;
176
+ /**
177
+ * Animates the first screen in a navigator from its closed state on initial mount
178
+ * instead of snapping directly to its settled progress.
179
+ *
180
+ * Useful for launch/onboarding flows where the initial screen should participate
181
+ * in the same transition system as pushed screens.
182
+ *
183
+ * @experimental This API may change in future versions.
184
+ * @default false
185
+ */
186
+ experimental_animateOnInitialMount?: boolean;
176
187
  /**
177
188
  * Describes heights where a screen can rest, as fractions of screen height,
178
189
  * or `'auto'` to snap to the intrinsic height of the screen content.
@@ -1 +1 @@
1
- {"version":3,"file":"screen.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/screen.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACX,uBAAuB,EACvB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEp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Map } from "../../stores/animation.store";
2
3
  import type { TransitionSpec } from "../../types/animation.types";
3
4
  interface AnimateToProgressProps {
@@ -11,9 +12,10 @@ interface AnimateToProgressProps {
11
12
  spec?: TransitionSpec;
12
13
  onAnimationFinish?: (finished: boolean) => void;
13
14
  animations: AnimationStoreMap;
15
+ targetProgress: SharedValue<number>;
14
16
  /** Optional initial velocity for spring-based progress (units: progress/sec). */
15
17
  initialVelocity?: number;
16
18
  }
17
- export declare const animateToProgress: ({ target, spec, onAnimationFinish, animations, initialVelocity, }: AnimateToProgressProps) => void;
19
+ export declare const animateToProgress: ({ target, spec, onAnimationFinish, animations, targetProgress, initialVelocity, }: AnimateToProgressProps) => void;
18
20
  export {};
19
21
  //# sourceMappingURL=animate-to-progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"animate-to-progress.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/animation/animate-to-progress.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,UAAU,sBAAsB;IAC/B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,GAAI,mEAM/B,sBAAsB,SA+DxB,CAAC"}
1
+ {"version":3,"file":"animate-to-progress.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/animation/animate-to-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,UAAU,sBAAsB;IAC/B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,GAAI,mFAO/B,sBAAsB,SA+DxB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"AASA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,MAAM,kBAAkB,CAAC;AAoG1B,eAAO,MAAM,kBAAkB,GAC9B,uDAAuD,mBAAmB,EAC1E,iBAAgB,aAAkC,EAClD,eAAe,sBAAsB;;;;;;;;;;EAiGrC,CAAC"}
1
+ {"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"AAQA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,MAAM,kBAAkB,CAAC;AAoG1B,eAAO,MAAM,kBAAkB,GAC9B,uDAAuD,mBAAmB,EAC1E,iBAAgB,aAAkC,EAClD,eAAe,sBAAsB;;;;;;;;;;EAiGrC,CAAC"}
@@ -1,4 +1,3 @@
1
- import type { BoundsAccessor } from "../../types/bounds.types";
2
- import type { BoundsFrameProps } from "./types/frame-props";
3
- export declare const createBoundsAccessor: (getProps: () => BoundsFrameProps) => BoundsAccessor;
1
+ import type { BoundsAccessor, BoundsInterpolationProps } from "../../types/bounds.types";
2
+ export declare const createBoundsAccessor: (getProps: () => BoundsInterpolationProps) => BoundsAccessor;
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/bounds/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAM/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAe5D,eAAO,MAAM,oBAAoB,GAChC,UAAU,MAAM,gBAAgB,KAC9B,cAiIF,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/bounds/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,cAAc,EACd,wBAAwB,EAExB,MAAM,0BAA0B,CAAC;AAoBlC,eAAO,MAAM,oBAAoB,GAChC,UAAU,MAAM,wBAAwB,KACtC,cA6EF,CAAC"}
@@ -1,4 +1,3 @@
1
- import type { ScreenStyleInterpolator } from "../../../types/animation.types";
2
- import type { BuildZoomStylesParams } from "./types";
3
- export declare const buildZoomStyles: ({ id, group, zoomOptions, props, resolveTag, computeRaw, }: BuildZoomStylesParams) => ReturnType<ScreenStyleInterpolator>;
1
+ import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
2
+ export declare const buildZoomStyles: ({ resolvedTag, zoomOptions, props, }: BuildZoomStylesParams) => ZoomInterpolatedStyle;
4
3
  //# sourceMappingURL=build.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACX,uBAAuB,EAEvB,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAwarD,eAAO,MAAM,eAAe,GAAI,4DAO7B,qBAAqB,KAAG,UAAU,CAAC,uBAAuB,CAuQ5D,CAAC"}
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AA8D5E,eAAO,MAAM,eAAe,GAAI,sCAI7B,qBAAqB,KAAG,qBAyS1B,CAAC"}
@@ -1,43 +1,17 @@
1
- import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
2
- import type { BoundId, BoundsOptions } from "../types/options";
3
- import type { ResolveTag } from "./types";
4
- type ZoomMask = NonNullable<BoundsNavigationZoomOptions["mask"]>;
5
- type ZoomRadiusValue = Exclude<ZoomMask["borderRadius"], undefined>;
6
- type ResolvedZoomOutset = {
7
- top: number;
8
- right: number;
9
- bottom: number;
10
- left: number;
11
- };
12
- export type ResolvedZoomOptions = {
13
- mask: {
14
- borderRadius: ZoomRadiusValue;
15
- borderTopLeftRadius?: ZoomRadiusValue;
16
- borderTopRightRadius?: ZoomRadiusValue;
17
- borderBottomLeftRadius?: ZoomRadiusValue;
18
- borderBottomRightRadius?: ZoomRadiusValue;
19
- borderCurve?: "circular" | "continuous";
20
- outset: ResolvedZoomOutset;
21
- };
22
- motion: {
23
- dragResistance: number;
24
- dragDirectionalScaleMin: number;
25
- dragDirectionalScaleMax: number;
26
- };
27
- };
1
+ import type { BoundsOptions } from "../types/options";
2
+ export declare const ZOOM_SHARED_OPTIONS: Readonly<{
3
+ anchor: "top";
4
+ scaleMode: "uniform";
5
+ }>;
6
+ export declare const ZOOM_DRAG_RESISTANCE = 0.4;
7
+ export declare const ZOOM_DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
8
+ export declare const ZOOM_DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
9
+ export declare const ZOOM_MASK_OUTSET: Readonly<{
10
+ top: 0;
11
+ right: 0;
12
+ bottom: 0;
13
+ left: 0;
14
+ }>;
15
+ export declare const getZoomAnchor: (target: BoundsOptions["target"] | undefined) => BoundsOptions["anchor"];
28
16
  export declare const toNumber: (value: unknown, fallback?: number) => number;
29
- export declare const resolveZoomConfig: ({ id, group, zoomOptions, currentRouteKey, resolveTag, defaultAnchor, }: {
30
- id: BoundId;
31
- group?: string;
32
- zoomOptions?: BoundsNavigationZoomOptions;
33
- currentRouteKey?: string;
34
- resolveTag: ResolveTag;
35
- defaultAnchor: BoundsOptions["anchor"] | undefined;
36
- }) => {
37
- resolvedTag: string;
38
- sharedOptions: Partial<BoundsOptions>;
39
- explicitTarget: BoundsOptions["target"] | undefined;
40
- zoomOptions: ResolvedZoomOptions;
41
- } | null;
42
- export {};
43
17
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,KAAK,QAAQ,GAAG,WAAW,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAC;AACjE,KAAK,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC,CAAC;AAYpE,KAAK,kBAAkB,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb,CAAC;AA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B,MAAM,CAAC;AACxC,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,+BAA+B,OAAO,CAAC;AAEpD,eAAO,MAAM,gBAAgB;;;;;EAK3B,CAAC;AAEH,eAAO,MAAM,aAAa,GACzB,QAAQ,aAAa,CAAC,QAAQ,CAAC,GAAG,SAAS,KACzC,aAAa,CAAC,QAAQ,CAGxB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,iBAAY,KAAG,MAGvD,CAAC"}
@@ -0,0 +1,44 @@
1
+ export type CombinedScaleMode = "multiply" | "average" | "max" | "min";
2
+ export declare const clamp: (value: number, min: number, max: number) => number;
3
+ export declare const clamp01: (value: number) => number;
4
+ export declare const lerp: (from: number, to: number, t: number) => number;
5
+ export declare const safeDivide: (numerator: number, denominator: number, fallback?: number) => number;
6
+ export declare const inverseLerp: (value: number, inMin: number, inMax: number) => number;
7
+ export declare const mapRangeClamped: (value: number, inMin: number, inMax: number, outMin: number, outMax: number) => number;
8
+ export declare const applyPowerCurve: (value: number, exponent: number) => number;
9
+ export declare const normalizedToTranslation: ({ normalized, dimension, resistance, }: {
10
+ normalized: number;
11
+ dimension: number;
12
+ resistance: number;
13
+ }) => number;
14
+ export declare const normalizedToScale: ({ normalized, outputRange, exponent, positiveOnly, }: {
15
+ normalized: number;
16
+ outputRange: readonly [number, number];
17
+ exponent?: number;
18
+ positiveOnly?: boolean;
19
+ }) => number;
20
+ export declare const combineScales: (scaleX: number, scaleY: number, mode?: CombinedScaleMode) => number;
21
+ export declare const computeCenterScaleShift: ({ center, containerCenter, scale, }: {
22
+ center: number;
23
+ containerCenter: number;
24
+ scale: number;
25
+ }) => number;
26
+ export declare const compensateTranslationForParentScale: ({ translation, parentScale, epsilon, }: {
27
+ translation: number;
28
+ parentScale: number;
29
+ epsilon: number;
30
+ }) => number;
31
+ export declare const composeCompensatedTranslation: ({ gesture, parentScale, centerShift, epsilon, }: {
32
+ gesture: number;
33
+ parentScale: number;
34
+ centerShift?: number;
35
+ epsilon: number;
36
+ }) => number;
37
+ export declare const resolveDirectionalDragScale: ({ normalized, dismissDirection, shrinkMin, growMax, exponent, }: {
38
+ normalized: number;
39
+ dismissDirection: "positive" | "negative";
40
+ shrinkMin: number;
41
+ growMax: number;
42
+ exponent: number;
43
+ }) => number;
44
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/math.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,KAAK,CAAC;AAEvE,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAS/D,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,MAGvC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,MAAM,MAAM,EAAE,IAAI,MAAM,EAAE,GAAG,MAAM,KAAG,MAG1D,CAAC;AAEF,eAAO,MAAM,UAAU,GACtB,WAAW,MAAM,EACjB,aAAa,MAAM,EACnB,iBAAY,KACV,MAIF,CAAC;AAEF,eAAO,MAAM,WAAW,GACvB,OAAO,MAAM,EACb,OAAO,MAAM,EACb,OAAO,MAAM,KACX,MAGF,CAAC;AAEF,eAAO,MAAM,eAAe,GAC3B,OAAO,MAAM,EACb,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,QAAQ,MAAM,KACZ,MAIF,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAKjE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,wCAIrC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACnB,KAAG,MAIH,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,sDAK/B;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB,KAAG,MAQH,CAAC;AAEF,eAAO,MAAM,aAAa,GACzB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,OAAM,iBAA8B,KAClC,MAaF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,qCAIrC;IACF,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACd,KAAG,MAGH,CAAC;AAEF,eAAO,MAAM,mCAAmC,GAAI,wCAIjD;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CAChB,KAAG,MAIH,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,iDAK3C;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CAChB,KAAG,MASH,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,iEAMzC;IACF,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,UAAU,GAAG,UAAU,CAAC;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CACjB,WAgBA,CAAC"}
@@ -1,17 +1,12 @@
1
- import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
2
- import type { BoundsFrameProps } from "../types/frame-props";
3
- import type { BoundId, BoundsOptions } from "../types/options";
4
- export type ResolveTag = (params: {
5
- id?: BoundId;
6
- group?: string;
7
- }) => string | undefined;
8
- export type ComputeRaw = (overrides: Partial<BoundsOptions>, frameProps?: BoundsFrameProps) => Record<string, unknown>;
1
+ import { NAVIGATION_MASK_CONTAINER_STYLE_ID, NAVIGATION_MASK_ELEMENT_STYLE_ID } from "../../../constants";
2
+ import type { BoundsInterpolationProps, BoundsNavigationZoomOptions, BoundsNavigationZoomStyle } from "../../../types/bounds.types";
3
+ export type ZoomInterpolatedStyle = BoundsNavigationZoomStyle & {
4
+ [NAVIGATION_MASK_CONTAINER_STYLE_ID]?: BoundsNavigationZoomStyle[typeof NAVIGATION_MASK_CONTAINER_STYLE_ID];
5
+ [NAVIGATION_MASK_ELEMENT_STYLE_ID]?: BoundsNavigationZoomStyle[typeof NAVIGATION_MASK_ELEMENT_STYLE_ID];
6
+ };
9
7
  export type BuildZoomStylesParams = {
10
- id: BoundId;
11
- group?: string;
8
+ resolvedTag?: string;
12
9
  zoomOptions?: BoundsNavigationZoomOptions;
13
- props: BoundsFrameProps;
14
- resolveTag: ResolveTag;
15
- computeRaw: ComputeRaw;
10
+ props: BoundsInterpolationProps;
16
11
  };
17
12
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,6BAA6B,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,MAAM,MAAM,UAAU,GAAG,CAAC,MAAM,EAAE;IACjC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,KAAK,MAAM,GAAG,SAAS,CAAC;AAEzB,MAAM,MAAM,UAAU,GAAG,CACxB,SAAS,EAAE,OAAO,CAAC,aAAa,CAAC,EACjC,UAAU,CAAC,EAAE,gBAAgB,KACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7B,MAAM,MAAM,qBAAqB,GAAG;IACnC,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,KAAK,EAAE,gBAAgB,CAAC;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;CACvB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC/D,CAAC,kCAAkC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,kCAAkC,CAAC,CAAC;IAC5G,CAAC,gCAAgC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,gCAAgC,CAAC,CAAC;CACxG,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,KAAK,EAAE,wBAAwB,CAAC;CAChC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ScreenKey } from "../types/screen.types";
2
+ interface CreateStoreOptions<TBag> {
3
+ createBag: () => TBag;
4
+ disposeBag: (bag: TBag) => void;
5
+ }
6
+ export declare function createStore<TBag>({ createBag, disposeBag, }: CreateStoreOptions<TBag>): {
7
+ peekBag: (routeKey: ScreenKey) => TBag | undefined;
8
+ getBag: (routeKey: ScreenKey) => TBag;
9
+ getValue: <K extends keyof TBag>(routeKey: ScreenKey, key: K) => TBag[K];
10
+ getCachedBag: () => TBag;
11
+ clearBag: (routeKey: ScreenKey) => void;
12
+ };
13
+ export {};
14
+ //# sourceMappingURL=create-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-store.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/create-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,UAAU,kBAAkB,CAAC,IAAI;IAChC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,UAAU,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,IAAI,CAAC;CAChC;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,EACjC,SAAS,EACT,UAAU,GACV,EAAE,kBAAkB,CAAC,IAAI,CAAC;wBAIC,SAAS,KAAG,IAAI,GAAG,SAAS;uBAI7B,SAAS,KAAG,IAAI;eASxB,CAAC,SAAS,MAAM,IAAI,YAC3B,SAAS,OACd,CAAC,KACJ,IAAI,CAAC,CAAC,CAAC;wBASe,IAAI;yBAOD,SAAS;EAerC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screen-transitions",
3
- "version": "3.4.0-alpha.3",
3
+ "version": "3.4.0-alpha.5",
4
4
  "description": "Easy screen transitions for React Native and Expo",
5
5
  "author": "Ed",
6
6
  "license": "MIT",
@@ -15,7 +15,7 @@ const POINT_NONE = "none" as const;
15
15
  const POINT_BOX_NONE = "box-none" as const;
16
16
 
17
17
  export const ComponentScreen = ({ routeKey, children }: ScreenProps) => {
18
- const sceneClosing = AnimationStore.getRouteAnimation(routeKey, "closing");
18
+ const sceneClosing = AnimationStore.getValue(routeKey, "closing");
19
19
  const screenRef = useAnimatedRef<View>();
20
20
 
21
21
  const animatedProps = useAnimatedProps(() => {
@@ -2,6 +2,7 @@ import { runOnUI } from "react-native-reanimated";
2
2
  import { DefaultSnapSpec } from "../configs/specs";
3
3
  import { AnimationStore } from "../stores/animation.store";
4
4
  import type { HistoryEntry } from "../stores/history.store";
5
+ import { SystemStore } from "../stores/system.store";
5
6
  import { animateToProgress } from "../utils/animation/animate-to-progress";
6
7
  import { logger } from "../utils/logger";
7
8
  import { resolveSnapTargetEntry } from "./resolve-snap-target";
@@ -12,10 +13,10 @@ const getSortedSnapPoints = (
12
13
  const snapPoints = descriptor.options?.snapPoints;
13
14
  if (!snapPoints || snapPoints.length === 0) return null;
14
15
 
15
- // Resolve 'auto' to the measured fraction stored in AnimationStore
16
- const autoVal = AnimationStore.getAnimation(
16
+ // Resolve 'auto' to the measured fraction stored in SystemStore
17
+ const autoVal = SystemStore.getValue(
17
18
  descriptor.route.key,
18
- "autoSnapPoint",
19
+ "resolvedAutoSnapPoint",
19
20
  ).value;
20
21
 
21
22
  const resolved = snapPoints
@@ -43,13 +44,18 @@ export function snapDescriptorToIndex(
43
44
  }
44
45
 
45
46
  const targetProgress = sorted[index];
46
- const animations = AnimationStore.getRouteAnimations(descriptor.route.key);
47
+ const animations = AnimationStore.getBag(descriptor.route.key);
48
+ const targetProgressValue = SystemStore.getValue(
49
+ descriptor.route.key,
50
+ "targetProgress",
51
+ );
47
52
 
48
53
  runOnUI(() => {
49
54
  "worklet";
50
55
  animateToProgress({
51
56
  target: targetProgress,
52
57
  animations,
58
+ targetProgress: targetProgressValue,
53
59
  spec: {
54
60
  open: descriptor.options.transitionSpec?.expand ?? DefaultSnapSpec,
55
61
  close: descriptor.options.transitionSpec?.collapse ?? DefaultSnapSpec,
@@ -83,7 +83,7 @@ export const resolveMeasurementWritePlan = (params: {
83
83
  const refreshSource = intents.refreshSource && hasSourceLink;
84
84
  const refreshDestination =
85
85
  intents.refreshDestination && (hasDestinationLink || hasPendingLink);
86
- const registerSnapshot = intents.snapshotOnly;
86
+ const registerSnapshot = intents.snapshotOnly || intents.refreshSource;
87
87
  const writesAny =
88
88
  registerSnapshot ||
89
89
  captureSource ||
@@ -1,5 +1,12 @@
1
- import { type SharedValue, useAnimatedReaction } from "react-native-reanimated";
1
+ import {
2
+ useAnimatedReaction,
3
+ useDerivedValue,
4
+ useSharedValue,
5
+ } from "react-native-reanimated";
6
+ import { EPSILON } from "../../../constants";
7
+ import { AnimationStore } from "../../../stores/animation.store";
2
8
  import { BoundStore } from "../../../stores/bounds";
9
+ import { GestureStore } from "../../../stores/gesture.store";
3
10
  import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
4
11
  import {
5
12
  canFlushGroupActiveMeasurement,
@@ -18,33 +25,93 @@ export const useGroupActiveMeasurement = (params: {
18
25
  enabled: boolean;
19
26
  group: string | undefined;
20
27
  id: BoundaryId;
28
+ currentScreenKey: string;
21
29
  shouldUpdateDestination: boolean;
22
- isAnimating: SharedValue<number>;
23
30
  maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
24
31
  }) => {
25
32
  const {
26
33
  enabled,
27
34
  group,
28
35
  id,
36
+ currentScreenKey,
29
37
  shouldUpdateDestination,
30
- isAnimating,
31
38
  maybeMeasureAndStore,
32
39
  } = params;
33
40
  const idStr = String(id);
34
41
 
35
42
  const allGroups = BoundStore.getGroups();
43
+ const progress = AnimationStore.getValue(currentScreenKey, "progress");
44
+ const animating = AnimationStore.getValue(currentScreenKey, "animating");
45
+ const entering = AnimationStore.getValue(currentScreenKey, "entering");
46
+ const closing = AnimationStore.getValue(currentScreenKey, "closing");
47
+ const dragging = GestureStore.getValue(currentScreenKey, "dragging");
48
+ const dismissing = GestureStore.getValue(currentScreenKey, "dismissing");
49
+ const hasSettledOpenOnce = useSharedValue(false);
50
+
51
+ useAnimatedReaction(
52
+ () => {
53
+ "worklet";
54
+ if (!enabled || !shouldUpdateDestination) return false;
55
+ return (
56
+ progress.value >= 1 - EPSILON &&
57
+ animating.value === 0 &&
58
+ entering.value === 0 &&
59
+ closing.value === 0 &&
60
+ dragging.value === 0 &&
61
+ dismissing.value === 0
62
+ );
63
+ },
64
+ (isSettledOpen) => {
65
+ "worklet";
66
+ if (isSettledOpen) {
67
+ hasSettledOpenOnce.value = true;
68
+ }
69
+ },
70
+ [
71
+ enabled,
72
+ shouldUpdateDestination,
73
+ progress,
74
+ animating,
75
+ entering,
76
+ closing,
77
+ dragging,
78
+ dismissing,
79
+ hasSettledOpenOnce,
80
+ ],
81
+ );
82
+
83
+ const isRefreshBlocked = useDerivedValue<number>(() => {
84
+ "worklet";
85
+ if (!enabled || !shouldUpdateDestination) return 0;
86
+ if (!hasSettledOpenOnce.value) return 1;
87
+ if (progress.value < 1 - EPSILON) return 1;
88
+ if (animating.value !== 0) return 1;
89
+ if (entering.value !== 0) return 1;
90
+ if (closing.value !== 0) return 1;
91
+ if (dragging.value !== 0) return 1;
92
+ if (dismissing.value !== 0) return 1;
93
+ return 0;
94
+ });
95
+
36
96
  const { clearPendingMeasurement, queueOrFlushMeasurement } =
37
97
  useDeferredMeasurementTrigger({
38
98
  enabled,
39
- isAnimating,
99
+ /**
100
+ * The reason to do extra guard checks for isAnimating is because a user may mid animation drag, causing
101
+ * the src component to be wrongly measured. This in turns leads to faulty src measurements being used, giving us a weird teleport
102
+ * animation rather than a smooth 'SET' transition when dst is actually dismissing.
103
+ */
104
+ isAnimating: isRefreshBlocked,
40
105
  canFlush: () => {
41
106
  "worklet";
42
- return canFlushGroupActiveMeasurement({
43
- enabled,
44
- isEligible: !!group && shouldUpdateDestination,
45
- memberId: idStr,
46
- activeId: group ? (allGroups.value[group]?.activeId ?? null) : null,
47
- });
107
+ return (
108
+ canFlushGroupActiveMeasurement({
109
+ enabled,
110
+ isEligible: !!group && shouldUpdateDestination,
111
+ memberId: idStr,
112
+ activeId: group ? (allGroups.value[group]?.activeId ?? null) : null,
113
+ }) && hasSettledOpenOnce.value
114
+ );
48
115
  },
49
116
  onFlush: () => {
50
117
  "worklet";
@@ -75,6 +142,9 @@ export const useGroupActiveMeasurement = (params: {
75
142
  }
76
143
 
77
144
  if (action === "queue-or-flush") {
145
+ if (!hasSettledOpenOnce.value) {
146
+ return;
147
+ }
78
148
  queueOrFlushMeasurement();
79
149
  }
80
150
  },
@@ -82,7 +152,9 @@ export const useGroupActiveMeasurement = (params: {
82
152
  enabled,
83
153
  group,
84
154
  idStr,
155
+ currentScreenKey,
85
156
  shouldUpdateDestination,
157
+ hasSettledOpenOnce,
86
158
  clearPendingMeasurement,
87
159
  queueOrFlushMeasurement,
88
160
  ],
@@ -23,13 +23,10 @@ export const useInitialLayoutHandler = (params: {
23
23
  maybeMeasureAndStore,
24
24
  } = params;
25
25
 
26
- const isAnimating = AnimationStore.getRouteAnimation(
27
- currentScreenKey,
28
- "animating",
29
- );
26
+ const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
30
27
 
31
28
  const ancestorAnimations = ancestorKeys.map((key) =>
32
- AnimationStore.getRouteAnimation(key, "animating"),
29
+ AnimationStore.getValue(key, "animating"),
33
30
  );
34
31
 
35
32
  const hasMeasuredOnLayout = useSharedValue(false);
@@ -94,14 +94,8 @@ export function createBoundaryComponent<P extends object>(
94
94
  };
95
95
  }, [anchor, scaleMode, target, method]);
96
96
 
97
- const isAnimating = AnimationStore.getRouteAnimation(
98
- currentScreenKey,
99
- "animating",
100
- );
101
- const progress = AnimationStore.getRouteAnimation(
102
- currentScreenKey,
103
- "progress",
104
- );
97
+ const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
98
+ const progress = AnimationStore.getValue(currentScreenKey, "progress");
105
99
 
106
100
  const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
107
101
 
@@ -174,14 +168,14 @@ export function createBoundaryComponent<P extends object>(
174
168
  enabled: runtimeEnabled,
175
169
  group,
176
170
  id,
171
+ currentScreenKey,
177
172
  shouldUpdateDestination,
178
- isAnimating,
179
173
  maybeMeasureAndStore,
180
174
  });
181
175
 
182
- // Source-side analog for grouped retargeting: when an unfocused/source
183
- // boundary becomes the active member, refresh its snapshot (and source
184
- // link when one exists) so close transitions don't use stale geometry.
176
+ // Source-side grouped retargeting: when an unfocused/source boundary
177
+ // becomes the active member, refresh its snapshot and source link so
178
+ // close transitions do not use stale pre-scroll geometry.
185
179
  useGroupActiveSourceMeasurement({
186
180
  enabled: runtimeEnabled,
187
181
  group,
@@ -56,15 +56,9 @@ export const NativeScreen = ({
56
56
  const topRouteKey = routes[topIndex]?.key ?? routeKey;
57
57
  const screenRef = useAnimatedRef<View>();
58
58
 
59
- const sceneClosing = AnimationStore.getRouteAnimation(routeKey, "closing");
60
- const topSceneProgress = AnimationStore.getRouteAnimation(
61
- topRouteKey,
62
- "progress",
63
- );
64
- const topSceneClosing = AnimationStore.getRouteAnimation(
65
- topRouteKey,
66
- "closing",
67
- );
59
+ const sceneClosing = AnimationStore.getValue(routeKey, "closing");
60
+ const topSceneProgress = AnimationStore.getValue(topRouteKey, "progress");
61
+ const topSceneClosing = AnimationStore.getValue(topRouteKey, "closing");
68
62
  const screenActivity = useSharedValue<ScreenActivity>(
69
63
  ScreenActivity.TRANSITIONING_OR_BELOW_TOP,
70
64
  );
@@ -1,7 +1,7 @@
1
1
  import { memo } from "react";
2
2
  import { StyleSheet } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
- import { HIDDEN_STYLE, NO_STYLES } from "../../constants";
4
+ import { HIDDEN_STYLE, VISIBLE_STYLE } from "../../constants";
5
5
  import { useScreenStyles } from "../../providers/screen/styles.provider";
6
6
 
7
7
  type Props = {
@@ -20,7 +20,7 @@ export const DeferredVisibilityHost = memo(({ children }: Props) => {
20
20
 
21
21
  const animatedStyle = useAnimatedStyle(() => {
22
22
  "worklet";
23
- return resolutionMode.value === "deferred" ? HIDDEN_STYLE : NO_STYLES;
23
+ return resolutionMode.value === "deferred" ? HIDDEN_STYLE : VISIBLE_STYLE;
24
24
  });
25
25
 
26
26
  return (