react-native-screen-transitions 3.4.0-alpha.7 → 3.4.0-beta.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 (372) hide show
  1. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +6 -4
  2. package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +22 -60
  4. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
  6. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +56 -41
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -23
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +111 -2
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js +69 -0
  16. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
  17. package/lib/commonjs/shared/components/create-boundary-component/index.js +10 -5
  18. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  19. package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -32
  20. package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
  21. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +11 -9
  22. package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  23. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +7 -5
  24. package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
  25. package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
  26. package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
  27. package/lib/commonjs/shared/constants.js +17 -3
  28. package/lib/commonjs/shared/constants.js.map +1 -1
  29. package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
  30. package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
  31. package/lib/commonjs/shared/index.js +6 -0
  32. package/lib/commonjs/shared/index.js.map +1 -1
  33. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
  34. package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  35. package/lib/commonjs/shared/providers/register-bounds.provider.js +9 -1
  36. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
  38. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
  39. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
  40. package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  41. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +1 -11
  42. package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
  43. package/lib/commonjs/shared/stores/animation.store.js +9 -3
  44. package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
  45. package/lib/commonjs/shared/stores/bounds/internals/clear.js +23 -167
  46. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  47. package/lib/commonjs/shared/stores/bounds/internals/presence.js +0 -3
  48. package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
  49. package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -7
  50. package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
  51. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -51
  52. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  53. package/lib/commonjs/shared/stores/bounds/internals/state.js +1 -83
  54. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  55. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
  56. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  57. package/lib/commonjs/shared/utils/bounds/constants.js.map +1 -0
  58. package/lib/commonjs/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +5 -5
  59. package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
  60. package/lib/commonjs/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +6 -6
  61. package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
  62. package/lib/commonjs/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
  63. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
  64. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +70 -0
  65. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
  66. package/lib/commonjs/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
  67. package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
  68. package/lib/commonjs/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +14 -20
  69. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
  70. package/lib/commonjs/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
  71. package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
  72. package/lib/commonjs/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
  73. package/lib/commonjs/shared/utils/bounds/index.js +16 -44
  74. package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
  75. package/lib/commonjs/shared/utils/bounds/zoom/build.js +234 -50
  76. package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
  77. package/lib/commonjs/shared/utils/bounds/zoom/config.js +10 -1
  78. package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
  79. package/lib/commonjs/shared/utils/bounds/zoom/math.js +34 -1
  80. package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -1
  81. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +6 -4
  82. package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
  83. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +23 -61
  84. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  85. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
  86. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
  87. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +54 -39
  88. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
  89. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
  90. package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
  91. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -23
  92. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
  93. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +114 -4
  94. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
  95. package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js +64 -0
  96. package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
  97. package/lib/module/shared/components/create-boundary-component/index.js +10 -5
  98. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  99. package/lib/module/shared/components/create-transition-aware-component.js +10 -34
  100. package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
  101. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
  102. package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
  103. package/lib/module/shared/components/screen-container/layers/backdrop.js +7 -5
  104. package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
  105. package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
  106. package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
  107. package/lib/module/shared/constants.js +16 -2
  108. package/lib/module/shared/constants.js.map +1 -1
  109. package/lib/module/shared/hooks/reanimated/use-animated-debounce.js +39 -0
  110. package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
  111. package/lib/module/shared/index.js +1 -1
  112. package/lib/module/shared/index.js.map +1 -1
  113. package/lib/module/shared/providers/gestures/handlers/use-handlers.js +7 -0
  114. package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
  115. package/lib/module/shared/providers/register-bounds.provider.js +9 -1
  116. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  117. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
  118. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
  119. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
  120. package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
  121. package/lib/module/shared/providers/screen/styles/styles.provider.js +1 -11
  122. package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
  123. package/lib/module/shared/stores/animation.store.js +9 -3
  124. package/lib/module/shared/stores/animation.store.js.map +1 -1
  125. package/lib/module/shared/stores/bounds/internals/clear.js +24 -168
  126. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  127. package/lib/module/shared/stores/bounds/internals/presence.js +1 -4
  128. package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
  129. package/lib/module/shared/stores/bounds/internals/registry.js +19 -8
  130. package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
  131. package/lib/module/shared/stores/bounds/internals/resolver.js +8 -52
  132. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  133. package/lib/module/shared/stores/bounds/internals/state.js +0 -78
  134. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  135. package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
  136. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  137. package/lib/module/shared/utils/bounds/constants.js.map +1 -0
  138. package/lib/module/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +3 -3
  139. package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
  140. package/lib/module/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +5 -5
  141. package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
  142. package/lib/module/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
  143. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
  144. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +64 -0
  145. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
  146. package/lib/module/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
  147. package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
  148. package/lib/module/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +12 -18
  149. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
  150. package/lib/module/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
  151. package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
  152. package/lib/module/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
  153. package/lib/module/shared/utils/bounds/index.js +14 -42
  154. package/lib/module/shared/utils/bounds/index.js.map +1 -1
  155. package/lib/module/shared/utils/bounds/zoom/build.js +238 -54
  156. package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
  157. package/lib/module/shared/utils/bounds/zoom/config.js +9 -0
  158. package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
  159. package/lib/module/shared/utils/bounds/zoom/math.js +31 -0
  160. package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -1
  161. package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
  162. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
  163. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
  164. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +17 -11
  165. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
  166. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +3 -1
  167. package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
  168. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +1 -2
  169. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
  170. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts +20 -1
  171. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
  172. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts +12 -0
  173. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts.map +1 -0
  174. package/lib/typescript/shared/components/create-boundary-component/index.d.ts +10 -4
  175. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  176. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +1 -1
  177. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  178. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  179. package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
  180. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
  182. package/lib/typescript/shared/constants.d.ts +33 -1
  183. package/lib/typescript/shared/constants.d.ts.map +1 -1
  184. package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
  185. package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
  186. package/lib/typescript/shared/index.d.ts +3 -3
  187. package/lib/typescript/shared/index.d.ts.map +1 -1
  188. package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
  189. package/lib/typescript/shared/providers/register-bounds.provider.d.ts +7 -0
  190. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  191. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
  192. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
  193. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
  194. package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
  195. package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
  196. package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
  197. package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
  198. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  199. package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
  200. package/lib/typescript/shared/stores/bounds/internals/registry.d.ts.map +1 -1
  201. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  202. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +0 -3
  203. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  204. package/lib/typescript/shared/stores/bounds/types.d.ts +0 -2
  205. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  206. package/lib/typescript/shared/types/animation.types.d.ts +11 -0
  207. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  208. package/lib/typescript/shared/types/bounds.types.d.ts +106 -1
  209. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  210. package/lib/typescript/shared/types/index.d.ts +1 -1
  211. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  212. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
  213. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  214. package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -0
  215. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +7 -0
  216. package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -0
  217. package/lib/typescript/shared/utils/bounds/helpers/{interpolators.d.ts → create-interpolators.d.ts} +3 -3
  218. package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +1 -0
  219. package/lib/typescript/shared/utils/bounds/helpers/{link-accessor.d.ts → create-link-accessor.d.ts} +1 -1
  220. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -0
  221. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +20 -0
  222. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -0
  223. package/lib/typescript/shared/utils/bounds/helpers/{style-composers.d.ts → styles/composers.d.ts} +4 -4
  224. package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -0
  225. package/lib/typescript/shared/utils/bounds/helpers/{compute-bounds-styles.d.ts → styles/compute.d.ts} +3 -3
  226. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -0
  227. package/lib/typescript/shared/utils/bounds/helpers/{interpolate-style.d.ts → styles/interpolate-link-style.d.ts} +2 -2
  228. package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +1 -0
  229. package/lib/typescript/shared/utils/bounds/helpers/styles/styles.d.ts.map +1 -0
  230. package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
  231. package/lib/typescript/shared/utils/bounds/types/options.d.ts +3 -2
  232. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  233. package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
  234. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +9 -0
  235. package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
  236. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +17 -0
  237. package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -1
  238. package/package.json +1 -1
  239. package/src/shared/components/create-boundary-component/components/boundary-target.tsx +6 -4
  240. package/src/shared/components/create-boundary-component/create-boundary-component.tsx +28 -60
  241. package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
  242. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +72 -53
  243. package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
  244. package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +5 -34
  245. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +180 -6
  246. package/src/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.ts +110 -0
  247. package/src/shared/components/create-boundary-component/index.tsx +10 -5
  248. package/src/shared/components/create-boundary-component/types.ts +1 -2
  249. package/src/shared/components/create-transition-aware-component.tsx +10 -47
  250. package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
  251. package/src/shared/components/screen-container/layers/backdrop.tsx +6 -9
  252. package/src/shared/components/screen-lifecycle/index.tsx +1 -4
  253. package/src/shared/constants.ts +11 -1
  254. package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
  255. package/src/shared/index.ts +3 -0
  256. package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
  257. package/src/shared/providers/register-bounds.provider.tsx +8 -1
  258. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
  259. package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
  260. package/src/shared/providers/screen/styles/styles.provider.tsx +1 -12
  261. package/src/shared/stores/animation.store.ts +11 -2
  262. package/src/shared/stores/bounds/internals/clear.ts +47 -220
  263. package/src/shared/stores/bounds/internals/presence.ts +1 -4
  264. package/src/shared/stores/bounds/internals/registry.ts +25 -14
  265. package/src/shared/stores/bounds/internals/resolver.ts +7 -84
  266. package/src/shared/stores/bounds/internals/state.ts +0 -98
  267. package/src/shared/stores/bounds/types.ts +0 -2
  268. package/src/shared/types/animation.types.ts +13 -0
  269. package/src/shared/types/bounds.types.ts +108 -1
  270. package/src/shared/types/index.ts +2 -0
  271. package/src/shared/utils/animation/animate-to-progress.ts +11 -1
  272. package/src/shared/utils/bounds/{helpers/constants.ts → constants.ts} +1 -1
  273. package/src/shared/utils/bounds/helpers/{resolve-bound-tag.ts → create-bound-tag.ts} +2 -2
  274. package/src/shared/utils/bounds/helpers/{interpolators.ts → create-interpolators.ts} +19 -12
  275. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +100 -0
  276. package/src/shared/utils/bounds/helpers/{style-composers.ts → styles/composers.ts} +119 -53
  277. package/src/shared/utils/bounds/helpers/{compute-bounds-styles.ts → styles/compute.ts} +10 -20
  278. package/src/shared/utils/bounds/helpers/{interpolate-style.ts → styles/interpolate-link-style.ts} +9 -4
  279. package/src/shared/utils/bounds/index.ts +13 -53
  280. package/src/shared/utils/bounds/types/options.ts +3 -2
  281. package/src/shared/utils/bounds/zoom/build.ts +316 -95
  282. package/src/shared/utils/bounds/zoom/config.ts +11 -0
  283. package/src/shared/utils/bounds/zoom/math.ts +57 -0
  284. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
  285. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
  286. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
  287. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
  288. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
  289. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
  290. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
  291. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
  292. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -58
  293. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
  294. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
  295. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
  296. package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js +0 -41
  297. package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
  298. package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
  299. package/lib/commonjs/shared/utils/bounds/helpers/constants.js.map +0 -1
  300. package/lib/commonjs/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
  301. package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js +0 -20
  302. package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js.map +0 -1
  303. package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +0 -1
  304. package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
  305. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
  306. package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +0 -1
  307. package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +0 -1
  308. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
  309. package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
  310. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
  311. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
  312. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
  313. package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
  314. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
  315. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
  316. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -53
  317. package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
  318. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
  319. package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
  320. package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js +0 -36
  321. package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
  322. package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
  323. package/lib/module/shared/utils/bounds/helpers/constants.js.map +0 -1
  324. package/lib/module/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
  325. package/lib/module/shared/utils/bounds/helpers/interpolate.js +0 -16
  326. package/lib/module/shared/utils/bounds/helpers/interpolate.js.map +0 -1
  327. package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +0 -1
  328. package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
  329. package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
  330. package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +0 -1
  331. package/lib/module/shared/utils/bounds/helpers/styles.js.map +0 -1
  332. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
  333. package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
  334. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
  335. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
  336. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
  337. package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
  338. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
  339. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
  340. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -11
  341. package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
  342. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
  343. package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
  344. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +0 -14
  345. package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +0 -1
  346. package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +0 -1
  347. package/lib/typescript/shared/utils/bounds/helpers/constants.d.ts.map +0 -1
  348. package/lib/typescript/shared/utils/bounds/helpers/interpolate-style.d.ts.map +0 -1
  349. package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts +0 -2
  350. package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts.map +0 -1
  351. package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +0 -1
  352. package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +0 -1
  353. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +0 -7
  354. package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +0 -1
  355. package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +0 -1
  356. package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +0 -1
  357. package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
  358. package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
  359. package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
  360. package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
  361. package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -87
  362. package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
  363. package/src/shared/utils/bounds/helpers/build-bounds-options.ts +0 -48
  364. package/src/shared/utils/bounds/helpers/interpolate.ts +0 -19
  365. /package/lib/commonjs/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
  366. /package/lib/commonjs/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
  367. /package/lib/module/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
  368. /package/lib/module/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
  369. /package/lib/typescript/shared/utils/bounds/{helpers/constants.d.ts → constants.d.ts} +0 -0
  370. /package/lib/typescript/shared/utils/bounds/helpers/{styles.d.ts → styles/styles.d.ts} +0 -0
  371. /package/src/shared/utils/bounds/helpers/{link-accessor.ts → create-link-accessor.ts} +0 -0
  372. /package/src/shared/utils/bounds/helpers/{styles.ts → styles/styles.ts} +0 -0
@@ -1,5 +1,4 @@
1
- import { View } from "react-native";
2
- import { Pressable } from "react-native-gesture-handler";
1
+ import { Pressable, View } from "react-native";
3
2
  import { BoundaryTarget } from "./components/boundary-target";
4
3
  import { createBoundaryComponent } from "./create-boundary-component";
5
4
 
@@ -30,10 +29,16 @@ BoundaryTarget.displayName = "Transition.Boundary.Target";
30
29
  * - `Boundary.Target` to measure a nested descendant instead of the owner.
31
30
  */
32
31
  export const Boundary = {
33
- /** Passive boundary wrapper (no built-in press semantics). */
32
+ /**
33
+ * Passive boundary wrapper (no built-in press semantics).
34
+ */
34
35
  View: BoundaryView,
35
- /** Pressable boundary wrapper with press-priority source capture. */
36
+ /**
37
+ * Pressable boundary wrapper with press-priority source capture.
38
+ */
36
39
  Trigger: BoundaryTrigger,
37
- /** Optional nested measurement override inside a boundary owner. */
40
+ /**
41
+ * Optional nested measurement override inside a boundary owner.
42
+ */
38
43
  Target: BoundaryTarget,
39
44
  };
@@ -43,8 +43,7 @@ export type MeasurementIntent =
43
43
  | "capture-source"
44
44
  | "complete-destination"
45
45
  | "refresh-source"
46
- | "refresh-destination"
47
- | "snapshot-only";
46
+ | "refresh-destination";
48
47
 
49
48
  export interface MaybeMeasureAndStoreParams {
50
49
  intent?: MeasurementIntent | readonly MeasurementIntent[];
@@ -1,6 +1,6 @@
1
1
  /** biome-ignore-all lint/style/noNonNullAssertion: <This helper is usually being used inside a transitionable stack> */
2
2
  import type React from "react";
3
- import { type ComponentType, forwardRef, memo, useCallback } from "react";
3
+ import { type ComponentType, forwardRef, memo } from "react";
4
4
  import type { View } from "react-native";
5
5
  import { GestureDetector } from "react-native-gesture-handler";
6
6
  import Animated, {
@@ -9,13 +9,11 @@ import Animated, {
9
9
  useAnimatedRef,
10
10
  useAnimatedStyle,
11
11
  useComposedEventHandler,
12
- useSharedValue,
13
12
  } from "react-native-reanimated";
14
13
  import { NO_PROPS, NO_STYLES } from "../constants";
15
14
  import { useScrollRegistry } from "../hooks/gestures/use-scroll-registry";
16
15
  import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
17
16
  import { useScreenStyles } from "../providers/screen/styles";
18
- import { ScrollSettleProvider } from "../providers/scroll-settle.provider";
19
17
  import type { TransitionAwareProps } from "../types/screen.types";
20
18
 
21
19
  interface CreateTransitionAwareComponentOptions {
@@ -45,15 +43,6 @@ export function createTransitionAwareComponent<P extends object>(
45
43
  ...scrollableProps
46
44
  } = props;
47
45
 
48
- const settledSignal = useSharedValue(0);
49
-
50
- const emitScrollSettled = useCallback(() => {
51
- runOnUI(() => {
52
- "worklet";
53
- settledSignal.value = settledSignal.value + 1;
54
- })();
55
- }, [settledSignal]);
56
-
57
46
  // Determine scroll direction from the horizontal prop (standard ScrollView API)
58
47
  const scrollDirection = scrollableProps.horizontal
59
48
  ? "horizontal"
@@ -72,54 +61,28 @@ export function createTransitionAwareComponent<P extends object>(
72
61
  userOnScroll ?? null,
73
62
  ]);
74
63
 
75
- const handleMomentumScrollEnd = useCallback(
76
- (event: unknown) => {
77
- userOnMomentumScrollEnd?.(event);
78
- emitScrollSettled();
79
- },
80
- [userOnMomentumScrollEnd, emitScrollSettled],
81
- );
82
-
83
- const handleScrollEndDrag = useCallback(
84
- (event: any) => {
85
- userOnScrollEndDrag?.(event);
86
-
87
- const velocityX = Math.abs(event?.nativeEvent?.velocity?.x ?? 0);
88
- const velocityY = Math.abs(event?.nativeEvent?.velocity?.y ?? 0);
89
-
90
- // If there is no momentum, onMomentumScrollEnd may not fire.
91
- // Emit settled signal here only when velocity is effectively zero.
92
- if (velocityX < 0.01 && velocityY < 0.01) {
93
- emitScrollSettled();
94
- }
95
- },
96
- [userOnScrollEndDrag, emitScrollSettled],
97
- );
98
-
99
64
  const scrollableComponent = (
100
65
  <AnimatedComponent
101
66
  {...(scrollableProps as any)}
102
67
  ref={ref}
103
68
  onScroll={composedScrollHandler}
104
- onMomentumScrollEnd={handleMomentumScrollEnd}
105
- onScrollEndDrag={handleScrollEndDrag}
69
+ onMomentumScrollEnd={userOnMomentumScrollEnd}
70
+ onScrollEndDrag={userOnScrollEndDrag}
106
71
  onContentSizeChange={onContentSizeChange}
107
72
  onLayout={onLayout}
108
73
  scrollEventThrottle={scrollableProps.scrollEventThrottle || 16}
109
74
  />
110
75
  );
111
76
 
77
+ if (!nativeGesture) {
78
+ return scrollableComponent;
79
+ }
80
+
112
81
  // If no gesture owner found for this axis, render without GestureDetector
113
82
  return (
114
- <ScrollSettleProvider settledSignal={settledSignal}>
115
- {!nativeGesture ? (
116
- scrollableComponent
117
- ) : (
118
- <GestureDetector gesture={nativeGesture}>
119
- {scrollableComponent}
120
- </GestureDetector>
121
- )}
122
- </ScrollSettleProvider>
83
+ <GestureDetector gesture={nativeGesture}>
84
+ {scrollableComponent}
85
+ </GestureDetector>
123
86
  );
124
87
  });
125
88
 
@@ -15,15 +15,8 @@ export function useContentLayout() {
15
15
  const { height: screenHeight } = useWindowDimensions();
16
16
  const routeKey = current.route.key;
17
17
  const animations = AnimationStore.getBag(routeKey);
18
- const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
19
- const resolvedAutoSnapPointValue = SystemStore.getValue(
20
- routeKey,
21
- "resolvedAutoSnapPoint",
22
- );
23
- const measuredContentLayoutValue = SystemStore.getValue(
24
- routeKey,
25
- "measuredContentLayout",
26
- );
18
+ const { targetProgress, resolvedAutoSnapPoint, measuredContentLayout } =
19
+ SystemStore.getBag(routeKey);
27
20
  const experimental_animateOnInitialMount =
28
21
  current.options.experimental_animateOnInitialMount;
29
22
  const transitionSpec = current.options.transitionSpec;
@@ -37,13 +30,13 @@ export function useContentLayout() {
37
30
 
38
31
  runOnUI((nextWidth: number, nextHeight: number, nextFraction: number) => {
39
32
  "worklet";
40
- measuredContentLayoutValue.value = {
33
+ measuredContentLayout.value = {
41
34
  width: nextWidth,
42
35
  height: nextHeight,
43
36
  };
44
37
 
45
- const isFirstMeasurement = resolvedAutoSnapPointValue.value <= 0;
46
- resolvedAutoSnapPointValue.value = nextFraction;
38
+ const isFirstMeasurement = resolvedAutoSnapPoint.value <= 0;
39
+ resolvedAutoSnapPoint.value = nextFraction;
47
40
 
48
41
  if (
49
42
  !isFirstMeasurement ||
@@ -54,7 +47,7 @@ export function useContentLayout() {
54
47
  }
55
48
 
56
49
  if (isFirstKey && !experimental_animateOnInitialMount) {
57
- targetProgressValue.value = nextFraction;
50
+ targetProgress.value = nextFraction;
58
51
  animations.progress.value = nextFraction;
59
52
  return;
60
53
  }
@@ -63,15 +56,15 @@ export function useContentLayout() {
63
56
  target: nextFraction,
64
57
  spec: transitionSpec,
65
58
  animations,
66
- targetProgress: targetProgressValue,
59
+ targetProgress,
67
60
  });
68
61
  })(width, height, fraction);
69
62
  },
70
63
  [
71
64
  animations,
72
- targetProgressValue,
73
- resolvedAutoSnapPointValue,
74
- measuredContentLayoutValue,
65
+ targetProgress,
66
+ resolvedAutoSnapPoint,
67
+ measuredContentLayout,
75
68
  isFirstKey,
76
69
  screenHeight,
77
70
  experimental_animateOnInitialMount,
@@ -31,11 +31,8 @@ export const BackdropLayer = memo(function BackdropLayer({
31
31
  const BackdropComponent = current.options.backdropComponent;
32
32
  const routeKey = current.route.key;
33
33
  const animations = AnimationStore.getBag(routeKey);
34
- const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
35
- const resolvedAutoSnapPointValue = SystemStore.getValue(
36
- routeKey,
37
- "resolvedAutoSnapPoint",
38
- );
34
+ const { targetProgress, resolvedAutoSnapPoint } =
35
+ SystemStore.getBag(routeKey);
39
36
 
40
37
  const AnimatedBackdropComponent = useMemo(
41
38
  () =>
@@ -68,7 +65,7 @@ export const BackdropLayer = memo(function BackdropLayer({
68
65
  "worklet";
69
66
  const resolvedSnaps = rawSnapPoints
70
67
  .map((point) =>
71
- point === "auto" ? resolvedAutoSnapPointValue.value : point,
68
+ point === "auto" ? resolvedAutoSnapPoint.value : point,
72
69
  )
73
70
  .filter((point): point is number => typeof point === "number");
74
71
 
@@ -94,15 +91,15 @@ export const BackdropLayer = memo(function BackdropLayer({
94
91
  target,
95
92
  spec,
96
93
  animations,
97
- targetProgress: targetProgressValue,
94
+ targetProgress,
98
95
  onAnimationFinish: shouldDismiss ? dismissScreen : undefined,
99
96
  });
100
97
  })();
101
98
  }
102
99
  }, [
103
100
  animations,
104
- targetProgressValue,
105
- resolvedAutoSnapPointValue,
101
+ targetProgress,
102
+ resolvedAutoSnapPoint,
106
103
  backdropBehavior,
107
104
  current,
108
105
  dismissScreen,
@@ -20,10 +20,7 @@ export const ScreenLifecycle = ({ children }: Props) => {
20
20
  const { current, previous } = useDescriptors();
21
21
  const { isFirstKey } = useDescriptorDerivations();
22
22
  const animations = AnimationStore.getBag(current.route.key);
23
- const targetProgress = SystemStore.getValue(
24
- current.route.key,
25
- "targetProgress",
26
- );
23
+ const { targetProgress } = SystemStore.getBag(current.route.key);
27
24
 
28
25
  const { activateHighRefreshRate, deactivateHighRefreshRate } =
29
26
  useOpenTransition(current, animations, targetProgress, isFirstKey);
@@ -56,6 +56,7 @@ export const createScreenTransitionState = (
56
56
  progress: 0,
57
57
  closing: 0,
58
58
  animating: 0,
59
+ willAnimate: 0,
59
60
  settled: 1,
60
61
  logicallySettled: 1,
61
62
  entering: 0,
@@ -79,6 +80,7 @@ export const DEFAULT_SCREEN_TRANSITION_STATE: ScreenTransitionState =
79
80
  progress: 0,
80
81
  closing: 0,
81
82
  animating: 0,
83
+ willAnimate: 0,
82
84
  settled: 1,
83
85
  logicallySettled: 1,
84
86
  entering: 0,
@@ -105,7 +107,15 @@ export const EMPTY_BOUND_HELPER_RESULT_RAW = Object.freeze({
105
107
  translateY: 0,
106
108
  width: 0,
107
109
  height: 0,
108
- ...HIDDEN_STYLE,
110
+ });
111
+ export const TRANSFORM_RESET = Object.freeze({
112
+ transform: [
113
+ { translateX: 0 },
114
+ { translateY: 0 },
115
+ { scale: 1 },
116
+ { scaleX: 1 },
117
+ { scaleY: 1 },
118
+ ],
109
119
  });
110
120
  export const ENTER_RANGE = [0, 1] as const;
111
121
  export const EXIT_RANGE = [1, 2] as const;
@@ -0,0 +1,56 @@
1
+ import {
2
+ cancelAnimation,
3
+ useAnimatedReaction,
4
+ useSharedValue,
5
+ withDelay,
6
+ withTiming,
7
+ } from "react-native-reanimated";
8
+
9
+ const SCROLL_SETTLE_DELAY_MS = 25;
10
+
11
+ interface AnimatedDebounceControls {
12
+ trigger: () => void;
13
+ cancel: () => void;
14
+ }
15
+
16
+ /**
17
+ * Debounces a UI-thread callback using Reanimated timing primitives.
18
+ *
19
+ * Call `trigger()` from a worklet to reset the debounce window. When no new
20
+ * trigger arrives within `delayMs`, `onDebounced` fires once on the UI thread.
21
+ */
22
+ export function useAnimatedDebounce(
23
+ onDebounced: () => void,
24
+ delayMs: number = SCROLL_SETTLE_DELAY_MS,
25
+ ): AnimatedDebounceControls {
26
+ const token = useSharedValue(0);
27
+
28
+ const trigger = () => {
29
+ "worklet";
30
+ cancelAnimation(token);
31
+ token.value = withDelay(
32
+ delayMs,
33
+ withTiming(token.value + 1, { duration: 0 }),
34
+ );
35
+ };
36
+
37
+ const cancel = () => {
38
+ "worklet";
39
+ cancelAnimation(token);
40
+ };
41
+
42
+ useAnimatedReaction(
43
+ () => token.value,
44
+ (nextToken, previousToken) => {
45
+ "worklet";
46
+ if (nextToken === 0 || nextToken === previousToken) {
47
+ return;
48
+ }
49
+
50
+ onDebounced();
51
+ },
52
+ [delayMs, onDebounced],
53
+ );
54
+
55
+ return { trigger, cancel };
56
+ }
@@ -28,6 +28,7 @@ export { snapTo } from "./animation/snap-to";
28
28
  export {
29
29
  NAVIGATION_MASK_CONTAINER_STYLE_ID,
30
30
  NAVIGATION_MASK_ELEMENT_STYLE_ID,
31
+ TRANSFORM_RESET,
31
32
  } from "./constants";
32
33
  export {
33
34
  type ScreenGestureTarget,
@@ -47,6 +48,8 @@ export type {
47
48
  AnimatedViewStyle,
48
49
  AnimationConfig,
49
50
  BoundsNavigationAccessor,
51
+ BoundsNavigationZoomOpacityRange,
52
+ BoundsNavigationZoomOpacityRanges,
50
53
  BoundsNavigationZoomOptions,
51
54
  BoundsNavigationZoomStyle,
52
55
  OverlayProps,
@@ -356,6 +356,7 @@ export const useHandlers = ({
356
356
  lockedSnapPoint.value = resolvedMaxSnapPoint;
357
357
  }
358
358
 
359
+ animations.willAnimate.value = TRUE;
359
360
  gestureAnimationValues.dragging.value = TRUE;
360
361
  gestureAnimationValues.dismissing.value = FALSE;
361
362
  gestureStartProgress.value = animations.progress.value;
@@ -365,6 +366,10 @@ export const useHandlers = ({
365
366
  (event: GestureUpdateEvent<PanGestureHandlerEventPayload>) => {
366
367
  "worklet";
367
368
 
369
+ if (animations.willAnimate.value) {
370
+ animations.willAnimate.value = FALSE;
371
+ }
372
+
368
373
  const { translationX, translationY } = event;
369
374
  const { width, height } = dimensions;
370
375
 
@@ -454,6 +459,8 @@ export const useHandlers = ({
454
459
  (event: GestureStateChangeEvent<PanGestureHandlerEventPayload>) => {
455
460
  "worklet";
456
461
 
462
+ animations.willAnimate.value = FALSE;
463
+
457
464
  if (hasSnapPoints) {
458
465
  const isHorizontal = snapAxis === "horizontal";
459
466
  const axisVelocity = isHorizontal ? event.velocityX : event.velocityY;
@@ -537,6 +544,7 @@ export const useHandlers = ({
537
544
  spec: effectiveSpec,
538
545
  animations,
539
546
  targetProgress: targetProgressValue,
547
+ emitWillAnimate: false,
540
548
  initialVelocity,
541
549
  });
542
550
  } else {
@@ -579,6 +587,7 @@ export const useHandlers = ({
579
587
  spec: transitionSpec,
580
588
  animations,
581
589
  targetProgress: targetProgressValue,
590
+ emitWillAnimate: false,
582
591
  initialVelocity: scaledInitialVelocity,
583
592
  });
584
593
  }
@@ -16,7 +16,7 @@ import useStableCallbackValue from "../hooks/use-stable-callback-value";
16
16
  import { AnimationStore } from "../stores/animation.store";
17
17
  import { BoundStore } from "../stores/bounds";
18
18
  import { applyMeasuredBoundsWrites } from "../stores/bounds/helpers/apply-measured-bounds-writes";
19
- import { prepareStyleForBounds } from "../utils/bounds/helpers/styles";
19
+ import { prepareStyleForBounds } from "../utils/bounds/helpers/styles/styles";
20
20
  import createProvider from "../utils/create-provider";
21
21
  import { useLayoutAnchorContext } from "./layout-anchor.provider";
22
22
  import { useDescriptorDerivations, useDescriptors } from "./screen/descriptors";
@@ -417,6 +417,13 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
417
417
  },
418
418
  );
419
419
 
420
+ /**
421
+ * Legacy bounds registration provider used by transition-aware components.
422
+ *
423
+ * @deprecated Prefer the newer bounds system (`Transition.Boundary`, `bounds()`,
424
+ * and navigation-style bounds helpers) for new code. This provider remains only
425
+ * for backwards compatibility with the older shared-bound-tag registration path.
426
+ */
420
427
  const RegisterBoundsProvider = registerBoundsBundle.RegisterBoundsProvider;
421
428
  useRegisterBoundsContext = registerBoundsBundle.useRegisterBoundsContext;
422
429
 
@@ -12,9 +12,12 @@ import type { BaseStackRoute } from "../../../../types/stack.types";
12
12
 
13
13
  type BuiltState = {
14
14
  progress: SharedValue<number>;
15
+ willAnimate: SharedValue<number>;
15
16
  closing: SharedValue<number>;
16
17
  animating: SharedValue<number>;
17
18
  entering: SharedValue<number>;
19
+ settled: SharedValue<number>;
20
+ logicallySettled: SharedValue<number>;
18
21
  gesture: GestureStoreMap;
19
22
  route: BaseStackRoute;
20
23
  meta?: Record<string, unknown>;
@@ -33,6 +36,16 @@ interface ComputeLogicallySettledParams {
33
36
  dragging: number;
34
37
  }
35
38
 
39
+ const computeSettled = (params: {
40
+ animating: number;
41
+ dismissing: number;
42
+ closing: number;
43
+ }) => {
44
+ "worklet";
45
+ const { animating, dismissing, closing } = params;
46
+ return animating || dismissing || closing ? FALSE : TRUE;
47
+ };
48
+
36
49
  /**
37
50
  * Computes the animated snap index based on progress and snap points.
38
51
  * Returns -1 if no snap points, otherwise interpolates between indices.
@@ -90,6 +103,7 @@ export const hydrateTransitionState = (
90
103
  "worklet";
91
104
  const out = s.unwrapped;
92
105
  out.progress = s.progress.value;
106
+ out.willAnimate = s.willAnimate.value;
93
107
  out.closing = s.closing.value;
94
108
  out.entering = s.entering.value;
95
109
  out.gesture.x = s.gesture.x.value;
@@ -113,7 +127,11 @@ export const hydrateTransitionState = (
113
127
  out.gesture.isDismissing = out.gesture.dismissing;
114
128
  out.gesture.isDragging = out.gesture.dragging;
115
129
 
116
- out.settled = out.animating || out.gesture.dismissing || out.closing ? 0 : 1;
130
+ out.settled = computeSettled({
131
+ animating: out.animating,
132
+ dismissing: out.gesture.dismissing,
133
+ closing: out.closing,
134
+ });
117
135
  out.logicallySettled = computeLogicallySettled({
118
136
  progress: out.progress,
119
137
  targetProgress: s.targetProgress.value,
@@ -121,6 +139,14 @@ export const hydrateTransitionState = (
121
139
  dragging: out.gesture.dragging,
122
140
  });
123
141
 
142
+ if (s.settled.value !== out.settled) {
143
+ s.settled.value = out.settled;
144
+ }
145
+
146
+ if (s.logicallySettled.value !== out.logicallySettled) {
147
+ s.logicallySettled.value = out.logicallySettled;
148
+ }
149
+
124
150
  out.meta = s.meta;
125
151
  out.layouts.screen.width = dimensions.width;
126
152
  out.layouts.screen.height = dimensions.height;
@@ -17,9 +17,12 @@ import { toPlainRoute, toPlainValue } from "./worklet";
17
17
 
18
18
  type BuiltState = {
19
19
  progress: SharedValue<number>;
20
+ willAnimate: SharedValue<number>;
20
21
  closing: SharedValue<number>;
21
22
  animating: SharedValue<number>;
22
23
  entering: SharedValue<number>;
24
+ settled: SharedValue<number>;
25
+ logicallySettled: SharedValue<number>;
23
26
  gesture: GestureStoreMap;
24
27
  route: BaseStackRoute;
25
28
  meta?: Record<string, unknown>;
@@ -60,9 +63,12 @@ export const useBuildTransitionState = (
60
63
 
61
64
  return {
62
65
  progress: AnimationStore.getValue(key, "progress"),
66
+ willAnimate: AnimationStore.getValue(key, "willAnimate"),
63
67
  closing: AnimationStore.getValue(key, "closing"),
64
68
  entering: AnimationStore.getValue(key, "entering"),
65
69
  animating: AnimationStore.getValue(key, "animating"),
70
+ settled: AnimationStore.getValue(key, "settled"),
71
+ logicallySettled: AnimationStore.getValue(key, "logicallySettled"),
66
72
  targetProgress: SystemStore.getValue(key, "targetProgress"),
67
73
  resolvedAutoSnapPoint: SystemStore.getValue(key, "resolvedAutoSnapPoint"),
68
74
  measuredContentLayout: SystemStore.getValue(key, "measuredContentLayout"),
@@ -44,9 +44,6 @@ export const {
44
44
 
45
45
  const isGesturingDuringCloseAnimation = useSharedValue(false);
46
46
  const hasWarnedLegacy = useSharedValue(false);
47
- const previousLayerStyleKeysBySlot = useSharedValue<
48
- Record<string, StyleKeySet>
49
- >({});
50
47
  const previousElementStyleKeysBySlot = useSharedValue<
51
48
  Record<string, StyleKeySet>
52
49
  >({});
@@ -134,15 +131,7 @@ export const {
134
131
  const layerStylesMap =
135
132
  useDerivedValue<NormalizedTransitionInterpolatedStyle>(() => {
136
133
  "worklet";
137
- const { resolvedStylesMap, nextPreviousStyleKeysBySlot } =
138
- buildResolvedStyleMap({
139
- currentStylesMap: rawStyleResolution.value.layerStylesMap,
140
- fallbackStylesMap: NO_STYLES,
141
- previousStyleKeysBySlot: previousLayerStyleKeysBySlot.value,
142
- });
143
-
144
- previousLayerStyleKeysBySlot.value = nextPreviousStyleKeysBySlot;
145
- return resolvedStylesMap;
134
+ return rawStyleResolution.value.layerStylesMap;
146
135
  });
147
136
 
148
137
  const elementStylesMap =
@@ -7,31 +7,40 @@ import { createStore } from "../utils/create-store";
7
7
 
8
8
  export type AnimationStoreMap = {
9
9
  progress: SharedValue<number>;
10
+ willAnimate: SharedValue<number>;
10
11
  animating: SharedValue<number>;
11
12
  closing: SharedValue<number>;
12
13
  entering: SharedValue<number>;
14
+ settled: SharedValue<number>;
15
+ logicallySettled: SharedValue<number>;
13
16
  };
14
17
 
15
18
  function createAnimationBag(): AnimationStoreMap {
16
19
  return {
17
20
  progress: makeMutable(0),
21
+ willAnimate: makeMutable(0),
18
22
  closing: makeMutable(0),
19
23
  animating: makeMutable(0),
20
24
  entering: makeMutable(0),
25
+ settled: makeMutable(1),
26
+ logicallySettled: makeMutable(1),
21
27
  };
22
28
  }
23
29
 
24
30
  /**
25
31
  * Route-keyed screen transition state for the public animation lifecycle. These
26
- * shared values track the current progress and whether a screen is entering,
27
- * closing, or actively animating.
32
+ * shared values track the current progress, whether a transition is about to
33
+ * begin, and whether a screen is entering, closing, or actively animating.
28
34
  */
29
35
  export const AnimationStore = createStore<AnimationStoreMap>({
30
36
  createBag: createAnimationBag,
31
37
  disposeBag: (bag) => {
32
38
  cancelAnimation(bag.progress);
39
+ cancelAnimation(bag.willAnimate);
33
40
  cancelAnimation(bag.animating);
34
41
  cancelAnimation(bag.closing);
35
42
  cancelAnimation(bag.entering);
43
+ cancelAnimation(bag.settled);
44
+ cancelAnimation(bag.logicallySettled);
36
45
  },
37
46
  });