react-native-screen-transitions 3.9.0-beta.0 → 3.9.0-beta.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 (350) 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 +30 -30
  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 +68 -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 +40 -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 +194 -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 +44 -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} +17 -16
  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} +11 -11
  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 +52 -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 +184 -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 +33 -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 +2 -2
  53. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +1 -15
  54. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +19 -56
  56. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +77 -23
  58. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  59. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +41 -12
  60. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  61. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js +36 -1
  62. package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  63. package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -1
  64. package/lib/commonjs/shared/configs/presets.js +2 -2
  65. package/lib/commonjs/shared/configs/presets.js.map +1 -1
  66. package/lib/commonjs/shared/index.js +13 -0
  67. package/lib/commonjs/shared/index.js.map +1 -1
  68. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
  69. package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  70. package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +50 -0
  71. package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
  72. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
  73. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  75. package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  76. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +5 -3
  77. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  79. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  80. package/lib/commonjs/shared/stores/system.store.js +10 -2
  81. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  82. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  83. package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  84. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +2 -2
  85. package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  86. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +3 -3
  87. package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  88. package/lib/module/shared/adapters/with-screen-transitions/index.js +19 -5
  89. package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
  90. package/lib/module/shared/animation/transition-blocking.js +66 -0
  91. package/lib/module/shared/animation/transition-blocking.js.map +1 -0
  92. package/lib/module/shared/components/boundary/components/boundary-target.js +32 -32
  93. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  94. package/lib/module/shared/components/boundary/create-boundary-component.js +32 -97
  95. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  96. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +72 -55
  97. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
  98. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
  99. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  100. package/lib/module/shared/components/boundary/hooks/use-measurer.js +15 -3
  101. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  102. package/lib/module/shared/components/boundary/hooks/use-register-target.js +27 -0
  103. package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +1 -0
  104. package/lib/module/shared/components/boundary/index.js +1 -1
  105. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +35 -0
  106. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
  107. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +9 -0
  108. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
  109. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +189 -0
  110. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
  111. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +33 -0
  112. package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
  113. package/lib/module/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +17 -16
  114. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
  115. package/lib/module/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +11 -11
  116. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
  117. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +47 -0
  118. package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
  119. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
  120. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +9 -0
  121. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
  122. package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
  123. package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
  124. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +179 -0
  125. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
  126. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
  127. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
  128. package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
  129. package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
  130. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +29 -0
  131. package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
  132. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
  133. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
  134. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
  135. package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +5 -10
  136. package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
  137. package/lib/module/shared/components/boundary/portal/index.js +1 -2
  138. package/lib/module/shared/components/boundary/portal/index.js.map +1 -1
  139. package/lib/module/shared/components/boundary/portal/teleport.js +2 -2
  140. package/lib/module/shared/components/boundary/portal/utils/naming.js +0 -12
  141. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  142. package/lib/module/shared/components/boundary/portal/utils/ownership.js +16 -52
  143. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
  144. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +74 -20
  145. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  146. package/lib/module/shared/components/boundary/utils/destination-signals.js +39 -10
  147. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  148. package/lib/module/shared/components/boundary/utils/measured-bounds.js +34 -0
  149. package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -1
  150. package/lib/module/shared/components/screen-container/layers/content.js +1 -1
  151. package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
  152. package/lib/module/shared/configs/presets.js +2 -2
  153. package/lib/module/shared/configs/presets.js.map +1 -1
  154. package/lib/module/shared/index.js +1 -0
  155. package/lib/module/shared/index.js.map +1 -1
  156. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
  157. package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
  158. package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +45 -0
  159. package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
  160. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
  161. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  162. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
  163. package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
  164. package/lib/module/shared/providers/screen/styles/slot.provider.js +5 -3
  165. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  166. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
  167. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
  168. package/lib/module/shared/stores/system.store.js +10 -2
  169. package/lib/module/shared/stores/system.store.js.map +1 -1
  170. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
  171. package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
  172. package/lib/module/shared/utils/bounds/navigation/reveal/build.js +2 -2
  173. package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
  174. package/lib/module/shared/utils/bounds/navigation/zoom/build.js +3 -3
  175. package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
  176. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +4 -1
  177. package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
  178. package/lib/typescript/shared/animation/transition-blocking.d.ts +33 -0
  179. package/lib/typescript/shared/animation/transition-blocking.d.ts.map +1 -0
  180. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  181. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  182. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +2 -1
  183. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
  184. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  185. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  186. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +10 -0
  187. package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +1 -0
  188. package/lib/typescript/shared/components/boundary/index.d.ts +2 -2
  189. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +10 -0
  190. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -0
  191. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +2 -0
  192. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +1 -0
  193. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +12 -0
  194. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -0
  195. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +11 -0
  196. package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -0
  197. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -0
  198. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -0
  199. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +14 -0
  200. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -0
  201. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +3 -0
  202. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +1 -0
  203. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts +2 -0
  204. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts.map +1 -0
  205. package/lib/typescript/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.d.ts +1 -1
  206. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -0
  207. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +12 -0
  208. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -0
  209. package/lib/typescript/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.d.ts +5 -1
  210. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -0
  211. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +12 -0
  212. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  213. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +13 -0
  214. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -0
  215. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.d.ts +1 -1
  216. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +1 -0
  217. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -0
  218. package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.d.ts +3 -3
  219. package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  220. package/lib/typescript/shared/components/boundary/portal/index.d.ts +1 -2
  221. package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -1
  222. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +0 -2
  223. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  224. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +9 -10
  225. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
  226. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +21 -21
  227. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  228. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +9 -2
  229. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  230. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +8 -0
  231. package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -1
  232. package/lib/typescript/shared/index.d.ts +1 -0
  233. package/lib/typescript/shared/index.d.ts.map +1 -1
  234. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts +4 -1
  235. package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
  236. package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts +4 -0
  237. package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts.map +1 -0
  238. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  239. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -0
  240. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
  241. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
  242. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
  243. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -1
  244. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  245. package/lib/typescript/shared/types/animation.types.d.ts +3 -3
  246. package/lib/typescript/shared/types/bounds.types.d.ts +7 -2
  247. package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
  248. package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
  249. package/lib/typescript/shared/utils/bounds/types/options.d.ts +6 -2
  250. package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
  251. package/package.json +1 -1
  252. package/src/shared/adapters/with-screen-transitions/index.tsx +30 -9
  253. package/src/shared/animation/transition-blocking.ts +79 -0
  254. package/src/shared/components/boundary/components/boundary-target.tsx +43 -50
  255. package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
  256. package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +103 -81
  257. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +1 -0
  258. package/src/shared/components/boundary/hooks/use-measurer.ts +12 -4
  259. package/src/shared/components/boundary/hooks/use-register-target.ts +43 -0
  260. package/src/shared/components/boundary/index.tsx +2 -2
  261. package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +48 -0
  262. package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +9 -0
  263. package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +274 -0
  264. package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +59 -0
  265. package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +14 -15
  266. package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +12 -12
  267. package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +80 -0
  268. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.ts +1 -1
  269. package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts +10 -0
  270. package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.ts +2 -2
  271. package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +250 -0
  272. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.ts +38 -8
  273. package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.ts +4 -15
  274. package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +38 -0
  275. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.ts +2 -2
  276. package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.ts +10 -15
  277. package/src/shared/components/boundary/portal/index.ts +1 -2
  278. package/src/shared/components/boundary/portal/teleport.ts +2 -2
  279. package/src/shared/components/boundary/portal/utils/naming.ts +0 -19
  280. package/src/shared/components/boundary/portal/utils/ownership.ts +32 -88
  281. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +198 -78
  282. package/src/shared/components/boundary/utils/destination-signals.ts +38 -14
  283. package/src/shared/components/boundary/utils/measured-bounds.ts +48 -0
  284. package/src/shared/components/screen-container/layers/content.tsx +1 -1
  285. package/src/shared/configs/presets.ts +2 -2
  286. package/src/shared/index.ts +4 -0
  287. package/src/shared/providers/screen/animation/helpers/read-screen-animation-revisions.ts +14 -0
  288. package/src/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.ts +75 -0
  289. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +11 -0
  290. package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
  291. package/src/shared/providers/screen/styles/slot.provider.tsx +4 -2
  292. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +2 -1
  293. package/src/shared/stores/system.store.ts +10 -4
  294. package/src/shared/types/animation.types.ts +3 -3
  295. package/src/shared/types/bounds.types.ts +9 -2
  296. package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +18 -11
  297. package/src/shared/utils/bounds/navigation/reveal/build.ts +2 -2
  298. package/src/shared/utils/bounds/navigation/zoom/build.ts +3 -3
  299. package/src/shared/utils/bounds/types/options.ts +9 -2
  300. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -58
  301. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  302. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +0 -1
  303. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  304. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +0 -272
  305. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +0 -1
  306. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  307. package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  308. package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  309. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  310. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  311. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  312. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  313. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -53
  314. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
  315. package/lib/module/shared/components/boundary/portal/components/host.js.map +0 -1
  316. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
  317. package/lib/module/shared/components/boundary/portal/components/portal.js +0 -267
  318. package/lib/module/shared/components/boundary/portal/components/portal.js.map +0 -1
  319. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
  320. package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
  321. package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
  322. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
  323. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
  324. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
  325. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
  326. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +0 -8
  327. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +0 -1
  328. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +0 -1
  329. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +0 -1
  330. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +0 -20
  331. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +0 -1
  332. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +0 -1
  333. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +0 -17
  334. package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +0 -1
  335. package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +0 -1
  336. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +0 -1
  337. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +0 -1
  338. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +0 -3
  339. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +0 -1
  340. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +0 -1
  341. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +0 -66
  342. package/src/shared/components/boundary/portal/components/portal.tsx +0 -412
  343. /package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  344. /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  345. /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
  346. /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
  347. /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
  348. /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
  349. /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
  350. /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
@@ -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,91 @@ export const useInitialDestinationMeasurement = ({
81
76
  return;
82
77
  }
83
78
 
84
- unblockLifecycleStart();
85
79
  isBlockingLifecycleStart.set(0);
86
- };
80
+ unblockLifecycleStart();
81
+ }, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
82
+
83
+ useLayoutEffect(() => {
84
+ if (
85
+ !destinationEnabled ||
86
+ !initialDestinationPairKey ||
87
+ progress.get() > 0 ||
88
+ isBlockingLifecycleStart.get()
89
+ ) {
90
+ return;
91
+ }
92
+
93
+ // Boundary layout effects run before the parent screen's open intent. Claim
94
+ // this boundary's startup block before the transition controller can consume
95
+ // the request; the UI-thread handshake below releases it once matching is done.
96
+ blockLifecycleStart();
97
+ isBlockingLifecycleStart.set(1);
98
+
99
+ return () => {
100
+ if (escapeClipping) {
101
+ // The portal host owns the release after this boundary hands off.
102
+ return;
103
+ }
104
+
105
+ // This is an abandonment fallback, not a second release. Run it on the UI
106
+ // runtime so it serializes with the handshake's guarded release.
107
+ runOnUI(releaseLifecycleStartBlock)();
108
+ };
109
+ }, [
110
+ blockLifecycleStart,
111
+ destinationEnabled,
112
+ escapeClipping,
113
+ initialDestinationPairKey,
114
+ isBlockingLifecycleStart,
115
+ progress,
116
+ releaseLifecycleStartBlock,
117
+ ]);
87
118
 
88
119
  useAnimatedReaction(
89
120
  () => {
90
121
  "worklet";
91
122
  const retryTick = retryToken.get();
92
-
93
- const hasPendingOpenRequest =
94
- pendingLifecycleRequestKind.get() ===
95
- LifecycleTransitionRequestKind.Open;
96
-
97
123
  const isWaitingForOpenToStart = progress.get() <= 0;
98
-
99
- if (!hasPendingOpenRequest || !isWaitingForOpenToStart) {
100
- return [0, retryTick] as const;
101
- }
102
-
103
- const measurePairKey = getInitialDestinationMeasurePairKey({
104
- enabled: destinationEnabled,
124
+ const sourceScreenKey = initialDestinationPairKey
125
+ ? getSourceScreenKeyFromPairKey(initialDestinationPairKey)
126
+ : undefined;
127
+ const signal = getInitialDestinationMeasurementSignal({
128
+ enabled:
129
+ destinationEnabled &&
130
+ isWaitingForOpenToStart &&
131
+ isBlockingLifecycleStart.get() > 0,
105
132
  destinationPairKey,
106
133
  ancestorDestinationPairKey,
107
134
  linkId: linkKey,
108
135
  group,
109
- linkState:
110
- destinationEnabled &&
111
- (destinationPairKey || ancestorDestinationPairKey)
112
- ? pairs.get()
113
- : undefined,
136
+ destinationPresent: getEntry(tag, currentScreenKey) !== null,
137
+ sourcePresent:
138
+ sourceScreenKey !== undefined &&
139
+ getEntry(tag, sourceScreenKey) !== null,
140
+ linkState: initialDestinationPairKey ? pairs.get() : undefined,
114
141
  });
115
142
 
116
- return [measurePairKey, retryTick] as const;
143
+ return [
144
+ signal?.pairKey ?? null,
145
+ signal?.action ?? null,
146
+ retryTick,
147
+ ] as const;
117
148
  },
118
- ([measurePairKey, retryTick], previous) => {
149
+ ([measurePairKey, action, retryTick], previous) => {
119
150
  "worklet";
120
- if (!measurePairKey) {
151
+ if (!measurePairKey || !action) {
121
152
  return;
122
153
  }
123
154
 
124
155
  const previousMeasurePairKey = previous?.[0];
125
- const previousRetryTick = previous?.[1];
126
- const shouldAttemptMeasure =
156
+ const previousAction = previous?.[1];
157
+ const previousRetryTick = previous?.[2];
158
+ const shouldHandleSignal =
127
159
  measurePairKey !== previousMeasurePairKey ||
160
+ action !== previousAction ||
128
161
  retryTick !== previousRetryTick;
129
162
 
130
- if (!shouldAttemptMeasure) {
163
+ if (!shouldHandleSignal) {
131
164
  return;
132
165
  }
133
166
 
@@ -135,62 +168,51 @@ export const useInitialDestinationMeasurement = ({
135
168
  return;
136
169
  }
137
170
 
138
- if (!isBlockingLifecycleStart.get()) {
139
- blockLifecycleStart();
140
- isBlockingLifecycleStart.set(1);
171
+ if (action === "release") {
172
+ releaseLifecycleStartBlock();
173
+ handshakeRetries.set(0);
174
+ return;
175
+ }
176
+
177
+ if (action === "measure") {
178
+ measureBoundary({
179
+ type: "destination",
180
+ pairKey: measurePairKey,
181
+ });
141
182
  }
142
183
 
143
- measureBoundary({
144
- type: "destination",
145
- pairKey: measurePairKey,
146
- });
184
+ const link = getLink(measurePairKey, linkKey);
185
+ const linkComplete = !!link?.source && !!link.destination;
147
186
 
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) {
187
+ if (linkComplete || action === "complete") {
188
+ cancelAnimation(retryToken);
189
+ handshakeRetries.set(0);
190
+ if (escapeClipping) {
168
191
  // Screen-level escape has a second readiness phase after destination
169
- // measurement: the host must commit before the transition starts, or
192
+ // matching: the host must commit before the transition starts, or
170
193
  // the payload can disappear for a frame.
171
194
  return;
172
195
  }
173
196
  releaseLifecycleStartBlock();
174
- viewportRetries.set(0);
175
197
  return;
176
198
  }
177
199
 
178
- if (viewportRetries.get() >= MAX_VIEWPORT_RETRIES) {
200
+ if (handshakeRetries.get() >= MAX_HANDSHAKE_RETRIES) {
179
201
  hasGivenUp.set(1);
180
202
  releaseLifecycleStartBlock();
181
203
  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.`,
204
+ `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
205
  );
184
206
  return;
185
207
  }
186
208
 
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);
209
+ // Keep the lifecycle blocked while registration, measurement, or source
210
+ // attachment settles. The retry token also retries rejected destination bounds.
211
+ handshakeRetries.set(handshakeRetries.get() + 1);
190
212
  cancelAnimation(retryToken);
191
213
  retryToken.set(
192
214
  withDelay(
193
- VIEWPORT_RETRY_DELAY_MS,
215
+ HANDSHAKE_RETRY_DELAY_MS,
194
216
  withTiming(retryToken.get() + 1, { duration: 0 }),
195
217
  ),
196
218
  );
@@ -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
 
@@ -8,15 +8,17 @@ import {
8
8
  } from "react-native-reanimated";
9
9
  import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
10
10
  import { useOriginContext } from "../../../providers/screen/origin.provider";
11
+ import { useScreenSlots } from "../../../providers/screen/styles";
11
12
  import type { BoundTag } from "../../../stores/bounds/types";
12
13
  import { ScrollStore } from "../../../stores/scroll.store";
13
14
  import { SystemStore } from "../../../stores/system.store";
15
+ import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
14
16
  import type { MeasureBoundary } from "../types";
15
17
  import {
16
18
  attachScrollSnapshotToMeasuredBounds,
17
19
  isMeasurementInViewport,
18
20
  measureWithOverscrollAwareness,
19
- normalizeMeasuredBoundsToOrigin,
21
+ normalizeMeasuredBoundsWithVisibilityGate,
20
22
  } from "../utils/measured-bounds";
21
23
 
22
24
  interface UseMeasurerParams {
@@ -48,6 +50,7 @@ export const useMeasurer = ({
48
50
  "pendingLifecycleStartBlockCount",
49
51
  );
50
52
  const { originRef } = useOriginContext();
53
+ const { visibilityBlocked } = useScreenSlots();
51
54
 
52
55
  return useCallback(
53
56
  (target) => {
@@ -62,10 +65,14 @@ export const useMeasurer = ({
62
65
 
63
66
  if (!measured || !measuredOrigin) return;
64
67
 
65
- const normalizedMeasured = normalizeMeasuredBoundsToOrigin(
68
+ const normalizedMeasured = normalizeMeasuredBoundsWithVisibilityGate({
66
69
  measured,
67
- measuredOrigin,
68
- );
70
+ origin: measuredOrigin,
71
+ visibilityBlocked: escapeClipping && visibilityBlocked.get(),
72
+ visibilityBlockOffset: getVisibilityBlockOffset(viewportHeight),
73
+ viewportWidth,
74
+ viewportHeight,
75
+ });
69
76
 
70
77
  /**
71
78
  * - Destination Pass -
@@ -119,6 +126,7 @@ export const useMeasurer = ({
119
126
  scrollMetadata,
120
127
  pendingLifecycleStartBlockCount,
121
128
  originRef,
129
+ visibilityBlocked,
122
130
  ],
123
131
  );
124
132
  };
@@ -0,0 +1,43 @@
1
+ import { useLayoutEffect } from "react";
2
+ import type { View } from "react-native";
3
+ import type { AnimatedRef } from "react-native-reanimated";
4
+ import { logger } from "../../../utils/logger";
5
+ import {
6
+ TARGET_OUTSIDE_ROOT_WARNING,
7
+ useBoundaryRootContext,
8
+ } from "../providers/boundary-root.provider";
9
+
10
+ interface RegisterTargetProps {
11
+ targetAnimatedRef: AnimatedRef<View>;
12
+ preparedStyles: Record<string, any>;
13
+ measurementRef: AnimatedRef<View>;
14
+ }
15
+
16
+ export const useRegisterTarget = ({
17
+ targetAnimatedRef,
18
+ preparedStyles,
19
+ measurementRef,
20
+ }: RegisterTargetProps) => {
21
+ const rootContext = useBoundaryRootContext();
22
+ const registerTargetRef = rootContext?.registerTargetRef;
23
+ const unregisterTargetRef = rootContext?.unregisterTargetRef;
24
+ useLayoutEffect(() => {
25
+ if (!registerTargetRef || !unregisterTargetRef) {
26
+ if (__DEV__) {
27
+ logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
28
+ }
29
+ return;
30
+ }
31
+
32
+ registerTargetRef(targetAnimatedRef, preparedStyles, measurementRef);
33
+ return () => {
34
+ unregisterTargetRef(targetAnimatedRef);
35
+ };
36
+ }, [
37
+ registerTargetRef,
38
+ unregisterTargetRef,
39
+ targetAnimatedRef,
40
+ preparedStyles,
41
+ measurementRef,
42
+ ]);
43
+ };
@@ -53,7 +53,7 @@ type BoundaryRootComponent = typeof BoundaryRoot;
53
53
  * Use:
54
54
  * - `Boundary` for passive and pressable shared elements.
55
55
  * - `Boundary.Target` to measure a nested descendant instead of the root.
56
- * - `Boundary.Host` to make nested portal placement explicit.
56
+ * - `Boundary.Host` to make clipping-escape host placement explicit.
57
57
  */
58
58
  export interface BoundaryComponent extends BoundaryRootComponent {
59
59
  /**
@@ -61,7 +61,7 @@ export interface BoundaryComponent extends BoundaryRootComponent {
61
61
  */
62
62
  Target: typeof BoundaryTarget;
63
63
  /**
64
- * Explicit portal host for scrollable or otherwise clipped coordinate spaces.
64
+ * Explicit host for clipping-escape placement.
65
65
  */
66
66
  Host: typeof Host;
67
67
  /**
@@ -0,0 +1,48 @@
1
+ import { memo, type ReactNode } from "react";
2
+ import { StyleSheet } from "react-native";
3
+ import Animated from "react-native-reanimated";
4
+ import { NativePortalHost } from "../../../teleport";
5
+ import { createBoundaryContentPortalHostName } from "../helpers/host-name";
6
+
7
+ const AnimatedPortalHost = NativePortalHost
8
+ ? Animated.createAnimatedComponent(NativePortalHost)
9
+ : null;
10
+
11
+ type BoundaryContentPortalHostProps = {
12
+ boundaryId: string;
13
+ children: ReactNode;
14
+ enabled: boolean;
15
+ screenKey: string;
16
+ };
17
+
18
+ export const BoundaryContentPortalHost = memo(
19
+ function BoundaryContentPortalHost({
20
+ boundaryId,
21
+ children,
22
+ enabled,
23
+ screenKey,
24
+ }: BoundaryContentPortalHostProps) {
25
+ if (!enabled || !AnimatedPortalHost) {
26
+ return <>{children}</>;
27
+ }
28
+
29
+ const portalHostName = createBoundaryContentPortalHostName(
30
+ screenKey,
31
+ boundaryId,
32
+ );
33
+
34
+ return (
35
+ <>
36
+ {children}
37
+ <AnimatedPortalHost name={portalHostName} style={styles.host} />
38
+ </>
39
+ );
40
+ },
41
+ );
42
+
43
+ const styles = StyleSheet.create({
44
+ host: {
45
+ ...StyleSheet.absoluteFillObject,
46
+ overflow: "visible",
47
+ },
48
+ });
@@ -0,0 +1,9 @@
1
+ const BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX = "-content-portal-host";
2
+
3
+ export const createBoundaryContentPortalHostName = (
4
+ screenKey: string,
5
+ boundaryId: string,
6
+ ) => {
7
+ "worklet";
8
+ return `${screenKey}-${boundaryId}${BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX}`;
9
+ };