react-native-screen-transitions 3.0.0-beta.10 → 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 (418) hide show
  1. package/README.md +60 -5
  2. package/lib/commonjs/blank-stack/components/Overlay.js +1 -1
  3. package/lib/commonjs/blank-stack/components/Screens.js +2 -2
  4. package/lib/commonjs/blank-stack/components/Screens.js.map +1 -1
  5. package/lib/commonjs/blank-stack/components/StackView.js +37 -40
  6. package/lib/commonjs/blank-stack/components/StackView.js.map +1 -1
  7. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +4 -4
  8. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  9. package/lib/commonjs/blank-stack/index.js +0 -7
  10. package/lib/commonjs/blank-stack/index.js.map +1 -1
  11. package/lib/commonjs/native-stack/views/NativeStackView.native.js +2 -2
  12. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  13. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js +9 -9
  14. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-transition-aware-component.js +11 -14
  16. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  17. package/lib/commonjs/shared/components/root-transition-aware.js +1 -1
  18. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  19. package/lib/commonjs/shared/configs/presets.js +20 -9
  20. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  21. package/lib/commonjs/shared/constants.js +0 -1
  22. package/lib/commonjs/shared/constants.js.map +1 -1
  23. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -10
  24. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  25. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +10 -25
  26. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  27. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +11 -11
  28. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  29. package/lib/commonjs/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  30. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js +1 -1
  31. package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  32. package/lib/commonjs/shared/hooks/use-stable-callback-value.js.map +1 -1
  33. package/lib/commonjs/shared/hooks/use-stable-callback.js.map +1 -1
  34. package/lib/commonjs/shared/providers/{gestures.js → gestures.provider.js} +1 -1
  35. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -0
  36. package/lib/commonjs/shared/providers/{keys.js → keys.provider.js} +1 -1
  37. package/lib/commonjs/shared/providers/keys.provider.js.map +1 -0
  38. package/lib/commonjs/shared/providers/register-bounds.provider.js +207 -0
  39. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -0
  40. package/lib/commonjs/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  41. package/lib/commonjs/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  42. package/lib/commonjs/shared/providers/{transition-styles.js → transition-styles.provider.js} +7 -9
  43. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +1 -0
  44. package/lib/commonjs/shared/stores/{animation-store.js → animation.store.js} +1 -1
  45. package/lib/commonjs/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
  46. package/lib/commonjs/shared/stores/bounds.store.js +141 -0
  47. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -0
  48. package/lib/commonjs/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
  49. package/lib/commonjs/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
  50. package/lib/commonjs/shared/types/{core.js → animation.types.js} +1 -1
  51. package/lib/commonjs/shared/types/animation.types.js.map +1 -0
  52. package/lib/commonjs/shared/types/{bounds.js → bounds.types.js} +1 -1
  53. package/lib/commonjs/shared/types/bounds.types.js.map +1 -0
  54. package/lib/commonjs/shared/types/{animation.js → core.types.js} +1 -1
  55. package/lib/commonjs/shared/types/{animation.js.map → core.types.js.map} +1 -1
  56. package/lib/commonjs/shared/types/{gesture.js → gesture.types.js} +1 -1
  57. package/lib/commonjs/shared/types/gesture.types.js.map +1 -0
  58. package/lib/commonjs/shared/types/utils.types.js +2 -0
  59. package/lib/commonjs/shared/types/{core.js.map → utils.types.js.map} +1 -1
  60. package/lib/commonjs/shared/utils/animation/derivations.js +1 -7
  61. package/lib/commonjs/shared/utils/animation/derivations.js.map +1 -1
  62. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -0
  63. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +19 -0
  64. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  65. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  66. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -0
  67. package/lib/commonjs/shared/utils/bounds/index.js +45 -35
  68. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  69. package/lib/commonjs/shared/utils/bounds/types/builder.js.map +1 -0
  70. package/lib/commonjs/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  71. package/lib/commonjs/shared/utils/create-provider.js.map +1 -0
  72. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +1 -1
  73. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js +1 -1
  74. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +17 -0
  75. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -0
  76. package/lib/module/blank-stack/components/Overlay.js +1 -1
  77. package/lib/module/blank-stack/components/Overlay.js.map +1 -1
  78. package/lib/module/blank-stack/components/Screens.js +1 -1
  79. package/lib/module/blank-stack/components/StackView.js +37 -40
  80. package/lib/module/blank-stack/components/StackView.js.map +1 -1
  81. package/lib/module/blank-stack/hooks/use-overlay-animation.js +3 -3
  82. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  83. package/lib/module/blank-stack/index.js +0 -1
  84. package/lib/module/blank-stack/index.js.map +1 -1
  85. package/lib/module/native-stack/views/NativeStackView.native.js +1 -1
  86. package/lib/module/shared/components/controllers/screen-lifecycle.js +8 -8
  87. package/lib/module/shared/components/controllers/screen-lifecycle.js.map +1 -1
  88. package/lib/module/shared/components/create-transition-aware-component.js +11 -14
  89. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  90. package/lib/module/shared/components/root-transition-aware.js +1 -1
  91. package/lib/module/shared/components/root-transition-aware.js.map +1 -1
  92. package/lib/module/shared/configs/presets.js +20 -9
  93. package/lib/module/shared/configs/presets.js.map +1 -1
  94. package/lib/module/shared/constants.js +0 -1
  95. package/lib/module/shared/constants.js.map +1 -1
  96. package/lib/module/shared/hooks/animation/use-associated-style.js +9 -10
  97. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  98. package/lib/module/shared/hooks/animation/use-screen-animation.js +7 -22
  99. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  100. package/lib/module/shared/hooks/gestures/use-build-gestures.js +4 -4
  101. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  102. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  103. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js.map +1 -1
  104. package/lib/module/shared/hooks/gestures/use-scroll-registry.js +1 -1
  105. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  106. package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  107. package/lib/module/shared/hooks/use-stable-callback-value.js.map +1 -1
  108. package/lib/module/shared/hooks/use-stable-callback.js.map +1 -1
  109. package/lib/module/shared/providers/{gestures.js → gestures.provider.js} +1 -1
  110. package/lib/module/shared/providers/gestures.provider.js.map +1 -0
  111. package/lib/module/shared/providers/{keys.js → keys.provider.js} +1 -1
  112. package/lib/module/shared/providers/keys.provider.js.map +1 -0
  113. package/lib/module/shared/providers/register-bounds.provider.js +202 -0
  114. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -0
  115. package/lib/module/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  116. package/lib/module/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  117. package/lib/module/shared/providers/{transition-styles.js → transition-styles.provider.js} +6 -9
  118. package/lib/module/shared/providers/transition-styles.provider.js.map +1 -0
  119. package/lib/module/shared/stores/{animation-store.js → animation.store.js} +1 -1
  120. package/lib/module/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
  121. package/lib/module/shared/stores/bounds.store.js +137 -0
  122. package/lib/module/shared/stores/bounds.store.js.map +1 -0
  123. package/lib/module/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
  124. package/lib/module/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
  125. package/lib/module/shared/types/animation.types.js +4 -0
  126. package/lib/module/shared/types/animation.types.js.map +1 -0
  127. package/lib/module/shared/types/bounds.types.js +4 -0
  128. package/lib/module/shared/types/bounds.types.js.map +1 -0
  129. package/lib/module/shared/types/core.types.js +4 -0
  130. package/lib/{commonjs/shared/types/bounds.js.map → module/shared/types/core.types.js.map} +1 -1
  131. package/lib/module/shared/types/{gesture.js → gesture.types.js} +1 -1
  132. package/lib/module/shared/types/gesture.types.js.map +1 -0
  133. package/lib/module/shared/types/utils.types.js +2 -0
  134. package/lib/{commonjs/shared/types/utils.js.map → module/shared/types/utils.types.js.map} +1 -1
  135. package/lib/module/shared/utils/animation/derivations.js +1 -7
  136. package/lib/module/shared/utils/animation/derivations.js.map +1 -1
  137. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -0
  138. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +14 -0
  139. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  140. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  141. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -0
  142. package/lib/module/shared/utils/bounds/index.js +45 -35
  143. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  144. package/lib/module/shared/utils/bounds/types/builder.js.map +1 -0
  145. package/lib/module/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  146. package/lib/module/shared/utils/create-provider.js.map +1 -0
  147. package/lib/module/shared/utils/gesture/apply-offset-rules.js +1 -1
  148. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +1 -1
  149. package/lib/module/shared/utils/gesture/check-gesture-activation.js +1 -1
  150. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  151. package/lib/module/shared/utils/reset-stores-for-screen.js +13 -0
  152. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -0
  153. package/lib/typescript/blank-stack/components/StackView.d.ts.map +1 -1
  154. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +1 -1
  155. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +1 -1
  156. package/lib/typescript/blank-stack/index.d.ts +0 -1
  157. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  158. package/lib/typescript/blank-stack/types.d.ts +2 -2
  159. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  160. package/lib/typescript/native-stack/types.d.ts +1 -1
  161. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  162. package/lib/typescript/shared/components/controllers/screen-lifecycle.d.ts.map +1 -1
  163. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  164. package/lib/typescript/shared/configs/index.d.ts +9 -3
  165. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  166. package/lib/typescript/shared/configs/presets.d.ts +10 -4
  167. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  168. package/lib/typescript/shared/constants.d.ts +6 -6
  169. package/lib/typescript/shared/constants.d.ts.map +1 -1
  170. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  171. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts +2 -2
  172. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  173. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts +2 -2
  174. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  175. package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -0
  176. package/lib/typescript/shared/hooks/use-stable-callback-value.d.ts.map +1 -1
  177. package/lib/typescript/shared/hooks/use-stable-callback.d.ts.map +1 -1
  178. package/lib/typescript/shared/index.d.ts +17 -11
  179. package/lib/typescript/shared/index.d.ts.map +1 -1
  180. package/lib/typescript/shared/providers/{gestures.d.ts → gestures.provider.d.ts} +2 -2
  181. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -0
  182. package/lib/typescript/shared/providers/{keys.d.ts → keys.provider.d.ts} +2 -2
  183. package/lib/typescript/shared/providers/keys.provider.d.ts.map +1 -0
  184. package/lib/typescript/shared/providers/register-bounds.provider.d.ts +17 -0
  185. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -0
  186. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts → screen-transition.provider.d.ts} +2 -2
  187. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts.map → screen-transition.provider.d.ts.map} +1 -1
  188. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +14 -0
  189. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +1 -0
  190. package/lib/typescript/shared/stores/{animation-store.d.ts → animation.store.d.ts} +2 -2
  191. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -0
  192. package/lib/typescript/shared/stores/bounds.store.d.ts +29 -0
  193. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -0
  194. package/lib/typescript/shared/stores/{gesture-store.d.ts → gesture.store.d.ts} +3 -3
  195. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -0
  196. package/lib/typescript/shared/types/{animation.d.ts → animation.types.d.ts} +48 -20
  197. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -0
  198. package/lib/typescript/shared/types/{bounds.d.ts → bounds.types.d.ts} +4 -4
  199. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -0
  200. package/lib/typescript/shared/types/{core.d.ts → core.types.d.ts} +3 -3
  201. package/lib/typescript/shared/types/core.types.d.ts.map +1 -0
  202. package/lib/typescript/shared/types/{gesture.d.ts → gesture.types.d.ts} +1 -1
  203. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -0
  204. package/lib/typescript/shared/types/{utils.d.ts → utils.types.d.ts} +1 -1
  205. package/lib/typescript/shared/types/utils.types.d.ts.map +1 -0
  206. package/lib/typescript/shared/utils/animation/derivations.d.ts +2 -4
  207. package/lib/typescript/shared/utils/animation/derivations.d.ts.map +1 -1
  208. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts +2 -2
  209. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts.map +1 -1
  210. package/lib/typescript/shared/utils/bounds/constants.d.ts +3 -3
  211. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -1
  212. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/geometry.d.ts +3 -3
  213. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -0
  214. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +1 -0
  215. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/style-composers.d.ts +2 -2
  216. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -0
  217. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/styles.d.ts +1 -1
  218. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -0
  219. package/lib/typescript/shared/utils/bounds/index.d.ts +3 -4
  220. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  221. package/lib/typescript/shared/utils/bounds/{_types → types}/builder.d.ts +13 -34
  222. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -0
  223. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -0
  224. package/lib/typescript/shared/{providers/utils → utils}/create-provider.d.ts +2 -2
  225. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -0
  226. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +2 -2
  227. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +1 -1
  228. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +2 -2
  229. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  230. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts +2 -2
  231. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/gesture/velocity.d.ts +1 -1
  233. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +6 -0
  234. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -0
  235. package/package.json +1 -1
  236. package/src/blank-stack/components/Overlay.tsx +1 -1
  237. package/src/blank-stack/components/Screens.tsx +1 -1
  238. package/src/blank-stack/components/StackView.tsx +45 -48
  239. package/src/blank-stack/hooks/use-overlay-animation.tsx +4 -4
  240. package/src/blank-stack/index.ts +0 -1
  241. package/src/blank-stack/types.ts +2 -2
  242. package/src/native-stack/types.ts +1 -1
  243. package/src/native-stack/views/NativeStackView.native.tsx +1 -1
  244. package/src/shared/components/controllers/screen-lifecycle.tsx +12 -10
  245. package/src/shared/components/create-transition-aware-component.tsx +23 -27
  246. package/src/shared/components/root-transition-aware.tsx +1 -1
  247. package/src/shared/configs/presets.ts +31 -17
  248. package/src/shared/constants.ts +6 -7
  249. package/src/shared/hooks/animation/use-associated-style.tsx +8 -9
  250. package/src/shared/hooks/animation/use-screen-animation.tsx +8 -26
  251. package/src/shared/hooks/gestures/use-build-gestures.tsx +5 -5
  252. package/src/shared/hooks/gestures/use-parent-gesture-registry.tsx +1 -1
  253. package/src/shared/hooks/gestures/use-scroll-registry.tsx +2 -2
  254. package/src/shared/index.ts +2 -2
  255. package/src/shared/providers/{gestures.tsx → gestures.provider.tsx} +1 -1
  256. package/src/shared/providers/{keys.tsx → keys.provider.tsx} +1 -1
  257. package/src/shared/providers/register-bounds.provider.tsx +284 -0
  258. package/src/shared/providers/{screen-transition-provider.tsx → screen-transition.provider.tsx} +3 -3
  259. package/src/shared/providers/{transition-styles.tsx → transition-styles.provider.tsx} +13 -14
  260. package/src/shared/stores/{animation-store.ts → animation.store.ts} +1 -1
  261. package/src/shared/stores/bounds.store.ts +166 -0
  262. package/src/shared/stores/{gesture-store.ts → gesture.store.ts} +2 -2
  263. package/src/shared/types/{animation.ts → animation.types.ts} +60 -19
  264. package/src/shared/types/{bounds.ts → bounds.types.ts} +3 -3
  265. package/src/shared/types/{core.ts → core.types.ts} +10 -2
  266. package/src/shared/utils/animation/derivations.ts +2 -8
  267. package/src/shared/utils/animation/start-screen-transition.ts +2 -2
  268. package/src/shared/utils/bounds/constants.ts +3 -3
  269. package/src/shared/utils/bounds/{_utils → helpers}/geometry.ts +3 -3
  270. package/src/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.ts +3 -3
  271. package/src/shared/utils/bounds/{_utils → helpers}/style-composers.ts +2 -2
  272. package/src/shared/utils/bounds/{_utils → helpers}/styles.ts +1 -1
  273. package/src/shared/utils/bounds/index.ts +53 -55
  274. package/src/shared/utils/bounds/{_types → types}/builder.ts +19 -37
  275. package/src/shared/{providers/utils → utils}/create-provider.tsx +3 -9
  276. package/src/shared/utils/gesture/apply-offset-rules.ts +2 -2
  277. package/src/shared/utils/gesture/check-gesture-activation.ts +2 -2
  278. package/src/shared/utils/gesture/reset-gesture-values.ts +2 -2
  279. package/src/shared/utils/gesture/velocity.ts +1 -1
  280. package/src/shared/utils/reset-stores-for-screen.ts +11 -0
  281. package/lib/commonjs/blank-stack/providers/blank-stack-state.js +0 -65
  282. package/lib/commonjs/blank-stack/providers/blank-stack-state.js.map +0 -1
  283. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js +0 -152
  284. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  285. package/lib/commonjs/shared/hooks/use-derived-value-state.js +0 -33
  286. package/lib/commonjs/shared/hooks/use-derived-value-state.js.map +0 -1
  287. package/lib/commonjs/shared/hooks/use-shared-value-state.js.map +0 -1
  288. package/lib/commonjs/shared/providers/gestures.js.map +0 -1
  289. package/lib/commonjs/shared/providers/keys.js.map +0 -1
  290. package/lib/commonjs/shared/providers/transition-styles.js.map +0 -1
  291. package/lib/commonjs/shared/providers/utils/create-provider.js.map +0 -1
  292. package/lib/commonjs/shared/stores/bound-store/_utils.js +0 -118
  293. package/lib/commonjs/shared/stores/bound-store/_utils.js.map +0 -1
  294. package/lib/commonjs/shared/stores/bound-store/index.js +0 -127
  295. package/lib/commonjs/shared/stores/bound-store/index.js.map +0 -1
  296. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js +0 -19
  297. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  298. package/lib/commonjs/shared/types/gesture.js.map +0 -1
  299. package/lib/commonjs/shared/types/utils.js +0 -2
  300. package/lib/commonjs/shared/utils/bounds/_types/geometry.js.map +0 -1
  301. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js +0 -6
  302. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  303. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js +0 -27
  304. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  305. package/lib/commonjs/shared/utils/bounds/_utils/geometry.js.map +0 -1
  306. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js +0 -49
  307. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  308. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js +0 -19
  309. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  310. package/lib/commonjs/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  311. package/lib/commonjs/shared/utils/bounds/_utils/styles.js.map +0 -1
  312. package/lib/module/blank-stack/providers/blank-stack-state.js +0 -59
  313. package/lib/module/blank-stack/providers/blank-stack-state.js.map +0 -1
  314. package/lib/module/shared/hooks/bounds/use-bound-registry.js +0 -146
  315. package/lib/module/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  316. package/lib/module/shared/hooks/use-derived-value-state.js +0 -30
  317. package/lib/module/shared/hooks/use-derived-value-state.js.map +0 -1
  318. package/lib/module/shared/hooks/use-shared-value-state.js.map +0 -1
  319. package/lib/module/shared/providers/gestures.js.map +0 -1
  320. package/lib/module/shared/providers/keys.js.map +0 -1
  321. package/lib/module/shared/providers/transition-styles.js.map +0 -1
  322. package/lib/module/shared/providers/utils/create-provider.js.map +0 -1
  323. package/lib/module/shared/stores/bound-store/_utils.js +0 -113
  324. package/lib/module/shared/stores/bound-store/_utils.js.map +0 -1
  325. package/lib/module/shared/stores/bound-store/index.js +0 -123
  326. package/lib/module/shared/stores/bound-store/index.js.map +0 -1
  327. package/lib/module/shared/stores/utils/reset-stores-for-screen.js +0 -15
  328. package/lib/module/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  329. package/lib/module/shared/types/animation.js +0 -4
  330. package/lib/module/shared/types/animation.js.map +0 -1
  331. package/lib/module/shared/types/bounds.js +0 -4
  332. package/lib/module/shared/types/bounds.js.map +0 -1
  333. package/lib/module/shared/types/core.js +0 -4
  334. package/lib/module/shared/types/core.js.map +0 -1
  335. package/lib/module/shared/types/gesture.js.map +0 -1
  336. package/lib/module/shared/types/utils.js +0 -2
  337. package/lib/module/shared/types/utils.js.map +0 -1
  338. package/lib/module/shared/utils/bounds/_types/geometry.js.map +0 -1
  339. package/lib/module/shared/utils/bounds/_types/get-bounds.js +0 -4
  340. package/lib/module/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  341. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js +0 -23
  342. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  343. package/lib/module/shared/utils/bounds/_utils/geometry.js.map +0 -1
  344. package/lib/module/shared/utils/bounds/_utils/get-bounds.js +0 -44
  345. package/lib/module/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  346. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js +0 -14
  347. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  348. package/lib/module/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  349. package/lib/module/shared/utils/bounds/_utils/styles.js.map +0 -1
  350. package/lib/typescript/blank-stack/providers/blank-stack-state.d.ts +0 -13
  351. package/lib/typescript/blank-stack/providers/blank-stack-state.d.ts.map +0 -1
  352. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts +0 -17
  353. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts.map +0 -1
  354. package/lib/typescript/shared/hooks/use-derived-value-state.d.ts +0 -9
  355. package/lib/typescript/shared/hooks/use-derived-value-state.d.ts.map +0 -1
  356. package/lib/typescript/shared/hooks/use-shared-value-state.d.ts.map +0 -1
  357. package/lib/typescript/shared/providers/gestures.d.ts.map +0 -1
  358. package/lib/typescript/shared/providers/keys.d.ts.map +0 -1
  359. package/lib/typescript/shared/providers/transition-styles.d.ts +0 -11
  360. package/lib/typescript/shared/providers/transition-styles.d.ts.map +0 -1
  361. package/lib/typescript/shared/providers/utils/create-provider.d.ts.map +0 -1
  362. package/lib/typescript/shared/stores/animation-store.d.ts.map +0 -1
  363. package/lib/typescript/shared/stores/bound-store/_utils.d.ts +0 -24
  364. package/lib/typescript/shared/stores/bound-store/_utils.d.ts.map +0 -1
  365. package/lib/typescript/shared/stores/bound-store/index.d.ts +0 -24
  366. package/lib/typescript/shared/stores/bound-store/index.d.ts.map +0 -1
  367. package/lib/typescript/shared/stores/gesture-store.d.ts.map +0 -1
  368. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts +0 -6
  369. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts.map +0 -1
  370. package/lib/typescript/shared/types/animation.d.ts.map +0 -1
  371. package/lib/typescript/shared/types/bounds.d.ts.map +0 -1
  372. package/lib/typescript/shared/types/core.d.ts.map +0 -1
  373. package/lib/typescript/shared/types/gesture.d.ts.map +0 -1
  374. package/lib/typescript/shared/types/utils.d.ts.map +0 -1
  375. package/lib/typescript/shared/utils/bounds/_types/builder.d.ts.map +0 -1
  376. package/lib/typescript/shared/utils/bounds/_types/geometry.d.ts.map +0 -1
  377. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts +0 -10
  378. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts.map +0 -1
  379. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts +0 -2
  380. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts.map +0 -1
  381. package/lib/typescript/shared/utils/bounds/_utils/geometry.d.ts.map +0 -1
  382. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts +0 -4
  383. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts.map +0 -1
  384. package/lib/typescript/shared/utils/bounds/_utils/is-bounds-equal.d.ts.map +0 -1
  385. package/lib/typescript/shared/utils/bounds/_utils/style-composers.d.ts.map +0 -1
  386. package/lib/typescript/shared/utils/bounds/_utils/styles.d.ts.map +0 -1
  387. package/src/blank-stack/providers/blank-stack-state.tsx +0 -90
  388. package/src/shared/hooks/bounds/use-bound-registry.tsx +0 -184
  389. package/src/shared/hooks/use-derived-value-state.ts +0 -41
  390. package/src/shared/stores/bound-store/_utils.ts +0 -161
  391. package/src/shared/stores/bound-store/index.ts +0 -148
  392. package/src/shared/stores/utils/reset-stores-for-screen.ts +0 -13
  393. package/src/shared/utils/bounds/_types/get-bounds.ts +0 -10
  394. package/src/shared/utils/bounds/_utils/flatten-styles.ts +0 -21
  395. package/src/shared/utils/bounds/_utils/get-bounds.ts +0 -54
  396. /package/lib/commonjs/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  397. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  398. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  399. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  400. /package/lib/commonjs/shared/utils/bounds/{_types → types}/builder.js +0 -0
  401. /package/lib/commonjs/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  402. /package/lib/commonjs/shared/{providers/utils → utils}/create-provider.js +0 -0
  403. /package/lib/module/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  404. /package/lib/module/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  405. /package/lib/module/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  406. /package/lib/module/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  407. /package/lib/module/shared/utils/bounds/{_types → types}/builder.js +0 -0
  408. /package/lib/module/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  409. /package/lib/module/shared/{providers/utils → utils}/create-provider.js +0 -0
  410. /package/lib/typescript/shared/hooks/{use-shared-value-state.d.ts → reanimated/use-shared-value-state.d.ts} +0 -0
  411. /package/lib/typescript/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.d.ts +0 -0
  412. /package/lib/typescript/shared/utils/bounds/{_types → types}/geometry.d.ts +0 -0
  413. /package/src/shared/hooks/{use-shared-value-state.ts → reanimated/use-shared-value-state.ts} +0 -0
  414. /package/src/shared/hooks/{use-stable-callback-value.tsx → use-stable-callback-value.ts} +0 -0
  415. /package/src/shared/hooks/{use-stable-callback.tsx → use-stable-callback.ts} +0 -0
  416. /package/src/shared/types/{gesture.ts → gesture.types.ts} +0 -0
  417. /package/src/shared/types/{utils.ts → utils.types.ts} +0 -0
  418. /package/src/shared/utils/bounds/{_types → types}/geometry.ts +0 -0
@@ -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
 
@@ -5,7 +5,7 @@ import {
5
5
  useSharedValue,
6
6
  } from "react-native-reanimated";
7
7
  import { NO_STYLES } from "../../constants";
8
- import { useTransitionStyles } from "../../providers/transition-styles";
8
+ import { useTransitionStyles } from "../../providers/transition-styles.provider";
9
9
 
10
10
  type Props = {
11
11
  id?: string;
@@ -16,14 +16,12 @@ type Props = {
16
16
  * This hook is used to get the associated styles for a given styleId / boundTag.
17
17
  */
18
18
  export const useAssociatedStyles = ({ id }: Props = {}) => {
19
- const { stylesMap } = useTransitionStyles();
19
+ const { stylesMap, parentStylesMap } = useTransitionStyles();
20
20
  const showAfterFirstFrame = useSharedValue(false);
21
21
 
22
22
  useDerivedValue(() => {
23
23
  "worklet";
24
24
 
25
- // If the associated styles have already been shown, return.
26
-
27
25
  if (!id) {
28
26
  showAfterFirstFrame.value = true;
29
27
  return;
@@ -39,10 +37,14 @@ export const useAssociatedStyles = ({ id }: Props = {}) => {
39
37
  const associatedStyles = useAnimatedStyle(() => {
40
38
  "worklet";
41
39
 
42
- if (!id || !stylesMap) {
40
+ if (!id) {
43
41
  return NO_STYLES;
44
42
  }
45
- const base = stylesMap.value[id] || NO_STYLES;
43
+
44
+ // Check local styles first, then fall back to parent
45
+ const localStyles = stylesMap?.value[id];
46
+ const parentStyles = parentStylesMap?.value[id];
47
+ const base = localStyles || parentStyles || NO_STYLES;
46
48
 
47
49
  let opacity = 1;
48
50
 
@@ -50,13 +52,10 @@ export const useAssociatedStyles = ({ id }: Props = {}) => {
50
52
  opacity = base.opacity as number;
51
53
  }
52
54
 
53
- // Only force opacity to 0 during the initial frame; once ready,
54
- // return base unchanged so we never override user-provided opacity.
55
55
  if (!showAfterFirstFrame.value) {
56
56
  return { ...base, opacity: 0 };
57
57
  }
58
58
 
59
- // Since opacity exists on the base style, we don't need to override it.
60
59
  if ("opacity" in base) {
61
60
  return base;
62
61
  }
@@ -4,19 +4,15 @@ import { useWindowDimensions } from "react-native";
4
4
  import { type SharedValue, useDerivedValue } from "react-native-reanimated";
5
5
  import { useSafeAreaInsets } from "react-native-safe-area-context";
6
6
 
7
- import {
8
- DEFAULT_SCREEN_TRANSITION_STATE,
9
- NO_BOUNDS_MAP,
10
- } from "../../constants";
11
- import { type TransitionDescriptor, useKeys } from "../../providers/keys";
12
-
13
- import { AnimationStore } from "../../stores/animation-store";
14
- import { BoundStore } from "../../stores/bound-store";
15
- import { GestureStore, type GestureStoreMap } from "../../stores/gesture-store";
7
+ import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../constants";
8
+ import { type TransitionDescriptor, useKeys } from "../../providers/keys.provider";
9
+
10
+ import { AnimationStore } from "../../stores/animation.store";
11
+ import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
16
12
  import type {
17
13
  ScreenInterpolationProps,
18
14
  ScreenTransitionState,
19
- } from "../../types/animation";
15
+ } from "../../types/animation.types";
20
16
  import { derivations } from "../../utils/animation/derivations";
21
17
  import { createBounds } from "../../utils/bounds";
22
18
 
@@ -48,7 +44,6 @@ const unwrap = (
48
44
  isDragging: s.gesture.isDragging.value,
49
45
  direction: s.gesture.direction.value,
50
46
  },
51
- bounds: BoundStore.getBounds(key) || NO_BOUNDS_MAP,
52
47
  route: s.route,
53
48
  };
54
49
  };
@@ -100,17 +95,9 @@ export function _useScreenAnimation() {
100
95
  unwrap(currentAnimation, currentDescriptor?.route.key) ??
101
96
  DEFAULT_SCREEN_TRANSITION_STATE;
102
97
 
103
- const {
104
- progress,
105
- focused,
106
- activeBoundId,
107
- active,
108
- isActiveTransitioning,
109
- isDismissing,
110
- } = derivations({
98
+ const helpers = derivations({
111
99
  current,
112
100
  next,
113
- previous,
114
101
  });
115
102
 
116
103
  return {
@@ -119,12 +106,7 @@ export function _useScreenAnimation() {
119
106
  previous,
120
107
  current,
121
108
  next,
122
- focused,
123
- activeBoundId,
124
- progress,
125
- active,
126
- isActiveTransitioning,
127
- isDismissing,
109
+ ...helpers,
128
110
  };
129
111
  });
130
112
 
@@ -21,12 +21,12 @@ import {
21
21
  import type {
22
22
  GestureContextType,
23
23
  ScrollConfig,
24
- } from "../../providers/gestures";
25
- import { useKeys } from "../../providers/keys";
26
- import { AnimationStore } from "../../stores/animation-store";
27
- import { GestureStore, type GestureStoreMap } from "../../stores/gesture-store";
24
+ } from "../../providers/gestures.provider";
25
+ import { useKeys } from "../../providers/keys.provider";
26
+ import { AnimationStore } from "../../stores/animation.store";
27
+ import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
28
28
 
29
- import { type GestureDirection, GestureOffsetState } from "../../types/gesture";
29
+ import { type GestureDirection, GestureOffsetState } from "../../types/gesture.types";
30
30
  import { startScreenTransition } from "../../utils/animation/start-screen-transition";
31
31
  import { applyOffsetRules } from "../../utils/gesture/check-gesture-activation";
32
32
  import { determineDismissal } from "../../utils/gesture/determine-dismissal";
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from "react";
2
- import { useGestureContext } from "../../providers/gestures";
2
+ import { useGestureContext } from "../../providers/gestures.provider";
3
3
  import useStableCallback from "../use-stable-callback";
4
4
 
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  import type { LayoutChangeEvent } from "react-native";
2
2
  import { useAnimatedScrollHandler } from "react-native-reanimated";
3
3
  import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes";
4
- import { useGestureContext } from "../../providers/gestures";
5
- import type { Any } from "../../types/utils";
4
+ import { useGestureContext } from "../../providers/gestures.provider";
5
+ import type { Any } from "../../types/utils.types";
6
6
  import useStableCallback from "../use-stable-callback";
7
7
 
8
8
  interface ScrollProgressHookProps {
@@ -25,5 +25,5 @@ export type {
25
25
  OverlayInterpolationProps,
26
26
  ScreenInterpolationProps,
27
27
  ScreenStyleInterpolator,
28
- } from "./types/animation";
29
- export type { ScreenTransitionConfig } from "./types/core";
28
+ } from "./types/animation.types";
29
+ export type { ScreenTransitionConfig } from "./types/core.types";
@@ -5,7 +5,7 @@ import { GestureDetector } from "react-native-gesture-handler";
5
5
  import type { SharedValue } from "react-native-reanimated";
6
6
  import { useSharedValue } from "react-native-reanimated";
7
7
  import { useBuildGestures } from "../hooks/gestures/use-build-gestures";
8
- import type { GestureStoreMap } from "../stores/gesture-store";
8
+ import type { GestureStoreMap } from "../stores/gesture.store";
9
9
 
10
10
  export type ScrollConfig = {
11
11
  x: number;
@@ -5,7 +5,7 @@ import type {
5
5
  RouteProp,
6
6
  } from "@react-navigation/native";
7
7
  import { createContext, useContext, useMemo } from "react";
8
- import type { ScreenTransitionConfig } from "../types/core";
8
+ import type { ScreenTransitionConfig } from "../types/core.types";
9
9
 
10
10
  export type TransitionDescriptor = Descriptor<
11
11
  ScreenTransitionConfig,
@@ -0,0 +1,284 @@
1
+ import {
2
+ type ReactNode,
3
+ useCallback,
4
+ useLayoutEffect,
5
+ useMemo,
6
+ useRef,
7
+ } from "react";
8
+ import type { View } from "react-native";
9
+ import {
10
+ type AnimatedRef,
11
+ measure,
12
+ runOnJS,
13
+ runOnUI,
14
+ type StyleProps,
15
+ useAnimatedReaction,
16
+ useSharedValue,
17
+ } from "react-native-reanimated";
18
+ import type { SharedValue } from "react-native-reanimated/lib/typescript/commonTypes";
19
+ import useStableCallback from "../hooks/use-stable-callback";
20
+ import useStableCallbackValue from "../hooks/use-stable-callback-value";
21
+ import { AnimationStore } from "../stores/animation.store";
22
+ import { BoundStore } from "../stores/bounds.store";
23
+ import { prepareStyleForBounds } from "../utils/bounds/helpers/styles";
24
+ import createProvider from "../utils/create-provider";
25
+ import { type TransitionDescriptor, useKeys } from "./keys.provider";
26
+
27
+ interface MaybeMeasureAndStoreParams {
28
+ onPress?: ((...args: unknown[]) => void) | undefined;
29
+ shouldSetSource?: boolean;
30
+ shouldSetDestination?: boolean;
31
+ }
32
+
33
+ interface RegisterBoundsRenderProps {
34
+ handleInitialLayout: () => void;
35
+ captureActiveOnPress: () => void;
36
+ }
37
+
38
+ interface RegisterBoundsProviderProps {
39
+ sharedBoundTag?: string;
40
+ animatedRef: AnimatedRef<View>;
41
+ style: StyleProps;
42
+ onPress?: ((...args: unknown[]) => void) | undefined;
43
+ children: (props: RegisterBoundsRenderProps) => ReactNode;
44
+ }
45
+
46
+ interface RegisterBoundsContextValue {
47
+ updateSignal: SharedValue<number>;
48
+ }
49
+
50
+ /**
51
+ * Gets the parent screen's route key for nested navigators.
52
+ * Returns undefined if we're not inside a nested navigator.
53
+ */
54
+ const getParentScreenKey = (current: TransitionDescriptor) => {
55
+ const parent = current.navigation.getParent();
56
+ if (!parent) return undefined;
57
+
58
+ const parentState = parent.getState();
59
+ if (!parentState?.routes) return undefined;
60
+
61
+ // Check if our route key exists directly in parent's routes
62
+ const existsInParent = parentState.routes.some(
63
+ (r) => r.key === current.route.key,
64
+ );
65
+
66
+ // If we don't exist in parent's routes, we're nested inside the focused route
67
+ if (!existsInParent && parentState.index !== undefined) {
68
+ return parentState.routes[parentState.index]?.key;
69
+ }
70
+
71
+ return undefined;
72
+ };
73
+
74
+ /**
75
+ * Handles initial layout measurement for destination elements.
76
+ * Only measures if an animation is in progress (local or parent).
77
+ */
78
+ const useInitialLayoutHandler = (params: {
79
+ sharedBoundTag?: string;
80
+ currentScreenKey: string;
81
+ parentScreenKey?: string;
82
+ maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
83
+ }) => {
84
+ const {
85
+ sharedBoundTag,
86
+ currentScreenKey,
87
+ parentScreenKey,
88
+ maybeMeasureAndStore,
89
+ } = params;
90
+
91
+ const isAnimating = AnimationStore.getAnimation(
92
+ currentScreenKey,
93
+ "animating",
94
+ );
95
+ const isParentAnimating = parentScreenKey
96
+ ? AnimationStore.getAnimation(parentScreenKey, "animating")
97
+ : null;
98
+
99
+ const hasMeasuredOnLayout = useSharedValue(false);
100
+
101
+ return useCallback(() => {
102
+ "worklet";
103
+ if (!sharedBoundTag || hasMeasuredOnLayout.value) return;
104
+ if (!isAnimating.value && !isParentAnimating?.value) return;
105
+
106
+ maybeMeasureAndStore({
107
+ shouldSetSource: false,
108
+ shouldSetDestination: true,
109
+ });
110
+
111
+ hasMeasuredOnLayout.value = true;
112
+ }, [
113
+ sharedBoundTag,
114
+ hasMeasuredOnLayout,
115
+ isAnimating,
116
+ isParentAnimating,
117
+ maybeMeasureAndStore,
118
+ ]);
119
+ };
120
+
121
+ /**
122
+ * Measures non-pressable elements when screen becomes blurred.
123
+ * Captures bounds right before transition starts.
124
+ */
125
+ const useBlurMeasurement = (params: {
126
+ sharedBoundTag?: string;
127
+ next?: TransitionDescriptor;
128
+ onPress?: () => void;
129
+ maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
130
+ }) => {
131
+ const { sharedBoundTag, next, onPress, maybeMeasureAndStore } = params;
132
+ const prevNextRef = useRef(next);
133
+
134
+ useLayoutEffect(() => {
135
+ if (!sharedBoundTag || onPress) return;
136
+
137
+ const hadNext = !!prevNextRef.current;
138
+ const hasNext = !!next;
139
+
140
+ // Screen went from focused to blurred
141
+ if (!hadNext && hasNext) {
142
+ runOnUI(maybeMeasureAndStore)({ shouldSetSource: true });
143
+ }
144
+
145
+ prevNextRef.current = next;
146
+ }, [next, sharedBoundTag, onPress, maybeMeasureAndStore]);
147
+ };
148
+
149
+ /**
150
+ * Syncs child measurements when parent updates.
151
+ */
152
+ const useParentSyncReaction = (params: {
153
+ parentContext: RegisterBoundsContextValue | null;
154
+ maybeMeasureAndStore: (options?: MaybeMeasureAndStoreParams) => void;
155
+ }) => {
156
+ const { parentContext, maybeMeasureAndStore } = params;
157
+
158
+ useAnimatedReaction(
159
+ () => parentContext?.updateSignal.value,
160
+ (value) => {
161
+ "worklet";
162
+ if (value === 0 || value === undefined) return;
163
+ maybeMeasureAndStore();
164
+ },
165
+ );
166
+ };
167
+
168
+ const { RegisterBoundsProvider, useRegisterBoundsContext } = createProvider(
169
+ "RegisterBounds",
170
+ { guarded: false },
171
+ )<RegisterBoundsProviderProps, RegisterBoundsContextValue>(
172
+ ({ style, onPress, sharedBoundTag, animatedRef, children }) => {
173
+ const { current, next } = useKeys();
174
+ const currentScreenKey = current.route.key;
175
+ const parentScreenKey = getParentScreenKey(current);
176
+
177
+ // Context & signals
178
+ const parentContext: RegisterBoundsContextValue | null =
179
+ useRegisterBoundsContext();
180
+ const ownSignal = useSharedValue(0);
181
+ const updateSignal: SharedValue<number> =
182
+ parentContext?.updateSignal ?? ownSignal;
183
+
184
+ const isAnimating = AnimationStore.getAnimation(
185
+ currentScreenKey,
186
+ "animating",
187
+ );
188
+ const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
189
+
190
+ const emitUpdate = useStableCallbackValue(() => {
191
+ "worklet";
192
+ const isRoot = !parentContext;
193
+ if (isRoot) updateSignal.value = updateSignal.value + 1;
194
+ });
195
+
196
+ const maybeMeasureAndStore = useStableCallbackValue(
197
+ ({
198
+ onPress,
199
+ shouldSetSource,
200
+ shouldSetDestination,
201
+ }: MaybeMeasureAndStoreParams = {}) => {
202
+ "worklet";
203
+ if (!sharedBoundTag) return;
204
+
205
+ const measured = measure(animatedRef);
206
+ if (!measured) return;
207
+
208
+ emitUpdate();
209
+
210
+ // Always register occurrence
211
+ BoundStore.registerOccurrence(
212
+ sharedBoundTag,
213
+ currentScreenKey,
214
+ measured,
215
+ preparedStyles,
216
+ );
217
+
218
+ // Set as source (on press or blur)
219
+ if (shouldSetSource) {
220
+ if (isAnimating.value) {
221
+ const existing = BoundStore.getOccurrence(
222
+ sharedBoundTag,
223
+ currentScreenKey,
224
+ );
225
+ BoundStore.setLinkSource(
226
+ sharedBoundTag,
227
+ currentScreenKey,
228
+ existing.bounds,
229
+ preparedStyles,
230
+ parentScreenKey,
231
+ );
232
+ return;
233
+ }
234
+ BoundStore.setLinkSource(
235
+ sharedBoundTag,
236
+ currentScreenKey,
237
+ measured,
238
+ preparedStyles,
239
+ parentScreenKey,
240
+ );
241
+ }
242
+
243
+ // Set as destination (on mount during animation)
244
+ if (shouldSetDestination) {
245
+ BoundStore.setLinkDestination(
246
+ sharedBoundTag,
247
+ currentScreenKey,
248
+ measured,
249
+ preparedStyles,
250
+ parentScreenKey,
251
+ );
252
+ }
253
+
254
+ if (onPress) runOnJS(onPress)();
255
+ },
256
+ );
257
+
258
+ const handleInitialLayout = useInitialLayoutHandler({
259
+ sharedBoundTag,
260
+ currentScreenKey,
261
+ parentScreenKey,
262
+ maybeMeasureAndStore,
263
+ });
264
+
265
+ const captureActiveOnPress = useStableCallback(() => {
266
+ if (!sharedBoundTag) {
267
+ onPress?.();
268
+ return;
269
+ }
270
+ runOnUI(maybeMeasureAndStore)({ onPress, shouldSetSource: true });
271
+ });
272
+
273
+ // Side effects
274
+ useBlurMeasurement({ sharedBoundTag, next, onPress, maybeMeasureAndStore });
275
+ useParentSyncReaction({ parentContext, maybeMeasureAndStore });
276
+
277
+ return {
278
+ value: { updateSignal },
279
+ children: children({ handleInitialLayout, captureActiveOnPress }),
280
+ };
281
+ },
282
+ );
283
+
284
+ export { RegisterBoundsProvider };
@@ -2,9 +2,9 @@ import type React from "react";
2
2
  import type { ComponentType } from "react";
3
3
  import type { ScreenLifecycleProps } from "../components/controllers/screen-lifecycle";
4
4
  import { RootTransitionAware } from "../components/root-transition-aware";
5
- import { ScreenGestureProvider } from "../providers/gestures";
6
- import { KeysProvider, type TransitionDescriptor } from "../providers/keys";
7
- import { TransitionStylesProvider } from "../providers/transition-styles";
5
+ import { ScreenGestureProvider } from "./gestures.provider";
6
+ import { KeysProvider, type TransitionDescriptor } from "./keys.provider";
7
+ import { TransitionStylesProvider } from "./transition-styles.provider";
8
8
 
9
9
  type Props<TDescriptor extends TransitionDescriptor> = {
10
10
  previous?: TDescriptor;