react-native-screen-transitions 3.9.0-beta.1 → 3.9.0-beta.3

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 (479) hide show
  1. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +20 -4
  2. package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -1
  3. package/lib/commonjs/shared/animation/transition-blocking.js +71 -0
  4. package/lib/commonjs/shared/animation/transition-blocking.js.map +1 -0
  5. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +33 -28
  6. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  7. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +30 -95
  8. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  9. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +75 -51
  10. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  11. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
  12. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  13. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +14 -2
  14. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js +32 -0
  16. package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js.map +1 -0
  17. package/lib/commonjs/shared/components/boundary/index.js +1 -1
  18. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +41 -0
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +14 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
  22. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +224 -0
  23. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
  24. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +45 -0
  25. package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
  26. package/lib/commonjs/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +20 -18
  27. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
  28. package/lib/commonjs/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +13 -12
  29. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
  30. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +51 -0
  31. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
  32. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
  33. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +14 -0
  34. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
  35. package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
  36. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
  37. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +185 -0
  38. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
  39. package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
  40. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
  41. package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
  42. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
  43. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +31 -0
  44. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
  46. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
  48. package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +7 -12
  49. package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
  50. package/lib/commonjs/shared/components/boundary/portal/index.js +1 -8
  51. package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -1
  52. package/lib/commonjs/shared/components/boundary/portal/teleport.js +4 -3
  53. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  54. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +1 -15
  55. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  56. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +19 -56
  57. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  58. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +90 -23
  59. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  60. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +41 -12
  61. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  62. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js +36 -1
  63. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  64. package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -1
  65. package/lib/commonjs/shared/configs/presets.js +2 -2
  66. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  67. package/lib/commonjs/shared/constants.js +4 -0
  68. package/lib/commonjs/shared/constants.js.map +1 -1
  69. package/lib/commonjs/shared/index.js +13 -0
  70. package/lib/commonjs/shared/index.js.map +1 -1
  71. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  72. package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  73. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  74. package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  75. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  76. package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  77. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  78. package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  79. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
  80. package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  81. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  82. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  83. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  84. package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  85. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  86. package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  87. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  88. package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  89. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
  90. package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
  91. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +13 -1
  92. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  93. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +5 -3
  94. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  95. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  96. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  97. package/lib/commonjs/shared/stores/gesture.store.js +8 -0
  98. package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
  99. package/lib/commonjs/shared/stores/system.store.js +10 -2
  100. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  101. package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
  102. package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
  103. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  104. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  105. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +2 -2
  106. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  107. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
  108. package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  109. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +178 -315
  110. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  111. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
  112. package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  113. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
  114. package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  115. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
  116. package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  117. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
  118. package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  119. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
  120. package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  121. package/lib/module/shared/adapters/with-screen-transitions/index.js +19 -5
  122. package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
  123. package/lib/module/shared/animation/transition-blocking.js +66 -0
  124. package/lib/module/shared/animation/transition-blocking.js.map +1 -0
  125. package/lib/module/shared/components/boundary/components/boundary-target.js +35 -30
  126. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  127. package/lib/module/shared/components/boundary/create-boundary-component.js +32 -97
  128. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  129. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +79 -55
  130. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  131. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
  132. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  133. package/lib/module/shared/components/boundary/hooks/use-measurer.js +15 -3
  134. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  135. package/lib/module/shared/components/boundary/hooks/use-register-target.js +27 -0
  136. package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +1 -0
  137. package/lib/module/shared/components/boundary/index.js +1 -1
  138. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +36 -0
  139. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
  140. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +9 -0
  141. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
  142. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +219 -0
  143. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
  144. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +34 -0
  145. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
  146. package/lib/module/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +20 -18
  147. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
  148. package/lib/module/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +13 -12
  149. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
  150. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +46 -0
  151. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
  152. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
  153. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +9 -0
  154. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
  155. package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
  156. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
  157. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +180 -0
  158. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
  159. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
  160. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
  161. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
  162. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
  163. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +27 -0
  164. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
  165. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
  166. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
  167. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
  168. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +5 -10
  169. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
  170. package/lib/module/shared/components/boundary/portal/index.js +1 -2
  171. package/lib/module/shared/components/boundary/portal/index.js.map +1 -1
  172. package/lib/module/shared/components/boundary/portal/teleport.js +3 -2
  173. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  174. package/lib/module/shared/components/boundary/portal/utils/naming.js +0 -12
  175. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  176. package/lib/module/shared/components/boundary/portal/utils/ownership.js +16 -52
  177. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  178. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +87 -20
  179. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  180. package/lib/module/shared/components/boundary/utils/destination-signals.js +39 -10
  181. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  182. package/lib/module/shared/components/boundary/utils/measured-bounds.js +34 -0
  183. package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  184. package/lib/module/shared/components/screen-container/layers/content.js +1 -1
  185. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  186. package/lib/module/shared/configs/presets.js +2 -2
  187. package/lib/module/shared/configs/presets.js.map +1 -1
  188. package/lib/module/shared/constants.js +4 -0
  189. package/lib/module/shared/constants.js.map +1 -1
  190. package/lib/module/shared/index.js +1 -0
  191. package/lib/module/shared/index.js.map +1 -1
  192. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
  193. package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  194. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
  195. package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
  196. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
  197. package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
  198. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
  199. package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
  200. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
  201. package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
  202. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
  203. package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
  204. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
  205. package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
  206. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
  207. package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
  208. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
  209. package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
  210. package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
  211. package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
  212. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +13 -1
  213. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  214. package/lib/module/shared/providers/screen/styles/slot.provider.js +5 -3
  215. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  216. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  217. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  218. package/lib/module/shared/stores/gesture.store.js +8 -0
  219. package/lib/module/shared/stores/gesture.store.js.map +1 -1
  220. package/lib/module/shared/stores/system.store.js +10 -2
  221. package/lib/module/shared/stores/system.store.js.map +1 -1
  222. package/lib/module/shared/types/bounds.types.js +26 -0
  223. package/lib/module/shared/types/bounds.types.js.map +1 -1
  224. package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
  225. package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
  226. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  227. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  228. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +2 -2
  229. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  230. package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
  231. package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
  232. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +182 -319
  233. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  234. package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
  235. package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
  236. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
  237. package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
  238. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
  239. package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
  240. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
  241. package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
  242. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
  243. package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
  244. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +4 -1
  245. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
  246. package/lib/typescript/shared/animation/transition-blocking.d.ts +33 -0
  247. package/lib/typescript/shared/animation/transition-blocking.d.ts.map +1 -0
  248. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
  249. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  250. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  251. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +2 -1
  252. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  253. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  254. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  255. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +10 -0
  256. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +1 -0
  257. package/lib/typescript/shared/components/boundary/index.d.ts +2 -2
  258. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +10 -0
  259. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -0
  260. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +2 -0
  261. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +1 -0
  262. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +12 -0
  263. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -0
  264. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +9 -0
  265. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -0
  266. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -0
  267. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -0
  268. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +13 -0
  269. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -0
  270. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +3 -0
  271. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +1 -0
  272. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts +2 -0
  273. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts.map +1 -0
  274. package/lib/typescript/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.d.ts +1 -1
  275. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -0
  276. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +12 -0
  277. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -0
  278. package/lib/typescript/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.d.ts +5 -1
  279. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -0
  280. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +12 -0
  281. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  282. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +12 -0
  283. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -0
  284. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.d.ts +1 -1
  285. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +1 -0
  286. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -0
  287. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.d.ts +3 -3
  288. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  289. package/lib/typescript/shared/components/boundary/portal/index.d.ts +1 -2
  290. package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -1
  291. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
  292. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  293. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +0 -2
  294. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  295. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +9 -10
  296. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
  297. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +22 -21
  298. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  299. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +9 -2
  300. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  301. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +8 -0
  302. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -1
  303. package/lib/typescript/shared/constants.d.ts.map +1 -1
  304. package/lib/typescript/shared/index.d.ts +2 -1
  305. package/lib/typescript/shared/index.d.ts.map +1 -1
  306. package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  307. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
  308. package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
  310. package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
  311. package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
  313. package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
  314. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
  315. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
  316. package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
  317. package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
  318. package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
  320. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +5 -0
  321. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
  323. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  324. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -1
  325. package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
  326. package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
  327. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  328. package/lib/typescript/shared/types/animation.types.d.ts +3 -3
  329. package/lib/typescript/shared/types/bounds.types.d.ts +122 -90
  330. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  331. package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
  332. package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
  333. package/lib/typescript/shared/types/index.d.ts +1 -1
  334. package/lib/typescript/shared/types/index.d.ts.map +1 -1
  335. package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
  336. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  337. package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
  338. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
  339. package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  340. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
  341. package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
  342. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
  343. package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
  344. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
  345. package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
  346. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
  347. package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
  348. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
  349. package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
  350. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
  351. package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
  352. package/lib/typescript/shared/utils/bounds/types/options.d.ts +6 -2
  353. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  354. package/package.json +1 -1
  355. package/src/shared/adapters/with-screen-transitions/index.tsx +30 -9
  356. package/src/shared/animation/transition-blocking.ts +79 -0
  357. package/src/shared/components/boundary/components/boundary-target.tsx +47 -43
  358. package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
  359. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +106 -81
  360. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +1 -0
  361. package/src/shared/components/boundary/hooks/use-measurer.ts +12 -4
  362. package/src/shared/components/boundary/hooks/use-register-target.ts +43 -0
  363. package/src/shared/components/boundary/index.tsx +2 -2
  364. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +52 -0
  365. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +9 -0
  366. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +317 -0
  367. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +62 -0
  368. package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +17 -17
  369. package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +14 -13
  370. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +79 -0
  371. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.ts +1 -1
  372. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts +10 -0
  373. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.ts +2 -2
  374. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +254 -0
  375. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.ts +38 -8
  376. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.ts +4 -15
  377. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +35 -0
  378. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.ts +2 -2
  379. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.ts +10 -15
  380. package/src/shared/components/boundary/portal/index.ts +1 -2
  381. package/src/shared/components/boundary/portal/teleport.ts +3 -2
  382. package/src/shared/components/boundary/portal/utils/naming.ts +0 -19
  383. package/src/shared/components/boundary/portal/utils/ownership.ts +32 -88
  384. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +218 -78
  385. package/src/shared/components/boundary/utils/destination-signals.ts +38 -14
  386. package/src/shared/components/boundary/utils/measured-bounds.ts +48 -0
  387. package/src/shared/components/screen-container/layers/content.tsx +1 -1
  388. package/src/shared/configs/presets.ts +2 -2
  389. package/src/shared/constants.ts +4 -0
  390. package/src/shared/index.ts +6 -0
  391. package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
  392. package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
  393. package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
  394. package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
  395. package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
  396. package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
  397. package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
  398. package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
  399. package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
  400. package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
  401. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +15 -1
  402. package/src/shared/providers/screen/styles/slot.provider.tsx +4 -2
  403. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +2 -1
  404. package/src/shared/stores/gesture.store.ts +12 -0
  405. package/src/shared/stores/system.store.ts +10 -4
  406. package/src/shared/types/animation.types.ts +3 -3
  407. package/src/shared/types/bounds.types.ts +128 -92
  408. package/src/shared/types/gesture.types.ts +10 -0
  409. package/src/shared/types/index.ts +2 -0
  410. package/src/shared/utils/animation/animate-to-progress.ts +23 -7
  411. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +18 -11
  412. package/src/shared/utils/bounds/navigation/reveal/build.ts +2 -2
  413. package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
  414. package/src/shared/utils/bounds/navigation/zoom/build.ts +224 -412
  415. package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
  416. package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
  417. package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
  418. package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
  419. package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
  420. package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
  421. package/src/shared/utils/bounds/types/options.ts +9 -2
  422. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -58
  423. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  424. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +0 -1
  425. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  426. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +0 -272
  427. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +0 -1
  428. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  429. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  430. package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  431. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  432. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  433. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  434. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  435. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
  436. package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  437. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -53
  438. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  439. package/lib/module/shared/components/boundary/portal/components/host.js.map +0 -1
  440. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  441. package/lib/module/shared/components/boundary/portal/components/portal.js +0 -267
  442. package/lib/module/shared/components/boundary/portal/components/portal.js.map +0 -1
  443. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  444. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  445. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  446. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  447. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  448. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  449. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  450. package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
  451. package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
  452. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +0 -8
  453. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +0 -1
  454. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +0 -1
  455. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +0 -1
  456. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +0 -20
  457. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +0 -1
  458. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +0 -1
  459. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +0 -17
  460. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +0 -1
  461. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +0 -1
  462. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +0 -1
  463. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +0 -1
  464. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +0 -3
  465. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +0 -1
  466. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +0 -1
  467. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
  468. package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
  469. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +0 -66
  470. package/src/shared/components/boundary/portal/components/portal.tsx +0 -412
  471. package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
  472. /package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  473. /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  474. /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  475. /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  476. /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
  477. /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
  478. /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
  479. /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
@@ -1,5 +1,5 @@
1
1
  import type React from "react";
2
- import { memo, useLayoutEffect, useMemo } from "react";
2
+ import { memo, useMemo } from "react";
3
3
  import type { View } from "react-native";
4
4
  import Animated, { useAnimatedRef } from "react-native-reanimated";
5
5
  import {
@@ -7,71 +7,62 @@ import {
7
7
  useSlotLayoutStyles,
8
8
  } from "../../../providers/screen/styles";
9
9
  import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
10
- import { logger } from "../../../utils/logger";
11
- import { Portal } from "../portal/components/portal";
10
+ import { useRegisterTarget } from "../hooks/use-register-target";
12
11
  import {
13
- TARGET_OUTSIDE_ROOT_WARNING,
14
- useBoundaryRootContext,
15
- } from "../providers/boundary-root.provider";
12
+ BoundaryContentPortal,
13
+ BoundaryContentPortalHost,
14
+ } from "../portal/components/boundary-content-portal";
15
+ import { BoundaryPortal } from "../portal/components/boundary-portal";
16
+ import { useBoundaryRootContext } from "../providers/boundary-root.provider";
16
17
 
17
- type BoundaryTargetProps = React.ComponentProps<typeof Animated.View>;
18
+ type BoundaryTargetProps = Omit<
19
+ React.ComponentProps<typeof Animated.View>,
20
+ "children"
21
+ > & {
22
+ children?: React.ReactNode;
23
+ };
18
24
 
19
25
  export const BoundaryTarget = memo(function BoundaryTarget(
20
26
  props: BoundaryTargetProps,
21
27
  ) {
22
- const { style, ...rest } = props;
28
+ const { children, pointerEvents, style, ...rest } = props;
23
29
  const targetAnimatedRef = useAnimatedRef<View>();
24
- const placeholderAnimatedRef = useAnimatedRef<View>();
30
+ const targetEscapePlaceholderRef = useAnimatedRef<View>();
25
31
  const rootContext = useBoundaryRootContext();
26
- const registerTargetRef = rootContext?.registerTargetRef;
27
- const unregisterTargetRef = rootContext?.unregisterTargetRef;
32
+ const boundaryId = rootContext?.boundTag.tag;
28
33
  const isActiveTarget = rootContext?.activeTargetRef === targetAnimatedRef;
29
34
  const portalRuntime = rootContext?.portalRuntime;
35
+ const handoffEnabled = isActiveTarget && rootContext?.handoffEnabled === true;
36
+ const shouldEscapeTargetToScreenHost =
37
+ portalRuntime?.escapeClipping === true && boundaryId !== undefined;
38
+
30
39
  const shouldApplyAssociatedStyleInline =
31
- isActiveTarget && portalRuntime?.enabled !== true;
40
+ isActiveTarget && portalRuntime?.escapeClipping !== true;
32
41
  const shouldApplyPortalLayoutStyle =
33
- isActiveTarget && portalRuntime?.enabled === true;
42
+ isActiveTarget && portalRuntime?.escapeClipping === true;
43
+
34
44
  const associatedTargetStyles = useComposedSlotStyles(
35
45
  rootContext?.boundTag.tag,
36
46
  style,
37
47
  );
38
48
  const portalLayoutStyle = useSlotLayoutStyles(rootContext?.boundTag.tag);
39
49
  const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
40
- // Teleported content can render outside its layout slot. The placeholder is
41
- // the truthful measurement surface whenever runtime portal behavior is active.
42
- const measurementRef = portalRuntime?.enabled
43
- ? placeholderAnimatedRef
44
- : targetAnimatedRef;
45
50
 
46
- useLayoutEffect(() => {
47
- if (!registerTargetRef || !unregisterTargetRef) {
48
- if (__DEV__) {
49
- logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
50
- }
51
- return;
52
- }
51
+ const measurementRef = shouldEscapeTargetToScreenHost
52
+ ? targetEscapePlaceholderRef
53
+ : targetAnimatedRef;
53
54
 
54
- registerTargetRef(targetAnimatedRef, preparedStyles, measurementRef);
55
- return () => {
56
- unregisterTargetRef(targetAnimatedRef);
57
- };
58
- }, [
59
- registerTargetRef,
60
- unregisterTargetRef,
61
- targetAnimatedRef,
62
- preparedStyles,
63
- measurementRef,
64
- ]);
55
+ useRegisterTarget({ preparedStyles, measurementRef, targetAnimatedRef });
65
56
 
66
57
  return (
67
- <Portal
68
- id={rootContext?.boundTag.tag}
69
- handoff={portalRuntime?.handoff}
70
- escapeClipping={portalRuntime?.escapeClipping}
71
- placeholderRef={placeholderAnimatedRef}
58
+ <BoundaryPortal
59
+ boundaryId={boundaryId ?? ""}
60
+ enabled={shouldEscapeTargetToScreenHost}
61
+ placeholderRef={targetEscapePlaceholderRef}
72
62
  >
73
63
  <Animated.View
74
64
  {...rest}
65
+ pointerEvents={pointerEvents}
75
66
  ref={targetAnimatedRef}
76
67
  style={[
77
68
  style,
@@ -79,7 +70,20 @@ export const BoundaryTarget = memo(function BoundaryTarget(
79
70
  shouldApplyPortalLayoutStyle ? portalLayoutStyle : undefined,
80
71
  ]}
81
72
  collapsable={false}
82
- />
83
- </Portal>
73
+ >
74
+ <BoundaryContentPortalHost
75
+ boundaryId={boundaryId ?? ""}
76
+ enabled={handoffEnabled}
77
+ screenKey={rootContext?.currentScreenKey ?? ""}
78
+ >
79
+ <BoundaryContentPortal
80
+ boundaryId={boundaryId}
81
+ enabled={handoffEnabled}
82
+ >
83
+ {children}
84
+ </BoundaryContentPortal>
85
+ </BoundaryContentPortalHost>
86
+ </Animated.View>
87
+ </BoundaryPortal>
84
88
  );
85
89
  });
@@ -1,49 +1,14 @@
1
- import {
2
- type ComponentType,
3
- forwardRef,
4
- memo,
5
- type ReactNode,
6
- useImperativeHandle,
7
- useMemo,
8
- } from "react";
9
- import type { View } from "react-native";
10
- import Animated, { useAnimatedRef } from "react-native-reanimated";
11
- import { useDescriptorsStore } from "../../providers/screen/descriptors";
12
- import {
13
- useComposedSlotStyles,
14
- useSlotStackingStyles,
15
- } from "../../providers/screen/styles";
16
- import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
17
- import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
18
- import { BoundaryLocalPortalHost } from "./portal/components/boundary-local-portal-host";
19
- import { Portal } from "./portal/components/portal";
20
- import { resolveBoundaryPortal } from "./portal/utils/resolve-portal";
21
- import {
22
- BoundaryRootProvider,
23
- useBoundaryRootState,
24
- } from "./providers/boundary-root.provider";
1
+ import { type ComponentType, forwardRef, memo } from "react";
2
+ import Animated from "react-native-reanimated";
3
+ import { BoundaryContentPortalHost } from "./portal/components/boundary-content-portal";
4
+ import { BoundaryPortal } from "./portal/components/boundary-portal";
5
+ import { BoundaryRootProvider } from "./providers/boundary-root.provider";
25
6
  import type { BoundaryComponentProps } from "./types";
26
7
 
27
8
  interface CreateBoundaryComponentOptions {
28
9
  alreadyAnimated?: boolean;
29
10
  }
30
11
 
31
- const hasRenderableChildren = (children: ReactNode): boolean => {
32
- if (
33
- children === null ||
34
- children === undefined ||
35
- typeof children === "boolean"
36
- ) {
37
- return false;
38
- }
39
-
40
- if (Array.isArray(children)) {
41
- return children.some(hasRenderableChildren);
42
- }
43
-
44
- return true;
45
- };
46
-
47
12
  export function createBoundaryComponent<P extends object>(
48
13
  Wrapped: ComponentType<P>,
49
14
  options: CreateBoundaryComponentOptions = {},
@@ -66,124 +31,44 @@ export function createBoundaryComponent<P extends object>(
66
31
  target,
67
32
  method,
68
33
  style,
69
- onPress,
70
34
  handoff,
71
35
  escapeClipping,
72
36
  children,
73
37
  ...rest
74
38
  } = props as any;
75
39
 
76
- const boundTag = useMemo(
77
- () => createBoundTag(String(id), group),
78
- [id, group],
79
- );
80
- const portalRuntime = resolveBoundaryPortal({
81
- handoff,
82
- escapeClipping,
83
- });
84
-
85
- const currentScreenKey = useDescriptorsStore(
86
- (s) => s.derivations.currentScreenKey,
87
- );
88
- const hasConfiguredInterpolator = useDescriptorsStore(
89
- (s) => s.derivations.hasConfiguredInterpolator,
90
- );
91
- const runtimeEnabled = enabled && hasConfiguredInterpolator;
92
- // Associated slot styles attach whenever the boundary is enabled,
93
- // independent of whether an interpolator is configured for this transition.
94
- const shouldAttachAssociatedStyles = enabled;
95
- const canPortalRoot =
96
- portalRuntime.enabled && hasRenderableChildren(children);
97
-
98
- const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
99
- const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
100
- const rootPlaceholderRef = useAnimatedRef<View>();
101
-
102
- const {
103
- ref,
104
- contextValue,
105
- measuredRef,
106
- hasActiveTarget,
107
- targetPreparedStyles,
108
- } = useBoundaryRootState({
109
- boundTag,
110
- portalRuntime,
111
- rootMeasurementRef: canPortalRoot ? rootPlaceholderRef : undefined,
112
- });
113
-
114
- useBoundaryMeasurement({
115
- boundTag,
116
- enabled,
117
- runtimeEnabled,
118
- currentScreenKey,
119
- measuredRef,
120
- style,
121
- targetPreparedStyles,
122
- handoff: portalRuntime.handoff,
123
- escapeClipping: portalRuntime.escapeClipping,
124
- config: { anchor, scaleMode, target, method },
125
- });
126
-
127
- useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
128
-
129
- const shouldPortalRoot = canPortalRoot && !hasActiveTarget;
130
- // A nested active target takes the full associated style, so the root keeps
131
- // only its stacking context. Without a nested target, a portal'd root is the
132
- // target, so its associated style is applied through the portal host instead
133
- // of inline on the teleported element.
134
- // Host-only handoff receivers still need the associated style: their local
135
- // portal host is absolute-filled inside this root, so the root is the visual
136
- // frame that animates the received payload.
137
- const attachedStyle = shouldAttachAssociatedStyles
138
- ? hasActiveTarget
139
- ? associatedStackingStyles
140
- : shouldPortalRoot
141
- ? undefined
142
- : associatedStyles
143
- : undefined;
144
- const pressProps = typeof onPress === "function" ? { onPress } : undefined;
145
-
146
- const localPortalHost = (
147
- <BoundaryLocalPortalHost
148
- boundaryId={boundTag.tag}
149
- enabled={enabled && portalRuntime.handoff}
150
- screenKey={currentScreenKey}
151
- />
152
- );
153
- const canInjectLocalPortalHost = typeof children !== "function";
154
-
155
- const renderBoundaryRoot = (extraChildren?: ReactNode) => (
156
- <AnimatedComponent
157
- {...rest}
158
- {...pressProps}
159
- ref={ref}
160
- style={[style, attachedStyle]}
161
- collapsable={false}
162
- >
163
- {children}
164
- {canInjectLocalPortalHost ? extraChildren : null}
165
- </AnimatedComponent>
166
- );
167
- const boundaryRoot = renderBoundaryRoot(
168
- shouldPortalRoot ? undefined : localPortalHost,
169
- );
170
-
171
40
  return (
172
- <BoundaryRootProvider value={contextValue}>
173
- {shouldPortalRoot ? (
174
- <Portal
175
- id={boundTag.tag}
176
- handoff={portalRuntime.handoff}
177
- escapeClipping={portalRuntime.escapeClipping}
178
- placeholderRef={rootPlaceholderRef}
179
- placeholderChildren={
180
- portalRuntime.handoff ? localPortalHost : undefined
181
- }
41
+ <BoundaryRootProvider
42
+ config={{ anchor, scaleMode, target, method }}
43
+ enabled={enabled}
44
+ escapeClipping={escapeClipping}
45
+ forwardedRef={forwardedRef}
46
+ group={group}
47
+ handoff={handoff}
48
+ id={id}
49
+ style={style}
50
+ >
51
+ {(root) => (
52
+ <BoundaryPortal
53
+ boundaryId={root.boundTag.tag}
54
+ enabled={root.shouldRenderBoundaryRootThroughPortal}
55
+ placeholderRef={root.rootEscapePlaceholderRef}
182
56
  >
183
- {boundaryRoot}
184
- </Portal>
185
- ) : (
186
- boundaryRoot
57
+ <AnimatedComponent
58
+ {...rest}
59
+ ref={root.ref}
60
+ style={[style, root.attachedStyle]}
61
+ collapsable={false}
62
+ >
63
+ <BoundaryContentPortalHost
64
+ boundaryId={root.boundTag.tag}
65
+ enabled={root.shouldRenderHandoffHost}
66
+ screenKey={root.currentScreenKey}
67
+ >
68
+ {children}
69
+ </BoundaryContentPortalHost>
70
+ </AnimatedComponent>
71
+ </BoundaryPortal>
187
72
  )}
188
73
  </BoundaryRootProvider>
189
74
  );
@@ -1,5 +1,7 @@
1
+ import { useCallback, useLayoutEffect } from "react";
1
2
  import {
2
3
  cancelAnimation,
4
+ runOnUI,
3
5
  useAnimatedReaction,
4
6
  useSharedValue,
5
7
  withDelay,
@@ -9,41 +11,33 @@ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
9
11
  import { AnimationStore } from "../../../../stores/animation.store";
10
12
  import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
11
13
  import { getEntry } from "../../../../stores/bounds/internals/entries";
12
- import {
13
- getDestination,
14
- getLink,
15
- } from "../../../../stores/bounds/internals/links";
14
+ import { getLink } from "../../../../stores/bounds/internals/links";
16
15
  import { pairs } from "../../../../stores/bounds/internals/state";
17
16
  import type { BoundTag } from "../../../../stores/bounds/types";
18
- import {
19
- LifecycleTransitionRequestKind,
20
- SystemStore,
21
- } from "../../../../stores/system.store";
17
+ import { SystemStore } from "../../../../stores/system.store";
22
18
  import { logger } from "../../../../utils/logger";
23
- import {
24
- hasHandoffEscapeContinuation,
25
- usesEscapeClippingHost,
26
- } from "../../portal/utils/ownership";
27
19
  import type { MeasureBoundary } from "../../types";
28
- import { getInitialDestinationMeasurePairKey } from "../../utils/destination-signals";
20
+ import { getInitialDestinationMeasurementSignal } from "../../utils/destination-signals";
29
21
 
30
- const VIEWPORT_RETRY_DELAY_MS = 100;
22
+ const HANDSHAKE_RETRY_DELAY_MS = 100;
31
23
  /**
32
- * A destination that keeps failing its measurement guards must not hold the
33
- * transition gate forever after this budget the block is released with a
34
- * warning so the open proceeds without that boundary.
24
+ * A destination whose initial handshake never completes must not hold the
25
+ * transition gate forever. After this budget, release the block with a warning
26
+ * so the open proceeds without that boundary.
35
27
  */
36
- const MAX_VIEWPORT_RETRIES = 20;
28
+ const MAX_HANDSHAKE_RETRIES = 20;
37
29
 
38
30
  interface UseInitialDestinationMeasurementParams {
39
31
  boundTag: BoundTag;
40
32
  enabled: boolean;
33
+ escapeClipping: boolean;
41
34
  measureBoundary: MeasureBoundary;
42
35
  }
43
36
 
44
37
  export const useInitialDestinationMeasurement = ({
45
38
  boundTag,
46
39
  enabled,
40
+ escapeClipping,
47
41
  measureBoundary,
48
42
  }: UseInitialDestinationMeasurementParams) => {
49
43
  const { tag, linkKey, group } = boundTag;
@@ -58,22 +52,23 @@ export const useInitialDestinationMeasurement = ({
58
52
  (s) => s.derivations.ancestorDestinationPairKey,
59
53
  );
60
54
  const destinationEnabled = enabled && !nextScreenKey;
55
+ const initialDestinationPairKey =
56
+ destinationPairKey ?? ancestorDestinationPairKey;
61
57
  const progress = AnimationStore.getValue(
62
58
  currentScreenKey,
63
59
  "transitionProgress",
64
60
  );
65
61
 
66
62
  const {
67
- pendingLifecycleRequestKind,
68
63
  actions: { blockLifecycleStart, unblockLifecycleStart },
69
64
  } = SystemStore.getBag(currentScreenKey);
70
65
 
71
66
  const isBlockingLifecycleStart = useSharedValue(0);
72
67
  const retryToken = useSharedValue(0);
73
- const viewportRetries = useSharedValue(0);
68
+ const handshakeRetries = useSharedValue(0);
74
69
  const hasGivenUp = useSharedValue(0);
75
70
 
76
- const releaseLifecycleStartBlock = () => {
71
+ const releaseLifecycleStartBlock = useCallback(() => {
77
72
  "worklet";
78
73
  cancelAnimation(retryToken);
79
74
 
@@ -81,53 +76,94 @@ export const useInitialDestinationMeasurement = ({
81
76
  return;
82
77
  }
83
78
 
84
- unblockLifecycleStart();
85
79
  isBlockingLifecycleStart.set(0);
86
- };
80
+ unblockLifecycleStart();
81
+ }, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
87
82
 
88
- useAnimatedReaction(
89
- () => {
90
- "worklet";
91
- const retryTick = retryToken.get();
83
+ const claimLifecycleStartBlock = useCallback(() => {
84
+ "worklet";
85
+
86
+ // The progress check and block claim must share one UI-thread operation.
87
+ // Otherwise a JS-thread layout effect can observe zero, enqueue the block,
88
+ // and let the opening animation start before that block reaches the UI thread.
89
+ if (progress.get() > 0 || isBlockingLifecycleStart.get()) {
90
+ return;
91
+ }
92
92
 
93
- const hasPendingOpenRequest =
94
- pendingLifecycleRequestKind.get() ===
95
- LifecycleTransitionRequestKind.Open;
93
+ blockLifecycleStart();
94
+ isBlockingLifecycleStart.set(1);
95
+ }, [blockLifecycleStart, isBlockingLifecycleStart, progress]);
96
96
 
97
- const isWaitingForOpenToStart = progress.get() <= 0;
97
+ useLayoutEffect(() => {
98
+ if (!destinationEnabled || !initialDestinationPairKey) {
99
+ return;
100
+ }
98
101
 
99
- if (!hasPendingOpenRequest || !isWaitingForOpenToStart) {
100
- return [0, retryTick] as const;
102
+ runOnUI(claimLifecycleStartBlock)();
103
+
104
+ return () => {
105
+ if (escapeClipping) {
106
+ // The portal host owns the release after this boundary hands off.
107
+ return;
101
108
  }
102
109
 
103
- const measurePairKey = getInitialDestinationMeasurePairKey({
104
- enabled: destinationEnabled,
110
+ // This is an abandonment fallback, not a second release. Run it on the UI
111
+ // runtime so it serializes with the handshake's guarded release.
112
+ runOnUI(releaseLifecycleStartBlock)();
113
+ };
114
+ }, [
115
+ claimLifecycleStartBlock,
116
+ destinationEnabled,
117
+ escapeClipping,
118
+ initialDestinationPairKey,
119
+ releaseLifecycleStartBlock,
120
+ ]);
121
+
122
+ useAnimatedReaction(
123
+ () => {
124
+ "worklet";
125
+ const retryTick = retryToken.get();
126
+ const isWaitingForOpenToStart = progress.get() <= 0;
127
+ const sourceScreenKey = initialDestinationPairKey
128
+ ? getSourceScreenKeyFromPairKey(initialDestinationPairKey)
129
+ : undefined;
130
+ const signal = getInitialDestinationMeasurementSignal({
131
+ enabled:
132
+ destinationEnabled &&
133
+ isWaitingForOpenToStart &&
134
+ isBlockingLifecycleStart.get() > 0,
105
135
  destinationPairKey,
106
136
  ancestorDestinationPairKey,
107
137
  linkId: linkKey,
108
138
  group,
109
- linkState:
110
- destinationEnabled &&
111
- (destinationPairKey || ancestorDestinationPairKey)
112
- ? pairs.get()
113
- : undefined,
139
+ destinationPresent: getEntry(tag, currentScreenKey) !== null,
140
+ sourcePresent:
141
+ sourceScreenKey !== undefined &&
142
+ getEntry(tag, sourceScreenKey) !== null,
143
+ linkState: initialDestinationPairKey ? pairs.get() : undefined,
114
144
  });
115
145
 
116
- return [measurePairKey, retryTick] as const;
146
+ return [
147
+ signal?.pairKey ?? null,
148
+ signal?.action ?? null,
149
+ retryTick,
150
+ ] as const;
117
151
  },
118
- ([measurePairKey, retryTick], previous) => {
152
+ ([measurePairKey, action, retryTick], previous) => {
119
153
  "worklet";
120
- if (!measurePairKey) {
154
+ if (!measurePairKey || !action) {
121
155
  return;
122
156
  }
123
157
 
124
158
  const previousMeasurePairKey = previous?.[0];
125
- const previousRetryTick = previous?.[1];
126
- const shouldAttemptMeasure =
159
+ const previousAction = previous?.[1];
160
+ const previousRetryTick = previous?.[2];
161
+ const shouldHandleSignal =
127
162
  measurePairKey !== previousMeasurePairKey ||
163
+ action !== previousAction ||
128
164
  retryTick !== previousRetryTick;
129
165
 
130
- if (!shouldAttemptMeasure) {
166
+ if (!shouldHandleSignal) {
131
167
  return;
132
168
  }
133
169
 
@@ -135,62 +171,51 @@ export const useInitialDestinationMeasurement = ({
135
171
  return;
136
172
  }
137
173
 
138
- if (!isBlockingLifecycleStart.get()) {
139
- blockLifecycleStart();
140
- isBlockingLifecycleStart.set(1);
174
+ if (action === "release") {
175
+ releaseLifecycleStartBlock();
176
+ handshakeRetries.set(0);
177
+ return;
141
178
  }
142
179
 
143
- measureBoundary({
144
- type: "destination",
145
- pairKey: measurePairKey,
146
- });
180
+ if (action === "measure") {
181
+ measureBoundary({
182
+ type: "destination",
183
+ pairKey: measurePairKey,
184
+ });
185
+ }
186
+
187
+ const link = getLink(measurePairKey, linkKey);
188
+ const linkComplete = !!link?.source && !!link.destination;
147
189
 
148
- const destinationAttached =
149
- getDestination(measurePairKey, linkKey) !== null;
150
-
151
- if (destinationAttached) {
152
- const linkState = pairs.get();
153
- const link = getLink(measurePairKey, linkKey);
154
- const sourceScreenKey = getSourceScreenKeyFromPairKey(measurePairKey);
155
- const sourceEntry = getEntry(tag, sourceScreenKey);
156
- const sourceEntryUsesDestinationEscapeHost =
157
- sourceEntry?.handoff === true && sourceEntry.escapeClipping === true;
158
- const shouldWaitForEscapeClippingHost =
159
- usesEscapeClippingHost(link) ||
160
- sourceEntryUsesDestinationEscapeHost ||
161
- hasHandoffEscapeContinuation({
162
- linkKey,
163
- linkState,
164
- sourceScreenKey,
165
- });
166
-
167
- if (shouldWaitForEscapeClippingHost) {
190
+ if (linkComplete || action === "complete") {
191
+ cancelAnimation(retryToken);
192
+ handshakeRetries.set(0);
193
+ if (escapeClipping) {
168
194
  // Screen-level escape has a second readiness phase after destination
169
- // measurement: the host must commit before the transition starts, or
195
+ // matching: the host must commit before the transition starts, or
170
196
  // the payload can disappear for a frame.
171
197
  return;
172
198
  }
173
199
  releaseLifecycleStartBlock();
174
- viewportRetries.set(0);
175
200
  return;
176
201
  }
177
202
 
178
- if (viewportRetries.get() >= MAX_VIEWPORT_RETRIES) {
203
+ if (handshakeRetries.get() >= MAX_HANDSHAKE_RETRIES) {
179
204
  hasGivenUp.set(1);
180
205
  releaseLifecycleStartBlock();
181
206
  logger.warn(
182
- `Destination boundary "${linkKey}" never produced a valid measurement after ${MAX_VIEWPORT_RETRIES} attempts; releasing the transition gate without it. The boundary is likely off-viewport (e.g. an inactive group member on a paged screen) or unmounted.`,
207
+ `Boundary "${linkKey}" never formed a complete source/destination link after ${MAX_HANDSHAKE_RETRIES} attempts; releasing the transition gate without it. One side is likely off-viewport or unmounted.`,
183
208
  );
184
209
  return;
185
210
  }
186
211
 
187
- // Destination did not attach (malformed off-screen measurement); retry
188
- // after the retry token advances while the lifecycle stays blocked.
189
- viewportRetries.set(viewportRetries.get() + 1);
212
+ // Keep the lifecycle blocked while registration, measurement, or source
213
+ // attachment settles. The retry token also retries rejected destination bounds.
214
+ handshakeRetries.set(handshakeRetries.get() + 1);
190
215
  cancelAnimation(retryToken);
191
216
  retryToken.set(
192
217
  withDelay(
193
- VIEWPORT_RETRY_DELAY_MS,
218
+ HANDSHAKE_RETRY_DELAY_MS,
194
219
  withTiming(retryToken.get() + 1, { duration: 0 }),
195
220
  ),
196
221
  );
@@ -86,6 +86,7 @@ export const useBoundaryMeasurement = ({
86
86
  useInitialDestinationMeasurement({
87
87
  boundTag,
88
88
  enabled: runtimeEnabled,
89
+ escapeClipping,
89
90
  measureBoundary,
90
91
  });
91
92