react-native-screen-transitions 2.4.0 → 2.4.2-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 (270) hide show
  1. package/lib/commonjs/__configs__/presets.js.map +1 -1
  2. package/lib/commonjs/components/root-transition-aware.js.map +1 -1
  3. package/lib/commonjs/constants.js.map +1 -1
  4. package/lib/commonjs/hooks/animation/use-screen-animation.js +9 -5
  5. package/lib/commonjs/hooks/animation/use-screen-animation.js.map +1 -1
  6. package/lib/commonjs/index.js +7 -0
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/integrations/blank-stack/components/Header.js +142 -0
  9. package/lib/commonjs/integrations/blank-stack/components/Header.js.map +1 -0
  10. package/lib/commonjs/integrations/blank-stack/components/Screens.js +64 -0
  11. package/lib/commonjs/integrations/blank-stack/components/Screens.js.map +1 -0
  12. package/lib/commonjs/integrations/blank-stack/components/StackView.js +94 -0
  13. package/lib/commonjs/integrations/blank-stack/components/StackView.js.map +1 -0
  14. package/lib/commonjs/integrations/blank-stack/navigators/createBlankStackNavigator.js +74 -0
  15. package/lib/commonjs/integrations/blank-stack/navigators/createBlankStackNavigator.js.map +1 -0
  16. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js +66 -0
  17. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +1 -0
  18. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js +16 -0
  19. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +1 -0
  20. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js +208 -0
  21. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +1 -0
  22. package/lib/commonjs/{types/navigator.js → integrations/blank-stack/utils/with-stack-navigation/_types.js} +1 -1
  23. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_types.js.map +1 -0
  24. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js +15 -0
  25. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +1 -0
  26. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.js +23 -0
  27. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.js.map +1 -0
  28. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +15 -0
  29. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +1 -0
  30. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js +14 -0
  31. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +1 -0
  32. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js +13 -0
  33. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +1 -0
  34. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/index.js +71 -0
  35. package/lib/commonjs/integrations/blank-stack/utils/with-stack-navigation/index.js.map +1 -0
  36. package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  37. package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -1
  38. package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -1
  39. package/lib/commonjs/integrations/native-stack/views/NativeStackView.js.map +1 -1
  40. package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
  41. package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -1
  42. package/lib/commonjs/providers/keys.js.map +1 -1
  43. package/lib/commonjs/providers/screen-transition-provider.js.map +1 -1
  44. package/lib/commonjs/providers/transition-styles.js +18 -4
  45. package/lib/commonjs/providers/transition-styles.js.map +1 -1
  46. package/lib/commonjs/stores/animations.js.map +1 -1
  47. package/lib/commonjs/stores/bounds/index.js.map +1 -1
  48. package/lib/commonjs/stores/gestures.js.map +1 -1
  49. package/lib/commonjs/stores/utils/reset-stores-for-screen.js.map +1 -1
  50. package/lib/commonjs/types/blank-stack.navigator.js +6 -0
  51. package/lib/commonjs/types/{navigator.js.map → blank-stack.navigator.js.map} +1 -1
  52. package/lib/commonjs/types/native-stack.navigator.js +6 -0
  53. package/lib/commonjs/types/native-stack.navigator.js.map +1 -0
  54. package/lib/commonjs/utils/animation/derivations.js +1 -14
  55. package/lib/commonjs/utils/animation/derivations.js.map +1 -1
  56. package/lib/commonjs/utils/bounds/_utils/styles.js.map +1 -1
  57. package/lib/commonjs/utils/bounds/constants.js.map +1 -1
  58. package/lib/commonjs/utils/bounds/index.js +23 -90
  59. package/lib/commonjs/utils/bounds/index.js.map +1 -1
  60. package/lib/commonjs/utils/gesture/apply-offset-rules.js.map +1 -1
  61. package/lib/commonjs/utils/gesture/check-gesture-activation.js.map +1 -1
  62. package/lib/commonjs/utils/gesture/reset-gesture-values.js.map +1 -1
  63. package/lib/commonjs/utils/gesture/velocity.js +2 -2
  64. package/lib/commonjs/utils/gesture/velocity.js.map +1 -1
  65. package/lib/module/__configs__/presets.js.map +1 -1
  66. package/lib/module/components/root-transition-aware.js.map +1 -1
  67. package/lib/module/constants.js.map +1 -1
  68. package/lib/module/hooks/animation/use-screen-animation.js +9 -5
  69. package/lib/module/hooks/animation/use-screen-animation.js.map +1 -1
  70. package/lib/module/index.js +1 -0
  71. package/lib/module/index.js.map +1 -1
  72. package/lib/module/integrations/blank-stack/components/Header.js +138 -0
  73. package/lib/module/integrations/blank-stack/components/Header.js.map +1 -0
  74. package/lib/module/integrations/blank-stack/components/Screens.js +58 -0
  75. package/lib/module/integrations/blank-stack/components/Screens.js.map +1 -0
  76. package/lib/module/integrations/blank-stack/components/StackView.js +90 -0
  77. package/lib/module/integrations/blank-stack/components/StackView.js.map +1 -0
  78. package/lib/module/integrations/blank-stack/navigators/createBlankStackNavigator.js +68 -0
  79. package/lib/module/integrations/blank-stack/navigators/createBlankStackNavigator.js.map +1 -0
  80. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js +60 -0
  81. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +1 -0
  82. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js +11 -0
  83. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +1 -0
  84. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js +202 -0
  85. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +1 -0
  86. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_types.js +4 -0
  87. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_types.js.map +1 -0
  88. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js +10 -0
  89. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +1 -0
  90. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.js +19 -0
  91. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.js.map +1 -0
  92. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js +10 -0
  93. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +1 -0
  94. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js +9 -0
  95. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +1 -0
  96. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js +8 -0
  97. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +1 -0
  98. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/index.js +65 -0
  99. package/lib/module/integrations/blank-stack/utils/with-stack-navigation/index.js.map +1 -0
  100. package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -1
  101. package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -1
  102. package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -1
  103. package/lib/module/integrations/native-stack/views/NativeStackView.js.map +1 -1
  104. package/lib/module/integrations/native-stack/views/NativeStackView.native.js.map +1 -1
  105. package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -1
  106. package/lib/module/providers/keys.js.map +1 -1
  107. package/lib/module/providers/screen-transition-provider.js.map +1 -1
  108. package/lib/module/providers/transition-styles.js +19 -5
  109. package/lib/module/providers/transition-styles.js.map +1 -1
  110. package/lib/module/stores/animations.js.map +1 -1
  111. package/lib/module/stores/bounds/index.js.map +1 -1
  112. package/lib/module/stores/gestures.js.map +1 -1
  113. package/lib/module/stores/utils/reset-stores-for-screen.js.map +1 -1
  114. package/lib/module/types/blank-stack.navigator.js +4 -0
  115. package/lib/module/types/{navigator.js.map → blank-stack.navigator.js.map} +1 -1
  116. package/lib/module/types/native-stack.navigator.js +4 -0
  117. package/lib/module/types/native-stack.navigator.js.map +1 -0
  118. package/lib/module/utils/animation/derivations.js +1 -14
  119. package/lib/module/utils/animation/derivations.js.map +1 -1
  120. package/lib/module/utils/bounds/_utils/styles.js.map +1 -1
  121. package/lib/module/utils/bounds/constants.js.map +1 -1
  122. package/lib/module/utils/bounds/index.js +24 -91
  123. package/lib/module/utils/bounds/index.js.map +1 -1
  124. package/lib/module/utils/gesture/apply-offset-rules.js.map +1 -1
  125. package/lib/module/utils/gesture/check-gesture-activation.js.map +1 -1
  126. package/lib/module/utils/gesture/reset-gesture-values.js.map +1 -1
  127. package/lib/module/utils/gesture/velocity.js +2 -2
  128. package/lib/module/utils/gesture/velocity.js.map +1 -1
  129. package/lib/typescript/__configs__/index.d.ts +9 -9
  130. package/lib/typescript/__configs__/index.d.ts.map +1 -1
  131. package/lib/typescript/__configs__/presets.d.ts +1 -1
  132. package/lib/typescript/__configs__/presets.d.ts.map +1 -1
  133. package/lib/typescript/components/root-transition-aware.d.ts.map +1 -1
  134. package/lib/typescript/constants.d.ts +2 -2
  135. package/lib/typescript/constants.d.ts.map +1 -1
  136. package/lib/typescript/hooks/animation/use-screen-animation.d.ts +1 -1
  137. package/lib/typescript/hooks/animation/use-screen-animation.d.ts.map +1 -1
  138. package/lib/typescript/index.d.ts +20 -18
  139. package/lib/typescript/index.d.ts.map +1 -1
  140. package/lib/typescript/integrations/blank-stack/components/Header.d.ts +5 -0
  141. package/lib/typescript/integrations/blank-stack/components/Header.d.ts.map +1 -0
  142. package/lib/typescript/integrations/blank-stack/components/Screens.d.ts +15 -0
  143. package/lib/typescript/integrations/blank-stack/components/Screens.d.ts.map +1 -0
  144. package/lib/typescript/integrations/blank-stack/components/StackView.d.ts +2 -0
  145. package/lib/typescript/integrations/blank-stack/components/StackView.d.ts.map +1 -0
  146. package/lib/typescript/integrations/blank-stack/navigators/createBlankStackNavigator.d.ts +109 -0
  147. package/lib/typescript/integrations/blank-stack/navigators/createBlankStackNavigator.d.ts.map +1 -0
  148. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.d.ts +8 -0
  149. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.d.ts.map +1 -0
  150. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.d.ts +2 -0
  151. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.d.ts.map +1 -0
  152. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts +20 -0
  153. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts.map +1 -0
  154. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_types.d.ts +23 -0
  155. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_types.d.ts.map +1 -0
  156. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts +3 -0
  157. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts.map +1 -0
  158. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.d.ts +4 -0
  159. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.d.ts.map +1 -0
  160. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts +4 -0
  161. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts.map +1 -0
  162. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts +3 -0
  163. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts.map +1 -0
  164. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts +3 -0
  165. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts.map +1 -0
  166. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/index.d.ts +6 -0
  167. package/lib/typescript/integrations/blank-stack/utils/with-stack-navigation/index.d.ts.map +1 -0
  168. package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  169. package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  170. package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts +1 -1
  171. package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts.map +1 -1
  172. package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts +1 -1
  173. package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts.map +1 -1
  174. package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts +1 -1
  175. package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts.map +1 -1
  176. package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts +1 -1
  177. package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  178. package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts +1 -1
  179. package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts.map +1 -1
  180. package/lib/typescript/providers/keys.d.ts +1 -1
  181. package/lib/typescript/providers/keys.d.ts.map +1 -1
  182. package/lib/typescript/providers/screen-transition-provider.d.ts +1 -1
  183. package/lib/typescript/providers/screen-transition-provider.d.ts.map +1 -1
  184. package/lib/typescript/providers/transition-styles.d.ts.map +1 -1
  185. package/lib/typescript/stores/animations.d.ts +1 -1
  186. package/lib/typescript/stores/animations.d.ts.map +1 -1
  187. package/lib/typescript/stores/bounds/index.d.ts +1 -1
  188. package/lib/typescript/stores/bounds/index.d.ts.map +1 -1
  189. package/lib/typescript/stores/gestures.d.ts +1 -1
  190. package/lib/typescript/stores/gestures.d.ts.map +1 -1
  191. package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts +1 -1
  192. package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts.map +1 -1
  193. package/lib/typescript/types/animation.d.ts +2 -4
  194. package/lib/typescript/types/animation.d.ts.map +1 -1
  195. package/lib/typescript/types/blank-stack.navigator.d.ts +219 -0
  196. package/lib/typescript/types/blank-stack.navigator.d.ts.map +1 -0
  197. package/lib/typescript/types/bounds.d.ts +0 -57
  198. package/lib/typescript/types/bounds.d.ts.map +1 -1
  199. package/lib/typescript/types/{navigator.d.ts → native-stack.navigator.d.ts} +5 -1
  200. package/lib/typescript/types/native-stack.navigator.d.ts.map +1 -0
  201. package/lib/typescript/types/utils.d.ts.map +1 -1
  202. package/lib/typescript/utils/animation/derivations.d.ts +1 -4
  203. package/lib/typescript/utils/animation/derivations.d.ts.map +1 -1
  204. package/lib/typescript/utils/bounds/_types/builder.d.ts +2 -2
  205. package/lib/typescript/utils/bounds/_types/builder.d.ts.map +1 -1
  206. package/lib/typescript/utils/bounds/_utils/geometry.d.ts +2 -2
  207. package/lib/typescript/utils/bounds/_utils/geometry.d.ts.map +1 -1
  208. package/lib/typescript/utils/bounds/_utils/styles.d.ts +2 -1
  209. package/lib/typescript/utils/bounds/_utils/styles.d.ts.map +1 -1
  210. package/lib/typescript/utils/bounds/constants.d.ts +2 -2
  211. package/lib/typescript/utils/bounds/constants.d.ts.map +1 -1
  212. package/lib/typescript/utils/bounds/index.d.ts +4 -4
  213. package/lib/typescript/utils/bounds/index.d.ts.map +1 -1
  214. package/lib/typescript/utils/gesture/apply-offset-rules.d.ts +2 -2
  215. package/lib/typescript/utils/gesture/apply-offset-rules.d.ts.map +1 -1
  216. package/lib/typescript/utils/gesture/check-gesture-activation.d.ts +2 -2
  217. package/lib/typescript/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  218. package/lib/typescript/utils/gesture/reset-gesture-values.d.ts.map +1 -1
  219. package/lib/typescript/utils/gesture/velocity.d.ts +1 -1
  220. package/lib/typescript/utils/gesture/velocity.d.ts.map +1 -1
  221. package/package.json +1 -1
  222. package/src/__configs__/presets.ts +590 -590
  223. package/src/components/root-transition-aware.tsx +27 -27
  224. package/src/constants.ts +47 -47
  225. package/src/hooks/animation/use-screen-animation.tsx +52 -47
  226. package/src/index.ts +33 -22
  227. package/src/integrations/blank-stack/components/Header.tsx +143 -0
  228. package/src/integrations/blank-stack/components/Screens.tsx +96 -0
  229. package/src/integrations/blank-stack/components/StackView.tsx +106 -0
  230. package/src/integrations/blank-stack/navigators/createBlankStackNavigator.tsx +122 -0
  231. package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.tsx +62 -0
  232. package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-previous.tsx +11 -0
  233. package/src/integrations/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.tsx +280 -0
  234. package/src/integrations/blank-stack/utils/with-stack-navigation/_types.ts +36 -0
  235. package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.ts +15 -0
  236. package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/calculateActiveScreensLimit.ts +29 -0
  237. package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.ts +17 -0
  238. package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.ts +12 -0
  239. package/src/integrations/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.ts +11 -0
  240. package/src/integrations/blank-stack/utils/with-stack-navigation/index.tsx +93 -0
  241. package/src/integrations/native-stack/navigators/createNativeStackNavigator.tsx +95 -95
  242. package/src/integrations/native-stack/utils/getModalRoutesKeys.ts +14 -14
  243. package/src/integrations/native-stack/utils/useInvalidPreventRemoveError.tsx +23 -23
  244. package/src/integrations/native-stack/views/NativeStackView.native.tsx +608 -608
  245. package/src/integrations/native-stack/views/NativeStackView.tsx +188 -188
  246. package/src/integrations/native-stack/views/useHeaderConfigProps.tsx +260 -260
  247. package/src/providers/keys.tsx +22 -22
  248. package/src/providers/screen-transition-provider.tsx +20 -20
  249. package/src/providers/transition-styles.tsx +24 -11
  250. package/src/stores/animations.ts +23 -23
  251. package/src/stores/bounds/index.ts +82 -82
  252. package/src/stores/gestures.ts +36 -36
  253. package/src/stores/utils/reset-stores-for-screen.ts +4 -4
  254. package/src/types/animation.ts +2 -4
  255. package/src/types/blank-stack.navigator.ts +271 -0
  256. package/src/types/bounds.ts +0 -64
  257. package/src/types/{navigator.ts → native-stack.navigator.ts} +5 -0
  258. package/src/types/utils.ts +1 -0
  259. package/src/utils/animation/derivations.ts +3 -20
  260. package/src/utils/bounds/_types/builder.ts +111 -111
  261. package/src/utils/bounds/_utils/geometry.ts +2 -2
  262. package/src/utils/bounds/_utils/styles.ts +2 -1
  263. package/src/utils/bounds/constants.ts +29 -29
  264. package/src/utils/bounds/index.ts +35 -105
  265. package/src/utils/gesture/apply-offset-rules.ts +271 -271
  266. package/src/utils/gesture/check-gesture-activation.ts +260 -260
  267. package/src/utils/gesture/reset-gesture-values.ts +1 -0
  268. package/src/utils/gesture/velocity.ts +1 -2
  269. package/lib/module/types/navigator.js +0 -4
  270. package/lib/typescript/types/navigator.d.ts.map +0 -1
@@ -0,0 +1,271 @@
1
+ import type {
2
+ DefaultNavigatorOptions,
3
+ Descriptor,
4
+ NavigationHelpers,
5
+ NavigationProp,
6
+ ParamListBase,
7
+ Route,
8
+ RouteProp,
9
+ StackActionHelpers,
10
+ StackNavigationState,
11
+ StackRouterOptions,
12
+ Theme,
13
+ } from "@react-navigation/native";
14
+ import type { StyleProp, ViewStyle } from "react-native";
15
+ import type { DerivedValue } from "react-native-reanimated";
16
+ import type { EdgeInsets } from "react-native-safe-area-context";
17
+ import type { ScreenProps } from "react-native-screens";
18
+ import type {
19
+ ScreenInterpolationProps,
20
+ ScreenStyleInterpolator,
21
+ TransitionSpec,
22
+ } from "./animation";
23
+ import type { GestureActivationArea, GestureDirection } from "./gesture";
24
+
25
+ export type BlankStackNavigationEventMap = {
26
+ /**
27
+ * Event which fires when a transition animation starts.
28
+ */
29
+ transitionStart: { data: { closing: boolean } };
30
+ /**
31
+ * Event which fires when a transition animation ends.
32
+ */
33
+ transitionEnd: { data: { closing: boolean } };
34
+ /**
35
+ * Event which fires when a swipe back is canceled on iOS.
36
+ */
37
+ gestureCancel: { data: undefined };
38
+ /**
39
+ * Event which fires when screen is in sheet presentation & it's detent changes.
40
+ *
41
+ * In payload it caries two fields:
42
+ *
43
+ * * `index` - current detent index in the `sheetAllowedDetents` array,
44
+ * * `stable` - on Android `false` value means that the user is dragging the sheet or it is settling; on iOS it is always `true`.
45
+ */
46
+ sheetDetentChange: { data: { index: number; stable: boolean } };
47
+ };
48
+
49
+ export type BlankStackNavigationProp<
50
+ ParamList extends ParamListBase,
51
+ RouteName extends keyof ParamList = string,
52
+ NavigatorID extends string | undefined = undefined
53
+ > = NavigationProp<
54
+ ParamList,
55
+ RouteName,
56
+ NavigatorID,
57
+ StackNavigationState<ParamList>,
58
+ BlankStackNavigationOptions,
59
+ BlankStackNavigationEventMap
60
+ > &
61
+ StackActionHelpers<ParamList>;
62
+
63
+ export type BlankStackScreenProps<
64
+ ParamList extends ParamListBase,
65
+ RouteName extends keyof ParamList = string,
66
+ NavigatorID extends string | undefined = undefined
67
+ > = {
68
+ navigation: BlankStackNavigationProp<ParamList, RouteName, NavigatorID>;
69
+ route: RouteProp<ParamList, RouteName>;
70
+ };
71
+
72
+ export type BlankStackOptionsArgs<
73
+ ParamList extends ParamListBase,
74
+ RouteName extends keyof ParamList = keyof ParamList,
75
+ NavigatorID extends string | undefined = undefined
76
+ > = BlankStackScreenProps<ParamList, RouteName, NavigatorID> & {
77
+ theme: Theme;
78
+ };
79
+
80
+ export type BlankStackNavigationHelpers = NavigationHelpers<
81
+ ParamListBase,
82
+ BlankStackNavigationEventMap
83
+ >;
84
+
85
+ export type BlankStackScene = {
86
+ route: Route<string>;
87
+ descriptor: BlankStackDescriptor;
88
+ };
89
+
90
+ // We want it to be an empty object because navigator does not have any additional props
91
+ export type BlankStackNavigationConfig = {};
92
+
93
+ export type BlankStackHeaderProps = {
94
+ /**
95
+ * Options for the back button.
96
+ */
97
+ back?: {
98
+ /**
99
+ * Title of the previous screen.
100
+ */
101
+ title: string;
102
+ };
103
+ /**
104
+ * Route object for the current screen.
105
+ */
106
+ route: Route<string>;
107
+ /**
108
+ * Navigation prop for the header.
109
+ */
110
+ navigation: BlankStackNavigationProp<ParamListBase>;
111
+ /**
112
+ * Safe area insets for the screen.
113
+ */
114
+ insets: EdgeInsets;
115
+ /**
116
+ * Animation for the screen.
117
+ */
118
+ animation: DerivedValue<ScreenInterpolationProps>;
119
+ /**
120
+ * Index of the active route
121
+ */
122
+ focusedIndex: number;
123
+ };
124
+
125
+ export type BlankStackScreenTransitionConfig = {
126
+ /**
127
+ * The user-provided function to calculate styles based on animation progress.
128
+ */
129
+ screenStyleInterpolator?: ScreenStyleInterpolator;
130
+ /**
131
+ * The Reanimated animation config for opening and closing transitions.
132
+ */
133
+ transitionSpec?: TransitionSpec;
134
+ /**
135
+ * Whether the gesture is enabled.
136
+ */
137
+ gestureEnabled?: boolean;
138
+ /**
139
+ * The direction of the swipe gesture used to dismiss the screen.
140
+ */
141
+ gestureDirection?: GestureDirection | GestureDirection[];
142
+ /**
143
+ * How much the gesture's final velocity impacts the dismiss decision.
144
+ */
145
+ gestureVelocityImpact?: number;
146
+ /**
147
+ * Whether to detach the previous screen from the view hierarchy to save memory.
148
+ * Set it to `false` if you need the previous screen to be seen through the active screen.
149
+ * Only applicable if `detachInactiveScreens` isn't set to `false`.
150
+ * Defaults to `false` for the last screen for modals, otherwise `true`.
151
+ */
152
+ detachPreviousScreen?: boolean;
153
+ /**
154
+ * Distance threshold for gesture recognition throughout the screen.
155
+ */
156
+ gestureResponseDistance?: number;
157
+ /**
158
+ * Whether the gesture drives the progress.
159
+ */
160
+ gestureDrivesProgress?: boolean;
161
+ /**
162
+ * The area of the screen where the gesture is activated.
163
+ */
164
+ gestureActivationArea?: GestureActivationArea;
165
+ };
166
+
167
+ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
168
+ /**
169
+ * Function that given `HeaderProps` returns a React Element to display as a header.
170
+ */
171
+ header?: (props: BlankStackHeaderProps) => React.ReactNode;
172
+ /**
173
+ * Layout: How the header is positioned
174
+ * - 'float': Single persistent header above all screens (like iOS)
175
+ * - 'screen': Per-screen header that transitions with content
176
+ * @default 'screen'
177
+ */
178
+ headerMode?: "float" | "screen";
179
+ /**
180
+ * Whether to show the header. The header is shown by default.
181
+ * Setting this to `false` hides the header.
182
+ */
183
+ headerShown?: boolean;
184
+
185
+ /**
186
+ * Whether the home indicator should prefer to stay hidden on this screen. Defaults to `false`.
187
+ *
188
+ * @platform ios
189
+ */
190
+ autoHideHomeIndicator?: boolean;
191
+ /**
192
+ * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
193
+ *
194
+ * @platform ios
195
+ */
196
+ keyboardHandlingEnabled?: boolean;
197
+ /**
198
+ * Sets the visibility of the navigation bar. Defaults to `false`.
199
+ *
200
+ * @platform android
201
+ */
202
+ navigationBarHidden?: boolean;
203
+ /**
204
+ * Sets the status bar animation (similar to the `StatusBar` component).
205
+ * 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.
206
+ * Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
207
+ *
208
+ * Defaults to `fade` on iOS and `none` on Android.
209
+ *
210
+ * Only supported on Android and iOS.
211
+ *
212
+ * @platform android, ios
213
+ */
214
+ statusBarAnimation?: ScreenProps["statusBarAnimation"];
215
+ /**
216
+ * Whether the status bar should be hidden on this screen.
217
+ * Requires setting `View controller-based status bar appearance -> YES` in your Info.plist file.
218
+ *
219
+ * Only supported on Android and iOS.
220
+ *
221
+ * @platform android, ios
222
+ */
223
+ statusBarHidden?: boolean;
224
+ /**
225
+ * Sets the status bar color (similar to the `StatusBar` component).
226
+ * Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
227
+ * `auto` and `inverted` are supported only on iOS. On Android, they will fallback to `light`.
228
+ *
229
+ * Defaults to `auto` on iOS and `light` on Android.
230
+ *
231
+ * Only supported on Android and iOS.
232
+ *
233
+ * @platform android, ios
234
+ */
235
+ statusBarStyle?: ScreenProps["statusBarStyle"];
236
+ /**
237
+ * Style object for the scene content.
238
+ */
239
+ contentStyle?: StyleProp<ViewStyle>;
240
+ /**
241
+ * Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
242
+ * Defaults to `true` when `enableFreeze()` is run at the top of the application.
243
+ * Requires `react-native-screens` version >=3.16.0.
244
+ *
245
+ * Only supported on iOS and Android.
246
+ */
247
+ freezeOnBlur?: boolean;
248
+ };
249
+
250
+ export type BlankStackNavigatorProps = DefaultNavigatorOptions<
251
+ ParamListBase,
252
+ string | undefined,
253
+ StackNavigationState<ParamListBase>,
254
+ BlankStackNavigationOptions,
255
+ BlankStackNavigationEventMap,
256
+ BlankStackNavigationProp<ParamListBase>
257
+ > &
258
+ StackRouterOptions &
259
+ BlankStackNavigationConfig;
260
+
261
+ export type BlankStackDescriptor = Descriptor<
262
+ BlankStackNavigationOptions,
263
+ BlankStackNavigationProp<ParamListBase>,
264
+ RouteProp<ParamListBase>
265
+ >;
266
+
267
+ export type BlankStackDescriptorMap = {
268
+ [key: string]: BlankStackDescriptor;
269
+ };
270
+
271
+ export type ScreenKey = string;
@@ -14,76 +14,12 @@ import type { ScreenPhase } from "./core";
14
14
  */
15
15
  export type BoundsMethod = "transform" | "size" | "content";
16
16
 
17
- export type BoundsBuilder = {
18
- /**
19
- * Include gesture offsets (x/y) in the computed transform for all methods.
20
- * This syncs the focused screen’s gesture deltas with the previous screen’s bound
21
- * to give the shared look while interacting.
22
- */
23
- gestures: (options?: { x?: number; y?: number }) => BoundsBuilder;
24
-
25
- /**
26
- * Animate to the full screen bounds as the destination.
27
- * Useful when the next screen does not define a bound for the same id.
28
- */
29
- toFullscreen: () => BoundsBuilder;
30
-
31
- /**
32
- * Compute using absolute window coordinates (pageX/pageY).
33
- * No relative delta math—good when elements are unconstrained by parent layout.
34
- */
35
- absolute: () => BoundsBuilder;
36
-
37
- /**
38
- * Compute using relative deltas between start/end bounds (dx/dy, scale).
39
- * This makes the math bound-relative; great when elements are within layout constraints.
40
- */
41
- relative: () => BoundsBuilder;
42
-
43
- /**
44
- * Select transform method: translate + scaleX/scaleY (no width/height size).
45
- * Note: x/y translation is applied for all methods when applicable.
46
- */
47
- transform: () => BoundsBuilder;
48
-
49
- /**
50
- * Select size method: translate + width/height interpolation (no scaleX/scaleY).
51
- */
52
- size: () => BoundsBuilder;
53
-
54
- /**
55
- * Select content method: screen-level transform to align destination content
56
- * so its bound matches the source at progress start. This modifies where the
57
- * bound sits within the screen rather than the bound’s own local transform.
58
- */
59
- content: () => BoundsBuilder;
60
-
61
- /**
62
- * Select content scale mode: "aspectFill" (fill), "aspectFit" (fit), or "auto" (default).
63
- */
64
- contentFill: () => BoundsBuilder;
65
-
66
- /**
67
- * Select content scale mode: "aspectFill" (fill), "aspectFit" (fit), or "auto" (default).
68
- */
69
- contentFit: () => BoundsBuilder;
70
-
71
- /**
72
- * Build the final animated style.
73
- * If a method is not explicitly selected via transform/resize/content,
74
- * the provided argument will be used; defaults to "transform".
75
- */
76
- build: (method?: BoundsMethod) => StyleProps;
77
- };
78
-
79
17
  export type BoundEntry = {
80
18
  bounds: MeasuredDimensions;
81
19
  styles: StyleProps;
82
20
  };
83
21
 
84
22
  export type BoundsAccessor = {
85
- (id: string): BoundsBuilder;
86
- (): BoundsBuilder;
87
23
  <T extends BoundsBuilderOptions>(options: T): BoundsReturnType<T>;
88
24
  get: (id?: string, phase?: ScreenPhase) => BoundEntry;
89
25
  };
@@ -25,6 +25,11 @@ import type {
25
25
  import type { ScreenStyleInterpolator, TransitionSpec } from "./animation";
26
26
  import type { GestureActivationArea, GestureDirection } from "./gesture";
27
27
 
28
+ export type Layout = {
29
+ width: number;
30
+ height: number;
31
+ };
32
+
28
33
  export type NativeStackNavigationEventMap = {
29
34
  /**
30
35
  * Event which fires when a transition animation starts.
@@ -1,3 +1,4 @@
1
+ // biome-ignore lint/suspicious/noExplicitAny: <>
1
2
  export type Any = any;
2
3
 
3
4
  export type Complete<T> = { [K in keyof T]-?: Exclude<T[K], undefined> };
@@ -1,25 +1,18 @@
1
- import type { ScaledSize } from "react-native";
2
1
  import { Bounds } from "../../stores/bounds";
3
2
  import type { ScreenTransitionState } from "../../types/animation";
4
- import { createBounds } from "../bounds";
5
3
 
6
4
  interface DerivationsParams {
7
5
  current: ScreenTransitionState;
8
6
  next?: ScreenTransitionState;
9
7
  previous?: ScreenTransitionState;
10
- dimensions: ScaledSize;
11
8
  }
12
9
 
13
10
  /**
14
11
  * Additional values to help make defining animations easier.
15
12
  */
16
- export const derivations = ({
17
- current,
18
- next,
19
- previous,
20
- dimensions,
21
- }: DerivationsParams) => {
13
+ export const derivations = ({ current, next, previous }: DerivationsParams) => {
22
14
  "worklet";
15
+
23
16
  // The combined progress
24
17
  const progress = current.progress + (next?.progress ?? 0);
25
18
 
@@ -30,26 +23,16 @@ export const derivations = ({
30
23
  const isActiveTransitioning = !!(
31
24
  active.gesture.isDragging || active.animating
32
25
  );
26
+
33
27
  const isDismissing = !!(active.gesture.isDismissing || active.closing);
34
28
 
35
29
  // The active bound id
36
30
  const activeBoundId = Bounds.getActiveBound(current, next, previous);
37
31
 
38
- // bounds api
39
- const bounds = createBounds({
40
- activeBoundId,
41
- current,
42
- previous,
43
- next,
44
- progress,
45
- dimensions,
46
- });
47
-
48
32
  return {
49
33
  progress,
50
34
  focused,
51
35
  activeBoundId,
52
- bounds,
53
36
  active,
54
37
  isActiveTransitioning,
55
38
  isDismissing,
@@ -1,30 +1,30 @@
1
- import type { ScaledSize } from "react-native";
2
1
  import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
3
2
  import type { ScreenTransitionState } from "../../../types/animation";
4
3
  import type { BoundsMethod } from "../../../types/bounds";
4
+ import type { Layout } from "../../../types/native-stack.navigator";
5
5
 
6
6
  /**
7
7
  * Params passed to the builder initializer. No method required here.
8
8
  */
9
9
  export type BoundsBuilderInitParams = {
10
- id: string | null;
11
- previous?: ScreenTransitionState;
12
- current: ScreenTransitionState;
13
- next?: ScreenTransitionState;
14
- progress: number;
15
- dimensions: ScaledSize;
10
+ id: string | null;
11
+ previous?: ScreenTransitionState;
12
+ current: ScreenTransitionState;
13
+ next?: ScreenTransitionState;
14
+ progress: number;
15
+ dimensions: Layout;
16
16
  };
17
17
 
18
18
  export type BoundsAnchor =
19
- | "topLeading"
20
- | "top"
21
- | "topTrailing"
22
- | "leading"
23
- | "center"
24
- | "trailing"
25
- | "bottomLeading"
26
- | "bottom"
27
- | "bottomTrailing";
19
+ | "topLeading"
20
+ | "top"
21
+ | "topTrailing"
22
+ | "leading"
23
+ | "center"
24
+ | "trailing"
25
+ | "bottomLeading"
26
+ | "bottom"
27
+ | "bottomTrailing";
28
28
 
29
29
  export type BoundsScaleMode = "match" | "none" | "uniform";
30
30
 
@@ -35,117 +35,117 @@ export type BoundsSpace = "relative" | "absolute";
35
35
  export type BoundsComputeParams = BoundsBuilderInitParams;
36
36
 
37
37
  export type RawSizeAbsoluteReturn = {
38
- width: number;
39
- height: number;
40
- translateX: number;
41
- translateY: number;
38
+ width: number;
39
+ height: number;
40
+ translateX: number;
41
+ translateY: number;
42
42
  };
43
43
 
44
44
  export type RawSizeRelativeReturn = {
45
- translateX: number;
46
- translateY: number;
47
- width: number;
48
- height: number;
45
+ translateX: number;
46
+ translateY: number;
47
+ width: number;
48
+ height: number;
49
49
  };
50
50
 
51
51
  export type RawTransformAbsoluteReturn = {
52
- translateX: number;
53
- translateY: number;
54
- scaleX: number;
55
- scaleY: number;
52
+ translateX: number;
53
+ translateY: number;
54
+ scaleX: number;
55
+ scaleY: number;
56
56
  };
57
57
 
58
58
  export type RawTransformRelativeReturn = {
59
- translateX: number;
60
- translateY: number;
61
- scaleX: number;
62
- scaleY: number;
59
+ translateX: number;
60
+ translateY: number;
61
+ scaleX: number;
62
+ scaleY: number;
63
63
  };
64
64
 
65
65
  export type RawContentReturn = {
66
- translateX: number;
67
- translateY: number;
68
- scale: number;
66
+ translateX: number;
67
+ translateY: number;
68
+ scale: number;
69
69
  };
70
70
 
71
71
  // Conditional return type based on options
72
72
  export type BoundsReturnType<T extends BoundsBuilderOptions> =
73
- T["raw"] extends true
74
- ? T["method"] extends "size"
75
- ? T["space"] extends "absolute"
76
- ? RawSizeAbsoluteReturn
77
- : RawSizeRelativeReturn
78
- : T["method"] extends "content"
79
- ? RawContentReturn
80
- : T["space"] extends "absolute"
81
- ? RawTransformAbsoluteReturn
82
- : RawTransformRelativeReturn
83
- : StyleProps;
73
+ T["raw"] extends true
74
+ ? T["method"] extends "size"
75
+ ? T["space"] extends "absolute"
76
+ ? RawSizeAbsoluteReturn
77
+ : RawSizeRelativeReturn
78
+ : T["method"] extends "content"
79
+ ? RawContentReturn
80
+ : T["space"] extends "absolute"
81
+ ? RawTransformAbsoluteReturn
82
+ : RawTransformRelativeReturn
83
+ : StyleProps;
84
84
 
85
85
  export type BoundsBuilderOptions = {
86
- /**
87
- * @deprecated Use `content.scaleMode` instead.
88
- */
89
- toFullscreen?: boolean;
90
- /**
91
- * @deprecated Use `content.anchor` instead.
92
- */
93
- absolute?: boolean;
94
- /**
95
- * @deprecated Use `content.anchor` instead.
96
- */
97
- relative?: boolean;
98
- /**
99
- * @deprecated Use `scaleMode` instead.
100
- */
101
- contentScaleMode?: "aspectFill" | "aspectFit" | "auto";
102
-
103
- /**
104
- * The ID of the bound to compute bounds for. If not provided, uses the active bound ID.
105
- */
106
- id?: string;
107
-
108
- /**
109
- * The method to use to compute the bounds.
110
- *
111
- * - "transform": translates and scales (scaleX/scaleY), no width/height size
112
- * - "size": translates and sizes (width/height), no scaleX/scaleY
113
- * - "content": screen-level content transform that aligns the destination screen
114
- * so the target bound matches the source at progress start
115
- * @default "transform"
116
- */
117
- method?: BoundsMethod;
118
-
119
- /**
120
- * The space to use to compute the bounds.
121
- *
122
- * - "relative": the bounds are computed with relative deltas, constrained by parent layout
123
- * - "absolute": the bounds are computed with absolute coordinates, unconstrained by parent layout
124
- * @default "relative"
125
- */
126
- space?: BoundsSpace;
127
- /**
128
- * Whether the bound should target the screen or the bound.
129
- * @default "bound"
130
- */
131
- target?: BoundsTarget;
132
- /**
133
- * The gesture offsets to apply to the bounds.
134
- */
135
- gestures?: { x?: number; y?: number };
136
- /**
137
- * How the bounds should be scaled between each other.
138
- * @default "match"
139
- */
140
- scaleMode?: BoundsScaleMode;
141
- /**
142
- * Where the bounds should be anchored between each other.
143
- * @default "center"
144
- */
145
- anchor?: BoundsAnchor;
146
- /**
147
- * If true, the raw values will be returned instead of the computed values.
148
- * @default false
149
- */
150
- raw?: boolean;
86
+ /**
87
+ * @deprecated Use `content.scaleMode` instead.
88
+ */
89
+ toFullscreen?: boolean;
90
+ /**
91
+ * @deprecated Use `content.anchor` instead.
92
+ */
93
+ absolute?: boolean;
94
+ /**
95
+ * @deprecated Use `content.anchor` instead.
96
+ */
97
+ relative?: boolean;
98
+ /**
99
+ * @deprecated Use `scaleMode` instead.
100
+ */
101
+ contentScaleMode?: "aspectFill" | "aspectFit" | "auto";
102
+
103
+ /**
104
+ * The ID of the bound to compute bounds for. If not provided, uses the active bound ID.
105
+ */
106
+ id?: string;
107
+
108
+ /**
109
+ * The method to use to compute the bounds.
110
+ *
111
+ * - "transform": translates and scales (scaleX/scaleY), no width/height size
112
+ * - "size": translates and sizes (width/height), no scaleX/scaleY
113
+ * - "content": screen-level content transform that aligns the destination screen
114
+ * so the target bound matches the source at progress start
115
+ * @default "transform"
116
+ */
117
+ method?: BoundsMethod;
118
+
119
+ /**
120
+ * The space to use to compute the bounds.
121
+ *
122
+ * - "relative": the bounds are computed with relative deltas, constrained by parent layout
123
+ * - "absolute": the bounds are computed with absolute coordinates, unconstrained by parent layout
124
+ * @default "relative"
125
+ */
126
+ space?: BoundsSpace;
127
+ /**
128
+ * Whether the bound should target the screen or the bound.
129
+ * @default "bound"
130
+ */
131
+ target?: BoundsTarget;
132
+ /**
133
+ * The gesture offsets to apply to the bounds.
134
+ */
135
+ gestures?: { x?: number; y?: number };
136
+ /**
137
+ * How the bounds should be scaled between each other.
138
+ * @default "match"
139
+ */
140
+ scaleMode?: BoundsScaleMode;
141
+ /**
142
+ * Where the bounds should be anchored between each other.
143
+ * @default "center"
144
+ */
145
+ anchor?: BoundsAnchor;
146
+ /**
147
+ * If true, the raw values will be returned instead of the computed values.
148
+ * @default false
149
+ */
150
+ raw?: boolean;
151
151
  };