react-native-screen-transitions 3.0.0-rc.1 → 3.0.0-rc.3

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 (233) hide show
  1. package/README.md +421 -371
  2. package/lib/commonjs/blank-stack/components/{Overlay.js → overlay.js} +11 -12
  3. package/lib/commonjs/blank-stack/components/overlay.js.map +1 -0
  4. package/lib/commonjs/blank-stack/components/{Screens.js → screens.js} +8 -10
  5. package/lib/commonjs/blank-stack/components/screens.js.map +1 -0
  6. package/lib/commonjs/blank-stack/components/stack-view.js +95 -0
  7. package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -0
  8. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +2 -3
  9. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  10. package/lib/commonjs/blank-stack/index.js +1 -8
  11. package/lib/commonjs/blank-stack/index.js.map +1 -1
  12. package/lib/commonjs/blank-stack/navigators/{createBlankStackNavigator.js → create-blank-stack-navigator.js} +3 -3
  13. package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -0
  14. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
  15. package/lib/{module/blank-stack/utils/with-stack-navigation/_utils → commonjs/blank-stack/utils/with-stack-navigation/helpers}/calculate-active-screens-limit.js.map +1 -1
  16. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js +15 -0
  17. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
  18. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
  19. package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
  20. package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +1 -12
  21. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
  22. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
  23. package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
  24. package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
  25. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +50 -56
  26. package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
  27. package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_types.js → types.js} +1 -1
  28. package/lib/commonjs/blank-stack/utils/with-stack-navigation/types.js.map +1 -0
  29. package/lib/commonjs/shared/configs/presets.js +8 -2
  30. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  31. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +42 -21
  32. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  33. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  34. package/lib/commonjs/shared/providers/flags.provider.js +25 -0
  35. package/lib/commonjs/shared/providers/flags.provider.js.map +1 -0
  36. package/lib/commonjs/shared/providers/register-bounds.provider.js +71 -45
  37. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  38. package/lib/commonjs/shared/stores/bounds.store.js +91 -47
  39. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -1
  40. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +1 -1
  41. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -1
  42. package/lib/commonjs/shared/utils/bounds/index.js +4 -5
  43. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  44. package/lib/commonjs/shared/utils/create-provider.js +20 -1
  45. package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
  46. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +2 -0
  47. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -1
  48. package/lib/module/blank-stack/components/{Overlay.js → overlay.js} +11 -12
  49. package/lib/module/blank-stack/components/overlay.js.map +1 -0
  50. package/lib/module/blank-stack/components/{Screens.js → screens.js} +8 -10
  51. package/lib/module/blank-stack/components/screens.js.map +1 -0
  52. package/lib/module/blank-stack/components/stack-view.js +90 -0
  53. package/lib/module/blank-stack/components/stack-view.js.map +1 -0
  54. package/lib/module/blank-stack/hooks/use-overlay-animation.js +2 -3
  55. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  56. package/lib/module/blank-stack/index.js +1 -2
  57. package/lib/module/blank-stack/index.js.map +1 -1
  58. package/lib/module/blank-stack/navigators/{createBlankStackNavigator.js → create-blank-stack-navigator.js} +2 -2
  59. package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -0
  60. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
  61. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +1 -0
  62. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js +10 -0
  63. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
  64. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
  65. package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
  66. package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +1 -12
  67. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
  68. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
  69. package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
  70. package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
  71. package/lib/module/blank-stack/utils/with-stack-navigation/index.js +49 -55
  72. package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
  73. package/lib/module/blank-stack/utils/with-stack-navigation/types.js +4 -0
  74. package/lib/module/blank-stack/utils/with-stack-navigation/types.js.map +1 -0
  75. package/lib/module/shared/configs/presets.js +8 -2
  76. package/lib/module/shared/configs/presets.js.map +1 -1
  77. package/lib/module/shared/hooks/animation/use-screen-animation.js +42 -21
  78. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  79. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  80. package/lib/module/shared/providers/flags.provider.js +19 -0
  81. package/lib/module/shared/providers/flags.provider.js.map +1 -0
  82. package/lib/module/shared/providers/register-bounds.provider.js +71 -45
  83. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  84. package/lib/module/shared/stores/bounds.store.js +91 -47
  85. package/lib/module/shared/stores/bounds.store.js.map +1 -1
  86. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +1 -1
  87. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -1
  88. package/lib/module/shared/utils/bounds/index.js +4 -5
  89. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  90. package/lib/module/shared/utils/create-provider.js +20 -1
  91. package/lib/module/shared/utils/create-provider.js.map +1 -1
  92. package/lib/module/shared/utils/reset-stores-for-screen.js +2 -0
  93. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -1
  94. package/lib/typescript/blank-stack/components/{Overlay.d.ts → overlay.d.ts} +1 -1
  95. package/lib/typescript/blank-stack/components/overlay.d.ts.map +1 -0
  96. package/lib/typescript/blank-stack/components/{Screens.d.ts → screens.d.ts} +1 -1
  97. package/lib/typescript/blank-stack/components/{Screens.d.ts.map → screens.d.ts.map} +1 -1
  98. package/lib/typescript/blank-stack/components/stack-view.d.ts +3 -0
  99. package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -0
  100. package/lib/typescript/blank-stack/index.d.ts +1 -2
  101. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  102. package/lib/typescript/blank-stack/navigators/{createBlankStackNavigator.d.ts → create-blank-stack-navigator.d.ts} +1 -1
  103. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -0
  104. package/lib/typescript/blank-stack/types.d.ts +23 -105
  105. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  106. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +1 -0
  107. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +1 -0
  108. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +1 -0
  109. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +1 -0
  110. package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +1 -0
  111. package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts.map +1 -1
  112. package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts.map +1 -1
  113. package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.d.ts +1 -1
  114. package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +1 -0
  115. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts +3 -5
  116. package/lib/typescript/blank-stack/utils/with-stack-navigation/index.d.ts.map +1 -1
  117. package/lib/typescript/blank-stack/utils/with-stack-navigation/{_types.d.ts → types.d.ts} +1 -1
  118. package/lib/typescript/blank-stack/utils/with-stack-navigation/types.d.ts.map +1 -0
  119. package/lib/typescript/native-stack/types.d.ts +7 -1
  120. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  121. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  122. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  123. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  124. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  125. package/lib/typescript/shared/index.d.ts +32 -32
  126. package/lib/typescript/shared/index.d.ts.map +1 -1
  127. package/lib/typescript/shared/providers/flags.provider.d.ts +10 -0
  128. package/lib/typescript/shared/providers/flags.provider.d.ts.map +1 -0
  129. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  130. package/lib/typescript/shared/stores/bounds.store.d.ts +23 -11
  131. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -1
  132. package/lib/typescript/shared/types/bounds.types.d.ts +2 -2
  133. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  134. package/lib/typescript/shared/types/core.types.d.ts +0 -4
  135. package/lib/typescript/shared/types/core.types.d.ts.map +1 -1
  136. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  137. package/lib/typescript/shared/utils/create-provider.d.ts +2 -2
  138. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
  139. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -1
  140. package/package.json +2 -1
  141. package/src/blank-stack/components/{Overlay.tsx → overlay.tsx} +9 -12
  142. package/src/blank-stack/components/{Screens.tsx → screens.tsx} +7 -9
  143. package/src/blank-stack/components/stack-view.tsx +104 -0
  144. package/src/blank-stack/hooks/use-overlay-animation.tsx +11 -11
  145. package/src/blank-stack/index.ts +1 -2
  146. package/src/blank-stack/navigators/{createBlankStackNavigator.tsx → create-blank-stack-navigator.tsx} +1 -1
  147. package/src/blank-stack/types.ts +31 -109
  148. package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.ts +1 -8
  149. package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.tsx +1 -12
  150. package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx +5 -5
  151. package/src/blank-stack/utils/with-stack-navigation/index.tsx +43 -63
  152. package/src/native-stack/types.ts +8 -1
  153. package/src/shared/__tests__/bounds.store.test.ts +398 -167
  154. package/src/shared/__tests__/determine-dismissal.test.ts +2 -12
  155. package/src/shared/__tests__/geometry.test.ts +1 -1
  156. package/src/shared/__tests__/gesture.velocity.test.ts +2 -10
  157. package/src/shared/configs/presets.ts +8 -2
  158. package/src/shared/hooks/animation/use-screen-animation.tsx +65 -31
  159. package/src/shared/hooks/gestures/use-build-gestures.tsx +4 -1
  160. package/src/shared/providers/flags.provider.tsx +21 -0
  161. package/src/shared/providers/register-bounds.provider.tsx +85 -54
  162. package/src/shared/stores/bounds.store.ts +90 -54
  163. package/src/shared/types/bounds.types.ts +2 -2
  164. package/src/shared/types/core.types.ts +4 -6
  165. package/src/shared/utils/bounds/helpers/is-bounds-equal.ts +1 -1
  166. package/src/shared/utils/bounds/index.ts +7 -10
  167. package/src/shared/utils/create-provider.tsx +35 -1
  168. package/src/shared/utils/reset-stores-for-screen.ts +2 -0
  169. package/lib/commonjs/blank-stack/components/Overlay.js.map +0 -1
  170. package/lib/commonjs/blank-stack/components/Screens.js.map +0 -1
  171. package/lib/commonjs/blank-stack/components/StackView.js +0 -93
  172. package/lib/commonjs/blank-stack/components/StackView.js.map +0 -1
  173. package/lib/commonjs/blank-stack/navigators/createBlankStackNavigator.js.map +0 -1
  174. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
  175. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
  176. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
  177. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_types.js.map +0 -1
  178. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
  179. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js.map +0 -1
  180. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +0 -25
  181. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
  182. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
  183. package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
  184. package/lib/module/blank-stack/components/Overlay.js.map +0 -1
  185. package/lib/module/blank-stack/components/Screens.js.map +0 -1
  186. package/lib/module/blank-stack/components/StackView.js +0 -88
  187. package/lib/module/blank-stack/components/StackView.js.map +0 -1
  188. package/lib/module/blank-stack/navigators/createBlankStackNavigator.js.map +0 -1
  189. package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
  190. package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
  191. package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
  192. package/lib/module/blank-stack/utils/with-stack-navigation/_types.js +0 -4
  193. package/lib/module/blank-stack/utils/with-stack-navigation/_types.js.map +0 -1
  194. package/lib/module/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
  195. package/lib/module/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +0 -20
  196. package/lib/module/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
  197. package/lib/module/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
  198. package/lib/module/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
  199. package/lib/typescript/blank-stack/components/Overlay.d.ts.map +0 -1
  200. package/lib/typescript/blank-stack/components/StackView.d.ts +0 -2
  201. package/lib/typescript/blank-stack/components/StackView.d.ts.map +0 -1
  202. package/lib/typescript/blank-stack/navigators/createBlankStackNavigator.d.ts.map +0 -1
  203. package/lib/typescript/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts.map +0 -1
  204. package/lib/typescript/blank-stack/utils/with-stack-navigation/_types.d.ts.map +0 -1
  205. package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts.map +0 -1
  206. package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.d.ts.map +0 -1
  207. package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts.map +0 -1
  208. package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts.map +0 -1
  209. package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts.map +0 -1
  210. package/src/blank-stack/components/StackView.tsx +0 -108
  211. /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
  212. /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
  213. /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
  214. /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
  215. /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
  216. /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
  217. /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
  218. /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
  219. /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
  220. /package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
  221. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.d.ts +0 -0
  222. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.d.ts +0 -0
  223. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.d.ts +0 -0
  224. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.d.ts +0 -0
  225. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.d.ts +0 -0
  226. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts +0 -0
  227. /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts +0 -0
  228. /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.ts +0 -0
  229. /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.ts +0 -0
  230. /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.ts +0 -0
  231. /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.ts +0 -0
  232. /package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.tsx +0 -0
  233. /package/src/blank-stack/utils/with-stack-navigation/{_types.ts → types.ts} +0 -0
@@ -3,12 +3,12 @@
3
3
  * https://github.com/MatiPl01/react-native-sortables/blob/main/packages/react-native-sortables/src/providers/utils/createProvider.tsx
4
4
  * SUPER COOL AMAZING UTILITY
5
5
  */
6
- import { type ReactNode } from "react";
6
+ import { type ComponentType, type ReactNode } from "react";
7
7
  export default function createProvider<ProviderName extends string, Guarded extends boolean = true>(name: ProviderName, options?: {
8
8
  guarded?: Guarded;
9
9
  }): <ProviderProps extends object, ContextValue>(factory: (props: ProviderProps) => {
10
10
  value?: ContextValue;
11
11
  enabled?: boolean;
12
12
  children?: ReactNode;
13
- }) => { [P in ProviderName as `${P}Context`]: React.Context<ContextValue>; } & { [P in ProviderName as `${P}Provider`]: React.FC<ProviderProps>; } & { [P in ProviderName as `use${P}Context`]: () => Guarded extends true ? ContextValue : ContextValue | null; };
13
+ }) => { [P in ProviderName as `${P}Context`]: React.Context<ContextValue>; } & { [P in ProviderName as `${P}Provider`]: React.FC<ProviderProps>; } & { [P in ProviderName as `use${P}Context`]: () => Guarded extends true ? ContextValue : ContextValue | null; } & { [P in ProviderName as `with${P}Provider`]: (Component: ComponentType<ContextValue>) => React.FC<ProviderProps>; };
14
14
  //# sourceMappingURL=create-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/create-provider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE3E,MAAM,CAAC,OAAO,UAAU,cAAc,CACrC,YAAY,SAAS,MAAM,EAC3B,OAAO,SAAS,OAAO,GAAG,IAAI,EAC7B,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,IAC5C,aAAa,SAAS,MAAM,EAAE,YAAY,EACjD,SAAS,CAAC,KAAK,EAAE,aAAa,KAAK;IAClC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,KA4CI,GACH,CAAC,IAAI,YAAY,IAAI,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,GACjE,GAAG,GACF,CAAC,IAAI,YAAY,IAAI,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,GAC9D,GAAG,GACF,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,SAAS,GAAG,MAAM,OAAO,SAAS,IAAI,GAChE,YAAY,GACZ,YAAY,GAAG,IAAI,GACtB,CAEF"}
1
+ {"version":3,"file":"create-provider.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/create-provider.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACN,KAAK,aAAa,EAElB,KAAK,SAAS,EAGd,MAAM,OAAO,CAAC;AAEf,MAAM,CAAC,OAAO,UAAU,cAAc,CACrC,YAAY,SAAS,MAAM,EAC3B,OAAO,SAAS,OAAO,GAAG,IAAI,EAC7B,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,IAC5C,aAAa,SAAS,MAAM,EAAE,YAAY,EACjD,SAAS,CAAC,KAAK,EAAE,aAAa,KAAK;IAClC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB,KAoEI,GACH,CAAC,IAAI,YAAY,IAAI,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,GACjE,GAAG,GACF,CAAC,IAAI,YAAY,IAAI,GAAG,CAAC,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,GAC9D,GAAG,GACF,CAAC,IAAI,YAAY,IAAI,MAAM,CAAC,SAAS,GAAG,MAAM,OAAO,SAAS,IAAI,GAChE,YAAY,GACZ,YAAY,GAAG,IAAI,GACtB,GAAG,GACF,CAAC,IAAI,YAAY,IAAI,OAAO,CAAC,UAAU,GAAG,CAC1C,SAAS,EAAE,aAAa,CAAC,YAAY,CAAC,KAClC,KAAK,CAAC,EAAE,CAAC,aAAa,CAAC,GAC5B,CAEF"}
@@ -1 +1 @@
1
- {"version":3,"file":"reset-stores-for-screen.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/reset-stores-for-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIvE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,oBAAoB,SAGjE,CAAC"}
1
+ {"version":3,"file":"reset-stores-for-screen.d.ts","sourceRoot":"","sources":["../../../../src/shared/utils/reset-stores-for-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKvE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,oBAAoB,SAIjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-screen-transitions",
3
- "version": "3.0.0-rc.1",
3
+ "version": "3.0.0-rc.3",
4
4
  "description": "Easy screen transitions for React Native and Expo",
5
5
  "author": "Ed",
6
6
  "license": "MIT",
@@ -36,6 +36,7 @@
36
36
  "scripts": {
37
37
  "build": "bob build",
38
38
  "lint": "biome check ./src",
39
+ "typecheck": "tsc --noEmit",
39
40
  "prepublishOnly": "bun run build"
40
41
  },
41
42
  "keywords": [
@@ -4,7 +4,6 @@ import {
4
4
  } from "@react-navigation/native";
5
5
  import { useMemo } from "react";
6
6
  import { Animated, StyleSheet, View } from "react-native";
7
- import { useSafeAreaInsets } from "react-native-safe-area-context";
8
7
  import { useScreenAnimation } from "../../shared/hooks/animation/use-screen-animation";
9
8
  import { KeysProvider, useKeys } from "../../shared/providers/keys.provider";
10
9
  import { TransitionStylesProvider } from "../../shared/providers/transition-styles.provider";
@@ -45,12 +44,10 @@ const getActiveFloatOverlay = (scenes: BlankStackScene[], index: number) => {
45
44
  };
46
45
 
47
46
  const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
48
- const insets = useSafeAreaInsets();
49
-
50
47
  const OverlayComponent = scene.descriptor.options.overlay;
51
48
 
52
49
  const { overlayAnimation, optimisticActiveIndex } = useOverlayAnimation();
53
- const { scenes } = useStackNavigationContext();
50
+ const { scenes, routes } = useStackNavigationContext();
54
51
 
55
52
  const overlaySceneIndex = useMemo(() => {
56
53
  return scenes.findIndex(
@@ -58,9 +55,9 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
58
55
  );
59
56
  }, [scenes, scene.route.key]);
60
57
 
61
- const focusedRoute = useMemo(() => {
58
+ const focusedScene = useMemo(() => {
62
59
  if (overlaySceneIndex === -1) {
63
- return scene.route;
60
+ return scene;
64
61
  }
65
62
 
66
63
  const maxOffset = Math.max(scenes.length - overlaySceneIndex - 1, 0);
@@ -69,8 +66,8 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
69
66
  maxOffset,
70
67
  );
71
68
 
72
- return scenes[overlaySceneIndex + normalizedIndex]?.route ?? scene.route;
73
- }, [overlaySceneIndex, optimisticActiveIndex, scenes, scene.route]);
69
+ return scenes[overlaySceneIndex + normalizedIndex] ?? scene;
70
+ }, [overlaySceneIndex, optimisticActiveIndex, scenes, scene]);
74
71
 
75
72
  const screenAnimation = useScreenAnimation();
76
73
 
@@ -79,13 +76,13 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
79
76
  }
80
77
 
81
78
  const overlayProps: BlankStackOverlayProps = {
82
- route: scene.route,
83
- focusedRoute,
84
- navigation: scene.descriptor.navigation,
79
+ routes,
85
80
  overlayAnimation,
86
81
  screenAnimation,
82
+ focusedRoute: focusedScene.route,
87
83
  focusedIndex: optimisticActiveIndex,
88
- insets,
84
+ overlayOptions: focusedScene.descriptor.options.overlayOptions,
85
+ navigation: scene.descriptor.navigation,
89
86
  };
90
87
 
91
88
  return (
@@ -1,4 +1,3 @@
1
- import type { NavigationRoute, ParamListBase } from "@react-navigation/native";
2
1
  import type * as React from "react";
3
2
  import { StyleSheet } from "react-native";
4
3
  import Animated, {
@@ -44,12 +43,12 @@ export const Screen = ({
44
43
 
45
44
  useDerivedValue(() => {
46
45
  if (!sceneProgress) {
47
- screenActivity.value = STATE_TRANSITIONING_OR_BELOW_TOP;
46
+ screenActivity.set(STATE_TRANSITIONING_OR_BELOW_TOP);
48
47
  return;
49
48
  }
50
49
 
51
50
  if (index < routesLength - activeScreensLimit - 1 || isPreloaded) {
52
- screenActivity.value = STATE_INACTIVE;
51
+ screenActivity.set(STATE_INACTIVE);
53
52
  } else {
54
53
  const outputValue =
55
54
  index === routesLength - 1
@@ -59,7 +58,7 @@ export const Screen = ({
59
58
  : STATE_INACTIVE;
60
59
 
61
60
  const v = interpolate(
62
- sceneProgress.value,
61
+ sceneProgress.get(),
63
62
  [0, 1 - EPSILON, 1],
64
63
  [1, 1, outputValue],
65
64
  "clamp",
@@ -68,17 +67,16 @@ export const Screen = ({
68
67
  const next =
69
68
  (Math.trunc(v) as 0 | 1 | 2) ?? STATE_TRANSITIONING_OR_BELOW_TOP;
70
69
 
71
- // avoid spamming JS thread
72
- if (next !== screenActivity.value) {
73
- screenActivity.value = next;
70
+ if (next !== screenActivity.get()) {
71
+ screenActivity.set(next);
74
72
  }
75
73
  }
76
74
  });
77
75
 
78
76
  const animatedProps = useAnimatedProps(() => {
79
77
  return {
80
- activityState: screenActivity.value,
81
- shouldFreeze: screenActivity.value === STATE_INACTIVE && shouldFreeze,
78
+ activityState: screenActivity.get(),
79
+ shouldFreeze: screenActivity.get() === STATE_INACTIVE && shouldFreeze,
82
80
  };
83
81
  });
84
82
 
@@ -0,0 +1,104 @@
1
+ import { SafeAreaProviderCompat } from "@react-navigation/elements";
2
+ import {
3
+ NavigationContext,
4
+ NavigationRouteContext,
5
+ } from "@react-navigation/native";
6
+ import * as React from "react";
7
+ import { StyleSheet } from "react-native";
8
+ import { GestureHandlerRootView } from "react-native-gesture-handler";
9
+ import { ScreenContainer } from "react-native-screens";
10
+ import { BlankStackScreenLifecycleController } from "../../shared/components/controllers/screen-lifecycle";
11
+ import { FlagsProvider } from "../../shared/providers/flags.provider";
12
+ import { ScreenTransitionProvider } from "../../shared/providers/screen-transition.provider";
13
+ import type { BlankStackDescriptor } from "../types";
14
+ import { withStackNavigationProvider } from "../utils/with-stack-navigation";
15
+ import { Overlay } from "./overlay";
16
+ import { Screen } from "./screens";
17
+
18
+ function isFabric() {
19
+ return "nativeFabricUIManager" in global;
20
+ }
21
+
22
+ type SceneViewProps = {
23
+ descriptor: BlankStackDescriptor;
24
+ };
25
+
26
+ const SceneView = React.memo(({ descriptor }: SceneViewProps) => {
27
+ const { route, navigation, render } = descriptor;
28
+
29
+ return (
30
+ <NavigationContext.Provider value={navigation}>
31
+ <NavigationRouteContext.Provider value={route}>
32
+ {descriptor.options.overlayMode === "screen" && <Overlay.Screen />}
33
+ {render()}
34
+ </NavigationRouteContext.Provider>
35
+ </NavigationContext.Provider>
36
+ );
37
+ });
38
+
39
+ export const StackView = withStackNavigationProvider(
40
+ ({
41
+ activeScreensLimit,
42
+ descriptors,
43
+ focusedIndex,
44
+ routes,
45
+ scenes,
46
+ shouldShowFloatOverlay,
47
+ }) => {
48
+ return (
49
+ <FlagsProvider TRANSITIONS_ALWAYS_ON>
50
+ <GestureHandlerRootView>
51
+ <SafeAreaProviderCompat>
52
+ {shouldShowFloatOverlay ? <Overlay.Float /> : null}
53
+ <ScreenContainer style={styles.container}>
54
+ {scenes.map((scene, sceneIndex) => {
55
+ const descriptor = scene.descriptor;
56
+ const route = scene.route;
57
+ const isFocused = focusedIndex === sceneIndex;
58
+ const isBelowFocused = focusedIndex - 1 === sceneIndex;
59
+
60
+ const previousDescriptor =
61
+ scenes[sceneIndex - 1]?.descriptor ?? undefined;
62
+ const nextDescriptor =
63
+ scenes[sceneIndex + 1]?.descriptor ?? undefined;
64
+
65
+ const isPreloaded = descriptors[route.key] === undefined;
66
+
67
+ // On Fabric, when screen is frozen, animated and reanimated values are not updated
68
+ // due to component being unmounted. To avoid this, we don't freeze the previous screen there
69
+ const shouldFreeze = isFabric()
70
+ ? !isPreloaded && !isFocused && !isBelowFocused
71
+ : !isPreloaded && !isFocused;
72
+ return (
73
+ <Screen
74
+ key={route.key}
75
+ isPreloaded={isPreloaded}
76
+ index={sceneIndex}
77
+ activeScreensLimit={activeScreensLimit}
78
+ routeKey={route.key}
79
+ routesLength={routes.length}
80
+ shouldFreeze={shouldFreeze}
81
+ freezeOnBlur={descriptor.options.freezeOnBlur}
82
+ >
83
+ <ScreenTransitionProvider
84
+ previous={previousDescriptor}
85
+ current={descriptor}
86
+ next={nextDescriptor}
87
+ LifecycleController={BlankStackScreenLifecycleController}
88
+ >
89
+ <SceneView key={route.key} descriptor={descriptor} />
90
+ </ScreenTransitionProvider>
91
+ </Screen>
92
+ );
93
+ })}
94
+ </ScreenContainer>
95
+ </SafeAreaProviderCompat>
96
+ </GestureHandlerRootView>
97
+ </FlagsProvider>
98
+ );
99
+ },
100
+ );
101
+
102
+ const styles = StyleSheet.create({
103
+ container: { flex: 1 },
104
+ });
@@ -51,21 +51,21 @@ export const useOverlayAnimation = (): {
51
51
  return total;
52
52
  }, [progressValues]);
53
53
 
54
- const optimisticActiveIndexValue = useDerivedValue(() => {
55
- "worklet";
56
-
57
- const activeIndex = progressValues.length - 1;
54
+ const optimisticActiveIndex = useSharedValueState(
55
+ useDerivedValue(() => {
56
+ "worklet";
58
57
 
59
- const isOneDismissing = Number(
60
- progressValues.some((value) => value.closing.value > 0),
61
- );
58
+ const activeIndex = progressValues.length - 1;
62
59
 
63
- const optimisticIndex = activeIndex - isOneDismissing;
60
+ const isOneDismissing = Number(
61
+ progressValues.some((value) => value.closing.value > 0),
62
+ );
64
63
 
65
- return optimisticIndex;
66
- });
64
+ const optimisticIndex = activeIndex - isOneDismissing;
67
65
 
68
- const optimisticActiveIndex = useSharedValueState(optimisticActiveIndexValue);
66
+ return optimisticIndex;
67
+ }),
68
+ );
69
69
 
70
70
  const screen = useWindowDimensions();
71
71
 
@@ -1,5 +1,4 @@
1
- export { useOverlayAnimation } from "../blank-stack/hooks/use-overlay-animation";
2
- export { createBlankStackNavigator } from "../blank-stack/navigators/createBlankStackNavigator";
1
+ export { createBlankStackNavigator } from "../blank-stack/navigators/create-blank-stack-navigator";
3
2
  export type {
4
3
  BlankStackNavigationEventMap,
5
4
  BlankStackNavigationOptions,
@@ -13,7 +13,7 @@ import {
13
13
  useNavigationBuilder,
14
14
  } from "@react-navigation/native";
15
15
  import * as React from "react";
16
- import { StackView } from "../components/StackView";
16
+ import { StackView } from "../components/stack-view";
17
17
  import type {
18
18
  BlankStackNavigationEventMap,
19
19
  BlankStackNavigationOptions,
@@ -12,18 +12,11 @@ import type {
12
12
  Theme,
13
13
  } from "@react-navigation/native";
14
14
  import type { DerivedValue } from "react-native-reanimated";
15
- import type { EdgeInsets } from "react-native-safe-area-context";
16
- import type { ScreenProps } from "react-native-screens";
15
+ import type { ScreenTransitionConfig } from "../shared";
17
16
  import type {
18
17
  OverlayInterpolationProps,
19
18
  ScreenInterpolationProps,
20
- ScreenStyleInterpolator,
21
- TransitionSpec,
22
19
  } from "../shared/types/animation.types";
23
- import type {
24
- GestureActivationArea,
25
- GestureDirection,
26
- } from "../shared/types/gesture.types";
27
20
 
28
21
  export type BlankStackNavigationEventMap = {
29
22
  /**
@@ -95,65 +88,46 @@ export type BlankStackNavigationConfig = {};
95
88
 
96
89
  export type BlankStackOverlayProps = {
97
90
  /**
98
- * Options for the back button.
91
+ * Route of the currently focused screen in the stack.
99
92
  */
100
- back?: {
101
- /**
102
- * Title of the previous screen.
103
- */
104
- title: string;
105
- };
93
+ focusedRoute: Route<string>;
94
+
106
95
  /**
107
- * Route object for the current screen.
96
+ * Index of the focused route in the stack.
108
97
  */
109
- route: Route<string>;
98
+ focusedIndex: number;
99
+
110
100
  /**
111
- * Route object for the currently focused screen in the stack.
101
+ * All routes currently in the stack.
112
102
  */
113
- focusedRoute: Route<string>;
103
+ routes: Route<string>[];
104
+
114
105
  /**
115
- * Navigation prop for the overlay.
106
+ * Options passed to the overlay component.
116
107
  */
117
- navigation: BlankStackNavigationProp<ParamListBase>;
108
+ overlayOptions?: {
109
+ title?: string;
110
+ subtitle?: string;
111
+ [key: string]: unknown;
112
+ };
113
+
118
114
  /**
119
- * Safe area insets for the screen.
115
+ * Navigation prop for the overlay.
120
116
  */
121
- insets: EdgeInsets;
117
+ navigation: BlankStackNavigationProp<ParamListBase>;
118
+
122
119
  /**
123
120
  * Animation values for the overlay.
124
121
  */
125
122
  overlayAnimation: DerivedValue<OverlayInterpolationProps>;
123
+
126
124
  /**
127
125
  * Animation values for the screen.
128
126
  */
129
127
  screenAnimation: DerivedValue<ScreenInterpolationProps>;
130
- /**
131
- * Index of the active route
132
- */
133
- focusedIndex: number;
134
128
  };
135
129
 
136
- export type BlankStackScreenTransitionConfig = {
137
- /**
138
- * The user-provided function to calculate styles based on animation progress.
139
- */
140
- screenStyleInterpolator?: ScreenStyleInterpolator;
141
- /**
142
- * The Reanimated animation config for opening and closing transitions.
143
- */
144
- transitionSpec?: TransitionSpec;
145
- /**
146
- * Whether the gesture is enabled.
147
- */
148
- gestureEnabled?: boolean;
149
- /**
150
- * The direction of the swipe gesture used to dismiss the screen.
151
- */
152
- gestureDirection?: GestureDirection | GestureDirection[];
153
- /**
154
- * How much the gesture's final velocity impacts the dismiss decision.
155
- */
156
- gestureVelocityImpact?: number;
130
+ export type BlankStackScreenTransitionConfig = ScreenTransitionConfig & {
157
131
  /**
158
132
  * Whether to detach the previous screen from the view hierarchy to save memory.
159
133
  * Set it to `false` if you need the previous screen to be seen through the active screen.
@@ -161,18 +135,6 @@ export type BlankStackScreenTransitionConfig = {
161
135
  * Defaults to `false` for the last screen for modals, otherwise `true`.
162
136
  */
163
137
  detachPreviousScreen?: boolean;
164
- /**
165
- * Distance threshold for gesture recognition throughout the screen.
166
- */
167
- gestureResponseDistance?: number;
168
- /**
169
- * Whether the gesture drives the progress.
170
- */
171
- gestureDrivesProgress?: boolean;
172
- /**
173
- * The area of the screen where the gesture is activated.
174
- */
175
- gestureActivationArea?: GestureActivationArea;
176
138
  };
177
139
 
178
140
  export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
@@ -180,6 +142,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
180
142
  * Function that given `OverlayProps` returns a React Element to display as a overlay.
181
143
  */
182
144
  overlay?: (props: BlankStackOverlayProps) => React.ReactNode;
145
+
183
146
  /**
184
147
  * Layout: How the Overlay is positioned
185
148
  * - 'float': Single persistent overlay above all screens (like iOS)
@@ -187,6 +150,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
187
150
  * @default 'screen'
188
151
  */
189
152
  overlayMode?: "float" | "screen";
153
+
190
154
  /**
191
155
  * Whether to show the overlay. The overlay is shown by default.
192
156
  * Setting this to `false` hides the overlay.
@@ -194,56 +158,14 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
194
158
  overlayShown?: boolean;
195
159
 
196
160
  /**
197
- * Whether the home indicator should prefer to stay hidden on this screen. Defaults to `false`.
198
- *
199
- * @platform ios
200
- */
201
- autoHideHomeIndicator?: boolean;
202
- /**
203
- * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
204
- *
205
- * @platform ios
206
- */
207
- keyboardHandlingEnabled?: boolean;
208
- /**
209
- * Sets the visibility of the navigation bar. Defaults to `false`.
210
- *
211
- * @platform android
212
- */
213
- navigationBarHidden?: boolean;
214
- /**
215
- * Sets the status bar animation (similar to the `StatusBar` component).
216
- * On Android, setting either `fade` or `slide` will set the transition of status bar color. On iOS, this option applies to appereance animation of the status bar.
217
- * Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
218
- *
219
- * Defaults to `fade` on iOS and `none` on Android.
220
- *
221
- * Only supported on Android and iOS.
222
- *
223
- * @platform android, ios
224
- */
225
- statusBarAnimation?: ScreenProps["statusBarAnimation"];
226
- /**
227
- * Whether the status bar should be hidden on this screen.
228
- * Requires setting `View controller-based status bar appearance -> YES` in your Info.plist file.
229
- *
230
- * Only supported on Android and iOS.
231
- *
232
- * @platform android, ios
161
+ * Options passed to the overlay component.
233
162
  */
234
- statusBarHidden?: boolean;
235
- /**
236
- * Sets the status bar color (similar to the `StatusBar` component).
237
- * Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
238
- * `auto` and `inverted` are supported only on iOS. On Android, they will fallback to `light`.
239
- *
240
- * Defaults to `auto` on iOS and `light` on Android.
241
- *
242
- * Only supported on Android and iOS.
243
- *
244
- * @platform android, ios
245
- */
246
- statusBarStyle?: ScreenProps["statusBarStyle"];
163
+ overlayOptions?: {
164
+ title?: string;
165
+ subtitle?: string;
166
+ [key: string]: unknown;
167
+ };
168
+
247
169
  /**
248
170
  * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
249
171
  * Defaults to `true` when `enableFreeze()` is run at the top of the application.
@@ -9,15 +9,8 @@ export const composeDescriptors = (
9
9
  const composed: BlankStackDescriptorMap = {};
10
10
 
11
11
  for (const route of routes) {
12
- const adjusted =
12
+ composed[route.key] =
13
13
  nextDescriptors[route.key] ?? currentDescriptors[route.key];
14
-
15
- // useScreenAnimation depends on this, however with blank-stack, this should be enabled by default
16
- const withEnableTransitions = {
17
- ...adjusted,
18
- options: { ...adjusted.options, enableTransitions: true },
19
- };
20
- composed[route.key] = withEnableTransitions;
21
14
  }
22
15
 
23
16
  return composed;
@@ -4,7 +4,6 @@ import useStableCallback from "../../../../shared/hooks/use-stable-callback";
4
4
 
5
5
  export const useClosingRouteKeys = () => {
6
6
  const keysRef = useRef<Set<string>>(new Set());
7
- const finishedRef = useRef<Set<string>>(new Set());
8
7
  const shared = useSharedValue<string[]>([]);
9
8
 
10
9
  const add = useStableCallback((key: string) => {
@@ -13,7 +12,6 @@ export const useClosingRouteKeys = () => {
13
12
  return;
14
13
  }
15
14
 
16
- finishedRef.current.delete(key);
17
15
  keys.add(key);
18
16
  shared.modify((prev) => {
19
17
  "worklet";
@@ -26,12 +24,8 @@ export const useClosingRouteKeys = () => {
26
24
 
27
25
  const remove = useStableCallback((key: string) => {
28
26
  const keys = keysRef.current;
29
- if (!keys.delete(key)) {
30
- finishedRef.current.delete(key);
31
- return;
32
- }
27
+ keys.delete(key);
33
28
 
34
- finishedRef.current.delete(key);
35
29
  shared.modify((prev) => {
36
30
  "worklet";
37
31
  const index = prev.indexOf(key);
@@ -44,13 +38,8 @@ export const useClosingRouteKeys = () => {
44
38
 
45
39
  const clear = useStableCallback(() => {
46
40
  const keys = keysRef.current;
47
- if (!keys.size) {
48
- finishedRef.current.clear();
49
- return;
50
- }
51
41
 
52
42
  keys.clear();
53
- finishedRef.current.clear();
54
43
  shared.modify((prev) => {
55
44
  "worklet";
56
45
  prev.length = 0;
@@ -2,11 +2,11 @@ import { type Route, StackActions } from "@react-navigation/native";
2
2
  import { useLayoutEffect, useState } from "react";
3
3
  import useStableCallback from "../../../../shared/hooks/use-stable-callback";
4
4
  import type { BlankStackDescriptorMap } from "../../../types";
5
- import type { StackNavigationContextProps } from "../_types";
6
- import { areDescriptorsEqual } from "../_utils/are-descriptors-equal";
7
- import { composeDescriptors } from "../_utils/compose-descriptors";
8
- import { haveSameRouteKeys } from "../_utils/have-same-route-keys";
9
- import { routesAreIdentical } from "../_utils/routes-are-identical";
5
+ import { areDescriptorsEqual } from "../helpers/are-descriptors-equal";
6
+ import { composeDescriptors } from "../helpers/compose-descriptors";
7
+ import { haveSameRouteKeys } from "../helpers/have-same-route-keys";
8
+ import { routesAreIdentical } from "../helpers/routes-are-identical";
9
+ import type { StackNavigationContextProps } from "../types";
10
10
  import { useClosingRouteKeys } from "./use-closing-route-keys";
11
11
  import { usePrevious } from "./use-previous";
12
12