react-native-screen-transitions 3.0.0-beta.1 → 3.0.0-beta.11

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 (429) hide show
  1. package/README.md +60 -5
  2. package/lib/commonjs/blank-stack/components/Overlay.js +20 -6
  3. package/lib/commonjs/blank-stack/components/Overlay.js.map +1 -1
  4. package/lib/commonjs/blank-stack/components/Screens.js +5 -5
  5. package/lib/commonjs/blank-stack/components/Screens.js.map +1 -1
  6. package/lib/commonjs/blank-stack/components/StackView.js +14 -8
  7. package/lib/commonjs/blank-stack/components/StackView.js.map +1 -1
  8. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +5 -9
  9. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  10. package/lib/commonjs/blank-stack/index.js +7 -0
  11. package/lib/commonjs/blank-stack/index.js.map +1 -1
  12. package/lib/commonjs/native-stack/views/NativeStackView.native.js +4 -3
  13. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  14. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js +25 -11
  15. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js.map +1 -1
  16. package/lib/commonjs/shared/components/create-transition-aware-component.js +11 -14
  17. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  18. package/lib/commonjs/shared/components/root-transition-aware.js +1 -1
  19. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  20. package/lib/commonjs/shared/configs/presets.js +20 -9
  21. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  22. package/lib/commonjs/shared/constants.js +0 -1
  23. package/lib/commonjs/shared/constants.js.map +1 -1
  24. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -10
  25. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  26. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +10 -25
  27. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  28. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +48 -36
  29. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  30. package/lib/commonjs/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  31. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js +1 -1
  32. package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  33. package/lib/commonjs/shared/hooks/use-stable-callback-value.js +7 -1
  34. package/lib/commonjs/shared/hooks/use-stable-callback-value.js.map +1 -1
  35. package/lib/commonjs/shared/hooks/use-stable-callback.js.map +1 -1
  36. package/lib/commonjs/shared/providers/{gestures.js → gestures.provider.js} +7 -4
  37. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -0
  38. package/lib/commonjs/shared/providers/{keys.js → keys.provider.js} +1 -1
  39. package/lib/commonjs/shared/providers/keys.provider.js.map +1 -0
  40. package/lib/commonjs/shared/providers/register-bounds.provider.js +207 -0
  41. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -0
  42. package/lib/commonjs/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  43. package/lib/commonjs/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  44. package/lib/commonjs/shared/providers/{transition-styles.js → transition-styles.provider.js} +7 -9
  45. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +1 -0
  46. package/lib/commonjs/shared/stores/{animation-store.js → animation.store.js} +13 -4
  47. package/lib/commonjs/shared/stores/animation.store.js.map +1 -0
  48. package/lib/commonjs/shared/stores/bounds.store.js +141 -0
  49. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -0
  50. package/lib/commonjs/shared/stores/{gesture-store.js → gesture.store.js} +11 -1
  51. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -0
  52. package/lib/commonjs/shared/types/{core.js → animation.types.js} +1 -1
  53. package/lib/commonjs/shared/types/animation.types.js.map +1 -0
  54. package/lib/commonjs/shared/types/{bounds.js → bounds.types.js} +1 -1
  55. package/lib/commonjs/shared/types/bounds.types.js.map +1 -0
  56. package/lib/commonjs/shared/types/{animation.js → core.types.js} +1 -1
  57. package/lib/commonjs/shared/types/{animation.js.map → core.types.js.map} +1 -1
  58. package/lib/commonjs/shared/types/{gesture.js → gesture.types.js} +1 -1
  59. package/lib/commonjs/shared/types/gesture.types.js.map +1 -0
  60. package/lib/commonjs/shared/types/utils.types.js +2 -0
  61. package/lib/commonjs/shared/types/{core.js.map → utils.types.js.map} +1 -1
  62. package/lib/commonjs/shared/utils/animation/derivations.js +1 -7
  63. package/lib/commonjs/shared/utils/animation/derivations.js.map +1 -1
  64. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -0
  65. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +19 -0
  66. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  67. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  68. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -0
  69. package/lib/commonjs/shared/utils/bounds/index.js +45 -35
  70. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  71. package/lib/commonjs/shared/utils/bounds/types/builder.js.map +1 -0
  72. package/lib/commonjs/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  73. package/lib/commonjs/shared/utils/create-provider.js +51 -0
  74. package/lib/commonjs/shared/utils/create-provider.js.map +1 -0
  75. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +1 -1
  76. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js +1 -1
  77. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +17 -0
  78. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -0
  79. package/lib/module/blank-stack/components/Overlay.js +20 -6
  80. package/lib/module/blank-stack/components/Overlay.js.map +1 -1
  81. package/lib/module/blank-stack/components/Screens.js +4 -4
  82. package/lib/module/blank-stack/components/Screens.js.map +1 -1
  83. package/lib/module/blank-stack/components/StackView.js +12 -7
  84. package/lib/module/blank-stack/components/StackView.js.map +1 -1
  85. package/lib/module/blank-stack/hooks/use-overlay-animation.js +5 -9
  86. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  87. package/lib/module/blank-stack/index.js +1 -0
  88. package/lib/module/blank-stack/index.js.map +1 -1
  89. package/lib/module/native-stack/views/NativeStackView.native.js +3 -2
  90. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  91. package/lib/module/shared/components/controllers/screen-lifecycle.js +24 -10
  92. package/lib/module/shared/components/controllers/screen-lifecycle.js.map +1 -1
  93. package/lib/module/shared/components/create-transition-aware-component.js +11 -14
  94. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  95. package/lib/module/shared/components/root-transition-aware.js +1 -1
  96. package/lib/module/shared/components/root-transition-aware.js.map +1 -1
  97. package/lib/module/shared/configs/presets.js +20 -9
  98. package/lib/module/shared/configs/presets.js.map +1 -1
  99. package/lib/module/shared/constants.js +0 -1
  100. package/lib/module/shared/constants.js.map +1 -1
  101. package/lib/module/shared/hooks/animation/use-associated-style.js +9 -10
  102. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  103. package/lib/module/shared/hooks/animation/use-screen-animation.js +7 -22
  104. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  105. package/lib/module/shared/hooks/gestures/use-build-gestures.js +46 -34
  106. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  107. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  108. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js.map +1 -1
  109. package/lib/module/shared/hooks/gestures/use-scroll-registry.js +1 -1
  110. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  111. package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  112. package/lib/module/shared/hooks/use-stable-callback-value.js +8 -2
  113. package/lib/module/shared/hooks/use-stable-callback-value.js.map +1 -1
  114. package/lib/module/shared/hooks/use-stable-callback.js.map +1 -1
  115. package/lib/module/shared/providers/{gestures.js → gestures.provider.js} +7 -4
  116. package/lib/module/shared/providers/gestures.provider.js.map +1 -0
  117. package/lib/module/shared/providers/{keys.js → keys.provider.js} +1 -1
  118. package/lib/module/shared/providers/keys.provider.js.map +1 -0
  119. package/lib/module/shared/providers/register-bounds.provider.js +202 -0
  120. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -0
  121. package/lib/module/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  122. package/lib/module/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  123. package/lib/module/shared/providers/{transition-styles.js → transition-styles.provider.js} +6 -9
  124. package/lib/module/shared/providers/transition-styles.provider.js.map +1 -0
  125. package/lib/module/shared/stores/animation.store.js +44 -0
  126. package/lib/module/shared/stores/animation.store.js.map +1 -0
  127. package/lib/module/shared/stores/bounds.store.js +137 -0
  128. package/lib/module/shared/stores/bounds.store.js.map +1 -0
  129. package/lib/module/shared/stores/{gesture-store.js → gesture.store.js} +12 -2
  130. package/lib/module/shared/stores/gesture.store.js.map +1 -0
  131. package/lib/module/shared/types/animation.types.js +4 -0
  132. package/lib/module/shared/types/animation.types.js.map +1 -0
  133. package/lib/module/shared/types/bounds.types.js +4 -0
  134. package/lib/module/shared/types/bounds.types.js.map +1 -0
  135. package/lib/module/shared/types/core.types.js +4 -0
  136. package/lib/{commonjs/shared/types/bounds.js.map → module/shared/types/core.types.js.map} +1 -1
  137. package/lib/module/shared/types/{gesture.js → gesture.types.js} +1 -1
  138. package/lib/module/shared/types/gesture.types.js.map +1 -0
  139. package/lib/module/shared/types/utils.types.js +2 -0
  140. package/lib/{commonjs/shared/types/utils.js.map → module/shared/types/utils.types.js.map} +1 -1
  141. package/lib/module/shared/utils/animation/derivations.js +1 -7
  142. package/lib/module/shared/utils/animation/derivations.js.map +1 -1
  143. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -0
  144. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +14 -0
  145. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  146. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  147. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -0
  148. package/lib/module/shared/utils/bounds/index.js +45 -35
  149. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  150. package/lib/module/shared/utils/bounds/types/builder.js.map +1 -0
  151. package/lib/module/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  152. package/lib/module/shared/utils/create-provider.js +46 -0
  153. package/lib/module/shared/utils/create-provider.js.map +1 -0
  154. package/lib/module/shared/utils/gesture/apply-offset-rules.js +1 -1
  155. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +1 -1
  156. package/lib/module/shared/utils/gesture/check-gesture-activation.js +1 -1
  157. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  158. package/lib/module/shared/utils/reset-stores-for-screen.js +13 -0
  159. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -0
  160. package/lib/typescript/blank-stack/components/Overlay.d.ts.map +1 -1
  161. package/lib/typescript/blank-stack/components/Screens.d.ts +2 -3
  162. package/lib/typescript/blank-stack/components/Screens.d.ts.map +1 -1
  163. package/lib/typescript/blank-stack/components/StackView.d.ts.map +1 -1
  164. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +1 -1
  165. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +1 -1
  166. package/lib/typescript/blank-stack/index.d.ts +1 -0
  167. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  168. package/lib/typescript/blank-stack/types.d.ts +6 -2
  169. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  170. package/lib/typescript/native-stack/types.d.ts +1 -1
  171. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  172. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  173. package/lib/typescript/shared/components/controllers/screen-lifecycle.d.ts.map +1 -1
  174. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  175. package/lib/typescript/shared/configs/index.d.ts +15 -9
  176. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  177. package/lib/typescript/shared/configs/presets.d.ts +10 -4
  178. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  179. package/lib/typescript/shared/constants.d.ts +6 -6
  180. package/lib/typescript/shared/constants.d.ts.map +1 -1
  181. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  182. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts +2 -2
  183. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  184. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts +5 -2
  185. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  186. package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -0
  187. package/lib/typescript/shared/hooks/use-stable-callback-value.d.ts.map +1 -1
  188. package/lib/typescript/shared/hooks/use-stable-callback.d.ts.map +1 -1
  189. package/lib/typescript/shared/index.d.ts +25 -18
  190. package/lib/typescript/shared/index.d.ts.map +1 -1
  191. package/lib/typescript/shared/providers/{gestures.d.ts → gestures.provider.d.ts} +5 -3
  192. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -0
  193. package/lib/typescript/shared/providers/{keys.d.ts → keys.provider.d.ts} +2 -2
  194. package/lib/typescript/shared/providers/keys.provider.d.ts.map +1 -0
  195. package/lib/typescript/shared/providers/register-bounds.provider.d.ts +17 -0
  196. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -0
  197. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts → screen-transition.provider.d.ts} +2 -2
  198. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts.map → screen-transition.provider.d.ts.map} +1 -1
  199. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +14 -0
  200. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +1 -0
  201. package/lib/typescript/shared/stores/{animation-store.d.ts → animation.store.d.ts} +6 -4
  202. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -0
  203. package/lib/typescript/shared/stores/bounds.store.d.ts +29 -0
  204. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -0
  205. package/lib/typescript/shared/stores/{gesture-store.d.ts → gesture.store.d.ts} +3 -3
  206. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -0
  207. package/lib/typescript/shared/types/{animation.d.ts → animation.types.d.ts} +48 -20
  208. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -0
  209. package/lib/typescript/shared/types/{bounds.d.ts → bounds.types.d.ts} +4 -4
  210. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -0
  211. package/lib/typescript/shared/types/{core.d.ts → core.types.d.ts} +3 -3
  212. package/lib/typescript/shared/types/core.types.d.ts.map +1 -0
  213. package/lib/typescript/shared/types/{gesture.d.ts → gesture.types.d.ts} +1 -1
  214. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -0
  215. package/lib/typescript/shared/types/{utils.d.ts → utils.types.d.ts} +1 -1
  216. package/lib/typescript/shared/types/utils.types.d.ts.map +1 -0
  217. package/lib/typescript/shared/utils/animation/derivations.d.ts +2 -4
  218. package/lib/typescript/shared/utils/animation/derivations.d.ts.map +1 -1
  219. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts +2 -2
  220. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts.map +1 -1
  221. package/lib/typescript/shared/utils/bounds/constants.d.ts +3 -3
  222. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -1
  223. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/geometry.d.ts +3 -3
  224. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -0
  225. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +1 -0
  226. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/style-composers.d.ts +2 -2
  227. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -0
  228. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/styles.d.ts +1 -1
  229. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -0
  230. package/lib/typescript/shared/utils/bounds/index.d.ts +3 -4
  231. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/bounds/{_types → types}/builder.d.ts +13 -34
  233. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -0
  234. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -0
  235. package/lib/typescript/shared/utils/create-provider.d.ts +14 -0
  236. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -0
  237. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +2 -2
  238. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +1 -1
  239. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +2 -2
  240. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  241. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts +2 -2
  242. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts.map +1 -1
  243. package/lib/typescript/shared/utils/gesture/velocity.d.ts +1 -1
  244. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +6 -0
  245. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -0
  246. package/package.json +1 -1
  247. package/src/blank-stack/components/Overlay.tsx +25 -5
  248. package/src/blank-stack/components/Screens.tsx +6 -6
  249. package/src/blank-stack/components/StackView.tsx +11 -5
  250. package/src/blank-stack/hooks/use-overlay-animation.tsx +6 -21
  251. package/src/blank-stack/index.ts +1 -0
  252. package/src/blank-stack/types.ts +6 -2
  253. package/src/native-stack/types.ts +1 -1
  254. package/src/native-stack/views/NativeStackView.native.tsx +4 -2
  255. package/src/shared/components/controllers/screen-lifecycle.tsx +26 -11
  256. package/src/shared/components/create-transition-aware-component.tsx +23 -27
  257. package/src/shared/components/root-transition-aware.tsx +1 -1
  258. package/src/shared/configs/presets.ts +31 -17
  259. package/src/shared/constants.ts +6 -7
  260. package/src/shared/hooks/animation/use-associated-style.tsx +8 -9
  261. package/src/shared/hooks/animation/use-screen-animation.tsx +8 -26
  262. package/src/shared/hooks/gestures/use-build-gestures.tsx +66 -38
  263. package/src/shared/hooks/gestures/use-parent-gesture-registry.tsx +1 -1
  264. package/src/shared/hooks/gestures/use-scroll-registry.tsx +2 -2
  265. package/src/shared/hooks/{use-stable-callback-value.tsx → use-stable-callback-value.ts} +10 -1
  266. package/src/shared/index.ts +4 -1
  267. package/src/shared/providers/{gestures.tsx → gestures.provider.tsx} +17 -8
  268. package/src/shared/providers/{keys.tsx → keys.provider.tsx} +1 -1
  269. package/src/shared/providers/register-bounds.provider.tsx +284 -0
  270. package/src/shared/providers/{screen-transition-provider.tsx → screen-transition.provider.tsx} +3 -3
  271. package/src/shared/providers/{transition-styles.tsx → transition-styles.provider.tsx} +13 -14
  272. package/src/shared/stores/{animation-store.ts → animation.store.ts} +20 -4
  273. package/src/shared/stores/bounds.store.ts +166 -0
  274. package/src/shared/stores/{gesture-store.ts → gesture.store.ts} +17 -3
  275. package/src/shared/types/{animation.ts → animation.types.ts} +60 -19
  276. package/src/shared/types/{bounds.ts → bounds.types.ts} +3 -3
  277. package/src/shared/types/{core.ts → core.types.ts} +10 -2
  278. package/src/shared/utils/animation/derivations.ts +2 -8
  279. package/src/shared/utils/animation/start-screen-transition.ts +2 -2
  280. package/src/shared/utils/bounds/constants.ts +3 -3
  281. package/src/shared/utils/bounds/{_utils → helpers}/geometry.ts +3 -3
  282. package/src/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.ts +3 -3
  283. package/src/shared/utils/bounds/{_utils → helpers}/style-composers.ts +2 -2
  284. package/src/shared/utils/bounds/{_utils → helpers}/styles.ts +1 -1
  285. package/src/shared/utils/bounds/index.ts +53 -55
  286. package/src/shared/utils/bounds/{_types → types}/builder.ts +19 -37
  287. package/src/shared/utils/create-provider.tsx +71 -0
  288. package/src/shared/utils/gesture/apply-offset-rules.ts +2 -2
  289. package/src/shared/utils/gesture/check-gesture-activation.ts +2 -2
  290. package/src/shared/utils/gesture/reset-gesture-values.ts +2 -2
  291. package/src/shared/utils/gesture/velocity.ts +1 -1
  292. package/src/shared/utils/reset-stores-for-screen.ts +11 -0
  293. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js +0 -131
  294. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  295. package/lib/commonjs/shared/hooks/use-shared-value-state.js.map +0 -1
  296. package/lib/commonjs/shared/providers/gestures.js.map +0 -1
  297. package/lib/commonjs/shared/providers/keys.js.map +0 -1
  298. package/lib/commonjs/shared/providers/transition-styles.js.map +0 -1
  299. package/lib/commonjs/shared/providers/utils/create-provider.js +0 -39
  300. package/lib/commonjs/shared/providers/utils/create-provider.js.map +0 -1
  301. package/lib/commonjs/shared/stores/animation-store.js.map +0 -1
  302. package/lib/commonjs/shared/stores/bound-store/_utils.js +0 -118
  303. package/lib/commonjs/shared/stores/bound-store/_utils.js.map +0 -1
  304. package/lib/commonjs/shared/stores/bound-store/index.js +0 -116
  305. package/lib/commonjs/shared/stores/bound-store/index.js.map +0 -1
  306. package/lib/commonjs/shared/stores/gesture-store.js.map +0 -1
  307. package/lib/commonjs/shared/stores/navigator-dismiss-state.js +0 -23
  308. package/lib/commonjs/shared/stores/navigator-dismiss-state.js.map +0 -1
  309. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js +0 -19
  310. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  311. package/lib/commonjs/shared/types/gesture.js.map +0 -1
  312. package/lib/commonjs/shared/types/utils.js +0 -2
  313. package/lib/commonjs/shared/utils/bounds/_types/geometry.js.map +0 -1
  314. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js +0 -6
  315. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  316. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js +0 -27
  317. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  318. package/lib/commonjs/shared/utils/bounds/_utils/geometry.js.map +0 -1
  319. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js +0 -49
  320. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  321. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js +0 -19
  322. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  323. package/lib/commonjs/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  324. package/lib/commonjs/shared/utils/bounds/_utils/styles.js.map +0 -1
  325. package/lib/module/shared/hooks/bounds/use-bound-registry.js +0 -125
  326. package/lib/module/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  327. package/lib/module/shared/hooks/use-shared-value-state.js.map +0 -1
  328. package/lib/module/shared/providers/gestures.js.map +0 -1
  329. package/lib/module/shared/providers/keys.js.map +0 -1
  330. package/lib/module/shared/providers/transition-styles.js.map +0 -1
  331. package/lib/module/shared/providers/utils/create-provider.js +0 -33
  332. package/lib/module/shared/providers/utils/create-provider.js.map +0 -1
  333. package/lib/module/shared/stores/animation-store.js +0 -33
  334. package/lib/module/shared/stores/animation-store.js.map +0 -1
  335. package/lib/module/shared/stores/bound-store/_utils.js +0 -113
  336. package/lib/module/shared/stores/bound-store/_utils.js.map +0 -1
  337. package/lib/module/shared/stores/bound-store/index.js +0 -112
  338. package/lib/module/shared/stores/bound-store/index.js.map +0 -1
  339. package/lib/module/shared/stores/gesture-store.js.map +0 -1
  340. package/lib/module/shared/stores/navigator-dismiss-state.js +0 -19
  341. package/lib/module/shared/stores/navigator-dismiss-state.js.map +0 -1
  342. package/lib/module/shared/stores/utils/reset-stores-for-screen.js +0 -15
  343. package/lib/module/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  344. package/lib/module/shared/types/animation.js +0 -4
  345. package/lib/module/shared/types/animation.js.map +0 -1
  346. package/lib/module/shared/types/bounds.js +0 -4
  347. package/lib/module/shared/types/bounds.js.map +0 -1
  348. package/lib/module/shared/types/core.js +0 -4
  349. package/lib/module/shared/types/core.js.map +0 -1
  350. package/lib/module/shared/types/gesture.js.map +0 -1
  351. package/lib/module/shared/types/utils.js +0 -2
  352. package/lib/module/shared/types/utils.js.map +0 -1
  353. package/lib/module/shared/utils/bounds/_types/geometry.js.map +0 -1
  354. package/lib/module/shared/utils/bounds/_types/get-bounds.js +0 -4
  355. package/lib/module/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  356. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js +0 -23
  357. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  358. package/lib/module/shared/utils/bounds/_utils/geometry.js.map +0 -1
  359. package/lib/module/shared/utils/bounds/_utils/get-bounds.js +0 -44
  360. package/lib/module/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  361. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js +0 -14
  362. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  363. package/lib/module/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  364. package/lib/module/shared/utils/bounds/_utils/styles.js.map +0 -1
  365. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts +0 -17
  366. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts.map +0 -1
  367. package/lib/typescript/shared/hooks/use-shared-value-state.d.ts.map +0 -1
  368. package/lib/typescript/shared/providers/gestures.d.ts.map +0 -1
  369. package/lib/typescript/shared/providers/keys.d.ts.map +0 -1
  370. package/lib/typescript/shared/providers/transition-styles.d.ts +0 -11
  371. package/lib/typescript/shared/providers/transition-styles.d.ts.map +0 -1
  372. package/lib/typescript/shared/providers/utils/create-provider.d.ts +0 -32
  373. package/lib/typescript/shared/providers/utils/create-provider.d.ts.map +0 -1
  374. package/lib/typescript/shared/stores/animation-store.d.ts.map +0 -1
  375. package/lib/typescript/shared/stores/bound-store/_utils.d.ts +0 -24
  376. package/lib/typescript/shared/stores/bound-store/_utils.d.ts.map +0 -1
  377. package/lib/typescript/shared/stores/bound-store/index.d.ts +0 -22
  378. package/lib/typescript/shared/stores/bound-store/index.d.ts.map +0 -1
  379. package/lib/typescript/shared/stores/gesture-store.d.ts.map +0 -1
  380. package/lib/typescript/shared/stores/navigator-dismiss-state.d.ts +0 -7
  381. package/lib/typescript/shared/stores/navigator-dismiss-state.d.ts.map +0 -1
  382. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts +0 -6
  383. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts.map +0 -1
  384. package/lib/typescript/shared/types/animation.d.ts.map +0 -1
  385. package/lib/typescript/shared/types/bounds.d.ts.map +0 -1
  386. package/lib/typescript/shared/types/core.d.ts.map +0 -1
  387. package/lib/typescript/shared/types/gesture.d.ts.map +0 -1
  388. package/lib/typescript/shared/types/utils.d.ts.map +0 -1
  389. package/lib/typescript/shared/utils/bounds/_types/builder.d.ts.map +0 -1
  390. package/lib/typescript/shared/utils/bounds/_types/geometry.d.ts.map +0 -1
  391. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts +0 -10
  392. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts.map +0 -1
  393. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts +0 -2
  394. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts.map +0 -1
  395. package/lib/typescript/shared/utils/bounds/_utils/geometry.d.ts.map +0 -1
  396. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts +0 -4
  397. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts.map +0 -1
  398. package/lib/typescript/shared/utils/bounds/_utils/is-bounds-equal.d.ts.map +0 -1
  399. package/lib/typescript/shared/utils/bounds/_utils/style-composers.d.ts.map +0 -1
  400. package/lib/typescript/shared/utils/bounds/_utils/styles.d.ts.map +0 -1
  401. package/src/shared/hooks/bounds/use-bound-registry.tsx +0 -153
  402. package/src/shared/providers/utils/create-provider.ts +0 -64
  403. package/src/shared/stores/bound-store/_utils.ts +0 -161
  404. package/src/shared/stores/bound-store/index.ts +0 -125
  405. package/src/shared/stores/navigator-dismiss-state.ts +0 -17
  406. package/src/shared/stores/utils/reset-stores-for-screen.ts +0 -13
  407. package/src/shared/utils/bounds/_types/get-bounds.ts +0 -10
  408. package/src/shared/utils/bounds/_utils/flatten-styles.ts +0 -21
  409. package/src/shared/utils/bounds/_utils/get-bounds.ts +0 -54
  410. /package/lib/commonjs/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  411. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  412. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  413. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  414. /package/lib/commonjs/shared/utils/bounds/{_types → types}/builder.js +0 -0
  415. /package/lib/commonjs/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  416. /package/lib/module/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  417. /package/lib/module/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  418. /package/lib/module/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  419. /package/lib/module/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  420. /package/lib/module/shared/utils/bounds/{_types → types}/builder.js +0 -0
  421. /package/lib/module/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  422. /package/lib/typescript/shared/hooks/{use-shared-value-state.d.ts → reanimated/use-shared-value-state.d.ts} +0 -0
  423. /package/lib/typescript/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.d.ts +0 -0
  424. /package/lib/typescript/shared/utils/bounds/{_types → types}/geometry.d.ts +0 -0
  425. /package/src/shared/hooks/{use-shared-value-state.ts → reanimated/use-shared-value-state.ts} +0 -0
  426. /package/src/shared/hooks/{use-stable-callback.tsx → use-stable-callback.ts} +0 -0
  427. /package/src/shared/types/{gesture.ts → gesture.types.ts} +0 -0
  428. /package/src/shared/types/{utils.ts → utils.types.ts} +0 -0
  429. /package/src/shared/utils/bounds/{_types → types}/geometry.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"check-gesture-activation.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/gesture/check-gesture-activation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mFAAmF,CAAC;AACjI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAEN,KAAK,qBAAqB,EAC1B,kBAAkB,EAElB,MAAM,qBAAqB,CAAC;AAE7B,KAAK,UAAU,GAAG;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,UAAU,2BAA2B;IACpC,YAAY,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AA8BD,UAAU,YAAY;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;CACvB;AAiKD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,iHAS9B,2BAA2B,KAAG,YA2EhC,CAAC"}
1
+ {"version":3,"file":"check-gesture-activation.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/gesture/check-gesture-activation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mFAAmF,CAAC;AACjI,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAEN,KAAK,qBAAqB,EAC1B,kBAAkB,EAElB,MAAM,2BAA2B,CAAC;AAEnC,KAAK,UAAU,GAAG;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,UAAU,2BAA2B;IACpC,YAAY,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAClC,kBAAkB,EAAE,WAAW,CAAC,kBAAkB,CAAC,CAAC;IACpD,cAAc,CAAC,EAAE,qBAAqB,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC1B;AA8BD,UAAU,YAAY;IACrB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,OAAO,CAAC;CACvB;AAiKD;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,iHAS9B,2BAA2B,KAAG,YA2EhC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { GestureStateChangeEvent, PanGestureHandlerEventPayload } from "react-native-gesture-handler";
2
- import type { GestureStoreMap } from "../../stores/gesture-store";
3
- import type { AnimationConfig } from "../../types/animation";
2
+ import type { GestureStoreMap } from "../../stores/gesture.store";
3
+ import type { AnimationConfig } from "../../types/animation.types";
4
4
  interface ResetGestureValuesProps {
5
5
  spec?: AnimationConfig;
6
6
  gestures: GestureStoreMap;
@@ -1 +1 @@
1
- {"version":3,"file":"reset-gesture-values.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/gesture/reset-gesture-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,6BAA6B,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,UAAU,uBAAuB;IAChC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,uBAAuB,CAAC,6BAA6B,CAAC,CAAC;IAC9D,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,eAAO,MAAM,kBAAkB,GAAI,uDAMhC,uBAAuB,SA2CzB,CAAC"}
1
+ {"version":3,"file":"reset-gesture-values.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/gesture/reset-gesture-values.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,uBAAuB,EACvB,6BAA6B,EAC7B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAInE,UAAU,uBAAuB;IAChC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,KAAK,EAAE,uBAAuB,CAAC,6BAA6B,CAAC,CAAC;IAC9D,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC9C;AAED,eAAO,MAAM,kBAAkB,GAAI,uDAMhC,uBAAuB,SA2CzB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { GestureStateChangeEvent, PanGestureHandlerEventPayload } from "react-native-gesture-handler";
2
- import type { AnimationStoreMap } from "../../stores/animation-store";
2
+ import type { AnimationStoreMap } from "../../stores/animation.store";
3
3
  interface CalculateProgressProps {
4
4
  animations: AnimationStoreMap;
5
5
  shouldDismiss: boolean;
@@ -0,0 +1,6 @@
1
+ import type { TransitionDescriptor } from "../providers/keys.provider";
2
+ /**
3
+ * Reset all stores for a given screen
4
+ */
5
+ export declare const resetStoresForScreen: (current: TransitionDescriptor) => void;
6
+ //# sourceMappingURL=reset-stores-for-screen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-stores-for-screen.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/reset-stores-for-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,oBAAoB,SAGjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screen-transitions",
3
- "version": "3.0.0-beta.1",
3
+ "version": "3.0.0-beta.11",
4
4
  "description": "Easy screen transitions for React Native and Expo",
5
5
  "author": "Ed",
6
6
  "license": "MIT",
@@ -5,7 +5,8 @@ import {
5
5
  import { useMemo } from "react";
6
6
  import { Animated, StyleSheet, View } from "react-native";
7
7
  import { useSafeAreaInsets } from "react-native-safe-area-context";
8
- import { KeysProvider, useKeys } from "../../shared/providers/keys";
8
+ import { useScreenAnimation } from "../../shared/hooks/animation/use-screen-animation";
9
+ import { KeysProvider, useKeys } from "../../shared/providers/keys.provider";
9
10
  import { useOverlayAnimation } from "../hooks/use-overlay-animation";
10
11
  import type {
11
12
  BlankStackDescriptor,
@@ -13,7 +14,6 @@ import type {
13
14
  BlankStackScene,
14
15
  } from "../types";
15
16
  import { useStackNavigationContext } from "../utils/with-stack-navigation";
16
- import { useScreenAnimation } from "../../shared/hooks/animation/use-screen-animation";
17
17
 
18
18
  type OverlayHostProps = {
19
19
  scene: BlankStackScene;
@@ -43,13 +43,33 @@ const getActiveFloatOverlay = (scenes: BlankStackScene[], index: number) => {
43
43
  return null;
44
44
  };
45
45
 
46
-
47
46
  const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
48
47
  const insets = useSafeAreaInsets();
49
48
 
50
49
  const OverlayComponent = scene.descriptor.options.overlay;
51
50
 
52
51
  const { overlayAnimation, optimisticActiveIndex } = useOverlayAnimation();
52
+ const { scenes } = useStackNavigationContext();
53
+
54
+ const overlaySceneIndex = useMemo(() => {
55
+ return scenes.findIndex(
56
+ (stackScene) => stackScene.route.key === scene.route.key,
57
+ );
58
+ }, [scenes, scene.route.key]);
59
+
60
+ const focusedRoute = useMemo(() => {
61
+ if (overlaySceneIndex === -1) {
62
+ return scene.route;
63
+ }
64
+
65
+ const maxOffset = Math.max(scenes.length - overlaySceneIndex - 1, 0);
66
+ const normalizedIndex = Math.min(
67
+ Math.max(optimisticActiveIndex, 0),
68
+ maxOffset,
69
+ );
70
+
71
+ return scenes[overlaySceneIndex + normalizedIndex]?.route ?? scene.route;
72
+ }, [overlaySceneIndex, optimisticActiveIndex, scenes, scene.route]);
53
73
 
54
74
  const screenAnimation = useScreenAnimation();
55
75
 
@@ -59,6 +79,7 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
59
79
 
60
80
  const overlayProps: BlankStackOverlayProps = {
61
81
  route: scene.route,
82
+ focusedRoute,
62
83
  navigation: scene.descriptor.navigation,
63
84
  overlayAnimation,
64
85
  screenAnimation,
@@ -71,7 +92,7 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
71
92
  pointerEvents="box-none"
72
93
  style={[
73
94
  styles.container,
74
- isFloating ? styles.floating : null,
95
+ isFloating ? styles.floating : { zIndex: 1 },
75
96
  styles.absolute,
76
97
  ]}
77
98
  >
@@ -112,7 +133,6 @@ const FloatOverlay = () => {
112
133
  };
113
134
 
114
135
  const ScreenOverlay = () => {
115
- const { focusedIndex } = useStackNavigationContext();
116
136
  const { current } = useKeys<BlankStackDescriptor>();
117
137
 
118
138
  const options = current.options;
@@ -8,12 +8,12 @@ import Animated, {
8
8
  useSharedValue,
9
9
  } from "react-native-reanimated";
10
10
  import { Screen as RNSScreen } from "react-native-screens";
11
- import { AnimationStore } from "../../shared/stores/animation-store";
11
+ import { AnimationStore } from "../../shared/stores/animation.store";
12
12
 
13
13
  interface ScreenProps {
14
14
  routeKey: string;
15
15
  index: number;
16
- routes: NavigationRoute<ParamListBase, string>[];
16
+ routesLength: number;
17
17
  isPreloaded: boolean;
18
18
  children: React.ReactNode;
19
19
  freezeOnBlur?: boolean;
@@ -32,7 +32,7 @@ const AnimatedScreen = Animated.createAnimatedComponent(RNSScreen);
32
32
  export const Screen = ({
33
33
  routeKey,
34
34
  index,
35
- routes,
35
+ routesLength,
36
36
  isPreloaded,
37
37
  activeScreensLimit,
38
38
  children,
@@ -48,13 +48,13 @@ export const Screen = ({
48
48
  return;
49
49
  }
50
50
 
51
- if (index < routes.length - activeScreensLimit - 1 || isPreloaded) {
51
+ if (index < routesLength - activeScreensLimit - 1 || isPreloaded) {
52
52
  screenActivity.value = STATE_INACTIVE;
53
53
  } else {
54
54
  const outputValue =
55
- index === routes.length - 1
55
+ index === routesLength - 1
56
56
  ? STATE_ON_TOP
57
- : index >= routes.length - activeScreensLimit
57
+ : index >= routesLength - activeScreensLimit
58
58
  ? STATE_TRANSITIONING_OR_BELOW_TOP
59
59
  : STATE_INACTIVE;
60
60
 
@@ -3,10 +3,12 @@ import {
3
3
  NavigationContext,
4
4
  NavigationRouteContext,
5
5
  } from "@react-navigation/native";
6
+ import * as React from "react";
7
+ import { StyleSheet } from "react-native";
6
8
  import { GestureHandlerRootView } from "react-native-gesture-handler";
7
9
  import { ScreenContainer } from "react-native-screens";
8
10
  import { BlankStackScreenLifecycleController } from "../../shared/components/controllers/screen-lifecycle";
9
- import { ScreenTransitionProvider } from "../../shared/providers/screen-transition-provider";
11
+ import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
10
12
  import type { BlankStackDescriptor } from "../types";
11
13
  import { withStackNavigationProvider } from "../utils/with-stack-navigation";
12
14
  import { Overlay } from "./Overlay";
@@ -22,7 +24,7 @@ type SceneViewProps = {
22
24
  sceneIndex: number;
23
25
  };
24
26
 
25
- const SceneView = ({ descriptor }: SceneViewProps) => {
27
+ const SceneView = React.memo(({ descriptor }: SceneViewProps) => {
26
28
  const { route, navigation, render } = descriptor;
27
29
 
28
30
  return (
@@ -33,7 +35,7 @@ const SceneView = ({ descriptor }: SceneViewProps) => {
33
35
  </NavigationRouteContext.Provider>
34
36
  </NavigationContext.Provider>
35
37
  );
36
- };
38
+ });
37
39
 
38
40
  export const StackView = withStackNavigationProvider(
39
41
  ({
@@ -48,7 +50,7 @@ export const StackView = withStackNavigationProvider(
48
50
  <GestureHandlerRootView>
49
51
  <SafeAreaProviderCompat>
50
52
  {shouldShowFloatOverlay ? <Overlay.Float /> : null}
51
- <ScreenContainer style={{ flex: 1 }}>
53
+ <ScreenContainer style={styles.container}>
52
54
  {scenes.map((scene, sceneIndex) => {
53
55
  const descriptor = scene.descriptor;
54
56
  const route = scene.route;
@@ -74,7 +76,7 @@ export const StackView = withStackNavigationProvider(
74
76
  index={sceneIndex}
75
77
  activeScreensLimit={activeScreensLimit}
76
78
  routeKey={route.key}
77
- routes={routes}
79
+ routesLength={routes.length}
78
80
  shouldFreeze={shouldFreeze}
79
81
  freezeOnBlur={descriptor.options.freezeOnBlur}
80
82
  >
@@ -100,3 +102,7 @@ export const StackView = withStackNavigationProvider(
100
102
  );
101
103
  },
102
104
  );
105
+
106
+ const styles = StyleSheet.create({
107
+ container: { flex: 1 },
108
+ });
@@ -1,20 +1,11 @@
1
1
  import { useMemo } from "react";
2
2
  import { useWindowDimensions } from "react-native";
3
- import {
4
- type DerivedValue,
5
- type SharedValue,
6
- useDerivedValue,
7
- useSharedValue,
8
- } from "react-native-reanimated";
3
+ import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
9
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
10
- import { useSharedValueState } from "../../shared/hooks/use-shared-value-state";
11
- import { useKeys } from "../../shared/providers/keys";
12
- import {
13
- AnimationStore,
14
- type AnimationStoreMap,
15
- } from "../../shared/stores/animation-store";
16
- import { GestureStore } from "../../shared/stores/gesture-store";
17
- import type { OverlayInterpolationProps } from "../../shared/types/animation";
5
+ import { useSharedValueState } from "../../shared/hooks/reanimated/use-shared-value-state";
6
+ import { useKeys } from "../../shared/providers/keys.provider";
7
+ import { AnimationStore } from "../../shared/stores/animation.store";
8
+ import type { OverlayInterpolationProps } from "../../shared/types/animation.types";
18
9
  import { useStackNavigationContext } from "../utils/with-stack-navigation";
19
10
 
20
11
  /**
@@ -27,15 +18,9 @@ export const useOverlayAnimation = (): {
27
18
  optimisticActiveIndex: number;
28
19
  } => {
29
20
  const { current } = useKeys();
30
- const { scenes, focusedIndex } = useStackNavigationContext();
21
+ const { scenes } = useStackNavigationContext();
31
22
  const routeKey = current?.route?.key;
32
23
 
33
- const gestureState = routeKey
34
- ? GestureStore.getRouteGestures(routeKey)
35
- : null;
36
-
37
- const fallbackIsDismissing = useSharedValue(0);
38
-
39
24
  const progressValues = useMemo(() => {
40
25
  if (!routeKey) {
41
26
  return [];
@@ -1,3 +1,4 @@
1
+ export { useOverlayAnimation } from "../blank-stack/hooks/use-overlay-animation";
1
2
  export { createBlankStackNavigator } from "../blank-stack/navigators/createBlankStackNavigator";
2
3
  export type {
3
4
  BlankStackNavigationEventMap,
@@ -19,11 +19,11 @@ import type {
19
19
  ScreenInterpolationProps,
20
20
  ScreenStyleInterpolator,
21
21
  TransitionSpec,
22
- } from "../shared/types/animation";
22
+ } from "../shared/types/animation.types";
23
23
  import type {
24
24
  GestureActivationArea,
25
25
  GestureDirection,
26
- } from "../shared/types/gesture";
26
+ } from "../shared/types/gesture.types";
27
27
 
28
28
  export type BlankStackNavigationEventMap = {
29
29
  /**
@@ -107,6 +107,10 @@ export type BlankStackOverlayProps = {
107
107
  * Route object for the current screen.
108
108
  */
109
109
  route: Route<string>;
110
+ /**
111
+ * Route object for the currently focused screen in the stack.
112
+ */
113
+ focusedRoute: Route<string>;
110
114
  /**
111
115
  * Navigation prop for the overlay.
112
116
  */
@@ -22,7 +22,7 @@ import type {
22
22
  ScreenStackHeaderConfigProps,
23
23
  SearchBarProps,
24
24
  } from "react-native-screens";
25
- import type { ScreenTransitionConfig } from "../shared/types/core";
25
+ import type { ScreenTransitionConfig } from "../shared/types/core.types";
26
26
 
27
27
  export type Layout = {
28
28
  width: number;
@@ -34,7 +34,7 @@ import {
34
34
  ScreenStackItem,
35
35
  } from "react-native-screens";
36
36
  import { NativeStackScreenLifecycleController } from "../../shared/components/controllers/screen-lifecycle";
37
- import { ScreenTransitionProvider } from "../../shared/providers/screen-transition-provider";
37
+ import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
38
38
  import type {
39
39
  NativeStackDescriptor,
40
40
  NativeStackDescriptorMap,
@@ -513,11 +513,13 @@ export function NativeStackView({
513
513
  return acc;
514
514
  }, {});
515
515
 
516
+ const routes = state.routes.concat(state.preloadedRoutes);
517
+
516
518
  return (
517
519
  <GestureHandlerRootView>
518
520
  <SafeAreaProviderCompat>
519
521
  <ScreenStack style={styles.container}>
520
- {state.routes.concat(state.preloadedRoutes).map((route, index) => {
522
+ {routes.map((route, index) => {
521
523
  const descriptor =
522
524
  descriptors[route.key] ?? preloadedDescriptors[route.key];
523
525
  const isFocused = state.index === index;
@@ -1,15 +1,16 @@
1
1
  import { useEffect, useLayoutEffect } from "react";
2
- import { useAnimatedReaction } from "react-native-reanimated";
2
+ import { useAnimatedReaction, useDerivedValue } from "react-native-reanimated";
3
3
  import type { BlankStackDescriptor } from "../../../blank-stack/types";
4
4
  import { useStackNavigationContext } from "../../../blank-stack/utils/with-stack-navigation";
5
5
  import type { NativeStackDescriptor } from "../../../native-stack/types";
6
6
  import { useParentGestureRegistry } from "../../hooks/gestures/use-parent-gesture-registry";
7
+ import { useSharedValueState } from "../../hooks/reanimated/use-shared-value-state";
7
8
  import useStableCallback from "../../hooks/use-stable-callback";
8
- import { useKeys } from "../../providers/keys";
9
- import { AnimationStore } from "../../stores/animation-store";
10
- import { NavigatorDismissState } from "../../stores/navigator-dismiss-state";
11
- import { resetStoresForScreen } from "../../stores/utils/reset-stores-for-screen";
9
+ import { useGestureContext } from "../../providers/gestures.provider";
10
+ import { useKeys } from "../../providers/keys.provider";
11
+ import { AnimationStore } from "../../stores/animation.store";
12
12
  import { startScreenTransition } from "../../utils/animation/start-screen-transition";
13
+ import { resetStoresForScreen } from "../../utils/reset-stores-for-screen";
13
14
 
14
15
  export interface ScreenLifecycleProps {
15
16
  children: React.ReactNode;
@@ -22,19 +23,24 @@ export const NativeStackScreenLifecycleController = ({
22
23
  children,
23
24
  }: ScreenLifecycleProps) => {
24
25
  const { current } = useKeys<NativeStackDescriptor>();
26
+ const { parentContext } = useGestureContext();
27
+
28
+ const isParentDismissingViaGesture = useSharedValueState(
29
+ useDerivedValue(() => {
30
+ "worklet";
31
+ return parentContext?.gestureAnimationValues.isDismissing?.value ?? false;
32
+ }),
33
+ );
25
34
 
26
35
  const animations = AnimationStore.getAll(current.route.key);
27
36
 
28
37
  const handleBeforeRemove = useStableCallback((e: any) => {
29
- const key = current.navigation.getParent()?.getState().key;
30
- const requestedDismissOnNavigator = NavigatorDismissState.get(key);
31
-
32
38
  const isEnabled = current.options.enableTransitions;
33
- const isRequestedDismissOnNavigator = requestedDismissOnNavigator;
39
+
34
40
  const isFirstScreen = current.navigation.getState().index === 0;
35
41
 
36
42
  // If transitions are disabled, or the dismissal was on the local root, or this is the first screen of the stack, reset the stores
37
- if (!isEnabled || isRequestedDismissOnNavigator || isFirstScreen) {
43
+ if (!isEnabled || isParentDismissingViaGesture || isFirstScreen) {
38
44
  resetStoresForScreen(current);
39
45
  return;
40
46
  }
@@ -105,6 +111,10 @@ export const BlankStackScreenLifecycleController = ({
105
111
  });
106
112
  });
107
113
 
114
+ const handleCleanup = useStableCallback(() => {
115
+ resetStoresForScreen(current);
116
+ });
117
+
108
118
  const handleCloseEnd = useStableCallback((finished: boolean) => {
109
119
  if (!finished) {
110
120
  return;
@@ -130,7 +140,12 @@ export const BlankStackScreenLifecycleController = ({
130
140
  },
131
141
  );
132
142
 
133
- useLayoutEffect(handleInitialize);
143
+ useLayoutEffect(() => {
144
+ handleInitialize();
145
+ return () => {
146
+ handleCleanup();
147
+ };
148
+ }, [handleInitialize, handleCleanup]);
134
149
 
135
150
  // important for t.a scrollviews inside nested navigators.
136
151
  useParentGestureRegistry();
@@ -4,11 +4,11 @@ import type { View } from "react-native";
4
4
  import { GestureDetector } from "react-native-gesture-handler";
5
5
  import Animated, { runOnUI, useAnimatedRef } from "react-native-reanimated";
6
6
  import { useAssociatedStyles } from "../hooks/animation/use-associated-style";
7
- import { useBoundsRegistry } from "../hooks/bounds/use-bound-registry";
8
7
  import { useScrollRegistry } from "../hooks/gestures/use-scroll-registry";
9
- import { useGestureContext } from "../providers/gestures";
10
- import type { TransitionAwareProps } from "../types/core";
11
- import type { Any } from "../types/utils";
8
+ import { useGestureContext } from "../providers/gestures.provider";
9
+ import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
10
+ import type { TransitionAwareProps } from "../types/core.types";
11
+ import type { Any } from "../types/utils.types";
12
12
 
13
13
  interface CreateTransitionAwareComponentOptions {
14
14
  isScrollable?: boolean;
@@ -61,30 +61,26 @@ export function createTransitionAwareComponent<P extends object>(
61
61
  style,
62
62
  });
63
63
 
64
- const {
65
- handleInitialLayout,
66
- captureActiveOnPress,
67
- MeasurementSyncProvider,
68
- } = useBoundsRegistry({
69
- sharedBoundTag,
70
- animatedRef,
71
- style,
72
- onPress,
73
- });
74
-
75
64
  return (
76
- <MeasurementSyncProvider>
77
- <AnimatedComponent
78
- {...(rest as Any)}
79
- ref={animatedRef}
80
- style={[style, associatedStyles]}
81
- onPress={captureActiveOnPress}
82
- onLayout={runOnUI(handleInitialLayout)}
83
- collapsable={!sharedBoundTag}
84
- >
85
- {children}
86
- </AnimatedComponent>
87
- </MeasurementSyncProvider>
65
+ <RegisterBoundsProvider
66
+ animatedRef={animatedRef}
67
+ style={style}
68
+ onPress={onPress}
69
+ sharedBoundTag={sharedBoundTag}
70
+ >
71
+ {({ captureActiveOnPress, handleInitialLayout }) => (
72
+ <AnimatedComponent
73
+ {...(rest as Any)}
74
+ ref={animatedRef}
75
+ style={[style, associatedStyles]}
76
+ onPress={captureActiveOnPress}
77
+ onLayout={runOnUI(handleInitialLayout)}
78
+ collapsable={!sharedBoundTag}
79
+ >
80
+ {children}
81
+ </AnimatedComponent>
82
+ )}
83
+ </RegisterBoundsProvider>
88
84
  );
89
85
  });
90
86
 
@@ -2,7 +2,7 @@ import { memo } from "react";
2
2
  import { StyleSheet, View } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
4
  import { NO_STYLES } from "../constants";
5
- import { useTransitionStyles } from "../providers/transition-styles";
5
+ import { useTransitionStyles } from "../providers/transition-styles.provider";
6
6
 
7
7
  type Props = {
8
8
  children: React.ReactNode;
@@ -4,7 +4,7 @@ import {
4
4
  interpolate,
5
5
  interpolateColor,
6
6
  } from "react-native-reanimated";
7
- import type { ScreenTransitionConfig } from "../types/core";
7
+ import type { ScreenTransitionConfig } from "../types/core.types";
8
8
  import { DefaultSpec } from "./specs";
9
9
 
10
10
  const platform = Platform.OS;
@@ -216,9 +216,12 @@ export const ElasticCard = (
216
216
  };
217
217
  };
218
218
 
219
- export const SharedIGImage = (
220
- config: Partial<ScreenTransitionConfig> = {},
221
- ): ScreenTransitionConfig => {
219
+ export const SharedIGImage = ({
220
+ sharedBoundTag,
221
+ ...config
222
+ }: Partial<ScreenTransitionConfig> & {
223
+ sharedBoundTag: string;
224
+ }): ScreenTransitionConfig => {
222
225
  return {
223
226
  gestureEnabled: true,
224
227
  gestureDirection: ["vertical", "horizontal"],
@@ -232,7 +235,6 @@ export const SharedIGImage = (
232
235
  bounds,
233
236
  progress,
234
237
  focused,
235
- activeBoundId,
236
238
  active,
237
239
  }) => {
238
240
  "worklet";
@@ -257,6 +259,7 @@ export const SharedIGImage = (
257
259
  const dragYScale = interpolate(normY, [0, 1], [1, 0.8]);
258
260
 
259
261
  const boundValues = bounds({
262
+ id: sharedBoundTag,
260
263
  method: focused ? "content" : "transform",
261
264
  scaleMode: "uniform",
262
265
  raw: true,
@@ -265,6 +268,7 @@ export const SharedIGImage = (
265
268
  // focused specific animations
266
269
  if (focused) {
267
270
  const maskedValues = bounds({
271
+ id: sharedBoundTag,
268
272
  space: "absolute",
269
273
  target: "fullscreen",
270
274
  method: "size",
@@ -309,7 +313,7 @@ export const SharedIGImage = (
309
313
  contentStyle: {
310
314
  pointerEvents: current.gesture.isDismissing ? "none" : "auto",
311
315
  },
312
- [activeBoundId]: {
316
+ [sharedBoundTag]: {
313
317
  transform: [
314
318
  { translateX: dragX || 0 },
315
319
  { translateY: dragY || 0 },
@@ -345,9 +349,12 @@ export const SharedIGImage = (
345
349
  };
346
350
  };
347
351
 
348
- export const SharedAppleMusic = (
349
- config: Partial<ScreenTransitionConfig> = {},
350
- ): ScreenTransitionConfig => {
352
+ export const SharedAppleMusic = ({
353
+ sharedBoundTag,
354
+ ...config
355
+ }: Partial<ScreenTransitionConfig> & {
356
+ sharedBoundTag: string;
357
+ }): ScreenTransitionConfig => {
351
358
  return {
352
359
  enableTransitions: true,
353
360
  gestureEnabled: true,
@@ -355,7 +362,6 @@ export const SharedAppleMusic = (
355
362
  gestureDrivesProgress: false,
356
363
  screenStyleInterpolator: ({
357
364
  bounds,
358
- activeBoundId,
359
365
  focused,
360
366
  progress,
361
367
  layouts: { screen },
@@ -395,6 +401,7 @@ export const SharedAppleMusic = (
395
401
  const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
396
402
 
397
403
  const boundValues = bounds({
404
+ id: sharedBoundTag,
398
405
  method: focused ? "content" : "transform",
399
406
  anchor: "top",
400
407
  scaleMode: "uniform",
@@ -415,6 +422,7 @@ export const SharedAppleMusic = (
415
422
  */
416
423
  if (focused) {
417
424
  const maskedValues = bounds({
425
+ id: sharedBoundTag,
418
426
  space: "absolute",
419
427
  method: "size",
420
428
  target: "fullscreen",
@@ -501,7 +509,7 @@ export const SharedAppleMusic = (
501
509
  const contentScale = interpolate(progress, [1, 2], [1, 0.9], "clamp");
502
510
 
503
511
  return {
504
- [activeBoundId]: {
512
+ [sharedBoundTag]: {
505
513
  transform: [
506
514
  { translateX: dragX || 0 },
507
515
  { translateY: dragY || 0 },
@@ -544,9 +552,12 @@ export const SharedAppleMusic = (
544
552
  };
545
553
  };
546
554
 
547
- export const SharedXImage = (
548
- config: Partial<ScreenTransitionConfig> = {},
549
- ): ScreenTransitionConfig => {
555
+ export const SharedXImage = ({
556
+ sharedBoundTag,
557
+ ...config
558
+ }: Partial<ScreenTransitionConfig> & {
559
+ sharedBoundTag: string;
560
+ }): ScreenTransitionConfig => {
550
561
  return {
551
562
  enableTransitions: true,
552
563
  gestureEnabled: true,
@@ -554,7 +565,6 @@ export const SharedXImage = (
554
565
  gestureDrivesProgress: false,
555
566
  screenStyleInterpolator: ({
556
567
  focused,
557
- activeBoundId,
558
568
  bounds,
559
569
  current,
560
570
  layouts: { screen },
@@ -565,7 +575,11 @@ export const SharedXImage = (
565
575
  // twitter doesn't animate the unfocused screen
566
576
  if (!focused) return {};
567
577
 
568
- const boundValues = bounds({ method: "transform", raw: true });
578
+ const boundValues = bounds({
579
+ id: sharedBoundTag,
580
+ method: "transform",
581
+ raw: true,
582
+ });
569
583
 
570
584
  // content styles
571
585
  const dragY = interpolate(
@@ -596,7 +610,7 @@ export const SharedXImage = (
596
610
  const scaleY = !current.closing ? boundValues.scaleY : 1;
597
611
 
598
612
  return {
599
- [activeBoundId]: {
613
+ [sharedBoundTag]: {
600
614
  transform: [
601
615
  {
602
616
  translateX: x,
@@ -1,11 +1,11 @@
1
1
  import type { ParamListBase, RouteProp } from "@react-navigation/native";
2
2
  import type { MeasuredDimensions } from "react-native-reanimated";
3
- import type { ScreenTransitionState } from "./types/animation";
4
- import type { BoundEntry } from "./types/bounds";
5
- import type { Layout } from "./types/core";
6
- import type { ActivationArea } from "./types/gesture";
7
- import type { Complete } from "./types/utils";
8
- import type { BoundsBuilderOptions } from "./utils/bounds/_types/builder";
3
+ import type { ScreenTransitionState } from "./types/animation.types";
4
+ import type { BoundEntry } from "./types/bounds.types";
5
+ import type { Layout } from "./types/core.types";
6
+ import type { ActivationArea } from "./types/gesture.types";
7
+ import type { Complete } from "./types/utils.types";
8
+ import type { BoundsBuilderOptions } from "./utils/bounds/types/builder";
9
9
 
10
10
  /**
11
11
  * Masked view integration
@@ -35,7 +35,6 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
35
35
  isDragging: 0,
36
36
  direction: null,
37
37
  },
38
- bounds: {} as Record<string, BoundEntry>,
39
38
  route: {} as RouteProp<ParamListBase>,
40
39
  });
41
40