react-native-screen-transitions 3.9.0-alpha.2 → 3.9.0-alpha.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 (421) hide show
  1. package/lib/commonjs/shared/components/boundary/components/boundary-target.js +14 -9
  2. package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
  3. package/lib/commonjs/shared/components/boundary/create-boundary-component.js +66 -28
  4. package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
  5. package/lib/commonjs/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
  6. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  7. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +27 -10
  8. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  9. package/lib/commonjs/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +5 -7
  10. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  11. package/lib/commonjs/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +4 -4
  12. package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  13. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +14 -35
  14. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  15. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +5 -6
  16. package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  17. package/lib/commonjs/shared/components/boundary/index.js +26 -29
  18. package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
  19. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +58 -0
  20. package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  21. package/lib/commonjs/shared/components/boundary/portal/components/host.js +20 -4
  22. package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -1
  23. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  24. package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  25. package/lib/commonjs/shared/components/boundary/portal/components/portal.js +206 -96
  26. package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
  27. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +14 -2
  28. package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  29. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
  30. package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  31. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
  32. package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  33. package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
  34. package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
  35. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
  36. package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  37. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
  38. package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
  39. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -49
  40. package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  41. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
  42. package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  43. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
  44. package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  45. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
  46. package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  47. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
  48. package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  49. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
  50. package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  51. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  52. package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  53. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +1 -22
  54. package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
  55. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
  56. package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  57. package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
  58. package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
  59. package/lib/commonjs/shared/index.js.map +1 -1
  60. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
  61. package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  62. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
  63. package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  64. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  65. package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  66. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
  67. package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  68. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  69. package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  70. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  71. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  72. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  73. package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  74. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
  75. package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  76. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  77. package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  78. package/lib/commonjs/shared/providers/screen/styles/index.js +16 -3
  79. package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
  80. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +22 -51
  81. package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
  82. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
  83. package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  84. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +22 -2
  85. package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  86. package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
  87. package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
  88. package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
  89. package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
  90. package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
  91. package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
  92. package/lib/commonjs/shared/stores/system.store.js +5 -0
  93. package/lib/commonjs/shared/stores/system.store.js.map +1 -1
  94. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
  95. package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  96. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
  97. package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  98. package/lib/module/shared/components/boundary/components/boundary-target.js +12 -7
  99. package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
  100. package/lib/module/shared/components/boundary/create-boundary-component.js +67 -29
  101. package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
  102. package/lib/module/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +8 -4
  103. package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
  104. package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +27 -10
  105. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
  106. package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +5 -7
  107. package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
  108. package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +4 -4
  109. package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
  110. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +15 -36
  111. package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
  112. package/lib/module/shared/components/boundary/hooks/use-measurer.js +5 -6
  113. package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
  114. package/lib/module/shared/components/boundary/index.js +26 -29
  115. package/lib/module/shared/components/boundary/index.js.map +1 -1
  116. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
  117. package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
  118. package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
  119. package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
  120. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
  121. package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
  122. package/lib/module/shared/components/boundary/portal/components/portal.js +212 -102
  123. package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
  124. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
  125. package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
  126. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
  127. package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
  128. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
  129. package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
  130. package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
  131. package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
  132. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
  133. package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
  134. package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
  135. package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
  136. package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -49
  137. package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
  138. package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
  139. package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
  140. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
  141. package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
  142. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
  143. package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
  144. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
  145. package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
  146. package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
  147. package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
  148. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +6 -7
  149. package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
  150. package/lib/module/shared/components/boundary/utils/destination-signals.js +2 -23
  151. package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
  152. package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
  153. package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
  154. package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
  155. package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
  156. package/lib/module/shared/index.js.map +1 -1
  157. package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
  158. package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
  159. package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
  160. package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
  161. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +1 -0
  162. package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
  163. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
  164. package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
  165. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
  166. package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
  167. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +9 -3
  168. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
  169. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
  170. package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
  171. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
  172. package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
  173. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +16 -3
  174. package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
  175. package/lib/module/shared/providers/screen/styles/index.js +2 -1
  176. package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
  177. package/lib/module/shared/providers/screen/styles/slot.provider.js +22 -47
  178. package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
  179. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
  180. package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
  181. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +19 -1
  182. package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
  183. package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
  184. package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
  185. package/lib/module/shared/stores/bounds/internals/links.js +135 -53
  186. package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
  187. package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
  188. package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
  189. package/lib/module/shared/stores/system.store.js +5 -0
  190. package/lib/module/shared/stores/system.store.js.map +1 -1
  191. package/lib/module/shared/types/animation.types.js.map +1 -1
  192. package/lib/module/shared/utils/bounds/helpers/styles/compute.js +10 -69
  193. package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
  194. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
  195. package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
  196. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +1 -2
  197. package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
  198. package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
  199. package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
  200. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -2
  201. package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
  202. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
  203. package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
  204. package/lib/typescript/native-stack/views/NativeStackView.d.ts +1 -2
  205. package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
  206. package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
  207. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
  208. package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
  209. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
  210. package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
  211. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
  212. package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
  213. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
  214. package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
  215. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +1 -1
  216. package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
  217. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts +0 -1
  218. package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
  219. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
  220. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
  221. package/lib/typescript/shared/components/boundary/hooks/{use-initial-destination-measurement.d.ts → lifecycles/use-initial-destination-measurement.d.ts} +2 -2
  222. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
  223. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
  224. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
  225. package/lib/typescript/shared/components/boundary/hooks/{use-refresh-boundary.d.ts → lifecycles/use-refresh-boundary.d.ts} +2 -2
  226. package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
  227. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +5 -9
  228. package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
  229. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +4 -3
  230. package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
  231. package/lib/typescript/shared/components/boundary/index.d.ts +35 -24
  232. package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
  233. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
  234. package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
  235. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
  236. package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
  237. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +2 -2
  238. package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
  239. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +1 -1
  240. package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
  241. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
  242. package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
  243. package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
  244. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
  245. package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
  246. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
  247. package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
  248. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
  249. package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
  250. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
  251. package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
  252. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
  253. package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
  254. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +16 -32
  255. package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
  256. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
  257. package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
  258. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
  259. package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
  260. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
  261. package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
  262. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
  263. package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
  264. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
  265. package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
  266. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +7 -12
  267. package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  268. package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
  269. package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
  270. package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
  271. package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
  272. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
  273. package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -1
  274. package/lib/typescript/shared/components/create-transition-aware-component.d.ts +6 -5
  275. package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
  276. package/lib/typescript/shared/components/masked-view.d.ts +1 -1
  277. package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
  278. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
  279. package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
  280. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
  281. package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
  282. package/lib/typescript/shared/components/scene-view.d.ts +1 -1
  283. package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
  284. package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
  285. package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
  286. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +1 -1
  287. package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
  288. package/lib/typescript/shared/components/screen-container/layers/content.d.ts +1 -1
  289. package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
  290. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +1 -1
  291. package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
  292. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts +1 -1
  293. package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
  294. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
  295. package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
  296. package/lib/typescript/shared/index.d.ts +711 -667
  297. package/lib/typescript/shared/index.d.ts.map +1 -1
  298. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
  299. package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
  300. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
  301. package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
  302. package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
  303. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
  304. package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
  305. package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
  306. package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
  307. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
  308. package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts.map +1 -1
  309. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
  310. package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
  311. package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
  312. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
  313. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
  314. package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
  315. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
  316. package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
  317. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -1
  318. package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
  319. package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
  320. package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
  321. package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
  322. package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +5 -10
  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 +6 -0
  325. package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
  326. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +2 -0
  327. package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
  328. package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
  329. package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
  330. package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
  331. package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
  332. package/lib/typescript/shared/stores/bounds/types.d.ts +9 -20
  333. package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
  334. package/lib/typescript/shared/stores/system.store.d.ts +1 -0
  335. package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
  336. package/lib/typescript/shared/types/animation.types.d.ts +7 -1
  337. package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
  338. package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
  339. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts +6 -0
  340. package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
  341. package/package.json +1 -1
  342. package/src/shared/components/boundary/components/boundary-target.tsx +21 -7
  343. package/src/shared/components/boundary/create-boundary-component.tsx +92 -28
  344. package/src/shared/components/boundary/hooks/{use-boundary-presence.ts → lifecycles/use-boundary-presence.ts} +16 -5
  345. package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +40 -13
  346. package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +7 -9
  347. package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +6 -6
  348. package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +15 -45
  349. package/src/shared/components/boundary/hooks/use-measurer.ts +9 -14
  350. package/src/shared/components/boundary/index.tsx +55 -29
  351. package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
  352. package/src/shared/components/boundary/portal/components/host.tsx +20 -5
  353. package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +67 -52
  354. package/src/shared/components/boundary/portal/components/portal.tsx +280 -119
  355. package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
  356. package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
  357. package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
  358. package/src/shared/components/boundary/portal/teleport.ts +28 -3
  359. package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
  360. package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
  361. package/src/shared/components/boundary/portal/utils/offset-style.ts +37 -139
  362. package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
  363. package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
  364. package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
  365. package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
  366. package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
  367. package/src/shared/components/boundary/providers/boundary-root.provider.tsx +9 -18
  368. package/src/shared/components/boundary/types.ts +9 -39
  369. package/src/shared/components/boundary/utils/destination-signals.ts +1 -32
  370. package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
  371. package/src/shared/components/boundary/utils/source-signals.ts +5 -17
  372. package/src/shared/index.ts +0 -5
  373. package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
  374. package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
  375. package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -0
  376. package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
  377. package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
  378. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +14 -2
  379. package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -0
  380. package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
  381. package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +21 -3
  382. package/src/shared/providers/screen/styles/index.tsx +8 -3
  383. package/src/shared/providers/screen/styles/slot.provider.tsx +36 -54
  384. package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
  385. package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +24 -1
  386. package/src/shared/stores/bounds/internals/entries.ts +13 -5
  387. package/src/shared/stores/bounds/internals/links.ts +167 -85
  388. package/src/shared/stores/bounds/internals/resolver.ts +0 -2
  389. package/src/shared/stores/bounds/types.ts +10 -22
  390. package/src/shared/stores/system.store.ts +6 -0
  391. package/src/shared/types/animation.types.ts +8 -1
  392. package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
  393. package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
  394. package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  395. package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  396. package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  397. package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  398. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +0 -36
  399. package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  400. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
  401. package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  402. package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
  403. package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
  404. package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
  405. package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
  406. package/lib/module/shared/components/boundary/portal/resolve-portal.js +0 -31
  407. package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +0 -1
  408. package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
  409. package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
  410. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -9
  411. package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
  412. package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
  413. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
  414. package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
  415. package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
  416. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +0 -14
  417. package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +0 -1
  418. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
  419. package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
  420. package/src/shared/components/boundary/portal/resolve-portal.ts +0 -40
  421. package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
@@ -2,18 +2,22 @@ import {
2
2
  type ComponentType,
3
3
  forwardRef,
4
4
  memo,
5
+ type ReactNode,
5
6
  useImperativeHandle,
6
7
  useMemo,
7
8
  } from "react";
8
- import Animated from "react-native-reanimated";
9
+ import type { View } from "react-native";
10
+ import Animated, { useAnimatedRef } from "react-native-reanimated";
9
11
  import { useDescriptorsStore } from "../../providers/screen/descriptors";
10
12
  import {
13
+ useComposedSlotStyles,
11
14
  useSlotStackingStyles,
12
- useSlotStyles,
13
15
  } from "../../providers/screen/styles";
14
16
  import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
15
17
  import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
16
- import { resolveBoundaryPortal } from "./portal/resolve-portal";
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";
17
21
  import {
18
22
  BoundaryRootProvider,
19
23
  useBoundaryRootState,
@@ -22,14 +26,29 @@ import type { BoundaryComponentProps } from "./types";
22
26
 
23
27
  interface CreateBoundaryComponentOptions {
24
28
  alreadyAnimated?: boolean;
25
- shouldAutoMeasure?: boolean;
26
29
  }
27
30
 
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
+
28
47
  export function createBoundaryComponent<P extends object>(
29
48
  Wrapped: ComponentType<P>,
30
49
  options: CreateBoundaryComponentOptions = {},
31
50
  ) {
32
- const { alreadyAnimated = false, shouldAutoMeasure = false } = options;
51
+ const { alreadyAnimated = false } = options;
33
52
  const AnimatedComponent = alreadyAnimated
34
53
  ? Wrapped
35
54
  : Animated.createAnimatedComponent(Wrapped);
@@ -48,7 +67,9 @@ export function createBoundaryComponent<P extends object>(
48
67
  method,
49
68
  style,
50
69
  onPress,
51
- portal: portalProp,
70
+ handoff,
71
+ escapeClipping,
72
+ children,
52
73
  ...rest
53
74
  } = props as any;
54
75
 
@@ -56,7 +77,10 @@ export function createBoundaryComponent<P extends object>(
56
77
  () => createBoundTag(String(id), group),
57
78
  [id, group],
58
79
  );
59
- const portal = resolveBoundaryPortal(portalProp);
80
+ const portalRuntime = resolveBoundaryPortal({
81
+ handoff,
82
+ escapeClipping,
83
+ });
60
84
 
61
85
  const currentScreenKey = useDescriptorsStore(
62
86
  (s) => s.derivations.currentScreenKey,
@@ -68,9 +92,12 @@ export function createBoundaryComponent<P extends object>(
68
92
  // Associated slot styles attach whenever the boundary is enabled,
69
93
  // independent of whether an interpolator is configured for this transition.
70
94
  const shouldAttachAssociatedStyles = enabled;
95
+ const canPortalRoot =
96
+ portalRuntime.enabled && hasRenderableChildren(children);
71
97
 
72
- const associatedStyles = useSlotStyles(boundTag.tag);
98
+ const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
73
99
  const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
100
+ const rootPlaceholderRef = useAnimatedRef<View>();
74
101
 
75
102
  const {
76
103
  ref,
@@ -80,13 +107,11 @@ export function createBoundaryComponent<P extends object>(
80
107
  targetPreparedStyles,
81
108
  } = useBoundaryRootState({
82
109
  boundTag,
83
- portal,
84
- associatedTargetStyles: shouldAttachAssociatedStyles
85
- ? associatedStyles
86
- : undefined,
110
+ portalRuntime,
111
+ rootMeasurementRef: canPortalRoot ? rootPlaceholderRef : undefined,
87
112
  });
88
113
 
89
- const { onPress: resolvedOnPress } = useBoundaryMeasurement({
114
+ useBoundaryMeasurement({
90
115
  boundTag,
91
116
  enabled,
92
117
  runtimeEnabled,
@@ -94,40 +119,79 @@ export function createBoundaryComponent<P extends object>(
94
119
  measuredRef,
95
120
  style,
96
121
  targetPreparedStyles,
97
- portal,
98
- shouldAutoMeasure,
122
+ handoff: portalRuntime.handoff,
123
+ escapeClipping: portalRuntime.escapeClipping,
99
124
  config: { anchor, scaleMode, target, method },
100
- onPress,
101
125
  });
102
126
 
103
127
  useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
104
128
 
129
+ const shouldPortalRoot = canPortalRoot && !hasActiveTarget;
105
130
  // A nested active target takes the full associated style, so the root keeps
106
- // only its stacking context; otherwise the root wears the full style.
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.
107
137
  const attachedStyle = shouldAttachAssociatedStyles
108
138
  ? hasActiveTarget
109
139
  ? associatedStackingStyles
110
- : associatedStyles
140
+ : shouldPortalRoot
141
+ ? undefined
142
+ : associatedStyles
111
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
+ );
112
170
 
113
171
  return (
114
172
  <BoundaryRootProvider value={contextValue}>
115
- <AnimatedComponent
116
- {...rest}
117
- ref={ref}
118
- style={[style, attachedStyle]}
119
- onPress={resolvedOnPress}
120
- collapsable={false}
121
- />
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
+ }
182
+ >
183
+ {boundaryRoot}
184
+ </Portal>
185
+ ) : (
186
+ boundaryRoot
187
+ )}
122
188
  </BoundaryRootProvider>
123
189
  );
124
190
  });
125
191
 
126
192
  // The HOC's runtime identity (animated + memoized forwardRef) is not
127
193
  // expressible against the public boundary props, so assert it here.
128
- return memo(
129
- Animated.createAnimatedComponent(Inner),
130
- ) as unknown as React.MemoExoticComponent<
194
+ return memo(Inner) as unknown as React.MemoExoticComponent<
131
195
  React.ForwardRefExoticComponent<
132
196
  BoundaryComponentProps<P> &
133
197
  React.RefAttributes<React.ComponentRef<typeof Wrapped>>
@@ -3,17 +3,26 @@ import { runOnUI } from "react-native-reanimated";
3
3
  import {
4
4
  removeEntry,
5
5
  setEntry,
6
- } from "../../../stores/bounds/internals/entries";
7
- import type { BoundTag } from "../../../stores/bounds/types";
8
- import type { BoundaryConfigProps } from "../types";
6
+ } from "../../../../stores/bounds/internals/entries";
7
+ import type { BoundTag } from "../../../../stores/bounds/types";
8
+ import type { BoundaryConfigProps } from "../../types";
9
9
 
10
10
  export const useBoundaryPresence = (params: {
11
11
  enabled: boolean;
12
12
  boundTag: BoundTag;
13
13
  currentScreenKey: string;
14
14
  boundaryConfig?: BoundaryConfigProps;
15
+ handoff?: boolean;
16
+ escapeClipping?: boolean;
15
17
  }) => {
16
- const { enabled, boundTag, currentScreenKey, boundaryConfig } = params;
18
+ const {
19
+ enabled,
20
+ boundTag,
21
+ currentScreenKey,
22
+ boundaryConfig,
23
+ handoff,
24
+ escapeClipping,
25
+ } = params;
17
26
  const { tag } = boundTag;
18
27
 
19
28
  useLayoutEffect(() => {
@@ -21,10 +30,12 @@ export const useBoundaryPresence = (params: {
21
30
 
22
31
  runOnUI(setEntry)(tag, currentScreenKey, {
23
32
  boundaryConfig,
33
+ handoff: handoff ? true : null,
34
+ escapeClipping: escapeClipping ? true : null,
24
35
  });
25
36
 
26
37
  return () => {
27
38
  runOnUI(removeEntry)(tag, currentScreenKey);
28
39
  };
29
- }, [enabled, tag, currentScreenKey, boundaryConfig]);
40
+ }, [enabled, tag, currentScreenKey, boundaryConfig, handoff, escapeClipping]);
30
41
  };
@@ -5,18 +5,27 @@ import {
5
5
  withDelay,
6
6
  withTiming,
7
7
  } from "react-native-reanimated";
8
- import { useDescriptorsStore } from "../../../providers/screen/descriptors";
9
- import { AnimationStore } from "../../../stores/animation.store";
10
- import { getDestination } from "../../../stores/bounds/internals/links";
11
- import { pairs } from "../../../stores/bounds/internals/state";
12
- import type { BoundTag } from "../../../stores/bounds/types";
8
+ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
9
+ import { AnimationStore } from "../../../../stores/animation.store";
10
+ import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
11
+ import { getEntry } from "../../../../stores/bounds/internals/entries";
12
+ import {
13
+ getDestination,
14
+ getLink,
15
+ } from "../../../../stores/bounds/internals/links";
16
+ import { pairs } from "../../../../stores/bounds/internals/state";
17
+ import type { BoundTag } from "../../../../stores/bounds/types";
13
18
  import {
14
19
  LifecycleTransitionRequestKind,
15
20
  SystemStore,
16
- } from "../../../stores/system.store";
17
- import { logger } from "../../../utils/logger";
18
- import type { MeasureBoundary } from "../types";
19
- import { getInitialDestinationMeasurePairKey } from "../utils/destination-signals";
21
+ } from "../../../../stores/system.store";
22
+ import { logger } from "../../../../utils/logger";
23
+ import {
24
+ hasHandoffEscapeContinuation,
25
+ usesEscapeClippingHost,
26
+ } from "../../portal/utils/ownership";
27
+ import type { MeasureBoundary } from "../../types";
28
+ import { getInitialDestinationMeasurePairKey } from "../../utils/destination-signals";
20
29
 
21
30
  const VIEWPORT_RETRY_DELAY_MS = 100;
22
31
  /**
@@ -37,7 +46,7 @@ export const useInitialDestinationMeasurement = ({
37
46
  enabled,
38
47
  measureBoundary,
39
48
  }: UseInitialDestinationMeasurementParams) => {
40
- const { linkKey, group } = boundTag;
49
+ const { tag, linkKey, group } = boundTag;
41
50
  const currentScreenKey = useDescriptorsStore(
42
51
  (s) => s.derivations.currentScreenKey,
43
52
  );
@@ -109,9 +118,6 @@ export const useInitialDestinationMeasurement = ({
109
118
  ([measurePairKey, retryTick], previous) => {
110
119
  "worklet";
111
120
  if (!measurePairKey) {
112
- releaseLifecycleStartBlock();
113
- viewportRetries.set(0);
114
- hasGivenUp.set(0);
115
121
  return;
116
122
  }
117
123
 
@@ -143,6 +149,27 @@ export const useInitialDestinationMeasurement = ({
143
149
  getDestination(measurePairKey, linkKey) !== null;
144
150
 
145
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) {
168
+ // Screen-level escape has a second readiness phase after destination
169
+ // measurement: the host must commit before the transition starts, or
170
+ // the payload can disappear for a frame.
171
+ return;
172
+ }
146
173
  releaseLifecycleStartBlock();
147
174
  viewportRetries.set(0);
148
175
  return;
@@ -1,17 +1,16 @@
1
1
  import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
2
- import { useDescriptorsStore } from "../../../providers/screen/descriptors";
3
- import { pairs } from "../../../stores/bounds/internals/state";
4
- import type { BoundTag } from "../../../stores/bounds/types";
5
- import type { MeasureBoundary } from "../types";
6
- import { getInitialSourceCaptureSignal } from "../utils/source-signals";
2
+ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
3
+ import { pairs } from "../../../../stores/bounds/internals/state";
4
+ import type { BoundTag } from "../../../../stores/bounds/types";
5
+ import type { MeasureBoundary } from "../../types";
6
+ import { getInitialSourceCaptureSignal } from "../../utils/source-signals";
7
7
 
8
8
  export const useInitialSourceMeasurement = (params: {
9
9
  enabled: boolean;
10
10
  measureBoundary: MeasureBoundary;
11
11
  boundTag: BoundTag;
12
- shouldAutoMeasure: boolean;
13
12
  }) => {
14
- const { enabled, measureBoundary, boundTag, shouldAutoMeasure } = params;
13
+ const { enabled, measureBoundary, boundTag } = params;
15
14
  const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
16
15
  const lastSourceCaptureSignal = useSharedValue<string | null>(null);
17
16
 
@@ -23,8 +22,7 @@ export const useInitialSourceMeasurement = (params: {
23
22
  sourcePairKey,
24
23
  linkId: boundTag.linkKey,
25
24
  group: boundTag.group,
26
- shouldAutoMeasure,
27
- linkState: shouldAutoMeasure && sourcePairKey ? pairs.get() : undefined,
25
+ linkState: sourcePairKey ? pairs.get() : undefined,
28
26
  });
29
27
  },
30
28
  (captureSignal) => {
@@ -1,10 +1,10 @@
1
1
  import { useAnimatedReaction } from "react-native-reanimated";
2
- import { useDescriptorsStore } from "../../../providers/screen/descriptors";
3
- import { AnimationStore } from "../../../stores/animation.store";
4
- import { pairs } from "../../../stores/bounds/internals/state";
5
- import type { BoundTag } from "../../../stores/bounds/types";
6
- import type { MeasureBoundary } from "../types";
7
- import { getRefreshBoundarySignal } from "../utils/refresh-signals";
2
+ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
3
+ import { AnimationStore } from "../../../../stores/animation.store";
4
+ import { pairs } from "../../../../stores/bounds/internals/state";
5
+ import type { BoundTag } from "../../../../stores/bounds/types";
6
+ import type { MeasureBoundary } from "../../types";
7
+ import { getRefreshBoundarySignal } from "../../utils/refresh-signals";
8
8
 
9
9
  interface UseRefreshBoundaryParams {
10
10
  enabled: boolean;
@@ -1,17 +1,14 @@
1
- import { useCallback, useMemo } from "react";
1
+ import { useMemo } from "react";
2
2
  import type { View } from "react-native";
3
3
  import type { AnimatedRef, StyleProps } from "react-native-reanimated";
4
- import { runOnUI } from "react-native-reanimated";
5
- import { createPendingPairKey } from "../../../stores/bounds/helpers/link-pairs.helpers";
6
4
  import type { BoundTag } from "../../../stores/bounds/types";
7
5
  import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
8
- import { resolvePortalHost } from "../portal/resolve-portal";
9
- import type { BoundaryConfigProps, BoundaryPortal } from "../types";
10
- import { useBoundaryPresence } from "./use-boundary-presence";
11
- import { useInitialDestinationMeasurement } from "./use-initial-destination-measurement";
12
- import { useInitialSourceMeasurement } from "./use-initial-source-measurement";
6
+ import type { BoundaryConfigProps } from "../types";
7
+ import { useBoundaryPresence } from "./lifecycles/use-boundary-presence";
8
+ import { useInitialDestinationMeasurement } from "./lifecycles/use-initial-destination-measurement";
9
+ import { useInitialSourceMeasurement } from "./lifecycles/use-initial-source-measurement";
10
+ import { useRefreshBoundary } from "./lifecycles/use-refresh-boundary";
13
11
  import { useMeasurer } from "./use-measurer";
14
- import { useRefreshBoundary } from "./use-refresh-boundary";
15
12
 
16
13
  interface UseBoundaryMeasurementParams {
17
14
  boundTag: BoundTag;
@@ -25,17 +22,15 @@ interface UseBoundaryMeasurementParams {
25
22
  /** Root's own style; ignored when a nested target supplies its own. */
26
23
  style?: unknown;
27
24
  targetPreparedStyles?: StyleProps;
28
- portal?: BoundaryPortal;
29
- shouldAutoMeasure: boolean;
25
+ handoff: boolean;
26
+ escapeClipping: boolean;
30
27
  config: BoundaryConfigProps;
31
- onPress?: (...args: unknown[]) => void;
32
28
  }
33
29
 
34
30
  /**
35
31
  * Owns the full measurement lifecycle for a boundary: builds the measurer,
36
32
  * registers presence, runs the initial source/destination + refresh reactions,
37
- * and returns the press-priority `onPress`. The component never touches the
38
- * measurer itself.
33
+ * and keeps the component itself away from the measurer.
39
34
  */
40
35
  export const useBoundaryMeasurement = ({
41
36
  boundTag,
@@ -45,10 +40,9 @@ export const useBoundaryMeasurement = ({
45
40
  measuredRef,
46
41
  style,
47
42
  targetPreparedStyles,
48
- portal,
49
- shouldAutoMeasure,
43
+ handoff,
44
+ escapeClipping,
50
45
  config,
51
- onPress,
52
46
  }: UseBoundaryMeasurementParams) => {
53
47
  const { anchor, scaleMode, target, method } = config;
54
48
  const boundaryConfig = useMemo<BoundaryConfigProps>(
@@ -62,15 +56,14 @@ export const useBoundaryMeasurement = ({
62
56
  );
63
57
  const preparedStyles = targetPreparedStyles ?? rootPreparedStyles;
64
58
 
65
- const portalHost = resolvePortalHost(portal);
66
-
67
59
  const measureBoundary = useMeasurer({
68
60
  enabled,
69
61
  boundTag,
70
62
  currentScreenKey,
71
63
  preparedStyles,
72
64
  measuredAnimatedRef: measuredRef,
73
- portalHost,
65
+ handoff,
66
+ escapeClipping,
74
67
  });
75
68
 
76
69
  // Register/unregister this boundary in the presence map so source/destination
@@ -80,18 +73,14 @@ export const useBoundaryMeasurement = ({
80
73
  boundTag,
81
74
  currentScreenKey,
82
75
  boundaryConfig,
76
+ handoff,
77
+ escapeClipping,
83
78
  });
84
79
 
85
- // Passive auto-measurement only applies to non-pressable boundaries; pressable
86
- // ones capture their source on press (see handlePress below).
87
- const shouldPassivelyMeasureSource =
88
- shouldAutoMeasure && typeof onPress !== "function";
89
-
90
80
  useInitialSourceMeasurement({
91
81
  enabled: runtimeEnabled,
92
82
  measureBoundary,
93
83
  boundTag,
94
- shouldAutoMeasure: shouldPassivelyMeasureSource,
95
84
  });
96
85
 
97
86
  useInitialDestinationMeasurement({
@@ -105,23 +94,4 @@ export const useBoundaryMeasurement = ({
105
94
  boundTag,
106
95
  measureBoundary,
107
96
  });
108
-
109
- const handlePress = useCallback(
110
- (...args: unknown[]) => {
111
- // Press path has priority: capture source before user onPress/navigation.
112
- runOnUI(measureBoundary)({
113
- type: "source",
114
- pairKey: createPendingPairKey(currentScreenKey),
115
- });
116
-
117
- if (typeof onPress === "function") {
118
- onPress(...args);
119
- }
120
- },
121
- [measureBoundary, onPress, currentScreenKey],
122
- );
123
-
124
- return {
125
- onPress: typeof onPress === "function" ? handlePress : undefined,
126
- };
127
97
  };
@@ -8,13 +8,9 @@ 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 type {
12
- BoundsPortalAttachTarget,
13
- BoundTag,
14
- } from "../../../stores/bounds/types";
11
+ import type { BoundTag } from "../../../stores/bounds/types";
15
12
  import { ScrollStore } from "../../../stores/scroll.store";
16
13
  import { SystemStore } from "../../../stores/system.store";
17
- import { getActiveScrollHost } from "../portal/stores/host-registry.store";
18
14
  import type { MeasureBoundary } from "../types";
19
15
  import {
20
16
  attachScrollSnapshotToMeasuredBounds,
@@ -29,7 +25,8 @@ interface UseMeasurerParams {
29
25
  currentScreenKey: string;
30
26
  preparedStyles: StyleProps;
31
27
  measuredAnimatedRef: AnimatedRef<View>;
32
- portalHost?: BoundsPortalAttachTarget;
28
+ handoff: boolean;
29
+ escapeClipping: boolean;
33
30
  }
34
31
 
35
32
  export const useMeasurer = ({
@@ -38,7 +35,8 @@ export const useMeasurer = ({
38
35
  currentScreenKey,
39
36
  preparedStyles,
40
37
  measuredAnimatedRef,
41
- portalHost,
38
+ handoff,
39
+ escapeClipping,
42
40
  }: UseMeasurerParams): MeasureBoundary => {
43
41
  const { width: viewportWidth, height: viewportHeight } =
44
42
  useWindowDimensions();
@@ -94,10 +92,6 @@ export const useMeasurer = ({
94
92
  normalizedMeasured,
95
93
  scrollMetadata.get(),
96
94
  );
97
- const sourceHost =
98
- target.type === "source"
99
- ? (getActiveScrollHost(currentScreenKey) ?? undefined)
100
- : undefined;
101
95
 
102
96
  applyMeasuredBoundsWrites({
103
97
  entryTag: boundTag.tag,
@@ -107,8 +101,8 @@ export const useMeasurer = ({
107
101
  measured: measuredWithScroll,
108
102
  preparedStyles,
109
103
  linkWrite: target,
110
- portalHost,
111
- sourceHost,
104
+ handoff,
105
+ escapeClipping,
112
106
  });
113
107
  },
114
108
  [
@@ -117,7 +111,8 @@ export const useMeasurer = ({
117
111
  currentScreenKey,
118
112
  preparedStyles,
119
113
  measuredAnimatedRef,
120
- portalHost,
114
+ handoff,
115
+ escapeClipping,
121
116
  viewportWidth,
122
117
  viewportHeight,
123
118
  scrollState,