react-native-screen-transitions 3.1.0 → 3.2.0-beta.1

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 (586) hide show
  1. package/README.md +103 -8
  2. package/lib/commonjs/blank-stack/components/adjusted-screen-container.js +36 -0
  3. package/lib/commonjs/blank-stack/components/adjusted-screen-container.js.map +1 -0
  4. package/lib/commonjs/blank-stack/components/{screens.js → adjusted-screen.js} +33 -13
  5. package/lib/commonjs/blank-stack/components/adjusted-screen.js.map +1 -0
  6. package/lib/commonjs/blank-stack/components/stack-view.js +44 -61
  7. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  8. package/lib/commonjs/blank-stack/components/stack-view.native.js +81 -0
  9. package/lib/commonjs/blank-stack/components/stack-view.native.js.map +1 -0
  10. package/lib/commonjs/component-stack/components/component-screen-container.js +23 -0
  11. package/lib/commonjs/component-stack/components/component-screen-container.js.map +1 -0
  12. package/lib/commonjs/component-stack/components/component-screen.js +36 -0
  13. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -0
  14. package/lib/commonjs/component-stack/components/stack-view.js +64 -0
  15. package/lib/commonjs/component-stack/components/stack-view.js.map +1 -0
  16. package/lib/commonjs/component-stack/index.js +13 -0
  17. package/lib/commonjs/component-stack/index.js.map +1 -0
  18. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +52 -0
  19. package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -0
  20. package/lib/commonjs/component-stack/types.js.map +1 -0
  21. package/lib/commonjs/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  22. package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  23. package/lib/commonjs/native-stack/views/NativeStackView.native.js +114 -117
  24. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  25. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  26. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +39 -0
  27. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  28. package/lib/commonjs/shared/components/overlay/index.js +13 -0
  29. package/lib/commonjs/shared/components/overlay/index.js.map +1 -0
  30. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +51 -0
  31. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -0
  32. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +124 -0
  33. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -0
  34. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +47 -0
  35. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -0
  36. package/lib/commonjs/shared/components/root-transition-aware.js +2 -2
  37. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  38. package/lib/commonjs/shared/constants.js +4 -31
  39. package/lib/commonjs/shared/constants.js.map +1 -1
  40. package/lib/commonjs/shared/{components/controllers/blank-stack-lifecycle.js → controller/managed-lifecycle.js} +25 -19
  41. package/lib/commonjs/shared/controller/managed-lifecycle.js.map +1 -0
  42. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
  43. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  44. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js +36 -0
  45. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  46. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +18 -11
  47. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  48. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +4 -2
  49. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  50. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  51. package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  52. package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  53. package/lib/commonjs/shared/hooks/navigation/use-previous.js.map +1 -0
  54. package/lib/commonjs/shared/hooks/navigation/use-stack.js +37 -0
  55. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -0
  56. package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js +5 -0
  57. package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -1
  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/layout-anchor.provider.js +73 -0
  61. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -0
  62. package/lib/commonjs/shared/providers/register-bounds.provider.js +19 -8
  63. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  64. package/lib/commonjs/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  65. package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -0
  66. package/lib/commonjs/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +7 -7
  67. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -0
  68. package/lib/commonjs/shared/providers/screen/styles.provider.js +95 -0
  69. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
  70. package/lib/commonjs/shared/providers/stack/core.provider.js +84 -0
  71. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
  72. package/lib/commonjs/shared/providers/stack/direct.provider.js +160 -0
  73. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -0
  74. 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
  75. package/lib/commonjs/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  76. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js +93 -0
  77. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  78. package/lib/commonjs/shared/providers/stack/managed.provider.js +157 -0
  79. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -0
  80. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
  81. package/lib/commonjs/shared/types/index.js +19 -0
  82. package/lib/commonjs/shared/types/index.js.map +1 -0
  83. package/lib/commonjs/shared/types/overlay.types.js +6 -0
  84. package/lib/commonjs/shared/types/overlay.types.js.map +1 -0
  85. package/lib/commonjs/shared/types/{core.types.js → screen.types.js} +1 -1
  86. package/lib/commonjs/shared/types/screen.types.js.map +1 -0
  87. package/lib/commonjs/shared/types/stack.types.js +32 -0
  88. package/lib/commonjs/shared/types/stack.types.js.map +1 -0
  89. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
  90. package/lib/commonjs/shared/utils/bounds/index.js +13 -1
  91. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  92. package/lib/commonjs/shared/utils/create-provider.js +16 -13
  93. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  94. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  95. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js +51 -0
  96. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  97. package/lib/commonjs/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  98. package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +1 -0
  99. package/lib/commonjs/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  100. package/lib/commonjs/shared/utils/navigation/routes-are-identical.js.map +1 -0
  101. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +70 -0
  102. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  103. package/lib/commonjs/shared/utils/read-shared-value.js +17 -0
  104. package/lib/commonjs/shared/utils/read-shared-value.js.map +1 -0
  105. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -1
  106. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
  107. package/lib/module/blank-stack/components/adjusted-screen-container.js +31 -0
  108. package/lib/module/blank-stack/components/adjusted-screen-container.js.map +1 -0
  109. package/lib/module/blank-stack/components/{screens.js → adjusted-screen.js} +32 -12
  110. package/lib/module/blank-stack/components/adjusted-screen.js.map +1 -0
  111. package/lib/module/blank-stack/components/stack-view.js +43 -60
  112. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  113. package/lib/module/blank-stack/components/stack-view.native.js +76 -0
  114. package/lib/module/blank-stack/components/stack-view.native.js.map +1 -0
  115. package/lib/module/component-stack/components/component-screen-container.js +18 -0
  116. package/lib/module/component-stack/components/component-screen-container.js.map +1 -0
  117. package/lib/module/component-stack/components/component-screen.js +30 -0
  118. package/lib/module/component-stack/components/component-screen.js.map +1 -0
  119. package/lib/module/component-stack/components/stack-view.js +59 -0
  120. package/lib/module/component-stack/components/stack-view.js.map +1 -0
  121. package/lib/module/component-stack/index.js +4 -0
  122. package/lib/module/component-stack/index.js.map +1 -0
  123. package/lib/module/component-stack/navigators/create-component-stack-navigator.js +48 -0
  124. package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -0
  125. package/lib/module/component-stack/types.js.map +1 -0
  126. package/lib/module/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  127. package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  128. package/lib/module/native-stack/views/NativeStackView.native.js +115 -118
  129. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  130. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  131. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +35 -0
  132. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  133. package/lib/module/shared/components/overlay/index.js +9 -0
  134. package/lib/module/shared/components/overlay/index.js.map +1 -0
  135. package/lib/module/shared/components/overlay/variations/float-overlay.js +48 -0
  136. package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -0
  137. package/lib/module/shared/components/overlay/variations/overlay-host.js +120 -0
  138. package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -0
  139. package/lib/module/shared/components/overlay/variations/screen-overlay.js +44 -0
  140. package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +1 -0
  141. package/lib/module/shared/components/root-transition-aware.js +2 -2
  142. package/lib/module/shared/components/root-transition-aware.js.map +1 -1
  143. package/lib/module/shared/constants.js +2 -29
  144. package/lib/module/shared/constants.js.map +1 -1
  145. package/lib/module/shared/controller/managed-lifecycle.js +72 -0
  146. package/lib/module/shared/controller/managed-lifecycle.js.map +1 -0
  147. package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
  148. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  149. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js +31 -0
  150. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  151. package/lib/module/shared/hooks/animation/use-screen-animation.js +18 -11
  152. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  153. package/lib/module/shared/hooks/gestures/use-build-gestures.js +5 -3
  154. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  155. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  156. package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  157. package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  158. package/lib/module/shared/hooks/navigation/use-previous.js.map +1 -0
  159. package/lib/module/shared/hooks/navigation/use-stack.js +33 -0
  160. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -0
  161. package/lib/module/shared/hooks/reanimated/use-shared-value-state.js +5 -0
  162. package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -1
  163. package/lib/module/shared/providers/gestures.provider.js +1 -1
  164. package/lib/module/shared/providers/gestures.provider.js.map +1 -1
  165. package/lib/module/shared/providers/layout-anchor.provider.js +67 -0
  166. package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -0
  167. package/lib/module/shared/providers/register-bounds.provider.js +19 -8
  168. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  169. package/lib/module/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  170. package/lib/module/shared/providers/screen/keys.provider.js.map +1 -0
  171. package/lib/module/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +6 -6
  172. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -0
  173. package/lib/module/shared/providers/screen/styles.provider.js +90 -0
  174. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
  175. package/lib/module/shared/providers/stack/core.provider.js +78 -0
  176. package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
  177. package/lib/module/shared/providers/stack/direct.provider.js +155 -0
  178. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -0
  179. 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
  180. package/lib/module/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  181. package/lib/module/shared/providers/stack/helpers/use-local-routes.js +87 -0
  182. package/lib/module/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  183. package/lib/module/shared/providers/stack/managed.provider.js +152 -0
  184. package/lib/module/shared/providers/stack/managed.provider.js.map +1 -0
  185. package/lib/module/shared/stores/bounds.store.js.map +1 -1
  186. package/lib/module/shared/types/index.js +4 -0
  187. package/lib/module/shared/types/index.js.map +1 -0
  188. package/lib/module/shared/types/overlay.types.js +4 -0
  189. package/lib/module/shared/types/overlay.types.js.map +1 -0
  190. package/lib/module/shared/types/screen.types.js +4 -0
  191. package/lib/module/shared/types/screen.types.js.map +1 -0
  192. package/lib/module/shared/types/stack.types.js +33 -0
  193. package/lib/module/shared/types/stack.types.js.map +1 -0
  194. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
  195. package/lib/module/shared/utils/bounds/index.js +13 -1
  196. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  197. package/lib/module/shared/utils/create-provider.js +16 -13
  198. package/lib/module/shared/utils/create-provider.js.map +1 -1
  199. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  200. package/lib/module/shared/utils/navigation/align-routes-with-latest.js +46 -0
  201. package/lib/module/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  202. package/lib/module/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  203. package/lib/module/shared/utils/navigation/compose-descriptors.js.map +1 -0
  204. package/lib/module/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  205. package/lib/module/shared/utils/navigation/routes-are-identical.js.map +1 -0
  206. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +65 -0
  207. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  208. package/lib/module/shared/utils/read-shared-value.js +14 -0
  209. package/lib/module/shared/utils/read-shared-value.js.map +1 -0
  210. package/lib/module/shared/utils/reset-stores-for-screen.js +2 -2
  211. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
  212. package/lib/typescript/blank-stack/components/adjusted-screen-container.d.ts +6 -0
  213. package/lib/typescript/blank-stack/components/adjusted-screen-container.d.ts.map +1 -0
  214. package/lib/typescript/blank-stack/components/{screens.d.ts → adjusted-screen.d.ts} +2 -2
  215. package/lib/typescript/blank-stack/components/adjusted-screen.d.ts.map +1 -0
  216. package/lib/typescript/blank-stack/components/stack-view.d.ts +2 -1
  217. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  218. package/lib/typescript/blank-stack/components/stack-view.native.d.ts +4 -0
  219. package/lib/typescript/blank-stack/components/stack-view.native.d.ts.map +1 -0
  220. package/lib/typescript/blank-stack/types.d.ts +10 -49
  221. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  222. package/lib/typescript/component-stack/components/component-screen-container.d.ts +6 -0
  223. package/lib/typescript/component-stack/components/component-screen-container.d.ts.map +1 -0
  224. package/lib/typescript/component-stack/components/component-screen.d.ts +8 -0
  225. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -0
  226. package/lib/typescript/component-stack/components/stack-view.d.ts +4 -0
  227. package/lib/typescript/component-stack/components/stack-view.d.ts.map +1 -0
  228. package/lib/typescript/component-stack/index.d.ts +3 -0
  229. package/lib/typescript/component-stack/index.d.ts.map +1 -0
  230. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +16 -0
  231. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -0
  232. package/lib/typescript/component-stack/types.d.ts +39 -0
  233. package/lib/typescript/component-stack/types.d.ts.map +1 -0
  234. package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +1 -0
  235. package/lib/typescript/native-stack/index.d.ts +1 -1
  236. package/lib/typescript/native-stack/index.d.ts.map +1 -1
  237. package/lib/typescript/native-stack/types.d.ts +9 -6
  238. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  239. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts +2 -10
  240. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  241. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  242. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +11 -0
  243. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -0
  244. package/lib/typescript/shared/components/overlay/index.d.ts +7 -0
  245. package/lib/typescript/shared/components/overlay/index.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 +2 -16
  256. package/lib/typescript/shared/constants.d.ts.map +1 -1
  257. package/lib/typescript/shared/controller/managed-lifecycle.d.ts +9 -0
  258. package/lib/typescript/shared/controller/managed-lifecycle.d.ts.map +1 -0
  259. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +13 -0
  260. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts.map +1 -0
  261. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts +2 -1
  262. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  263. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  264. package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
  265. package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +1 -0
  266. package/lib/typescript/shared/hooks/navigation/use-previous.d.ts.map +1 -0
  267. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +66 -0
  268. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
  269. package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -1
  270. package/lib/typescript/shared/index.d.ts +41 -43
  271. package/lib/typescript/shared/index.d.ts.map +1 -1
  272. package/lib/typescript/shared/providers/gestures.provider.d.ts +4 -2
  273. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
  274. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +34 -0
  275. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -0
  276. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  277. package/lib/typescript/shared/providers/screen/keys.provider.d.ts +29 -0
  278. package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -0
  279. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +13 -0
  280. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -0
  281. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +13 -0
  282. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -0
  283. package/lib/typescript/shared/providers/stack/core.provider.d.ts +22 -0
  284. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -0
  285. package/lib/typescript/shared/providers/stack/direct.provider.d.ts +34 -0
  286. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -0
  287. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts +9 -0
  288. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts.map +1 -0
  289. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts +19 -0
  290. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts.map +1 -0
  291. package/lib/typescript/shared/providers/stack/managed.provider.d.ts +39 -0
  292. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -0
  293. package/lib/typescript/shared/stores/animation.store.d.ts +1 -1
  294. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  295. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
  296. package/lib/typescript/shared/stores/gesture.store.d.ts +2 -2
  297. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  298. package/lib/typescript/shared/types/animation.types.d.ts +3 -3
  299. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  300. package/lib/typescript/shared/types/bounds.types.d.ts +1 -0
  301. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  302. package/lib/typescript/shared/types/gesture.types.d.ts +0 -1
  303. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  304. package/lib/typescript/shared/types/index.d.ts +8 -0
  305. package/lib/typescript/shared/types/index.d.ts.map +1 -0
  306. package/lib/typescript/shared/types/overlay.types.d.ts +39 -0
  307. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -0
  308. package/lib/typescript/shared/types/{core.types.d.ts → screen.types.d.ts} +31 -6
  309. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -0
  310. package/lib/typescript/shared/types/stack.types.d.ts +55 -0
  311. package/lib/typescript/shared/types/stack.types.d.ts.map +1 -0
  312. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +1 -1
  313. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  314. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +2 -1
  315. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  316. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts +1 -2
  317. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -1
  318. package/lib/typescript/shared/utils/bounds/index.d.ts +1 -9
  319. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  320. package/lib/typescript/shared/utils/bounds/types/builder.d.ts +9 -8
  321. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -1
  322. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts +2 -1
  323. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -1
  324. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  325. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +1 -1
  326. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  327. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts +13 -0
  328. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts.map +1 -0
  329. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts +2 -0
  330. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts.map +1 -0
  331. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts +6 -0
  332. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +1 -0
  333. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts +6 -0
  334. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts.map +1 -0
  335. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts +6 -0
  336. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts.map +1 -0
  337. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +21 -0
  338. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -0
  339. package/lib/typescript/shared/utils/read-shared-value.d.ts +7 -0
  340. package/lib/typescript/shared/utils/read-shared-value.d.ts.map +1 -0
  341. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +4 -3
  342. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
  343. package/package.json +7 -2
  344. package/src/blank-stack/components/adjusted-screen-container.tsx +25 -0
  345. package/src/blank-stack/components/{screens.tsx → adjusted-screen.tsx} +35 -14
  346. package/src/blank-stack/components/stack-view.native.tsx +94 -0
  347. package/src/blank-stack/components/stack-view.tsx +60 -74
  348. package/src/blank-stack/types.ts +12 -63
  349. package/src/component-stack/components/component-screen-container.tsx +15 -0
  350. package/src/component-stack/components/component-screen.tsx +40 -0
  351. package/src/component-stack/components/stack-view.tsx +74 -0
  352. package/src/component-stack/index.ts +10 -0
  353. package/src/component-stack/navigators/create-component-stack-navigator.tsx +88 -0
  354. package/src/component-stack/types.ts +101 -0
  355. package/src/{shared/components → native-stack}/controllers/native-stack-lifecycle.tsx +18 -11
  356. package/src/native-stack/index.ts +1 -0
  357. package/src/native-stack/types.ts +11 -7
  358. package/src/native-stack/views/NativeStackView.native.tsx +138 -167
  359. package/src/shared/__tests__/sync-routes-with-removed.test.ts +137 -0
  360. package/src/shared/components/create-transition-aware-component.tsx +5 -6
  361. package/src/shared/components/overlay/helpers/get-active-overlay.ts +38 -0
  362. package/src/shared/components/overlay/index.ts +7 -0
  363. package/src/shared/components/overlay/variations/float-overlay.tsx +44 -0
  364. package/src/shared/components/overlay/variations/overlay-host.tsx +148 -0
  365. package/src/shared/components/overlay/variations/screen-overlay.tsx +51 -0
  366. package/src/shared/components/root-transition-aware.tsx +2 -2
  367. package/src/shared/configs/presets.ts +1 -1
  368. package/src/shared/constants.ts +3 -32
  369. package/src/shared/controller/managed-lifecycle.tsx +73 -0
  370. package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
  371. package/src/shared/hooks/animation/use-high-refresh-rate.tsx +34 -0
  372. package/src/shared/hooks/animation/use-screen-animation.tsx +24 -18
  373. package/src/shared/hooks/gestures/use-build-gestures.tsx +10 -3
  374. package/src/shared/hooks/gestures/use-scroll-registry.tsx +3 -4
  375. package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.tsx +1 -1
  376. package/src/shared/hooks/navigation/use-stack.tsx +89 -0
  377. package/src/shared/hooks/reanimated/use-shared-value-state.ts +5 -0
  378. package/src/shared/index.ts +8 -3
  379. package/src/shared/providers/gestures.provider.tsx +6 -2
  380. package/src/shared/providers/layout-anchor.provider.tsx +81 -0
  381. package/src/shared/providers/register-bounds.provider.tsx +23 -9
  382. package/src/shared/providers/{keys.provider.tsx → screen/keys.provider.tsx} +25 -10
  383. package/src/shared/providers/screen/screen-composer.tsx +38 -0
  384. package/src/shared/providers/screen/styles.provider.tsx +120 -0
  385. package/src/shared/providers/stack/core.provider.tsx +87 -0
  386. package/src/shared/providers/stack/direct.provider.tsx +231 -0
  387. package/src/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.ts → shared/providers/stack/helpers/active-screens-limit.ts} +10 -4
  388. package/src/shared/providers/stack/helpers/use-local-routes.tsx +133 -0
  389. package/src/shared/providers/stack/managed.provider.tsx +229 -0
  390. package/src/shared/stores/animation.store.ts +1 -1
  391. package/src/shared/stores/bounds.store.ts +4 -5
  392. package/src/shared/stores/gesture.store.ts +2 -2
  393. package/src/shared/types/animation.types.ts +3 -3
  394. package/src/shared/types/bounds.types.ts +5 -0
  395. package/src/shared/types/gesture.types.ts +0 -2
  396. package/src/shared/types/index.ts +46 -0
  397. package/src/shared/types/overlay.types.ts +49 -0
  398. package/src/shared/types/{core.types.ts → screen.types.ts} +34 -7
  399. package/src/shared/types/stack.types.ts +63 -0
  400. package/src/shared/utils/bounds/helpers/geometry.ts +1 -1
  401. package/src/shared/utils/bounds/helpers/style-composers.ts +1 -1
  402. package/src/shared/utils/bounds/helpers/styles.ts +1 -2
  403. package/src/shared/utils/bounds/index.ts +19 -10
  404. package/src/shared/utils/bounds/types/builder.ts +8 -8
  405. package/src/shared/utils/bounds/types/geometry.ts +1 -1
  406. package/src/shared/utils/create-provider.tsx +14 -16
  407. package/src/shared/utils/gesture/check-gesture-activation.ts +1 -1
  408. package/src/shared/utils/navigation/align-routes-with-latest.ts +68 -0
  409. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.ts +5 -5
  410. package/src/shared/utils/navigation/compose-descriptors.ts +21 -0
  411. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.ts +6 -4
  412. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.ts +6 -4
  413. package/src/shared/utils/navigation/sync-routes-with-removed.ts +102 -0
  414. package/src/shared/utils/read-shared-value.ts +15 -0
  415. package/src/shared/utils/reset-stores-for-screen.ts +4 -3
  416. package/lib/commonjs/blank-stack/components/overlay.js +0 -156
  417. package/lib/commonjs/blank-stack/components/overlay.js.map +0 -1
  418. package/lib/commonjs/blank-stack/components/screens.js.map +0 -1
  419. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +0 -72
  420. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  421. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  422. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  423. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  424. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  425. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  426. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  427. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  428. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -196
  429. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  430. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +0 -61
  431. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  432. package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  433. package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
  434. package/lib/commonjs/native-stack/views/FooterComponent.js.map +0 -1
  435. package/lib/commonjs/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  436. package/lib/commonjs/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  437. package/lib/commonjs/shared/providers/flags.provider.js +0 -25
  438. package/lib/commonjs/shared/providers/flags.provider.js.map +0 -1
  439. package/lib/commonjs/shared/providers/keys.provider.js.map +0 -1
  440. package/lib/commonjs/shared/providers/routes.provider.js +0 -48
  441. package/lib/commonjs/shared/providers/routes.provider.js.map +0 -1
  442. package/lib/commonjs/shared/providers/screen-transition.provider.js.map +0 -1
  443. package/lib/commonjs/shared/providers/transition-styles.provider.js +0 -62
  444. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
  445. package/lib/commonjs/shared/types/core.types.js.map +0 -1
  446. package/lib/commonjs/shared/types/utils.types.js +0 -2
  447. package/lib/commonjs/shared/types/utils.types.js.map +0 -1
  448. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js +0 -20
  449. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js.map +0 -1
  450. package/lib/commonjs/shared/utils/bounds/constants.js +0 -42
  451. package/lib/commonjs/shared/utils/bounds/constants.js.map +0 -1
  452. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +0 -19
  453. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  454. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +0 -224
  455. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  456. package/lib/commonjs/shared/utils/reanimated/version.js +0 -12
  457. package/lib/commonjs/shared/utils/reanimated/version.js.map +0 -1
  458. package/lib/module/blank-stack/components/overlay.js +0 -152
  459. package/lib/module/blank-stack/components/overlay.js.map +0 -1
  460. package/lib/module/blank-stack/components/screens.js.map +0 -1
  461. package/lib/module/blank-stack/hooks/use-overlay-animation.js +0 -68
  462. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  463. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  464. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  465. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  466. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  467. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  468. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  469. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  470. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -190
  471. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  472. package/lib/module/blank-stack/utils/with-stack-navigation/index.js +0 -55
  473. package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  474. package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  475. package/lib/module/native-stack/views/FooterComponent.js +0 -13
  476. package/lib/module/native-stack/views/FooterComponent.js.map +0 -1
  477. package/lib/module/shared/components/controllers/blank-stack-lifecycle.js +0 -66
  478. package/lib/module/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  479. package/lib/module/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  480. package/lib/module/shared/providers/flags.provider.js +0 -19
  481. package/lib/module/shared/providers/flags.provider.js.map +0 -1
  482. package/lib/module/shared/providers/keys.provider.js.map +0 -1
  483. package/lib/module/shared/providers/routes.provider.js +0 -42
  484. package/lib/module/shared/providers/routes.provider.js.map +0 -1
  485. package/lib/module/shared/providers/screen-transition.provider.js.map +0 -1
  486. package/lib/module/shared/providers/transition-styles.provider.js +0 -56
  487. package/lib/module/shared/providers/transition-styles.provider.js.map +0 -1
  488. package/lib/module/shared/types/core.types.js +0 -4
  489. package/lib/module/shared/types/core.types.js.map +0 -1
  490. package/lib/module/shared/types/utils.types.js +0 -2
  491. package/lib/module/shared/types/utils.types.js.map +0 -1
  492. package/lib/module/shared/utils/animation/compute-stack-progress.js +0 -15
  493. package/lib/module/shared/utils/animation/compute-stack-progress.js.map +0 -1
  494. package/lib/module/shared/utils/bounds/constants.js +0 -37
  495. package/lib/module/shared/utils/bounds/constants.js.map +0 -1
  496. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +0 -14
  497. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  498. package/lib/module/shared/utils/gesture/apply-offset-rules.js +0 -219
  499. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  500. package/lib/module/shared/utils/reanimated/version.js +0 -7
  501. package/lib/module/shared/utils/reanimated/version.js.map +0 -1
  502. package/lib/typescript/blank-stack/components/overlay.d.ts +0 -5
  503. package/lib/typescript/blank-stack/components/overlay.d.ts.map +0 -1
  504. package/lib/typescript/blank-stack/components/screens.d.ts.map +0 -1
  505. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +0 -12
  506. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +0 -1
  507. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts +0 -3
  508. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +0 -1
  509. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts +0 -4
  510. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +0 -1
  511. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts +0 -4
  512. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +0 -1
  513. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts +0 -3
  514. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +0 -1
  515. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts +0 -3
  516. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +0 -1
  517. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.d.ts.map +0 -1
  518. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-previous.d.ts.map +0 -1
  519. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts +0 -20
  520. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +0 -1
  521. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +0 -4
  522. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +0 -1
  523. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts +0 -22
  524. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +0 -1
  525. package/lib/typescript/native-stack/views/FooterComponent.d.ts +0 -7
  526. package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +0 -1
  527. package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts +0 -8
  528. package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts.map +0 -1
  529. package/lib/typescript/shared/components/controllers/native-stack-lifecycle.d.ts.map +0 -1
  530. package/lib/typescript/shared/providers/flags.provider.d.ts +0 -10
  531. package/lib/typescript/shared/providers/flags.provider.d.ts.map +0 -1
  532. package/lib/typescript/shared/providers/keys.provider.d.ts +0 -18
  533. package/lib/typescript/shared/providers/keys.provider.d.ts.map +0 -1
  534. package/lib/typescript/shared/providers/routes.provider.d.ts +0 -19
  535. package/lib/typescript/shared/providers/routes.provider.d.ts.map +0 -1
  536. package/lib/typescript/shared/providers/screen-transition.provider.d.ts +0 -14
  537. package/lib/typescript/shared/providers/screen-transition.provider.d.ts.map +0 -1
  538. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +0 -14
  539. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +0 -1
  540. package/lib/typescript/shared/types/core.types.d.ts.map +0 -1
  541. package/lib/typescript/shared/types/utils.types.d.ts +0 -5
  542. package/lib/typescript/shared/types/utils.types.d.ts.map +0 -1
  543. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts +0 -3
  544. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts.map +0 -1
  545. package/lib/typescript/shared/utils/bounds/constants.d.ts +0 -7
  546. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +0 -1
  547. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts +0 -7
  548. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +0 -1
  549. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +0 -38
  550. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +0 -1
  551. package/lib/typescript/shared/utils/reanimated/version.d.ts +0 -2
  552. package/lib/typescript/shared/utils/reanimated/version.d.ts.map +0 -1
  553. package/src/blank-stack/components/overlay.tsx +0 -169
  554. package/src/blank-stack/hooks/use-overlay-animation.tsx +0 -86
  555. package/src/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.ts +0 -17
  556. package/src/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.tsx +0 -267
  557. package/src/blank-stack/utils/with-stack-navigation/index.tsx +0 -74
  558. package/src/blank-stack/utils/with-stack-navigation/types.ts +0 -35
  559. package/src/native-stack/views/FooterComponent.tsx +0 -10
  560. package/src/shared/components/controllers/blank-stack-lifecycle.tsx +0 -70
  561. package/src/shared/providers/flags.provider.tsx +0 -21
  562. package/src/shared/providers/routes.provider.tsx +0 -54
  563. package/src/shared/providers/screen-transition.provider.tsx +0 -41
  564. package/src/shared/providers/transition-styles.provider.tsx +0 -74
  565. package/src/shared/types/utils.types.ts +0 -4
  566. package/src/shared/utils/animation/compute-stack-progress.ts +0 -16
  567. package/src/shared/utils/bounds/constants.ts +0 -40
  568. package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +0 -24
  569. package/src/shared/utils/gesture/apply-offset-rules.ts +0 -312
  570. package/src/shared/utils/reanimated/version.ts +0 -5
  571. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  572. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  573. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  574. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  575. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  576. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  577. /package/lib/module/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  578. /package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  579. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  580. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  581. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  582. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  583. /package/lib/typescript/{shared/components → native-stack}/controllers/native-stack-lifecycle.d.ts +0 -0
  584. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.d.ts +0 -0
  585. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.d.ts +0 -0
  586. /package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.tsx +0 -0
@@ -4,16 +4,12 @@ import {
4
4
  HeaderBackContext,
5
5
  HeaderHeightContext,
6
6
  HeaderShownContext,
7
- SafeAreaProviderCompat,
8
7
  useFrameSize,
9
8
  } from "@react-navigation/elements";
10
9
  import {
11
10
  NavigationContext,
12
11
  NavigationRouteContext,
13
- type ParamListBase,
14
- type RouteProp,
15
12
  StackActions,
16
- type StackNavigationState,
17
13
  usePreventRemoveContext,
18
14
  useTheme,
19
15
  } from "@react-navigation/native";
@@ -26,21 +22,21 @@ import {
26
22
  useAnimatedValue,
27
23
  View,
28
24
  } from "react-native";
29
- import { GestureHandlerRootView } from "react-native-gesture-handler";
30
25
  import { useSafeAreaInsets } from "react-native-safe-area-context";
31
26
  import {
32
27
  type ScreenProps,
33
28
  ScreenStack,
34
29
  ScreenStackItem,
35
30
  } from "react-native-screens";
36
- import { NativeStackScreenLifecycleController } from "../../shared/components/controllers/native-stack-lifecycle";
37
- import { RoutesProvider } from "../../shared/providers/routes.provider";
38
- import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
39
- import type {
40
- NativeStackDescriptor,
41
- NativeStackDescriptorMap,
42
- NativeStackNavigationHelpers,
43
- } from "../types";
31
+ import { Overlay } from "../../shared/components/overlay";
32
+ import { ScreenComposer } from "../../shared/providers/screen/screen-composer";
33
+ import { withStackCore } from "../../shared/providers/stack/core.provider";
34
+ import {
35
+ type DirectStackContextValue,
36
+ withDirectStack,
37
+ } from "../../shared/providers/stack/direct.provider";
38
+ import { NativeStackScreenLifecycleController } from "../controllers/native-stack-lifecycle";
39
+ import type { NativeStackDescriptor } from "../types";
44
40
  import { debounce } from "../utils/debounce";
45
41
  import { getModalRouteKeys } from "../utils/getModalRoutesKeys";
46
42
  import { AnimatedHeaderHeightContext } from "../utils/useAnimatedHeaderHeight";
@@ -468,14 +464,14 @@ const SceneView = ({
468
464
  value={isParentHeaderShown || headerShown !== false}
469
465
  >
470
466
  <HeaderBackContext.Provider value={headerBack}>
471
- <ScreenTransitionProvider
467
+ <ScreenComposer
472
468
  previous={previousDescriptor}
473
469
  current={descriptor}
474
470
  next={nextDescriptor}
475
471
  LifecycleController={NativeStackScreenLifecycleController}
476
472
  >
477
473
  {render()}
478
- </ScreenTransitionProvider>
474
+ </ScreenComposer>
479
475
  </HeaderBackContext.Provider>
480
476
  </HeaderShownContext.Provider>
481
477
  </HeaderHeightContext.Provider>
@@ -486,158 +482,133 @@ const SceneView = ({
486
482
  );
487
483
  };
488
484
 
489
- type Props = {
490
- state: StackNavigationState<ParamListBase>;
491
- navigation: NativeStackNavigationHelpers;
492
- descriptors: NativeStackDescriptorMap;
493
- describe: (
494
- route: RouteProp<ParamListBase>,
495
- placeholder: boolean,
496
- ) => NativeStackDescriptor;
497
- };
498
-
499
- export function NativeStackView({
500
- state,
501
- navigation,
502
- descriptors,
503
- describe,
504
- }: Props) {
505
- const { setNextDismissedKey } = useDismissedRouteError(state);
506
-
507
- useInvalidPreventRemoveError(descriptors);
508
-
509
- const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);
510
-
511
- const preloadedDescriptors =
512
- state.preloadedRoutes.reduce<NativeStackDescriptorMap>((acc, route) => {
513
- acc[route.key] = acc[route.key] || describe(route, true);
514
- return acc;
515
- }, {});
516
-
517
- const routes = state.routes.concat(state.preloadedRoutes);
518
-
519
- // Memoize route keys array for RoutesProvider
520
- const routeKeys = React.useMemo(
521
- () => routes.map((route) => route.key),
522
- [routes],
523
- );
524
-
525
- return (
526
- <RoutesProvider routeKeys={routeKeys}>
527
- <GestureHandlerRootView>
528
- <SafeAreaProviderCompat>
529
- <ScreenStack style={styles.container}>
530
- {routes.map((route, index) => {
531
- const descriptor =
532
- descriptors[route.key] ?? preloadedDescriptors[route.key];
533
- const isFocused = state.index === index;
534
- const isBelowFocused = state.index - 1 === index;
535
- const previousKey = state.routes[index - 1]?.key;
536
- const nextKey = state.routes[index + 1]?.key;
537
- const previousDescriptor = previousKey
538
- ? descriptors[previousKey]
539
- : undefined;
540
- const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
541
-
542
- const isModal = modalRouteKeys.includes(route.key);
543
-
544
- const isPreloaded =
545
- preloadedDescriptors[route.key] !== undefined &&
546
- descriptors[route.key] === undefined;
547
-
548
- // On Fabric, when screen is frozen, animated and reanimated values are not updated
549
- // due to component being unmounted. To avoid this, we don't freeze the previous screen there
550
- const shouldFreeze = isFabric()
551
- ? !isPreloaded && !isFocused && !isBelowFocused
552
- : !isPreloaded && !isFocused;
553
-
554
- return (
555
- <SceneView
556
- key={route.key}
557
- index={index}
558
- focused={isFocused}
559
- shouldFreeze={shouldFreeze}
560
- descriptor={descriptor}
561
- previousDescriptor={previousDescriptor}
562
- nextDescriptor={nextDescriptor}
563
- isPresentationModal={isModal}
564
- isPreloaded={isPreloaded}
565
- onWillDisappear={() => {
566
- navigation.emit({
567
- type: "transitionStart",
568
- data: { closing: true },
569
- target: route.key,
570
- });
571
- }}
572
- onWillAppear={() => {
573
- navigation.emit({
574
- type: "transitionStart",
575
- data: { closing: false },
576
- target: route.key,
577
- });
578
- }}
579
- onAppear={() => {
580
- navigation.emit({
581
- type: "transitionEnd",
582
- data: { closing: false },
583
- target: route.key,
584
- });
585
- }}
586
- onDisappear={() => {
587
- navigation.emit({
588
- type: "transitionEnd",
589
- data: { closing: true },
590
- target: route.key,
591
- });
592
- }}
593
- onDismissed={(event) => {
594
- navigation.dispatch({
595
- ...StackActions.pop(event.nativeEvent.dismissCount),
596
- source: route.key,
597
- target: state.key,
598
- });
599
-
600
- setNextDismissedKey(route.key);
601
- }}
602
- onHeaderBackButtonClicked={() => {
603
- navigation.dispatch({
604
- ...StackActions.pop(),
605
- source: route.key,
606
- target: state.key,
607
- });
608
- }}
609
- onNativeDismissCancelled={(event) => {
610
- navigation.dispatch({
611
- ...StackActions.pop(event.nativeEvent.dismissCount),
612
- source: route.key,
613
- target: state.key,
614
- });
615
- }}
616
- onGestureCancel={() => {
617
- navigation.emit({
618
- type: "gestureCancel",
619
- target: route.key,
620
- });
621
- }}
622
- onSheetDetentChanged={(event) => {
623
- navigation.emit({
624
- type: "sheetDetentChange",
625
- target: route.key,
626
- data: {
627
- index: event.nativeEvent.index,
628
- stable: event.nativeEvent.isStable,
629
- },
630
- });
631
- }}
632
- />
633
- );
634
- })}
635
- </ScreenStack>
636
- </SafeAreaProviderCompat>
637
- </GestureHandlerRootView>
638
- </RoutesProvider>
639
- );
640
- }
485
+ export const NativeStackView = withStackCore(
486
+ { TRANSITIONS_ALWAYS_ON: false },
487
+ withDirectStack(function NativeStackViewContent({
488
+ state,
489
+ navigation,
490
+ descriptors,
491
+ scenes,
492
+ focusedIndex,
493
+ shouldShowFloatOverlay,
494
+ }: DirectStackContextValue) {
495
+ const { setNextDismissedKey } = useDismissedRouteError(state);
496
+
497
+ useInvalidPreventRemoveError(descriptors);
498
+
499
+ const modalRouteKeys = getModalRouteKeys(state.routes, descriptors);
500
+
501
+ return (
502
+ <>
503
+ {shouldShowFloatOverlay ? <Overlay.Float /> : null}
504
+ <ScreenStack style={styles.container}>
505
+ {scenes.map((scene, index) => {
506
+ const { route, descriptor, isPreloaded } = scene;
507
+ const isFocused = focusedIndex === index;
508
+ const isBelowFocused = focusedIndex - 1 === index;
509
+
510
+ // Get previous/next descriptors from state.routes (not scenes) for proper navigation
511
+ const previousKey = state.routes[index - 1]?.key;
512
+ const nextKey = state.routes[index + 1]?.key;
513
+ const previousDescriptor = previousKey
514
+ ? descriptors[previousKey]
515
+ : undefined;
516
+ const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;
517
+
518
+ const isModal = modalRouteKeys.includes(route.key);
519
+
520
+ // On Fabric, when screen is frozen, animated and reanimated values are not updated
521
+ // due to component being unmounted. To avoid this, we don't freeze the previous screen there
522
+ const shouldFreeze = isFabric()
523
+ ? !isPreloaded && !isFocused && !isBelowFocused
524
+ : !isPreloaded && !isFocused;
525
+
526
+ return (
527
+ <SceneView
528
+ key={route.key}
529
+ index={index}
530
+ focused={isFocused}
531
+ shouldFreeze={shouldFreeze}
532
+ descriptor={descriptor}
533
+ previousDescriptor={previousDescriptor}
534
+ nextDescriptor={nextDescriptor}
535
+ isPresentationModal={isModal}
536
+ isPreloaded={isPreloaded}
537
+ onWillDisappear={() => {
538
+ navigation.emit({
539
+ type: "transitionStart",
540
+ data: { closing: true },
541
+ target: route.key,
542
+ });
543
+ }}
544
+ onWillAppear={() => {
545
+ navigation.emit({
546
+ type: "transitionStart",
547
+ data: { closing: false },
548
+ target: route.key,
549
+ });
550
+ }}
551
+ onAppear={() => {
552
+ navigation.emit({
553
+ type: "transitionEnd",
554
+ data: { closing: false },
555
+ target: route.key,
556
+ });
557
+ }}
558
+ onDisappear={() => {
559
+ navigation.emit({
560
+ type: "transitionEnd",
561
+ data: { closing: true },
562
+ target: route.key,
563
+ });
564
+ }}
565
+ onDismissed={(event) => {
566
+ navigation.dispatch({
567
+ ...StackActions.pop(event.nativeEvent.dismissCount),
568
+ source: route.key,
569
+ target: state.key,
570
+ });
571
+
572
+ setNextDismissedKey(route.key);
573
+ }}
574
+ onHeaderBackButtonClicked={() => {
575
+ navigation.dispatch({
576
+ ...StackActions.pop(),
577
+ source: route.key,
578
+ target: state.key,
579
+ });
580
+ }}
581
+ onNativeDismissCancelled={(event) => {
582
+ navigation.dispatch({
583
+ ...StackActions.pop(event.nativeEvent.dismissCount),
584
+ source: route.key,
585
+ target: state.key,
586
+ });
587
+ }}
588
+ onGestureCancel={() => {
589
+ navigation.emit({
590
+ type: "gestureCancel",
591
+ target: route.key,
592
+ });
593
+ }}
594
+ onSheetDetentChanged={(event) => {
595
+ navigation.emit({
596
+ type: "sheetDetentChange",
597
+ target: route.key,
598
+ data: {
599
+ index: event.nativeEvent.index,
600
+ stable: event.nativeEvent.isStable,
601
+ },
602
+ });
603
+ }}
604
+ />
605
+ );
606
+ })}
607
+ </ScreenStack>
608
+ </>
609
+ );
610
+ }),
611
+ );
641
612
 
642
613
  const styles = StyleSheet.create({
643
614
  container: {
@@ -0,0 +1,137 @@
1
+ import { beforeEach, describe, expect, it } from "bun:test";
2
+ import { AnimationStore } from "../stores/animation.store";
3
+ import { GestureStore } from "../stores/gesture.store";
4
+ import { syncRoutesWithRemoved } from "../utils/navigation/sync-routes-with-removed";
5
+
6
+ const createRoute = (key: string) => ({ key });
7
+
8
+ const createClosingRouteKeys = () => {
9
+ const keys = new Set<string>();
10
+ const sharedValue: string[] = [];
11
+ return {
12
+ ref: { current: keys } as React.RefObject<Set<string>>,
13
+ shared: {
14
+ value: sharedValue,
15
+ get: () => sharedValue,
16
+ set: (v: string[]) => {
17
+ sharedValue.length = 0;
18
+ sharedValue.push(...v);
19
+ },
20
+ addListener: () => () => {},
21
+ removeListener: () => {},
22
+ modify: (fn?: (v: string[]) => string[], _forceUpdate?: boolean) => {
23
+ if (fn) {
24
+ const result = fn(sharedValue);
25
+ sharedValue.length = 0;
26
+ sharedValue.push(...result);
27
+ }
28
+ },
29
+ },
30
+ add: (key: string) => {
31
+ keys.add(key);
32
+ },
33
+ remove: (key: string) => {
34
+ keys.delete(key);
35
+ },
36
+ clear: () => keys.clear(),
37
+ };
38
+ };
39
+
40
+ // Helper to set up a route's animation state
41
+ const setRouteState = (
42
+ routeKey: string,
43
+ state: {
44
+ progress?: number;
45
+ closing?: number;
46
+ isDragging?: number;
47
+ isDismissing?: number;
48
+ },
49
+ ) => {
50
+ const animations = AnimationStore.getAll(routeKey);
51
+ const gestures = GestureStore.getRouteGestures(routeKey);
52
+
53
+ if (state.progress !== undefined) animations.progress.value = state.progress;
54
+ if (state.closing !== undefined) animations.closing.value = state.closing;
55
+ if (state.isDragging !== undefined)
56
+ gestures.isDragging.value = state.isDragging;
57
+ if (state.isDismissing !== undefined)
58
+ gestures.isDismissing.value = state.isDismissing;
59
+ };
60
+
61
+ // Reset stores before each test
62
+ beforeEach(() => {
63
+ globalThis.resetMutableRegistry();
64
+ });
65
+
66
+ describe("syncRoutesWithRemoved", () => {
67
+ describe("basic routing", () => {
68
+ it("returns empty routes when nextRoutes is empty", () => {
69
+ const closingRouteKeys = createClosingRouteKeys();
70
+ const result = syncRoutesWithRemoved({
71
+ prevRoutes: [createRoute("a")],
72
+ prevDescriptors: {},
73
+ nextRoutes: [],
74
+ nextDescriptors: {},
75
+ closingRouteKeys,
76
+ });
77
+ expect(result.routes).toEqual([]);
78
+ });
79
+
80
+ it("returns nextRoutes unchanged for normal push (A -> B)", () => {
81
+ const closingRouteKeys = createClosingRouteKeys();
82
+
83
+ // Both routes fully visible
84
+ setRouteState("a", { progress: 1 });
85
+ setRouteState("b", { progress: 1 });
86
+
87
+ const result = syncRoutesWithRemoved({
88
+ prevRoutes: [createRoute("a")],
89
+ prevDescriptors: { a: {} },
90
+ nextRoutes: [createRoute("a"), createRoute("b")],
91
+ nextDescriptors: { a: {}, b: {} },
92
+ closingRouteKeys,
93
+ });
94
+ expect(result.routes.map((r) => r.key)).toEqual(["a", "b"]);
95
+ });
96
+
97
+ it("returns nextRoutes unchanged for normal stack (A -> B -> C)", () => {
98
+ const closingRouteKeys = createClosingRouteKeys();
99
+
100
+ setRouteState("a", { progress: 1 });
101
+ setRouteState("b", { progress: 1 });
102
+ setRouteState("c", { progress: 1 });
103
+
104
+ const result = syncRoutesWithRemoved({
105
+ prevRoutes: [createRoute("a"), createRoute("b")],
106
+ prevDescriptors: { a: {}, b: {} },
107
+ nextRoutes: [createRoute("a"), createRoute("b"), createRoute("c")],
108
+ nextDescriptors: { a: {}, b: {}, c: {} },
109
+ closingRouteKeys,
110
+ });
111
+ expect(result.routes.map((r) => r.key)).toEqual(["a", "b", "c"]);
112
+ });
113
+ });
114
+
115
+
116
+ describe("normal back navigation", () => {
117
+ it("keeps closing route at end for normal back (C -> B)", () => {
118
+ const closingRouteKeys = createClosingRouteKeys();
119
+
120
+ setRouteState("a", { progress: 1 });
121
+ setRouteState("b", { progress: 1 });
122
+ setRouteState("c", { progress: 1 });
123
+
124
+ const result = syncRoutesWithRemoved({
125
+ prevRoutes: [createRoute("a"), createRoute("b"), createRoute("c")],
126
+ prevDescriptors: { a: {}, b: {}, c: {} },
127
+ nextRoutes: [createRoute("a"), createRoute("b")],
128
+ nextDescriptors: { a: {}, b: {} },
129
+ closingRouteKeys,
130
+ });
131
+
132
+ // c should be added to end for close animation
133
+ expect(result.routes.map((r) => r.key)).toEqual(["a", "b", "c"]);
134
+ expect(closingRouteKeys.ref.current.has("c")).toBe(true);
135
+ });
136
+ });
137
+ });
@@ -8,8 +8,7 @@ import { useAssociatedStyles } from "../hooks/animation/use-associated-style";
8
8
  import { useScrollRegistry } from "../hooks/gestures/use-scroll-registry";
9
9
  import { useGestureContext } from "../providers/gestures.provider";
10
10
  import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
11
- import type { TransitionAwareProps } from "../types/core.types";
12
- import type { Any } from "../types/utils.types";
11
+ import type { TransitionAwareProps } from "../types/screen.types";
13
12
 
14
13
  interface CreateTransitionAwareComponentOptions {
15
14
  isScrollable?: boolean;
@@ -26,7 +25,7 @@ export function createTransitionAwareComponent<P extends object>(
26
25
  const ScrollableInner = forwardRef<
27
26
  React.ComponentRef<typeof Wrapped>,
28
27
  TransitionAwareProps<P>
29
- >((props: Any, ref) => {
28
+ >((props: any, ref) => {
30
29
  const { nativeGesture } = useGestureContext()!;
31
30
  const { scrollHandler, onContentSizeChange, onLayout } = useScrollRegistry({
32
31
  onScroll: props.onScroll,
@@ -37,7 +36,7 @@ export function createTransitionAwareComponent<P extends object>(
37
36
  return (
38
37
  <GestureDetector gesture={nativeGesture}>
39
38
  <AnimatedComponent
40
- {...(props as Any)}
39
+ {...(props as any)}
41
40
  ref={ref}
42
41
  onScroll={scrollHandler}
43
42
  onContentSizeChange={onContentSizeChange}
@@ -53,7 +52,7 @@ export function createTransitionAwareComponent<P extends object>(
53
52
  TransitionAwareProps<P>
54
53
  >((props, _) => {
55
54
  const { children, style, sharedBoundTag, styleId, onPress, ...rest } =
56
- props as Any;
55
+ props as any;
57
56
 
58
57
  const animatedRef = useAnimatedRef<View>();
59
58
 
@@ -71,7 +70,7 @@ export function createTransitionAwareComponent<P extends object>(
71
70
  >
72
71
  {({ captureActiveOnPress, handleInitialLayout }) => (
73
72
  <AnimatedComponent
74
- {...(rest as Any)}
73
+ {...(rest as any)}
75
74
  ref={animatedRef}
76
75
  style={[style, associatedStyles]}
77
76
  onPress={captureActiveOnPress}
@@ -0,0 +1,38 @@
1
+ import type { StackScene } from "../../../hooks/navigation/use-stack";
2
+
3
+ /**
4
+ * Find the active float overlay from scenes.
5
+ * Scans from the top of the stack downward to find the first screen
6
+ * with overlayMode="float" and overlayShown=true.
7
+ */
8
+ export function getActiveFloatOverlay(
9
+ scenes: StackScene[],
10
+ index: number,
11
+ transitionsAlwaysOn: boolean,
12
+ ): { scene: StackScene; overlayIndex: number } | null {
13
+ if (scenes.length === 0) {
14
+ return null;
15
+ }
16
+
17
+ // When navigating back, closing scenes are kept at the top of the local stack
18
+ // while the focused index already points to the destination screen. We need to
19
+ // start scanning from the actual top of the stack so the overlay can animate
20
+ // out together with its closing screen instead of disappearing immediately.
21
+ const startIndex = Math.max(index, scenes.length - 1);
22
+
23
+ for (let i = startIndex; i >= 0; i--) {
24
+ const scene = scenes[i];
25
+ const options = scene?.descriptor?.options;
26
+
27
+ // Skip screens without enableTransitions (native-stack only)
28
+ if (!transitionsAlwaysOn && !options?.enableTransitions) {
29
+ continue;
30
+ }
31
+
32
+ if (options?.overlayMode === "float" && options?.overlayShown) {
33
+ return { scene, overlayIndex: i };
34
+ }
35
+ }
36
+
37
+ return null;
38
+ }
@@ -0,0 +1,7 @@
1
+ import { FloatOverlay } from "./variations/float-overlay";
2
+ import { ScreenOverlay } from "./variations/screen-overlay";
3
+
4
+ export const Overlay = {
5
+ Float: FloatOverlay,
6
+ Screen: ScreenOverlay,
7
+ };
@@ -0,0 +1,44 @@
1
+ import { useMemo } from "react";
2
+ import { useStack } from "../../../hooks/navigation/use-stack";
3
+ import { KeysProvider } from "../../../providers/screen/keys.provider";
4
+ import { ScreenStylesProvider } from "../../../providers/screen/styles.provider";
5
+ import { getActiveFloatOverlay } from "../helpers/get-active-overlay";
6
+ import { OverlayHost } from "./overlay-host";
7
+
8
+ /**
9
+ * Float overlay component that renders above all screens.
10
+ * Gets routes and descriptors from stack context.
11
+ */
12
+ export function FloatOverlay() {
13
+ const { routes, scenes, focusedIndex, flags } = useStack();
14
+
15
+ const activeOverlay = useMemo(
16
+ () =>
17
+ getActiveFloatOverlay(scenes, focusedIndex, flags.TRANSITIONS_ALWAYS_ON),
18
+ [scenes, focusedIndex, flags.TRANSITIONS_ALWAYS_ON],
19
+ );
20
+
21
+ if (!activeOverlay) {
22
+ return null;
23
+ }
24
+
25
+ const { scene, overlayIndex } = activeOverlay;
26
+
27
+ const previous = scenes[overlayIndex - 1]?.descriptor;
28
+ const current = scene.descriptor;
29
+ const next = scenes[overlayIndex + 1]?.descriptor;
30
+
31
+ return (
32
+ <KeysProvider current={current} previous={previous} next={next}>
33
+ <ScreenStylesProvider>
34
+ <OverlayHost
35
+ scene={scene}
36
+ scenes={scenes}
37
+ routes={routes}
38
+ overlayIndex={overlayIndex}
39
+ isFloating
40
+ />
41
+ </ScreenStylesProvider>
42
+ </KeysProvider>
43
+ );
44
+ }