react-native-screen-transitions 3.6.0-alpha.1 → 3.6.0-alpha.2

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 (433) hide show
  1. package/lib/commonjs/component-stack/components/component-screen.js +1 -7
  2. package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
  3. package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  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/hooks/use-boundary-presence.js +4 -4
  6. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  7. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +17 -19
  8. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  9. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +27 -7
  10. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +23 -51
  12. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  13. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  14. package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  15. package/lib/commonjs/shared/components/create-boundary-component/index.js +3 -1
  16. package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
  17. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +75 -0
  18. package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  19. package/lib/commonjs/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +15 -2
  20. package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  21. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +103 -0
  22. package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  23. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +52 -0
  24. package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  25. package/lib/commonjs/shared/components/native-screen.js +2 -13
  26. package/lib/commonjs/shared/components/native-screen.js.map +1 -1
  27. package/lib/commonjs/shared/constants.js +2 -7
  28. package/lib/commonjs/shared/constants.js.map +1 -1
  29. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +35 -0
  30. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  31. package/lib/commonjs/shared/providers/register-bounds.provider.js +48 -55
  32. package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
  33. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  34. package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  35. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -6
  36. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  37. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  38. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  39. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  40. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +9 -2
  41. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  42. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js +19 -0
  43. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  44. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  45. package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  46. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +2 -2
  47. package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  48. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js +2 -2
  49. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  50. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  51. package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  52. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +2 -2
  53. package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  54. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +18 -2
  55. package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  56. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +1 -5
  57. package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  58. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  59. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  60. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +125 -0
  61. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  62. package/lib/commonjs/shared/stores/bounds/index.js +6 -12
  63. package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
  64. package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -21
  65. package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
  66. package/lib/commonjs/shared/stores/bounds/internals/entries.js +49 -9
  67. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  68. package/lib/commonjs/shared/stores/bounds/internals/links.js +143 -82
  69. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  70. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +17 -43
  71. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  72. package/lib/commonjs/shared/stores/bounds/internals/state.js +26 -3
  73. package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
  74. package/lib/commonjs/shared/stores/gesture.store.js +2 -0
  75. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  76. package/lib/commonjs/shared/types/gesture.types.js +2 -2
  77. package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
  78. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  79. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  80. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  81. package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  83. package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +23 -0
  85. package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  86. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +91 -199
  87. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  88. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +15 -2
  89. package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  90. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +155 -14
  91. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  92. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  93. package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  94. package/lib/module/component-stack/components/component-screen.js +2 -8
  95. package/lib/module/component-stack/components/component-screen.js.map +1 -1
  96. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +27 -34
  97. package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
  98. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
  99. package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
  100. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +18 -20
  101. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
  102. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +28 -8
  103. package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
  104. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +22 -50
  105. package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
  106. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
  107. package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
  108. package/lib/module/shared/components/create-boundary-component/index.js +3 -1
  109. package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
  110. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +70 -0
  111. package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
  112. package/lib/module/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +13 -1
  113. package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
  114. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +98 -0
  115. package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
  116. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +47 -0
  117. package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
  118. package/lib/module/shared/components/native-screen.js +3 -14
  119. package/lib/module/shared/components/native-screen.js.map +1 -1
  120. package/lib/module/shared/constants.js +1 -6
  121. package/lib/module/shared/constants.js.map +1 -1
  122. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +30 -0
  123. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
  124. package/lib/module/shared/providers/register-bounds.provider.js +48 -55
  125. package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
  126. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
  127. package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
  128. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -1
  129. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  130. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  131. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
  132. package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
  133. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +10 -3
  134. package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
  135. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js +20 -1
  136. package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
  137. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
  138. package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
  139. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +3 -3
  140. package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
  141. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js +3 -3
  142. package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
  143. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
  144. package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
  145. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +3 -3
  146. package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
  147. package/lib/module/shared/providers/screen/gestures/shared/physics.js +15 -0
  148. package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
  149. package/lib/module/shared/providers/screen/gestures/shared/policy.js +3 -3
  150. package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
  151. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
  152. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  153. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +105 -0
  154. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
  155. package/lib/module/shared/stores/bounds/index.js +7 -13
  156. package/lib/module/shared/stores/bounds/index.js.map +1 -1
  157. package/lib/module/shared/stores/bounds/internals/clear.js +14 -22
  158. package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
  159. package/lib/module/shared/stores/bounds/internals/entries.js +49 -9
  160. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  161. package/lib/module/shared/stores/bounds/internals/links.js +139 -80
  162. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  163. package/lib/module/shared/stores/bounds/internals/resolver.js +17 -43
  164. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  165. package/lib/module/shared/stores/bounds/internals/state.js +25 -2
  166. package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
  167. package/lib/module/shared/stores/gesture.store.js +2 -0
  168. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  169. package/lib/module/shared/types/animation.types.js +0 -4
  170. package/lib/module/shared/types/animation.types.js.map +1 -1
  171. package/lib/module/shared/types/gesture.types.js +0 -1
  172. package/lib/module/shared/types/gesture.types.js.map +1 -1
  173. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
  174. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  175. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
  176. package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
  177. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
  178. package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
  179. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +18 -0
  180. package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
  181. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +90 -198
  182. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  183. package/lib/module/shared/utils/bounds/navigation/reveal/config.js +14 -1
  184. package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
  185. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +144 -12
  186. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  187. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
  188. package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
  189. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  190. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +1 -0
  191. package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
  192. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts +1 -1
  193. package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
  194. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts +5 -4
  195. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
  196. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts +6 -2
  197. package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +1 -1
  198. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts +5 -4
  199. package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
  200. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +7 -7
  201. package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
  202. package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
  203. package/lib/typescript/shared/components/create-boundary-component/types.d.ts +11 -7
  204. package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
  205. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts +10 -0
  206. package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +1 -0
  207. package/lib/typescript/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.d.ts → utils/measured-bounds.d.ts} +3 -2
  208. package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -0
  209. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts +22 -0
  210. package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts +16 -0
  212. package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
  214. package/lib/typescript/shared/constants.d.ts +0 -5
  215. package/lib/typescript/shared/constants.d.ts.map +1 -1
  216. package/lib/typescript/shared/index.d.ts +1 -1
  217. package/lib/typescript/shared/index.d.ts.map +1 -1
  218. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +21 -0
  219. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -0
  220. package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
  221. package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
  222. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts +0 -1
  223. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  224. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -1
  225. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  226. package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +1 -1
  227. package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
  228. package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +1 -1
  229. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts +2 -1
  230. package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +1 -1
  231. package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
  232. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +1 -1
  233. package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
  235. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +7 -0
  236. package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
  237. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +0 -10
  238. package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
  239. package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
  240. package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  242. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +18 -0
  243. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -0
  244. package/lib/typescript/shared/stores/bounds/index.d.ts +6 -12
  245. package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
  247. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  248. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +13 -10
  249. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  250. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  251. package/lib/typescript/shared/stores/bounds/internals/state.d.ts +26 -5
  252. package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
  253. package/lib/typescript/shared/stores/bounds/types.d.ts +14 -7
  254. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  255. package/lib/typescript/shared/stores/gesture.store.d.ts +1 -0
  256. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  257. package/lib/typescript/shared/types/animation.types.d.ts +0 -18
  258. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  259. package/lib/typescript/shared/types/gesture.types.d.ts +8 -1
  260. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  261. package/lib/typescript/shared/types/index.d.ts +1 -1
  262. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  263. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  264. package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
  265. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
  266. package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
  267. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts +4 -0
  268. package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -0
  269. package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  270. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +14 -1
  271. package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
  272. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +48 -7
  273. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  274. package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -3
  275. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  276. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +3 -2
  277. package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
  278. package/package.json +1 -1
  279. package/src/component-stack/components/component-screen.tsx +3 -11
  280. package/src/shared/components/create-boundary-component/create-boundary-component.tsx +30 -27
  281. package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +5 -5
  282. package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +25 -24
  283. package/src/shared/components/create-boundary-component/hooks/use-initial-source-measurement.ts +41 -11
  284. package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +49 -64
  285. package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +44 -83
  286. package/src/shared/components/create-boundary-component/index.tsx +3 -1
  287. package/src/shared/components/create-boundary-component/types.ts +13 -11
  288. package/src/shared/components/create-boundary-component/utils/destination-signals.ts +129 -0
  289. package/src/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.ts → utils/measured-bounds.ts} +25 -1
  290. package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +164 -0
  291. package/src/shared/components/create-boundary-component/utils/source-signals.ts +72 -0
  292. package/src/shared/components/native-screen.tsx +3 -12
  293. package/src/shared/constants.ts +1 -6
  294. package/src/shared/index.ts +0 -3
  295. package/src/shared/providers/helpers/measured-bounds-writes.ts +67 -0
  296. package/src/shared/providers/register-bounds.provider.tsx +68 -91
  297. package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +0 -14
  298. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +1 -2
  299. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -4
  300. package/src/shared/providers/screen/gestures/pan/pan-activation.ts +4 -1
  301. package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +18 -2
  302. package/src/shared/providers/screen/gestures/pan/pan-release.ts +33 -0
  303. package/src/shared/providers/screen/gestures/pan/pan-reset.ts +3 -0
  304. package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +9 -6
  305. package/src/shared/providers/screen/gestures/pinch/pinch-activation.ts +5 -2
  306. package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +1 -0
  307. package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +9 -6
  308. package/src/shared/providers/screen/gestures/shared/physics.ts +25 -0
  309. package/src/shared/providers/screen/gestures/shared/policy.ts +3 -5
  310. package/src/shared/providers/screen/gestures/types.ts +2 -0
  311. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +0 -3
  312. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +161 -0
  313. package/src/shared/stores/bounds/index.ts +10 -20
  314. package/src/shared/stores/bounds/internals/clear.ts +17 -41
  315. package/src/shared/stores/bounds/internals/entries.ts +56 -13
  316. package/src/shared/stores/bounds/internals/links.ts +222 -113
  317. package/src/shared/stores/bounds/internals/resolver.ts +23 -87
  318. package/src/shared/stores/bounds/internals/state.ts +27 -5
  319. package/src/shared/stores/bounds/types.ts +17 -7
  320. package/src/shared/stores/gesture.store.ts +3 -0
  321. package/src/shared/types/animation.types.ts +0 -23
  322. package/src/shared/types/gesture.types.ts +8 -2
  323. package/src/shared/types/index.ts +0 -4
  324. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +1 -0
  325. package/src/shared/utils/bounds/helpers/create-link-accessor.ts +6 -6
  326. package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +20 -11
  327. package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +22 -0
  328. package/src/shared/utils/bounds/navigation/reveal/build.ts +153 -297
  329. package/src/shared/utils/bounds/navigation/reveal/config.ts +20 -1
  330. package/src/shared/utils/bounds/navigation/reveal/math.ts +234 -18
  331. package/src/shared/utils/bounds/types/options.ts +2 -3
  332. package/src/shared/utils/navigation/resolve-scene-neighbors.ts +36 -23
  333. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -43
  334. package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  335. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -17
  336. package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  337. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -28
  338. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  339. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -75
  340. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  341. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -20
  342. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  343. package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  344. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -16
  345. package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  346. package/lib/commonjs/shared/providers/layout-anchor.provider.js +0 -86
  347. package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +0 -1
  348. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js +0 -49
  349. package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  350. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js +0 -25
  351. package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  352. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js +0 -30
  353. package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  354. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js +0 -79
  355. package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  356. package/lib/commonjs/shared/stores/bounds/helpers/matching.js +0 -13
  357. package/lib/commonjs/shared/stores/bounds/helpers/matching.js.map +0 -1
  358. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js +0 -30
  359. package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  360. package/lib/commonjs/shared/stores/bounds/internals/groups.js +0 -102
  361. package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +0 -1
  362. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -38
  363. package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
  364. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -12
  365. package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
  366. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -23
  367. package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
  368. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -68
  369. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
  370. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -15
  371. package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
  372. package/lib/module/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
  373. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -12
  374. package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
  375. package/lib/module/shared/providers/layout-anchor.provider.js +0 -80
  376. package/lib/module/shared/providers/layout-anchor.provider.js.map +0 -1
  377. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js +0 -42
  378. package/lib/module/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
  379. package/lib/module/shared/stores/bounds/helpers/find-latest.js +0 -19
  380. package/lib/module/shared/stores/bounds/helpers/find-latest.js.map +0 -1
  381. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js +0 -23
  382. package/lib/module/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
  383. package/lib/module/shared/stores/bounds/helpers/link.helpers.js +0 -69
  384. package/lib/module/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
  385. package/lib/module/shared/stores/bounds/helpers/matching.js +0 -9
  386. package/lib/module/shared/stores/bounds/helpers/matching.js.map +0 -1
  387. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js +0 -24
  388. package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
  389. package/lib/module/shared/stores/bounds/internals/groups.js +0 -95
  390. package/lib/module/shared/stores/bounds/internals/groups.js.map +0 -1
  391. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts +0 -15
  392. package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts.map +0 -1
  393. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts +0 -2
  394. package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +0 -1
  395. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts +0 -22
  396. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts.map +0 -1
  397. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +0 -29
  398. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +0 -1
  399. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +0 -3
  400. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +0 -1
  401. package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.d.ts.map +0 -1
  402. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -8
  403. package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +0 -1
  404. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +0 -39
  405. package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +0 -1
  406. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts +0 -5
  407. package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts.map +0 -1
  408. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts +0 -3
  409. package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts.map +0 -1
  410. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts +0 -10
  411. package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts.map +0 -1
  412. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts +0 -14
  413. package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts.map +0 -1
  414. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts +0 -3
  415. package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts.map +0 -1
  416. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts +0 -5
  417. package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts.map +0 -1
  418. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +0 -16
  419. package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +0 -1
  420. package/src/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.ts +0 -83
  421. package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +0 -20
  422. package/src/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.ts +0 -48
  423. package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +0 -101
  424. package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +0 -25
  425. package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +0 -14
  426. package/src/shared/providers/layout-anchor.provider.tsx +0 -112
  427. package/src/shared/stores/bounds/helpers/entries.helpers.ts +0 -55
  428. package/src/shared/stores/bounds/helpers/find-latest.ts +0 -22
  429. package/src/shared/stores/bounds/helpers/groups.helpers.ts +0 -27
  430. package/src/shared/stores/bounds/helpers/link.helpers.ts +0 -131
  431. package/src/shared/stores/bounds/helpers/matching.ts +0 -11
  432. package/src/shared/stores/bounds/helpers/tag-state.helpers.ts +0 -24
  433. package/src/shared/stores/bounds/internals/groups.ts +0 -116
@@ -0,0 +1,164 @@
1
+ import {
2
+ createPendingPairKey,
3
+ createScreenPairKey,
4
+ getDestinationScreenKeyFromPairKey,
5
+ } from "../../../stores/bounds/helpers/link-pairs.helpers";
6
+ import type {
7
+ LinkPairsState,
8
+ ScreenPairKey,
9
+ } from "../../../stores/bounds/types";
10
+ import type { MeasureTarget } from "../types";
11
+
12
+ const SOURCE_SIGNAL_PREFIX = "source|";
13
+ const DESTINATION_SIGNAL_PREFIX = "destination|";
14
+
15
+ type RefreshBoundarySignal = MeasureTarget & {
16
+ signal: string;
17
+ };
18
+
19
+ const findNestedDestinationPairKey = (
20
+ linkState: LinkPairsState | undefined,
21
+ linkId: string,
22
+ ancestorScreenKeys: readonly string[] | undefined,
23
+ ): ScreenPairKey | null => {
24
+ "worklet";
25
+ const destinationScreenKey = ancestorScreenKeys?.[0];
26
+ if (!linkState || !destinationScreenKey) return null;
27
+
28
+ for (const pairKey in linkState) {
29
+ if (getDestinationScreenKeyFromPairKey(pairKey) !== destinationScreenKey) {
30
+ continue;
31
+ }
32
+
33
+ if (linkState[pairKey]?.links?.[linkId]?.destination) {
34
+ return pairKey;
35
+ }
36
+ }
37
+
38
+ return null;
39
+ };
40
+
41
+ const buildRefreshSignal = (
42
+ type: MeasureTarget["type"],
43
+ pairKey: ScreenPairKey,
44
+ key: string,
45
+ ): RefreshBoundarySignal => {
46
+ "worklet";
47
+ const prefix =
48
+ type === "source" ? SOURCE_SIGNAL_PREFIX : DESTINATION_SIGNAL_PREFIX;
49
+ return {
50
+ type,
51
+ pairKey,
52
+ signal: `${prefix}${pairKey}|${key}`,
53
+ };
54
+ };
55
+
56
+ export const getRefreshBoundarySignal = (params: {
57
+ enabled: boolean;
58
+ currentScreenKey: string;
59
+ preferredSourceScreenKey?: string;
60
+ nextScreenKey?: string;
61
+ linkId: string;
62
+ group?: string;
63
+ ancestorScreenKeys?: readonly string[];
64
+ shouldRefresh: boolean;
65
+ closing: boolean;
66
+ entering: boolean;
67
+ animating: boolean;
68
+ progress: number;
69
+ linkState?: LinkPairsState;
70
+ }): RefreshBoundarySignal | null => {
71
+ "worklet";
72
+ const {
73
+ enabled,
74
+ currentScreenKey,
75
+ preferredSourceScreenKey,
76
+ nextScreenKey,
77
+ linkId,
78
+ group,
79
+ ancestorScreenKeys,
80
+ shouldRefresh,
81
+ closing,
82
+ entering,
83
+ animating,
84
+ progress,
85
+ linkState,
86
+ } = params;
87
+
88
+ if (!enabled) return null;
89
+
90
+ const canRefreshPreCloseDestination =
91
+ shouldRefresh && closing && !entering && !animating && progress >= 1;
92
+ const canRefreshSettledDestination = shouldRefresh && !closing && !entering;
93
+
94
+ if (!canRefreshPreCloseDestination && !canRefreshSettledDestination) {
95
+ return null;
96
+ }
97
+
98
+ // Non-group refresh only rewrites destination bounds. Source refresh is a
99
+ // grouped-only fallback for active ids that do not have source bounds yet.
100
+ if (!group) {
101
+ if (nextScreenKey) {
102
+ return null;
103
+ }
104
+
105
+ // Nested initial screens have no previous screen in their own navigator,
106
+ // so recover the pair by looking for a destination on the ancestor route.
107
+ const pairKey = preferredSourceScreenKey
108
+ ? createScreenPairKey(preferredSourceScreenKey, currentScreenKey)
109
+ : findNestedDestinationPairKey(linkState, linkId, ancestorScreenKeys);
110
+
111
+ if (!pairKey) return null;
112
+
113
+ return buildRefreshSignal(
114
+ "destination",
115
+ pairKey,
116
+ [currentScreenKey, closing ? "closing" : "settled"].join("|"),
117
+ );
118
+ }
119
+
120
+ // Source-side grouped refresh: a new active id may not have source bounds yet,
121
+ // so the next screen's lifecycle pulse gives that source one chance to capture.
122
+ if (nextScreenKey) {
123
+ const pairKey = createScreenPairKey(currentScreenKey, nextScreenKey);
124
+ const pendingPairKey = createPendingPairKey(currentScreenKey);
125
+ const activeId = linkState?.[pairKey]?.groups?.[group]?.activeId;
126
+ const hasSource =
127
+ !!linkState?.[pairKey]?.links?.[linkId]?.source ||
128
+ !!linkState?.[pendingPairKey]?.links?.[linkId]?.source;
129
+
130
+ if (activeId !== linkId || hasSource) {
131
+ return null;
132
+ }
133
+
134
+ return buildRefreshSignal(
135
+ "source",
136
+ pairKey,
137
+ [group, linkId, closing ? "closing" : "settled"].join("|"),
138
+ );
139
+ }
140
+
141
+ if (!preferredSourceScreenKey) return null;
142
+
143
+ // Destination-side grouped refresh: only the active member rewrites the
144
+ // destination side, keeping inactive grouped members from stealing the link.
145
+ const pairKey = createScreenPairKey(
146
+ preferredSourceScreenKey,
147
+ currentScreenKey,
148
+ );
149
+ const activeId = linkState?.[pairKey]?.groups?.[group]?.activeId;
150
+ const hasSource = !!linkState?.[pairKey]?.links?.[linkId]?.source;
151
+ const hasDestination = !!linkState?.[pairKey]?.links?.[linkId]?.destination;
152
+
153
+ // Destination retargeting should only measure a concrete member that already
154
+ // participates in the pair. Missing members fall back to initialId at resolve.
155
+ if (activeId !== linkId || (!hasSource && !hasDestination)) {
156
+ return null;
157
+ }
158
+
159
+ return buildRefreshSignal(
160
+ "destination",
161
+ pairKey,
162
+ [group, linkId, closing ? "closing" : "settled"].join("|"),
163
+ );
164
+ };
@@ -0,0 +1,72 @@
1
+ import { createScreenPairKey } from "../../../stores/bounds/helpers/link-pairs.helpers";
2
+ import type {
3
+ LinkPairsState,
4
+ ScreenPairKey,
5
+ } from "../../../stores/bounds/types";
6
+
7
+ const SOURCE_SIGNAL_PREFIX = "source|";
8
+
9
+ type SourceCaptureSignal = {
10
+ pairKey: ScreenPairKey;
11
+ signal: string;
12
+ };
13
+
14
+ const buildSourceSignal = (
15
+ pairKey: ScreenPairKey,
16
+ key: string,
17
+ ): SourceCaptureSignal => {
18
+ "worklet";
19
+ return {
20
+ pairKey,
21
+ signal: `${SOURCE_SIGNAL_PREFIX}${pairKey}|${key}`,
22
+ };
23
+ };
24
+
25
+ export const getInitialSourceCaptureSignal = (params: {
26
+ enabled: boolean;
27
+ nextScreenKey?: string;
28
+ currentScreenKey?: string;
29
+ linkId: string;
30
+ group?: string;
31
+ shouldAutoMeasure: boolean;
32
+ linkState?: LinkPairsState;
33
+ }): SourceCaptureSignal | null => {
34
+ "worklet";
35
+ const {
36
+ enabled,
37
+ nextScreenKey,
38
+ currentScreenKey,
39
+ linkId,
40
+ group,
41
+ shouldAutoMeasure,
42
+ linkState,
43
+ } = params;
44
+
45
+ if (!enabled || !nextScreenKey || !currentScreenKey) {
46
+ return null;
47
+ }
48
+
49
+ // Trigger components capture on press. This passive path is for Boundary.View
50
+ // slots that need a source before navigation starts.
51
+ if (!shouldAutoMeasure) {
52
+ return null;
53
+ }
54
+
55
+ const pairKey = createScreenPairKey(currentScreenKey, nextScreenKey);
56
+
57
+ if (group) {
58
+ const activeId = linkState?.[pairKey]?.groups?.[group]?.activeId;
59
+
60
+ // Passive grouped sources should not measure every mounted item. Once a
61
+ // group has an active id, only that concrete member can auto-capture.
62
+ if (activeId && activeId !== linkId) {
63
+ return null;
64
+ }
65
+ }
66
+
67
+ const signalParts = group
68
+ ? [currentScreenKey, nextScreenKey, group, linkId]
69
+ : [currentScreenKey, nextScreenKey, linkId];
70
+
71
+ return buildSourceSignal(pairKey, signalParts.join("|"));
72
+ };
@@ -1,17 +1,15 @@
1
1
  import type * as React from "react";
2
- import { StyleSheet, type View } from "react-native";
2
+ import { StyleSheet } from "react-native";
3
3
  import Animated, {
4
4
  Extrapolation,
5
5
  interpolate,
6
6
  useAnimatedProps,
7
- useAnimatedRef,
8
7
  useDerivedValue,
9
8
  useSharedValue,
10
9
  } from "react-native-reanimated";
11
10
  import { Screen as RNSScreen } from "react-native-screens";
12
11
  import { EPSILON } from "../constants";
13
12
  import { useStack } from "../hooks/navigation/use-stack";
14
- import { LayoutAnchorProvider } from "../providers/layout-anchor.provider";
15
13
  import { useManagedStackContext } from "../providers/stack/managed.provider";
16
14
  import { AnimationStore } from "../stores/animation.store";
17
15
 
@@ -54,7 +52,6 @@ export const NativeScreen = ({
54
52
  const routesLength = routes.length;
55
53
  const topIndex = routesLength - 1;
56
54
  const topRouteKey = routes[topIndex]?.key ?? routeKey;
57
- const screenRef = useAnimatedRef<View>();
58
55
 
59
56
  const sceneClosing = AnimationStore.getValue(routeKey, "closing");
60
57
  const topSceneProgress = AnimationStore.getValue(topRouteKey, "progress");
@@ -155,16 +152,13 @@ export const NativeScreen = ({
155
152
  if (DISABLE_NATIVE_SCREENS) {
156
153
  return (
157
154
  <Animated.View
158
- ref={screenRef}
159
155
  // Keep a native boundary per screen when falling back to plain views.
160
156
  // Android release builds can otherwise flatten sibling screens together.
161
157
  collapsable={false}
162
158
  style={StyleSheet.absoluteFill}
163
159
  animatedProps={animatedProps}
164
160
  >
165
- <LayoutAnchorProvider anchorRef={screenRef}>
166
- {children}
167
- </LayoutAnchorProvider>
161
+ {children}
168
162
  </Animated.View>
169
163
  );
170
164
  }
@@ -172,14 +166,11 @@ export const NativeScreen = ({
172
166
  return (
173
167
  <AnimatedNativeScreen
174
168
  enabled
175
- ref={screenRef}
176
169
  style={StyleSheet.absoluteFill}
177
170
  freezeOnBlur={freezeOnBlur}
178
171
  animatedProps={animatedProps}
179
172
  >
180
- <LayoutAnchorProvider anchorRef={screenRef}>
181
- {children}
182
- </LayoutAnchorProvider>
173
+ {children}
183
174
  </AnimatedNativeScreen>
184
175
  );
185
176
  };
@@ -48,6 +48,7 @@ const DEFAULT_RAW_GESTURE_VALUES = {
48
48
 
49
49
  const DEFAULT_GESTURE_VALUES = {
50
50
  ...DEFAULT_RAW_GESTURE_VALUES,
51
+ velocity: 0,
51
52
  focalX: 0,
52
53
  focalY: 0,
53
54
  raw: DEFAULT_RAW_GESTURE_VALUES,
@@ -180,12 +181,6 @@ export const FALSE = 0;
180
181
  */
181
182
  export const EPSILON = 1e-5;
182
183
 
183
- /**
184
- * Threshold for snapping animations to target when "close enough" (1% of range).
185
- * Prevents micro-jitter/oscillation near animation endpoints.
186
- */
187
- export const ANIMATION_SNAP_THRESHOLD = 0.01;
188
-
189
184
  /**
190
185
  * Number of consecutive frames progress must remain near its target before it
191
186
  * is treated as logically settled.
@@ -56,10 +56,7 @@ export type {
56
56
  OverlayProps,
57
57
  ScreenInterpolationProps,
58
58
  ScreenStyleInterpolator,
59
- ScreenTransitionAccessor,
60
59
  ScreenTransitionConfig,
61
- ScreenTransitionDepthTarget,
62
- ScreenTransitionTarget,
63
60
  TransitionInterpolatedStyle,
64
61
  TransitionSlotStyle,
65
62
  TransitionSpec,
@@ -0,0 +1,67 @@
1
+ import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
2
+ import { setEntry } from "../../stores/bounds/internals/entries";
3
+ import { setDestination, setSource } from "../../stores/bounds/internals/links";
4
+ import type { ScreenPairKey } from "../../stores/bounds/types";
5
+
6
+ type LinkWrite =
7
+ | {
8
+ type: "source";
9
+ pairKey: ScreenPairKey;
10
+ }
11
+ | {
12
+ type: "destination";
13
+ pairKey: ScreenPairKey;
14
+ };
15
+
16
+ type ApplyMeasuredBoundsWritesParams = {
17
+ entryTag: string;
18
+ linkId: string;
19
+ group?: string;
20
+ currentScreenKey: string;
21
+ measured: MeasuredDimensions;
22
+ preparedStyles: StyleProps;
23
+ linkWrite?: LinkWrite;
24
+ };
25
+
26
+ export const applyMeasuredBoundsWrites = (
27
+ params: ApplyMeasuredBoundsWritesParams,
28
+ ) => {
29
+ "worklet";
30
+ const {
31
+ entryTag,
32
+ linkId,
33
+ group,
34
+ currentScreenKey,
35
+ measured,
36
+ preparedStyles,
37
+ linkWrite,
38
+ } = params;
39
+
40
+ // Set the bounds entry on every measure to avoid any stale measurements
41
+ // for the public read API.
42
+ setEntry(entryTag, currentScreenKey, {
43
+ bounds: measured,
44
+ });
45
+
46
+ if (linkWrite?.type === "source") {
47
+ setSource(
48
+ linkWrite.pairKey,
49
+ linkId,
50
+ currentScreenKey,
51
+ measured,
52
+ preparedStyles,
53
+ group,
54
+ );
55
+ }
56
+
57
+ if (linkWrite?.type === "destination") {
58
+ setDestination(
59
+ linkWrite.pairKey,
60
+ linkId,
61
+ currentScreenKey,
62
+ measured,
63
+ preparedStyles,
64
+ group,
65
+ );
66
+ }
67
+ };
@@ -11,25 +11,24 @@ import {
11
11
  useSharedValue,
12
12
  } from "react-native-reanimated";
13
13
  import type { SharedValue } from "react-native-reanimated/lib/typescript/commonTypes";
14
- import { applyMeasuredBoundsWrites } from "../components/create-boundary-component/helpers/apply-measured-bounds-writes";
15
14
  import useStableCallback from "../hooks/use-stable-callback";
16
15
  import useStableCallbackValue from "../hooks/use-stable-callback-value";
17
16
  import { AnimationStore } from "../stores/animation.store";
18
- import { getEntry } from "../stores/bounds/internals/entries";
19
17
  import {
20
- getPendingLink,
21
- hasDestinationLink,
22
- hasSourceLink,
23
- } from "../stores/bounds/internals/links";
18
+ createPendingPairKey,
19
+ createScreenPairKey,
20
+ } from "../stores/bounds/helpers/link-pairs.helpers";
21
+ import { getEntry } from "../stores/bounds/internals/entries";
22
+ import { getDestination, getSource } from "../stores/bounds/internals/links";
24
23
  import { prepareStyleForBounds } from "../utils/bounds/helpers/styles/styles";
25
24
  import createProvider from "../utils/create-provider";
25
+ import { applyMeasuredBoundsWrites } from "./helpers/measured-bounds-writes";
26
26
  import { useDescriptorDerivations, useDescriptors } from "./screen/descriptors";
27
27
 
28
28
  interface MaybeMeasureAndStoreParams {
29
29
  onPress?: ((...args: unknown[]) => void) | undefined;
30
30
  shouldSetSource?: boolean;
31
31
  shouldSetDestination?: boolean;
32
- shouldUpdateSource?: boolean;
33
32
  }
34
33
 
35
34
  interface RegisterBoundsRenderProps {
@@ -208,48 +207,14 @@ const useParentSyncReaction = (params: {
208
207
  );
209
208
  };
210
209
 
211
- const CloseRemeasureReactionEffect = (params: {
212
- sharedBoundTag: string;
213
- remeasureOnFocus: boolean;
214
- nextClosing: SharedValue<number>;
215
- maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
216
- }) => {
217
- const {
218
- sharedBoundTag,
219
- remeasureOnFocus,
220
- nextClosing,
221
- maybeMeasureAndStore,
222
- } = params;
223
-
224
- useAnimatedReaction(
225
- () => nextClosing.get(),
226
- (closing, prevClosing) => {
227
- "worklet";
228
- if (closing === 1 && (prevClosing === 0 || prevClosing === null)) {
229
- maybeMeasureAndStore({ shouldUpdateSource: true });
230
- }
231
- },
232
- [sharedBoundTag, remeasureOnFocus, nextClosing],
233
- );
234
-
235
- return null;
236
- };
237
-
238
210
  let useRegisterBoundsContext: () => RegisterBoundsContextValue | null;
239
211
 
240
212
  const registerBoundsBundle = createProvider("RegisterBounds", {
241
213
  guarded: false,
242
214
  })<RegisterBoundsProviderProps, RegisterBoundsContextValue>(
243
- ({
244
- style,
245
- onPress,
246
- sharedBoundTag,
247
- animatedRef,
248
- remeasureOnFocus,
249
- children,
250
- }) => {
215
+ ({ style, onPress, sharedBoundTag, animatedRef, children }) => {
251
216
  const { current, next } = useDescriptors();
252
- const { ancestorKeys } = useDescriptorDerivations();
217
+ const { ancestorKeys, previousScreenKey } = useDescriptorDerivations();
253
218
  const currentScreenKey = current.route.key;
254
219
  const selectedNextRouteId = getRouteParamId(next?.route);
255
220
 
@@ -277,7 +242,6 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
277
242
  onPress,
278
243
  shouldSetSource,
279
244
  shouldSetDestination,
280
- shouldUpdateSource,
281
245
  }: MaybeMeasureAndStoreParams = {}) => {
282
246
  "worklet";
283
247
  if (!sharedBoundTag) {
@@ -285,15 +249,27 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
285
249
  return;
286
250
  }
287
251
 
252
+ const sourcePairKey = createPendingPairKey(currentScreenKey);
253
+ const destinationPairKey = previousScreenKey
254
+ ? createScreenPairKey(previousScreenKey, currentScreenKey)
255
+ : undefined;
256
+ const pendingSourcePairKey = previousScreenKey
257
+ ? createPendingPairKey(previousScreenKey)
258
+ : undefined;
259
+
288
260
  if (shouldSetSource && isAnimating.get()) {
289
261
  const existing = getEntry(sharedBoundTag, currentScreenKey);
290
262
  if (existing?.bounds) {
291
263
  applyMeasuredBoundsWrites({
292
- sharedBoundTag,
264
+ entryTag: sharedBoundTag,
265
+ linkId: sharedBoundTag,
293
266
  currentScreenKey,
294
267
  measured: existing.bounds,
295
268
  preparedStyles,
296
- shouldSetSource: true,
269
+ linkWrite: {
270
+ type: "source",
271
+ pairKey: sourcePairKey,
272
+ },
297
273
  });
298
274
  }
299
275
 
@@ -301,31 +277,30 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
301
277
  return;
302
278
  }
303
279
 
304
- const hasPending = getPendingLink(sharedBoundTag) !== null;
305
- const hasSource = hasSourceLink(sharedBoundTag, currentScreenKey);
306
- const hasDestination = hasDestinationLink(
307
- sharedBoundTag,
308
- currentScreenKey,
309
- );
280
+ const hasPendingSource = pendingSourcePairKey
281
+ ? getSource(pendingSourcePairKey, sharedBoundTag) !== null
282
+ : false;
283
+ const hasSource =
284
+ getSource(sourcePairKey, sharedBoundTag) !== null ||
285
+ (destinationPairKey
286
+ ? getSource(destinationPairKey, sharedBoundTag) !== null
287
+ : false);
288
+ const hasDestination = destinationPairKey
289
+ ? getDestination(destinationPairKey, sharedBoundTag) !== null
290
+ : false;
310
291
 
311
292
  const wantsSetSource = !!shouldSetSource;
312
293
  const wantsSetDestination = !!shouldSetDestination;
313
- const wantsUpdateSource = !!shouldUpdateSource;
314
- const wantsSnapshotOnly =
315
- !wantsSetSource && !wantsSetDestination && !wantsUpdateSource;
294
+ const wantsSnapshotOnly = !wantsSetSource && !wantsSetDestination;
316
295
 
317
296
  const canSetSource = wantsSetSource;
318
- const canSetDestination = wantsSetDestination && hasPending;
319
- const canUpdateSource = wantsUpdateSource && hasSource;
297
+ const canSetDestination =
298
+ wantsSetDestination && (hasPendingSource || hasSource);
320
299
  const canSnapshotOnly =
321
- wantsSnapshotOnly && (hasPending || hasSource || hasDestination);
322
-
323
- if (
324
- !canSetSource &&
325
- !canSetDestination &&
326
- !canUpdateSource &&
327
- !canSnapshotOnly
328
- ) {
300
+ wantsSnapshotOnly &&
301
+ (hasPendingSource || hasSource || hasDestination);
302
+
303
+ if (!canSetSource && !canSetDestination && !canSnapshotOnly) {
329
304
  if (onPress) runOnJS(onPress)();
330
305
  return;
331
306
  }
@@ -339,15 +314,38 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
339
314
  emitUpdate();
340
315
 
341
316
  applyMeasuredBoundsWrites({
342
- sharedBoundTag,
317
+ entryTag: sharedBoundTag,
318
+ linkId: sharedBoundTag,
343
319
  currentScreenKey,
344
320
  measured,
345
321
  preparedStyles,
346
- shouldSetSource: canSetSource,
347
- shouldUpdateSource: canUpdateSource,
348
- shouldSetDestination: canSetDestination,
322
+ linkWrite: canSetSource
323
+ ? {
324
+ type: "source",
325
+ pairKey: sourcePairKey,
326
+ }
327
+ : canSetDestination && destinationPairKey
328
+ ? {
329
+ type: "destination",
330
+ pairKey: destinationPairKey,
331
+ }
332
+ : undefined,
349
333
  });
350
334
 
335
+ if (canSetSource && canSetDestination && destinationPairKey) {
336
+ applyMeasuredBoundsWrites({
337
+ entryTag: sharedBoundTag,
338
+ linkId: sharedBoundTag,
339
+ currentScreenKey,
340
+ measured,
341
+ preparedStyles,
342
+ linkWrite: {
343
+ type: "destination",
344
+ pairKey: destinationPairKey,
345
+ },
346
+ });
347
+ }
348
+
351
349
  if (onPress) runOnJS(onPress)();
352
350
  },
353
351
  );
@@ -368,15 +366,6 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
368
366
  ancestorKeys,
369
367
  });
370
368
 
371
- // Re-measure source bounds when the destination screen (next in stack)
372
- // starts closing. This fires at the instant the back animation begins,
373
- // unlike useFocusEffect which fires too late (after the screen is removed
374
- // from state).
375
- const nextScreenKey = next?.route.key;
376
- const nextClosing = nextScreenKey
377
- ? AnimationStore.getValue(nextScreenKey, "closing")
378
- : null;
379
-
380
369
  useParentSyncReaction({ parentContext, maybeMeasureAndStore });
381
370
 
382
371
  const captureActiveOnPress = useStableCallback(() => {
@@ -390,19 +379,7 @@ const registerBoundsBundle = createProvider("RegisterBounds", {
390
379
 
391
380
  return {
392
381
  value: { updateSignal },
393
- children: (
394
- <>
395
- {sharedBoundTag && remeasureOnFocus && nextClosing ? (
396
- <CloseRemeasureReactionEffect
397
- sharedBoundTag={sharedBoundTag}
398
- remeasureOnFocus={remeasureOnFocus}
399
- nextClosing={nextClosing}
400
- maybeMeasureAndStore={maybeMeasureAndStore}
401
- />
402
- ) : null}
403
- {children({ handleInitialLayout, captureActiveOnPress })}
404
- </>
405
- ),
382
+ children: <>{children({ handleInitialLayout, captureActiveOnPress })}</>,
406
383
  };
407
384
  },
408
385
  );
@@ -72,20 +72,6 @@ export const createTransitionAccessor = (
72
72
  return {
73
73
  ...frame,
74
74
  bounds: source.boundsAccessor,
75
- transition: (target?: ScreenTransitionTarget) => {
76
- "worklet";
77
- const targetIndex = resolveTargetIndex(
78
- target,
79
- sourceIndex,
80
- currentSources.length,
81
- );
82
-
83
- if (targetIndex === -1) {
84
- return null;
85
- }
86
-
87
- return buildScope(targetIndex);
88
- },
89
75
  };
90
76
  };
91
77
 
@@ -18,8 +18,6 @@ import {
18
18
  } from "./snap-points";
19
19
  import type { BuiltState } from "./types";
20
20
 
21
- export { computeLogicallySettled } from "./settle";
22
-
23
21
  const LOGICAL_SETTLE_STICKY_PROGRESS_THRESHOLD =
24
22
  LOGICAL_SETTLE_PROGRESS_THRESHOLD * 10;
25
23
 
@@ -38,6 +36,7 @@ export const hydrateTransitionState = (
38
36
  out.gesture.y = s.gesture.y.get();
39
37
  out.gesture.normX = s.gesture.normX.get();
40
38
  out.gesture.normY = s.gesture.normY.get();
39
+ out.gesture.velocity = s.gesture.velocity.get();
41
40
  out.gesture.scale = s.gesture.scale.get();
42
41
  out.gesture.normScale = s.gesture.normScale.get();
43
42
  out.gesture.focalX = s.gesture.focalX.get();
@@ -20,10 +20,7 @@ import { hydrateTransitionState } from "./hydrate-transition-state";
20
20
  import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
21
21
  import { useBuildTransitionState } from "./use-build-transition-state";
22
22
 
23
- export type ScreenInterpolatorFrame = Omit<
24
- ScreenInterpolationProps,
25
- "bounds" | "transition"
26
- >;
23
+ export type ScreenInterpolatorFrame = Omit<ScreenInterpolationProps, "bounds">;
27
24
 
28
25
  interface ScreenAnimationPipeline {
29
26
  screenInterpolatorProps: SharedValue<ScreenInterpolatorFrame>;