react-native-screen-transitions 3.1.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 (561) hide show
  1. package/lib/commonjs/blank-stack/components/screens.js +2 -2
  2. package/lib/commonjs/blank-stack/components/screens.js.map +1 -1
  3. package/lib/commonjs/blank-stack/components/stack-view.js +42 -51
  4. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
  5. package/lib/commonjs/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +17 -8
  6. package/lib/commonjs/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
  7. package/lib/commonjs/component-stack/components/component-view.js +63 -0
  8. package/lib/commonjs/component-stack/components/component-view.js.map +1 -0
  9. package/lib/commonjs/component-stack/components/screens.js +64 -0
  10. package/lib/commonjs/component-stack/components/screens.js.map +1 -0
  11. package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js +82 -0
  12. package/lib/commonjs/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
  13. package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js +321 -0
  14. package/lib/commonjs/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
  15. package/lib/commonjs/component-stack/hooks/use-component-navigation.js +28 -0
  16. package/lib/commonjs/component-stack/hooks/use-component-navigation.js.map +1 -0
  17. package/lib/commonjs/component-stack/index.js +20 -0
  18. package/lib/commonjs/component-stack/index.js.map +1 -0
  19. package/lib/commonjs/component-stack/navigators/create-component-navigator.js +97 -0
  20. package/lib/commonjs/component-stack/navigators/create-component-navigator.js.map +1 -0
  21. package/lib/commonjs/component-stack/types.js.map +1 -0
  22. package/lib/commonjs/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  23. package/lib/commonjs/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  24. package/lib/commonjs/native-stack/views/NativeStackView.native.js +120 -121
  25. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  26. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  27. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +64 -0
  28. package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  29. package/lib/commonjs/shared/components/overlay/index.js +15 -0
  30. package/lib/commonjs/shared/components/overlay/index.js.map +1 -0
  31. package/lib/commonjs/shared/components/overlay/variations/container-overlay.js +99 -0
  32. package/lib/commonjs/shared/components/overlay/variations/container-overlay.js.map +1 -0
  33. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +51 -0
  34. package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -0
  35. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +124 -0
  36. package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -0
  37. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +47 -0
  38. package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +1 -0
  39. package/lib/commonjs/shared/components/root-transition-aware.js +2 -2
  40. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  41. package/lib/commonjs/shared/constants.js +2 -31
  42. package/lib/commonjs/shared/constants.js.map +1 -1
  43. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
  44. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  45. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js +30 -0
  46. package/lib/commonjs/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  47. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +16 -9
  48. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  49. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +1 -1
  50. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  51. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  52. package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  53. package/lib/commonjs/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  54. package/lib/commonjs/shared/hooks/navigation/use-previous.js.map +1 -0
  55. package/lib/commonjs/shared/hooks/navigation/use-stack.js +37 -0
  56. package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -0
  57. package/lib/commonjs/shared/providers/gestures.provider.js +1 -1
  58. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -1
  59. package/lib/commonjs/shared/providers/register-bounds.provider.js +11 -5
  60. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  61. package/lib/commonjs/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  62. package/lib/commonjs/shared/providers/screen/keys.provider.js.map +1 -0
  63. package/lib/commonjs/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +7 -7
  64. package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -0
  65. package/lib/commonjs/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +12 -13
  66. package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -0
  67. package/lib/commonjs/shared/providers/stack/core.provider.js +61 -0
  68. package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -0
  69. package/lib/commonjs/shared/providers/stack/direct.provider.js +158 -0
  70. package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -0
  71. 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
  72. package/lib/commonjs/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  73. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js +93 -0
  74. package/lib/commonjs/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  75. package/lib/commonjs/shared/providers/stack/managed.provider.js +155 -0
  76. package/lib/commonjs/shared/providers/stack/managed.provider.js.map +1 -0
  77. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
  78. package/lib/commonjs/shared/types/index.js +19 -0
  79. package/lib/commonjs/shared/types/index.js.map +1 -0
  80. package/lib/commonjs/shared/types/overlay.types.js +6 -0
  81. package/lib/commonjs/shared/types/overlay.types.js.map +1 -0
  82. package/lib/commonjs/shared/types/screen.types.js +6 -0
  83. package/lib/commonjs/shared/types/screen.types.js.map +1 -0
  84. package/lib/commonjs/shared/types/{core.types.js → stack.types.js} +1 -1
  85. package/lib/commonjs/shared/types/{core.types.js.map → stack.types.js.map} +1 -1
  86. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -1
  87. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  88. package/lib/commonjs/shared/utils/create-provider.js +16 -13
  89. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  90. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  91. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js +51 -0
  92. package/lib/commonjs/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  93. package/lib/commonjs/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  94. package/lib/commonjs/shared/utils/navigation/compose-descriptors.js.map +1 -0
  95. package/lib/commonjs/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  96. package/lib/commonjs/shared/utils/navigation/routes-are-identical.js.map +1 -0
  97. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js +95 -0
  98. package/lib/commonjs/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  99. package/lib/commonjs/shared/utils/read-shared-value.js +17 -0
  100. package/lib/commonjs/shared/utils/read-shared-value.js.map +1 -0
  101. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -1
  102. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
  103. package/lib/module/blank-stack/components/screens.js +2 -2
  104. package/lib/module/blank-stack/components/screens.js.map +1 -1
  105. package/lib/module/blank-stack/components/stack-view.js +41 -50
  106. package/lib/module/blank-stack/components/stack-view.js.map +1 -1
  107. package/lib/module/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.js +18 -9
  108. package/lib/module/blank-stack/controllers/blank-stack-lifecycle.js.map +1 -0
  109. package/lib/module/component-stack/components/component-view.js +58 -0
  110. package/lib/module/component-stack/components/component-view.js.map +1 -0
  111. package/lib/module/component-stack/components/screens.js +58 -0
  112. package/lib/module/component-stack/components/screens.js.map +1 -0
  113. package/lib/module/component-stack/controllers/component-stack-lifecycle.js +76 -0
  114. package/lib/module/component-stack/controllers/component-stack-lifecycle.js.map +1 -0
  115. package/lib/module/component-stack/hooks/use-component-navigation-builder.js +316 -0
  116. package/lib/module/component-stack/hooks/use-component-navigation-builder.js.map +1 -0
  117. package/lib/module/component-stack/hooks/use-component-navigation.js +25 -0
  118. package/lib/module/component-stack/hooks/use-component-navigation.js.map +1 -0
  119. package/lib/module/component-stack/index.js +5 -0
  120. package/lib/module/component-stack/index.js.map +1 -0
  121. package/lib/module/component-stack/navigators/create-component-navigator.js +91 -0
  122. package/lib/module/component-stack/navigators/create-component-navigator.js.map +1 -0
  123. package/lib/module/component-stack/types.js.map +1 -0
  124. package/lib/module/{shared/components → native-stack}/controllers/native-stack-lifecycle.js +18 -9
  125. package/lib/module/native-stack/controllers/native-stack-lifecycle.js.map +1 -0
  126. package/lib/module/native-stack/views/NativeStackView.native.js +121 -122
  127. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  128. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  129. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +59 -0
  130. package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -0
  131. package/lib/module/shared/components/overlay/index.js +11 -0
  132. package/lib/module/shared/components/overlay/index.js.map +1 -0
  133. package/lib/module/shared/components/overlay/variations/container-overlay.js +97 -0
  134. package/lib/module/shared/components/overlay/variations/container-overlay.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 +0 -29
  144. package/lib/module/shared/constants.js.map +1 -1
  145. package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
  146. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  147. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js +24 -0
  148. package/lib/module/shared/hooks/animation/use-high-refresh-rate.js.map +1 -0
  149. package/lib/module/shared/hooks/animation/use-screen-animation.js +16 -9
  150. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  151. package/lib/module/shared/hooks/gestures/use-build-gestures.js +1 -1
  152. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  153. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  154. package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.js +1 -1
  155. package/lib/module/shared/hooks/navigation/use-closing-route-keys.js.map +1 -0
  156. package/lib/module/shared/hooks/navigation/use-previous.js.map +1 -0
  157. package/lib/module/shared/hooks/navigation/use-stack.js +33 -0
  158. package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -0
  159. package/lib/module/shared/providers/gestures.provider.js +1 -1
  160. package/lib/module/shared/providers/gestures.provider.js.map +1 -1
  161. package/lib/module/shared/providers/register-bounds.provider.js +11 -5
  162. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  163. package/lib/module/shared/providers/{keys.provider.js → screen/keys.provider.js} +12 -0
  164. package/lib/module/shared/providers/screen/keys.provider.js.map +1 -0
  165. package/lib/module/shared/providers/{screen-transition.provider.js → screen/screen-composer.js} +6 -6
  166. package/lib/module/shared/providers/screen/screen-composer.js.map +1 -0
  167. package/lib/module/shared/providers/{transition-styles.provider.js → screen/styles.provider.js} +10 -10
  168. package/lib/module/shared/providers/screen/styles.provider.js.map +1 -0
  169. package/lib/module/shared/providers/stack/core.provider.js +55 -0
  170. package/lib/module/shared/providers/stack/core.provider.js.map +1 -0
  171. package/lib/module/shared/providers/stack/direct.provider.js +153 -0
  172. package/lib/module/shared/providers/stack/direct.provider.js.map +1 -0
  173. 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
  174. package/lib/module/shared/providers/stack/helpers/active-screens-limit.js.map +1 -0
  175. package/lib/module/shared/providers/stack/helpers/use-local-routes.js +87 -0
  176. package/lib/module/shared/providers/stack/helpers/use-local-routes.js.map +1 -0
  177. package/lib/module/shared/providers/stack/managed.provider.js +150 -0
  178. package/lib/module/shared/providers/stack/managed.provider.js.map +1 -0
  179. package/lib/module/shared/stores/bounds.store.js.map +1 -1
  180. package/lib/module/shared/types/index.js +4 -0
  181. package/lib/module/shared/types/index.js.map +1 -0
  182. package/lib/module/shared/types/overlay.types.js +4 -0
  183. package/lib/module/shared/types/overlay.types.js.map +1 -0
  184. package/lib/module/shared/types/screen.types.js +4 -0
  185. package/lib/module/shared/types/screen.types.js.map +1 -0
  186. package/lib/module/shared/types/stack.types.js +4 -0
  187. package/lib/{commonjs/shared/types/utils.types.js.map → module/shared/types/stack.types.js.map} +1 -1
  188. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -1
  189. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  190. package/lib/module/shared/utils/create-provider.js +16 -13
  191. package/lib/module/shared/utils/create-provider.js.map +1 -1
  192. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  193. package/lib/module/shared/utils/navigation/align-routes-with-latest.js +46 -0
  194. package/lib/module/shared/utils/navigation/align-routes-with-latest.js.map +1 -0
  195. package/lib/module/shared/utils/navigation/are-descriptors-equal.js.map +1 -0
  196. package/lib/module/shared/utils/navigation/compose-descriptors.js.map +1 -0
  197. package/lib/module/shared/utils/navigation/have-same-route-keys.js.map +1 -0
  198. package/lib/module/shared/utils/navigation/routes-are-identical.js.map +1 -0
  199. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js +90 -0
  200. package/lib/module/shared/utils/navigation/sync-routes-with-removed.js.map +1 -0
  201. package/lib/module/shared/utils/read-shared-value.js +14 -0
  202. package/lib/module/shared/utils/read-shared-value.js.map +1 -0
  203. package/lib/module/shared/utils/reset-stores-for-screen.js +2 -2
  204. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
  205. package/lib/typescript/blank-stack/components/stack-view.d.ts +2 -1
  206. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
  207. package/lib/typescript/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.d.ts +2 -1
  208. package/lib/typescript/blank-stack/controllers/blank-stack-lifecycle.d.ts.map +1 -0
  209. package/lib/typescript/blank-stack/types.d.ts +9 -50
  210. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  211. package/lib/typescript/component-stack/components/component-view.d.ts +4 -0
  212. package/lib/typescript/component-stack/components/component-view.d.ts.map +1 -0
  213. package/lib/typescript/component-stack/components/screens.d.ts +9 -0
  214. package/lib/typescript/component-stack/components/screens.d.ts.map +1 -0
  215. package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts +10 -0
  216. package/lib/typescript/component-stack/controllers/component-stack-lifecycle.d.ts.map +1 -0
  217. package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts +19 -0
  218. package/lib/typescript/component-stack/hooks/use-component-navigation-builder.d.ts.map +1 -0
  219. package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts +19 -0
  220. package/lib/typescript/component-stack/hooks/use-component-navigation.d.ts.map +1 -0
  221. package/lib/typescript/component-stack/index.d.ts +4 -0
  222. package/lib/typescript/component-stack/index.d.ts.map +1 -0
  223. package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts +35 -0
  224. package/lib/typescript/component-stack/navigators/create-component-navigator.d.ts.map +1 -0
  225. package/lib/typescript/component-stack/types.d.ts +206 -0
  226. package/lib/typescript/component-stack/types.d.ts.map +1 -0
  227. package/lib/typescript/native-stack/controllers/native-stack-lifecycle.d.ts.map +1 -0
  228. package/lib/typescript/native-stack/index.d.ts +1 -1
  229. package/lib/typescript/native-stack/index.d.ts.map +1 -1
  230. package/lib/typescript/native-stack/types.d.ts +9 -6
  231. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  232. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts +2 -10
  233. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  234. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  235. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +20 -0
  236. package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -0
  237. package/lib/typescript/shared/components/overlay/index.d.ts +9 -0
  238. package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -0
  239. package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts +8 -0
  240. package/lib/typescript/shared/components/overlay/variations/container-overlay.d.ts.map +1 -0
  241. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +6 -0
  242. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -0
  243. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +12 -0
  244. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -0
  245. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +6 -0
  246. package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +1 -0
  247. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  248. package/lib/typescript/shared/configs/presets.d.ts +1 -1
  249. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  250. package/lib/typescript/shared/constants.d.ts +1 -16
  251. package/lib/typescript/shared/constants.d.ts.map +1 -1
  252. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts +6 -0
  253. package/lib/typescript/shared/hooks/animation/use-high-refresh-rate.d.ts.map +1 -0
  254. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  255. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  256. package/lib/typescript/shared/hooks/gestures/use-scroll-registry.d.ts.map +1 -1
  257. package/lib/typescript/shared/hooks/navigation/use-closing-route-keys.d.ts.map +1 -0
  258. package/lib/typescript/shared/hooks/navigation/use-previous.d.ts.map +1 -0
  259. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +71 -0
  260. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -0
  261. package/lib/typescript/shared/index.d.ts +31 -33
  262. package/lib/typescript/shared/index.d.ts.map +1 -1
  263. package/lib/typescript/shared/providers/gestures.provider.d.ts +4 -2
  264. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -1
  265. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  266. package/lib/typescript/shared/providers/screen/keys.provider.d.ts +29 -0
  267. package/lib/typescript/shared/providers/screen/keys.provider.d.ts.map +1 -0
  268. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +13 -0
  269. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -0
  270. package/lib/typescript/shared/providers/screen/styles.provider.d.ts +13 -0
  271. package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -0
  272. package/lib/typescript/shared/providers/stack/core.provider.d.ts +11 -0
  273. package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -0
  274. package/lib/typescript/shared/providers/stack/direct.provider.d.ts +34 -0
  275. package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -0
  276. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts +9 -0
  277. package/lib/typescript/shared/providers/stack/helpers/active-screens-limit.d.ts.map +1 -0
  278. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts +19 -0
  279. package/lib/typescript/shared/providers/stack/helpers/use-local-routes.d.ts.map +1 -0
  280. package/lib/typescript/shared/providers/stack/managed.provider.d.ts +39 -0
  281. package/lib/typescript/shared/providers/stack/managed.provider.d.ts.map +1 -0
  282. package/lib/typescript/shared/stores/animation.store.d.ts +1 -1
  283. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  284. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
  285. package/lib/typescript/shared/stores/gesture.store.d.ts +2 -2
  286. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  287. package/lib/typescript/shared/types/animation.types.d.ts +3 -3
  288. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  289. package/lib/typescript/shared/types/gesture.types.d.ts +0 -1
  290. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  291. package/lib/typescript/shared/types/index.d.ts +8 -0
  292. package/lib/typescript/shared/types/index.d.ts.map +1 -0
  293. package/lib/typescript/shared/types/overlay.types.d.ts +50 -0
  294. package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -0
  295. package/lib/typescript/shared/types/{core.types.d.ts → screen.types.d.ts} +31 -6
  296. package/lib/typescript/shared/types/screen.types.d.ts.map +1 -0
  297. package/lib/typescript/shared/types/stack.types.d.ts +52 -0
  298. package/lib/typescript/shared/types/stack.types.d.ts.map +1 -0
  299. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +1 -1
  300. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
  301. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +2 -1
  302. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
  303. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts +1 -2
  304. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -1
  305. package/lib/typescript/shared/utils/bounds/index.d.ts +1 -9
  306. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  307. package/lib/typescript/shared/utils/bounds/types/builder.d.ts +9 -8
  308. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -1
  309. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts +2 -1
  310. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -1
  311. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  312. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +1 -1
  313. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  314. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts +13 -0
  315. package/lib/typescript/shared/utils/navigation/align-routes-with-latest.d.ts.map +1 -0
  316. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts +2 -0
  317. package/lib/typescript/shared/utils/navigation/are-descriptors-equal.d.ts.map +1 -0
  318. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts +6 -0
  319. package/lib/typescript/shared/utils/navigation/compose-descriptors.d.ts.map +1 -0
  320. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts +6 -0
  321. package/lib/typescript/shared/utils/navigation/have-same-route-keys.d.ts.map +1 -0
  322. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts +6 -0
  323. package/lib/typescript/shared/utils/navigation/routes-are-identical.d.ts.map +1 -0
  324. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts +21 -0
  325. package/lib/typescript/shared/utils/navigation/sync-routes-with-removed.d.ts.map +1 -0
  326. package/lib/typescript/shared/utils/read-shared-value.d.ts +7 -0
  327. package/lib/typescript/shared/utils/read-shared-value.d.ts.map +1 -0
  328. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +4 -3
  329. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
  330. package/package.json +7 -2
  331. package/src/blank-stack/components/screens.tsx +2 -2
  332. package/src/blank-stack/components/stack-view.tsx +59 -67
  333. package/src/{shared/components → blank-stack}/controllers/blank-stack-lifecycle.tsx +18 -11
  334. package/src/blank-stack/types.ts +10 -62
  335. package/src/component-stack/components/component-view.tsx +72 -0
  336. package/src/component-stack/components/screens.tsx +86 -0
  337. package/src/component-stack/controllers/component-stack-lifecycle.tsx +80 -0
  338. package/src/component-stack/hooks/use-component-navigation-builder.tsx +388 -0
  339. package/src/component-stack/hooks/use-component-navigation.tsx +22 -0
  340. package/src/component-stack/index.ts +16 -0
  341. package/src/component-stack/navigators/create-component-navigator.tsx +104 -0
  342. package/src/component-stack/types.ts +209 -0
  343. package/src/{shared/components → native-stack}/controllers/native-stack-lifecycle.tsx +18 -11
  344. package/src/native-stack/index.ts +1 -0
  345. package/src/native-stack/types.ts +11 -7
  346. package/src/native-stack/views/NativeStackView.native.tsx +42 -69
  347. package/src/shared/__tests__/sync-routes-with-removed.test.ts +283 -0
  348. package/src/shared/components/create-transition-aware-component.tsx +5 -6
  349. package/src/shared/components/overlay/helpers/get-active-overlay.ts +64 -0
  350. package/src/shared/components/overlay/index.ts +9 -0
  351. package/src/shared/components/overlay/variations/container-overlay.tsx +98 -0
  352. package/src/shared/components/overlay/variations/float-overlay.tsx +44 -0
  353. package/src/shared/components/overlay/variations/overlay-host.tsx +148 -0
  354. package/src/shared/components/overlay/variations/screen-overlay.tsx +51 -0
  355. package/src/shared/components/root-transition-aware.tsx +2 -2
  356. package/src/shared/configs/presets.ts +1 -1
  357. package/src/shared/constants.ts +1 -33
  358. package/src/shared/hooks/animation/use-associated-style.tsx +2 -2
  359. package/src/shared/hooks/animation/use-high-refresh-rate.tsx +28 -0
  360. package/src/shared/hooks/animation/use-screen-animation.tsx +19 -15
  361. package/src/shared/hooks/gestures/use-build-gestures.tsx +1 -2
  362. package/src/shared/hooks/gestures/use-scroll-registry.tsx +3 -4
  363. package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.tsx +1 -1
  364. package/src/shared/hooks/navigation/use-stack.tsx +100 -0
  365. package/src/shared/index.ts +7 -3
  366. package/src/shared/providers/gestures.provider.tsx +6 -2
  367. package/src/shared/providers/register-bounds.provider.tsx +13 -6
  368. package/src/shared/providers/screen/keys.provider.tsx +72 -0
  369. package/src/shared/providers/screen/screen-composer.tsx +38 -0
  370. package/src/shared/providers/{transition-styles.provider.tsx → screen/styles.provider.tsx} +14 -13
  371. package/src/shared/providers/stack/core.provider.tsx +64 -0
  372. package/src/shared/providers/stack/direct.provider.tsx +228 -0
  373. package/src/{blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.ts → shared/providers/stack/helpers/active-screens-limit.ts} +10 -4
  374. package/src/shared/providers/stack/helpers/use-local-routes.tsx +133 -0
  375. package/src/shared/providers/stack/managed.provider.tsx +226 -0
  376. package/src/shared/stores/animation.store.ts +1 -1
  377. package/src/shared/stores/bounds.store.ts +4 -5
  378. package/src/shared/stores/gesture.store.ts +2 -2
  379. package/src/shared/types/animation.types.ts +3 -3
  380. package/src/shared/types/gesture.types.ts +0 -2
  381. package/src/shared/types/index.ts +47 -0
  382. package/src/shared/types/overlay.types.ts +62 -0
  383. package/src/shared/types/{core.types.ts → screen.types.ts} +40 -7
  384. package/src/shared/types/stack.types.ts +59 -0
  385. package/src/shared/utils/bounds/helpers/geometry.ts +1 -1
  386. package/src/shared/utils/bounds/helpers/style-composers.ts +1 -1
  387. package/src/shared/utils/bounds/helpers/styles.ts +1 -2
  388. package/src/shared/utils/bounds/index.ts +1 -9
  389. package/src/shared/utils/bounds/types/builder.ts +8 -8
  390. package/src/shared/utils/bounds/types/geometry.ts +1 -1
  391. package/src/shared/utils/create-provider.tsx +14 -16
  392. package/src/shared/utils/gesture/check-gesture-activation.ts +1 -1
  393. package/src/shared/utils/navigation/align-routes-with-latest.ts +68 -0
  394. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.ts +5 -5
  395. package/src/shared/utils/navigation/compose-descriptors.ts +21 -0
  396. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.ts +6 -4
  397. package/src/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.ts +6 -4
  398. package/src/shared/utils/navigation/sync-routes-with-removed.ts +132 -0
  399. package/src/shared/utils/read-shared-value.ts +15 -0
  400. package/src/shared/utils/reset-stores-for-screen.ts +4 -3
  401. package/lib/commonjs/blank-stack/components/overlay.js +0 -156
  402. package/lib/commonjs/blank-stack/components/overlay.js.map +0 -1
  403. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +0 -72
  404. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  405. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  406. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  407. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  408. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  409. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  410. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  411. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  412. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -196
  413. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  414. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +0 -61
  415. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  416. package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  417. package/lib/commonjs/native-stack/views/FooterComponent.js +0 -17
  418. package/lib/commonjs/native-stack/views/FooterComponent.js.map +0 -1
  419. package/lib/commonjs/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  420. package/lib/commonjs/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  421. package/lib/commonjs/shared/providers/flags.provider.js +0 -25
  422. package/lib/commonjs/shared/providers/flags.provider.js.map +0 -1
  423. package/lib/commonjs/shared/providers/keys.provider.js.map +0 -1
  424. package/lib/commonjs/shared/providers/routes.provider.js +0 -48
  425. package/lib/commonjs/shared/providers/routes.provider.js.map +0 -1
  426. package/lib/commonjs/shared/providers/screen-transition.provider.js.map +0 -1
  427. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +0 -1
  428. package/lib/commonjs/shared/types/utils.types.js +0 -2
  429. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js +0 -20
  430. package/lib/commonjs/shared/utils/animation/compute-stack-progress.js.map +0 -1
  431. package/lib/commonjs/shared/utils/bounds/constants.js +0 -42
  432. package/lib/commonjs/shared/utils/bounds/constants.js.map +0 -1
  433. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +0 -19
  434. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  435. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +0 -224
  436. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  437. package/lib/commonjs/shared/utils/reanimated/version.js +0 -12
  438. package/lib/commonjs/shared/utils/reanimated/version.js.map +0 -1
  439. package/lib/module/blank-stack/components/overlay.js +0 -152
  440. package/lib/module/blank-stack/components/overlay.js.map +0 -1
  441. package/lib/module/blank-stack/hooks/use-overlay-animation.js +0 -68
  442. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +0 -1
  443. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +0 -1
  444. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +0 -1
  445. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +0 -1
  446. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +0 -1
  447. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +0 -1
  448. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +0 -1
  449. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +0 -1
  450. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js +0 -190
  451. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +0 -1
  452. package/lib/module/blank-stack/utils/with-stack-navigation/index.js +0 -55
  453. package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +0 -1
  454. package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +0 -1
  455. package/lib/module/native-stack/views/FooterComponent.js +0 -13
  456. package/lib/module/native-stack/views/FooterComponent.js.map +0 -1
  457. package/lib/module/shared/components/controllers/blank-stack-lifecycle.js.map +0 -1
  458. package/lib/module/shared/components/controllers/native-stack-lifecycle.js.map +0 -1
  459. package/lib/module/shared/providers/flags.provider.js +0 -19
  460. package/lib/module/shared/providers/flags.provider.js.map +0 -1
  461. package/lib/module/shared/providers/keys.provider.js.map +0 -1
  462. package/lib/module/shared/providers/routes.provider.js +0 -42
  463. package/lib/module/shared/providers/routes.provider.js.map +0 -1
  464. package/lib/module/shared/providers/screen-transition.provider.js.map +0 -1
  465. package/lib/module/shared/providers/transition-styles.provider.js.map +0 -1
  466. package/lib/module/shared/types/core.types.js +0 -4
  467. package/lib/module/shared/types/core.types.js.map +0 -1
  468. package/lib/module/shared/types/utils.types.js +0 -2
  469. package/lib/module/shared/types/utils.types.js.map +0 -1
  470. package/lib/module/shared/utils/animation/compute-stack-progress.js +0 -15
  471. package/lib/module/shared/utils/animation/compute-stack-progress.js.map +0 -1
  472. package/lib/module/shared/utils/bounds/constants.js +0 -37
  473. package/lib/module/shared/utils/bounds/constants.js.map +0 -1
  474. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +0 -14
  475. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +0 -1
  476. package/lib/module/shared/utils/gesture/apply-offset-rules.js +0 -219
  477. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +0 -1
  478. package/lib/module/shared/utils/reanimated/version.js +0 -7
  479. package/lib/module/shared/utils/reanimated/version.js.map +0 -1
  480. package/lib/typescript/blank-stack/components/overlay.d.ts +0 -5
  481. package/lib/typescript/blank-stack/components/overlay.d.ts.map +0 -1
  482. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +0 -12
  483. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +0 -1
  484. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts +0 -3
  485. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +0 -1
  486. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts +0 -4
  487. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +0 -1
  488. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts +0 -4
  489. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +0 -1
  490. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts +0 -3
  491. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +0 -1
  492. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts +0 -3
  493. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +0 -1
  494. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.d.ts.map +0 -1
  495. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-previous.d.ts.map +0 -1
  496. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts +0 -20
  497. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +0 -1
  498. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +0 -4
  499. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +0 -1
  500. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts +0 -22
  501. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +0 -1
  502. package/lib/typescript/native-stack/views/FooterComponent.d.ts +0 -7
  503. package/lib/typescript/native-stack/views/FooterComponent.d.ts.map +0 -1
  504. package/lib/typescript/shared/components/controllers/blank-stack-lifecycle.d.ts.map +0 -1
  505. package/lib/typescript/shared/components/controllers/native-stack-lifecycle.d.ts.map +0 -1
  506. package/lib/typescript/shared/providers/flags.provider.d.ts +0 -10
  507. package/lib/typescript/shared/providers/flags.provider.d.ts.map +0 -1
  508. package/lib/typescript/shared/providers/keys.provider.d.ts +0 -18
  509. package/lib/typescript/shared/providers/keys.provider.d.ts.map +0 -1
  510. package/lib/typescript/shared/providers/routes.provider.d.ts +0 -19
  511. package/lib/typescript/shared/providers/routes.provider.d.ts.map +0 -1
  512. package/lib/typescript/shared/providers/screen-transition.provider.d.ts +0 -14
  513. package/lib/typescript/shared/providers/screen-transition.provider.d.ts.map +0 -1
  514. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +0 -14
  515. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +0 -1
  516. package/lib/typescript/shared/types/core.types.d.ts.map +0 -1
  517. package/lib/typescript/shared/types/utils.types.d.ts +0 -5
  518. package/lib/typescript/shared/types/utils.types.d.ts.map +0 -1
  519. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts +0 -3
  520. package/lib/typescript/shared/utils/animation/compute-stack-progress.d.ts.map +0 -1
  521. package/lib/typescript/shared/utils/bounds/constants.d.ts +0 -7
  522. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +0 -1
  523. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts +0 -7
  524. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +0 -1
  525. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +0 -38
  526. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +0 -1
  527. package/lib/typescript/shared/utils/reanimated/version.d.ts +0 -2
  528. package/lib/typescript/shared/utils/reanimated/version.d.ts.map +0 -1
  529. package/src/blank-stack/components/overlay.tsx +0 -169
  530. package/src/blank-stack/hooks/use-overlay-animation.tsx +0 -86
  531. package/src/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.ts +0 -17
  532. package/src/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.tsx +0 -267
  533. package/src/blank-stack/utils/with-stack-navigation/index.tsx +0 -74
  534. package/src/blank-stack/utils/with-stack-navigation/types.ts +0 -35
  535. package/src/native-stack/views/FooterComponent.tsx +0 -10
  536. package/src/shared/providers/flags.provider.tsx +0 -21
  537. package/src/shared/providers/keys.provider.tsx +0 -57
  538. package/src/shared/providers/routes.provider.tsx +0 -54
  539. package/src/shared/providers/screen-transition.provider.tsx +0 -41
  540. package/src/shared/types/utils.types.ts +0 -4
  541. package/src/shared/utils/animation/compute-stack-progress.ts +0 -16
  542. package/src/shared/utils/bounds/constants.ts +0 -40
  543. package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +0 -24
  544. package/src/shared/utils/gesture/apply-offset-rules.ts +0 -312
  545. package/src/shared/utils/reanimated/version.ts +0 -5
  546. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  547. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  548. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  549. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  550. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  551. /package/lib/commonjs/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  552. /package/lib/module/{blank-stack/utils/with-stack-navigation → component-stack}/types.js +0 -0
  553. /package/lib/module/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.js +0 -0
  554. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/are-descriptors-equal.js +0 -0
  555. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/compose-descriptors.js +0 -0
  556. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/have-same-route-keys.js +0 -0
  557. /package/lib/module/{blank-stack/utils/with-stack-navigation/helpers → shared/utils/navigation}/routes-are-identical.js +0 -0
  558. /package/lib/typescript/{shared/components → native-stack}/controllers/native-stack-lifecycle.d.ts +0 -0
  559. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-closing-route-keys.d.ts +0 -0
  560. /package/lib/typescript/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.d.ts +0 -0
  561. /package/src/{blank-stack/utils/with-stack-navigation/hooks → shared/hooks/navigation}/use-previous.tsx +0 -0
@@ -0,0 +1,80 @@
1
+ import { useLayoutEffect } from "react";
2
+ import { runOnJS, useAnimatedReaction } from "react-native-reanimated";
3
+ import { useHighRefreshRate } from "../../shared/hooks/animation/use-high-refresh-rate";
4
+ import useStableCallback from "../../shared/hooks/use-stable-callback";
5
+ import { useKeys } from "../../shared/providers/screen/keys.provider";
6
+ import { useManagedStackContext } from "../../shared/providers/stack/managed.provider";
7
+ import { AnimationStore } from "../../shared/stores/animation.store";
8
+ import { startScreenTransition } from "../../shared/utils/animation/start-screen-transition";
9
+ import { resetStoresForScreen } from "../../shared/utils/reset-stores-for-screen";
10
+ import type { ComponentStackDescriptor } from "../types";
11
+
12
+ interface Props {
13
+ children: React.ReactNode;
14
+ }
15
+
16
+ /**
17
+ * Lifecycle controller built out for Component Stack implementation.
18
+ * Uses the shared ManagedStackContext for closing route handling.
19
+ */
20
+ export const ComponentStackScreenLifecycleController = ({
21
+ children,
22
+ }: Props) => {
23
+ const { current } = useKeys<ComponentStackDescriptor>();
24
+ const { handleCloseRoute, closingRouteKeysShared } = useManagedStackContext();
25
+
26
+ const animations = AnimationStore.getAll(current.route.key);
27
+
28
+ const { deactivateHighRefreshRate, activateHighRefreshRate } =
29
+ useHighRefreshRate(current);
30
+
31
+ const handleInitialize = useStableCallback(() => {
32
+ activateHighRefreshRate();
33
+ startScreenTransition({
34
+ target: "open",
35
+ spec: current.options.transitionSpec,
36
+ animations,
37
+ onAnimationFinish: deactivateHighRefreshRate,
38
+ });
39
+ });
40
+
41
+ const handleCleanup = useStableCallback(() => {
42
+ resetStoresForScreen(current);
43
+ });
44
+
45
+ const handleCloseEnd = useStableCallback((finished: boolean) => {
46
+ deactivateHighRefreshRate();
47
+ if (!finished) {
48
+ return;
49
+ }
50
+ handleCloseRoute({ route: current.route });
51
+ });
52
+
53
+ useAnimatedReaction(
54
+ () => ({
55
+ keys: closingRouteKeysShared.value,
56
+ }),
57
+ ({ keys }) => {
58
+ if (!keys.includes(current.route.key)) {
59
+ return;
60
+ }
61
+
62
+ runOnJS(activateHighRefreshRate)();
63
+ startScreenTransition({
64
+ target: "close",
65
+ spec: current.options.transitionSpec,
66
+ animations,
67
+ onAnimationFinish: handleCloseEnd,
68
+ });
69
+ },
70
+ );
71
+
72
+ useLayoutEffect(() => {
73
+ handleInitialize();
74
+ return () => {
75
+ handleCleanup();
76
+ };
77
+ }, [handleInitialize, handleCleanup]);
78
+
79
+ return children;
80
+ };
@@ -0,0 +1,388 @@
1
+ import * as React from "react";
2
+ import { useCallback, useMemo, useReducer, useRef } from "react";
3
+ import type {
4
+ ComponentNavigation,
5
+ ComponentRoute,
6
+ ComponentScreenConfig,
7
+ ComponentScreenProps,
8
+ ComponentStackDescriptor,
9
+ ComponentStackDescriptorMap,
10
+ ComponentStackNavigationOptions,
11
+ ComponentStackState,
12
+ } from "../types";
13
+
14
+ // Generate unique keys for routes
15
+ let keyCounter = 0;
16
+ const generateKey = () => `component-route-${++keyCounter}`;
17
+
18
+ // Generate unique key for stack instance
19
+ const generateStackKey = () => `component-stack-${Date.now()}`;
20
+
21
+ type NavigationAction =
22
+ | { type: "PUSH"; name: string; params?: Record<string, unknown> }
23
+ | { type: "POP" }
24
+ | { type: "POP_BY_KEY"; key: string }
25
+ | { type: "NAVIGATE"; name: string; params?: Record<string, unknown> }
26
+ | { type: "RESET"; name?: string; params?: Record<string, unknown> };
27
+
28
+ interface ScreenRegistry {
29
+ [name: string]: ComponentScreenConfig;
30
+ }
31
+
32
+ function createRoute(
33
+ name: string,
34
+ params?: Record<string, unknown>,
35
+ ): ComponentRoute {
36
+ return {
37
+ key: generateKey(),
38
+ name,
39
+ params,
40
+ };
41
+ }
42
+
43
+ function navigationReducer(
44
+ state: ComponentStackState,
45
+ action: NavigationAction & {
46
+ screens: ScreenRegistry;
47
+ initialRouteName: string;
48
+ },
49
+ ): ComponentStackState {
50
+ switch (action.type) {
51
+ case "PUSH": {
52
+ if (!action.screens[action.name]) {
53
+ console.warn(
54
+ `[ComponentStack] Screen "${action.name}" not found in navigator`,
55
+ );
56
+ return state;
57
+ }
58
+ const newRoute = createRoute(action.name, action.params);
59
+ return {
60
+ ...state,
61
+ routes: [...state.routes, newRoute],
62
+ index: state.routes.length,
63
+ };
64
+ }
65
+
66
+ case "POP": {
67
+ if (state.routes.length <= 1) {
68
+ return state;
69
+ }
70
+ return {
71
+ ...state,
72
+ routes: state.routes.slice(0, -1),
73
+ index: state.index - 1,
74
+ };
75
+ }
76
+
77
+ case "POP_BY_KEY": {
78
+ const routeIndex = state.routes.findIndex(
79
+ (route) => route.key === action.key,
80
+ );
81
+ if (routeIndex === -1) {
82
+ // Route not found, nothing to do
83
+ return state;
84
+ }
85
+ if (state.routes.length <= 1) {
86
+ // Can't pop the last route
87
+ return state;
88
+ }
89
+ const nextRoutes = state.routes.filter(
90
+ (route) => route.key !== action.key,
91
+ );
92
+ return {
93
+ ...state,
94
+ routes: nextRoutes,
95
+ index: Math.min(state.index, nextRoutes.length - 1),
96
+ };
97
+ }
98
+
99
+ case "NAVIGATE": {
100
+ if (!action.screens[action.name]) {
101
+ console.warn(
102
+ `[ComponentStack] Screen "${action.name}" not found in navigator`,
103
+ );
104
+ return state;
105
+ }
106
+ // Check if screen already exists in stack
107
+ const existingIndex = state.routes.findIndex(
108
+ (route) => route.name === action.name,
109
+ );
110
+ if (existingIndex !== -1) {
111
+ // Navigate to existing screen (pop to it)
112
+ return {
113
+ ...state,
114
+ routes: state.routes.slice(0, existingIndex + 1),
115
+ index: existingIndex,
116
+ };
117
+ }
118
+ // Push new screen
119
+ const newRoute = createRoute(action.name, action.params);
120
+ return {
121
+ ...state,
122
+ routes: [...state.routes, newRoute],
123
+ index: state.routes.length,
124
+ };
125
+ }
126
+
127
+ case "RESET": {
128
+ const targetName = action.name || action.initialRouteName;
129
+ if (!action.screens[targetName]) {
130
+ console.warn(
131
+ `[ComponentStack] Screen "${targetName}" not found in navigator`,
132
+ );
133
+ return state;
134
+ }
135
+ const newRoute = createRoute(targetName, action.params);
136
+ return {
137
+ ...state,
138
+ routes: [newRoute],
139
+ index: 0,
140
+ };
141
+ }
142
+
143
+ default:
144
+ return state;
145
+ }
146
+ }
147
+
148
+ interface UseComponentNavigationBuilderOptions {
149
+ children: React.ReactNode;
150
+ initialRouteName?: string;
151
+ screenOptions?: ComponentStackNavigationOptions;
152
+ }
153
+
154
+ interface ComponentNavigationBuilderResult {
155
+ state: ComponentStackState;
156
+ navigation: ComponentNavigation;
157
+ describe: (
158
+ route: ComponentRoute,
159
+ placeholder: boolean,
160
+ ) => ComponentStackDescriptor;
161
+ descriptors: ComponentStackDescriptorMap;
162
+ NavigationContent: React.FC<{ children: React.ReactNode }>;
163
+ }
164
+
165
+ /**
166
+ * Parse children to extract screen configurations.
167
+ * Expects children to be ComponentScreen elements.
168
+ */
169
+ function parseScreens(children: React.ReactNode): ScreenRegistry {
170
+ const screens: ScreenRegistry = {};
171
+
172
+ React.Children.forEach(children, (child) => {
173
+ if (!React.isValidElement(child)) {
174
+ return;
175
+ }
176
+
177
+ const props = child.props as ComponentScreenProps;
178
+ if (props.name && props.component) {
179
+ screens[props.name] = {
180
+ name: props.name,
181
+ component: props.component,
182
+ options: props.options,
183
+ };
184
+ }
185
+ });
186
+
187
+ return screens;
188
+ }
189
+
190
+ export function useComponentNavigationBuilder({
191
+ children,
192
+ initialRouteName,
193
+ screenOptions,
194
+ }: UseComponentNavigationBuilderOptions): ComponentNavigationBuilderResult {
195
+ // Parse screen configs from children
196
+ const screens = useMemo(() => parseScreens(children), [children]);
197
+
198
+ // Determine initial route
199
+ const screenNames = Object.keys(screens);
200
+ const initialRoute = initialRouteName || screenNames[0];
201
+
202
+ if (!initialRoute) {
203
+ throw new Error(
204
+ "[ComponentStack] No screens defined. Add at least one ComponentStack.Screen child.",
205
+ );
206
+ }
207
+
208
+ // Stable stack key
209
+ const stackKeyRef = useRef(generateStackKey());
210
+
211
+ // Navigation state reducer
212
+ const [state, internalDispatch] = useReducer(
213
+ (state: ComponentStackState, action: NavigationAction) =>
214
+ navigationReducer(state, {
215
+ ...action,
216
+ screens,
217
+ initialRouteName: initialRoute,
218
+ }),
219
+ {
220
+ routes: [createRoute(initialRoute)],
221
+ index: 0,
222
+ key: stackKeyRef.current,
223
+ },
224
+ );
225
+
226
+ // Dispatch method that handles both internal actions and StackActions format
227
+ const dispatch = useCallback(
228
+ (
229
+ action:
230
+ | NavigationAction
231
+ | { type: string; source?: string; target?: string; payload?: unknown },
232
+ ) => {
233
+ // Handle StackActions.pop() format from useLocalRoutes: { type: 'POP', source: routeKey }
234
+ if (
235
+ action.type === "POP" &&
236
+ "source" in action &&
237
+ typeof action.source === "string"
238
+ ) {
239
+ internalDispatch({ type: "POP_BY_KEY", key: action.source });
240
+ return;
241
+ }
242
+
243
+ // Handle standard internal actions
244
+ switch (action.type) {
245
+ case "PUSH":
246
+ if ("name" in action && typeof action.name === "string") {
247
+ internalDispatch({
248
+ type: "PUSH",
249
+ name: action.name,
250
+ params: action.params as Record<string, unknown> | undefined,
251
+ });
252
+ }
253
+ break;
254
+ case "POP":
255
+ internalDispatch({ type: "POP" });
256
+ break;
257
+ case "NAVIGATE":
258
+ if ("name" in action && typeof action.name === "string") {
259
+ internalDispatch({
260
+ type: "NAVIGATE",
261
+ name: action.name,
262
+ params: action.params as Record<string, unknown> | undefined,
263
+ });
264
+ }
265
+ break;
266
+ case "RESET":
267
+ internalDispatch({
268
+ type: "RESET",
269
+ name:
270
+ "name" in action
271
+ ? (action.name as string | undefined)
272
+ : undefined,
273
+ params:
274
+ "params" in action
275
+ ? (action.params as Record<string, unknown> | undefined)
276
+ : undefined,
277
+ });
278
+ break;
279
+ case "POP_BY_KEY":
280
+ if ("key" in action && typeof action.key === "string") {
281
+ internalDispatch({ type: "POP_BY_KEY", key: action.key });
282
+ }
283
+ break;
284
+ }
285
+ },
286
+ [],
287
+ );
288
+
289
+ // Ref for getState to always return latest state
290
+ const stateRef = useRef(state);
291
+ stateRef.current = state;
292
+
293
+ // Navigation object
294
+ const navigation: ComponentNavigation = useMemo(() => {
295
+ return {
296
+ push: (name: string, params?: Record<string, unknown>) => {
297
+ internalDispatch({ type: "PUSH", name, params });
298
+ },
299
+ pop: () => {
300
+ internalDispatch({ type: "POP" });
301
+ },
302
+ goBack: () => {
303
+ internalDispatch({ type: "POP" });
304
+ },
305
+ navigate: (name: string, params?: Record<string, unknown>) => {
306
+ internalDispatch({ type: "NAVIGATE", name, params });
307
+ },
308
+ canGoBack: () => stateRef.current.routes.length > 1,
309
+ reset: (name?: string, params?: Record<string, unknown>) => {
310
+ internalDispatch({ type: "RESET", name, params });
311
+ },
312
+ dispatch,
313
+ getState: () => stateRef.current,
314
+ index: state.index,
315
+ };
316
+ }, [state.index, dispatch]);
317
+
318
+ // Build descriptors for each route
319
+ const descriptors = useMemo(() => {
320
+ const result: ComponentStackDescriptorMap = {};
321
+
322
+ for (const route of state.routes) {
323
+ const screenConfig = screens[route.name];
324
+ if (!screenConfig) {
325
+ continue;
326
+ }
327
+
328
+ const Component = screenConfig.component;
329
+ const mergedOptions: ComponentStackNavigationOptions = {
330
+ ...screenOptions,
331
+ ...screenConfig.options,
332
+ };
333
+
334
+ const descriptor: ComponentStackDescriptor = {
335
+ route,
336
+ navigation,
337
+ options: mergedOptions,
338
+ render: (): React.JSX.Element => (
339
+ <Component navigation={navigation} route={route} />
340
+ ),
341
+ };
342
+
343
+ result[route.key] = descriptor;
344
+ }
345
+
346
+ return result;
347
+ }, [state.routes, screens, screenOptions, navigation]);
348
+
349
+ // Describe function: creates a descriptor for a route (used for placeholder screens)
350
+ const describe = useCallback(
351
+ (route: ComponentRoute, placeholder: boolean): ComponentStackDescriptor => {
352
+ const screenConfig = screens[route.name];
353
+ const mergedOptions: ComponentStackNavigationOptions = {
354
+ ...screenOptions,
355
+ ...screenConfig?.options,
356
+ };
357
+
358
+ const Component = screenConfig?.component;
359
+
360
+ return {
361
+ route,
362
+ navigation,
363
+ options: mergedOptions,
364
+ render: (): React.JSX.Element | null =>
365
+ placeholder || !Component ? null : (
366
+ <Component navigation={navigation} route={route} />
367
+ ),
368
+ };
369
+ },
370
+ [screens, screenOptions, navigation],
371
+ );
372
+
373
+ // NavigationContent wrapper (simple pass-through for component-stack)
374
+ const NavigationContent = useCallback(
375
+ ({ children }: { children: React.ReactNode }) => {
376
+ return <>{children}</>;
377
+ },
378
+ [],
379
+ );
380
+
381
+ return {
382
+ state,
383
+ navigation,
384
+ describe,
385
+ descriptors,
386
+ NavigationContent,
387
+ };
388
+ }
@@ -0,0 +1,22 @@
1
+ import { useComponentNavigationContext } from "../navigators/create-component-navigator";
2
+
3
+ /**
4
+ * Hook to access the component navigation object from within a screen.
5
+ *
6
+ * @example
7
+ * ```tsx
8
+ * function MyScreen() {
9
+ * const navigation = useComponentNavigation();
10
+ *
11
+ * return (
12
+ * <Button
13
+ * title="Go to Details"
14
+ * onPress={() => navigation.push('Details')}
15
+ * />
16
+ * );
17
+ * }
18
+ * ```
19
+ */
20
+ export function useComponentNavigation() {
21
+ return useComponentNavigationContext();
22
+ }
@@ -0,0 +1,16 @@
1
+ export { useComponentNavigation } from "./hooks/use-component-navigation";
2
+ export { createComponentNavigator } from "./navigators/create-component-navigator";
3
+ export type {
4
+ ComponentNavigation,
5
+ ComponentNavigatorProps,
6
+ ComponentRoute,
7
+ ComponentScreenConfig,
8
+ ComponentScreenProps,
9
+ ComponentStackDescriptor,
10
+ ComponentStackNavigationOptions,
11
+ ComponentStackOverlayProps,
12
+ ComponentStackScene,
13
+ ComponentStackScreenProps,
14
+ ComponentStackScreenTransitionConfig,
15
+ ComponentStackState,
16
+ } from "./types";
@@ -0,0 +1,104 @@
1
+ import * as React from "react";
2
+ import type { ManagedStackProps } from "../../shared/providers/stack/managed.provider";
3
+ import { ComponentView } from "../components/component-view";
4
+ import { useComponentNavigationBuilder } from "../hooks/use-component-navigation-builder";
5
+ import type {
6
+ ComponentNavigation,
7
+ ComponentNavigatorProps,
8
+ ComponentScreenProps,
9
+ ComponentStackDescriptor,
10
+ } from "../types";
11
+
12
+ // Context for component navigation
13
+ const ComponentNavigationContext =
14
+ React.createContext<ComponentNavigation | null>(null);
15
+
16
+ export function useComponentNavigationContext(): ComponentNavigation {
17
+ const context = React.useContext(ComponentNavigationContext);
18
+ if (!context) {
19
+ throw new Error(
20
+ "useComponentNavigation must be used within a ComponentStack.Navigator",
21
+ );
22
+ }
23
+ return context;
24
+ }
25
+
26
+ /**
27
+ * Screen component for defining screens in a ComponentNavigator.
28
+ * This is a configuration component - it doesn't render anything itself.
29
+ */
30
+ function ComponentScreen(_props: ComponentScreenProps): null {
31
+ return null;
32
+ }
33
+
34
+ /**
35
+ * Navigator component that manages internal component navigation.
36
+ * Does not affect React Navigation or Expo Router routes.
37
+ */
38
+ function ComponentNavigator({
39
+ children,
40
+ initialRouteName,
41
+ screenOptions,
42
+ }: ComponentNavigatorProps) {
43
+ const { state, navigation, describe, descriptors, NavigationContent } =
44
+ useComponentNavigationBuilder({
45
+ children,
46
+ initialRouteName,
47
+ screenOptions,
48
+ });
49
+
50
+ const managedStackProps: ManagedStackProps<
51
+ ComponentStackDescriptor,
52
+ ComponentNavigation
53
+ > = {
54
+ state,
55
+ navigation,
56
+ describe,
57
+ descriptors,
58
+ };
59
+
60
+ return (
61
+ <ComponentNavigationContext.Provider value={navigation}>
62
+ <NavigationContent>
63
+ <ComponentView {...managedStackProps} />
64
+ </NavigationContent>
65
+ </ComponentNavigationContext.Provider>
66
+ );
67
+ }
68
+
69
+ interface ComponentStack {
70
+ Navigator: React.FC<ComponentNavigatorProps>;
71
+ Screen: React.FC<ComponentScreenProps>;
72
+ }
73
+
74
+ /**
75
+ * Creates a component navigation stack.
76
+ *
77
+ * @example
78
+ * ```tsx
79
+ * const Stack = createComponentNavigator();
80
+ *
81
+ * function MyComponent() {
82
+ * return (
83
+ * <Stack.Navigator initialRouteName="Home">
84
+ * <Stack.Screen
85
+ * name="Home"
86
+ * component={HomeScreen}
87
+ * options={{ ...SlideFromBottom() }}
88
+ * />
89
+ * <Stack.Screen
90
+ * name="Details"
91
+ * component={DetailsScreen}
92
+ * options={{ ...SlideFromBottom() }}
93
+ * />
94
+ * </Stack.Navigator>
95
+ * );
96
+ * }
97
+ * ```
98
+ */
99
+ export function createComponentNavigator(): ComponentStack {
100
+ return {
101
+ Navigator: ComponentNavigator,
102
+ Screen: ComponentScreen,
103
+ };
104
+ }