react-native-screen-transitions 4.1.0-beta.0 → 4.1.0-beta.1

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 (454) hide show
  1. package/lib/commonjs/components/boundary/components/boundary-lifecycle.js +40 -8
  2. package/lib/commonjs/components/boundary/components/boundary-lifecycle.js.map +1 -1
  3. package/lib/commonjs/components/boundary/components/boundary-target.js +10 -17
  4. package/lib/commonjs/components/boundary/components/boundary-target.js.map +1 -1
  5. package/lib/commonjs/components/boundary/create-boundary-component.js +13 -16
  6. package/lib/commonjs/components/boundary/create-boundary-component.js.map +1 -1
  7. package/lib/commonjs/components/boundary/helpers/presentation.js +56 -0
  8. package/lib/commonjs/components/boundary/helpers/presentation.js.map +1 -0
  9. package/lib/commonjs/components/boundary/hooks/use-boundary-presentation.js +65 -0
  10. package/lib/commonjs/components/boundary/hooks/use-boundary-presentation.js.map +1 -0
  11. package/lib/commonjs/components/boundary/hooks/use-composed-boundary-style.js +43 -0
  12. package/lib/commonjs/components/boundary/hooks/use-composed-boundary-style.js.map +1 -0
  13. package/lib/commonjs/components/boundary/index.js +2 -3
  14. package/lib/commonjs/components/boundary/index.js.map +1 -1
  15. package/lib/commonjs/components/boundary/portal/components/portal-host.js +39 -0
  16. package/lib/commonjs/components/boundary/portal/components/portal-host.js.map +1 -0
  17. package/lib/commonjs/components/boundary/portal/components/portal-overlay.js +170 -0
  18. package/lib/commonjs/components/boundary/portal/components/portal-overlay.js.map +1 -0
  19. package/lib/commonjs/components/boundary/portal/components/portal.js +88 -0
  20. package/lib/commonjs/components/boundary/portal/components/portal.js.map +1 -0
  21. package/lib/commonjs/components/boundary/portal/helpers/offset-style.js.map +1 -0
  22. package/lib/commonjs/components/boundary/portal/hooks/use-active-portal-boundary-host.js +35 -0
  23. package/lib/commonjs/components/boundary/portal/hooks/use-active-portal-boundary-host.js.map +1 -0
  24. package/lib/commonjs/components/boundary/portal/hooks/use-host-measurement.js +83 -0
  25. package/lib/commonjs/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
  26. package/lib/commonjs/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  27. package/lib/commonjs/components/boundary/portal/hooks/use-portal-destination.js +58 -0
  28. package/lib/commonjs/components/boundary/portal/hooks/use-portal-destination.js.map +1 -0
  29. package/lib/commonjs/components/boundary/portal/index.js +0 -7
  30. package/lib/commonjs/components/boundary/portal/index.js.map +1 -1
  31. package/lib/commonjs/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.js +1 -12
  32. package/lib/commonjs/components/boundary/portal/stores/host-registry.store.js.map +1 -0
  33. package/lib/commonjs/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.js +17 -17
  34. package/lib/commonjs/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
  35. package/lib/commonjs/components/boundary/portal/utils/naming.js +8 -1
  36. package/lib/commonjs/components/boundary/portal/utils/naming.js.map +1 -1
  37. package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js +7 -27
  38. package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js.map +1 -1
  39. package/lib/commonjs/components/boundary/providers/boundary-root.provider.js +13 -7
  40. package/lib/commonjs/components/boundary/providers/boundary-root.provider.js.map +1 -1
  41. package/lib/commonjs/components/screen/container/helpers/layer-component.js +39 -0
  42. package/lib/commonjs/components/screen/container/helpers/layer-component.js.map +1 -0
  43. package/lib/commonjs/components/screen/container/{layers/render-component.js → helpers/uses-layer-render-props.js} +1 -1
  44. package/lib/commonjs/components/screen/container/helpers/uses-layer-render-props.js.map +1 -0
  45. package/lib/commonjs/components/screen/container/layers/backdrop.js +4 -13
  46. package/lib/commonjs/components/screen/container/layers/backdrop.js.map +1 -1
  47. package/lib/commonjs/components/screen/container/layers/clip.js +117 -0
  48. package/lib/commonjs/components/screen/container/layers/clip.js.map +1 -0
  49. package/lib/commonjs/components/screen/container/layers/content.js +17 -33
  50. package/lib/commonjs/components/screen/container/layers/content.js.map +1 -1
  51. package/lib/commonjs/components/screen/container/layers/surface.js +3 -15
  52. package/lib/commonjs/components/screen/container/layers/surface.js.map +1 -1
  53. package/lib/commonjs/components/screen/lifecycle/hooks/use-open-transition-intent.js +15 -0
  54. package/lib/commonjs/components/screen/lifecycle/hooks/use-open-transition-intent.js.map +1 -1
  55. package/lib/commonjs/constants.js +3 -1
  56. package/lib/commonjs/constants.js.map +1 -1
  57. package/lib/commonjs/hooks/navigation/use-navigation-helpers.js +16 -4
  58. package/lib/commonjs/hooks/navigation/use-navigation-helpers.js.map +1 -1
  59. package/lib/commonjs/providers/screen/motion/animation/helpers/build-screen-transition-options.js +0 -1
  60. package/lib/commonjs/providers/screen/motion/animation/helpers/build-screen-transition-options.js.map +1 -1
  61. package/lib/commonjs/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js +3 -2
  62. package/lib/commonjs/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  63. package/lib/commonjs/providers/screen/motion/options/helpers.js +1 -3
  64. package/lib/commonjs/providers/screen/motion/options/helpers.js.map +1 -1
  65. package/lib/commonjs/providers/screen/orchestrator/helpers/use-interpolator-state.js +4 -2
  66. package/lib/commonjs/providers/screen/orchestrator/helpers/use-interpolator-state.js.map +1 -1
  67. package/lib/commonjs/providers/screen/orchestrator/helpers/use-pair-presentation.js +79 -0
  68. package/lib/commonjs/providers/screen/orchestrator/helpers/use-pair-presentation.js.map +1 -0
  69. package/lib/commonjs/providers/screen/orchestrator/orchestrator.provider.js +3 -0
  70. package/lib/commonjs/providers/screen/orchestrator/orchestrator.provider.js.map +1 -1
  71. package/lib/commonjs/providers/screen/orchestrator/styles/constants.js +1 -0
  72. package/lib/commonjs/providers/screen/orchestrator/styles/constants.js.map +1 -1
  73. package/lib/commonjs/providers/screen/orchestrator/styles/hooks/slot-resolvers.js +5 -8
  74. package/lib/commonjs/providers/screen/orchestrator/styles/hooks/slot-resolvers.js.map +1 -1
  75. package/lib/commonjs/utils/bounds/navigation/reveal/build.js +28 -61
  76. package/lib/commonjs/utils/bounds/navigation/reveal/build.js.map +1 -1
  77. package/lib/commonjs/utils/bounds/navigation/reveal/config.js +3 -4
  78. package/lib/commonjs/utils/bounds/navigation/reveal/config.js.map +1 -1
  79. package/lib/commonjs/utils/bounds/navigation/reveal/math.js +8 -8
  80. package/lib/commonjs/utils/bounds/navigation/reveal/math.js.map +1 -1
  81. package/lib/commonjs/utils/bounds/navigation/reveal/types.js +3 -1
  82. package/lib/commonjs/utils/bounds/navigation/reveal/types.js.map +1 -1
  83. package/lib/commonjs/utils/bounds/navigation/zoom/build.js +4 -6
  84. package/lib/commonjs/utils/bounds/navigation/zoom/build.js.map +1 -1
  85. package/lib/commonjs/utils/bounds/navigation/zoom/clip.js +64 -0
  86. package/lib/commonjs/utils/bounds/navigation/zoom/clip.js.map +1 -0
  87. package/lib/commonjs/utils/bounds/navigation/zoom/drag.js +1 -1
  88. package/lib/commonjs/utils/bounds/navigation/zoom/drag.js.map +1 -1
  89. package/lib/commonjs/utils/bounds/navigation/zoom/types.js +3 -1
  90. package/lib/commonjs/utils/bounds/navigation/zoom/types.js.map +1 -1
  91. package/lib/module/components/boundary/components/boundary-lifecycle.js +41 -9
  92. package/lib/module/components/boundary/components/boundary-lifecycle.js.map +1 -1
  93. package/lib/module/components/boundary/components/boundary-target.js +10 -17
  94. package/lib/module/components/boundary/components/boundary-target.js.map +1 -1
  95. package/lib/module/components/boundary/create-boundary-component.js +13 -16
  96. package/lib/module/components/boundary/create-boundary-component.js.map +1 -1
  97. package/lib/module/components/boundary/helpers/presentation.js +50 -0
  98. package/lib/module/components/boundary/helpers/presentation.js.map +1 -0
  99. package/lib/module/components/boundary/hooks/use-boundary-presentation.js +62 -0
  100. package/lib/module/components/boundary/hooks/use-boundary-presentation.js.map +1 -0
  101. package/lib/module/components/boundary/hooks/use-composed-boundary-style.js +39 -0
  102. package/lib/module/components/boundary/hooks/use-composed-boundary-style.js.map +1 -0
  103. package/lib/module/components/boundary/index.js +2 -3
  104. package/lib/module/components/boundary/index.js.map +1 -1
  105. package/lib/module/components/boundary/portal/components/portal-host.js +34 -0
  106. package/lib/module/components/boundary/portal/components/portal-host.js.map +1 -0
  107. package/lib/module/components/boundary/portal/components/portal-overlay.js +165 -0
  108. package/lib/module/components/boundary/portal/components/portal-overlay.js.map +1 -0
  109. package/lib/module/components/boundary/portal/components/portal.js +83 -0
  110. package/lib/module/components/boundary/portal/components/portal.js.map +1 -0
  111. package/lib/module/components/boundary/portal/helpers/offset-style.js.map +1 -0
  112. package/lib/module/components/boundary/portal/hooks/use-active-portal-boundary-host.js +31 -0
  113. package/lib/module/components/boundary/portal/hooks/use-active-portal-boundary-host.js.map +1 -0
  114. package/lib/module/components/boundary/portal/hooks/use-host-measurement.js +78 -0
  115. package/lib/module/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
  116. package/lib/module/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
  117. package/lib/module/components/boundary/portal/hooks/use-portal-destination.js +54 -0
  118. package/lib/module/components/boundary/portal/hooks/use-portal-destination.js.map +1 -0
  119. package/lib/module/components/boundary/portal/index.js +0 -1
  120. package/lib/module/components/boundary/portal/index.js.map +1 -1
  121. package/lib/module/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.js +1 -12
  122. package/lib/module/components/boundary/portal/stores/host-registry.store.js.map +1 -0
  123. package/lib/module/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.js +17 -17
  124. package/lib/module/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
  125. package/lib/module/components/boundary/portal/utils/naming.js +6 -0
  126. package/lib/module/components/boundary/portal/utils/naming.js.map +1 -1
  127. package/lib/module/components/boundary/portal/utils/resolve-portal.js +7 -27
  128. package/lib/module/components/boundary/portal/utils/resolve-portal.js.map +1 -1
  129. package/lib/module/components/boundary/providers/boundary-root.provider.js +13 -7
  130. package/lib/module/components/boundary/providers/boundary-root.provider.js.map +1 -1
  131. package/lib/module/components/screen/container/helpers/layer-component.js +35 -0
  132. package/lib/module/components/screen/container/helpers/layer-component.js.map +1 -0
  133. package/lib/module/components/screen/container/{layers/render-component.js → helpers/uses-layer-render-props.js} +1 -1
  134. package/lib/module/components/screen/container/helpers/uses-layer-render-props.js.map +1 -0
  135. package/lib/module/components/screen/container/layers/backdrop.js +5 -13
  136. package/lib/module/components/screen/container/layers/backdrop.js.map +1 -1
  137. package/lib/module/components/screen/container/layers/clip.js +112 -0
  138. package/lib/module/components/screen/container/layers/clip.js.map +1 -0
  139. package/lib/module/components/screen/container/layers/content.js +18 -33
  140. package/lib/module/components/screen/container/layers/content.js.map +1 -1
  141. package/lib/module/components/screen/container/layers/surface.js +4 -15
  142. package/lib/module/components/screen/container/layers/surface.js.map +1 -1
  143. package/lib/module/components/screen/lifecycle/hooks/use-open-transition-intent.js +17 -2
  144. package/lib/module/components/screen/lifecycle/hooks/use-open-transition-intent.js.map +1 -1
  145. package/lib/module/constants.js +3 -1
  146. package/lib/module/constants.js.map +1 -1
  147. package/lib/module/hooks/navigation/use-navigation-helpers.js +16 -4
  148. package/lib/module/hooks/navigation/use-navigation-helpers.js.map +1 -1
  149. package/lib/module/providers/screen/motion/animation/helpers/build-screen-transition-options.js +0 -1
  150. package/lib/module/providers/screen/motion/animation/helpers/build-screen-transition-options.js.map +1 -1
  151. package/lib/module/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js +3 -2
  152. package/lib/module/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js.map +1 -1
  153. package/lib/module/providers/screen/motion/options/helpers.js +1 -3
  154. package/lib/module/providers/screen/motion/options/helpers.js.map +1 -1
  155. package/lib/module/providers/screen/orchestrator/helpers/use-interpolator-state.js +6 -4
  156. package/lib/module/providers/screen/orchestrator/helpers/use-interpolator-state.js.map +1 -1
  157. package/lib/module/providers/screen/orchestrator/helpers/use-pair-presentation.js +73 -0
  158. package/lib/module/providers/screen/orchestrator/helpers/use-pair-presentation.js.map +1 -0
  159. package/lib/module/providers/screen/orchestrator/orchestrator.provider.js +3 -0
  160. package/lib/module/providers/screen/orchestrator/orchestrator.provider.js.map +1 -1
  161. package/lib/module/providers/screen/orchestrator/styles/constants.js +1 -0
  162. package/lib/module/providers/screen/orchestrator/styles/constants.js.map +1 -1
  163. package/lib/module/providers/screen/orchestrator/styles/hooks/slot-resolvers.js +5 -8
  164. package/lib/module/providers/screen/orchestrator/styles/hooks/slot-resolvers.js.map +1 -1
  165. package/lib/module/types/animation.types.js +3 -1
  166. package/lib/module/types/animation.types.js.map +1 -1
  167. package/lib/module/utils/bounds/navigation/reveal/build.js +30 -63
  168. package/lib/module/utils/bounds/navigation/reveal/build.js.map +1 -1
  169. package/lib/module/utils/bounds/navigation/reveal/config.js +2 -3
  170. package/lib/module/utils/bounds/navigation/reveal/config.js.map +1 -1
  171. package/lib/module/utils/bounds/navigation/reveal/math.js +7 -7
  172. package/lib/module/utils/bounds/navigation/reveal/math.js.map +1 -1
  173. package/lib/module/utils/bounds/navigation/reveal/types.js +1 -1
  174. package/lib/module/utils/bounds/navigation/reveal/types.js.map +1 -1
  175. package/lib/module/utils/bounds/navigation/zoom/build.js +5 -7
  176. package/lib/module/utils/bounds/navigation/zoom/build.js.map +1 -1
  177. package/lib/module/utils/bounds/navigation/zoom/clip.js +59 -0
  178. package/lib/module/utils/bounds/navigation/zoom/clip.js.map +1 -0
  179. package/lib/module/utils/bounds/navigation/zoom/drag.js +1 -1
  180. package/lib/module/utils/bounds/navigation/zoom/drag.js.map +1 -1
  181. package/lib/module/utils/bounds/navigation/zoom/types.js +1 -1
  182. package/lib/module/utils/bounds/navigation/zoom/types.js.map +1 -1
  183. package/lib/typescript/components/boundary/components/boundary-lifecycle.d.ts.map +1 -1
  184. package/lib/typescript/components/boundary/components/boundary-target.d.ts.map +1 -1
  185. package/lib/typescript/components/boundary/create-boundary-component.d.ts.map +1 -1
  186. package/lib/typescript/components/boundary/helpers/presentation.d.ts +14 -0
  187. package/lib/typescript/components/boundary/helpers/presentation.d.ts.map +1 -0
  188. package/lib/typescript/components/boundary/hooks/use-boundary-presentation.d.ts +9 -0
  189. package/lib/typescript/components/boundary/hooks/use-boundary-presentation.d.ts.map +1 -0
  190. package/lib/typescript/components/boundary/hooks/use-composed-boundary-style.d.ts +4 -0
  191. package/lib/typescript/components/boundary/hooks/use-composed-boundary-style.d.ts.map +1 -0
  192. package/lib/typescript/components/boundary/index.d.ts +3 -2
  193. package/lib/typescript/components/boundary/index.d.ts.map +1 -1
  194. package/lib/typescript/components/boundary/portal/components/portal-host.d.ts +15 -0
  195. package/lib/typescript/components/boundary/portal/components/portal-host.d.ts.map +1 -0
  196. package/lib/typescript/components/boundary/portal/components/portal-overlay.d.ts +20 -0
  197. package/lib/typescript/components/boundary/portal/components/portal-overlay.d.ts.map +1 -0
  198. package/lib/typescript/components/boundary/portal/components/portal.d.ts +23 -0
  199. package/lib/typescript/components/boundary/portal/components/portal.d.ts.map +1 -0
  200. package/lib/typescript/components/boundary/portal/helpers/offset-style.d.ts.map +1 -0
  201. package/lib/typescript/components/boundary/portal/hooks/use-active-portal-boundary-host.d.ts +11 -0
  202. package/lib/typescript/components/boundary/portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -0
  203. package/lib/typescript/components/boundary/portal/hooks/use-host-measurement.d.ts +13 -0
  204. package/lib/typescript/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -0
  205. package/lib/typescript/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +1 -0
  206. package/lib/typescript/components/boundary/portal/hooks/use-portal-destination.d.ts +8 -0
  207. package/lib/typescript/components/boundary/portal/hooks/use-portal-destination.d.ts.map +1 -0
  208. package/lib/typescript/components/boundary/portal/index.d.ts +0 -1
  209. package/lib/typescript/components/boundary/portal/index.d.ts.map +1 -1
  210. package/lib/typescript/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -0
  211. package/lib/typescript/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.d.ts +2 -3
  212. package/lib/typescript/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -0
  213. package/lib/typescript/components/boundary/portal/utils/naming.d.ts +1 -0
  214. package/lib/typescript/components/boundary/portal/utils/naming.d.ts.map +1 -1
  215. package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts +2 -7
  216. package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -1
  217. package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts +5 -2
  218. package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
  219. package/lib/typescript/components/screen/container/helpers/layer-component.d.ts +10 -0
  220. package/lib/typescript/components/screen/container/helpers/layer-component.d.ts.map +1 -0
  221. package/lib/typescript/components/screen/container/{layers/render-component.d.ts → helpers/uses-layer-render-props.d.ts} +1 -1
  222. package/lib/typescript/components/screen/container/helpers/uses-layer-render-props.d.ts.map +1 -0
  223. package/lib/typescript/components/screen/container/layers/backdrop.d.ts.map +1 -1
  224. package/lib/typescript/components/screen/container/layers/clip.d.ts +7 -0
  225. package/lib/typescript/components/screen/container/layers/clip.d.ts.map +1 -0
  226. package/lib/typescript/components/screen/container/layers/content.d.ts.map +1 -1
  227. package/lib/typescript/components/screen/container/layers/surface.d.ts.map +1 -1
  228. package/lib/typescript/components/screen/lifecycle/hooks/use-open-transition-intent.d.ts.map +1 -1
  229. package/lib/typescript/constants.d.ts +3 -1
  230. package/lib/typescript/constants.d.ts.map +1 -1
  231. package/lib/typescript/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
  232. package/lib/typescript/index.d.ts +1 -1
  233. package/lib/typescript/index.d.ts.map +1 -1
  234. package/lib/typescript/providers/screen/motion/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
  235. package/lib/typescript/providers/screen/motion/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
  236. package/lib/typescript/providers/screen/motion/options/helpers.d.ts.map +1 -1
  237. package/lib/typescript/providers/screen/motion/options/types.d.ts +0 -1
  238. package/lib/typescript/providers/screen/motion/options/types.d.ts.map +1 -1
  239. package/lib/typescript/providers/screen/orchestrator/helpers/use-interpolator-state.d.ts.map +1 -1
  240. package/lib/typescript/providers/screen/orchestrator/helpers/use-pair-presentation.d.ts +21 -0
  241. package/lib/typescript/providers/screen/orchestrator/helpers/use-pair-presentation.d.ts.map +1 -0
  242. package/lib/typescript/providers/screen/orchestrator/orchestrator.provider.d.ts +2 -0
  243. package/lib/typescript/providers/screen/orchestrator/orchestrator.provider.d.ts.map +1 -1
  244. package/lib/typescript/providers/screen/orchestrator/styles/constants.d.ts.map +1 -1
  245. package/lib/typescript/providers/screen/orchestrator/styles/hooks/slot-resolvers.d.ts +1 -1
  246. package/lib/typescript/providers/screen/orchestrator/styles/hooks/slot-resolvers.d.ts.map +1 -1
  247. package/lib/typescript/providers/screen/orchestrator/styles/types.d.ts +1 -1
  248. package/lib/typescript/providers/screen/orchestrator/styles/types.d.ts.map +1 -1
  249. package/lib/typescript/types/animation.types.d.ts +16 -4
  250. package/lib/typescript/types/animation.types.d.ts.map +1 -1
  251. package/lib/typescript/types/bounds.types.d.ts +7 -15
  252. package/lib/typescript/types/bounds.types.d.ts.map +1 -1
  253. package/lib/typescript/types/index.d.ts +1 -1
  254. package/lib/typescript/types/index.d.ts.map +1 -1
  255. package/lib/typescript/types/screen.types.d.ts +1 -8
  256. package/lib/typescript/types/screen.types.d.ts.map +1 -1
  257. package/lib/typescript/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
  258. package/lib/typescript/utils/bounds/navigation/reveal/config.d.ts +2 -3
  259. package/lib/typescript/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
  260. package/lib/typescript/utils/bounds/navigation/reveal/math.d.ts +3 -3
  261. package/lib/typescript/utils/bounds/navigation/reveal/types.d.ts +1 -5
  262. package/lib/typescript/utils/bounds/navigation/reveal/types.d.ts.map +1 -1
  263. package/lib/typescript/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
  264. package/lib/typescript/utils/bounds/navigation/zoom/{mask.d.ts → clip.d.ts} +5 -5
  265. package/lib/typescript/utils/bounds/navigation/zoom/clip.d.ts.map +1 -0
  266. package/lib/typescript/utils/bounds/navigation/zoom/drag.d.ts +1 -1
  267. package/lib/typescript/utils/bounds/navigation/zoom/types.d.ts +1 -5
  268. package/lib/typescript/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
  269. package/package.json +1 -1
  270. package/src/components/boundary/components/boundary-lifecycle.tsx +44 -8
  271. package/src/components/boundary/components/boundary-target.tsx +14 -36
  272. package/src/components/boundary/create-boundary-component.tsx +16 -17
  273. package/src/components/boundary/helpers/presentation.ts +88 -0
  274. package/src/components/boundary/hooks/use-boundary-presentation.ts +82 -0
  275. package/src/components/boundary/hooks/use-composed-boundary-style.ts +58 -0
  276. package/src/components/boundary/index.tsx +10 -5
  277. package/src/components/boundary/portal/components/portal-host.tsx +36 -0
  278. package/src/components/boundary/portal/components/portal-overlay.tsx +223 -0
  279. package/src/components/boundary/portal/components/portal.tsx +124 -0
  280. package/src/components/boundary/portal/hooks/use-active-portal-boundary-host.ts +52 -0
  281. package/src/components/boundary/portal/hooks/use-host-measurement.ts +101 -0
  282. package/src/components/boundary/portal/hooks/use-portal-destination.ts +53 -0
  283. package/src/components/boundary/portal/index.ts +0 -1
  284. package/src/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.ts +1 -20
  285. package/src/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.ts +19 -26
  286. package/src/components/boundary/portal/utils/naming.ts +10 -0
  287. package/src/components/boundary/portal/utils/resolve-portal.ts +9 -48
  288. package/src/components/boundary/providers/boundary-root.provider.tsx +34 -22
  289. package/src/components/screen/container/helpers/layer-component.tsx +38 -0
  290. package/src/components/screen/container/layers/backdrop.tsx +8 -31
  291. package/src/components/screen/container/layers/clip.tsx +124 -0
  292. package/src/components/screen/container/layers/content.tsx +21 -62
  293. package/src/components/screen/container/layers/surface.tsx +5 -23
  294. package/src/components/screen/lifecycle/hooks/use-open-transition-intent.ts +26 -2
  295. package/src/constants.ts +3 -1
  296. package/src/hooks/navigation/use-navigation-helpers.ts +13 -7
  297. package/src/index.ts +1 -0
  298. package/src/providers/screen/motion/animation/helpers/build-screen-transition-options.ts +0 -1
  299. package/src/providers/screen/motion/animation/helpers/hydrate-transition-state/index.ts +3 -2
  300. package/src/providers/screen/motion/options/helpers.ts +0 -6
  301. package/src/providers/screen/motion/options/types.ts +0 -1
  302. package/src/providers/screen/orchestrator/helpers/use-interpolator-state.ts +13 -8
  303. package/src/providers/screen/orchestrator/helpers/use-pair-presentation.ts +103 -0
  304. package/src/providers/screen/orchestrator/orchestrator.provider.tsx +4 -0
  305. package/src/providers/screen/orchestrator/styles/constants.ts +1 -0
  306. package/src/providers/screen/orchestrator/styles/hooks/slot-resolvers.tsx +8 -11
  307. package/src/providers/screen/orchestrator/styles/types.ts +1 -0
  308. package/src/types/animation.types.ts +35 -4
  309. package/src/types/bounds.types.ts +7 -15
  310. package/src/types/index.ts +1 -0
  311. package/src/types/screen.types.ts +1 -8
  312. package/src/utils/bounds/navigation/reveal/build.ts +46 -80
  313. package/src/utils/bounds/navigation/reveal/config.ts +2 -4
  314. package/src/utils/bounds/navigation/reveal/math.ts +9 -9
  315. package/src/utils/bounds/navigation/reveal/types.ts +1 -8
  316. package/src/utils/bounds/navigation/zoom/build.ts +16 -26
  317. package/src/utils/bounds/navigation/zoom/{mask.ts → clip.ts} +42 -48
  318. package/src/utils/bounds/navigation/zoom/drag.ts +2 -2
  319. package/src/utils/bounds/navigation/zoom/types.ts +1 -8
  320. package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js +0 -83
  321. package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js.map +0 -1
  322. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js +0 -45
  323. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js.map +0 -1
  324. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +0 -119
  325. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +0 -1
  326. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js +0 -20
  327. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js.map +0 -1
  328. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +0 -14
  329. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +0 -1
  330. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +0 -136
  331. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +0 -1
  332. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js +0 -53
  333. package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js.map +0 -1
  334. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js +0 -99
  335. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js.map +0 -1
  336. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +0 -104
  337. package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +0 -1
  338. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +0 -13
  339. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +0 -1
  340. package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +0 -1
  341. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +0 -82
  342. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +0 -1
  343. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +0 -58
  344. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +0 -1
  345. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +0 -67
  346. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +0 -1
  347. package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +0 -1
  348. package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js +0 -68
  349. package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js.map +0 -1
  350. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +0 -1
  351. package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +0 -1
  352. package/lib/commonjs/components/screen/container/layers/maybe-masked-navigation-container.js +0 -83
  353. package/lib/commonjs/components/screen/container/layers/maybe-masked-navigation-container.js.map +0 -1
  354. package/lib/commonjs/components/screen/container/layers/render-component.js.map +0 -1
  355. package/lib/commonjs/utils/bounds/navigation/zoom/mask.js +0 -73
  356. package/lib/commonjs/utils/bounds/navigation/zoom/mask.js.map +0 -1
  357. package/lib/module/components/boundary/hooks/use-boundary-measurement.js +0 -78
  358. package/lib/module/components/boundary/hooks/use-boundary-measurement.js.map +0 -1
  359. package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js +0 -40
  360. package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js.map +0 -1
  361. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +0 -110
  362. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +0 -1
  363. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js +0 -16
  364. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js.map +0 -1
  365. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +0 -9
  366. package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +0 -1
  367. package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +0 -131
  368. package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +0 -1
  369. package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js +0 -42
  370. package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js.map +0 -1
  371. package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js +0 -94
  372. package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js.map +0 -1
  373. package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +0 -99
  374. package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +0 -1
  375. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +0 -8
  376. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +0 -1
  377. package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +0 -1
  378. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +0 -76
  379. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +0 -1
  380. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +0 -53
  381. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +0 -1
  382. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +0 -62
  383. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +0 -1
  384. package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +0 -1
  385. package/lib/module/components/boundary/portal/components/boundary-portal/index.js +0 -63
  386. package/lib/module/components/boundary/portal/components/boundary-portal/index.js.map +0 -1
  387. package/lib/module/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +0 -1
  388. package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +0 -1
  389. package/lib/module/components/screen/container/layers/maybe-masked-navigation-container.js +0 -78
  390. package/lib/module/components/screen/container/layers/maybe-masked-navigation-container.js.map +0 -1
  391. package/lib/module/components/screen/container/layers/render-component.js.map +0 -1
  392. package/lib/module/utils/bounds/navigation/zoom/mask.js +0 -68
  393. package/lib/module/utils/bounds/navigation/zoom/mask.js.map +0 -1
  394. package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts +0 -28
  395. package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts.map +0 -1
  396. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +0 -10
  397. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +0 -1
  398. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +0 -45
  399. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +0 -1
  400. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.d.ts +0 -8
  401. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.d.ts.map +0 -1
  402. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +0 -2
  403. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +0 -1
  404. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +0 -10
  405. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +0 -1
  406. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/index.d.ts +0 -9
  407. package/lib/typescript/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +0 -1
  408. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts +0 -7
  409. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +0 -1
  410. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts +0 -13
  411. package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +0 -1
  412. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +0 -4
  413. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +0 -1
  414. package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +0 -1
  415. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +0 -21
  416. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +0 -1
  417. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +0 -10
  418. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +0 -1
  419. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts +0 -12
  420. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +0 -1
  421. package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +0 -1
  422. package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts +0 -12
  423. package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts.map +0 -1
  424. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +0 -1
  425. package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +0 -1
  426. package/lib/typescript/components/screen/container/layers/maybe-masked-navigation-container.d.ts +0 -9
  427. package/lib/typescript/components/screen/container/layers/maybe-masked-navigation-container.d.ts.map +0 -1
  428. package/lib/typescript/components/screen/container/layers/render-component.d.ts.map +0 -1
  429. package/lib/typescript/utils/bounds/navigation/zoom/mask.d.ts.map +0 -1
  430. package/src/components/boundary/hooks/use-boundary-measurement.ts +0 -98
  431. package/src/components/boundary/portal/components/boundary-content-portal/components/host.tsx +0 -56
  432. package/src/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +0 -192
  433. package/src/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.ts +0 -23
  434. package/src/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +0 -9
  435. package/src/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +0 -252
  436. package/src/components/boundary/portal/components/boundary-content-portal/index.tsx +0 -81
  437. package/src/components/boundary/portal/components/boundary-portal/components/host.tsx +0 -119
  438. package/src/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +0 -139
  439. package/src/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +0 -10
  440. package/src/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +0 -118
  441. package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +0 -64
  442. package/src/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +0 -90
  443. package/src/components/boundary/portal/components/boundary-portal/index.tsx +0 -97
  444. package/src/components/screen/container/layers/maybe-masked-navigation-container.tsx +0 -113
  445. /package/lib/commonjs/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.js +0 -0
  446. /package/lib/commonjs/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.js +0 -0
  447. /package/lib/module/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.js +0 -0
  448. /package/lib/module/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.js +0 -0
  449. /package/lib/typescript/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.d.ts +0 -0
  450. /package/lib/typescript/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.d.ts +0 -0
  451. /package/lib/typescript/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.d.ts +0 -0
  452. /package/src/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.ts +0 -0
  453. /package/src/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.ts +0 -0
  454. /package/src/components/screen/container/{layers/render-component.ts → helpers/uses-layer-render-props.ts} +0 -0
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PortalOverlay = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
10
+ var _constants = require("../../../../constants");
11
+ var _builder = require("../../../../providers/screen/builder");
12
+ var _composeSlotStyle = require("../../../../providers/screen/orchestrator/styles/helpers/compose-slot-style");
13
+ var _offsetStyle = require("../helpers/offset-style");
14
+ var _useHostMeasurement = require("../hooks/use-host-measurement");
15
+ var _hostRegistry = require("../stores/host-registry.store");
16
+ var _portalBoundaryHost = require("../stores/portal-boundary-host.store");
17
+ var _teleport = require("../teleport");
18
+ var _portalHost = require("./portal-host");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
+ /**
22
+ * A screen-sized overlay containing the receivers for escaped boundary frames.
23
+ *
24
+ * Registers this overlay as an available placement, measures its origin, and
25
+ * renders one positioned PortalHost per boundary assigned to it. An overlay can
26
+ * contain many hosts; each host receives one named portal.
27
+ *
28
+ * Boundary.Host uses this directly; screens render it with `fallback` for
29
+ * their automatic overlay. Explicit overlays take priority over the fallback.
30
+ * Handoff between screens uses receivers inside boundaries, so it does not
31
+ * need this overlay unless escapeClipping is also enabled.
32
+ */
33
+ const PortalOverlay = exports.PortalOverlay = /*#__PURE__*/(0, _react.memo)(function PortalOverlay({
34
+ fallback = false,
35
+ style
36
+ }) {
37
+ const screenKey = (0, _builder.useBuilderStore)(s => s.derivations.currentScreenKey);
38
+ const id = (0, _react.useId)();
39
+ const hostKey = fallback ? screenKey : `${screenKey}-host-${id}`;
40
+ const activeBoundaryHosts = (0, _portalBoundaryHost.useActivePortalBoundaryHosts)(hostKey);
41
+ const {
42
+ height: viewportHeight,
43
+ width: viewportWidth
44
+ } = (0, _reactNative.useWindowDimensions)();
45
+ const measurementKey = activeBoundaryHosts.length ? activeBoundaryHosts.map(host => host.portalHostName).join("|") : null;
46
+ const measurement = (0, _useHostMeasurement.useHostMeasurement)({
47
+ measurementKey,
48
+ boundaryMeasurements: activeBoundaryHosts.map(host => host.localMeasurement)
49
+ });
50
+ const boundaryHosts = activeBoundaryHosts.map(host => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
51
+ pointerEvents: _teleport.PORTAL_POINTER_EVENTS,
52
+ style: [styles.boundaryHostViewport, {
53
+ width: viewportWidth,
54
+ height: viewportHeight
55
+ }],
56
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(BoundaryPortalPlacement, {
57
+ host: host,
58
+ hostBounds: measurement.hostBounds
59
+ })
60
+ }, host.portalHostName));
61
+ (0, _react.useLayoutEffect)(() => {
62
+ (0, _hostRegistry.registerHost)({
63
+ fallback,
64
+ hostKey,
65
+ screenKey
66
+ });
67
+ return () => {
68
+ (0, _hostRegistry.unregisterHost)(screenKey, hostKey);
69
+ };
70
+ }, [fallback, hostKey, screenKey]);
71
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
72
+ ref: measurement.hostRef,
73
+ pointerEvents: _teleport.PORTAL_POINTER_EVENTS,
74
+ style: [styles.host, {
75
+ width: viewportWidth,
76
+ height: viewportHeight
77
+ }, style],
78
+ collapsable: false,
79
+ children: boundaryHosts
80
+ });
81
+ });
82
+ const getCurrentBoundaryBounds = host => {
83
+ "worklet";
84
+
85
+ return host.localMeasurement.get()?.bounds ?? null;
86
+ };
87
+ /** Positions one receiver using captured boundary and overlay measurements. */
88
+ const BoundaryPortalPlacement = /*#__PURE__*/(0, _react.memo)(function BoundaryPortalPlacement({
89
+ host,
90
+ hostBounds
91
+ }) {
92
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => {
93
+ "worklet";
94
+
95
+ return getCurrentBoundaryBounds(host) !== null && hostBounds.get() !== null;
96
+ }, ready => {
97
+ "worklet";
98
+
99
+ host.portalHostReady.set(ready);
100
+ });
101
+ const hostStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
102
+ "worklet";
103
+
104
+ const boundaryBounds = getCurrentBoundaryBounds(host);
105
+ if (!boundaryBounds) {
106
+ return _constants.NO_STYLES;
107
+ }
108
+ return (0, _offsetStyle.resolvePortalOffsetStyle)({
109
+ bounds: boundaryBounds,
110
+ hostBounds: hostBounds.get()
111
+ });
112
+ });
113
+ const contentFrameStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
114
+ "worklet";
115
+
116
+ const boundaryBounds = getCurrentBoundaryBounds(host);
117
+ if (!boundaryBounds) {
118
+ return _constants.NO_STYLES;
119
+ }
120
+ return {
121
+ height: boundaryBounds.height,
122
+ width: boundaryBounds.width
123
+ };
124
+ });
125
+ const slotStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
126
+ "worklet";
127
+
128
+ const slot = host.slotsMap.get()[host.boundaryId];
129
+ return (0, _composeSlotStyle.composeSlotStyleWithLocalTransform)(slot?.style ?? _constants.NO_STYLES, undefined, slot?.boundsLocalTransform);
130
+ });
131
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
132
+ pointerEvents: _teleport.PORTAL_POINTER_EVENTS,
133
+ style: [_reactNative.StyleSheet.absoluteFill, hostStyle],
134
+ collapsable: false,
135
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_portalHost.PortalHost, {
136
+ name: host.portalHostName,
137
+ style: [styles.content, contentFrameStyle, slotStyle]
138
+ })
139
+ });
140
+ });
141
+ const styles = _reactNative.StyleSheet.create({
142
+ // The teleport offset is a physical page delta measured from the screen's
143
+ // left edge, so the content box must anchor there too. Under native RTL,
144
+ // `left: 0` swaps to a right-edge anchor; `end: 0` is the physical left edge
145
+ // in RTL regardless of the swap setting.
146
+ content: _reactNative.I18nManager.isRTL ? {
147
+ end: 0,
148
+ position: "absolute",
149
+ top: 0
150
+ } : {
151
+ left: 0,
152
+ position: "absolute",
153
+ top: 0
154
+ },
155
+ host: {
156
+ elevation: 999999,
157
+ left: 0,
158
+ overflow: "visible",
159
+ position: "absolute",
160
+ top: 0,
161
+ zIndex: 999999
162
+ },
163
+ boundaryHostViewport: {
164
+ left: 0,
165
+ overflow: "visible",
166
+ position: "absolute",
167
+ top: 0
168
+ }
169
+ });
170
+ //# sourceMappingURL=portal-overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireWildcard","_constants","_builder","_composeSlotStyle","_offsetStyle","_useHostMeasurement","_hostRegistry","_portalBoundaryHost","_teleport","_portalHost","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PortalOverlay","exports","memo","fallback","style","screenKey","useBuilderStore","s","derivations","currentScreenKey","id","useId","hostKey","activeBoundaryHosts","useActivePortalBoundaryHosts","height","viewportHeight","width","viewportWidth","useWindowDimensions","measurementKey","length","map","host","portalHostName","join","measurement","useHostMeasurement","boundaryMeasurements","localMeasurement","boundaryHosts","jsx","View","pointerEvents","PORTAL_POINTER_EVENTS","styles","boundaryHostViewport","children","BoundaryPortalPlacement","hostBounds","useLayoutEffect","registerHost","unregisterHost","ref","hostRef","collapsable","getCurrentBoundaryBounds","bounds","useAnimatedReaction","ready","portalHostReady","hostStyle","useAnimatedStyle","boundaryBounds","NO_STYLES","resolvePortalOffsetStyle","contentFrameStyle","slotStyle","slot","slotsMap","boundaryId","composeSlotStyleWithLocalTransform","undefined","boundsLocalTransform","StyleSheet","absoluteFill","PortalHost","name","content","create","I18nManager","isRTL","end","position","top","left","elevation","overflow","zIndex"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/components/portal-overlay.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,sBAAA,GAAAC,uBAAA,CAAAH,OAAA;AAMA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,mBAAA,GAAAV,OAAA;AAIA,IAAAW,SAAA,GAAAX,OAAA;AACA,IAAAY,WAAA,GAAAZ,OAAA;AAA2C,IAAAa,WAAA,GAAAb,OAAA;AAAA,SAAAG,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GA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;IACrBuC,IAAI,EAAE,CAAC;IACPE,QAAQ,EAAE,SAAS;IACnBJ,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Portal = void 0;
7
+ var _react = require("react");
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeReanimated = _interopRequireDefault(require("react-native-reanimated"));
10
+ var _reactNativeWorklets = require("react-native-worklets");
11
+ var _logger = require("../../../../utils/logger");
12
+ var _usePlaceholderStyles = require("../hooks/use-placeholder-styles");
13
+ var _usePortalDestination = require("../hooks/use-portal-destination");
14
+ var _teleport = require("../teleport");
15
+ var _portalHost = require("./portal-host");
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ const AnimatedNativePortal = _teleport.NativePortal ? _reactNativeReanimated.default.createAnimatedComponent(_teleport.NativePortal) : null;
19
+ const EnabledNativePortal = AnimatedNativePortal;
20
+ /**
21
+ * Sends its children to a named PortalHost chosen on the UI thread.
22
+ *
23
+ * `handoff` moves the boundary's content between screens and creates a local
24
+ * receiver inside this boundary. `escapeClipping` moves the whole boundary
25
+ * frame into a PortalOverlay, leaving a sized placeholder at its original spot.
26
+ * When both are enabled, the handoff portal lives inside the escaped frame.
27
+ * Disabled portals, or apps without Teleport, render their children inline.
28
+ */
29
+ const Portal = exports.Portal = /*#__PURE__*/(0, _react.memo)(function Portal(props) {
30
+ if (!props.enabled || props.boundaryId === undefined || !_teleport.isTeleportAvailable || !AnimatedNativePortal) {
31
+ return props.children;
32
+ }
33
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(EnabledPortal, {
34
+ ...props,
35
+ boundaryId: props.boundaryId
36
+ });
37
+ });
38
+ function EnabledPortal({
39
+ boundaryId,
40
+ children,
41
+ mode,
42
+ placeholderRef
43
+ }) {
44
+ if (__DEV__ && mode === "escapeClipping" && !boundaryId) {
45
+ _logger.logger.warnOnce("portal:missing-id", "A boundary portal was rendered without an id; rendering inline.");
46
+ }
47
+ const {
48
+ teleportProps,
49
+ localHostName
50
+ } = (0, _usePortalDestination.usePortalDestination)(boundaryId, mode);
51
+ const content = /*#__PURE__*/(0, _jsxRuntime.jsx)(EnabledNativePortal, {
52
+ animatedProps: teleportProps,
53
+ name: boundaryId,
54
+ pointerEvents: _teleport.PORTAL_POINTER_EVENTS,
55
+ style: mode === "handoff" ? _reactNative.StyleSheet.absoluteFill : undefined,
56
+ children: children
57
+ });
58
+ return mode === "handoff" ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
59
+ children: [content, /*#__PURE__*/(0, _jsxRuntime.jsx)(_portalHost.PortalHost, {
60
+ name: localHostName
61
+ })]
62
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(PortalPlaceholder, {
63
+ placeholderRef: placeholderRef,
64
+ children: content
65
+ });
66
+ }
67
+ function PortalPlaceholder({
68
+ children,
69
+ placeholderRef
70
+ }) {
71
+ const {
72
+ handleOnLayout,
73
+ placeholderStyle
74
+ } = (0, _usePlaceholderStyles.usePlaceholderStyles)();
75
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
76
+ ref: placeholderRef,
77
+ onLayout: ({
78
+ nativeEvent: {
79
+ layout
80
+ }
81
+ }) => (0, _reactNativeWorklets.scheduleOnUI)(handleOnLayout, layout),
82
+ style: placeholderStyle,
83
+ pointerEvents: _teleport.PORTAL_POINTER_EVENTS,
84
+ collapsable: false,
85
+ children: children
86
+ });
87
+ }
88
+ //# sourceMappingURL=portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_interopRequireDefault","_reactNativeWorklets","_logger","_usePlaceholderStyles","_usePortalDestination","_teleport","_portalHost","_jsxRuntime","e","__esModule","default","AnimatedNativePortal","NativePortal","Animated","createAnimatedComponent","EnabledNativePortal","Portal","exports","memo","props","enabled","boundaryId","undefined","isTeleportAvailable","children","jsx","EnabledPortal","mode","placeholderRef","__DEV__","logger","warnOnce","teleportProps","localHostName","usePortalDestination","content","animatedProps","name","pointerEvents","PORTAL_POINTER_EVENTS","style","StyleSheet","absoluteFill","jsxs","Fragment","PortalHost","PortalPlaceholder","handleOnLayout","placeholderStyle","usePlaceholderStyles","View","ref","onLayout","nativeEvent","layout","scheduleOnUI","collapsable"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/components/portal.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAP,OAAA;AAIA,IAAAQ,SAAA,GAAAR,OAAA;AAKA,IAAAS,WAAA,GAAAT,OAAA;AAA2C,IAAAU,WAAA,GAAAV,OAAA;AAAA,SAAAG,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAM3C,MAAMG,oBAAoB,GAAGC,sBAAY,GACtCC,8BAAQ,CAACC,uBAAuB,CAChCF,sBACD,CAAC,GACA,IAAI;AACP,MAAMG,mBAAmB,GAAGJ,oBAE3B;AAUD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMK,MAAM,GAAAC,OAAA,CAAAD,MAAA,gBAAG,IAAAE,WAAI,EAAC,SAASF,MAAMA,CAACG,KAAkB,EAAE;EAC9D,IACC,CAACA,KAAK,CAACC,OAAO,IACdD,KAAK,CAACE,UAAU,KAAKC,SAAS,IAC9B,CAACC,6BAAmB,IACpB,CAACZ,oBAAoB,E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IAAEC;EAAiB,CAAC,GAAG,IAAAC,0CAAoB,EAAC,CAAC;EACnE,oBACC,IAAA1C,WAAA,CAAAkB,GAAA,EAAC1B,sBAAA,CAAAW,OAAQ,CAACwC,IAAI;IACbC,GAAG,EAAEvB,cAAe;IACpBwB,QAAQ,EAAEA,CAAC;MAAEC,WAAW,EAAE;QAAEC;MAAO;IAAE,CAAC,KACrC,IAAAC,iCAAY,EAACR,cAAc,EAAEO,MAAM,CACnC;IACDd,KAAK,EAAEQ,gBAAiB;IACxBV,aAAa,EAAEC,+BAAsB;IACrCiB,WAAW,EAAE,KAAM;IAAAhC,QAAA,EAElBA;EAAQ,CACK,CAAC;AAElB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"names":["resolvePortalOffsetStyle","bounds","hostBounds","hostPageX","pageX","hostPageY","pageY","transform","translateY","translateX","exports"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/helpers/offset-style.ts"],"mappings":";;;;;;AAOO,MAAMA,wBAAwB,GAAGA,CAAC;EACxCC,MAAM;EACNC;AAC+B,CAAC,KAAiB;EACjD,SAAS;;EACT;EACA;EACA;EACA,MAAMC,SAAS,GAAGD,UAAU,EAAEE,KAAK,IAAI,CAAC;EACxC,MAAMC,SAAS,GAAGH,UAAU,EAAEI,KAAK,IAAI,CAAC;EAExC,OAAO;IACNC,SAAS,EAAE,CACV;MAAEC,UAAU,EAAEP,MAAM,CAACK,KAAK,GAAGD;IAAU,CAAC,EACxC;MAAEI,UAAU,EAAER,MAAM,CAACG,KAAK,GAAGD;IAAU,CAAC;EAE1C,CAAC;AACF,CAAC;AAACO,OAAA,CAAAV,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useActivePortalBoundaryHost = void 0;
7
+ var _react = require("react");
8
+ var _portalBoundaryHost = require("../stores/portal-boundary-host.store");
9
+ var _naming = require("../utils/naming");
10
+ // Hosts belong to mounted boundaries, not animation phases. React prepares
11
+ // them once; attachment and release are entirely UI-thread decisions.
12
+ const useActivePortalBoundaryHost = ({
13
+ boundaryId,
14
+ escapeHostKey,
15
+ localMeasurement,
16
+ portalHostReady,
17
+ slotsMap
18
+ }) => {
19
+ const portalHostName = escapeHostKey ? (0, _naming.createBoundaryPortalHostName)(escapeHostKey, boundaryId) : null;
20
+ (0, _react.useLayoutEffect)(() => {
21
+ if (!escapeHostKey || !portalHostName) return;
22
+ (0, _portalBoundaryHost.mountPortalBoundaryHost)({
23
+ boundaryId,
24
+ hostKey: escapeHostKey,
25
+ localMeasurement,
26
+ portalHostName,
27
+ portalHostReady,
28
+ slotsMap
29
+ });
30
+ return () => (0, _portalBoundaryHost.unmountPortalBoundaryHostByName)(portalHostName);
31
+ }, [boundaryId, escapeHostKey, localMeasurement, portalHostName, portalHostReady, slotsMap]);
32
+ return portalHostName;
33
+ };
34
+ exports.useActivePortalBoundaryHost = useActivePortalBoundaryHost;
35
+ //# sourceMappingURL=use-active-portal-boundary-host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_portalBoundaryHost","_naming","useActivePortalBoundaryHost","boundaryId","escapeHostKey","localMeasurement","portalHostReady","slotsMap","portalHostName","createBoundaryPortalHostName","useLayoutEffect","mountPortalBoundaryHost","hostKey","unmountPortalBoundaryHostByName","exports"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/hooks/use-active-portal-boundary-host.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAEA;AACA;AACO,MAAMG,2BAA2B,GAAGA,CAAC;EAC3CC,UAAU;EACVC,aAAa;EACbC,gBAAgB;EAChBC,eAAe;EACfC;AAOD,CAAC,KAAK;EACL,MAAMC,cAAc,GAAGJ,aAAa,GACjC,IAAAK,oCAA4B,EAACL,aAAa,EAAED,UAAU,CAAC,GACvD,IAAI;EAEP,IAAAO,sBAAe,EAAC,MAAM;IACrB,IAAI,CAACN,aAAa,IAAI,CAACI,cAAc,EAAE;IAEvC,IAAAG,2CAAuB,EAAC;MACvBR,UAAU;MACVS,OAAO,EAAER,aAAa;MACtBC,gBAAgB;MAChBG,cAAc;MACdF,eAAe;MACfC;IACD,CAAC,CAAC;IAEF,OAAO,MAAM,IAAAM,mDAA+B,EAACL,cAAc,CAAC;EAC7D,CAAC,EAAE,CACFL,UAAU,EACVC,aAAa,EACbC,gBAAgB,EAChBG,cAAc,EACdF,eAAe,EACfC,QAAQ,CACR,CAAC;EACF,OAAOC,cAAc;AACtB,CAAC;AAACM,OAAA,CAAAZ,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useHostMeasurement = void 0;
7
+ var _reactNativeReanimated = require("react-native-reanimated");
8
+ const HOST_MEASUREMENT_RETRY_DELAY_MS = 16;
9
+ const MAX_HOST_MEASUREMENT_ATTEMPTS = 20;
10
+ const useHostMeasurement = ({
11
+ measurementKey,
12
+ boundaryMeasurements
13
+ }) => {
14
+ const hostRef = (0, _reactNativeReanimated.useAnimatedRef)();
15
+ const measurement = (0, _reactNativeReanimated.useSharedValue)(null);
16
+ const hostBounds = (0, _reactNativeReanimated.useDerivedValue)(() => {
17
+ const captured = measurement.get();
18
+ return captured?.key === measurementKey ? captured.bounds : null;
19
+ });
20
+ const retryToken = (0, _reactNativeReanimated.useSharedValue)(0);
21
+ const attempts = (0, _reactNativeReanimated.useSharedValue)({
22
+ key: measurementKey,
23
+ count: 0
24
+ });
25
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => {
26
+ "worklet";
27
+
28
+ if (!measurementKey) {
29
+ return null;
30
+ }
31
+
32
+ // Hosts mount before their screen is visible. Wait for source capture
33
+ // rather than caching the screen's initial offscreen position.
34
+ let hasSource = false;
35
+ for (const measurement of boundaryMeasurements) {
36
+ if (measurement.get()) {
37
+ hasSource = true;
38
+ break;
39
+ }
40
+ }
41
+ if (!hasSource) return null;
42
+ return [measurementKey, measurement.get()?.key ?? null, retryToken.get()];
43
+ }, state => {
44
+ "worklet";
45
+
46
+ if (!state) {
47
+ (0, _reactNativeReanimated.cancelAnimation)(retryToken);
48
+ return;
49
+ }
50
+ const [requestedKey, completedKey] = state;
51
+ if (requestedKey === completedKey) {
52
+ return;
53
+ }
54
+ (0, _reactNativeReanimated.cancelAnimation)(retryToken);
55
+ const count = attempts.get().key === requestedKey ? attempts.get().count : 0;
56
+ if (count >= MAX_HOST_MEASUREMENT_ATTEMPTS) return;
57
+ attempts.set({
58
+ key: requestedKey,
59
+ count: count + 1
60
+ });
61
+ const measured = (0, _reactNativeReanimated.measure)(hostRef);
62
+ if (!measured || measured.width <= 0 || measured.height <= 0) {
63
+ if (count + 1 < MAX_HOST_MEASUREMENT_ATTEMPTS) {
64
+ retryToken.set((0, _reactNativeReanimated.withDelay)(HOST_MEASUREMENT_RETRY_DELAY_MS, (0, _reactNativeReanimated.withTiming)(retryToken.get() + 1, {
65
+ duration: 0
66
+ })));
67
+ }
68
+ return;
69
+ }
70
+ measurement.set({
71
+ key: requestedKey,
72
+ bounds: {
73
+ ...measured
74
+ }
75
+ });
76
+ });
77
+ return {
78
+ hostBounds,
79
+ hostRef
80
+ };
81
+ };
82
+ exports.useHostMeasurement = useHostMeasurement;
83
+ //# sourceMappingURL=use-host-measurement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeReanimated","require","HOST_MEASUREMENT_RETRY_DELAY_MS","MAX_HOST_MEASUREMENT_ATTEMPTS","useHostMeasurement","measurementKey","boundaryMeasurements","hostRef","useAnimatedRef","measurement","useSharedValue","hostBounds","useDerivedValue","captured","get","key","bounds","retryToken","attempts","count","useAnimatedReaction","hasSource","state","cancelAnimation","requestedKey","completedKey","set","measured","measure","width","height","withDelay","withTiming","duration","exports"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;;;;;AACA,IAAAA,sBAAA,GAAAC,OAAA;AAcA,MAAMC,+BAA+B,GAAG,EAAE;AAC1C,MAAMC,6BAA6B,GAAG,EAAE;AAOjC,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,cAAc;EACdC;AACyB,CAAC,KAAK;EAC/B,MAAMC,OAAO,GAAG,IAAAC,qCAAc,EAAO,CAAC;EACtC,MAAMC,WAAW,GAAG,IAAAC,qCAAc,EAGxB,IAAI,CAAC;EACf,MAAMC,UAAU,GAAG,IAAAC,sCAAe,EAAC,MAAM;IACxC,MAAMC,QAAQ,GAAGJ,WAAW,CAACK,GAAG,CAAC,CAAC;IAClC,OAAOD,QAAQ,EAAEE,GAAG,KAAKV,cAAc,GAAGQ,QAAQ,CAACG,MAAM,GAAG,IAAI;EACjE,CAAC,CAAC;EACF,MAAMC,UAAU,GAAG,IAAAP,qCAAc,EAAC,CAAC,CAAC;EACpC,MAAMQ,QAAQ,GAAG,IAAAR,qCAAc,EAAC;IAAEK,GAAG,EAAEV,cAAc;IAAEc,KAAK,EAAE;EAAE,CAAC,CAAC;EAElE,IAAAC,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,IAAI,CAACf,cAAc,EAAE;MACpB,OAAO,IAAI;IACZ;;IAEA;IACA;IACA,IAAIgB,SAAS,GAAG,KAAK;IACrB,KAAK,MAAMZ,WAAW,IAAIH,oBAAoB,EAAE;MAC/C,IAAIG,WAAW,CAACK,GAAG,CAAC,CAAC,EAAE;QACtBO,SAAS,GAAG,IAAI;QAChB;MACD;IACD;IACA,IAAI,CAACA,SAAS,EAAE,OAAO,IAAI;IAC3B,OAAO,CACNhB,cAAc,EACdI,WAAW,CAACK,GAAG,CAAC,CAAC,EAAEC,GAAG,IAAI,IAAI,EAC9BE,UAAU,CAACH,GAAG,CAAC,CAAC,CAChB;EACF,CAAC,EACAQ,KAAK,IAAK;I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version":3,"names":["_react","require","_reactNativeReanimated","usePlaceholderStyles","placeholderWidth","useSharedValue","placeholderHeight","placeholderStyle","useAnimatedStyle","width","get","height","handleOnLayout","useCallback","layout","hasValidDimensions","set","exports"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/hooks/use-placeholder-styles.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,GAAGA,CAAA,KAAM;EACzC,MAAMC,gBAAgB,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EAC1C,MAAMC,iBAAiB,GAAG,IAAAD,qCAAc,EAAC,CAAC,CAAC;EAC3C;EACA;EACA;EACA;EACA,MAAME,gBAAgB,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAC/C,SAAS;;IACT,MAAMC,KAAK,GAAGL,gBAAgB,CAACM,GAAG,CAAC,CAAC;IACpC,MAAMC,MAAM,GAAGL,iBAAiB,CAACI,GAAG,CAAC,CAAC;IAEtC,IAAID,KAAK,KAAK,CAAC,EAAE;MAChB,OAAO;QAAEA,KAAK,EAAE,MAAM;QAAEE,MAAM,EAAE;MAAO,CAAC;IACzC;IAEA,OAAO;MAAEF,KAAK;MAAEE;IAAO,CAAC;EACzB,CAAC,CAAC;EAEF,MAAMC,cAAc,GAAG,IAAAC,kBAAW,EAChCC,MAAuB,IAAK;IAC5B,SAAS;;IACT,MAAM;MAAEL,KAAK;MAAEE;IAAO,CAAC,GAAGG,MAAM;IAChC,IAAIL,KAAK,KAAK,CAAC,IAAIE,MAAM,KAAK,CAAC,EAAE;MAChC;IACD;IAEA,MAAMI,kBAAkB,GACvBT,iBAAiB,CAACI,GAAG,CAAC,CAAC,KAAK,CAAC,IAAIN,gBAAgB,CAACM,GAAG,CAAC,CAAC,KAAK,CAAC;IAE9D,IAAI,CAACK,kBAAkB,EAAE;MACxBX,gBAAgB,CAACY,GAAG,CAACP,KAAK,CAAC;MAC3BH,iBAAiB,CAACU,GAAG,CAACL,MAAM,CAAC;IAC9B;EACD,CAAC,EACD,CAACL,iBAAiB,EAAEF,gBAAgB,CACrC,CAAC;EAED,OAAO;IAAEG,gBAAgB;IAAEK;EAAe,CAAC;AAC5C,CAAC;AAACK,OAAA,CAAAd,oBAAA,GAAAA,oBAAA","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePortalDestination = usePortalDestination;
7
+ var _reactNativeReanimated = require("react-native-reanimated");
8
+ var _boundaryRoot = require("../../providers/boundary-root.provider");
9
+ var _hostRegistry = require("../stores/host-registry.store");
10
+ var _naming = require("../utils/naming");
11
+ var _useActivePortalBoundaryHost = require("./use-active-portal-boundary-host");
12
+ function usePortalDestination(boundaryId, mode) {
13
+ const {
14
+ currentScreenKey,
15
+ localMeasurement,
16
+ slotsMap,
17
+ boundaryPresentation
18
+ } = (0, _boundaryRoot.useBoundaryRootStore)(s => s);
19
+ const portalHostReady = (0, _reactNativeReanimated.useSharedValue)(false);
20
+ const escapeHostKey = (0, _hostRegistry.useActiveHostKey)(mode === "escapeClipping" ? currentScreenKey : null);
21
+ const portalHostName = (0, _useActivePortalBoundaryHost.useActivePortalBoundaryHost)({
22
+ boundaryId,
23
+ escapeHostKey,
24
+ localMeasurement,
25
+ portalHostReady,
26
+ slotsMap
27
+ });
28
+ const teleportProps = (0, _reactNativeReanimated.useAnimatedProps)(() => {
29
+ "worklet";
30
+
31
+ const {
32
+ owner,
33
+ receiver,
34
+ slots
35
+ } = boundaryPresentation.get();
36
+ const slot = slots[boundaryId];
37
+ const {
38
+ pointerEvents: _pointerEvents,
39
+ handoffTarget: _handoffTarget,
40
+ ...props
41
+ } = slot?.props ?? {};
42
+ let hostName = _naming.PORTAL_HOST_NAME_RESET_VALUE;
43
+ if (mode === "handoff") {
44
+ hostName = (0, _naming.createHandoffHostName)(receiver, boundaryId);
45
+ } else if (owner?.ready && localMeasurement.get()?.pairKey === owner.pairKey && slot !== undefined && portalHostReady.get()) {
46
+ hostName = portalHostName;
47
+ }
48
+ return {
49
+ ...props,
50
+ hostName
51
+ };
52
+ });
53
+ return {
54
+ teleportProps,
55
+ localHostName: (0, _naming.createHandoffHostName)(currentScreenKey, boundaryId)
56
+ };
57
+ }
58
+ //# sourceMappingURL=use-portal-destination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeReanimated","require","_boundaryRoot","_hostRegistry","_naming","_useActivePortalBoundaryHost","usePortalDestination","boundaryId","mode","currentScreenKey","localMeasurement","slotsMap","boundaryPresentation","useBoundaryRootStore","s","portalHostReady","useSharedValue","escapeHostKey","useActiveHostKey","portalHostName","useActivePortalBoundaryHost","teleportProps","useAnimatedProps","owner","receiver","slots","get","slot","pointerEvents","_pointerEvents","handoffTarget","_handoffTarget","props","hostName","PORTAL_HOST_NAME_RESET_VALUE","createHandoffHostName","ready","pairKey","undefined","localHostName"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/hooks/use-portal-destination.ts"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAIA,IAAAI,4BAAA,GAAAJ,OAAA;AAIO,SAASK,oBAAoBA,CAACC,UAAkB,EAAEC,IAAgB,EAAE;EAC1E,MAAM;IAAEC,gBAAgB;IAAEC,gBAAgB;IAAEC,QAAQ;IAAEC;EAAqB,CAAC,GAC3E,IAAAC,kCAAoB,EAAEC,CAAC,IAAKA,CAAC,CAAC;EAC/B,MAAMC,eAAe,GAAG,IAAAC,qCAAc,EAAC,KAAK,CAAC;EAC7C,MAAMC,aAAa,GAAG,IAAAC,8BAAgB,EACrCV,IAAI,KAAK,gBAAgB,GAAGC,gBAAgB,GAAG,IAChD,CAAC;EACD,MAAMU,cAAc,GAAG,IAAAC,wDAA2B,EAAC;IAClDb,UAAU;IACVU,aAAa;IACbP,gBAAgB;IAChBK,eAAe;IACfJ;EACD,CAAC,CAAC;EACF,MAAMU,aAAa,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAC5C,SAAS;;IACT,MAAM;MAAEC,KAAK;MAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAGb,oBAAoB,CAACc,GAAG,CAAC,CAAC;IAC7D,MAAMC,IAAI,GAAGF,KAAK,CAAClB,UAAU,CAAC;IAC9B,MAAM;MACLqB,aAAa,EAAEC,cAAc;MAC7BC,aAAa,EAAEC,cAAc;MAC7B,GAAGC;IACJ,CAAC,GAAGL,IAAI,EAAEK,KAAK,IAAI,CAAC,CAAC;IACrB,IAAIC,QAAuB,GAAGC,oCAA4B;IAC1D,IAAI1B,IAAI,KAAK,SAAS,EAAE;MACvByB,QAAQ,GAAG,IAAAE,6BAAqB,EAACX,QAAQ,EAAEjB,UAAU,CAAC;IACvD,CAAC,MAAM,IACNgB,KAAK,EAAEa,KAAK,IACZ1B,gBAAgB,CAACgB,GAAG,CAAC,CAAC,EAAEW,OAAO,KAAKd,KAAK,CAACc,OAAO,IACjDV,IAAI,KAAKW,SAAS,IAClBvB,eAAe,CAACW,GAAG,CAAC,CAAC,EACpB;MACDO,QAAQ,GAAGd,cAAc;IAC1B;IAEA,OAAO;MAAE,GAAGa,KAAK;MAAEC;IAAS,CAAC;EAC9B,CAAC,CAAC;EACF,OAAO;IACNZ,aAAa;IACbkB,aAAa,EAAE,IAAAJ,6BAAqB,EAAC1B,gBAAgB,EAAEF,UAAU;EAClE,CAAC;AACF","ignoreList":[]}
@@ -3,18 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Host", {
7
- enumerable: true,
8
- get: function () {
9
- return _host.Host;
10
- }
11
- });
12
6
  Object.defineProperty(exports, "PortalProvider", {
13
7
  enumerable: true,
14
8
  get: function () {
15
9
  return _portalProvider.PortalProvider;
16
10
  }
17
11
  });
18
- var _host = require("./components/boundary-portal/components/host");
19
12
  var _portalProvider = require("./components/portal-provider");
20
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_host","require","_portalProvider"],"sourceRoot":"../../../../../src","sources":["components/boundary/portal/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["_portalProvider","require"],"sourceRoot":"../../../../../src","sources":["components/boundary/portal/index.ts"],"mappings":";;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA","ignoreList":[]}
@@ -5,10 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.useActiveHostKey = exports.unregisterHost = exports.resetHostRegistry = exports.registerHost = exports.getActiveHostKey = void 0;
7
7
  var _react = require("react");
8
- const EMPTY_SNAPSHOT = {};
9
8
  const listeners = new Set();
10
9
  const hostStacks = new Map();
11
- let snapshot = EMPTY_SNAPSHOT;
12
10
 
13
11
  /**
14
12
  * The active host for a screen. Stack ordering is the load-bearing invariant:
@@ -28,15 +26,7 @@ const getActiveHostFromStack = (screenKey, stack) => {
28
26
  }
29
27
  return stack[0]?.hostKey ?? screenKey;
30
28
  };
31
- const buildSnapshot = () => {
32
- const nextSnapshot = {};
33
- for (const [screenKey, stack] of hostStacks) {
34
- nextSnapshot[screenKey] = getActiveHostFromStack(screenKey, stack);
35
- }
36
- return nextSnapshot;
37
- };
38
29
  const emit = () => {
39
- snapshot = buildSnapshot();
40
30
  for (const listener of listeners) {
41
31
  listener();
42
32
  }
@@ -82,7 +72,7 @@ const unregisterHost = (screenKey, hostKey) => {
82
72
  };
83
73
  exports.unregisterHost = unregisterHost;
84
74
  const getActiveHostKey = screenKey => {
85
- return snapshot[screenKey] ?? screenKey;
75
+ return getActiveHostFromStack(screenKey, hostStacks.get(screenKey));
86
76
  };
87
77
  exports.getActiveHostKey = getActiveHostKey;
88
78
  const useActiveHostKey = screenKey => {
@@ -91,7 +81,6 @@ const useActiveHostKey = screenKey => {
91
81
  exports.useActiveHostKey = useActiveHostKey;
92
82
  const resetHostRegistry = () => {
93
83
  hostStacks.clear();
94
- snapshot = EMPTY_SNAPSHOT;
95
84
  emit();
96
85
  };
97
86
  exports.resetHostRegistry = resetHostRegistry;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","listeners","Set","hostStacks","Map","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","exports","unregisterHost","getActiveHostKey","useActiveHostKey","useSyncExternalStore","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/stores/host-registry.store.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQA,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOF,SAAS;EACjB;EAEA,KAAK,IAAIG,KAAK,GAAGF,KAAK,CAACC,MAAM,GAAG,CAAC,EAAEC,KAAK,IAAI,CAAC,EAAEA,KAAK,EAAE,EAAE;IACvD,MAAMC,IAAI,GAAGH,KAAK,CAACE,KAAK,CAAC;IACzB,IAAI,CAACC,IAAI,CAACC,QAAQ,EAAE;MACnB,OAAOD,IAAI,CAACE,OAAO;IACpB;EACD;EAEA,OAAOL,KAAK,CAAC,CAAC,CAAC,EAAEK,OAAO,IAAIN,SAAS;AACtC,CAAC;AAED,MAAMO,IAAI,GAAGA,CAAA,KAAM;EAClB,KAAK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f,KAAK,CAACgB,MAAM,CAAEb,IAAI,IAAKA,IAAI,CAACE,OAAO,KAAKA,OAAO,CAAC;EAElE,IAAIU,SAAS,CAACd,MAAM,KAAK,CAAC,EAAE;IAC3BL,UAAU,CAACc,MAAM,CAACX,SAAS,CAAC;EAC7B,CAAC,MAAM;IACNH,UAAU,CAACuB,GAAG,CAACpB,SAAS,EAAEgB,SAAS,CAAC;EACrC;EAEA,IAAID,qBAAqB,KAAKhB,sBAAsB,CAACC,SAAS,EAAEgB,SAAS,CAAC,EAAE;IAC3E;EACD;EAEAT,IAAI,CAAC,CAAC;AACP,CAAC;AAACc,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAEK,MAAMC,gBAAgB,GAAIvB,SAAiB,IAAK;EACtD,OAAOD,sBAAsB,CAACC,SAAS,EAAEH,UAAU,CAACiB,GAAG,CAACd,SAAS,CAAC,CAAC;AACpE,CAAC;AAACqB,OAAA,CAAAE,gBAAA,GAAAA,gBAAA;AAEK,MAAMC,gBAAgB,GAAIxB,SAAyB,IAAK;EAC9D,OAAO,IAAAyB,2BAAoB,EAC1BhB,SAAS,EACT,MAAOT,SAAS,GAAGuB,gBAAgB,CAACvB,SAAS,CAAC,GAAG0B,SAAU,EAC3D,MAAMA,SACP,CAAC;AACF,CAAC;AAACL,OAAA,CAAAG,gBAAA,GAAAA,gBAAA;AAEK,MAAMG,iBAAiB,GAAGA,CAAA,KAAM;EACtC9B,UAAU,CAAC+B,KAAK,CAAC,CAAC;EAClBrB,IAAI,CAAC,CAAC;AACP,CAAC;AAACc,OAAA,CAAAM,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -11,25 +11,23 @@ const activeBoundaryHosts = new Map();
11
11
  let snapshot = {
12
12
  hostsByScope: {}
13
13
  };
14
- const buildSnapshot = () => {
15
- const hostsByScope = {};
16
- for (const host of activeBoundaryHosts.values()) {
17
- const hosts = hostsByScope[host.hostKey] ?? [];
18
- hosts.push(host);
19
- hostsByScope[host.hostKey] = hosts;
14
+
15
+ // Preserve other overlays' snapshots so a registration only rerenders its owners.
16
+ const emit = (...hostKeys) => {
17
+ const hostsByScope = {
18
+ ...snapshot.hostsByScope
19
+ };
20
+ for (const hostKey of new Set(hostKeys)) {
21
+ hostsByScope[hostKey] = Array.from(activeBoundaryHosts.values()).filter(host => host.hostKey === hostKey);
22
+ if (!hostsByScope[hostKey].length) delete hostsByScope[hostKey];
20
23
  }
21
- return {
24
+ snapshot = {
22
25
  hostsByScope
23
26
  };
24
- };
25
- const emit = () => {
26
- snapshot = buildSnapshot();
27
- for (const listener of listeners) {
28
- listener();
29
- }
27
+ for (const listener of listeners) listener();
30
28
  };
31
29
  const isSameHost = (a, b) => {
32
- return a.boundaryId === b.boundaryId && a.hostKey === b.hostKey && a.localMeasurement === b.localMeasurement && a.pairKey === b.pairKey && a.portalHostName === b.portalHostName && a.portalHostReady === b.portalHostReady && a.slotsMap === b.slotsMap;
30
+ return a.boundaryId === b.boundaryId && a.hostKey === b.hostKey && a.localMeasurement === b.localMeasurement && a.portalHostName === b.portalHostName && a.portalHostReady === b.portalHostReady && a.slotsMap === b.slotsMap;
33
31
  };
34
32
  const mountPortalBoundaryHost = host => {
35
33
  const previous = activeBoundaryHosts.get(host.portalHostName);
@@ -37,14 +35,16 @@ const mountPortalBoundaryHost = host => {
37
35
  return;
38
36
  }
39
37
  activeBoundaryHosts.set(host.portalHostName, host);
40
- emit();
38
+ emit(host.hostKey, previous?.hostKey ?? host.hostKey);
41
39
  };
42
40
  exports.mountPortalBoundaryHost = mountPortalBoundaryHost;
43
41
  const unmountPortalBoundaryHostByName = portalHostName => {
44
- if (!portalHostName || !activeBoundaryHosts.delete(portalHostName)) {
42
+ const host = portalHostName ? activeBoundaryHosts.get(portalHostName) : undefined;
43
+ if (!host) {
45
44
  return;
46
45
  }
47
- emit();
46
+ activeBoundaryHosts.delete(host.portalHostName);
47
+ emit(host.hostKey);
48
48
  };
49
49
  exports.unmountPortalBoundaryHostByName = unmountPortalBoundaryHostByName;
50
50
  const subscribe = listener => {
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","EMPTY_HOSTS","listeners","Set","activeBoundaryHosts","Map","snapshot","hostsByScope","emit","hostKeys","hostKey","Array","from","values","filter","host","length","listener","isSameHost","a","b","boundaryId","localMeasurement","portalHostName","portalHostReady","slotsMap","mountPortalBoundaryHost","previous","get","set","exports","unmountPortalBoundaryHostByName","undefined","delete","subscribe","add","useActivePortalBoundaryHosts","useSyncExternalStore"],"sourceRoot":"../../../../../../src","sources":["components/boundary/portal/stores/portal-boundary-host.store.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAkBA,MAAMC,WAAuC,GAAG,EAAE;AAElD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAmC,CAAC;AAEvE,IAAIC,QAAwB,GAAG;EAC9BC,YAAY,EAAE,CAAC;AAChB,CAAC;;AAED;AACA,MAAMC,IAAI,GAAGA,CAAC,GAAGC,QAAkB,KAAK;EACvC,MAAMF,YAAY,GAAG;IAAE,GAAGD,QAAQ,CAACC;EAAa,CAAC;EACjD,KAAK,MAAMG,OAAO,IAAI,IAAIP,GAAG,CAACM,QAAQ,CAAC,EAAE;IACxCF,YAAY,CAACG,OAAO,CAAC,GAAGC,KAAK,CAACC,IAAI,CAACR,mBAAmB,CAACS,MAAM,CAAC,CAAC,CAAC,CAACC,MAAM,CACrEC,IAAI,IAAKA,IAAI,CAACL,OAAO,KAAKA,OAC5B,CAAC;IACD,IAAI,CAACH,YAAY,CAACG,OAAO,CAAC,CAACM,MAAM,EAAE,OAAOT,YAAY,CAACG,OAAO,CAAC;EAChE;EACAJ,QAAQ,GAAG;IAAEC;EAAa,CAAC;EAC3B,KAAK,MAAMU,QAAQ,IAAIf,SAAS,EAAEe,QAAQ,CAAC,CAAC;AAC7C,CAAC;AAED,MAAMC,UAAU,GAAGA,CAClBC,CAA2B,EAC3BC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