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
@@ -2,22 +2,24 @@ import { useCallback } from "react";
2
2
  import type { View } from "react-native";
3
3
  import { useWindowDimensions } from "react-native";
4
4
  import type { AnimatedRef, StyleProps } from "react-native-reanimated";
5
+ import { setEntry } from "../../../stores/bounds/internals/entries";
6
+ import {
7
+ setDestination,
8
+ setSource,
9
+ } from "../../../stores/bounds/internals/links";
5
10
  import { ScrollStore } from "../../../stores/scroll.store";
6
11
  import { SystemStore } from "../../../stores/system.store";
7
- import { applyMeasuredBoundsWrites } from "../helpers/apply-measured-bounds-writes";
8
- import type { MeasureParams } from "../types";
9
- import { createLinkContext } from "./helpers/boundary-link-context";
10
- import { isMeasurementInViewport } from "./helpers/measurement";
12
+ import type { MeasureBoundary } from "../types";
11
13
  import {
12
- buildMeasurementWritePlan,
13
- getMeasureIntentFlags,
14
- } from "./helpers/measurement-rules";
15
- import { measureWithOverscrollAwareness } from "./helpers/scroll-measurement";
14
+ isMeasurementInViewport,
15
+ measureWithOverscrollAwareness,
16
+ } from "../utils/measured-bounds";
16
17
 
17
18
  interface UseMeasurerParams {
18
19
  enabled: boolean;
19
- sharedBoundTag: string;
20
- preferredSourceScreenKey?: string;
20
+ entryTag: string;
21
+ linkId: string;
22
+ group?: string;
21
23
  currentScreenKey: string;
22
24
  preparedStyles: StyleProps;
23
25
  measuredAnimatedRef: AnimatedRef<View>;
@@ -25,12 +27,13 @@ interface UseMeasurerParams {
25
27
 
26
28
  export const useMeasurer = ({
27
29
  enabled,
28
- sharedBoundTag,
29
- preferredSourceScreenKey,
30
+ entryTag,
31
+ linkId,
32
+ group,
30
33
  currentScreenKey,
31
34
  preparedStyles,
32
35
  measuredAnimatedRef,
33
- }: UseMeasurerParams) => {
36
+ }: UseMeasurerParams): MeasureBoundary => {
34
37
  const { width: viewportWidth, height: viewportHeight } =
35
38
  useWindowDimensions();
36
39
 
@@ -41,27 +44,10 @@ export const useMeasurer = ({
41
44
  );
42
45
 
43
46
  return useCallback(
44
- ({ intent }: MeasureParams = {}) => {
47
+ (target) => {
45
48
  "worklet";
46
49
  if (!enabled) return;
47
50
 
48
- const intents = getMeasureIntentFlags(intent);
49
- const currentLink = createLinkContext({
50
- sharedBoundTag,
51
- currentScreenKey,
52
- preferredSourceScreenKey,
53
- });
54
-
55
- const writePlan = buildMeasurementWritePlan({
56
- intents,
57
- hasPendingLink: currentLink.hasPendingLink,
58
- hasSourceLink: currentLink.hasSourceLink,
59
- hasDestinationLink: currentLink.hasDestinationLink,
60
- hasAttachableSourceLink: currentLink.hasAttachableSourceLink,
61
- });
62
-
63
- if (!writePlan.writesAny) return;
64
-
65
51
  const measured = measureWithOverscrollAwareness(
66
52
  measuredAnimatedRef,
67
53
  scrollState.get(),
@@ -69,15 +55,6 @@ export const useMeasurer = ({
69
55
 
70
56
  if (!measured) return;
71
57
 
72
- /**
73
- * Source Pass
74
- * Source intents are intentionally used & kept unguarded.
75
- */
76
- const sourceWrites = {
77
- shouldSetSource: writePlan.captureSource,
78
- shouldUpdateSource: writePlan.refreshSource,
79
- };
80
-
81
58
  /**
82
59
  * - Destination Pass -
83
60
  * Be strict while lifecycle start is blocked for destination capture.
@@ -86,40 +63,48 @@ export const useMeasurer = ({
86
63
  * lifecycle blocked until a valid retry lands.
87
64
  */
88
65
  const shouldGuardDestinationViewport =
89
- pendingLifecycleStartBlockCount.get() > 0;
66
+ pendingLifecycleStartBlockCount.get() > 0 || !!group;
67
+
90
68
  const viewportAllowsDestinationWrite =
69
+ target.type !== "destination" ||
91
70
  !shouldGuardDestinationViewport ||
92
71
  isMeasurementInViewport(measured, viewportWidth, viewportHeight);
93
72
 
94
- const destinationWrites = {
95
- shouldSetDestination:
96
- viewportAllowsDestinationWrite && writePlan.completeDestination,
97
- shouldUpdateDestination:
98
- viewportAllowsDestinationWrite && writePlan.refreshDestination,
99
- };
73
+ if (!viewportAllowsDestinationWrite) return;
100
74
 
101
- const shouldApplyMeasurement =
102
- sourceWrites.shouldSetSource ||
103
- sourceWrites.shouldUpdateSource ||
104
- destinationWrites.shouldSetDestination ||
105
- destinationWrites.shouldUpdateDestination;
75
+ // Set the bounds entry on every measure to avoid any stale measurements
76
+ // for the public read API.
77
+ setEntry(entryTag, currentScreenKey, {
78
+ bounds: measured,
79
+ });
106
80
 
107
- if (!shouldApplyMeasurement) return;
81
+ if (target.type === "source") {
82
+ setSource(
83
+ target.pairKey,
84
+ linkId,
85
+ currentScreenKey,
86
+ measured,
87
+ preparedStyles,
88
+ group,
89
+ );
90
+ }
108
91
 
109
- applyMeasuredBoundsWrites({
110
- sharedBoundTag,
111
- currentScreenKey,
112
- measured,
113
- preparedStyles,
114
- expectedSourceScreenKey: currentLink.expectedSourceScreenKey,
115
- ...sourceWrites,
116
- ...destinationWrites,
117
- });
92
+ if (target.type === "destination") {
93
+ setDestination(
94
+ target.pairKey,
95
+ linkId,
96
+ currentScreenKey,
97
+ measured,
98
+ preparedStyles,
99
+ group,
100
+ );
101
+ }
118
102
  },
119
103
  [
120
104
  enabled,
121
- sharedBoundTag,
122
- preferredSourceScreenKey,
105
+ entryTag,
106
+ linkId,
107
+ group,
123
108
  currentScreenKey,
124
109
  preparedStyles,
125
110
  measuredAnimatedRef,
@@ -1,116 +1,77 @@
1
1
  import { useAnimatedReaction } from "react-native-reanimated";
2
2
  import { AnimationStore } from "../../../stores/animation.store";
3
- import { getGroupActiveId } from "../../../stores/bounds/internals/groups";
4
- import {
5
- hasDestinationLink,
6
- hasSourceLink,
7
- } from "../../../stores/bounds/internals/links";
8
- import type { BoundaryId, MeasureParams } from "../types";
3
+ import { pairs } from "../../../stores/bounds/internals/state";
4
+ import type { MeasureBoundary } from "../types";
5
+ import { getRefreshBoundarySignal } from "../utils/refresh-signals";
9
6
 
10
7
  interface UseRefreshBoundaryParams {
11
8
  enabled: boolean;
12
- sharedBoundTag: string;
13
- id: BoundaryId;
14
- group?: string;
15
9
  currentScreenKey: string;
10
+ preferredSourceScreenKey?: string;
16
11
  nextScreenKey?: string;
17
- hasNextScreen: boolean;
18
- measureBoundary: (options: MeasureParams) => void;
12
+ linkId: string;
13
+ group?: string;
14
+ ancestorScreenKeys: string[];
15
+ measureBoundary: MeasureBoundary;
19
16
  }
20
17
 
21
18
  export const useRefreshBoundary = ({
22
19
  enabled,
23
- sharedBoundTag,
24
- id,
25
- group,
26
20
  currentScreenKey,
21
+ preferredSourceScreenKey,
27
22
  nextScreenKey,
28
- hasNextScreen,
23
+ linkId,
24
+ group,
25
+ ancestorScreenKeys,
29
26
  measureBoundary,
30
27
  }: UseRefreshBoundaryParams) => {
31
- const currentWillAnimate = AnimationStore.getValue(
32
- currentScreenKey,
28
+ // Source-side boundaries refresh from the next screen's lifecycle pulse.
29
+ // Destination-side boundaries have no next screen, so they refresh from self.
30
+ const refreshScreenKey = nextScreenKey ?? currentScreenKey;
31
+ const refreshWillAnimate = AnimationStore.getValue(
32
+ refreshScreenKey,
33
33
  "willAnimate",
34
34
  );
35
- const currentClosing = AnimationStore.getValue(currentScreenKey, "closing");
36
- const currentEntering = AnimationStore.getValue(currentScreenKey, "entering");
37
- const currentAnimating = AnimationStore.getValue(
38
- currentScreenKey,
35
+ const refreshClosing = AnimationStore.getValue(refreshScreenKey, "closing");
36
+ const refreshEntering = AnimationStore.getValue(refreshScreenKey, "entering");
37
+ const refreshAnimating = AnimationStore.getValue(
38
+ refreshScreenKey,
39
39
  "progressAnimating",
40
40
  );
41
- const currentProgress = AnimationStore.getValue(currentScreenKey, "progress");
42
- const nextWillAnimate = nextScreenKey
43
- ? AnimationStore.getValue(nextScreenKey, "willAnimate")
44
- : null;
45
-
46
- const nextClosing = nextScreenKey
47
- ? AnimationStore.getValue(nextScreenKey, "closing")
48
- : null;
49
- const nextEntering = nextScreenKey
50
- ? AnimationStore.getValue(nextScreenKey, "entering")
51
- : null;
41
+ const refreshProgress = AnimationStore.getValue(refreshScreenKey, "progress");
52
42
 
53
43
  useAnimatedReaction(
54
44
  () => {
55
45
  "worklet";
56
-
57
- const shouldRefresh = hasNextScreen
58
- ? (nextWillAnimate?.get() ?? 0)
59
- : currentWillAnimate.get();
60
- const closing = hasNextScreen
61
- ? (nextClosing?.get() ?? 0)
62
- : currentClosing.get();
63
- const entering = hasNextScreen
64
- ? (nextEntering?.get() ?? 0)
65
- : currentEntering.get();
66
-
67
- // Programmatic close marks `closing` before pulsing `willAnimate`.
68
- // This frame is still settled, so destination refresh is valid and
69
- // reveal can compute initial/current destination delta before progress moves.
70
- const canRefreshPreCloseDestination =
71
- !hasNextScreen &&
72
- shouldRefresh &&
73
- closing &&
74
- !entering &&
75
- !currentAnimating.get() &&
76
- currentProgress.get() >= 1;
77
-
78
- if (
79
- canRefreshPreCloseDestination ||
80
- (shouldRefresh && !closing && !entering)
81
- ) {
82
- return 1;
83
- }
84
-
85
- return 0;
46
+ return getRefreshBoundarySignal({
47
+ enabled,
48
+ currentScreenKey,
49
+ preferredSourceScreenKey,
50
+ nextScreenKey,
51
+ linkId,
52
+ group,
53
+ ancestorScreenKeys,
54
+ shouldRefresh: !!refreshWillAnimate.get(),
55
+ closing: !!refreshClosing.get(),
56
+ entering: !!refreshEntering.get(),
57
+ animating: !!refreshAnimating.get(),
58
+ progress: refreshProgress.get(),
59
+ linkState: group || ancestorScreenKeys.length ? pairs.get() : undefined,
60
+ });
86
61
  },
87
- (shouldRefresh, prevShouldRefresh) => {
62
+ (refreshSignal, prevRefreshSignal) => {
88
63
  "worklet";
89
64
 
90
- if (!enabled || !shouldRefresh || shouldRefresh === prevShouldRefresh)
91
- return;
92
-
93
- const currentGroupActiveId = group ? getGroupActiveId(group) : null;
94
-
95
- if (group && currentGroupActiveId !== String(id)) {
96
- return;
97
- }
98
-
99
- if (hasNextScreen) {
100
- if (
101
- !nextScreenKey ||
102
- !hasSourceLink(sharedBoundTag, currentScreenKey) ||
103
- !hasDestinationLink(sharedBoundTag, nextScreenKey)
104
- ) {
105
- return;
106
- }
107
-
108
- measureBoundary({ intent: "refresh-source" });
65
+ if (
66
+ !refreshSignal ||
67
+ refreshSignal.signal === prevRefreshSignal?.signal
68
+ ) {
109
69
  return;
110
70
  }
111
71
 
112
72
  measureBoundary({
113
- intent: "refresh-destination",
73
+ type: refreshSignal.type,
74
+ pairKey: refreshSignal.pairKey,
114
75
  });
115
76
  },
116
77
  );
@@ -4,7 +4,9 @@ import { createBoundaryComponent } from "./create-boundary-component";
4
4
 
5
5
  export { createBoundaryComponent };
6
6
 
7
- const BoundaryView = createBoundaryComponent(View);
7
+ const BoundaryView = createBoundaryComponent(View, {
8
+ shouldAutoMeasure: true,
9
+ });
8
10
  const BoundaryTrigger = createBoundaryComponent(Pressable);
9
11
  BoundaryView.displayName = "Transition.Boundary.View";
10
12
  BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
@@ -1,3 +1,4 @@
1
+ import type { ScreenPairKey } from "../../stores/bounds/types";
1
2
  import type { BoundsOptions } from "../../utils/bounds/types/options";
2
3
 
3
4
  export type BoundaryId = string | number;
@@ -15,9 +16,8 @@ export type BoundaryConfigProps = Pick<
15
16
  export interface BoundaryOwnProps extends BoundaryConfigProps {
16
17
  /**
17
18
  * Optional group name for collection/list scenarios.
18
- * When provided, boundaries are tracked as a group and the active member
19
- * re-measures automatically when focus changes within the group.
20
- * The internal tag becomes `group:id`.
19
+ * When provided, concrete boundary entries use `group:id`, while transition
20
+ * links stay keyed by the member `id` inside the active screen pair.
21
21
  */
22
22
  group?: string;
23
23
  /**
@@ -35,12 +35,14 @@ export interface BoundaryOwnProps extends BoundaryConfigProps {
35
35
  export type BoundaryComponentProps<P extends object> = Omit<P, "id"> &
36
36
  BoundaryOwnProps;
37
37
 
38
- export type MeasureIntent =
39
- | "capture-source"
40
- | "complete-destination"
41
- | "refresh-source"
42
- | "refresh-destination";
38
+ export type MeasureTarget =
39
+ | {
40
+ type: "source";
41
+ pairKey: ScreenPairKey;
42
+ }
43
+ | {
44
+ type: "destination";
45
+ pairKey: ScreenPairKey;
46
+ };
43
47
 
44
- export interface MeasureParams {
45
- intent?: MeasureIntent | readonly MeasureIntent[];
46
- }
48
+ export type MeasureBoundary = (target: MeasureTarget) => void;
@@ -0,0 +1,129 @@
1
+ import {
2
+ createPendingPairKey,
3
+ createScreenPairKey,
4
+ getDestinationScreenKeyFromPairKey,
5
+ getSourceScreenKeyFromPairKey,
6
+ } from "../../../stores/bounds/helpers/link-pairs.helpers";
7
+ import {
8
+ getDestination,
9
+ getSource,
10
+ } from "../../../stores/bounds/internals/links";
11
+ import type {
12
+ LinkPairsState,
13
+ ScreenPairKey,
14
+ } from "../../../stores/bounds/types";
15
+
16
+ const findPendingSourcePairKey = (
17
+ linkState: LinkPairsState | undefined,
18
+ linkId: string,
19
+ ): ScreenPairKey | null => {
20
+ "worklet";
21
+ if (!linkState) return null;
22
+
23
+ for (const pairKey in linkState) {
24
+ const sourceScreenKey = getSourceScreenKeyFromPairKey(pairKey);
25
+
26
+ if (pairKey !== createPendingPairKey(sourceScreenKey)) {
27
+ continue;
28
+ }
29
+
30
+ if (linkState[pairKey]?.links?.[linkId]?.source) {
31
+ return pairKey;
32
+ }
33
+ }
34
+
35
+ return null;
36
+ };
37
+
38
+ // Passive Boundary.View sources in nested routes can already live in the final
39
+ // ancestor pair, even before the destination side has attached.
40
+ const findAncestorSourcePairKey = (
41
+ linkState: LinkPairsState | undefined,
42
+ linkId: string,
43
+ destinationScreenKey: string | undefined,
44
+ ): ScreenPairKey | null => {
45
+ "worklet";
46
+ if (!linkState || !destinationScreenKey) return null;
47
+
48
+ for (const pairKey in linkState) {
49
+ if (getDestinationScreenKeyFromPairKey(pairKey) !== destinationScreenKey) {
50
+ continue;
51
+ }
52
+
53
+ if (linkState[pairKey]?.links?.[linkId]?.source) {
54
+ return pairKey;
55
+ }
56
+ }
57
+
58
+ return null;
59
+ };
60
+
61
+ export const getInitialDestinationMeasurePairKey = (params: {
62
+ enabled: boolean;
63
+ currentScreenKey: string;
64
+ preferredSourceScreenKey?: string;
65
+ ancestorScreenKeys?: readonly string[];
66
+ linkId: string;
67
+ linkState?: LinkPairsState;
68
+ }): ScreenPairKey | null => {
69
+ "worklet";
70
+ const {
71
+ enabled,
72
+ currentScreenKey,
73
+ preferredSourceScreenKey,
74
+ ancestorScreenKeys,
75
+ linkId,
76
+ linkState,
77
+ } = params;
78
+
79
+ if (!enabled) {
80
+ return null;
81
+ }
82
+
83
+ // Initial screens inside nested navigators measure concrete child views, but
84
+ // the transition pair belongs to the nearest animated ancestor route.
85
+ const ancestorPairKey = findAncestorSourcePairKey(
86
+ linkState,
87
+ linkId,
88
+ ancestorScreenKeys?.[0],
89
+ );
90
+
91
+ // Trigger sources start as pending screen<> links. Boundary.View sources may
92
+ // already be in the ancestor pair, so only scan pending when needed.
93
+ const pendingSourcePairKey = preferredSourceScreenKey
94
+ ? createPendingPairKey(preferredSourceScreenKey)
95
+ : ancestorPairKey
96
+ ? null
97
+ : findPendingSourcePairKey(linkState, linkId);
98
+
99
+ const sourceScreenKey = preferredSourceScreenKey
100
+ ? preferredSourceScreenKey
101
+ : getSourceScreenKeyFromPairKey(
102
+ ancestorPairKey ?? pendingSourcePairKey ?? "",
103
+ );
104
+
105
+ if (!sourceScreenKey) return null;
106
+
107
+ // Non-nested destinations attach to their own route. Nested initial screens
108
+ // attach to the animated ancestor route unless that pair already exists.
109
+ const destinationScreenKey =
110
+ ancestorPairKey || preferredSourceScreenKey || !ancestorScreenKeys?.[0]
111
+ ? currentScreenKey
112
+ : ancestorScreenKeys[0];
113
+
114
+ const destinationPairKey =
115
+ ancestorPairKey ??
116
+ createScreenPairKey(sourceScreenKey, destinationScreenKey);
117
+
118
+ const hasDestinationLink =
119
+ getDestination(destinationPairKey, linkId) !== null;
120
+
121
+ const hasAttachableSourceLink =
122
+ getSource(destinationPairKey, linkId) !== null ||
123
+ (!!pendingSourcePairKey &&
124
+ getSource(pendingSourcePairKey, linkId) !== null);
125
+
126
+ return hasAttachableSourceLink && !hasDestinationLink
127
+ ? destinationPairKey
128
+ : null;
129
+ };
@@ -7,7 +7,7 @@ import {
7
7
  import type {
8
8
  ScrollGestureAxisState,
9
9
  ScrollGestureState,
10
- } from "../../../../types/gesture.types";
10
+ } from "../../../types/gesture.types";
11
11
 
12
12
  const SCROLL_MEASUREMENT_EPSILON = 1;
13
13
 
@@ -46,6 +46,30 @@ export const adjustedMeasuredBoundsForOverscrollDeltas = (
46
46
  };
47
47
  };
48
48
 
49
+ export const isMeasurementInViewport = (
50
+ measured: MeasuredDimensions,
51
+ viewportWidth: number,
52
+ viewportHeight: number,
53
+ ): boolean => {
54
+ "worklet";
55
+
56
+ if (measured.width <= 0 || measured.height <= 0) {
57
+ return false;
58
+ }
59
+
60
+ const toleranceX = viewportWidth * 0.15;
61
+ const toleranceY = viewportHeight * 0.15;
62
+ const centerX = measured.pageX + measured.width / 2;
63
+ const centerY = measured.pageY + measured.height / 2;
64
+
65
+ return (
66
+ centerX >= -toleranceX &&
67
+ centerX <= viewportWidth + toleranceX &&
68
+ centerY >= -toleranceY &&
69
+ centerY <= viewportHeight + toleranceY
70
+ );
71
+ };
72
+
49
73
  export const measureWithOverscrollAwareness = (
50
74
  ref: AnimatedRef<View>,
51
75
  scrollState: ScrollGestureState | null,