react-native-screen-transitions 3.0.0 → 3.2.0-beta.0

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 (569) hide show
  1. package/README.md +179 -48
  2. package/lib/commonjs/blank-stack/components/screens.js +2 -2
  3. package/lib/commonjs/blank-stack/components/screens.js.map +1 -1
  4. package/lib/commonjs/blank-stack/components/stack-view.js +42 -51
  5. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  6. package/lib/commonjs/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +17 -8
  7. package/lib/commonjs/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
  8. package/lib/commonjs/component-stack/components/component-view.js +63 -0
  9. package/lib/commonjs/component-stack/components/component-view.js.map +1 -0
  10. package/lib/commonjs/component-stack/components/screens.js +64 -0
  11. package/lib/commonjs/component-stack/components/screens.js.map +1 -0
  12. package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js +82 -0
  13. package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
  14. package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js +321 -0
  15. package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
  16. package/lib/commonjs/component-stack/hooks/use-component-navigation.js +28 -0
  17. package/lib/commonjs/component-stack/hooks/use-component-navigation.js.map +1 -0
  18. package/lib/commonjs/component-stack/index.js +20 -0
  19. package/lib/commonjs/component-stack/index.js.map +1 -0
  20. package/lib/commonjs/component-stack/navigators/create-component-navigator.js +97 -0
  21. package/lib/commonjs/component-stack/navigators/create-component-navigator.js.map +1 -0
  22. package/lib/commonjs/component-stack/types.js.map +1 -0
  23. package/lib/commonjs/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  24. package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  25. package/lib/commonjs/native-stack/views/NativeStackView.native.js +120 -121
  26. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  27. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  28. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +64 -0
  29. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  30. package/lib/commonjs/shared/components/overlay/index.js +15 -0
  31. package/lib/commonjs/shared/components/overlay/index.js.map +1 -0
  32. package/lib/commonjs/shared/components/overlay/variations/container-overlay.js +99 -0
  33. package/lib/commonjs/shared/components/overlay/variations/container-overlay.js.map +1 -0
  34. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +51 -0
  35. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -0
  36. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +124 -0
  37. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -0
  38. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +47 -0
  39. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -0
  40. package/lib/commonjs/shared/components/root-transition-aware.js +2 -2
  41. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  42. package/lib/commonjs/shared/constants.js +2 -31
  43. package/lib/commonjs/shared/constants.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
  45. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  46. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js +30 -0
  47. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  48. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +17 -9
  49. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  50. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +1 -1
  51. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  52. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  53. package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  54. package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  55. package/lib/commonjs/shared/hooks/navigation/use-previous.js.map +1 -0
  56. package/lib/commonjs/shared/hooks/navigation/use-stack.js +37 -0
  57. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -0
  58. package/lib/commonjs/shared/providers/gestures.provider.js +1 -1
  59. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -1
  60. package/lib/commonjs/shared/providers/register-bounds.provider.js +11 -5
  61. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  62. package/lib/commonjs/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  63. package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -0
  64. package/lib/commonjs/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +7 -7
  65. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -0
  66. package/lib/commonjs/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +12 -13
  67. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
  68. package/lib/commonjs/shared/providers/stack/core.provider.js +61 -0
  69. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
  70. package/lib/commonjs/shared/providers/stack/direct.provider.js +158 -0
  71. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -0
  72. package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
  73. package/lib/commonjs/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  74. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js +93 -0
  75. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  76. package/lib/commonjs/shared/providers/stack/managed.provider.js +155 -0
  77. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -0
  78. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
  79. package/lib/commonjs/shared/types/index.js +19 -0
  80. package/lib/commonjs/shared/types/index.js.map +1 -0
  81. package/lib/commonjs/shared/types/overlay.types.js +6 -0
  82. package/lib/commonjs/shared/types/overlay.types.js.map +1 -0
  83. package/lib/commonjs/shared/types/screen.types.js +6 -0
  84. package/lib/commonjs/shared/types/screen.types.js.map +1 -0
  85. package/lib/commonjs/shared/types/{core.types.js → stack.types.js} +1 -1
  86. package/lib/commonjs/shared/types/{core.types.js.map → stack.types.js.map} +1 -1
  87. package/lib/commonjs/shared/utils/animation/derivations.js +7 -0
  88. package/lib/commonjs/shared/utils/animation/derivations.js.map +1 -1
  89. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
  90. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  91. package/lib/commonjs/shared/utils/create-provider.js +16 -13
  92. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  93. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  94. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js +51 -0
  95. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  96. package/lib/commonjs/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  97. package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +1 -0
  98. package/lib/commonjs/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  99. package/lib/commonjs/shared/utils/navigation/routes-are-identical.js.map +1 -0
  100. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +95 -0
  101. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  102. package/lib/commonjs/shared/utils/read-shared-value.js +17 -0
  103. package/lib/commonjs/shared/utils/read-shared-value.js.map +1 -0
  104. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -1
  105. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
  106. package/lib/module/blank-stack/components/screens.js +2 -2
  107. package/lib/module/blank-stack/components/screens.js.map +1 -1
  108. package/lib/module/blank-stack/components/stack-view.js +41 -50
  109. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  110. package/lib/module/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +18 -9
  111. package/lib/module/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
  112. package/lib/module/component-stack/components/component-view.js +58 -0
  113. package/lib/module/component-stack/components/component-view.js.map +1 -0
  114. package/lib/module/component-stack/components/screens.js +58 -0
  115. package/lib/module/component-stack/components/screens.js.map +1 -0
  116. package/lib/module/component-stack/controllers/component-stack-lifecycle.js +76 -0
  117. package/lib/module/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
  118. package/lib/module/component-stack/hooks/use-component-navigation-builder.js +316 -0
  119. package/lib/module/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
  120. package/lib/module/component-stack/hooks/use-component-navigation.js +25 -0
  121. package/lib/module/component-stack/hooks/use-component-navigation.js.map +1 -0
  122. package/lib/module/component-stack/index.js +5 -0
  123. package/lib/module/component-stack/index.js.map +1 -0
  124. package/lib/module/component-stack/navigators/create-component-navigator.js +91 -0
  125. package/lib/module/component-stack/navigators/create-component-navigator.js.map +1 -0
  126. package/lib/module/component-stack/types.js.map +1 -0
  127. package/lib/module/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  128. package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  129. package/lib/module/native-stack/views/NativeStackView.native.js +121 -122
  130. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  131. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  132. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +59 -0
  133. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  134. package/lib/module/shared/components/overlay/index.js +11 -0
  135. package/lib/module/shared/components/overlay/index.js.map +1 -0
  136. package/lib/module/shared/components/overlay/variations/container-overlay.js +97 -0
  137. package/lib/module/shared/components/overlay/variations/container-overlay.js.map +1 -0
  138. package/lib/module/shared/components/overlay/variations/float-overlay.js +48 -0
  139. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -0
  140. package/lib/module/shared/components/overlay/variations/overlay-host.js +120 -0
  141. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -0
  142. package/lib/module/shared/components/overlay/variations/screen-overlay.js +44 -0
  143. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +1 -0
  144. package/lib/module/shared/components/root-transition-aware.js +2 -2
  145. package/lib/module/shared/components/root-transition-aware.js.map +1 -1
  146. package/lib/module/shared/constants.js +0 -29
  147. package/lib/module/shared/constants.js.map +1 -1
  148. package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
  149. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  150. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js +24 -0
  151. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  152. package/lib/module/shared/hooks/animation/use-screen-animation.js +17 -9
  153. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  154. package/lib/module/shared/hooks/gestures/use-build-gestures.js +1 -1
  155. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  156. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  157. package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  158. package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  159. package/lib/module/shared/hooks/navigation/use-previous.js.map +1 -0
  160. package/lib/module/shared/hooks/navigation/use-stack.js +33 -0
  161. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -0
  162. package/lib/module/shared/providers/gestures.provider.js +1 -1
  163. package/lib/module/shared/providers/gestures.provider.js.map +1 -1
  164. package/lib/module/shared/providers/register-bounds.provider.js +11 -5
  165. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  166. package/lib/module/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  167. package/lib/module/shared/providers/screen/keys.provider.js.map +1 -0
  168. package/lib/module/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +6 -6
  169. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -0
  170. package/lib/module/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +10 -10
  171. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
  172. package/lib/module/shared/providers/stack/core.provider.js +55 -0
  173. package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
  174. package/lib/module/shared/providers/stack/direct.provider.js +153 -0
  175. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -0
  176. package/lib/module/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js → shared/providers/stack/helpers/active-screens-limit.js} +1 -1
  177. package/lib/module/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  178. package/lib/module/shared/providers/stack/helpers/use-local-routes.js +87 -0
  179. package/lib/module/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  180. package/lib/module/shared/providers/stack/managed.provider.js +150 -0
  181. package/lib/module/shared/providers/stack/managed.provider.js.map +1 -0
  182. package/lib/module/shared/stores/bounds.store.js.map +1 -1
  183. package/lib/module/shared/types/index.js +4 -0
  184. package/lib/module/shared/types/index.js.map +1 -0
  185. package/lib/module/shared/types/overlay.types.js +4 -0
  186. package/lib/module/shared/types/overlay.types.js.map +1 -0
  187. package/lib/module/shared/types/screen.types.js +4 -0
  188. package/lib/module/shared/types/screen.types.js.map +1 -0
  189. package/lib/module/shared/types/stack.types.js +4 -0
  190. package/lib/{commonjs/shared/types/utils.types.js.map → module/shared/types/stack.types.js.map} +1 -1
  191. package/lib/module/shared/utils/animation/derivations.js +7 -0
  192. package/lib/module/shared/utils/animation/derivations.js.map +1 -1
  193. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
  194. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  195. package/lib/module/shared/utils/create-provider.js +16 -13
  196. package/lib/module/shared/utils/create-provider.js.map +1 -1
  197. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  198. package/lib/module/shared/utils/navigation/align-routes-with-latest.js +46 -0
  199. package/lib/module/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  200. package/lib/module/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  201. package/lib/module/shared/utils/navigation/compose-descriptors.js.map +1 -0
  202. package/lib/module/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  203. package/lib/module/shared/utils/navigation/routes-are-identical.js.map +1 -0
  204. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +90 -0
  205. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  206. package/lib/module/shared/utils/read-shared-value.js +14 -0
  207. package/lib/module/shared/utils/read-shared-value.js.map +1 -0
  208. package/lib/module/shared/utils/reset-stores-for-screen.js +2 -2
  209. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
  210. package/lib/typescript/blank-stack/components/stack-view.d.ts +2 -1
  211. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  212. package/lib/typescript/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.d.ts +2 -1
  213. package/lib/typescript/blank-stack/controllers/blank-stack-lifecycle.d.ts.map +1 -0
  214. package/lib/typescript/blank-stack/types.d.ts +9 -50
  215. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  216. package/lib/typescript/component-stack/components/component-view.d.ts +4 -0
  217. package/lib/typescript/component-stack/components/component-view.d.ts.map +1 -0
  218. package/lib/typescript/component-stack/components/screens.d.ts +9 -0
  219. package/lib/typescript/component-stack/components/screens.d.ts.map +1 -0
  220. package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts +10 -0
  221. package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts.map +1 -0
  222. package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts +19 -0
  223. package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts.map +1 -0
  224. package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts +19 -0
  225. package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts.map +1 -0
  226. package/lib/typescript/component-stack/index.d.ts +4 -0
  227. package/lib/typescript/component-stack/index.d.ts.map +1 -0
  228. package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts +35 -0
  229. package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts.map +1 -0
  230. package/lib/typescript/component-stack/types.d.ts +206 -0
  231. package/lib/typescript/component-stack/types.d.ts.map +1 -0
  232. package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +1 -0
  233. package/lib/typescript/native-stack/index.d.ts +1 -1
  234. package/lib/typescript/native-stack/index.d.ts.map +1 -1
  235. package/lib/typescript/native-stack/types.d.ts +9 -6
  236. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  237. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts +2 -10
  238. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  239. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  240. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +20 -0
  241. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -0
  242. package/lib/typescript/shared/components/overlay/index.d.ts +9 -0
  243. package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -0
  244. package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts +8 -0
  245. package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts.map +1 -0
  246. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +6 -0
  247. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -0
  248. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +12 -0
  249. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -0
  250. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +6 -0
  251. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +1 -0
  252. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  253. package/lib/typescript/shared/configs/presets.d.ts +1 -1
  254. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  255. package/lib/typescript/shared/constants.d.ts +1 -16
  256. package/lib/typescript/shared/constants.d.ts.map +1 -1
  257. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +6 -0
  258. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts.map +1 -0
  259. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  260. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  261. package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
  262. package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +1 -0
  263. package/lib/typescript/shared/hooks/navigation/use-previous.d.ts.map +1 -0
  264. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +71 -0
  265. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
  266. package/lib/typescript/shared/index.d.ts +31 -33
  267. package/lib/typescript/shared/index.d.ts.map +1 -1
  268. package/lib/typescript/shared/providers/gestures.provider.d.ts +4 -2
  269. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
  270. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  271. package/lib/typescript/shared/providers/screen/keys.provider.d.ts +29 -0
  272. package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -0
  273. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +13 -0
  274. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -0
  275. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +13 -0
  276. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -0
  277. package/lib/typescript/shared/providers/stack/core.provider.d.ts +11 -0
  278. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -0
  279. package/lib/typescript/shared/providers/stack/direct.provider.d.ts +34 -0
  280. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -0
  281. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts +9 -0
  282. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts.map +1 -0
  283. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts +19 -0
  284. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts.map +1 -0
  285. package/lib/typescript/shared/providers/stack/managed.provider.d.ts +39 -0
  286. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -0
  287. package/lib/typescript/shared/stores/animation.store.d.ts +1 -1
  288. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  289. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
  290. package/lib/typescript/shared/stores/gesture.store.d.ts +2 -2
  291. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  292. package/lib/typescript/shared/types/animation.types.d.ts +10 -3
  293. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  294. package/lib/typescript/shared/types/gesture.types.d.ts +0 -1
  295. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  296. package/lib/typescript/shared/types/index.d.ts +8 -0
  297. package/lib/typescript/shared/types/index.d.ts.map +1 -0
  298. package/lib/typescript/shared/types/overlay.types.d.ts +50 -0
  299. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -0
  300. package/lib/typescript/shared/types/{core.types.d.ts → screen.types.d.ts} +31 -6
  301. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -0
  302. package/lib/typescript/shared/types/stack.types.d.ts +52 -0
  303. package/lib/typescript/shared/types/stack.types.d.ts.map +1 -0
  304. package/lib/typescript/shared/utils/animation/derivations.d.ts +3 -1
  305. package/lib/typescript/shared/utils/animation/derivations.d.ts.map +1 -1
  306. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +1 -1
  307. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  308. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +2 -1
  309. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  310. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts +1 -2
  311. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -1
  312. package/lib/typescript/shared/utils/bounds/index.d.ts +1 -9
  313. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  314. package/lib/typescript/shared/utils/bounds/types/builder.d.ts +9 -8
  315. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -1
  316. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts +2 -1
  317. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -1
  318. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  319. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +1 -1
  320. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  321. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts +13 -0
  322. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts.map +1 -0
  323. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts +2 -0
  324. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts.map +1 -0
  325. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts +6 -0
  326. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +1 -0
  327. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts +6 -0
  328. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts.map +1 -0
  329. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts +6 -0
  330. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts.map +1 -0
  331. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +21 -0
  332. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -0
  333. package/lib/typescript/shared/utils/read-shared-value.d.ts +7 -0
  334. package/lib/typescript/shared/utils/read-shared-value.d.ts.map +1 -0
  335. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +4 -3
  336. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
  337. package/package.json +7 -2
  338. package/src/blank-stack/components/screens.tsx +2 -2
  339. package/src/blank-stack/components/stack-view.tsx +59 -67
  340. package/src/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.tsx +18 -11
  341. package/src/blank-stack/types.ts +10 -62
  342. package/src/component-stack/components/component-view.tsx +72 -0
  343. package/src/component-stack/components/screens.tsx +86 -0
  344. package/src/component-stack/controllers/component-stack-lifecycle.tsx +80 -0
  345. package/src/component-stack/hooks/use-component-navigation-builder.tsx +388 -0
  346. package/src/component-stack/hooks/use-component-navigation.tsx +22 -0
  347. package/src/component-stack/index.ts +16 -0
  348. package/src/component-stack/navigators/create-component-navigator.tsx +104 -0
  349. package/src/component-stack/types.ts +209 -0
  350. package/src/{shared/components → native-stack}/controllers/native-stack-lifecycle.tsx +18 -11
  351. package/src/native-stack/index.ts +1 -0
  352. package/src/native-stack/types.ts +11 -7
  353. package/src/native-stack/views/NativeStackView.native.tsx +42 -69
  354. package/src/shared/__tests__/sync-routes-with-removed.test.ts +283 -0
  355. package/src/shared/components/create-transition-aware-component.tsx +5 -6
  356. package/src/shared/components/overlay/helpers/get-active-overlay.ts +64 -0
  357. package/src/shared/components/overlay/index.ts +9 -0
  358. package/src/shared/components/overlay/variations/container-overlay.tsx +98 -0
  359. package/src/shared/components/overlay/variations/float-overlay.tsx +44 -0
  360. package/src/shared/components/overlay/variations/overlay-host.tsx +148 -0
  361. package/src/shared/components/overlay/variations/screen-overlay.tsx +51 -0
  362. package/src/shared/components/root-transition-aware.tsx +2 -2
  363. package/src/shared/configs/presets.ts +1 -1
  364. package/src/shared/constants.ts +1 -33
  365. package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
  366. package/src/shared/hooks/animation/use-high-refresh-rate.tsx +28 -0
  367. package/src/shared/hooks/animation/use-screen-animation.tsx +20 -15
  368. package/src/shared/hooks/gestures/use-build-gestures.tsx +1 -2
  369. package/src/shared/hooks/gestures/use-scroll-registry.tsx +3 -4
  370. package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.tsx +1 -1
  371. package/src/shared/hooks/navigation/use-stack.tsx +100 -0
  372. package/src/shared/index.ts +7 -3
  373. package/src/shared/providers/gestures.provider.tsx +6 -2
  374. package/src/shared/providers/register-bounds.provider.tsx +13 -6
  375. package/src/shared/providers/screen/keys.provider.tsx +72 -0
  376. package/src/shared/providers/screen/screen-composer.tsx +38 -0
  377. package/src/shared/providers/{transition-styles.provider.tsx → screen/styles.provider.tsx} +14 -13
  378. package/src/shared/providers/stack/core.provider.tsx +64 -0
  379. package/src/shared/providers/stack/direct.provider.tsx +228 -0
  380. package/src/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.ts → shared/providers/stack/helpers/active-screens-limit.ts} +10 -4
  381. package/src/shared/providers/stack/helpers/use-local-routes.tsx +133 -0
  382. package/src/shared/providers/stack/managed.provider.tsx +226 -0
  383. package/src/shared/stores/animation.store.ts +1 -1
  384. package/src/shared/stores/bounds.store.ts +4 -5
  385. package/src/shared/stores/gesture.store.ts +2 -2
  386. package/src/shared/types/animation.types.ts +11 -3
  387. package/src/shared/types/gesture.types.ts +0 -2
  388. package/src/shared/types/index.ts +47 -0
  389. package/src/shared/types/overlay.types.ts +62 -0
  390. package/src/shared/types/{core.types.ts → screen.types.ts} +40 -7
  391. package/src/shared/types/stack.types.ts +59 -0
  392. package/src/shared/utils/animation/derivations.ts +8 -1
  393. package/src/shared/utils/bounds/helpers/geometry.ts +1 -1
  394. package/src/shared/utils/bounds/helpers/style-composers.ts +1 -1
  395. package/src/shared/utils/bounds/helpers/styles.ts +1 -2
  396. package/src/shared/utils/bounds/index.ts +1 -9
  397. package/src/shared/utils/bounds/types/builder.ts +8 -8
  398. package/src/shared/utils/bounds/types/geometry.ts +1 -1
  399. package/src/shared/utils/create-provider.tsx +14 -16
  400. package/src/shared/utils/gesture/check-gesture-activation.ts +1 -1
  401. package/src/shared/utils/navigation/align-routes-with-latest.ts +68 -0
  402. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.ts +5 -5
  403. package/src/shared/utils/navigation/compose-descriptors.ts +21 -0
  404. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.ts +6 -4
  405. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.ts +6 -4
  406. package/src/shared/utils/navigation/sync-routes-with-removed.ts +132 -0
  407. package/src/shared/utils/read-shared-value.ts +15 -0
  408. package/src/shared/utils/reset-stores-for-screen.ts +4 -3
  409. package/lib/commonjs/blank-stack/components/overlay.js +0 -156
  410. package/lib/commonjs/blank-stack/components/overlay.js.map +0 -1
  411. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +0 -72
  412. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  413. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  414. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  415. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  416. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  417. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  418. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  419. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  420. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -196
  421. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  422. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +0 -61
  423. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  424. package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  425. package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
  426. package/lib/commonjs/native-stack/views/FooterComponent.js.map +0 -1
  427. package/lib/commonjs/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  428. package/lib/commonjs/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  429. package/lib/commonjs/shared/providers/flags.provider.js +0 -25
  430. package/lib/commonjs/shared/providers/flags.provider.js.map +0 -1
  431. package/lib/commonjs/shared/providers/keys.provider.js.map +0 -1
  432. package/lib/commonjs/shared/providers/routes.provider.js +0 -48
  433. package/lib/commonjs/shared/providers/routes.provider.js.map +0 -1
  434. package/lib/commonjs/shared/providers/screen-transition.provider.js.map +0 -1
  435. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
  436. package/lib/commonjs/shared/types/utils.types.js +0 -2
  437. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js +0 -20
  438. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js.map +0 -1
  439. package/lib/commonjs/shared/utils/bounds/constants.js +0 -42
  440. package/lib/commonjs/shared/utils/bounds/constants.js.map +0 -1
  441. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +0 -19
  442. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  443. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +0 -224
  444. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  445. package/lib/commonjs/shared/utils/reanimated/version.js +0 -12
  446. package/lib/commonjs/shared/utils/reanimated/version.js.map +0 -1
  447. package/lib/module/blank-stack/components/overlay.js +0 -152
  448. package/lib/module/blank-stack/components/overlay.js.map +0 -1
  449. package/lib/module/blank-stack/hooks/use-overlay-animation.js +0 -68
  450. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  451. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  452. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  453. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  454. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  455. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  456. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  457. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  458. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -190
  459. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  460. package/lib/module/blank-stack/utils/with-stack-navigation/index.js +0 -55
  461. package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  462. package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  463. package/lib/module/native-stack/views/FooterComponent.js +0 -13
  464. package/lib/module/native-stack/views/FooterComponent.js.map +0 -1
  465. package/lib/module/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  466. package/lib/module/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  467. package/lib/module/shared/providers/flags.provider.js +0 -19
  468. package/lib/module/shared/providers/flags.provider.js.map +0 -1
  469. package/lib/module/shared/providers/keys.provider.js.map +0 -1
  470. package/lib/module/shared/providers/routes.provider.js +0 -42
  471. package/lib/module/shared/providers/routes.provider.js.map +0 -1
  472. package/lib/module/shared/providers/screen-transition.provider.js.map +0 -1
  473. package/lib/module/shared/providers/transition-styles.provider.js.map +0 -1
  474. package/lib/module/shared/types/core.types.js +0 -4
  475. package/lib/module/shared/types/core.types.js.map +0 -1
  476. package/lib/module/shared/types/utils.types.js +0 -2
  477. package/lib/module/shared/types/utils.types.js.map +0 -1
  478. package/lib/module/shared/utils/animation/compute-stack-progress.js +0 -15
  479. package/lib/module/shared/utils/animation/compute-stack-progress.js.map +0 -1
  480. package/lib/module/shared/utils/bounds/constants.js +0 -37
  481. package/lib/module/shared/utils/bounds/constants.js.map +0 -1
  482. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +0 -14
  483. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  484. package/lib/module/shared/utils/gesture/apply-offset-rules.js +0 -219
  485. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  486. package/lib/module/shared/utils/reanimated/version.js +0 -7
  487. package/lib/module/shared/utils/reanimated/version.js.map +0 -1
  488. package/lib/typescript/blank-stack/components/overlay.d.ts +0 -5
  489. package/lib/typescript/blank-stack/components/overlay.d.ts.map +0 -1
  490. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +0 -12
  491. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +0 -1
  492. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts +0 -3
  493. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +0 -1
  494. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts +0 -4
  495. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +0 -1
  496. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts +0 -4
  497. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +0 -1
  498. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts +0 -3
  499. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +0 -1
  500. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts +0 -3
  501. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +0 -1
  502. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.d.ts.map +0 -1
  503. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-previous.d.ts.map +0 -1
  504. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts +0 -20
  505. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +0 -1
  506. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +0 -4
  507. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +0 -1
  508. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts +0 -22
  509. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +0 -1
  510. package/lib/typescript/native-stack/views/FooterComponent.d.ts +0 -7
  511. package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +0 -1
  512. package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts.map +0 -1
  513. package/lib/typescript/shared/components/controllers/native-stack-lifecycle.d.ts.map +0 -1
  514. package/lib/typescript/shared/providers/flags.provider.d.ts +0 -10
  515. package/lib/typescript/shared/providers/flags.provider.d.ts.map +0 -1
  516. package/lib/typescript/shared/providers/keys.provider.d.ts +0 -18
  517. package/lib/typescript/shared/providers/keys.provider.d.ts.map +0 -1
  518. package/lib/typescript/shared/providers/routes.provider.d.ts +0 -19
  519. package/lib/typescript/shared/providers/routes.provider.d.ts.map +0 -1
  520. package/lib/typescript/shared/providers/screen-transition.provider.d.ts +0 -14
  521. package/lib/typescript/shared/providers/screen-transition.provider.d.ts.map +0 -1
  522. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +0 -14
  523. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +0 -1
  524. package/lib/typescript/shared/types/core.types.d.ts.map +0 -1
  525. package/lib/typescript/shared/types/utils.types.d.ts +0 -5
  526. package/lib/typescript/shared/types/utils.types.d.ts.map +0 -1
  527. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts +0 -3
  528. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts.map +0 -1
  529. package/lib/typescript/shared/utils/bounds/constants.d.ts +0 -7
  530. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +0 -1
  531. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts +0 -7
  532. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +0 -1
  533. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +0 -38
  534. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +0 -1
  535. package/lib/typescript/shared/utils/reanimated/version.d.ts +0 -2
  536. package/lib/typescript/shared/utils/reanimated/version.d.ts.map +0 -1
  537. package/src/blank-stack/components/overlay.tsx +0 -169
  538. package/src/blank-stack/hooks/use-overlay-animation.tsx +0 -86
  539. package/src/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.ts +0 -17
  540. package/src/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.tsx +0 -267
  541. package/src/blank-stack/utils/with-stack-navigation/index.tsx +0 -74
  542. package/src/blank-stack/utils/with-stack-navigation/types.ts +0 -35
  543. package/src/native-stack/views/FooterComponent.tsx +0 -10
  544. package/src/shared/providers/flags.provider.tsx +0 -21
  545. package/src/shared/providers/keys.provider.tsx +0 -57
  546. package/src/shared/providers/routes.provider.tsx +0 -54
  547. package/src/shared/providers/screen-transition.provider.tsx +0 -41
  548. package/src/shared/types/utils.types.ts +0 -4
  549. package/src/shared/utils/animation/compute-stack-progress.ts +0 -16
  550. package/src/shared/utils/bounds/constants.ts +0 -40
  551. package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +0 -24
  552. package/src/shared/utils/gesture/apply-offset-rules.ts +0 -312
  553. package/src/shared/utils/reanimated/version.ts +0 -5
  554. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  555. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  556. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  557. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  558. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  559. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  560. /package/lib/module/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  561. /package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  562. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  563. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  564. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  565. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  566. /package/lib/typescript/{shared/components → native-stack}/controllers/native-stack-lifecycle.d.ts +0 -0
  567. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.d.ts +0 -0
  568. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.d.ts +0 -0
  569. /package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.tsx +0 -0
@@ -0,0 +1,51 @@
1
+ import { useMemo } from "react";
2
+ import {
3
+ type StackDescriptor,
4
+ type StackScene,
5
+ useStack,
6
+ } from "../../../hooks/navigation/use-stack";
7
+ import { useKeys } from "../../../providers/screen/keys.provider";
8
+ import { OverlayHost } from "./overlay-host";
9
+
10
+ /**
11
+ * Screen overlay component that renders per-screen.
12
+ * Gets current descriptor from keys context.
13
+ */
14
+ export function ScreenOverlay() {
15
+ const { current } = useKeys<StackDescriptor>();
16
+ const { routeKeys, flags } = useStack();
17
+
18
+ const options = current.options;
19
+
20
+ const scene = useMemo<StackScene>(
21
+ () => ({
22
+ descriptor: current,
23
+ route: current.route,
24
+ }),
25
+ [current],
26
+ );
27
+
28
+ // Find the index of this screen in the stack
29
+ const overlayIndex = useMemo(
30
+ () => routeKeys.indexOf(current.route.key),
31
+ [routeKeys, current.route.key],
32
+ );
33
+
34
+ // Skip screens without enableTransitions (native-stack only)
35
+ if (!flags.TRANSITIONS_ALWAYS_ON && !options.enableTransitions) {
36
+ return null;
37
+ }
38
+
39
+ if (!options.overlayShown || options.overlayMode !== "screen") {
40
+ return null;
41
+ }
42
+
43
+ return (
44
+ <OverlayHost
45
+ scene={scene}
46
+ scenes={[scene]}
47
+ routes={[]}
48
+ overlayIndex={overlayIndex}
49
+ />
50
+ );
51
+ }
@@ -2,14 +2,14 @@ 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.provider";
5
+ import { useScreenStyles } from "../providers/screen/styles.provider";
6
6
 
7
7
  type Props = {
8
8
  children: React.ReactNode;
9
9
  };
10
10
 
11
11
  export const RootTransitionAware = memo(({ children }: Props) => {
12
- const { stylesMap } = useTransitionStyles();
12
+ const { stylesMap } = useScreenStyles();
13
13
 
14
14
  const animatedContentStyle = useAnimatedStyle(() => {
15
15
  "worklet";
@@ -4,7 +4,7 @@ import {
4
4
  interpolate,
5
5
  interpolateColor,
6
6
  } from "react-native-reanimated";
7
- import type { ScreenTransitionConfig } from "../types/core.types";
7
+ import type { ScreenTransitionConfig } from "../types/screen.types";
8
8
  import { DefaultSpec } from "./specs";
9
9
 
10
10
  const platform = Platform.OS;
@@ -1,11 +1,8 @@
1
1
  import type { ParamListBase, RouteProp } from "@react-navigation/native";
2
2
  import type { MeasuredDimensions } from "react-native-reanimated";
3
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
4
  import type { ActivationArea } from "./types/gesture.types";
7
- import type { Complete } from "./types/utils.types";
8
- import type { BoundsBuilderOptions } from "./utils/bounds/types/builder";
5
+ import type { Layout } from "./types/screen.types";
9
6
 
10
7
  /**
11
8
  * Masked view integration
@@ -41,7 +38,6 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
41
38
  /**
42
39
  * Bounds API Defaults
43
40
  */
44
- export const NO_BOUNDS_MAP: Record<string, BoundEntry> = Object.freeze({});
45
41
  export const EMPTY_BOUND_HELPER_RESULT = Object.freeze({});
46
42
  export const EMPTY_BOUND_HELPER_RESULT_RAW = Object.freeze({
47
43
  scaleX: 1,
@@ -69,23 +65,6 @@ export const FULLSCREEN_DIMENSIONS = (
69
65
  };
70
66
  };
71
67
 
72
- export const DEFAULT_BUILDER_OPTIONS: Complete<
73
- Omit<BoundsBuilderOptions, "id">
74
- > = Object.freeze({
75
- gestures: { x: 0, y: 0 },
76
- toFullscreen: false,
77
- absolute: false,
78
- relative: true,
79
- method: "transform",
80
- contentScaleMode: "auto",
81
- //
82
- space: "relative",
83
- target: "bound",
84
- scaleMode: "match",
85
- anchor: "center",
86
- raw: false,
87
- } as const);
88
-
89
68
  /**
90
69
  * Default gesture config
91
70
  */
@@ -94,14 +73,3 @@ export const DEFAULT_GESTURE_DIRECTION = "horizontal";
94
73
  export const DEFAULT_GESTURE_ENABLED = false;
95
74
  export const DEFAULT_GESTURE_DRIVES_PROGRESS = true;
96
75
  export const DEFAULT_GESTURE_ACTIVATION_AREA: ActivationArea = "screen";
97
-
98
- /**
99
- * Default gesture offset
100
- */
101
- export const GESTURE_ACTIVATION_THRESHOLD_X = 10;
102
- export const GESTURE_ACTIVATION_THRESHOLD_Y = 10;
103
- export const GESTURE_FAIL_TOLERANCE_X = 15;
104
- export const GESTURE_FAIL_TOLERANCE_Y = 20;
105
- export const DEFAULT_EDGE_DISTANCE_HORIZONTAL = 50;
106
- export const DEFAULT_EDGE_DISTANCE_VERTICAL = 135;
107
- export const DEFAULT_ACTIVATION_AREA = "screen" as const;
@@ -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.provider";
8
+ import { useScreenStyles } from "../../providers/screen/styles.provider";
9
9
 
10
10
  type Props = {
11
11
  id?: string;
@@ -16,7 +16,7 @@ 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, ancestorStylesMaps } = useTransitionStyles();
19
+ const { stylesMap, ancestorStylesMaps } = useScreenStyles();
20
20
  const showAfterFirstFrame = useSharedValue(false);
21
21
 
22
22
  useDerivedValue(() => {
@@ -0,0 +1,28 @@
1
+ import { useFrameCallback } from "react-native-reanimated";
2
+ import type { BaseDescriptor } from "../../providers/screen/keys.provider";
3
+ import useStableCallback from "../use-stable-callback";
4
+
5
+ export const useHighRefreshRate = (current: BaseDescriptor) => {
6
+ // Force display to run at max refresh rate during transitions only
7
+ const enableHighRefreshRate =
8
+ current.options.experimental_enableHighRefreshRate ?? false;
9
+
10
+ const frameCallback = useFrameCallback(() => {}, false);
11
+
12
+ const activateHighRefreshRate = useStableCallback(() => {
13
+ if (enableHighRefreshRate) {
14
+ frameCallback.setActive(true);
15
+ }
16
+ });
17
+
18
+ const deactivateHighRefreshRate = useStableCallback(() => {
19
+ if (enableHighRefreshRate) {
20
+ frameCallback.setActive(false);
21
+ }
22
+ });
23
+
24
+ return {
25
+ activateHighRefreshRate,
26
+ deactivateHighRefreshRate,
27
+ };
28
+ };
@@ -1,39 +1,37 @@
1
- import type { ParamListBase, RouteProp } from "@react-navigation/native";
2
1
  import { useMemo } from "react";
3
2
  import { useWindowDimensions } from "react-native";
4
3
  import { type SharedValue, useDerivedValue } from "react-native-reanimated";
5
4
  import { useSafeAreaInsets } from "react-native-safe-area-context";
6
5
  import type { NativeStackScreenTransitionConfig } from "../../../native-stack/types";
7
6
  import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../constants";
8
- import { useFlagsContext } from "../../providers/flags.provider";
9
7
  import {
10
- type TransitionDescriptor,
8
+ type BaseDescriptor,
9
+ type BaseRoute,
11
10
  useKeys,
12
- } from "../../providers/keys.provider";
13
- import { useStackAnimationValues } from "../../providers/routes.provider";
11
+ } from "../../providers/screen/keys.provider";
14
12
  import { AnimationStore } from "../../stores/animation.store";
15
13
  import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
16
14
  import type {
17
15
  ScreenInterpolationProps,
18
16
  ScreenTransitionState,
19
17
  } from "../../types/animation.types";
20
- import type { ScreenTransitionConfig } from "../../types/core.types";
21
- import { computeStackProgress } from "../../utils/animation/compute-stack-progress";
18
+ import type { ScreenTransitionConfig } from "../../types/screen.types";
22
19
  import { derivations } from "../../utils/animation/derivations";
23
20
  import { createBounds } from "../../utils/bounds";
21
+ import { useStack } from "../navigation/use-stack";
24
22
 
25
23
  type BuiltState = {
26
24
  progress: SharedValue<number>;
27
25
  closing: SharedValue<number>;
28
26
  animating: SharedValue<number>;
29
27
  gesture: GestureStoreMap;
30
- route: RouteProp<ParamListBase>;
28
+ route: BaseRoute;
31
29
  meta?: Record<string, unknown>;
32
30
  unwrapped: ScreenTransitionState;
33
31
  };
34
32
 
35
33
  const createScreenTransitionState = (
36
- route: RouteProp<ParamListBase>,
34
+ route: BaseRoute,
37
35
  meta?: Record<string, unknown>,
38
36
  ): ScreenTransitionState => ({
39
37
  progress: 0,
@@ -71,7 +69,7 @@ const unwrapInto = (s: BuiltState): ScreenTransitionState => {
71
69
  };
72
70
 
73
71
  const useBuildScreenTransitionState = (
74
- descriptor: TransitionDescriptor | undefined,
72
+ descriptor: BaseDescriptor | undefined,
75
73
  ): BuiltState | undefined => {
76
74
  const key = descriptor?.route.key;
77
75
  const meta = descriptor?.options?.meta;
@@ -101,10 +99,12 @@ const hasTransitionsEnabled = (
101
99
  };
102
100
 
103
101
  export function _useScreenAnimation() {
104
- const dimensions = useWindowDimensions();
102
+ const windowDimensions = useWindowDimensions();
103
+ const dimensions = windowDimensions;
104
+
105
105
  const insets = useSafeAreaInsets();
106
- const flags = useFlagsContext();
107
- const transitionsAlwaysOn = flags?.TRANSITIONS_ALWAYS_ON ?? false;
106
+ const { flags, stackProgress: rootStackProgress, routeKeys } = useStack();
107
+ const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
108
108
 
109
109
  const {
110
110
  current: currentDescriptor,
@@ -117,7 +117,7 @@ export function _useScreenAnimation() {
117
117
  const prevAnimation = useBuildScreenTransitionState(previousDescriptor);
118
118
 
119
119
  const currentRouteKey = currentDescriptor?.route?.key;
120
- const stackAnimationValues = useStackAnimationValues(currentRouteKey);
120
+ const currentIndex = routeKeys.indexOf(currentRouteKey);
121
121
 
122
122
  const screenInterpolatorProps = useDerivedValue<
123
123
  Omit<ScreenInterpolationProps, "bounds">
@@ -137,11 +137,16 @@ export function _useScreenAnimation() {
137
137
  : DEFAULT_SCREEN_TRANSITION_STATE;
138
138
 
139
139
  const { progress, ...helpers } = derivations({
140
+ previous,
140
141
  current,
141
142
  next,
142
143
  });
143
144
 
144
- const stackProgress = computeStackProgress(stackAnimationValues, progress);
145
+ // Compute relative stack progress: total - currentIndex
146
+ // This gives us the sum of progress values from current screen onwards
147
+ // Falls back to current progress if index is invalid
148
+ const stackProgress =
149
+ currentIndex >= 0 ? rootStackProgress.value - currentIndex : progress;
145
150
 
146
151
  return {
147
152
  layouts: { screen: dimensions },
@@ -22,10 +22,9 @@ import type {
22
22
  GestureContextType,
23
23
  ScrollConfig,
24
24
  } from "../../providers/gestures.provider";
25
- import { useKeys } from "../../providers/keys.provider";
25
+ import { useKeys } from "../../providers/screen/keys.provider";
26
26
  import { AnimationStore } from "../../stores/animation.store";
27
27
  import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
28
-
29
28
  import {
30
29
  type GestureDirection,
31
30
  GestureOffsetState,
@@ -5,7 +5,6 @@ import type { LayoutChangeEvent } from "react-native";
5
5
  import { useAnimatedScrollHandler } from "react-native-reanimated";
6
6
  import type { ReanimatedScrollEvent } from "react-native-reanimated/lib/typescript/hook/commonTypes";
7
7
  import { useGestureContext } from "../../providers/gestures.provider";
8
- import type { Any } from "../../types/utils.types";
9
8
  import useStableCallback from "../use-stable-callback";
10
9
 
11
10
  interface ScrollProgressHookProps {
@@ -34,7 +33,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
34
33
  onScroll: (event) => {
35
34
  props.onScroll?.(event);
36
35
 
37
- const updateScrollPosition = (v: Any) => {
36
+ const updateScrollPosition = (v: any) => {
38
37
  "worklet";
39
38
  if (v === null) {
40
39
  return {
@@ -64,7 +63,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
64
63
  (width: number, height: number) => {
65
64
  props.onContentSizeChange?.(width, height);
66
65
 
67
- const updateContentSize = (v: Any) => {
66
+ const updateContentSize = (v: any) => {
68
67
  "worklet";
69
68
  if (v === null) {
70
69
  return {
@@ -93,7 +92,7 @@ export const useScrollRegistry = (props: ScrollProgressHookProps) => {
93
92
  props.onLayout?.(event);
94
93
  const { width, height } = event.nativeEvent.layout;
95
94
 
96
- const updateLayout = (v: Any) => {
95
+ const updateLayout = (v: any) => {
97
96
  "worklet";
98
97
  if (v === null) {
99
98
  return {
@@ -1,6 +1,6 @@
1
1
  import { useMemo, useRef } from "react";
2
2
  import { useSharedValue } from "react-native-reanimated";
3
- import useStableCallback from "../../../../shared/hooks/use-stable-callback";
3
+ import useStableCallback from "../use-stable-callback";
4
4
 
5
5
  export const useClosingRouteKeys = () => {
6
6
  const keysRef = useRef<Set<string>>(new Set());
@@ -0,0 +1,100 @@
1
+ import type { Route } from "@react-navigation/native";
2
+ import { createContext, useContext } from "react";
3
+ import type { DerivedValue } from "react-native-reanimated";
4
+ import type {
5
+ ContainerOverlayProps,
6
+ OverlayMode,
7
+ OverlayProps,
8
+ } from "../../types/overlay.types";
9
+ import type {
10
+ BaseStackDescriptor,
11
+ BaseStackNavigation,
12
+ BaseStackRoute,
13
+ BaseStackScene,
14
+ } from "../../types/stack.types";
15
+
16
+ /**
17
+ * Stack descriptor with overlay options.
18
+ * Extends BaseStackDescriptor with overlay-specific options.
19
+ */
20
+ export interface StackDescriptor<
21
+ TRoute extends BaseStackRoute = Route<string>,
22
+ TNavigation extends BaseStackNavigation = BaseStackNavigation,
23
+ > extends BaseStackDescriptor<TRoute, TNavigation> {
24
+ options: BaseStackDescriptor["options"] & {
25
+ overlay?:
26
+ | ((props: OverlayProps) => React.ReactNode)
27
+ | ((props: ContainerOverlayProps) => React.ReactNode);
28
+ overlayMode?: OverlayMode;
29
+ overlayShown?: boolean;
30
+ meta?: Record<string, unknown>;
31
+ enableTransitions?: boolean;
32
+ };
33
+ }
34
+
35
+ /**
36
+ * Scene type for stack context (route + descriptor pair).
37
+ */
38
+ export type StackScene<TDescriptor extends StackDescriptor = StackDescriptor> =
39
+ BaseStackScene<TDescriptor>;
40
+
41
+ /**
42
+ * Common stack context value that both managed and direct stack providers populate.
43
+ * Used by overlays and shared components that need stack progress info.
44
+ */
45
+ export interface StackContextValue {
46
+ /**
47
+ * Stack flags.
48
+ */
49
+ flags: {
50
+ TRANSITIONS_ALWAYS_ON: boolean;
51
+ };
52
+ /**
53
+ * Route keys for all routes in the stack.
54
+ */
55
+ routeKeys: string[];
56
+ /**
57
+ * All routes in the stack.
58
+ */
59
+ routes: Route<string>[];
60
+ /**
61
+ * Descriptor map for all routes.
62
+ */
63
+ descriptors: Record<string, StackDescriptor>;
64
+ /**
65
+ * Pre-computed scenes (route + descriptor pairs).
66
+ */
67
+ scenes: StackScene[];
68
+ /**
69
+ * The current focused index from navigation state.
70
+ */
71
+ focusedIndex: number;
72
+ /**
73
+ * Aggregated stack progress across all routes.
74
+ * Sum of all individual screen progress values.
75
+ * When 4 screens are fully visible, stackProgress = 4.
76
+ */
77
+ stackProgress: DerivedValue<number>;
78
+ /**
79
+ * Focused index that accounts for closing screens.
80
+ * Returns currentIndex - 1 if any screen is closing, otherwise currentIndex.
81
+ */
82
+ optimisticFocusedIndex: DerivedValue<number>;
83
+ }
84
+
85
+ export const StackContext = createContext<StackContextValue | null>(null);
86
+ StackContext.displayName = "Stack";
87
+
88
+ /**
89
+ * Hook to access common stack context values.
90
+ * Works in both blank-stack and native-stack navigators.
91
+ */
92
+ export function useStack<T extends StackContextValue = StackContextValue>(): T {
93
+ const context = useContext(StackContext);
94
+
95
+ if (context === null) {
96
+ throw new Error("useStack must be used within a Stack provider");
97
+ }
98
+
99
+ return context as T;
100
+ }
@@ -23,9 +23,13 @@ export { useScreenGesture } from "./hooks/gestures/use-screen-gesture";
23
23
 
24
24
  export type {
25
25
  AnimationConfig,
26
+ BoundEntry,
27
+ BoundsLink,
28
+ ContainerOverlayProps,
26
29
  OverlayInterpolationProps,
30
+ OverlayMode,
31
+ OverlayProps,
27
32
  ScreenInterpolationProps,
28
33
  ScreenStyleInterpolator,
29
- } from "./types/animation.types";
30
- export type { BoundEntry, BoundsLink } from "./types/bounds.types";
31
- export type { ScreenTransitionConfig } from "./types/core.types";
34
+ ScreenTransitionConfig,
35
+ } from "./types";
@@ -8,7 +8,7 @@ import { useSharedValue } from "react-native-reanimated";
8
8
  import { useBuildGestures } from "../hooks/gestures/use-build-gestures";
9
9
  import type { GestureStoreMap } from "../stores/gesture.store";
10
10
  import createProvider from "../utils/create-provider";
11
- import { useKeys } from "./keys.provider";
11
+ import { useKeys } from "./screen/keys.provider";
12
12
 
13
13
  export type ScrollConfig = {
14
14
  x: number;
@@ -29,11 +29,15 @@ export interface GestureContextType {
29
29
  gestureEnabled: boolean;
30
30
  }
31
31
 
32
+ interface ScreenGestureProviderProps {
33
+ children: React.ReactNode;
34
+ }
35
+
32
36
  export const {
33
37
  ScreenGestureProvider,
34
38
  useScreenGestureContext: useGestureContext,
35
39
  } = createProvider("ScreenGesture", { guarded: false })<
36
- { children: React.ReactNode },
40
+ ScreenGestureProviderProps,
37
41
  GestureContextType
38
42
  >(({ children }) => {
39
43
  const { current } = useKeys();
@@ -17,7 +17,7 @@ import { AnimationStore } from "../stores/animation.store";
17
17
  import { BoundStore } from "../stores/bounds.store";
18
18
  import { prepareStyleForBounds } from "../utils/bounds/helpers/styles";
19
19
  import createProvider from "../utils/create-provider";
20
- import { type TransitionDescriptor, useKeys } from "./keys.provider";
20
+ import { type BaseDescriptor, useKeys } from "./screen/keys.provider";
21
21
 
22
22
  interface MaybeMeasureAndStoreParams {
23
23
  onPress?: ((...args: unknown[]) => void) | undefined;
@@ -47,19 +47,26 @@ interface RegisterBoundsContextValue {
47
47
  * Returns an array of screen keys from immediate parent to root.
48
48
  * [parentKey, grandparentKey, greatGrandparentKey, ...]
49
49
  */
50
- const getAncestorKeys = (current: TransitionDescriptor): string[] => {
50
+ const getAncestorKeys = (current: BaseDescriptor): string[] => {
51
51
  const ancestors: string[] = [];
52
- let nav = current.navigation.getParent();
52
+ const nav = current.navigation as any;
53
53
 
54
- while (nav) {
55
- const state = nav.getState();
54
+ // Safety check for component-stack which doesn't have getParent
55
+ if (typeof nav?.getParent !== "function") {
56
+ return ancestors;
57
+ }
58
+
59
+ let parent = nav.getParent();
60
+
61
+ while (parent) {
62
+ const state = parent.getState();
56
63
  if (state?.routes && state.index !== undefined) {
57
64
  const focusedRoute = state.routes[state.index];
58
65
  if (focusedRoute?.key) {
59
66
  ancestors.push(focusedRoute.key);
60
67
  }
61
68
  }
62
- nav = nav.getParent();
69
+ parent = parent.getParent();
63
70
  }
64
71
 
65
72
  return ancestors;
@@ -0,0 +1,72 @@
1
+ import type {
2
+ Descriptor,
3
+ NavigationProp,
4
+ ParamListBase,
5
+ RouteProp,
6
+ } from "@react-navigation/native";
7
+ import { createContext, useContext, useMemo } from "react";
8
+ import type { ScreenTransitionConfig } from "../../types/screen.types";
9
+ import type {
10
+ BaseStackDescriptor,
11
+ BaseStackNavigation,
12
+ BaseStackRoute,
13
+ } from "../../types/stack.types";
14
+
15
+ // Re-export for backward compatibility
16
+ export type { BaseStackNavigation as BaseNavigation };
17
+ export type { BaseStackRoute as BaseRoute };
18
+
19
+ /**
20
+ * Base descriptor interface - minimal contract for all stack types.
21
+ * This allows component-stack, blank-stack, and native-stack to all
22
+ * work with the shared providers without tight coupling to React Navigation.
23
+ */
24
+ export type BaseDescriptor = BaseStackDescriptor;
25
+
26
+ /**
27
+ * React Navigation specific descriptor - extends base with full typing
28
+ */
29
+ export type TransitionDescriptor = Descriptor<
30
+ ScreenTransitionConfig,
31
+ NavigationProp<ParamListBase>,
32
+ RouteProp<ParamListBase>
33
+ >;
34
+
35
+ interface KeysContextType<TDescriptor extends BaseDescriptor = BaseDescriptor> {
36
+ previous?: TDescriptor;
37
+ current: TDescriptor;
38
+ next?: TDescriptor;
39
+ }
40
+
41
+ const KeysContext = createContext<KeysContextType | undefined>(undefined);
42
+
43
+ interface KeysProviderProps<TDescriptor extends BaseDescriptor> {
44
+ children: React.ReactNode;
45
+ previous?: TDescriptor;
46
+ current: TDescriptor;
47
+ next?: TDescriptor;
48
+ }
49
+
50
+ export function KeysProvider<TDescriptor extends BaseDescriptor>({
51
+ children,
52
+ previous,
53
+ current,
54
+ next,
55
+ }: KeysProviderProps<TDescriptor>) {
56
+ const value = useMemo<KeysContextType<TDescriptor>>(
57
+ () => ({ previous, current, next }),
58
+ [previous, current, next],
59
+ );
60
+
61
+ return <KeysContext.Provider value={value}>{children}</KeysContext.Provider>;
62
+ }
63
+
64
+ export function useKeys<
65
+ TDescriptor extends BaseDescriptor = BaseDescriptor,
66
+ >(): KeysContextType<TDescriptor> {
67
+ const context = useContext(KeysContext);
68
+ if (context === undefined) {
69
+ throw new Error("useKeys must be used within a KeysProvider");
70
+ }
71
+ return context as KeysContextType<TDescriptor>;
72
+ }
@@ -0,0 +1,38 @@
1
+ import type React from "react";
2
+ import type { ComponentType } from "react";
3
+ import { RootTransitionAware } from "../../components/root-transition-aware";
4
+ import { ScreenGestureProvider } from "../gestures.provider";
5
+ import { type BaseDescriptor, KeysProvider } from "./keys.provider";
6
+ import { ScreenStylesProvider } from "./styles.provider";
7
+
8
+ type Props<TDescriptor extends BaseDescriptor> = {
9
+ previous?: TDescriptor;
10
+ current: TDescriptor;
11
+ next?: TDescriptor;
12
+ children: React.ReactNode;
13
+ LifecycleController: ComponentType<any>;
14
+ };
15
+
16
+ export function ScreenComposer<TDescriptor extends BaseDescriptor>({
17
+ previous,
18
+ current,
19
+ next,
20
+ children,
21
+ LifecycleController,
22
+ }: Props<TDescriptor>) {
23
+ return (
24
+ <KeysProvider<TDescriptor>
25
+ previous={previous}
26
+ current={current}
27
+ next={next}
28
+ >
29
+ <ScreenGestureProvider>
30
+ <LifecycleController>
31
+ <ScreenStylesProvider>
32
+ <RootTransitionAware>{children}</RootTransitionAware>
33
+ </ScreenStylesProvider>
34
+ </LifecycleController>
35
+ </ScreenGestureProvider>
36
+ </KeysProvider>
37
+ );
38
+ }