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
@@ -0,0 +1,274 @@
1
+ import { useCallback, useLayoutEffect, useState } from "react";
2
+ import {
3
+ runOnJS,
4
+ useAnimatedProps,
5
+ useAnimatedReaction,
6
+ useSharedValue,
7
+ } from "react-native-reanimated";
8
+ import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
9
+ import { useScreenSlots } from "../../../../../../providers/screen/styles";
10
+ import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
11
+ import { AnimationStore } from "../../../../../../stores/animation.store";
12
+ import { pairs } from "../../../../../../stores/bounds/internals/state";
13
+ import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
14
+ import {
15
+ canSwitchHandoffHostImmediately,
16
+ isHandoffHostClosingComplete,
17
+ type PortalOwnershipSignal,
18
+ resolveBoundaryPortalOwnership,
19
+ } from "../../../utils/ownership";
20
+ import { shallowEqual } from "../../../utils/shallow-equal";
21
+ import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
22
+ import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
23
+ import { createBoundaryContentPortalHostName } from "../helpers/host-name";
24
+
25
+ interface UseBoundaryContentPortalAttachmentParams {
26
+ boundaryId: string;
27
+ enabled: boolean;
28
+ }
29
+
30
+ export const useBoundaryContentPortalAttachment = ({
31
+ boundaryId,
32
+ enabled,
33
+ }: UseBoundaryContentPortalAttachmentParams) => {
34
+ const ownScreenSlots = useScreenSlots();
35
+ const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
36
+ const currentScreenKey = useDescriptorsStore(
37
+ (s) => s.derivations.currentScreenKey,
38
+ );
39
+ const [ownership, setOwnership] = useState<Extract<
40
+ PortalOwnershipSignal,
41
+ { status: "complete" }
42
+ > | null>(null);
43
+
44
+ const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
45
+ const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
46
+ const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
47
+ const {
48
+ nextInterpolatorReady: activeNextInterpolatorReady,
49
+ slotsMap: activeSlotsMap,
50
+ } = activeScreenSlots;
51
+ const requestedPortalHostName = useSharedValue<string | null>(null);
52
+ const visiblePortalHostName = useSharedValue<string | null>(null);
53
+ const canSwitchPortalHostImmediately = useSharedValue(0);
54
+
55
+ const targetScreenKey = ownership ? ownership.hostScreenKey : null;
56
+ const settledHostScreenKey = ownership?.hostScreenKey ?? null;
57
+ const settledHostProgress = AnimationStore.getValue(
58
+ settledHostScreenKey ?? currentScreenKey,
59
+ "progressSettled",
60
+ );
61
+ const settledHostAnimating = AnimationStore.getValue(
62
+ settledHostScreenKey ?? currentScreenKey,
63
+ "progressAnimating",
64
+ );
65
+ const settledHostWillAnimate = AnimationStore.getValue(
66
+ settledHostScreenKey ?? currentScreenKey,
67
+ "willAnimate",
68
+ );
69
+ const settledHostClosing = AnimationStore.getValue(
70
+ settledHostScreenKey ?? currentScreenKey,
71
+ "closing",
72
+ );
73
+ const handoffHostName =
74
+ targetScreenKey !== null
75
+ ? createBoundaryContentPortalHostName(targetScreenKey, boundaryId)
76
+ : null;
77
+
78
+ const updatePortalOwnership = useCallback(
79
+ (
80
+ hostScreenKey: string | null,
81
+ ownerPairKey?: string,
82
+ ownerScreenKey?: string,
83
+ ) => {
84
+ if (hostScreenKey && ownerPairKey && ownerScreenKey) {
85
+ setOwnership((current) => {
86
+ if (
87
+ current?.hostScreenKey === hostScreenKey &&
88
+ current.ownerPairKey === ownerPairKey &&
89
+ current.ownerScreenKey === ownerScreenKey
90
+ ) {
91
+ return current;
92
+ }
93
+
94
+ return {
95
+ hostScreenKey,
96
+ ownerPairKey,
97
+ ownerScreenKey,
98
+ status: "complete",
99
+ };
100
+ });
101
+ return;
102
+ }
103
+
104
+ setOwnership((current) => (current ? null : current));
105
+ },
106
+ [],
107
+ );
108
+
109
+ useLayoutEffect(() => {
110
+ if (!enabled || !ownership || !handoffHostName) {
111
+ requestedPortalHostName.set(null);
112
+ visiblePortalHostName.set(null);
113
+ return;
114
+ }
115
+
116
+ requestedPortalHostName.set(handoffHostName);
117
+ }, [
118
+ enabled,
119
+ handoffHostName,
120
+ ownership,
121
+ requestedPortalHostName,
122
+ visiblePortalHostName,
123
+ ]);
124
+
125
+ useLayoutEffect(() => {
126
+ return () => {
127
+ requestedPortalHostName.set(null);
128
+ visiblePortalHostName.set(null);
129
+ };
130
+ }, [requestedPortalHostName, visiblePortalHostName]);
131
+
132
+ useAnimatedReaction(
133
+ () => {
134
+ "worklet";
135
+ if (!enabled || !sourcePairKey) {
136
+ return {
137
+ hostScreenKey: null,
138
+ ownerPairKey: sourcePairKey,
139
+ ownerScreenKey: null,
140
+ status: "clear",
141
+ };
142
+ }
143
+
144
+ const progressAnimating = settledHostAnimating.get();
145
+ const progressSettled = settledHostProgress.get();
146
+ const willAnimate = settledHostWillAnimate.get();
147
+
148
+ return resolveBoundaryPortalOwnership({
149
+ boundaryId,
150
+ currentScreenKey,
151
+ handoff: true,
152
+ isSettledHostClosingComplete: isHandoffHostClosingComplete({
153
+ closing: settledHostClosing.get(),
154
+ progressAnimating,
155
+ progressSettled,
156
+ willAnimate,
157
+ }),
158
+ isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
159
+ pairsState: pairs.get(),
160
+ settledHostScreenKey,
161
+ sourcePairKey,
162
+ });
163
+ },
164
+ (signal, previousSignal) => {
165
+ "worklet";
166
+ if (shallowEqual(previousSignal, signal)) {
167
+ return;
168
+ }
169
+
170
+ if (signal.status === "pending") {
171
+ canSwitchPortalHostImmediately.set(0);
172
+ return;
173
+ }
174
+
175
+ const hostScreenKey =
176
+ signal.status === "complete" ? signal.hostScreenKey : null;
177
+ let previousOwnerPairKey: string | undefined;
178
+
179
+ if (previousSignal?.status === "complete") {
180
+ previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
181
+ }
182
+
183
+ const canSwitchImmediately = canSwitchHandoffHostImmediately({
184
+ hostScreenKey,
185
+ ownerPairKey:
186
+ signal.status === "complete" ? signal.ownerPairKey : undefined,
187
+ previousOwnerPairKey,
188
+ });
189
+
190
+ canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
191
+
192
+ if (canSwitchImmediately && hostScreenKey) {
193
+ const hostName = createBoundaryContentPortalHostName(
194
+ hostScreenKey,
195
+ boundaryId,
196
+ );
197
+ requestedPortalHostName.set(hostName);
198
+ visiblePortalHostName.set(hostName);
199
+ }
200
+
201
+ runOnJS(updatePortalOwnership)(
202
+ signal.hostScreenKey,
203
+ signal.ownerPairKey,
204
+ signal.ownerScreenKey ?? undefined,
205
+ );
206
+ },
207
+ );
208
+
209
+ useAnimatedReaction(
210
+ () => {
211
+ "worklet";
212
+ const slot = activeSlotsMap.get()[boundaryId];
213
+ const teleport = slot?.props?.teleport;
214
+ const shouldTeleport = shouldAttachBoundaryPortal({
215
+ enabled,
216
+ teleport,
217
+ });
218
+ const requestedName = requestedPortalHostName.get();
219
+ const visibleName = visiblePortalHostName.get();
220
+ const isInterpolatorReady = activeNextInterpolatorReady.get();
221
+ const nextVisibleName = resolveNextVisiblePortalHostName({
222
+ canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
223
+ isInterpolatorReady: isInterpolatorReady === 1,
224
+ requestedName,
225
+ shouldTeleport,
226
+ visibleName,
227
+ });
228
+
229
+ return {
230
+ isInterpolatorReady,
231
+ nextVisibleName,
232
+ requestedName,
233
+ shouldTeleport,
234
+ teleport,
235
+ visibleName,
236
+ };
237
+ },
238
+ (state, previousState) => {
239
+ "worklet";
240
+ if (shallowEqual(previousState, state)) {
241
+ return;
242
+ }
243
+
244
+ if (state.nextVisibleName !== state.visibleName) {
245
+ visiblePortalHostName.set(state.nextVisibleName);
246
+ }
247
+ },
248
+ );
249
+
250
+ const teleportProps = useAnimatedProps(() => {
251
+ "worklet";
252
+
253
+ const slot = activeSlotsMap.get()[boundaryId];
254
+ const { teleport, ...slotProps } = slot?.props ?? {};
255
+ const shouldTeleport = shouldAttachBoundaryPortal({
256
+ enabled,
257
+ teleport,
258
+ });
259
+ const visibleName = visiblePortalHostName.get();
260
+
261
+ return {
262
+ ...slotProps,
263
+ hostName:
264
+ shouldTeleport && visibleName
265
+ ? visibleName
266
+ : PORTAL_HOST_NAME_RESET_VALUE,
267
+ };
268
+ });
269
+
270
+ return {
271
+ teleportProps,
272
+ visiblePortalHostName,
273
+ };
274
+ };
@@ -0,0 +1,59 @@
1
+ import {
2
+ type ComponentProps,
3
+ type ComponentType,
4
+ memo,
5
+ type ReactNode,
6
+ } from "react";
7
+ import type { ViewProps } from "react-native";
8
+ import Animated from "react-native-reanimated";
9
+ import { isTeleportAvailable, NativePortal } from "../../teleport";
10
+ import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
11
+
12
+ export { BoundaryContentPortalHost } from "./components/host";
13
+
14
+ type BoundaryContentPortalProps = {
15
+ boundaryId?: string;
16
+ children: ReactNode;
17
+ enabled: boolean;
18
+ pointerEvents?: ViewProps["pointerEvents"];
19
+ };
20
+
21
+ type NullableHostNamePortalProps = Omit<
22
+ ComponentProps<NonNullable<typeof NativePortal>>,
23
+ "hostName"
24
+ > & {
25
+ hostName?: string | null;
26
+ };
27
+
28
+ const AnimatedNativePortal = NativePortal
29
+ ? Animated.createAnimatedComponent(
30
+ NativePortal as ComponentType<NullableHostNamePortalProps>,
31
+ )
32
+ : null;
33
+
34
+ export const BoundaryContentPortal = memo(function BoundaryContentPortal({
35
+ boundaryId,
36
+ children,
37
+ enabled,
38
+ pointerEvents,
39
+ }: BoundaryContentPortalProps) {
40
+ const shouldEnablePortal = enabled && boundaryId !== undefined;
41
+ const { teleportProps } = useBoundaryContentPortalAttachment({
42
+ boundaryId: boundaryId ?? "",
43
+ enabled: shouldEnablePortal,
44
+ });
45
+
46
+ if (shouldEnablePortal && isTeleportAvailable && AnimatedNativePortal) {
47
+ return (
48
+ <AnimatedNativePortal
49
+ animatedProps={teleportProps}
50
+ name={boundaryId}
51
+ pointerEvents={pointerEvents}
52
+ >
53
+ {children}
54
+ </AnimatedNativePortal>
55
+ );
56
+ }
57
+
58
+ return children;
59
+ });
@@ -7,8 +7,9 @@ import {
7
7
  type ViewStyle,
8
8
  } from "react-native";
9
9
  import Animated from "react-native-reanimated";
10
- import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
11
- import { SystemStore } from "../../../../stores/system.store";
10
+ import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
11
+ import { useScreenSlots } from "../../../../../../providers/screen/styles";
12
+ import { SystemStore } from "../../../../../../stores/system.store";
12
13
  import { useHostMeasurement } from "../hooks/use-host-measurement";
13
14
  import { registerHost, unregisterHost } from "../stores/host-registry.store";
14
15
  import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
@@ -26,7 +27,7 @@ type HostImplProps = PublicHostProps & {
26
27
 
27
28
  function HostImpl({ fallback = false, style }: HostImplProps) {
28
29
  const screenKey = useDescriptorsStore((s) => s.derivations.currentScreenKey);
29
- const { drainLifecycleStartBlocks } = SystemStore.getBag(screenKey).actions;
30
+ const { unblockLifecycleStart } = SystemStore.getBag(screenKey).actions;
30
31
  const generatedHostKeyRef = useRef<string | null>(null);
31
32
 
32
33
  if (generatedHostKeyRef.current === null) {
@@ -36,6 +37,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
36
37
  const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
37
38
  const capturesScroll = !fallback;
38
39
  const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
40
+ const { visibilityBlocked } = useScreenSlots();
39
41
  const { height: viewportHeight, width: viewportWidth } =
40
42
  useWindowDimensions();
41
43
 
@@ -44,6 +46,9 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
44
46
  enabled: activeBoundaryHosts.length > 0,
45
47
  hostKey,
46
48
  screenKey,
49
+ visibilityBlocked,
50
+ viewportHeight,
51
+ viewportWidth,
47
52
  });
48
53
 
49
54
  useLayoutEffect(() => {
@@ -60,15 +65,13 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
60
65
  }, [capturesScroll, fallback, hostKey, screenKey]);
61
66
 
62
67
  const handleUnblocking = useCallback(() => {
63
- // Screen-level escape keeps the open transition gated until portal hosts
64
- // have committed layout. A screen may render more than one portal boundary
65
- // host for the same lifecycle request, so the final host layout drains the
66
- // outstanding start blocks for this screen.
67
- drainLifecycleStartBlocks();
68
- }, [drainLifecycleStartBlocks]);
68
+ // Each destination boundary contributes one lifecycle start block. Release
69
+ // only this host's block so unrelated boundary and user blocks stay intact.
70
+ unblockLifecycleStart();
71
+ }, [unblockLifecycleStart]);
69
72
 
70
73
  const boundaryHosts = measurement.canRenderHosts
71
- ? activeBoundaryHosts.map((host, idx, list) => (
74
+ ? activeBoundaryHosts.map((host) => (
72
75
  <View
73
76
  key={host.portalHostName}
74
77
  pointerEvents="none"
@@ -76,11 +79,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
76
79
  styles.boundaryHostViewport,
77
80
  { width: viewportWidth, height: viewportHeight },
78
81
  ]}
79
- onLayout={() => {
80
- if (list.length - 1 === idx) {
81
- handleUnblocking();
82
- }
83
- }}
82
+ onLayout={handleUnblocking}
84
83
  >
85
84
  <PortalBoundaryHost host={host} style={StyleSheet.absoluteFill} />
86
85
  </View>
@@ -1,20 +1,20 @@
1
1
  import { memo } from "react";
2
2
  import { type StyleProp, StyleSheet, type ViewStyle } from "react-native";
3
3
  import Animated, { useAnimatedStyle } from "react-native-reanimated";
4
- import { NO_STYLES } from "../../../../constants";
5
- import { composeSlotStyleWithLocalTransform } from "../../../../providers/screen/styles/helpers/compose-slot-style";
6
- import { AnimationStore } from "../../../../stores/animation.store";
7
- import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
8
- import { getLink } from "../../../../stores/bounds/internals/links";
4
+ import { NO_STYLES } from "../../../../../../constants";
5
+ import { composeSlotStyleWithLocalTransform } from "../../../../../../providers/screen/styles/helpers/compose-slot-style";
6
+ import { AnimationStore } from "../../../../../../stores/animation.store";
7
+ import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
8
+ import { getLink } from "../../../../../../stores/bounds/internals/links";
9
9
  import {
10
10
  getClampedScrollAxisDelta,
11
11
  ScrollStore,
12
- } from "../../../../stores/scroll.store";
13
- import type { ScrollMeasuredDimensions } from "../../utils/measured-bounds";
12
+ } from "../../../../../../stores/scroll.store";
13
+ import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
14
+ import { NativePortalHost } from "../../../teleport";
15
+ import { hasLocalSlot } from "../helpers/has-local-slot";
16
+ import { resolvePortalOffsetStyle } from "../helpers/offset-style";
14
17
  import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
15
- import { NativePortalHost } from "../teleport";
16
- import { hasLocalSlot } from "../utils/has-local-slot";
17
- import { resolvePortalOffsetStyle } from "../utils/offset-style";
18
18
 
19
19
  const AnimatedPortalBoundaryHost = NativePortalHost
20
20
  ? Animated.createAnimatedComponent(NativePortalHost)
@@ -45,7 +45,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
45
45
 
46
46
  const hostStyle = useAnimatedStyle(() => {
47
47
  "worklet";
48
- // Strict per-member lookup a fallback member's source rect would
48
+ // Strict per-member lookup - a fallback member's source rect would
49
49
  // misplace this host's teleported content.
50
50
  const link = getLink(host.pairKey, host.boundaryId);
51
51
  if (!link?.source || !link.destination) {
@@ -135,7 +135,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
135
135
  });
136
136
 
137
137
  // Without `react-native-teleport` no portal ever mounts a boundary host, so
138
- // this never renders the guard just narrows the nullable animated host.
138
+ // this never renders - the guard just narrows the nullable animated host.
139
139
  if (!AnimatedPortalBoundaryHost) {
140
140
  return null;
141
141
  }
@@ -0,0 +1,80 @@
1
+ import {
2
+ type ComponentProps,
3
+ type ComponentType,
4
+ memo,
5
+ type ReactNode,
6
+ } from "react";
7
+ import type { View, ViewProps } from "react-native";
8
+ import Animated, { type AnimatedRef, runOnUI } from "react-native-reanimated";
9
+ import { logger } from "../../../../../../utils/logger";
10
+ import {
11
+ isTeleportAvailable,
12
+ NativePortal as TeleportPortal,
13
+ } from "../../../teleport";
14
+ import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
15
+
16
+ type NullableHostNamePortalProps = Omit<
17
+ ComponentProps<NonNullable<typeof TeleportPortal>>,
18
+ "hostName"
19
+ > & {
20
+ hostName?: string | null;
21
+ };
22
+
23
+ const AnimatedNativePortal = TeleportPortal
24
+ ? Animated.createAnimatedComponent(
25
+ TeleportPortal as ComponentType<NullableHostNamePortalProps>,
26
+ )
27
+ : null;
28
+
29
+ type BoundaryPortalSlotProps = {
30
+ id: string;
31
+ children: ReactNode;
32
+ enabled: boolean;
33
+ animatedProps: any;
34
+ pointerEvents?: ViewProps["pointerEvents"];
35
+ placeholderRef?: AnimatedRef<View>;
36
+ };
37
+
38
+ export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
39
+ id,
40
+ children,
41
+ enabled,
42
+ animatedProps,
43
+ pointerEvents,
44
+ placeholderRef,
45
+ }: BoundaryPortalSlotProps) {
46
+ const isPortalEnabled = enabled && isTeleportAvailable;
47
+
48
+ if (__DEV__ && enabled && !id) {
49
+ logger.warnOnce(
50
+ "portal:missing-id",
51
+ "A boundary portal was rendered without an id; rendering inline.",
52
+ );
53
+ }
54
+
55
+ const { handleOnLayout, placeholderStyle } = usePlaceholderStyles();
56
+
57
+ if (isPortalEnabled && AnimatedNativePortal) {
58
+ return (
59
+ <Animated.View
60
+ ref={placeholderRef}
61
+ onLayout={({ nativeEvent: { layout } }) =>
62
+ runOnUI(handleOnLayout)(layout)
63
+ }
64
+ style={placeholderStyle}
65
+ pointerEvents={pointerEvents}
66
+ collapsable={false}
67
+ >
68
+ <AnimatedNativePortal
69
+ animatedProps={animatedProps}
70
+ name={id}
71
+ pointerEvents={pointerEvents}
72
+ >
73
+ {children}
74
+ </AnimatedNativePortal>
75
+ </Animated.View>
76
+ );
77
+ }
78
+
79
+ return children;
80
+ });
@@ -1,4 +1,4 @@
1
- import type { LocalStyleLayers } from "../../../../providers/screen/styles/helpers/resolve-slot-styles";
1
+ import type { LocalStyleLayers } from "../../../../../../providers/screen/styles/helpers/resolve-slot-styles";
2
2
 
3
3
  export const hasLocalSlot = (
4
4
  localStylesMaps: LocalStyleLayers,
@@ -0,0 +1,10 @@
1
+ const BOUNDARY_PORTAL_HOST_NAME_SUFFIX = "-portal-host";
2
+
3
+ export const createBoundaryPortalHostName = (
4
+ hostKey: string,
5
+ boundaryId: string,
6
+ pairKey?: string | null,
7
+ ) => {
8
+ "worklet";
9
+ return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${BOUNDARY_PORTAL_HOST_NAME_SUFFIX}`;
10
+ };
@@ -1,6 +1,6 @@
1
1
  import type { StyleProps } from "react-native-reanimated";
2
- import { getClampedScrollAxisDelta } from "../../../../stores/scroll.store";
3
- import type { ScrollMeasuredDimensions } from "../../utils/measured-bounds";
2
+ import { getClampedScrollAxisDelta } from "../../../../../../stores/scroll.store";
3
+ import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
4
4
  import { getPortalHostBounds } from "../stores/host-bounds.store";
5
5
 
6
6
  /**