react-native-screen-transitions 3.0.0-beta.9 → 3.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/README.md +60 -5
  2. package/lib/commonjs/blank-stack/components/Overlay.js +7 -4
  3. package/lib/commonjs/blank-stack/components/Overlay.js.map +1 -1
  4. package/lib/commonjs/blank-stack/components/Screens.js +2 -2
  5. package/lib/commonjs/blank-stack/components/Screens.js.map +1 -1
  6. package/lib/commonjs/blank-stack/components/StackView.js +9 -5
  7. package/lib/commonjs/blank-stack/components/StackView.js.map +1 -1
  8. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +4 -4
  9. package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  10. package/lib/commonjs/blank-stack/index.js +1 -1
  11. package/lib/commonjs/blank-stack/index.js.map +1 -1
  12. package/lib/commonjs/native-stack/views/NativeStackView.native.js +4 -3
  13. package/lib/commonjs/native-stack/views/NativeStackView.native.js.map +1 -1
  14. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js +9 -9
  15. package/lib/commonjs/shared/components/controllers/screen-lifecycle.js.map +1 -1
  16. package/lib/commonjs/shared/components/create-transition-aware-component.js +11 -14
  17. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  18. package/lib/commonjs/shared/components/root-transition-aware.js +1 -1
  19. package/lib/commonjs/shared/components/root-transition-aware.js.map +1 -1
  20. package/lib/commonjs/shared/configs/presets.js +20 -9
  21. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  22. package/lib/commonjs/shared/constants.js +0 -1
  23. package/lib/commonjs/shared/constants.js.map +1 -1
  24. package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -10
  25. package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
  26. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +10 -25
  27. package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
  28. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js +11 -11
  29. package/lib/commonjs/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  30. package/lib/commonjs/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  31. package/lib/commonjs/shared/hooks/gestures/use-scroll-registry.js +1 -1
  32. package/lib/commonjs/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  33. package/lib/commonjs/shared/hooks/use-stable-callback-value.js.map +1 -1
  34. package/lib/commonjs/shared/hooks/use-stable-callback.js.map +1 -1
  35. package/lib/commonjs/shared/providers/{gestures.js → gestures.provider.js} +1 -1
  36. package/lib/commonjs/shared/providers/gestures.provider.js.map +1 -0
  37. package/lib/commonjs/shared/providers/{keys.js → keys.provider.js} +1 -1
  38. package/lib/commonjs/shared/providers/keys.provider.js.map +1 -0
  39. package/lib/commonjs/shared/providers/register-bounds.provider.js +211 -0
  40. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -0
  41. package/lib/commonjs/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  42. package/lib/commonjs/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  43. package/lib/commonjs/shared/providers/{transition-styles.js → transition-styles.provider.js} +9 -9
  44. package/lib/commonjs/shared/providers/transition-styles.provider.js.map +1 -0
  45. package/lib/commonjs/shared/stores/{animation-store.js → animation.store.js} +1 -1
  46. package/lib/commonjs/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
  47. package/lib/commonjs/shared/stores/bounds.store.js +141 -0
  48. package/lib/commonjs/shared/stores/bounds.store.js.map +1 -0
  49. package/lib/commonjs/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
  50. package/lib/commonjs/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
  51. package/lib/commonjs/shared/types/{core.js → animation.types.js} +1 -1
  52. package/lib/commonjs/shared/types/animation.types.js.map +1 -0
  53. package/lib/commonjs/shared/types/{bounds.js → bounds.types.js} +1 -1
  54. package/lib/commonjs/shared/types/bounds.types.js.map +1 -0
  55. package/lib/commonjs/shared/types/{animation.js → core.types.js} +1 -1
  56. package/lib/commonjs/shared/types/{animation.js.map → core.types.js.map} +1 -1
  57. package/lib/commonjs/shared/types/{gesture.js → gesture.types.js} +1 -1
  58. package/lib/commonjs/shared/types/gesture.types.js.map +1 -0
  59. package/lib/commonjs/shared/types/utils.types.js +2 -0
  60. package/lib/commonjs/shared/types/{core.js.map → utils.types.js.map} +1 -1
  61. package/lib/commonjs/shared/utils/animation/derivations.js +1 -7
  62. package/lib/commonjs/shared/utils/animation/derivations.js.map +1 -1
  63. package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -0
  64. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js +19 -0
  65. package/lib/commonjs/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  66. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  67. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +1 -0
  68. package/lib/commonjs/shared/utils/bounds/index.js +45 -35
  69. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  70. package/lib/commonjs/shared/utils/bounds/types/builder.js.map +1 -0
  71. package/lib/commonjs/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  72. package/lib/commonjs/shared/utils/create-provider.js.map +1 -0
  73. package/lib/commonjs/shared/utils/gesture/apply-offset-rules.js +1 -1
  74. package/lib/commonjs/shared/utils/gesture/check-gesture-activation.js +1 -1
  75. package/lib/commonjs/shared/utils/reset-stores-for-screen.js +17 -0
  76. package/lib/commonjs/shared/utils/reset-stores-for-screen.js.map +1 -0
  77. package/lib/module/blank-stack/components/Overlay.js +7 -4
  78. package/lib/module/blank-stack/components/Overlay.js.map +1 -1
  79. package/lib/module/blank-stack/components/Screens.js +1 -1
  80. package/lib/module/blank-stack/components/StackView.js +8 -4
  81. package/lib/module/blank-stack/components/StackView.js.map +1 -1
  82. package/lib/module/blank-stack/hooks/use-overlay-animation.js +3 -3
  83. package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
  84. package/lib/module/blank-stack/index.js +1 -1
  85. package/lib/module/blank-stack/index.js.map +1 -1
  86. package/lib/module/native-stack/views/NativeStackView.native.js +3 -2
  87. package/lib/module/native-stack/views/NativeStackView.native.js.map +1 -1
  88. package/lib/module/shared/components/controllers/screen-lifecycle.js +8 -8
  89. package/lib/module/shared/components/controllers/screen-lifecycle.js.map +1 -1
  90. package/lib/module/shared/components/create-transition-aware-component.js +11 -14
  91. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  92. package/lib/module/shared/components/root-transition-aware.js +1 -1
  93. package/lib/module/shared/components/root-transition-aware.js.map +1 -1
  94. package/lib/module/shared/configs/presets.js +20 -9
  95. package/lib/module/shared/configs/presets.js.map +1 -1
  96. package/lib/module/shared/constants.js +0 -1
  97. package/lib/module/shared/constants.js.map +1 -1
  98. package/lib/module/shared/hooks/animation/use-associated-style.js +9 -10
  99. package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
  100. package/lib/module/shared/hooks/animation/use-screen-animation.js +7 -22
  101. package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
  102. package/lib/module/shared/hooks/gestures/use-build-gestures.js +4 -4
  103. package/lib/module/shared/hooks/gestures/use-build-gestures.js.map +1 -1
  104. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js +1 -1
  105. package/lib/module/shared/hooks/gestures/use-parent-gesture-registry.js.map +1 -1
  106. package/lib/module/shared/hooks/gestures/use-scroll-registry.js +1 -1
  107. package/lib/module/shared/hooks/gestures/use-scroll-registry.js.map +1 -1
  108. package/lib/module/shared/hooks/reanimated/use-shared-value-state.js.map +1 -0
  109. package/lib/module/shared/hooks/use-stable-callback-value.js.map +1 -1
  110. package/lib/module/shared/hooks/use-stable-callback.js.map +1 -1
  111. package/lib/module/shared/providers/{gestures.js → gestures.provider.js} +1 -1
  112. package/lib/module/shared/providers/gestures.provider.js.map +1 -0
  113. package/lib/module/shared/providers/{keys.js → keys.provider.js} +1 -1
  114. package/lib/module/shared/providers/keys.provider.js.map +1 -0
  115. package/lib/module/shared/providers/register-bounds.provider.js +206 -0
  116. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -0
  117. package/lib/module/shared/providers/{screen-transition-provider.js → screen-transition.provider.js} +4 -4
  118. package/lib/module/shared/providers/{screen-transition-provider.js.map → screen-transition.provider.js.map} +1 -1
  119. package/lib/module/shared/providers/{transition-styles.js → transition-styles.provider.js} +8 -9
  120. package/lib/module/shared/providers/transition-styles.provider.js.map +1 -0
  121. package/lib/module/shared/stores/{animation-store.js → animation.store.js} +1 -1
  122. package/lib/module/shared/stores/{animation-store.js.map → animation.store.js.map} +1 -1
  123. package/lib/module/shared/stores/bounds.store.js +137 -0
  124. package/lib/module/shared/stores/bounds.store.js.map +1 -0
  125. package/lib/module/shared/stores/{gesture-store.js → gesture.store.js} +1 -1
  126. package/lib/module/shared/stores/{gesture-store.js.map → gesture.store.js.map} +1 -1
  127. package/lib/module/shared/types/animation.types.js +4 -0
  128. package/lib/module/shared/types/animation.types.js.map +1 -0
  129. package/lib/module/shared/types/bounds.types.js +4 -0
  130. package/lib/module/shared/types/bounds.types.js.map +1 -0
  131. package/lib/module/shared/types/core.types.js +4 -0
  132. package/lib/{commonjs/shared/types/bounds.js.map → module/shared/types/core.types.js.map} +1 -1
  133. package/lib/module/shared/types/{gesture.js → gesture.types.js} +1 -1
  134. package/lib/module/shared/types/gesture.types.js.map +1 -0
  135. package/lib/module/shared/types/utils.types.js +2 -0
  136. package/lib/{commonjs/shared/types/utils.js.map → module/shared/types/utils.types.js.map} +1 -1
  137. package/lib/module/shared/utils/animation/derivations.js +1 -7
  138. package/lib/module/shared/utils/animation/derivations.js.map +1 -1
  139. package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -0
  140. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js +14 -0
  141. package/lib/module/shared/utils/bounds/helpers/is-bounds-equal.js.map +1 -0
  142. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -0
  143. package/lib/module/shared/utils/bounds/helpers/styles.js.map +1 -0
  144. package/lib/module/shared/utils/bounds/index.js +45 -35
  145. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  146. package/lib/module/shared/utils/bounds/types/builder.js.map +1 -0
  147. package/lib/module/shared/utils/bounds/{_types/builder.js.map → types/geometry.js.map} +1 -1
  148. package/lib/module/shared/utils/create-provider.js.map +1 -0
  149. package/lib/module/shared/utils/gesture/apply-offset-rules.js +1 -1
  150. package/lib/module/shared/utils/gesture/apply-offset-rules.js.map +1 -1
  151. package/lib/module/shared/utils/gesture/check-gesture-activation.js +1 -1
  152. package/lib/module/shared/utils/gesture/check-gesture-activation.js.map +1 -1
  153. package/lib/module/shared/utils/reset-stores-for-screen.js +13 -0
  154. package/lib/module/shared/utils/reset-stores-for-screen.js.map +1 -0
  155. package/lib/typescript/blank-stack/components/Overlay.d.ts.map +1 -1
  156. package/lib/typescript/blank-stack/components/StackView.d.ts.map +1 -1
  157. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts +1 -1
  158. package/lib/typescript/blank-stack/hooks/use-overlay-animation.d.ts.map +1 -1
  159. package/lib/typescript/blank-stack/index.d.ts +1 -1
  160. package/lib/typescript/blank-stack/index.d.ts.map +1 -1
  161. package/lib/typescript/blank-stack/types.d.ts +2 -2
  162. package/lib/typescript/blank-stack/types.d.ts.map +1 -1
  163. package/lib/typescript/native-stack/types.d.ts +1 -1
  164. package/lib/typescript/native-stack/types.d.ts.map +1 -1
  165. package/lib/typescript/native-stack/views/NativeStackView.native.d.ts.map +1 -1
  166. package/lib/typescript/shared/components/controllers/screen-lifecycle.d.ts.map +1 -1
  167. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  168. package/lib/typescript/shared/configs/index.d.ts +9 -3
  169. package/lib/typescript/shared/configs/index.d.ts.map +1 -1
  170. package/lib/typescript/shared/configs/presets.d.ts +10 -4
  171. package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
  172. package/lib/typescript/shared/constants.d.ts +6 -6
  173. package/lib/typescript/shared/constants.d.ts.map +1 -1
  174. package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
  175. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts +2 -2
  176. package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
  177. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts +2 -2
  178. package/lib/typescript/shared/hooks/gestures/use-build-gestures.d.ts.map +1 -1
  179. package/lib/typescript/shared/hooks/reanimated/use-shared-value-state.d.ts.map +1 -0
  180. package/lib/typescript/shared/hooks/use-stable-callback-value.d.ts.map +1 -1
  181. package/lib/typescript/shared/hooks/use-stable-callback.d.ts.map +1 -1
  182. package/lib/typescript/shared/index.d.ts +25 -19
  183. package/lib/typescript/shared/index.d.ts.map +1 -1
  184. package/lib/typescript/shared/providers/{gestures.d.ts → gestures.provider.d.ts} +2 -2
  185. package/lib/typescript/shared/providers/gestures.provider.d.ts.map +1 -0
  186. package/lib/typescript/shared/providers/{keys.d.ts → keys.provider.d.ts} +2 -2
  187. package/lib/typescript/shared/providers/keys.provider.d.ts.map +1 -0
  188. package/lib/typescript/shared/providers/register-bounds.provider.d.ts +17 -0
  189. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -0
  190. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts → screen-transition.provider.d.ts} +2 -2
  191. package/lib/typescript/shared/providers/{screen-transition-provider.d.ts.map → screen-transition.provider.d.ts.map} +1 -1
  192. package/lib/typescript/shared/providers/transition-styles.provider.d.ts +14 -0
  193. package/lib/typescript/shared/providers/transition-styles.provider.d.ts.map +1 -0
  194. package/lib/typescript/shared/stores/{animation-store.d.ts → animation.store.d.ts} +2 -2
  195. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -0
  196. package/lib/typescript/shared/stores/bounds.store.d.ts +29 -0
  197. package/lib/typescript/shared/stores/bounds.store.d.ts.map +1 -0
  198. package/lib/typescript/shared/stores/{gesture-store.d.ts → gesture.store.d.ts} +3 -3
  199. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -0
  200. package/lib/typescript/shared/types/{animation.d.ts → animation.types.d.ts} +48 -20
  201. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -0
  202. package/lib/typescript/shared/types/{bounds.d.ts → bounds.types.d.ts} +4 -4
  203. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -0
  204. package/lib/typescript/shared/types/{core.d.ts → core.types.d.ts} +3 -3
  205. package/lib/typescript/shared/types/core.types.d.ts.map +1 -0
  206. package/lib/typescript/shared/types/{gesture.d.ts → gesture.types.d.ts} +1 -1
  207. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -0
  208. package/lib/typescript/shared/types/{utils.d.ts → utils.types.d.ts} +1 -1
  209. package/lib/typescript/shared/types/utils.types.d.ts.map +1 -0
  210. package/lib/typescript/shared/utils/animation/derivations.d.ts +2 -4
  211. package/lib/typescript/shared/utils/animation/derivations.d.ts.map +1 -1
  212. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts +2 -2
  213. package/lib/typescript/shared/utils/animation/start-screen-transition.d.ts.map +1 -1
  214. package/lib/typescript/shared/utils/bounds/constants.d.ts +3 -3
  215. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -1
  216. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/geometry.d.ts +3 -3
  217. package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -0
  218. package/lib/typescript/shared/utils/bounds/helpers/is-bounds-equal.d.ts.map +1 -0
  219. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/style-composers.d.ts +2 -2
  220. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -0
  221. package/lib/typescript/shared/utils/bounds/{_utils → helpers}/styles.d.ts +1 -1
  222. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +1 -0
  223. package/lib/typescript/shared/utils/bounds/index.d.ts +3 -4
  224. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  225. package/lib/typescript/shared/utils/bounds/{_types → types}/builder.d.ts +13 -34
  226. package/lib/typescript/shared/utils/bounds/types/builder.d.ts.map +1 -0
  227. package/lib/typescript/shared/utils/bounds/types/geometry.d.ts.map +1 -0
  228. package/lib/typescript/shared/{providers/utils → utils}/create-provider.d.ts +2 -2
  229. package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -0
  230. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts +2 -2
  231. package/lib/typescript/shared/utils/gesture/apply-offset-rules.d.ts.map +1 -1
  232. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts +2 -2
  233. package/lib/typescript/shared/utils/gesture/check-gesture-activation.d.ts.map +1 -1
  234. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts +2 -2
  235. package/lib/typescript/shared/utils/gesture/reset-gesture-values.d.ts.map +1 -1
  236. package/lib/typescript/shared/utils/gesture/velocity.d.ts +1 -1
  237. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts +6 -0
  238. package/lib/typescript/shared/utils/reset-stores-for-screen.d.ts.map +1 -0
  239. package/package.json +1 -1
  240. package/src/blank-stack/components/Overlay.tsx +5 -2
  241. package/src/blank-stack/components/Screens.tsx +1 -1
  242. package/src/blank-stack/components/StackView.tsx +7 -2
  243. package/src/blank-stack/hooks/use-overlay-animation.tsx +4 -4
  244. package/src/blank-stack/index.ts +1 -1
  245. package/src/blank-stack/types.ts +2 -2
  246. package/src/native-stack/types.ts +1 -1
  247. package/src/native-stack/views/NativeStackView.native.tsx +4 -2
  248. package/src/shared/components/controllers/screen-lifecycle.tsx +12 -10
  249. package/src/shared/components/create-transition-aware-component.tsx +23 -27
  250. package/src/shared/components/root-transition-aware.tsx +1 -1
  251. package/src/shared/configs/presets.ts +31 -17
  252. package/src/shared/constants.ts +6 -7
  253. package/src/shared/hooks/animation/use-associated-style.tsx +12 -9
  254. package/src/shared/hooks/animation/use-screen-animation.tsx +8 -26
  255. package/src/shared/hooks/gestures/use-build-gestures.tsx +5 -5
  256. package/src/shared/hooks/gestures/use-parent-gesture-registry.tsx +1 -1
  257. package/src/shared/hooks/gestures/use-scroll-registry.tsx +2 -2
  258. package/src/shared/index.ts +2 -2
  259. package/src/shared/providers/{gestures.tsx → gestures.provider.tsx} +1 -1
  260. package/src/shared/providers/{keys.tsx → keys.provider.tsx} +1 -1
  261. package/src/shared/providers/register-bounds.provider.tsx +290 -0
  262. package/src/shared/providers/{screen-transition-provider.tsx → screen-transition.provider.tsx} +3 -3
  263. package/src/shared/providers/{transition-styles.tsx → transition-styles.provider.tsx} +18 -16
  264. package/src/shared/stores/{animation-store.ts → animation.store.ts} +1 -1
  265. package/src/shared/stores/bounds.store.ts +166 -0
  266. package/src/shared/stores/{gesture-store.ts → gesture.store.ts} +2 -2
  267. package/src/shared/types/{animation.ts → animation.types.ts} +60 -19
  268. package/src/shared/types/{bounds.ts → bounds.types.ts} +3 -3
  269. package/src/shared/types/{core.ts → core.types.ts} +10 -2
  270. package/src/shared/utils/animation/derivations.ts +2 -8
  271. package/src/shared/utils/animation/start-screen-transition.ts +2 -2
  272. package/src/shared/utils/bounds/constants.ts +3 -3
  273. package/src/shared/utils/bounds/{_utils → helpers}/geometry.ts +3 -3
  274. package/src/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.ts +3 -3
  275. package/src/shared/utils/bounds/{_utils → helpers}/style-composers.ts +2 -2
  276. package/src/shared/utils/bounds/{_utils → helpers}/styles.ts +1 -1
  277. package/src/shared/utils/bounds/index.ts +53 -55
  278. package/src/shared/utils/bounds/{_types → types}/builder.ts +19 -37
  279. package/src/shared/{providers/utils → utils}/create-provider.tsx +3 -9
  280. package/src/shared/utils/gesture/apply-offset-rules.ts +2 -2
  281. package/src/shared/utils/gesture/check-gesture-activation.ts +2 -2
  282. package/src/shared/utils/gesture/reset-gesture-values.ts +2 -2
  283. package/src/shared/utils/gesture/velocity.ts +1 -1
  284. package/src/shared/utils/reset-stores-for-screen.ts +11 -0
  285. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js +0 -152
  286. package/lib/commonjs/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  287. package/lib/commonjs/shared/hooks/use-derived-value-state.js +0 -33
  288. package/lib/commonjs/shared/hooks/use-derived-value-state.js.map +0 -1
  289. package/lib/commonjs/shared/hooks/use-shared-value-state.js.map +0 -1
  290. package/lib/commonjs/shared/providers/gestures.js.map +0 -1
  291. package/lib/commonjs/shared/providers/keys.js.map +0 -1
  292. package/lib/commonjs/shared/providers/transition-styles.js.map +0 -1
  293. package/lib/commonjs/shared/providers/utils/create-provider.js.map +0 -1
  294. package/lib/commonjs/shared/stores/bound-store/_utils.js +0 -118
  295. package/lib/commonjs/shared/stores/bound-store/_utils.js.map +0 -1
  296. package/lib/commonjs/shared/stores/bound-store/index.js +0 -127
  297. package/lib/commonjs/shared/stores/bound-store/index.js.map +0 -1
  298. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js +0 -19
  299. package/lib/commonjs/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  300. package/lib/commonjs/shared/types/gesture.js.map +0 -1
  301. package/lib/commonjs/shared/types/utils.js +0 -2
  302. package/lib/commonjs/shared/utils/bounds/_types/geometry.js.map +0 -1
  303. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js +0 -6
  304. package/lib/commonjs/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  305. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js +0 -27
  306. package/lib/commonjs/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  307. package/lib/commonjs/shared/utils/bounds/_utils/geometry.js.map +0 -1
  308. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js +0 -49
  309. package/lib/commonjs/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  310. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js +0 -19
  311. package/lib/commonjs/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  312. package/lib/commonjs/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  313. package/lib/commonjs/shared/utils/bounds/_utils/styles.js.map +0 -1
  314. package/lib/module/shared/hooks/bounds/use-bound-registry.js +0 -146
  315. package/lib/module/shared/hooks/bounds/use-bound-registry.js.map +0 -1
  316. package/lib/module/shared/hooks/use-derived-value-state.js +0 -30
  317. package/lib/module/shared/hooks/use-derived-value-state.js.map +0 -1
  318. package/lib/module/shared/hooks/use-shared-value-state.js.map +0 -1
  319. package/lib/module/shared/providers/gestures.js.map +0 -1
  320. package/lib/module/shared/providers/keys.js.map +0 -1
  321. package/lib/module/shared/providers/transition-styles.js.map +0 -1
  322. package/lib/module/shared/providers/utils/create-provider.js.map +0 -1
  323. package/lib/module/shared/stores/bound-store/_utils.js +0 -113
  324. package/lib/module/shared/stores/bound-store/_utils.js.map +0 -1
  325. package/lib/module/shared/stores/bound-store/index.js +0 -123
  326. package/lib/module/shared/stores/bound-store/index.js.map +0 -1
  327. package/lib/module/shared/stores/utils/reset-stores-for-screen.js +0 -15
  328. package/lib/module/shared/stores/utils/reset-stores-for-screen.js.map +0 -1
  329. package/lib/module/shared/types/animation.js +0 -4
  330. package/lib/module/shared/types/animation.js.map +0 -1
  331. package/lib/module/shared/types/bounds.js +0 -4
  332. package/lib/module/shared/types/bounds.js.map +0 -1
  333. package/lib/module/shared/types/core.js +0 -4
  334. package/lib/module/shared/types/core.js.map +0 -1
  335. package/lib/module/shared/types/gesture.js.map +0 -1
  336. package/lib/module/shared/types/utils.js +0 -2
  337. package/lib/module/shared/types/utils.js.map +0 -1
  338. package/lib/module/shared/utils/bounds/_types/geometry.js.map +0 -1
  339. package/lib/module/shared/utils/bounds/_types/get-bounds.js +0 -4
  340. package/lib/module/shared/utils/bounds/_types/get-bounds.js.map +0 -1
  341. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js +0 -23
  342. package/lib/module/shared/utils/bounds/_utils/flatten-styles.js.map +0 -1
  343. package/lib/module/shared/utils/bounds/_utils/geometry.js.map +0 -1
  344. package/lib/module/shared/utils/bounds/_utils/get-bounds.js +0 -44
  345. package/lib/module/shared/utils/bounds/_utils/get-bounds.js.map +0 -1
  346. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js +0 -14
  347. package/lib/module/shared/utils/bounds/_utils/is-bounds-equal.js.map +0 -1
  348. package/lib/module/shared/utils/bounds/_utils/style-composers.js.map +0 -1
  349. package/lib/module/shared/utils/bounds/_utils/styles.js.map +0 -1
  350. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts +0 -17
  351. package/lib/typescript/shared/hooks/bounds/use-bound-registry.d.ts.map +0 -1
  352. package/lib/typescript/shared/hooks/use-derived-value-state.d.ts +0 -9
  353. package/lib/typescript/shared/hooks/use-derived-value-state.d.ts.map +0 -1
  354. package/lib/typescript/shared/hooks/use-shared-value-state.d.ts.map +0 -1
  355. package/lib/typescript/shared/providers/gestures.d.ts.map +0 -1
  356. package/lib/typescript/shared/providers/keys.d.ts.map +0 -1
  357. package/lib/typescript/shared/providers/transition-styles.d.ts +0 -11
  358. package/lib/typescript/shared/providers/transition-styles.d.ts.map +0 -1
  359. package/lib/typescript/shared/providers/utils/create-provider.d.ts.map +0 -1
  360. package/lib/typescript/shared/stores/animation-store.d.ts.map +0 -1
  361. package/lib/typescript/shared/stores/bound-store/_utils.d.ts +0 -24
  362. package/lib/typescript/shared/stores/bound-store/_utils.d.ts.map +0 -1
  363. package/lib/typescript/shared/stores/bound-store/index.d.ts +0 -24
  364. package/lib/typescript/shared/stores/bound-store/index.d.ts.map +0 -1
  365. package/lib/typescript/shared/stores/gesture-store.d.ts.map +0 -1
  366. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts +0 -6
  367. package/lib/typescript/shared/stores/utils/reset-stores-for-screen.d.ts.map +0 -1
  368. package/lib/typescript/shared/types/animation.d.ts.map +0 -1
  369. package/lib/typescript/shared/types/bounds.d.ts.map +0 -1
  370. package/lib/typescript/shared/types/core.d.ts.map +0 -1
  371. package/lib/typescript/shared/types/gesture.d.ts.map +0 -1
  372. package/lib/typescript/shared/types/utils.d.ts.map +0 -1
  373. package/lib/typescript/shared/utils/bounds/_types/builder.d.ts.map +0 -1
  374. package/lib/typescript/shared/utils/bounds/_types/geometry.d.ts.map +0 -1
  375. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts +0 -10
  376. package/lib/typescript/shared/utils/bounds/_types/get-bounds.d.ts.map +0 -1
  377. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts +0 -2
  378. package/lib/typescript/shared/utils/bounds/_utils/flatten-styles.d.ts.map +0 -1
  379. package/lib/typescript/shared/utils/bounds/_utils/geometry.d.ts.map +0 -1
  380. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts +0 -4
  381. package/lib/typescript/shared/utils/bounds/_utils/get-bounds.d.ts.map +0 -1
  382. package/lib/typescript/shared/utils/bounds/_utils/is-bounds-equal.d.ts.map +0 -1
  383. package/lib/typescript/shared/utils/bounds/_utils/style-composers.d.ts.map +0 -1
  384. package/lib/typescript/shared/utils/bounds/_utils/styles.d.ts.map +0 -1
  385. package/src/shared/hooks/bounds/use-bound-registry.tsx +0 -184
  386. package/src/shared/hooks/use-derived-value-state.ts +0 -41
  387. package/src/shared/stores/bound-store/_utils.ts +0 -161
  388. package/src/shared/stores/bound-store/index.ts +0 -148
  389. package/src/shared/stores/utils/reset-stores-for-screen.ts +0 -13
  390. package/src/shared/utils/bounds/_types/get-bounds.ts +0 -10
  391. package/src/shared/utils/bounds/_utils/flatten-styles.ts +0 -21
  392. package/src/shared/utils/bounds/_utils/get-bounds.ts +0 -54
  393. /package/lib/commonjs/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  394. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  395. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  396. /package/lib/commonjs/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  397. /package/lib/commonjs/shared/utils/bounds/{_types → types}/builder.js +0 -0
  398. /package/lib/commonjs/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  399. /package/lib/commonjs/shared/{providers/utils → utils}/create-provider.js +0 -0
  400. /package/lib/module/shared/hooks/{use-shared-value-state.js → reanimated/use-shared-value-state.js} +0 -0
  401. /package/lib/module/shared/utils/bounds/{_utils → helpers}/geometry.js +0 -0
  402. /package/lib/module/shared/utils/bounds/{_utils → helpers}/style-composers.js +0 -0
  403. /package/lib/module/shared/utils/bounds/{_utils → helpers}/styles.js +0 -0
  404. /package/lib/module/shared/utils/bounds/{_types → types}/builder.js +0 -0
  405. /package/lib/module/shared/utils/bounds/{_types → types}/geometry.js +0 -0
  406. /package/lib/module/shared/{providers/utils → utils}/create-provider.js +0 -0
  407. /package/lib/typescript/shared/hooks/{use-shared-value-state.d.ts → reanimated/use-shared-value-state.d.ts} +0 -0
  408. /package/lib/typescript/shared/utils/bounds/{_utils → helpers}/is-bounds-equal.d.ts +0 -0
  409. /package/lib/typescript/shared/utils/bounds/{_types → types}/geometry.d.ts +0 -0
  410. /package/src/shared/hooks/{use-shared-value-state.ts → reanimated/use-shared-value-state.ts} +0 -0
  411. /package/src/shared/hooks/{use-stable-callback-value.tsx → use-stable-callback-value.ts} +0 -0
  412. /package/src/shared/hooks/{use-stable-callback.tsx → use-stable-callback.ts} +0 -0
  413. /package/src/shared/types/{gesture.ts → gesture.types.ts} +0 -0
  414. /package/src/shared/types/{utils.ts → utils.types.ts} +0 -0
  415. /package/src/shared/utils/bounds/{_types → types}/geometry.ts +0 -0
@@ -1,24 +0,0 @@
1
- import { type MeasuredDimensions, type StyleProps } from "react-native-reanimated";
2
- import type { ScreenTransitionState } from "../../types/animation";
3
- import type { ScreenKey } from "../../types/core";
4
- declare function setBounds(screenId: string, boundId: string, bounds?: MeasuredDimensions | null, styles?: StyleProps): void;
5
- declare function getBounds(screenId: string): Record<string, {
6
- bounds: MeasuredDimensions;
7
- styles: StyleProps;
8
- }>;
9
- declare function setRouteActive(routeKey: string, boundId: string): void;
10
- declare function getRouteActive(routeKey: string): string;
11
- declare function clear(routeKey: ScreenKey): void;
12
- declare function debugBoundStore(): void;
13
- declare function getActiveBound(current: ScreenTransitionState, next: ScreenTransitionState | undefined, previous: ScreenTransitionState | undefined): string;
14
- export declare const BoundStore: {
15
- setBounds: typeof setBounds;
16
- getBounds: typeof getBounds;
17
- setRouteActive: typeof setRouteActive;
18
- getRouteActive: typeof getRouteActive;
19
- clear: typeof clear;
20
- getActiveBound: typeof getActiveBound;
21
- debugBoundStore: typeof debugBoundStore;
22
- };
23
- export {};
24
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/stores/bound-store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,kBAAkB,EAEvB,KAAK,UAAU,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAalD,iBAAS,SAAS,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,kBAAkB,GAAG,IAAW,EACxC,MAAM,GAAE,UAAe,QAYvB;AAED,iBAAS,SAAS,CAAC,QAAQ,EAAE,MAAM;YAzBT,kBAAkB;YAAU,UAAU;GA4B/D;AAED,iBAAS,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,QAOxD;AAED,iBAAS,cAAc,CAAC,QAAQ,EAAE,MAAM,UAGvC;AAoBD,iBAAS,KAAK,CAAC,QAAQ,EAAE,SAAS,QA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@ -1,6 +0,0 @@
1
- import type { NativeStackDescriptor } from "../../../native-stack/types";
2
- /**
3
- * Reset all stores for a given screen
4
- */
5
- export declare const resetStoresForScreen: (current: NativeStackDescriptor) => void;
6
- //# sourceMappingURL=reset-stores-for-screen.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"reset-stores-for-screen.d.ts","sourceRoot":"","sources":["../../../../../src/shared/stores/utils/reset-stores-for-screen.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAKzE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,qBAAqB,SAIlE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,yBAAyB;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACR,wDAAwD;QACxD,MAAM,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,MAAM,qBAAqB,GAAG;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAA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AAC;CACxB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/bounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EACX,oBAAoB,EACpB,gBAAgB,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAE1C;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,CAAC,CAAC,SAAS,oBAAoB,EAAE,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,KAAK,UAAU,CAAC;CACtD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAEzE,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CA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AG,CAAC,EAAE,cAAc,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF,oBAAY,kBAAkB;IAC7B,OAAO,IAAA;IACP,MAAM,IAAA;IACN,MAAM,IAAA;CACN;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,cAAc,CAAC;AAE7D,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAAG,cAAc,CAAC;AAEpE,MAAM,MAAM,aAAa,GAAG;IAC3B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,SAAS,EAAE,IAAI,CAAC,gBAAgB,EAAE,eAAe,CAAC,GAAG,IAAI,CAAC;CAC1D,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/utils.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,GAAG,GAAG,GAAG,CAAC;AAEtB,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;CAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_types/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,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SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACd,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_types/geometry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IAC1B,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG;IACrD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;CACV,CAAC"}
@@ -1,10 +0,0 @@
1
- import type { ScreenTransitionState } from "../../../types/animation";
2
- import type { ScreenPhase } from "../../../types/core";
3
- export type GetBoundsParams = {
4
- id: string | null;
5
- phase?: ScreenPhase;
6
- previous?: ScreenTransitionState;
7
- current: ScreenTransitionState;
8
- next?: ScreenTransitionState;
9
- };
10
- //# sourceMappingURL=get-bounds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-bounds.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_types/get-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG;IAC7B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,OAAO,EAAE,qBAAqB,CAAC;IAC/B,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC7B,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare function flattenStyle<TStyleProp>(style: TStyleProp): TStyleProp;
2
- //# sourceMappingURL=flatten-styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flatten-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_utils/flatten-styles.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAoBtE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"geometry.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_utils/geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EACX,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,oBAAoB,CAAC;AAsC5B;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,EACvC,KAAK,EACL,GAAG,EACH,QAAQ,EACR,MAAiB,EACjB,SAAmB,GACnB,EAAE;IACF,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,gBAAgB,CAoCnB;AACD;;;GAGG;AACH,wBAAgB,+BAA+B,CAAC,EAC/C,KAAK,EACL,GAAG,EACH,QAAQ,EACR,UAAU,EACV,MAAiB,EACjB,SAAqB,GACrB,EAAE;IACF,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,wBAAwB,CAmD3B"}
@@ -1,4 +0,0 @@
1
- import type { BoundEntry } from "../../../types/bounds";
2
- import type { GetBoundsParams } from "../_types/get-bounds";
3
- export declare const getBounds: (props: GetBoundsParams) => BoundEntry;
4
- //# sourceMappingURL=get-bounds.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-bounds.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_utils/get-bounds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAc5D,eAAO,MAAM,SAAS,GAAI,OAAO,eAAe,KAAG,UAqClD,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"is-bounds-equal.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_utils/is-bounds-equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,eAAO,MAAM,aAAa,GAAI,oCAI3B;IACF,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,cAAc,EAAE,MAAM,CAAC;CACvB,YAYA,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"style-composers.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/_utils/style-composers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;A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BAAsB,CAAC;AAEhD,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AACnD,KAAK,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtC,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAqD5C,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,UAAU,GAAG,SAAS,GAC3B,gBAAgB,CAOlB"}
@@ -1,184 +0,0 @@
1
- import {
2
- createContext,
3
- Fragment,
4
- useContext,
5
- useLayoutEffect,
6
- useMemo,
7
- useRef,
8
- } from "react";
9
- import type { View } from "react-native";
10
- import {
11
- type AnimatedRef,
12
- measure,
13
- runOnJS,
14
- runOnUI,
15
- type StyleProps,
16
- useAnimatedReaction,
17
- useSharedValue,
18
- } from "react-native-reanimated";
19
- import type { SharedValue } from "react-native-reanimated/lib/typescript/commonTypes";
20
- import { useKeys } from "../../providers/keys";
21
- import { BoundStore } from "../../stores/bound-store";
22
- import { isBoundsEqual } from "../../utils/bounds/_utils/is-bounds-equal";
23
- import { prepareStyleForBounds } from "../../utils/bounds/_utils/styles";
24
- import useStableCallback from "../use-stable-callback";
25
- import useStableCallbackValue from "../use-stable-callback-value";
26
-
27
- interface BoundMeasurerHookProps {
28
- sharedBoundTag?: string;
29
- animatedRef: AnimatedRef<View>;
30
- style: StyleProps;
31
- onPress?: ((...args: unknown[]) => void) | undefined;
32
- }
33
-
34
- interface MaybeMeasureAndStoreParams {
35
- onPress?: ((...args: unknown[]) => void) | undefined;
36
- skipMarkingActive?: boolean;
37
- }
38
-
39
- interface MeasurementUpdateContextType {
40
- updateSignal: SharedValue<number>;
41
- }
42
-
43
- const MeasurementUpdateContext =
44
- createContext<MeasurementUpdateContextType | null>(null);
45
-
46
- export const useBoundsRegistry = ({
47
- sharedBoundTag,
48
- animatedRef,
49
- style,
50
- onPress,
51
- }: BoundMeasurerHookProps) => {
52
- const { previous, current, next } = useKeys();
53
- const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
54
-
55
- const ROOT_MEASUREMENT_SIGNAL = useContext(MeasurementUpdateContext);
56
- const ROOT_SIGNAL = useSharedValue(0);
57
- const IS_ROOT = !ROOT_MEASUREMENT_SIGNAL;
58
-
59
- const emitUpdate = useStableCallbackValue(() => {
60
- "worklet";
61
- if (IS_ROOT) ROOT_SIGNAL.value = ROOT_SIGNAL.value + 1;
62
- });
63
-
64
- const maybeMeasureAndStore = useStableCallbackValue(
65
- ({ onPress, skipMarkingActive }: MaybeMeasureAndStoreParams) => {
66
- "worklet";
67
- // Currently, there's no necessity to measure when the current route is blurred ( could potentially change in the future )
68
- if (!sharedBoundTag || next) return;
69
-
70
- const measured = measure(animatedRef);
71
-
72
- if (!measured) {
73
- console.warn(
74
- `[react-native-screen-transitions] measure() returned null for sharedBoundTag="${sharedBoundTag}"`,
75
- );
76
- return;
77
- }
78
-
79
- const key = current.route.key;
80
-
81
- if (isBoundsEqual({ measured, key, sharedBoundTag })) {
82
- emitUpdate();
83
- if (!skipMarkingActive) {
84
- BoundStore.setRouteActive(key, sharedBoundTag);
85
- }
86
- if (onPress) runOnJS(onPress)();
87
- return;
88
- }
89
-
90
- emitUpdate();
91
-
92
- BoundStore.setBounds(key, sharedBoundTag, measured, preparedStyles);
93
- if (!skipMarkingActive) {
94
- BoundStore.setRouteActive(key, sharedBoundTag);
95
- }
96
-
97
- if (onPress) runOnJS(onPress)();
98
- },
99
- );
100
-
101
- const hasMeasuredOnLayout = useSharedValue(false);
102
- const handleInitialLayout = useStableCallbackValue(() => {
103
- "worklet";
104
-
105
- const prevKey = previous?.route.key;
106
- if (!sharedBoundTag || hasMeasuredOnLayout.value || !prevKey) {
107
- return;
108
- }
109
-
110
- const prevBounds = BoundStore.getBounds(prevKey)?.[sharedBoundTag];
111
-
112
- if (prevBounds) {
113
- // Should skip mark active if we are in a transition
114
- maybeMeasureAndStore({ skipMarkingActive: true });
115
- // Should not measure again while in transition
116
- hasMeasuredOnLayout.value = true;
117
- }
118
- });
119
-
120
- const captureActiveOnPress = useStableCallback(() => {
121
- if (!sharedBoundTag) {
122
- if (onPress) onPress();
123
- return;
124
- }
125
-
126
- // In this case, we DO want to mark active
127
- runOnUI(maybeMeasureAndStore)({ onPress });
128
- });
129
-
130
- const MeasurementSyncProvider = useMemo(() => {
131
- if (!IS_ROOT || !sharedBoundTag) {
132
- return Fragment;
133
- }
134
-
135
- return ({ children }: { children: React.ReactNode }) => (
136
- <MeasurementUpdateContext.Provider value={{ updateSignal: ROOT_SIGNAL }}>
137
- {children}
138
- </MeasurementUpdateContext.Provider>
139
- );
140
- }, [IS_ROOT, sharedBoundTag, ROOT_SIGNAL]);
141
-
142
- const prevNextRef = useRef(next);
143
- /**
144
- * Measure non-pressable elements when the screen goes from focused to blurred
145
- * (or when a new `next` descriptor appears) so we capture final bounds
146
- * right before the transition starts.
147
- */
148
- useLayoutEffect(() => {
149
- if (!sharedBoundTag || onPress) return;
150
-
151
- const hadNext = !!prevNextRef.current;
152
- const hasNext = !!next;
153
-
154
- if (!hadNext && hasNext) {
155
- runOnUI(maybeMeasureAndStore)({});
156
- }
157
-
158
- prevNextRef.current = next;
159
- }, [next, sharedBoundTag, onPress, maybeMeasureAndStore]);
160
-
161
- /**
162
- * Signal child shared elements (nested under this provider) to refresh their
163
- * measurements when the root updates, while preventing them from marking
164
- * themselves active during that sync.
165
- */
166
- useAnimatedReaction(
167
- () => ROOT_MEASUREMENT_SIGNAL?.updateSignal.value,
168
- (current) => {
169
- "worklet";
170
-
171
- // We don't want to run on the initial amount)
172
- if (current === 0 || current === undefined) return;
173
-
174
- // Children should not have the ability to mark active
175
- maybeMeasureAndStore({ skipMarkingActive: true });
176
- },
177
- );
178
-
179
- return {
180
- handleInitialLayout,
181
- captureActiveOnPress,
182
- MeasurementSyncProvider,
183
- };
184
- };
@@ -1,41 +0,0 @@
1
- import { useState } from "react";
2
- import {
3
- executeOnUIRuntimeSync,
4
- runOnJS,
5
- type SharedValue,
6
- useAnimatedReaction,
7
- useDerivedValue,
8
- } from "react-native-reanimated";
9
-
10
- /**
11
- * Derives React state from a Reanimated worklet.
12
- *
13
- * @param processor - The worklet function that calculates the value
14
- * @param dependencies - Array of dependencies for the worklet
15
- * @returns The derived value as React State
16
- */
17
- export function useDerivedValueState<T>(
18
- processor: () => T,
19
- dependencies: any[] = [],
20
- ): T {
21
- const derivedValue = useDerivedValue(processor, dependencies);
22
-
23
- const [state, setState] = useState<T>(() => {
24
- const readOnUI = executeOnUIRuntimeSync((sv: SharedValue<T>) => {
25
- "worklet";
26
- return sv.value;
27
- });
28
- return readOnUI(derivedValue);
29
- });
30
-
31
- useAnimatedReaction(
32
- () => derivedValue.value,
33
- (curr, prev) => {
34
- if (curr !== prev) {
35
- runOnJS(setState)(curr);
36
- }
37
- },
38
- );
39
-
40
- return state;
41
- }
@@ -1,161 +0,0 @@
1
- import type { ScreenTransitionState } from "../../types/animation";
2
-
3
- type GetCache = (fromKey: string, toKey: string) => string | null;
4
- type SetCache = (fromKey: string, toKey: string, id: string) => void;
5
- type GetRouteActive = (routeKey: string) => string | null;
6
-
7
- interface ResolveActiveBoundParams {
8
- current: ScreenTransitionState;
9
- next?: ScreenTransitionState;
10
- previous?: ScreenTransitionState;
11
- getPairCache: GetCache;
12
- setPairCache: SetCache;
13
- getRouteActive: GetRouteActive;
14
- }
15
-
16
- export function pairKey(fromKey?: string, toKey?: string) {
17
- "worklet";
18
- return fromKey && toKey ? `${fromKey}|${toKey}` : "";
19
- }
20
-
21
- const hasBound = (s: ScreenTransitionState | undefined, id?: string | null) => {
22
- "worklet";
23
- return !!id && !!s && !!s.bounds && !!s.bounds[id];
24
- };
25
-
26
- const getRoutePair = (
27
- current: ScreenTransitionState,
28
- next: ScreenTransitionState | undefined,
29
- previous: ScreenTransitionState | undefined,
30
- ) => {
31
- "worklet";
32
- const isClosing = !!next;
33
- const fromKey = isClosing ? current.route.key : previous?.route.key;
34
- const toKey = isClosing ? next?.route.key : current.route.key;
35
- const other = next ?? previous;
36
- return { fromKey, toKey, other } as const;
37
- };
38
-
39
- const resolveFromPairCache = (
40
- fromKey: string | undefined,
41
- toKey: string | undefined,
42
- other: ScreenTransitionState | undefined,
43
- getPairCache: GetCache,
44
- ) => {
45
- "worklet";
46
- if (fromKey && toKey) {
47
- const cached = getPairCache(fromKey, toKey);
48
- if (hasBound(other, cached)) return cached as string;
49
- }
50
- return "";
51
- };
52
-
53
- const resolveFromRequested = (
54
- reqId: string | null,
55
- current: ScreenTransitionState,
56
- other: ScreenTransitionState | undefined,
57
- ) => {
58
- "worklet";
59
- if (hasBound(other, reqId)) return reqId as string;
60
- if (hasBound(current, reqId)) return reqId as string;
61
- return "";
62
- };
63
-
64
- const resolveFromInteresection = (
65
- current: ScreenTransitionState,
66
- other: ScreenTransitionState | undefined,
67
- fromKey: string | undefined,
68
- getRouteActive: GetRouteActive,
69
- ) => {
70
- "worklet";
71
- if (!other) return "";
72
- const a = Object.keys(current.bounds);
73
- const b = Object.keys(other.bounds);
74
- const inter = a.filter((k) => b.includes(k));
75
- const otherHasAny = b.length > 0;
76
- const routeActive = fromKey ? getRouteActive(fromKey) : null;
77
-
78
- if (inter.length > 0) {
79
- if (routeActive && inter.includes(routeActive)) return routeActive;
80
- return inter[0];
81
- }
82
-
83
- if (routeActive && hasBound(other, routeActive)) return routeActive;
84
- if (b.length === 1) return b[0];
85
-
86
- if (!otherHasAny) {
87
- if (routeActive && hasBound(current, routeActive)) return routeActive;
88
- if (a.length === 1) return a[0];
89
- }
90
-
91
- return "";
92
- };
93
-
94
- /**
95
- * Util function to get the active bound id for a given transition state.
96
- *
97
- * It will check by ( priority from highest to lowest ):
98
- * 1. Requested id
99
- * 2. Cache
100
- * 3. Intersection
101
- */
102
- export function resolveActiveBound({
103
- current,
104
- next,
105
- previous,
106
- getPairCache,
107
- setPairCache,
108
- getRouteActive,
109
- }: ResolveActiveBoundParams) {
110
- "worklet";
111
- const { fromKey, toKey, other } = getRoutePair(current, next, previous);
112
-
113
- // Resolve requested from per-route most recently used (last active bound by route)
114
- const requestedId = fromKey ? getRouteActive(fromKey) : null;
115
- const byRequested = resolveFromRequested(requestedId, current, other);
116
- if (byRequested) {
117
- if (
118
- fromKey &&
119
- toKey &&
120
- hasBound(current, byRequested) &&
121
- hasBound(other, byRequested)
122
- ) {
123
- setPairCache(fromKey, toKey, byRequested);
124
- }
125
- return byRequested;
126
- }
127
-
128
- const byPairCache = resolveFromPairCache(fromKey, toKey, other, getPairCache);
129
- if (byPairCache) {
130
- if (
131
- fromKey &&
132
- toKey &&
133
- hasBound(current, byPairCache) &&
134
- hasBound(other, byPairCache)
135
- ) {
136
- setPairCache(fromKey, toKey, byPairCache);
137
- }
138
- return byPairCache;
139
- }
140
-
141
- const byIntersection = resolveFromInteresection(
142
- current,
143
- other,
144
- fromKey,
145
- getRouteActive,
146
- );
147
-
148
- if (byIntersection) {
149
- if (
150
- fromKey &&
151
- toKey &&
152
- hasBound(current, byIntersection) &&
153
- hasBound(other, byIntersection)
154
- ) {
155
- setPairCache(fromKey, toKey, byIntersection);
156
- }
157
- return byIntersection;
158
- }
159
-
160
- return "";
161
- }
@@ -1,148 +0,0 @@
1
- import {
2
- type MeasuredDimensions,
3
- makeMutable,
4
- type StyleProps,
5
- } from "react-native-reanimated";
6
- import type { ScreenTransitionState } from "../../types/animation";
7
- import type { ScreenKey } from "../../types/core";
8
- import type { Any } from "../../types/utils";
9
- import { pairKey, resolveActiveBound } from "./_utils";
10
-
11
- type BoundsDict = Record<
12
- string,
13
- Record<string, { bounds: MeasuredDimensions; styles: StyleProps }>
14
- >;
15
-
16
- const registry = makeMutable<BoundsDict>({});
17
- const pairCache = makeMutable<Record<string, string>>({});
18
- const lastActiveByRoute = makeMutable<Record<string, string>>({});
19
-
20
- function setBounds(
21
- screenId: string,
22
- boundId: string,
23
- bounds: MeasuredDimensions | null = null,
24
- styles: StyleProps = {},
25
- ) {
26
- "worklet";
27
- registry.modify((state: Any) => {
28
- "worklet";
29
- if (!state[screenId]) {
30
- state[screenId] = {};
31
- }
32
- state[screenId][boundId] = { bounds, styles };
33
-
34
- return state;
35
- });
36
- }
37
-
38
- function getBounds(screenId: string) {
39
- "worklet";
40
- return registry.value[screenId] ?? {};
41
- }
42
-
43
- function setRouteActive(routeKey: string, boundId: string) {
44
- "worklet";
45
- lastActiveByRoute.modify((state: Any) => {
46
- "worklet";
47
- state[routeKey] = boundId;
48
- return state;
49
- });
50
- }
51
-
52
- function getRouteActive(routeKey: string) {
53
- "worklet";
54
- return lastActiveByRoute.value[routeKey] ?? null;
55
- }
56
-
57
- function setPairCache(fromKey: string, toKey: string, boundId: string) {
58
- "worklet";
59
- const key = pairKey(fromKey, toKey);
60
- if (!key) return;
61
- pairCache.modify((state: Any) => {
62
- "worklet";
63
- state[key] = boundId;
64
- return state;
65
- });
66
- }
67
-
68
- function getPairCache(fromKey: string, toKey: string) {
69
- "worklet";
70
- const key = pairKey(fromKey, toKey);
71
- if (!key) return null;
72
- return pairCache.value[key] ?? null;
73
- }
74
-
75
- function clear(routeKey: ScreenKey) {
76
- "worklet";
77
- registry.modify((state) => {
78
- "worklet";
79
- delete state[routeKey];
80
- return state;
81
- });
82
- lastActiveByRoute.modify((state) => {
83
- "worklet";
84
- if (state[routeKey]) delete state[routeKey];
85
- return state;
86
- });
87
-
88
- pairCache.modify((state) => {
89
- "worklet";
90
- const keys = Object.keys(state);
91
- for (let i = 0; i < keys.length; i++) {
92
- const k = keys[i];
93
- const [from, to] = k.split("|");
94
- if (from === routeKey || to === routeKey) {
95
- delete state[k];
96
- }
97
- }
98
- return state;
99
- });
100
- }
101
-
102
- function debugBoundStore() {
103
- "worklet";
104
- console.log("[BoundStore] registry keys:", Object.keys(registry.value));
105
- console.log(
106
- "[BoundStore] registry size:",
107
- Object.keys(registry.value).length,
108
- );
109
- console.log("[BoundStore] pairCache keys:", Object.keys(pairCache.value));
110
- console.log(
111
- "[BoundStore] pairCache size:",
112
- Object.keys(pairCache.value).length,
113
- );
114
- console.log(
115
- "[BoundStore] lastActiveByRoute keys:",
116
- Object.keys(lastActiveByRoute.value),
117
- );
118
- console.log(
119
- "[BoundStore] lastActiveByRoute size:",
120
- Object.keys(lastActiveByRoute.value).length,
121
- );
122
- }
123
-
124
- function getActiveBound(
125
- current: ScreenTransitionState,
126
- next: ScreenTransitionState | undefined,
127
- previous: ScreenTransitionState | undefined,
128
- ) {
129
- "worklet";
130
- return resolveActiveBound({
131
- current,
132
- next,
133
- previous,
134
- getPairCache,
135
- setPairCache,
136
- getRouteActive,
137
- });
138
- }
139
-
140
- export const BoundStore = {
141
- setBounds,
142
- getBounds,
143
- setRouteActive,
144
- getRouteActive,
145
- clear,
146
- getActiveBound,
147
- debugBoundStore,
148
- };