react-native-screen-transitions 1.1.0 → 2.0.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 (344) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +273 -269
  3. package/lib/commonjs/__tests__ /geometry.test.js +178 -0
  4. package/lib/commonjs/__tests__ /geometry.test.js.map +1 -0
  5. package/lib/commonjs/components/bounds-activator.js +33 -0
  6. package/lib/commonjs/components/bounds-activator.js.map +1 -0
  7. package/lib/commonjs/components/controllers/screen-lifecycle.js +66 -0
  8. package/lib/commonjs/components/controllers/screen-lifecycle.js.map +1 -0
  9. package/lib/commonjs/components/create-transition-aware-component.js +96 -0
  10. package/lib/commonjs/components/create-transition-aware-component.js.map +1 -0
  11. package/lib/commonjs/components/root-transition-aware.js +56 -0
  12. package/lib/commonjs/components/root-transition-aware.js.map +1 -0
  13. package/lib/commonjs/configs/index.js +12 -0
  14. package/lib/commonjs/configs/index.js.map +1 -0
  15. package/lib/commonjs/configs/presets.js +206 -0
  16. package/lib/commonjs/configs/presets.js.map +1 -0
  17. package/lib/commonjs/configs/specs.js +14 -0
  18. package/lib/commonjs/configs/specs.js.map +1 -0
  19. package/lib/commonjs/hooks/animation/use-associated-style.js +36 -0
  20. package/lib/commonjs/hooks/animation/use-associated-style.js.map +1 -0
  21. package/lib/commonjs/hooks/animation/use-screen-animation.js +120 -0
  22. package/lib/commonjs/hooks/animation/use-screen-animation.js.map +1 -0
  23. package/lib/commonjs/hooks/bounds/use-bound-measurer.js +52 -0
  24. package/lib/commonjs/hooks/bounds/use-bound-measurer.js.map +1 -0
  25. package/lib/commonjs/hooks/gestures/use-build-gestures.js +239 -0
  26. package/lib/commonjs/hooks/gestures/use-build-gestures.js.map +1 -0
  27. package/lib/commonjs/hooks/gestures/use-scroll-progress.js +57 -0
  28. package/lib/commonjs/hooks/gestures/use-scroll-progress.js.map +1 -0
  29. package/lib/commonjs/hooks/use-stable-callback.js +17 -0
  30. package/lib/commonjs/hooks/use-stable-callback.js.map +1 -0
  31. package/lib/commonjs/index.js +37 -0
  32. package/lib/commonjs/index.js.map +1 -0
  33. package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js +68 -0
  34. package/lib/commonjs/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
  35. package/lib/commonjs/integrations/native-stack/utils/debounce.js +16 -0
  36. package/lib/commonjs/integrations/native-stack/utils/debounce.js.map +1 -0
  37. package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js +17 -0
  38. package/lib/commonjs/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -0
  39. package/lib/commonjs/integrations/native-stack/utils/useAnimatedHeaderHeight.js +18 -0
  40. package/lib/commonjs/integrations/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
  41. package/lib/commonjs/integrations/native-stack/utils/useDismissedRouteError.js +22 -0
  42. package/lib/commonjs/integrations/native-stack/utils/useDismissedRouteError.js.map +1 -0
  43. package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js +25 -0
  44. package/lib/commonjs/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -0
  45. package/lib/commonjs/integrations/native-stack/views/FontProcessor.js +10 -0
  46. package/lib/commonjs/integrations/native-stack/views/FontProcessor.js.map +1 -0
  47. package/lib/commonjs/integrations/native-stack/views/FontProcessor.native.js +18 -0
  48. package/lib/commonjs/integrations/native-stack/views/FontProcessor.native.js.map +1 -0
  49. package/lib/commonjs/integrations/native-stack/views/FooterComponent.js +17 -0
  50. package/lib/commonjs/integrations/native-stack/views/FooterComponent.js.map +1 -0
  51. package/lib/commonjs/integrations/native-stack/views/NativeStackView.js +138 -0
  52. package/lib/commonjs/integrations/native-stack/views/NativeStackView.js.map +1 -0
  53. package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js +497 -0
  54. package/lib/commonjs/integrations/native-stack/views/NativeStackView.native.js.map +1 -0
  55. package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js +203 -0
  56. package/lib/commonjs/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -0
  57. package/lib/commonjs/package.json +1 -0
  58. package/lib/commonjs/providers/gestures.js +64 -0
  59. package/lib/commonjs/providers/gestures.js.map +1 -0
  60. package/lib/commonjs/providers/keys.js +35 -0
  61. package/lib/commonjs/providers/keys.js.map +1 -0
  62. package/lib/commonjs/stores/animations.js +39 -0
  63. package/lib/commonjs/stores/animations.js.map +1 -0
  64. package/lib/commonjs/stores/bounds.js +64 -0
  65. package/lib/commonjs/stores/bounds.js.map +1 -0
  66. package/lib/commonjs/stores/gestures.js +38 -0
  67. package/lib/commonjs/stores/gestures.js.map +1 -0
  68. package/lib/commonjs/stores/navigator-dismiss-state.js +23 -0
  69. package/lib/commonjs/stores/navigator-dismiss-state.js.map +1 -0
  70. package/lib/commonjs/stores/utils/reset-stores-for-screen.js +20 -0
  71. package/lib/commonjs/stores/utils/reset-stores-for-screen.js.map +1 -0
  72. package/lib/commonjs/types/animation.js +6 -0
  73. package/lib/commonjs/types/animation.js.map +1 -0
  74. package/lib/commonjs/types/bounds.js +6 -0
  75. package/lib/commonjs/types/bounds.js.map +1 -0
  76. package/lib/commonjs/types/core.js +6 -0
  77. package/lib/commonjs/types/core.js.map +1 -0
  78. package/lib/commonjs/types/gesture.js +2 -0
  79. package/lib/commonjs/types/gesture.js.map +1 -0
  80. package/lib/commonjs/types/navigator.js +6 -0
  81. package/lib/commonjs/types/navigator.js.map +1 -0
  82. package/lib/commonjs/types/utils.js +2 -0
  83. package/lib/commonjs/types/utils.js.map +1 -0
  84. package/lib/commonjs/utils/animation/animate.js +18 -0
  85. package/lib/commonjs/utils/animation/animate.js.map +1 -0
  86. package/lib/commonjs/utils/animation/run-transition.js +48 -0
  87. package/lib/commonjs/utils/animation/run-transition.js.map +1 -0
  88. package/lib/commonjs/utils/bounds/_types/builder.js +6 -0
  89. package/lib/commonjs/utils/bounds/_types/builder.js.map +1 -0
  90. package/lib/commonjs/utils/bounds/_types/geometry.js +2 -0
  91. package/lib/commonjs/utils/bounds/_types/geometry.js.map +1 -0
  92. package/lib/commonjs/utils/bounds/_types/get-bounds.js +6 -0
  93. package/lib/commonjs/utils/bounds/_types/get-bounds.js.map +1 -0
  94. package/lib/commonjs/utils/bounds/build-bound-styles.js +145 -0
  95. package/lib/commonjs/utils/bounds/build-bound-styles.js.map +1 -0
  96. package/lib/commonjs/utils/bounds/constants.js +31 -0
  97. package/lib/commonjs/utils/bounds/constants.js.map +1 -0
  98. package/lib/commonjs/utils/bounds/flatten-styles.js +27 -0
  99. package/lib/commonjs/utils/bounds/flatten-styles.js.map +1 -0
  100. package/lib/commonjs/utils/bounds/geometry.js +94 -0
  101. package/lib/commonjs/utils/bounds/geometry.js.map +1 -0
  102. package/lib/commonjs/utils/bounds/get-bounds.js +51 -0
  103. package/lib/commonjs/utils/bounds/get-bounds.js.map +1 -0
  104. package/lib/commonjs/utils/bounds/index.js +38 -0
  105. package/lib/commonjs/utils/bounds/index.js.map +1 -0
  106. package/lib/commonjs/utils/bounds/style-composers.js +199 -0
  107. package/lib/commonjs/utils/bounds/style-composers.js.map +1 -0
  108. package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js +81 -0
  109. package/lib/commonjs/utils/gesture/apply-gesture-activation-criteria.js.map +1 -0
  110. package/lib/commonjs/utils/gesture/map-gesture-to-progress.js +17 -0
  111. package/lib/commonjs/utils/gesture/map-gesture-to-progress.js.map +1 -0
  112. package/lib/commonjs/utils/gesture/normalize-gesture-translation.js +21 -0
  113. package/lib/commonjs/utils/gesture/normalize-gesture-translation.js.map +1 -0
  114. package/lib/commonjs/utils/index.js +17 -0
  115. package/lib/commonjs/utils/index.js.map +1 -0
  116. package/lib/module/__tests__ /geometry.test.js +178 -0
  117. package/lib/module/__tests__ /geometry.test.js.map +1 -0
  118. package/lib/module/components/bounds-activator.js +28 -0
  119. package/lib/module/components/bounds-activator.js.map +1 -0
  120. package/lib/module/components/controllers/screen-lifecycle.js +60 -0
  121. package/lib/module/components/controllers/screen-lifecycle.js.map +1 -0
  122. package/lib/module/components/create-transition-aware-component.js +91 -0
  123. package/lib/module/components/create-transition-aware-component.js.map +1 -0
  124. package/lib/module/components/root-transition-aware.js +51 -0
  125. package/lib/module/components/root-transition-aware.js.map +1 -0
  126. package/lib/module/configs/index.js +5 -0
  127. package/lib/module/configs/index.js.map +1 -0
  128. package/lib/module/configs/presets.js +197 -0
  129. package/lib/module/configs/presets.js.map +1 -0
  130. package/lib/module/configs/specs.js +10 -0
  131. package/lib/module/configs/specs.js.map +1 -0
  132. package/lib/module/hooks/animation/use-associated-style.js +32 -0
  133. package/lib/module/hooks/animation/use-associated-style.js.map +1 -0
  134. package/lib/module/hooks/animation/use-screen-animation.js +115 -0
  135. package/lib/module/hooks/animation/use-screen-animation.js.map +1 -0
  136. package/lib/module/hooks/bounds/use-bound-measurer.js +47 -0
  137. package/lib/module/hooks/bounds/use-bound-measurer.js.map +1 -0
  138. package/lib/module/hooks/gestures/use-build-gestures.js +234 -0
  139. package/lib/module/hooks/gestures/use-build-gestures.js.map +1 -0
  140. package/lib/module/hooks/gestures/use-scroll-progress.js +52 -0
  141. package/lib/module/hooks/gestures/use-scroll-progress.js.map +1 -0
  142. package/lib/module/hooks/use-stable-callback.js +13 -0
  143. package/lib/module/hooks/use-stable-callback.js.map +1 -0
  144. package/lib/module/index.js +21 -0
  145. package/lib/module/index.js.map +1 -0
  146. package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js +63 -0
  147. package/lib/module/integrations/native-stack/navigators/createNativeStackNavigator.js.map +1 -0
  148. package/lib/module/integrations/native-stack/utils/debounce.js +12 -0
  149. package/lib/module/integrations/native-stack/utils/debounce.js.map +1 -0
  150. package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js +12 -0
  151. package/lib/module/integrations/native-stack/utils/getModalRoutesKeys.js.map +1 -0
  152. package/lib/module/integrations/native-stack/utils/useAnimatedHeaderHeight.js +12 -0
  153. package/lib/module/integrations/native-stack/utils/useAnimatedHeaderHeight.js.map +1 -0
  154. package/lib/module/integrations/native-stack/utils/useDismissedRouteError.js +17 -0
  155. package/lib/module/integrations/native-stack/utils/useDismissedRouteError.js.map +1 -0
  156. package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js +20 -0
  157. package/lib/module/integrations/native-stack/utils/useInvalidPreventRemoveError.js.map +1 -0
  158. package/lib/module/integrations/native-stack/views/FontProcessor.js +6 -0
  159. package/lib/module/integrations/native-stack/views/FontProcessor.js.map +1 -0
  160. package/lib/module/integrations/native-stack/views/FontProcessor.native.js +12 -0
  161. package/lib/module/integrations/native-stack/views/FontProcessor.native.js.map +1 -0
  162. package/lib/module/integrations/native-stack/views/FooterComponent.js +13 -0
  163. package/lib/module/integrations/native-stack/views/FooterComponent.js.map +1 -0
  164. package/lib/module/integrations/native-stack/views/NativeStackView.js +133 -0
  165. package/lib/module/integrations/native-stack/views/NativeStackView.js.map +1 -0
  166. package/lib/module/integrations/native-stack/views/NativeStackView.native.js +492 -0
  167. package/lib/module/integrations/native-stack/views/NativeStackView.native.js.map +1 -0
  168. package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js +199 -0
  169. package/lib/module/integrations/native-stack/views/useHeaderConfigProps.js.map +1 -0
  170. package/lib/module/providers/gestures.js +58 -0
  171. package/lib/module/providers/gestures.js.map +1 -0
  172. package/lib/module/providers/keys.js +29 -0
  173. package/lib/module/providers/keys.js.map +1 -0
  174. package/lib/module/stores/animations.js +33 -0
  175. package/lib/module/stores/animations.js.map +1 -0
  176. package/lib/module/stores/bounds.js +60 -0
  177. package/lib/module/stores/bounds.js.map +1 -0
  178. package/lib/module/stores/gestures.js +34 -0
  179. package/lib/module/stores/gestures.js.map +1 -0
  180. package/lib/module/stores/navigator-dismiss-state.js +19 -0
  181. package/lib/module/stores/navigator-dismiss-state.js.map +1 -0
  182. package/lib/module/stores/utils/reset-stores-for-screen.js +16 -0
  183. package/lib/module/stores/utils/reset-stores-for-screen.js.map +1 -0
  184. package/lib/module/types/animation.js +4 -0
  185. package/lib/module/types/animation.js.map +1 -0
  186. package/lib/module/types/bounds.js +4 -0
  187. package/lib/module/types/bounds.js.map +1 -0
  188. package/lib/module/types/core.js +4 -0
  189. package/lib/module/types/core.js.map +1 -0
  190. package/lib/module/types/gesture.js +2 -0
  191. package/lib/module/types/gesture.js.map +1 -0
  192. package/lib/module/types/navigator.js +4 -0
  193. package/lib/module/types/navigator.js.map +1 -0
  194. package/lib/module/types/utils.js +2 -0
  195. package/lib/module/types/utils.js.map +1 -0
  196. package/lib/module/utils/animation/animate.js +13 -0
  197. package/lib/module/utils/animation/animate.js.map +1 -0
  198. package/lib/module/utils/animation/run-transition.js +43 -0
  199. package/lib/module/utils/animation/run-transition.js.map +1 -0
  200. package/lib/module/utils/bounds/_types/builder.js +4 -0
  201. package/lib/module/utils/bounds/_types/builder.js.map +1 -0
  202. package/lib/module/utils/bounds/_types/geometry.js +2 -0
  203. package/lib/module/utils/bounds/_types/geometry.js.map +1 -0
  204. package/lib/module/utils/bounds/_types/get-bounds.js +4 -0
  205. package/lib/module/utils/bounds/_types/get-bounds.js.map +1 -0
  206. package/lib/module/utils/bounds/build-bound-styles.js +141 -0
  207. package/lib/module/utils/bounds/build-bound-styles.js.map +1 -0
  208. package/lib/module/utils/bounds/constants.js +26 -0
  209. package/lib/module/utils/bounds/constants.js.map +1 -0
  210. package/lib/module/utils/bounds/flatten-styles.js +23 -0
  211. package/lib/module/utils/bounds/flatten-styles.js.map +1 -0
  212. package/lib/module/utils/bounds/geometry.js +89 -0
  213. package/lib/module/utils/bounds/geometry.js.map +1 -0
  214. package/lib/module/utils/bounds/get-bounds.js +46 -0
  215. package/lib/module/utils/bounds/get-bounds.js.map +1 -0
  216. package/lib/module/utils/bounds/index.js +33 -0
  217. package/lib/module/utils/bounds/index.js.map +1 -0
  218. package/lib/module/utils/bounds/style-composers.js +191 -0
  219. package/lib/module/utils/bounds/style-composers.js.map +1 -0
  220. package/lib/module/utils/gesture/apply-gesture-activation-criteria.js +76 -0
  221. package/lib/module/utils/gesture/apply-gesture-activation-criteria.js.map +1 -0
  222. package/lib/module/utils/gesture/map-gesture-to-progress.js +12 -0
  223. package/lib/module/utils/gesture/map-gesture-to-progress.js.map +1 -0
  224. package/lib/module/utils/gesture/normalize-gesture-translation.js +16 -0
  225. package/lib/module/utils/gesture/normalize-gesture-translation.js.map +1 -0
  226. package/lib/module/utils/index.js +4 -0
  227. package/lib/module/utils/index.js.map +1 -0
  228. package/lib/typescript/components/bounds-activator.d.ts +8 -0
  229. package/lib/typescript/components/bounds-activator.d.ts.map +1 -0
  230. package/lib/typescript/components/controllers/screen-lifecycle.d.ts +6 -0
  231. package/lib/typescript/components/controllers/screen-lifecycle.d.ts.map +1 -0
  232. package/lib/typescript/components/create-transition-aware-component.d.ts +9 -0
  233. package/lib/typescript/components/create-transition-aware-component.d.ts.map +1 -0
  234. package/lib/typescript/components/root-transition-aware.d.ts +6 -0
  235. package/lib/typescript/components/root-transition-aware.d.ts.map +1 -0
  236. package/lib/typescript/configs/index.d.ts +3 -0
  237. package/lib/typescript/configs/index.d.ts.map +1 -0
  238. package/lib/typescript/configs/presets.d.ts +9 -0
  239. package/lib/typescript/configs/presets.d.ts.map +1 -0
  240. package/lib/typescript/configs/specs.d.ts +3 -0
  241. package/lib/typescript/configs/specs.d.ts.map +1 -0
  242. package/lib/typescript/hooks/animation/use-associated-style.d.ts +11 -0
  243. package/lib/typescript/hooks/animation/use-associated-style.d.ts.map +1 -0
  244. package/lib/typescript/hooks/animation/use-screen-animation.d.ts +7 -0
  245. package/lib/typescript/hooks/animation/use-screen-animation.d.ts.map +1 -0
  246. package/lib/typescript/hooks/bounds/use-bound-measurer.d.ts +18 -0
  247. package/lib/typescript/hooks/bounds/use-bound-measurer.d.ts.map +1 -0
  248. package/lib/typescript/hooks/gestures/use-build-gestures.d.ts +11 -0
  249. package/lib/typescript/hooks/gestures/use-build-gestures.d.ts.map +1 -0
  250. package/lib/typescript/hooks/gestures/use-scroll-progress.d.ts +14 -0
  251. package/lib/typescript/hooks/gestures/use-scroll-progress.d.ts.map +1 -0
  252. package/lib/typescript/hooks/use-stable-callback.d.ts +2 -0
  253. package/lib/typescript/hooks/use-stable-callback.d.ts.map +1 -0
  254. package/lib/typescript/index.d.ts +1275 -0
  255. package/lib/typescript/index.d.ts.map +1 -0
  256. package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts +16 -0
  257. package/lib/typescript/integrations/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -0
  258. package/lib/typescript/integrations/native-stack/utils/debounce.d.ts +2 -0
  259. package/lib/typescript/integrations/native-stack/utils/debounce.d.ts.map +1 -0
  260. package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts +4 -0
  261. package/lib/typescript/integrations/native-stack/utils/getModalRoutesKeys.d.ts.map +1 -0
  262. package/lib/typescript/integrations/native-stack/utils/useAnimatedHeaderHeight.d.ts +5 -0
  263. package/lib/typescript/integrations/native-stack/utils/useAnimatedHeaderHeight.d.ts.map +1 -0
  264. package/lib/typescript/integrations/native-stack/utils/useDismissedRouteError.d.ts +6 -0
  265. package/lib/typescript/integrations/native-stack/utils/useDismissedRouteError.d.ts.map +1 -0
  266. package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts +3 -0
  267. package/lib/typescript/integrations/native-stack/utils/useInvalidPreventRemoveError.d.ts.map +1 -0
  268. package/lib/typescript/integrations/native-stack/views/FontProcessor.d.ts +2 -0
  269. package/lib/typescript/integrations/native-stack/views/FontProcessor.d.ts.map +1 -0
  270. package/lib/typescript/integrations/native-stack/views/FontProcessor.native.d.ts +2 -0
  271. package/lib/typescript/integrations/native-stack/views/FontProcessor.native.d.ts.map +1 -0
  272. package/lib/typescript/integrations/native-stack/views/FooterComponent.d.ts +7 -0
  273. package/lib/typescript/integrations/native-stack/views/FooterComponent.d.ts.map +1 -0
  274. package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts +11 -0
  275. package/lib/typescript/integrations/native-stack/views/NativeStackView.d.ts.map +1 -0
  276. package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts +11 -0
  277. package/lib/typescript/integrations/native-stack/views/NativeStackView.native.d.ts.map +1 -0
  278. package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts +44 -0
  279. package/lib/typescript/integrations/native-stack/views/useHeaderConfigProps.d.ts.map +1 -0
  280. package/lib/typescript/providers/gestures.d.ts +22 -0
  281. package/lib/typescript/providers/gestures.d.ts.map +1 -0
  282. package/lib/typescript/providers/keys.d.ts +16 -0
  283. package/lib/typescript/providers/keys.d.ts.map +1 -0
  284. package/lib/typescript/stores/animations.d.ts +17 -0
  285. package/lib/typescript/stores/animations.d.ts.map +1 -0
  286. package/lib/typescript/stores/bounds.d.ts +21 -0
  287. package/lib/typescript/stores/bounds.d.ts.map +1 -0
  288. package/lib/typescript/stores/gestures.d.ts +21 -0
  289. package/lib/typescript/stores/gestures.d.ts.map +1 -0
  290. package/lib/typescript/stores/navigator-dismiss-state.d.ts +7 -0
  291. package/lib/typescript/stores/navigator-dismiss-state.d.ts.map +1 -0
  292. package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts +6 -0
  293. package/lib/typescript/stores/utils/reset-stores-for-screen.d.ts.map +1 -0
  294. package/lib/typescript/types/animation.d.ts +65 -0
  295. package/lib/typescript/types/animation.d.ts.map +1 -0
  296. package/lib/typescript/types/bounds.d.ts +73 -0
  297. package/lib/typescript/types/bounds.d.ts.map +1 -0
  298. package/lib/typescript/types/core.d.ts +47 -0
  299. package/lib/typescript/types/core.d.ts.map +1 -0
  300. package/lib/typescript/types/gesture.d.ts +28 -0
  301. package/lib/typescript/types/gesture.d.ts.map +1 -0
  302. package/lib/typescript/types/navigator.d.ts +683 -0
  303. package/lib/typescript/types/navigator.d.ts.map +1 -0
  304. package/lib/typescript/types/utils.d.ts +5 -0
  305. package/lib/typescript/types/utils.d.ts.map +1 -0
  306. package/lib/typescript/utils/animation/animate.d.ts +4 -0
  307. package/lib/typescript/utils/animation/animate.d.ts.map +1 -0
  308. package/lib/typescript/utils/animation/run-transition.d.ts +11 -0
  309. package/lib/typescript/utils/animation/run-transition.d.ts.map +1 -0
  310. package/lib/typescript/utils/bounds/_types/builder.d.ts +36 -0
  311. package/lib/typescript/utils/bounds/_types/builder.d.ts.map +1 -0
  312. package/lib/typescript/utils/bounds/_types/geometry.d.ts +16 -0
  313. package/lib/typescript/utils/bounds/_types/geometry.d.ts.map +1 -0
  314. package/lib/typescript/utils/bounds/_types/get-bounds.d.ts +10 -0
  315. package/lib/typescript/utils/bounds/_types/get-bounds.d.ts.map +1 -0
  316. package/lib/typescript/utils/bounds/build-bound-styles.d.ts +4 -0
  317. package/lib/typescript/utils/bounds/build-bound-styles.d.ts.map +1 -0
  318. package/lib/typescript/utils/bounds/constants.d.ts +7 -0
  319. package/lib/typescript/utils/bounds/constants.d.ts.map +1 -0
  320. package/lib/typescript/utils/bounds/flatten-styles.d.ts +2 -0
  321. package/lib/typescript/utils/bounds/flatten-styles.d.ts.map +1 -0
  322. package/lib/typescript/utils/bounds/geometry.d.ts +24 -0
  323. package/lib/typescript/utils/bounds/geometry.d.ts.map +1 -0
  324. package/lib/typescript/utils/bounds/get-bounds.d.ts +4 -0
  325. package/lib/typescript/utils/bounds/get-bounds.d.ts.map +1 -0
  326. package/lib/typescript/utils/bounds/index.d.ts +15 -0
  327. package/lib/typescript/utils/bounds/index.d.ts.map +1 -0
  328. package/lib/typescript/utils/bounds/style-composers.d.ts +40 -0
  329. package/lib/typescript/utils/bounds/style-composers.d.ts.map +1 -0
  330. package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts +17 -0
  331. package/lib/typescript/utils/gesture/apply-gesture-activation-criteria.d.ts.map +1 -0
  332. package/lib/typescript/utils/gesture/map-gesture-to-progress.d.ts +5 -0
  333. package/lib/typescript/utils/gesture/map-gesture-to-progress.d.ts.map +1 -0
  334. package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts +6 -0
  335. package/lib/typescript/utils/gesture/normalize-gesture-translation.d.ts.map +1 -0
  336. package/lib/typescript/utils/index.d.ts +2 -0
  337. package/lib/typescript/utils/index.d.ts.map +1 -0
  338. package/package.json +33 -16
  339. package/dist/index.d.mts +0 -1473
  340. package/dist/index.d.ts +0 -1473
  341. package/dist/index.js +0 -1169
  342. package/dist/index.js.map +0 -1
  343. package/dist/index.mjs +0 -1159
  344. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ZoomIn = exports.SlideFromTop = exports.SlideFromBottom = exports.ElasticCard = exports.DraggableCard = void 0;
7
+ var _reactNativeReanimated = require("react-native-reanimated");
8
+ var _specs = require("./specs");
9
+ const SlideFromTop = (config = {}) => {
10
+ return {
11
+ enableTransitions: true,
12
+ gestureEnabled: true,
13
+ gestureDirection: "vertical-inverted",
14
+ screenStyleInterpolator: ({
15
+ current,
16
+ next,
17
+ layouts: {
18
+ screen: {
19
+ height
20
+ }
21
+ }
22
+ }) => {
23
+ "worklet";
24
+
25
+ const progress = current.progress + (next?.progress ?? 0);
26
+ const y = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [-height, 0, height]);
27
+ return {
28
+ contentStyle: {
29
+ transform: [{
30
+ translateY: y
31
+ }]
32
+ }
33
+ };
34
+ },
35
+ transitionSpec: {
36
+ open: _specs.DefaultSpec,
37
+ close: _specs.DefaultSpec
38
+ },
39
+ ...config
40
+ };
41
+ };
42
+ exports.SlideFromTop = SlideFromTop;
43
+ const ZoomIn = (config = {}) => {
44
+ return {
45
+ enableTransitions: true,
46
+ gestureEnabled: false,
47
+ screenStyleInterpolator: ({
48
+ current,
49
+ next
50
+ }) => {
51
+ "worklet";
52
+
53
+ const progress = current.progress + (next?.progress ?? 0);
54
+ const scale = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [0.5, 1, 0.5], _reactNativeReanimated.Extrapolation.CLAMP);
55
+ const opacity = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [0, 1, 0], _reactNativeReanimated.Extrapolation.CLAMP);
56
+ return {
57
+ contentStyle: {
58
+ transform: [{
59
+ scale
60
+ }],
61
+ opacity
62
+ }
63
+ };
64
+ },
65
+ transitionSpec: {
66
+ open: _specs.DefaultSpec,
67
+ close: _specs.DefaultSpec
68
+ },
69
+ ...config
70
+ };
71
+ };
72
+ exports.ZoomIn = ZoomIn;
73
+ const SlideFromBottom = (config = {}) => {
74
+ return {
75
+ enableTransitions: true,
76
+ gestureEnabled: true,
77
+ gestureDirection: "vertical",
78
+ screenStyleInterpolator: ({
79
+ current,
80
+ next,
81
+ layouts: {
82
+ screen: {
83
+ height
84
+ }
85
+ }
86
+ }) => {
87
+ "worklet";
88
+
89
+ const progress = current.progress + (next?.progress ?? 0);
90
+ const y = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [height, 0, -height]);
91
+ return {
92
+ contentStyle: {
93
+ transform: [{
94
+ translateY: y
95
+ }]
96
+ }
97
+ };
98
+ },
99
+ transitionSpec: {
100
+ open: _specs.DefaultSpec,
101
+ close: _specs.DefaultSpec
102
+ },
103
+ ...config
104
+ };
105
+ };
106
+ exports.SlideFromBottom = SlideFromBottom;
107
+ const DraggableCard = (config = {}) => {
108
+ return {
109
+ enableTransitions: true,
110
+ gestureEnabled: true,
111
+ gestureDirection: ["horizontal", "vertical"],
112
+ screenStyleInterpolator: ({
113
+ current,
114
+ progress,
115
+ layouts: {
116
+ screen
117
+ }
118
+ }) => {
119
+ "worklet";
120
+
121
+ /** Combined */
122
+ const scale = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [0, 1, 0.75]);
123
+
124
+ /** Vertical */
125
+ const translateY = (0, _reactNativeReanimated.interpolate)(current.gesture.normalizedY, [-1, 1], [-screen.height * 0.5, screen.height * 0.5], "clamp");
126
+
127
+ /** Horizontal */
128
+ const translateX = (0, _reactNativeReanimated.interpolate)(current.gesture.normalizedX, [-1, 1], [-screen.width * 0.5, screen.width * 0.5], "clamp");
129
+ return {
130
+ contentStyle: {
131
+ transform: [{
132
+ scale
133
+ }, {
134
+ translateY: translateY
135
+ }, {
136
+ translateX
137
+ }]
138
+ }
139
+ };
140
+ },
141
+ transitionSpec: {
142
+ open: _specs.DefaultSpec,
143
+ close: _specs.DefaultSpec
144
+ },
145
+ ...config
146
+ };
147
+ };
148
+ exports.DraggableCard = DraggableCard;
149
+ const ElasticCard = (config = {
150
+ elasticFactor: 0.5
151
+ }) => {
152
+ return {
153
+ enableTransitions: true,
154
+ gestureEnabled: true,
155
+ gestureDirection: "bidirectional",
156
+ screenStyleInterpolator: ({
157
+ current,
158
+ next,
159
+ layouts: {
160
+ screen
161
+ },
162
+ progress
163
+ }) => {
164
+ "worklet";
165
+
166
+ /**
167
+ * Applies to both screens ( previous and incoming)
168
+ */
169
+ const scale = (0, _reactNativeReanimated.interpolate)(progress, [0, 1, 2], [0, 1, 0.8]);
170
+
171
+ /**
172
+ * Applies to current screen
173
+ */
174
+ const maxElasticityX = screen.width * (config.elasticFactor ?? 0.5);
175
+ const maxElasticityY = screen.height * (config.elasticFactor ?? 0.5);
176
+ const translateX = (0, _reactNativeReanimated.interpolate)(current.gesture.normalizedX, [-1, 0, 1], [-maxElasticityX, 0, maxElasticityX], "clamp");
177
+ const translateY = (0, _reactNativeReanimated.interpolate)(current.gesture.normalizedY, [-1, 0, 1], [-maxElasticityY, 0, maxElasticityY], "clamp");
178
+
179
+ /**
180
+ * Applies to unfocused screen ( previous screen )
181
+ */
182
+ const overlayColor = (0, _reactNativeReanimated.interpolateColor)(progress, [0, 1], ["rgba(0,0,0,0)", "rgba(0,0,0,0.5)"]);
183
+ return {
184
+ contentStyle: {
185
+ transform: [{
186
+ scale
187
+ }, {
188
+ translateX
189
+ }, {
190
+ translateY
191
+ }]
192
+ },
193
+ overlayStyle: {
194
+ backgroundColor: !next ? overlayColor : "rgba(0,0,0,0)"
195
+ }
196
+ };
197
+ },
198
+ transitionSpec: {
199
+ open: _specs.DefaultSpec,
200
+ close: _specs.DefaultSpec
201
+ },
202
+ ...config
203
+ };
204
+ };
205
+ exports.ElasticCard = ElasticCard;
206
+ //# sourceMappingURL=presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeReanimated","require","_specs","SlideFromTop","config","enableTransitions","gestureEnabled","gestureDirection","screenStyleInterpolator","current","next","layouts","screen","height","progress","y","interpolate","contentStyle","transform","translateY","transitionSpec","open","DefaultSpec","close","exports","ZoomIn","scale","Extrapolation","CLAMP","opacity","SlideFromBottom","DraggableCard","gesture","normalizedY","translateX","normalizedX","width","ElasticCard","elasticFactor","maxElasticityX","maxElasticityY","overlayColor","interpolateColor","overlayStyle","backgroundColor"],"sourceRoot":"../../../src","sources":["configs/presets.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAD,OAAA;AAEO,MAAME,YAAY,GAAGA,CAC3BC,MAAuC,GAAG,CAAC,CAAC,KAChB;EAC5B,OAAO;IACNC,iBAAiB,EAAE,IAAI;IACvBC,cAAc,EAAE,IAAI;IACpBC,gBAAgB,EAAE,mBAAmB;IACrCC,uBAAuB,EAAEA,CAAC;MACzBC,OAAO;MACPC,IAAI;MACJC,OAAO,EAAE;QACRC,MAAM,EAAE;UAAEC;QAAO;MAClB;IACD,CAAC,KAAK;MACL,SAAS;;MAET,MAAMC,QAAQ,GAAGL,OAAO,CAACK,QAAQ,IAAIJ,IAAI,EAAEI,QAAQ,IAAI,CAAC,CAAC;MAEzD,MAAMC,CAAC,GAAG,IAAAC,kCAAW,EAACF,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAACD,MAAM,EAAE,CAAC,EAAEA,MAAM,CAAC,CAAC;MAEhE,OAAO;QACNI,YAAY,EAAE;UACbC,SAAS,EAAE,CAAC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
+ value: true
5
+ });
6
+ exports.DefaultSpec = void 0;
7
+ const DefaultSpec = exports.DefaultSpec = {
8
+ stiffness: 1000,
9
+ damping: 500,
10
+ mass: 3,
11
+ overshootClamping: true,
12
+ restSpeedThreshold: 0.01
13
+ };
14
+ //# sourceMappingURL=specs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DefaultSpec","exports","stiffness","damping","mass","overshootClamping","restSpeedThreshold"],"sourceRoot":"../../../src","sources":["configs/specs.ts"],"mappings":";;;;;;AAEO,MAAMA,WAA6B,GAAAC,OAAA,CAAAD,WAAA,GAAG;EAC5CE,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE,GAAG;EACZC,IAAI,EAAE,CAAC;EACPC,iBAAiB,EAAE,IAAI;EACvBC,kBAAkB,EAAE;AACrB,CAAC","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAssociatedStyles = void 0;
7
+ var _reactNativeReanimated = require("react-native-reanimated");
8
+ var _useScreenAnimation2 = require("./use-screen-animation");
9
+ /**
10
+ * This hook is used to get the associated styles for a given styleId.
11
+ * It is used to get the associated styles for a given styleId.
12
+ * It is used to get the associated styles for a given styleId.
13
+ */
14
+ const useAssociatedStyles = ({
15
+ id
16
+ } = {}) => {
17
+ const {
18
+ screenStyleInterpolator,
19
+ screenInterpolatorProps
20
+ } = (0, _useScreenAnimation2._useScreenAnimation)();
21
+ const associatedStyles = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
22
+ "worklet";
23
+
24
+ if (!id || !screenStyleInterpolator) {
25
+ return {};
26
+ }
27
+ return screenStyleInterpolator(screenInterpolatorProps.value)[id] || {
28
+ opacity: 1 // <-- This fixes flickering?? We'll have to deep dive this?? wtf
29
+ };
30
+ });
31
+ return {
32
+ associatedStyles
33
+ };
34
+ };
35
+ exports.useAssociatedStyles = useAssociatedStyles;
36
+ //# sourceMappingURL=use-associated-style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeReanimated","require","_useScreenAnimation2","useAssociatedStyles","id","screenStyleInterpolator","screenInterpolatorProps","_useScreenAnimation","associatedStyles","useAnimatedStyle","value","opacity","exports"],"sourceRoot":"../../../../src","sources":["hooks/animation/use-associated-style.tsx"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,oBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAME,mBAAmB,GAAGA,CAAC;EAAEC;AAAoB,CAAC,GAAG,CAAC,CAAC,KAAK;EACpE,MAAM;IAAEC,uBAAuB;IAAEC;EAAwB,CAAC,GACzD,IAAAC,wCAAmB,EAAC,CAAC;EAEtB,MAAMC,gBAAgB,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAC/C,SAAS;;IAET,IAAI,CAACL,EAAE,IAAI,CAACC,uBAAuB,EAAE;MACpC,OAAO,CAAC,CAAC;IACV;IAEA,OACCA,uBAAuB,CAACC,uBAAuB,CAACI,KAAK,CAAC,CAACN,EAAE,CAAC,IAAI;MAC7DO,OAAO,EAAE,CAAC,CAAE;IACb,CAAC;EAEH,CAAC,CAAC;EAEF,OAAO;IAAEH;EAAiB,CAAC;AAC5B,CAAC;AAACI,OAAA,CAAAT,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports._useScreenAnimation = _useScreenAnimation;
7
+ exports.useScreenAnimation = useScreenAnimation;
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = require("react-native-reanimated");
10
+ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
11
+ var _keys = require("../../providers/keys");
12
+ var _animations = require("../../stores/animations");
13
+ var _bounds = require("../../stores/bounds");
14
+ var _gestures = require("../../stores/gestures");
15
+ var _bounds2 = require("../../utils/bounds");
16
+ const FALLBACK = Object.freeze({
17
+ progress: 0,
18
+ closing: 0,
19
+ animating: 0,
20
+ gesture: {
21
+ x: 0,
22
+ y: 0,
23
+ normalizedX: 0,
24
+ normalizedY: 0,
25
+ isDismissing: 0,
26
+ isDragging: 0
27
+ },
28
+ bounds: {},
29
+ route: {}
30
+ });
31
+ const useBuildScreenTransitionState = descriptor => {
32
+ const key = descriptor?.route.key;
33
+ if (!key) return undefined;
34
+ const progress = _animations.Animations.getAnimation(key, "progress");
35
+ const closing = _animations.Animations.getAnimation(key, "closing");
36
+ const animating = _animations.Animations.getAnimation(key, "animating");
37
+ const gesture = _gestures.Gestures.getRouteGestures(key);
38
+ const route = descriptor?.route;
39
+ return {
40
+ progress,
41
+ closing,
42
+ animating,
43
+ gesture,
44
+ route
45
+ };
46
+ };
47
+ const unwrap = (s, key) => {
48
+ "worklet";
49
+
50
+ return s && key ? {
51
+ progress: s.progress.value ?? 0,
52
+ closing: s.closing.value ?? 0,
53
+ animating: s.animating.value ?? 0,
54
+ gesture: {
55
+ x: s.gesture.x.value ?? 0,
56
+ y: s.gesture.y.value ?? 0,
57
+ normalizedX: s.gesture.normalizedX.value ?? 0,
58
+ normalizedY: s.gesture.normalizedY.value ?? 0,
59
+ isDismissing: s.gesture.isDismissing.value ?? 0,
60
+ isDragging: s.gesture.isDragging.value ?? 0
61
+ },
62
+ bounds: _bounds.Bounds.getBounds(key) ?? {},
63
+ route: s.route
64
+ } : undefined;
65
+ };
66
+ function _useScreenAnimation() {
67
+ const {
68
+ current: currentDescriptor,
69
+ next: nextDescriptor,
70
+ previous: previousDescriptor
71
+ } = (0, _keys.useKeys)();
72
+ const dimensions = (0, _reactNative.useWindowDimensions)();
73
+ const currentAnimation = useBuildScreenTransitionState(currentDescriptor);
74
+ const nextAnimation = useBuildScreenTransitionState(nextDescriptor);
75
+ const prevAnimation = useBuildScreenTransitionState(previousDescriptor);
76
+ const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
77
+ const screenInterpolatorProps = (0, _reactNativeReanimated.useDerivedValue)(() => {
78
+ "worklet";
79
+
80
+ const previous = unwrap(prevAnimation, previousDescriptor?.route.key);
81
+ const next = unwrap(nextAnimation, nextDescriptor?.route.key);
82
+ const current = unwrap(currentAnimation, currentDescriptor?.route.key) ?? FALLBACK;
83
+ const progress = current.progress + (next?.progress ?? 0);
84
+ const focused = !next;
85
+ const activeBoundId = _bounds.Bounds.getActiveBoundId() || "";
86
+ const bounds = (0, _bounds2.buildBoundsAccessor)({
87
+ activeBoundId,
88
+ current,
89
+ previous,
90
+ next,
91
+ progress,
92
+ dimensions
93
+ });
94
+ return {
95
+ layouts: {
96
+ screen: dimensions
97
+ },
98
+ insets,
99
+ previous,
100
+ current,
101
+ next,
102
+ focused,
103
+ activeBoundId,
104
+ progress,
105
+ bounds
106
+ };
107
+ });
108
+ const screenStyleInterpolator = nextDescriptor?.options.screenStyleInterpolator || currentDescriptor?.options.screenStyleInterpolator;
109
+ return {
110
+ screenInterpolatorProps,
111
+ screenStyleInterpolator
112
+ };
113
+ }
114
+ function useScreenAnimation() {
115
+ const {
116
+ screenInterpolatorProps
117
+ } = _useScreenAnimation();
118
+ return (0, _reactNativeReanimated.useDerivedValue)(() => screenInterpolatorProps.value);
119
+ }
120
+ //# sourceMappingURL=use-screen-animation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNativeReanimated","_reactNativeSafeAreaContext","_keys","_animations","_bounds","_gestures","_bounds2","FALLBACK","Object","freeze","progress","closing","animating","gesture","x","y","normalizedX","normalizedY","isDismissing","isDragging","bounds","route","useBuildScreenTransitionState","descriptor","key","undefined","Animations","getAnimation","Gestures","getRouteGestures","unwrap","s","value","Bounds","getBounds","_useScreenAnimation","current","currentDescriptor","next","nextDescriptor","previous","previousDescriptor","useKeys","dimensions","useWindowDimensions","currentAnimation","nextAnimation","prevAnimation","insets","useSafeAreaInsets","screenInterpolatorProps","useDerivedValue","focused","activeBoundId","getActiveBoundId","buildBoundsAccessor","layouts","screen","screenStyleInterpolator","options","useScreenAnimation"],"sourceRoot":"../../../../src","sources":["hooks/animation/use-screen-animation.tsx"],"mappings":";;;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAOA,IAAAO,QAAA,GAAAP,OAAA;AAUA,MAAMQ,QAAQ,GAAGC,MAAM,CAACC,MAAM,CAAC;EAC9BC,QAAQ,EAAE,CAAC;EACXC,OAAO,EAAE,CAAC;EACVC,SAAS,EAAE,CAAC;EACZC,OAAO,EAAE;IACRC,CAAC,EAAE,CAAC;IACJC,CAAC,EAAE,CAAC;IACJC,WAAW,EAAE,CAAC;IACdC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,CAAC;IACfC,UAAU,EAAE;EACb,CAAC;EACDC,MAAM,EAAE,CAAC,CAA+B;EACxCC,KAAK,EAAE,CAAC;AACT,CAAC,CAAC;AAEF,MAAMC,6BAA6B,GAClCC,UAA6C,IACjB;EAC5B,MAAMC,GAAG,GAAGD,UAAU,EAAEF,KAAK,CAACG,GAAG;EACjC,IAAI,CAACA,GAAG,EAAE,OAAOC,SAAS;EAC1B,MAAMf,QAAQ,GAAGgB,sBAAU,CAACC,YAAY,CAACH,GAAG,EAAE,UAAU,CAAC;EACzD,MAAMb,OAAO,GAAGe,sBAAU,CAACC,YAAY,CAACH,GAAG,EAAE,SAAS,CAAC;EACvD,MAAMZ,SAAS,GAAGc,sBAAU,CAACC,YAAY,CAACH,GAAG,EAAE,WAAW,CAAC;EAC3D,MAAMX,OAAO,GAAGe,kBAAQ,CAACC,gBAAgB,CAACL,GAAG,CAAC;EAC9C,MAAMH,KAAK,GAAGE,UAAU,EAAEF,KAAK;EAE/B,OAAO;IAAEX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EAAEsB,OAAO,CAACD,uBAAuB;EAEnD,OAAO;IAAER,uBAAuB;IAAEQ;EAAwB,CAAC;AAC5D;AACO,SAASE,kBAAkBA,CAAA,EAAG;EACpC,MAAM;IAAEV;EAAwB,CAAC,GAAGf,mBAAmB,CAAC,CAAC;EAEzD,OAAO,IAAAgB,sCAAe,EAAC,MAAMD,uBAAuB,CAAClB,KAAK,CAAC;AAC5D","ignoreList":[]}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useBoundMeasurer = void 0;
7
+ var _react = require("react");
8
+ var _reactNativeReanimated = require("react-native-reanimated");
9
+ var _keys = require("../../providers/keys");
10
+ var _bounds = require("../../stores/bounds");
11
+ var _flattenStyles = require("../../utils/bounds/flatten-styles");
12
+ var _useScreenAnimation = require("../animation/use-screen-animation");
13
+ const useBoundMeasurer = ({
14
+ sharedBoundTag,
15
+ animatedRef,
16
+ current,
17
+ style
18
+ }) => {
19
+ const {
20
+ previous
21
+ } = (0, _keys.useKeys)();
22
+ const interpolatorProps = (0, _useScreenAnimation.useScreenAnimation)();
23
+ const hasAlreadyMeasured = (0, _reactNativeReanimated.useSharedValue)(false);
24
+ const measureAndSet = (0, _react.useCallback)(() => {
25
+ "worklet";
26
+
27
+ if (!sharedBoundTag) return;
28
+ const measured = (0, _reactNativeReanimated.measure)(animatedRef);
29
+ if (measured) {
30
+ _bounds.Bounds.setBounds(current.route.key, sharedBoundTag, measured, (0, _flattenStyles.flattenStyle)(style));
31
+ }
32
+ }, [sharedBoundTag, animatedRef, current.route.key, style]);
33
+ const measureOnLayout = (0, _react.useCallback)(() => {
34
+ "worklet";
35
+
36
+ if (!sharedBoundTag || hasAlreadyMeasured.value) return;
37
+ const previousRouteKey = previous?.route.key;
38
+ if (!previousRouteKey) return;
39
+ const previousBounds = _bounds.Bounds.getBounds(previousRouteKey);
40
+ const hasPreviousBoundForTag = previousBounds[sharedBoundTag];
41
+ if (interpolatorProps.value.current.animating && hasPreviousBoundForTag) {
42
+ measureAndSet();
43
+ hasAlreadyMeasured.value = true;
44
+ }
45
+ }, [measureAndSet, interpolatorProps, sharedBoundTag, previous?.route.key, hasAlreadyMeasured]);
46
+ return {
47
+ measureAndSet,
48
+ measureOnLayout
49
+ };
50
+ };
51
+ exports.useBoundMeasurer = useBoundMeasurer;
52
+ //# sourceMappingURL=use-bound-measurer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNativeReanimated","_keys","_bounds","_flattenStyles","_useScreenAnimation","useBoundMeasurer","sharedBoundTag","animatedRef","current","style","previous","useKeys","interpolatorProps","useScreenAnimation","hasAlreadyMeasured","useSharedValue","measureAndSet","useCallback","measured","measure","Bounds","setBounds","route","key","flattenStyle","measureOnLayout","value","previousRouteKey","previousBounds","getBounds","hasPreviousBoundForTag","animating","exports"],"sourceRoot":"../../../../src","sources":["hooks/bounds/use-bound-measurer.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AAMA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AASO,MAAMM,gBAAgB,GAAGA,CAAC;EAChCC,cAAc;EACdC,WAAW;EACXC,OAAO;EACPC;AACuB,CAAC,KAAK;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAG,IAAAC,aAAO,EAAC,CAAC;EAC9B,MAAMC,iBAAiB,GAAG,IAAAC,sCAAkB,EAAC,CAAC;EAC9C,MAAMC,kBAAkB,GAAG,IAAAC,qCAAc,EAAC,KAAK,CAAC;EAEhD,MAAMC,aAAa,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACvC,SAAS;;IACT,IAAI,CAACX,cAAc,EAAE;IACrB,MAAMY,QAAQ,GAAG,IAAAC,8BAAO,EAACZ,WAAW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