@oxyhq/bloom 1.6.0 → 1.8.0

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 (212) hide show
  1. package/NOTICE +46 -0
  2. package/docs/media-flight.mdx +151 -3
  3. package/docs/teleport.mdx +72 -0
  4. package/lib/commonjs/media-flight/MediaFlightLayer.js +4 -5
  5. package/lib/commonjs/media-flight/MediaFlightLayer.js.map +1 -1
  6. package/lib/commonjs/media-flight/media-node.web.js +37 -1
  7. package/lib/commonjs/media-flight/media-node.web.js.map +1 -1
  8. package/lib/commonjs/teleport/Portal.js +109 -0
  9. package/lib/commonjs/teleport/Portal.js.map +1 -0
  10. package/lib/commonjs/teleport/PortalHost.js +75 -0
  11. package/lib/commonjs/teleport/PortalHost.js.map +1 -0
  12. package/lib/commonjs/teleport/PortalHostView.js +40 -0
  13. package/lib/commonjs/teleport/PortalHostView.js.map +1 -0
  14. package/lib/commonjs/teleport/PortalHostView.native.js +24 -0
  15. package/lib/commonjs/teleport/PortalHostView.native.js.map +1 -0
  16. package/lib/commonjs/teleport/PortalProvider.js +57 -0
  17. package/lib/commonjs/teleport/PortalProvider.js.map +1 -0
  18. package/lib/commonjs/teleport/PortalProviderView.js +59 -0
  19. package/lib/commonjs/teleport/PortalProviderView.js.map +1 -0
  20. package/lib/commonjs/teleport/PortalProviderView.native.js +19 -0
  21. package/lib/commonjs/teleport/PortalProviderView.native.js.map +1 -0
  22. package/lib/commonjs/teleport/PortalView.js +83 -0
  23. package/lib/commonjs/teleport/PortalView.js.map +1 -0
  24. package/lib/commonjs/teleport/PortalView.native.js +14 -0
  25. package/lib/commonjs/teleport/PortalView.native.js.map +1 -0
  26. package/lib/commonjs/teleport/index.js +35 -0
  27. package/lib/commonjs/teleport/index.js.map +1 -0
  28. package/lib/commonjs/teleport/portal-manager.js +40 -0
  29. package/lib/commonjs/teleport/portal-manager.js.map +1 -0
  30. package/lib/commonjs/teleport/portal-registry.js +24 -0
  31. package/lib/commonjs/teleport/portal-registry.js.map +1 -0
  32. package/lib/commonjs/teleport/reducer.js +86 -0
  33. package/lib/commonjs/teleport/reducer.js.map +1 -0
  34. package/lib/commonjs/teleport/scroll-view-context/context.js +17 -0
  35. package/lib/commonjs/teleport/scroll-view-context/context.js.map +1 -0
  36. package/lib/commonjs/teleport/scroll-view-context/context.native.js +22 -0
  37. package/lib/commonjs/teleport/scroll-view-context/context.native.js.map +1 -0
  38. package/lib/commonjs/teleport/scroll-view-context/types.js +2 -0
  39. package/lib/commonjs/teleport/scroll-view-context/types.js.map +1 -0
  40. package/lib/commonjs/teleport/specs/PortalHostViewNativeComponent.js +17 -0
  41. package/lib/commonjs/teleport/specs/PortalHostViewNativeComponent.js.map +1 -0
  42. package/lib/commonjs/teleport/specs/PortalViewNativeComponent.js +17 -0
  43. package/lib/commonjs/teleport/specs/PortalViewNativeComponent.js.map +1 -0
  44. package/lib/commonjs/teleport/teleport-global.d.js +2 -0
  45. package/lib/commonjs/teleport/teleport-global.d.js.map +1 -0
  46. package/lib/commonjs/teleport/types.js +6 -0
  47. package/lib/commonjs/teleport/types.js.map +1 -0
  48. package/lib/commonjs/teleport/use-id.js +24 -0
  49. package/lib/commonjs/teleport/use-id.js.map +1 -0
  50. package/lib/commonjs/teleport/use-portal.js +59 -0
  51. package/lib/commonjs/teleport/use-portal.js.map +1 -0
  52. package/lib/module/media-flight/MediaFlightLayer.js +4 -5
  53. package/lib/module/media-flight/MediaFlightLayer.js.map +1 -1
  54. package/lib/module/media-flight/media-node.web.js +37 -1
  55. package/lib/module/media-flight/media-node.web.js.map +1 -1
  56. package/lib/module/teleport/Portal.js +103 -0
  57. package/lib/module/teleport/Portal.js.map +1 -0
  58. package/lib/module/teleport/PortalHost.js +71 -0
  59. package/lib/module/teleport/PortalHost.js.map +1 -0
  60. package/lib/module/teleport/PortalHostView.js +35 -0
  61. package/lib/module/teleport/PortalHostView.js.map +1 -0
  62. package/lib/module/teleport/PortalHostView.native.js +18 -0
  63. package/lib/module/teleport/PortalHostView.native.js.map +1 -0
  64. package/lib/module/teleport/PortalProvider.js +51 -0
  65. package/lib/module/teleport/PortalProvider.js.map +1 -0
  66. package/lib/module/teleport/PortalProviderView.js +54 -0
  67. package/lib/module/teleport/PortalProviderView.js.map +1 -0
  68. package/lib/module/teleport/PortalProviderView.native.js +15 -0
  69. package/lib/module/teleport/PortalProviderView.native.js.map +1 -0
  70. package/lib/module/teleport/PortalView.js +79 -0
  71. package/lib/module/teleport/PortalView.js.map +1 -0
  72. package/lib/module/teleport/PortalView.native.js +10 -0
  73. package/lib/module/teleport/PortalView.native.js.map +1 -0
  74. package/lib/module/teleport/index.js +30 -0
  75. package/lib/module/teleport/index.js.map +1 -0
  76. package/lib/module/teleport/portal-manager.js +33 -0
  77. package/lib/module/teleport/portal-manager.js.map +1 -0
  78. package/lib/module/teleport/portal-registry.js +18 -0
  79. package/lib/module/teleport/portal-registry.js.map +1 -0
  80. package/lib/module/teleport/reducer.js +81 -0
  81. package/lib/module/teleport/reducer.js.map +1 -0
  82. package/lib/module/teleport/scroll-view-context/context.js +12 -0
  83. package/lib/module/teleport/scroll-view-context/context.js.map +1 -0
  84. package/lib/module/teleport/scroll-view-context/context.native.js +18 -0
  85. package/lib/module/teleport/scroll-view-context/context.native.js.map +1 -0
  86. package/lib/module/teleport/scroll-view-context/types.js +2 -0
  87. package/lib/module/teleport/scroll-view-context/types.js.map +1 -0
  88. package/lib/module/teleport/specs/PortalHostViewNativeComponent.js +13 -0
  89. package/lib/module/teleport/specs/PortalHostViewNativeComponent.js.map +1 -0
  90. package/lib/module/teleport/specs/PortalViewNativeComponent.js +13 -0
  91. package/lib/module/teleport/specs/PortalViewNativeComponent.js.map +1 -0
  92. package/lib/module/teleport/teleport-global.d.js +2 -0
  93. package/lib/module/teleport/teleport-global.d.js.map +1 -0
  94. package/lib/module/teleport/types.js +4 -0
  95. package/lib/module/teleport/types.js.map +1 -0
  96. package/lib/module/teleport/use-id.js +19 -0
  97. package/lib/module/teleport/use-id.js.map +1 -0
  98. package/lib/module/teleport/use-portal.js +55 -0
  99. package/lib/module/teleport/use-portal.js.map +1 -0
  100. package/lib/typescript/commonjs/media-flight/MediaFlightLayer.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/media-flight/media-node.web.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/teleport/Portal.d.ts +48 -0
  103. package/lib/typescript/commonjs/teleport/Portal.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/teleport/PortalHost.d.ts +25 -0
  105. package/lib/typescript/commonjs/teleport/PortalHost.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/teleport/PortalHostView.d.ts +5 -0
  107. package/lib/typescript/commonjs/teleport/PortalHostView.d.ts.map +1 -0
  108. package/lib/typescript/commonjs/teleport/PortalHostView.native.d.ts +4 -0
  109. package/lib/typescript/commonjs/teleport/PortalHostView.native.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/teleport/PortalProvider.d.ts +23 -0
  111. package/lib/typescript/commonjs/teleport/PortalProvider.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/teleport/PortalProviderView.d.ts +3 -0
  113. package/lib/typescript/commonjs/teleport/PortalProviderView.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/teleport/PortalProviderView.native.d.ts +9 -0
  115. package/lib/typescript/commonjs/teleport/PortalProviderView.native.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/teleport/PortalView.d.ts +9 -0
  117. package/lib/typescript/commonjs/teleport/PortalView.d.ts.map +1 -0
  118. package/lib/typescript/commonjs/teleport/PortalView.native.d.ts +8 -0
  119. package/lib/typescript/commonjs/teleport/PortalView.native.d.ts.map +1 -0
  120. package/lib/typescript/commonjs/teleport/index.d.ts +29 -0
  121. package/lib/typescript/commonjs/teleport/index.d.ts.map +1 -0
  122. package/lib/typescript/commonjs/teleport/portal-manager.d.ts +16 -0
  123. package/lib/typescript/commonjs/teleport/portal-manager.d.ts.map +1 -0
  124. package/lib/typescript/commonjs/teleport/portal-registry.d.ts +10 -0
  125. package/lib/typescript/commonjs/teleport/portal-registry.d.ts.map +1 -0
  126. package/lib/typescript/commonjs/teleport/reducer.d.ts +40 -0
  127. package/lib/typescript/commonjs/teleport/reducer.d.ts.map +1 -0
  128. package/lib/typescript/commonjs/teleport/scroll-view-context/context.d.ts +4 -0
  129. package/lib/typescript/commonjs/teleport/scroll-view-context/context.d.ts.map +1 -0
  130. package/lib/typescript/commonjs/teleport/scroll-view-context/context.native.d.ts +13 -0
  131. package/lib/typescript/commonjs/teleport/scroll-view-context/context.native.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/teleport/scroll-view-context/types.d.ts +10 -0
  133. package/lib/typescript/commonjs/teleport/scroll-view-context/types.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/teleport/specs/PortalHostViewNativeComponent.d.ts +13 -0
  135. package/lib/typescript/commonjs/teleport/specs/PortalHostViewNativeComponent.d.ts.map +1 -0
  136. package/lib/typescript/commonjs/teleport/specs/PortalViewNativeComponent.d.ts +14 -0
  137. package/lib/typescript/commonjs/teleport/specs/PortalViewNativeComponent.d.ts.map +1 -0
  138. package/lib/typescript/commonjs/teleport/types.d.ts +22 -0
  139. package/lib/typescript/commonjs/teleport/types.d.ts.map +1 -0
  140. package/lib/typescript/commonjs/teleport/use-id.d.ts +2 -0
  141. package/lib/typescript/commonjs/teleport/use-id.d.ts.map +1 -0
  142. package/lib/typescript/commonjs/teleport/use-portal.d.ts +35 -0
  143. package/lib/typescript/commonjs/teleport/use-portal.d.ts.map +1 -0
  144. package/lib/typescript/module/media-flight/MediaFlightLayer.d.ts.map +1 -1
  145. package/lib/typescript/module/media-flight/media-node.web.d.ts.map +1 -1
  146. package/lib/typescript/module/teleport/Portal.d.ts +48 -0
  147. package/lib/typescript/module/teleport/Portal.d.ts.map +1 -0
  148. package/lib/typescript/module/teleport/PortalHost.d.ts +25 -0
  149. package/lib/typescript/module/teleport/PortalHost.d.ts.map +1 -0
  150. package/lib/typescript/module/teleport/PortalHostView.d.ts +5 -0
  151. package/lib/typescript/module/teleport/PortalHostView.d.ts.map +1 -0
  152. package/lib/typescript/module/teleport/PortalHostView.native.d.ts +4 -0
  153. package/lib/typescript/module/teleport/PortalHostView.native.d.ts.map +1 -0
  154. package/lib/typescript/module/teleport/PortalProvider.d.ts +23 -0
  155. package/lib/typescript/module/teleport/PortalProvider.d.ts.map +1 -0
  156. package/lib/typescript/module/teleport/PortalProviderView.d.ts +3 -0
  157. package/lib/typescript/module/teleport/PortalProviderView.d.ts.map +1 -0
  158. package/lib/typescript/module/teleport/PortalProviderView.native.d.ts +9 -0
  159. package/lib/typescript/module/teleport/PortalProviderView.native.d.ts.map +1 -0
  160. package/lib/typescript/module/teleport/PortalView.d.ts +9 -0
  161. package/lib/typescript/module/teleport/PortalView.d.ts.map +1 -0
  162. package/lib/typescript/module/teleport/PortalView.native.d.ts +8 -0
  163. package/lib/typescript/module/teleport/PortalView.native.d.ts.map +1 -0
  164. package/lib/typescript/module/teleport/index.d.ts +29 -0
  165. package/lib/typescript/module/teleport/index.d.ts.map +1 -0
  166. package/lib/typescript/module/teleport/portal-manager.d.ts +16 -0
  167. package/lib/typescript/module/teleport/portal-manager.d.ts.map +1 -0
  168. package/lib/typescript/module/teleport/portal-registry.d.ts +10 -0
  169. package/lib/typescript/module/teleport/portal-registry.d.ts.map +1 -0
  170. package/lib/typescript/module/teleport/reducer.d.ts +40 -0
  171. package/lib/typescript/module/teleport/reducer.d.ts.map +1 -0
  172. package/lib/typescript/module/teleport/scroll-view-context/context.d.ts +4 -0
  173. package/lib/typescript/module/teleport/scroll-view-context/context.d.ts.map +1 -0
  174. package/lib/typescript/module/teleport/scroll-view-context/context.native.d.ts +13 -0
  175. package/lib/typescript/module/teleport/scroll-view-context/context.native.d.ts.map +1 -0
  176. package/lib/typescript/module/teleport/scroll-view-context/types.d.ts +10 -0
  177. package/lib/typescript/module/teleport/scroll-view-context/types.d.ts.map +1 -0
  178. package/lib/typescript/module/teleport/specs/PortalHostViewNativeComponent.d.ts +13 -0
  179. package/lib/typescript/module/teleport/specs/PortalHostViewNativeComponent.d.ts.map +1 -0
  180. package/lib/typescript/module/teleport/specs/PortalViewNativeComponent.d.ts +14 -0
  181. package/lib/typescript/module/teleport/specs/PortalViewNativeComponent.d.ts.map +1 -0
  182. package/lib/typescript/module/teleport/types.d.ts +22 -0
  183. package/lib/typescript/module/teleport/types.d.ts.map +1 -0
  184. package/lib/typescript/module/teleport/use-id.d.ts +2 -0
  185. package/lib/typescript/module/teleport/use-id.d.ts.map +1 -0
  186. package/lib/typescript/module/teleport/use-portal.d.ts +35 -0
  187. package/lib/typescript/module/teleport/use-portal.d.ts.map +1 -0
  188. package/package.json +16 -1
  189. package/src/media-flight/MediaFlightLayer.tsx +4 -5
  190. package/src/media-flight/media-node.web.ts +42 -1
  191. package/src/teleport/Portal.tsx +97 -0
  192. package/src/teleport/PortalHost.tsx +61 -0
  193. package/src/teleport/PortalHostView.native.tsx +14 -0
  194. package/src/teleport/PortalHostView.tsx +30 -0
  195. package/src/teleport/PortalProvider.tsx +51 -0
  196. package/src/teleport/PortalProviderView.native.tsx +11 -0
  197. package/src/teleport/PortalProviderView.tsx +67 -0
  198. package/src/teleport/PortalView.native.tsx +7 -0
  199. package/src/teleport/PortalView.tsx +94 -0
  200. package/src/teleport/index.ts +32 -0
  201. package/src/teleport/portal-manager.tsx +48 -0
  202. package/src/teleport/portal-registry.ts +27 -0
  203. package/src/teleport/reducer.ts +94 -0
  204. package/src/teleport/scroll-view-context/context.native.ts +19 -0
  205. package/src/teleport/scroll-view-context/context.ts +12 -0
  206. package/src/teleport/scroll-view-context/types.ts +7 -0
  207. package/src/teleport/specs/PortalHostViewNativeComponent.ts +15 -0
  208. package/src/teleport/specs/PortalViewNativeComponent.ts +16 -0
  209. package/src/teleport/teleport-global.d.ts +11 -0
  210. package/src/teleport/types.ts +22 -0
  211. package/src/teleport/use-id.ts +18 -0
  212. package/src/teleport/use-portal.ts +47 -0
package/NOTICE ADDED
@@ -0,0 +1,46 @@
1
+ @oxyhq/bloom — third-party notices
2
+ =================================
3
+
4
+ Bloom includes code derived from other open-source projects. Each derived file
5
+ carries a header naming its source, the version it was taken from, and what was
6
+ changed; this file carries the licences those sources require, in full.
7
+
8
+
9
+ react-native-teleport
10
+ ---------------------
11
+
12
+ https://github.com/kirillzyusko/react-native-teleport — by Kiryl Ziusko.
13
+
14
+ Bloom's media-flight layer moves one media element between hosts instead of
15
+ rebuilding it at each end. Bloom arrived at the web technique independently and
16
+ then found that react-native-teleport had solved the same problem, better in
17
+ places: it is the source of the `moveBefore`-with-`insertBefore`-fallback move
18
+ used in `src/media-flight/media-node.web.ts`, and — where noted in those files —
19
+ of Bloom's native re-parenting.
20
+
21
+ We are grateful for it, and for the fact that it is readable: the reasoning in
22
+ its source and its documentation is what let us check our own.
23
+
24
+ Taken from version 1.2.0.
25
+
26
+ MIT License
27
+
28
+ Copyright (c) 2025 Kiryl Ziusko
29
+
30
+ Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ of this software and associated documentation files (the "Software"), to deal
32
+ in the Software without restriction, including without limitation the rights
33
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ copies of the Software, and to permit persons to whom the Software is
35
+ furnished to do so, subject to the following conditions:
36
+
37
+ The above copyright notice and this permission notice shall be included in all
38
+ copies or substantial portions of the Software.
39
+
40
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ SOFTWARE.
@@ -149,9 +149,67 @@ and "did `currentTime` advance monotonically?", not time-to-first-frame.
149
149
 
150
150
  ## Why this exists rather than `react-native-teleport`
151
151
 
152
- A shared-element transition normally assumes the origin screen is still mounted
153
- while the element travels. That is why `react-native-teleport` requires
154
- `presentation: 'transparentModal'`, and why it has no web story at all.
152
+ **Correction, 2026-08-26.** This section used to say that `react-native-teleport`
153
+ requires `presentation: 'transparentModal'` and "has no web story at all". Both
154
+ were false, both were written here without checking, and they described someone
155
+ else's work wrongly in a public repository. Verified against the published
156
+ package (`react-native-teleport@1.2.0`), what is actually true is the opposite,
157
+ and it is worth reading:
158
+
159
+ ```js
160
+ // lib/module/views/Portal/index.js — the WEB implementation
161
+ if (!elRef.current) elRef.current = document.createElement("div"); // outside React
162
+ const supportsMoveBefore = "moveBefore" in Element.prototype;
163
+ parent.moveBefore(child, before); // insertBefore fallback
164
+ createPortal(children, elRef.current);
165
+ ```
166
+
167
+ Their own documentation says so plainly — "✅ Works across **iOS, Android, and
168
+ Web**" (`docs/docs/intro.mdx`) and "Cross-platform: Consistent on iOS, Android
169
+ and web" (`docs/docs/guides/portal.md`) — which is what this guide should have
170
+ checked before claiming otherwise.
171
+
172
+ That is **the same mechanism** described elsewhere in this guide as Bloom's:
173
+ a wrapper created outside React, `createPortal` into a container whose identity
174
+ never changes, and the wrapper moved between hosts. Down to the `moveBefore`
175
+ with a fallback. Bloom arrived at it independently, which is corroboration that
176
+ the technique is right — not grounds for having said they lacked it.
177
+
178
+ **The real reasons Bloom has its own**, both checkable:
179
+
180
+ - **Bloom needed a flight, not a portal.** The animated box, the anchor
181
+ registry, the rect measurement, the poster behind the media, `contentFit`, and
182
+ the shared-player semantics are the feature; teleporting the node is one piece
183
+ of it.
184
+ - **`react-native-teleport` ships native code** — `codegenConfig`
185
+ (`TeleportViewSpec`), C++ shadow nodes under `common/cpp/`, `android/build.gradle`,
186
+ `Teleport.podspec`. Bloom has never shipped native code, deliberately: adding
187
+ it would force a native rebuild on Mention, Allo, Alia, TNP, Homiio and Inbox
188
+ at the next bump.
189
+
190
+ ### What Bloom takes from them, and where to look for more
191
+
192
+ Bloom's web move primitive is now **theirs**: `moveBefore` with an
193
+ `insertBefore` fallback, derived from `src/views/Portal/index.tsx` in
194
+ react-native-teleport 1.2.0 (MIT, Copyright (c) 2025 Kiryl Ziusko — see
195
+ `NOTICE` at the repository root, and the header on
196
+ `src/media-flight/media-node.web.ts`). `appendChild` of an attached node is a
197
+ remove followed by an insert; `moveBefore` does not run the removal steps at
198
+ all. Measured, it makes no difference to a playing `<video>` — and Bloom is not
199
+ only video, so the correct primitive is worth having for focus, `<iframe>`s and
200
+ CSS animations, where the aborted-removal reprieve does not apply.
201
+
202
+ **This is a FORK, and forks go stale.** Their fixes will not arrive here on
203
+ their own, and their repository is active — there is a note in their blog from
204
+ August 2026 about faster re-parenting on Android that Bloom does not have.
205
+ Anyone maintaining this in a year: the upstream is
206
+ https://github.com/kirillzyusko/react-native-teleport, and it is worth reading
207
+ before rewriting anything here.
208
+
209
+ **And what Bloom did NOT do:** their native side re-parents for real. Bloom's
210
+ native path does not — it keeps the origin, the flying surface and the
211
+ destination as three views on one player (see the section on decoders below).
212
+ The re-parenting here is web-only.
155
213
 
156
214
  Under expo-router on web the origin route is **unmounted** the moment the URL
157
215
  changes. Anything the origin was rendering — a `VideoView`, a decoded image —
@@ -398,6 +456,96 @@ i.e. visibly not the thumbnail it is replacing. `width`/`height` are
398
456
  interpolated instead; the position still rides a transform, so the only layout
399
457
  work per frame is one absolutely-positioned node resizing.
400
458
 
459
+ ## Open: three decoders on native, and why the obvious cut is wrong
460
+
461
+ On web a flight re-parents one element, so there is exactly one video view for
462
+ the whole leg. **On native there is no re-parenting**, so during a flight the
463
+ origin host, the destination host and the layer's own flying surface are three
464
+ views on one player — and the flying one is a `TextureVideoView`, because a
465
+ `SurfaceView` composites outside the view hierarchy and would ignore the clip,
466
+ radius and transform that a flying box is made of.
467
+
468
+ Three concurrent decoders is not a detail on a phone. Many Android devices
469
+ guarantee only one or two concurrent hardware decoders; the third falls back to
470
+ software or fails, which on a low-end device is a black video — worse than
471
+ anything this transition is trying to hide.
472
+
473
+ **The obvious cut is to paint the poster on the flying surface for the ~300 ms
474
+ of the leg. Do not do that.** It is the same artefact this package spent a day
475
+ removing from the web path: a 267–282 ms frozen picture mid-flight was measured,
476
+ treated as the defect, and made the merge criterion. A still frame for 300 ms
477
+ cannot be a defect on web and an optimisation on native. And it is in fact
478
+ worse, because the poster is a *different image* — usually frame zero, not the
479
+ frame the viewer was looking at — so the sequence becomes playing at 4.28 s, a
480
+ jump to an unrelated still, then live again at 4.6 s. Two content jumps instead
481
+ of one freeze.
482
+
483
+ **If the decoder count does turn out to hurt, the cut goes the other way: the
484
+ ENDS paint posters and the flying surface keeps the video.** During a leg the
485
+ two hosts are covered by the surface that is flying; nobody is looking at them.
486
+ The one being watched should be the one that plays.
487
+
488
+ That costs something honest: it needs the layer to arbitrate who paints while a
489
+ leg is live — the rank machinery that exists on web and that native deliberately
490
+ does not have. It may not be worth it.
491
+
492
+ ### What is measured about it, and what is not
493
+
494
+ Measured on an Android emulator (2026-08-26), with the flight isolated from the
495
+ route change by clearing app data and deep-linking straight into the fullscreen
496
+ route:
497
+
498
+ ```
499
+ slot called Cannot set prop 'player'
500
+ cold, no flight x2 0 / 3 0 / 0
501
+ with a flight x2 4 / 4 2 / 2
502
+ ```
503
+
504
+ **The third view is real: one per flight, and it is not remounted.** With no
505
+ flight there is no `TextureVideoView` and no error; with one, the layer mounts
506
+ its own `MediaSurface` (no `renderVideo`, so `surfaceType` defaults to
507
+ `'textureView'`). The name in the error is the RUNTIME class of the instance —
508
+ `ConcreteViewProp.kt` throws `PropSetException(name, onView::class, …)` — so it
509
+ is not a mislabelling.
510
+
511
+ Traced on device, one flight:
512
+
513
+ ```
514
+ 01:09:41.923 MOUNT <id> ak19
515
+ 01:09:42.846 PropSetException: Cannot set prop 'player' on view 'TextureVideoView'
516
+ 01:09:42.868 UNMOUNT <id> ak19 same instance
517
+ ```
518
+
519
+ **The exception fires at the UNBIND, not at the mount** — ~920 ms after mounting
520
+ and 22 ms before the surface is destroyed. That is the `player={null}` commit
521
+ `releaseFlight` renders on the way out: the same instruction the web path
522
+ depends on (it makes an element go quiet without an event) is rejected by the
523
+ Kotlin view, which reports being "notified of disconnection from the player
524
+ view, even though it's still connected". Nothing is wrong with the mount, and
525
+ anyone reading this looking to fix mounting would be looking in the wrong place.
526
+
527
+ One mount, one unmount, one exception, 2 flights of 2. Matching a bench
528
+ measurement of the same path: the layer mounts its arm ONCE per flight, and the
529
+ `detached` commit is a re-render rather than a remount.
530
+
531
+ **No observed consequence.** Playback continues, and picture-in-picture opens
532
+ with the video playing rather than black or frozen. A failed assignment onto a
533
+ view that is destroyed 22 ms later has nobody left to affect. Note the limit of
534
+ that claim: it rules out the mechanism we suspected — a remount restarting the
535
+ decoder, hidden by an emulator that has no real ones — rather than proving no
536
+ consequence exists at all.
537
+
538
+ **What is NOT measured: whether any of this costs anything on real hardware.**
539
+ An emulator has no real hardware decoders, so the decoder-count question — the
540
+ reason this section exists — cannot be answered where everything else in this
541
+ package was measured. It needs a physical device.
542
+
543
+ Until then this section is the decision, not the code. The upstream report is
544
+ written and deliberately not filed: an issue about an error with no symptom is
545
+ easy to archive, and it may share a root with the web-side defect already filed
546
+ (`expo/expo#49359` — expo-video handling several views on one player). If a real
547
+ device shows a consequence, it goes up with this attached.
548
+
401
549
  ## Android: a flight crosses a surface-type boundary
402
550
 
403
551
  expo-video renders Android video into a `SurfaceView` by default. A flight
@@ -0,0 +1,72 @@
1
+ ---
2
+ title: Teleport
3
+ description: react-native-teleport, vendored — one view moved between hosts, not rebuilt at each end
4
+ ---
5
+
6
+ # Teleport
7
+
8
+ `@oxyhq/bloom/teleport` is **a copy of [react-native-teleport][upstream] 1.2.0**,
9
+ by Kiryl Ziusko, MIT-licensed. It is not a reimplementation and not an
10
+ adaptation: the files under `src/teleport/` are theirs, each one carrying a
11
+ header that names the file it came from and what changed — import paths, in
12
+ almost every case, and nothing else.
13
+
14
+ The full licence is in `NOTICE` at the repository root, and it ships in the
15
+ published tarball.
16
+
17
+ [upstream]: https://github.com/kirillzyusko/react-native-teleport
18
+
19
+ ## Why Bloom carries it rather than depending on it
20
+
21
+ Bloom needs its **native re-parenting**: moving one platform view between hosts
22
+ instead of mounting a second one somewhere else. That arrives as Fabric
23
+ components — C++ shadow nodes, Kotlin, Objective-C++ — not as JavaScript, and
24
+ Bloom's media flight is the consumer.
25
+
26
+ Vendoring is a decision with a cost, and the cost is that **this is a fork**.
27
+ Their fixes will not arrive here on their own; their repository is active. Read
28
+ theirs before rewriting anything here.
29
+
30
+ ## The one thing Bloom does differently, and it is not their code
31
+
32
+ **Bloom mounts these portals from its ROOT LAYER. Never from the origin screen.**
33
+
34
+ Their `<Portal>` renders `createPortal(children, …)` inside the component that
35
+ mounts it, so the children belong to that component's tree. Their Instagram
36
+ recipe mounts it inside the screen the media starts on and keeps that screen
37
+ alive with `presentation: 'transparentModal'`, which is correct for a navigator
38
+ that behaves that way — and it is the premise the design needs.
39
+
40
+ Under expo-router on **web** the origin route is unmounted the moment the URL
41
+ changes. Measured against their library, with the origin unmounting:
42
+
43
+ ```
44
+ origin UNMOUNTS count 1 -> 0 -> 0 the media is gone
45
+ origin STAYS stamps ["1","1","1"], ct 0.93 -> 1.73 one element, still playing
46
+ ```
47
+
48
+ The portal is not what fails there; the **ownership** is. Same piece, mounted
49
+ where it does not die — which is what `MediaFlightLayer` does.
50
+
51
+ `src/__tests__/Teleport.test.tsx` pins all three behaviours, including that last
52
+ one, so nobody re-discovers it in an app.
53
+
54
+ ## Status
55
+
56
+ - **Web: in, and used.** The move primitive in `media-flight/media-node.web.ts`
57
+ is theirs (`moveBefore` with an `insertBefore` fallback).
58
+ - **Native: not yet.** The Fabric components are not in this repo. Until they
59
+ are, Bloom's native flight keeps its three surfaces on one player.
60
+ - **Their own test suite is not here yet, and the reason is measured.** It is
61
+ written for `preset: react-native`, and Bloom's jest resolves no platform
62
+ extensions, so it reaches the web files instead. Moving their tests to a web
63
+ renderer does not work either: they depend on react-native-testing-library's
64
+ API, not only its renderer — `fireEvent.press` and `toBeOnTheScreen` appear
65
+ 37 times in one 221-line file, and neither exists in
66
+ `@testing-library/react`. Rewriting those is rewriting every interaction and
67
+ every assertion, which is not vendoring their tests, it is writing ours.
68
+
69
+ So they arrive with the native side, which is what they were written for. They
70
+ are held, not `.skip`ped: a skipped vendored test claims coverage that does not
71
+ exist. Meanwhile `src/__tests__/Teleport.test.tsx` covers their code on the
72
+ path Bloom uses today. See `AGENTS.md`, "Jest resolves no platform extensions".
@@ -18,11 +18,10 @@ var _jsxRuntime = require("react/jsx-runtime");
18
18
  * ## The problem it exists for
19
19
  *
20
20
  * A shared-element transition normally assumes the ORIGIN screen is still
21
- * mounted while the element travels which is why `react-native-teleport` needs
22
- * `presentation: 'transparentModal'` and has no web story at all. Under
23
- * expo-router on web the origin route is UNMOUNTED the moment the URL changes,
24
- * so anything the origin was rendering (a `VideoView`, a decoded image) is gone
25
- * before the first frame of the transition.
21
+ * mounted while the element travels. Under expo-router on web the origin route
22
+ * is UNMOUNTED the moment the URL changes, so anything the origin was rendering
23
+ * (a `VideoView`, a decoded image) is gone before the first frame of the
24
+ * transition.
26
25
  *
27
26
  * The fix is to move the surface OUT of both screens for the duration of the
28
27
  * flight. `<MediaFlightLayer>` is mounted ONCE at the app root and renders
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_index","_portal","_MediaSurface","_store","_jsxRuntime","MediaFlightLayer","flights","useSyncExternalStore","subscribeToFlights","getFlights","length","jsx","Portal","children","OverlayRoot","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","unbinding","useEffect","notifySurfaceMounted","originX","x","originY","y","boxStyle","useAnimatedStyle","transform","translateX","interpolate","value","translateY","width","height","MediaSurface","detached","pointerEvents","style","styles","box","left","top","borderRadius","StyleSheet","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;;;;;AAqCA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA+E,IAAAO,WAAA,GAAAP,OAAA;AA5C/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAWA;AACA;AACA;AACA;AACA;AACA;AACO,SAASQ,gBAAgBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAG,IAAAC,2BAAoB,EAACC,yBAAkB,EAAEC,iBAAU,EAAEA,iBAAU,CAAC;EAEhF,IAAIH,OAAO,CAACI,MAAM,KAAK,CAAC,EAAE,OAAO,IAAI;EAErC,oBACE,IAAAN,WAAA,CAAAO,GAAA,EAACV,OAAA,CAAAW,MAAM;IAAAC,QAAA,eAKL,IAAAT,WAAA,CAAAO,GAAA,EAACX,MAAA,CAAAc,WAAW;MAAAD,QAAA,EACTP,OAAO,CAACS,GAAG,CAAEC,MAAM,iBAClB,IAAAZ,WAAA,CAAAO,GAAA,EAACM,kBAAkB;QAAiBD,MAAM,EAAEA;MAAO,GAA1BA,MAAM,CAACE,EAAqB,CACtD;IAAC,CACS;EAAC,CACR,CAAC;AAEb;AAEAb,gBAAgB,CAACc,WAAW,GAAG,kBAAkB;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASF,kBAAkBA,CAAC;EAAED;AAAgC,CAAC,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QAAQ,EAAEQ,OAAO,EAAEE,OAAO,EAAEZ,IAAI,CAACqB,KAAK,EAAErB,IAAI,CAACsB,MAAM,EAAErB,EAAE,CAACoB,KAAK,EAAEpB,EAAE,CAACqB,MAAM,CAC3E,CAAC;EAED,oBACE,IAAAtC,WAAA,CAAAO,GAAA,EAACT,aAAA,CAAAyC,YAAY;IACXpB,OAAO,EAAEA,OAAQ;IACjBE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA;IACb;IACA;IACA;IACA;IACA;IAAA;IACAkB,QAAQ,EAAEjB;IACV;IACA;IAAA;IACAkB,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CAACC,MAAM,CAACC,GAAG,EAAE;MAAEC,IAAI,EAAE5B,EAAE,CAACU,CAAC;MAAEmB,GAAG,EAAE7B,EAAE,CAACY,CAAC;MAAEkB,YAAY,EAAE3B;IAAa,CAAC,EAAEU,QAAQ;EAAE,CACtF,CAAC;AAEN;AAEA,MAAMa,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,GAAG,EAAE;IACHM,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","require","_reactNative","_reactNativeReanimated","_index","_portal","_MediaSurface","_store","_jsxRuntime","MediaFlightLayer","flights","useSyncExternalStore","subscribeToFlights","getFlights","length","jsx","Portal","children","OverlayRoot","map","flight","MediaFlightSurface","id","displayName","from","to","progress","content","cornerRadius","contentFit","surfaceType","unbinding","useEffect","notifySurfaceMounted","originX","x","originY","y","boxStyle","useAnimatedStyle","transform","translateX","interpolate","value","translateY","width","height","MediaSurface","detached","pointerEvents","style","styles","box","left","top","borderRadius","StyleSheet","create","position","overflow"],"sourceRoot":"../../../src","sources":["media-flight/MediaFlightLayer.tsx"],"mappings":";;;;;;AAoCA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAA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tC,WAAA,CAAAO,GAAA,EAACT,aAAA,CAAAyC,YAAY;IACXpB,OAAO,EAAEA,OAAQ;IACjBE,UAAU,EAAEA,UAAW;IACvBC,WAAW,EAAEA;IACb;IACA;IACA;IACA;IACA;IAAA;IACAkB,QAAQ,EAAEjB;IACV;IACA;IAAA;IACAkB,aAAa,EAAC,MAAM;IACpBC,KAAK,EAAE,CAACC,MAAM,CAACC,GAAG,EAAE;MAAEC,IAAI,EAAE5B,EAAE,CAACU,CAAC;MAAEmB,GAAG,EAAE7B,EAAE,CAACY,CAAC;MAAEkB,YAAY,EAAE3B;IAAa,CAAC,EAAEU,QAAQ;EAAE,CACtF,CAAC;AAEN;AAEA,MAAMa,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BL,GAAG,EAAE;IACHM,QAAQ,EAAE,UAAU;IACpBC,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -172,6 +172,42 @@ function pick(claims) {
172
172
  return best;
173
173
  }
174
174
 
175
+ /**
176
+ * An element that can be MOVED rather than removed and re-inserted.
177
+ *
178
+ * `moveBefore` is newer than TypeScript's DOM library, so the capability is
179
+ * named here and checked at runtime rather than assumed.
180
+ */
181
+
182
+ /**
183
+ * DERIVED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.tsx`,
184
+ * its `moveElementTo`. MIT, Copyright (c) 2025 Kiryl Ziusko; see `NOTICE`.
185
+ *
186
+ * Changed: typed for TypeScript's DOM library, which does not know `moveBefore`
187
+ * yet, and reduced to the append case Bloom needs (no `before` sibling).
188
+ *
189
+ * Why it is worth taking rather than keeping `appendChild`: `appendChild` of an
190
+ * ATTACHED node is a remove followed by an insert, and the only reason media
191
+ * survives it is that HTML's removal steps await a stable state and abort if
192
+ * the node is back in a document by then. `moveBefore` does not run the removal
193
+ * steps at all — it is the state-preserving primitive, which matters for
194
+ * anything the abort does not cover: focus, `<iframe>`s, CSS animations.
195
+ *
196
+ * Measured for a playing `<video>` in Chrome 151: indistinguishable from
197
+ * `appendChild` (ct 0.60 -> 1.00, never paused, 6 frames, worst frame gap
198
+ * 100 ms — the clip's own cadence — under both), while a real removal pauses
199
+ * and freezes. So this is not a fix for a defect Bloom has; it is the correct
200
+ * primitive for the ones it does not have yet.
201
+ */
202
+ function moveInto(parent, child) {
203
+ if (supportsMoveBefore && child.parentNode !== null) {
204
+ parent.moveBefore(child, null);
205
+ return;
206
+ }
207
+ parent.appendChild(child);
208
+ }
209
+ const supportsMoveBefore = typeof Element !== 'undefined' && 'moveBefore' in Element.prototype;
210
+
175
211
  /**
176
212
  * Put the wrapper where its top claim says, in ONE synchronous move.
177
213
  *
@@ -184,7 +220,7 @@ function place(record) {
184
220
  const target = topClaim(record)?.el ?? holder(reg);
185
221
  if (target === null) return;
186
222
  if (record.wrapper.parentElement === target) return;
187
- target.appendChild(record.wrapper);
223
+ moveInto(target, record.wrapper);
188
224
  }
189
225
  function sameRender(a, b) {
190
226
  if (a.contentFit !== b.contentFit) return false;
@@ -1 +1 @@
1
- {"version":3,"names":["_store","require","HOST_RANK","exports","FLIGHT_RANK","registry","globalThis","__oxyhq_bloom_media_nodes__","nodes","Map","listeners","Set","snapshot","holder","seq","HOLDER_ID","reg","document","isConnected","existing","getElementById","created","createElement","id","style","cssText","setAttribute","body","appendChild","makeWrapper","wrapper","recordFor","render","record","get","claims","EMPTY_RENDER","set","content","uri","contentFit","renderVideo","undefined","nativeControls","accessibilityLabel","flightId","topClaim","pick","topRender","filter","claim","best","rank","place","target","el","parentElement","sameRender","a","b","x","y","kind","player","poster","publish","next","push","previous","unchanged","length","every","view","i","candidate","listener","claimMediaNode","find","releaseMediaNode","before","hasFlight","delete","remove","hasMediaNode","subscribeToMediaNodes","add","getMediaNodes","resetMediaNodes","values","clear"],"sourceRoot":"../../../src","sources":["media-flight/media-node.web.ts"],"mappings":";;;;;;;;;;;;AA6DA,IAAAA,MAAA,GAAAC,OAAA;AA7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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CAACpB,MAAM,CAAC;EACbgC,OAAO,CAACjD,GAAG,CAAC;AACd;;AAEA;AACO,SAASmE,YAAYA,CAAC5D,EAAU,EAAW;EAChD,MAAMU,MAAM,GAAG5B,QAAQ,CAAC,CAAC,CAACG,KAAK,CAAC0B,GAAG,CAACX,EAAE,CAAC;EACvC,OAAOU,MAAM,KAAKS,SAAS,IAAIT,MAAM,CAACE,MAAM,CAACmC,MAAM,GAAG,CAAC;AACzD;;AAEA;AACO,SAASc,qBAAqBA,CAACT,QAAoB,EAAc;EACtE,MAAM3D,GAAG,GAAGX,QAAQ,CAAC,CAAC;EACtBW,GAAG,CAACN,SAAS,CAAC2E,GAAG,CAACV,QAAQ,CAAC;EAC3B,OAAO,MAAM;IACX3D,GAAG,CAACN,SAAS,CAACuE,MAAM,CAACN,QAAQ,CAAC;EAChC,CAAC;AACH;;AAEA;AACO,SAASW,aAAaA,CAAA,EAA6B;EACxD,OAAOjF,QAAQ,CAAC,CAAC,CAACO,QAAQ;AAC5B;;AAEA;AACO,SAAS2E,eAAeA,CAAA,EAAS;EACtC,MAAMvE,GAAG,GAAGX,QAAQ,CAAC,CAAC;EACtB,KAAK,MAAM4B,MAAM,IAAIjB,GAAG,CAACR,KAAK,CAACgF,MAAM,CAAC,CAAC,EAAEvD,MAAM,CAACH,OAAO,CAACoD,MAAM,CAAC,CAAC;EAChElE,GAAG,CAACR,KAAK,CAACiF,KAAK,CAAC,CAAC;EACjBzE,GAAG,CAACJ,QAAQ,GAAG,EAAE;EACjB,IAAII,GAAG,CAACH,MAAM,KAAK,IAAI,EAAE;IACvBG,GAAG,CAACH,MAAM,CAACqE,MAAM,CAAC,CAAC;IACnBlE,GAAG,CAACH,MAAM,GAAG,IAAI;EACnB;EACA,KAAK,MAAM8D,QAAQ,IAAI3D,GAAG,CAACN,SAAS,EAAEiE,QAAQ,CAAC,CAAC;AAClD","ignoreList":[]}
1
+ {"version":3,"names":["_store","require","HOST_RANK","exports","FLIGHT_RANK","registry","globalThis","__oxyhq_bloom_media_nodes__","nodes","Map","listeners","Set","snapshot","holder","seq","HOLDER_ID","reg","document","isConnected","existing","getElementById","created","createElement","id","style","cssText","setAttribute","body","appendChild","makeWrapper","wrapper","recordFor","render","record","get","claims","EMPTY_RENDER","set","content","uri","contentFit","renderVideo","undefined","nativeControls","accessibilityLabel","flightId","topClaim","pick","topRender","filter","claim","best","rank","moveInto","parent","child","supportsMoveBefore","parentNode","moveBefore","Element","prototype","place","target","el","parentElement","sameRender","a","b","x","y","kind","player","poster","publish","next","push","previous","unchanged","length","every","view","i","candidate","listener","claimMediaNode","find","releaseMediaNode","before","hasFlight","delete","remove","hasMediaNode","subscribeToMediaNodes","add","getMediaNodes","resetMediaNodes","values","clear"],"sourceRoot":"../../../src","sources":["media-flight/media-node.web.ts"],"mappings":";;;;;;;;;;;;AA6DA,IAAAA,MAAA,GAAAC,OAAA;AA7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA;;AAYA;AACO,MAAMC,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,CAAC;AACnB,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAG,CAAC;;AAqC5B;;AAqBA,SAASC,QAAQA,CAAA,EAAiB;EAChCC,UAAU,CAACC,2BAA2B,KAAK;IACzCC,KAAK,EAAE,IAAIC,GAAG,CAAC,CAAC;IAChBC,SAAS,EAAE,IAAIC,GAAG,CAAC,CAAC;IACpBC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE,IAAI;IACZC,GAAG,EAAE;EACP,CAAC;EACD,OAAOR,UAA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AK,CAAC0B,GAAG,CAACX,EAAE,CAAC;EACvC,OAAOU,MAAM,KAAKS,SAAS,IAAIT,MAAM,CAACE,MAAM,CAAC2C,MAAM,GAAG,CAAC;AACzD;;AAEA;AACO,SAASc,qBAAqBA,CAACT,QAAoB,EAAc;EACtE,MAAMnE,GAAG,GAAGX,QAAQ,CAAC,CAAC;EACtBW,GAAG,CAACN,SAAS,CAACmF,GAAG,CAACV,QAAQ,CAAC;EAC3B,OAAO,MAAM;IACXnE,GAAG,CAACN,SAAS,CAAC+E,MAAM,CAACN,QAAQ,CAAC;EAChC,CAAC;AACH;;AAEA;AACO,SAASW,aAAaA,CAAA,EAA6B;EACxD,OAAOzF,QAAQ,CAAC,CAAC,CAACO,QAAQ;AAC5B;;AAEA;AACO,SAASmF,eAAeA,CAAA,EAAS;EACtC,MAAM/E,GAAG,GAAGX,QAAQ,CAAC,CAAC;EACtB,KAAK,MAAM4B,MAAM,IAAIjB,GAAG,CAACR,KAAK,CAACwF,MAAM,CAAC,CAAC,EAAE/D,MAAM,CAACH,OAAO,CAAC4D,MAAM,CAAC,CAAC;EAChE1E,GAAG,CAACR,KAAK,CAACyF,KAAK,CAAC,CAAC;EACjBjF,GAAG,CAACJ,QAAQ,GAAG,EAAE;EACjB,IAAII,GAAG,CAACH,MAAM,KAAK,IAAI,EAAE;IACvBG,GAAG,CAACH,MAAM,CAAC6E,MAAM,CAAC,CAAC;IACnB1E,GAAG,CAACH,MAAM,GAAG,IAAI;EACnB;EACA,KAAK,MAAMsE,QAAQ,IAAInE,GAAG,CAACN,SAAS,EAAEyE,QAAQ,CAAC,CAAC;AAClD","ignoreList":[]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _portalManager = require("./portal-manager.js");
9
+ var _context = _interopRequireDefault(require("./scroll-view-context/context"));
10
+ var _PortalView = _interopRequireDefault(require("./PortalView"));
11
+ var _useId = _interopRequireDefault(require("./use-id.js"));
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
+ /**
15
+ * COPIED FROM react-native-teleport 1.2.0 — `src/components/Portal.tsx`
16
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
17
+ *
18
+ * Changed: import paths only, for this flat directory.
19
+ */
20
+
21
+ /**
22
+ * Portal helps you to render a component in a different place in the view hierarchy.
23
+ * This is useful when you need a view to visually “break out” of its parent container (for example: modals, toasts, floating UI, popovers).
24
+ *
25
+ * @category components
26
+ * @param hostName - The `name` of the `PortalHost`. It's used to identify the host where the content should be rendered.
27
+ * @param name - The name of the portal. It's used to identify the portal.
28
+ * @param children - The content that should be rendered in the portal.
29
+ * @example
30
+ * ```tsx
31
+ * import { useState } from "react";
32
+ * import { View, StyleSheet, Button } from "react-native";
33
+ * import { Portal } from "react-native-teleport";
34
+ * export default function InstantRootExample() {
35
+ * const [shouldBeTeleported, setTeleported] = useState(true);
36
+ * return (
37
+ * <View style={styles.container}>
38
+ * {shouldBeTeleported && (
39
+ * <Portal hostName={"overlay"}>
40
+ * <View style={styles.box} />
41
+ * </Portal>
42
+ * )}
43
+ * <Button
44
+ * title={shouldBeTeleported ? "Hide" : "Show"}
45
+ * onPress={() => setTeleported((t) => !t)}
46
+ * />
47
+ * </View>
48
+ * );
49
+ * }
50
+ * const styles = StyleSheet.create({
51
+ * container: {
52
+ * flex: 1,
53
+ * alignItems: "center",
54
+ * justifyContent: "center",
55
+ * },
56
+ * box: {
57
+ * width: 160,
58
+ * height: 160,
59
+ * marginVertical: 20,
60
+ * backgroundColor: "blue",
61
+ * },
62
+ * });
63
+ * ```
64
+ */
65
+ const PortalComponent = ({
66
+ hostName,
67
+ name,
68
+ style,
69
+ children
70
+ }) => {
71
+ const sourceScrollViewContext = (0, _react.useContext)(_context.default);
72
+ const {
73
+ state,
74
+ dispatch
75
+ } = (0, _portalManager.usePortalManagerContext)();
76
+ const instanceId = (0, _useId.default)();
77
+ const scrollViewContext = hostName && state.hosts[hostName] ? state.hostScrollViewContexts[hostName] ?? null : sourceScrollViewContext;
78
+ const isRemoved = hostName && name ? state.removed[hostName]?.[name]?.[instanceId] : false;
79
+ (0, _react.useEffect)(() => {
80
+ if (!hostName || !name) {
81
+ return;
82
+ }
83
+ dispatch({
84
+ type: "REGISTER_PORTAL",
85
+ hostName,
86
+ name,
87
+ instanceId
88
+ });
89
+ return () => {
90
+ dispatch({
91
+ type: "CLEAR_REMOVED_ON_UNMOUNT",
92
+ hostName,
93
+ name,
94
+ instanceId
95
+ });
96
+ };
97
+ }, [dispatch, hostName, name, instanceId]);
98
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.default.Provider, {
99
+ value: scrollViewContext,
100
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PortalView.default, {
101
+ hostName: hostName,
102
+ name: name,
103
+ style: style,
104
+ children: isRemoved ? null : children
105
+ })
106
+ });
107
+ };
108
+ var _default = exports.default = PortalComponent;
109
+ //# sourceMappingURL=Portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_portalManager","_context","_interopRequireDefault","_PortalView","_useId","_jsxRuntime","e","__esModule","default","PortalComponent","hostName","name","style","children","sourceScrollViewContext","useContext","ScrollViewContext","state","dispatch","usePortalManagerContext","instanceId","useId","scrollViewContext","hosts","hostScrollViewContexts","isRemoved","removed","useEffect","type","jsx","Provider","value","_default","exports"],"sourceRoot":"../../../src","sources":["teleport/Portal.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAF,sBAAA,CAAAH,OAAA;AAA6B,IAAAM,WAAA,GAAAN,OAAA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I;QACJS;MACF,CAAC,CAAC;IACJ,CAAC;EACH,CAAC,EAAE,CAACF,QAAQ,EAAER,QAAQ,EAAEC,IAAI,EAAES,UAAU,CAAC,CAAC;EAE1C,oBACE,IAAAf,WAAA,CAAAwB,GAAA,EAAC5B,QAAA,CAAAO,OAAiB,CAACsB,QAAQ;IAACC,KAAK,EAAET,iBAAkB;IAAAT,QAAA,eACnD,IAAAR,WAAA,CAAAwB,GAAA,EAAC1B,WAAA,CAAAK,OAAU;MAACE,QAAQ,EAAEA,QAAS;MAACC,IAAI,EAAEA,IAAK;MAACC,KAAK,EAAEA,KAAM;MAAAC,QAAA,EACtDY,SAAS,GAAG,IAAI,GAAGZ;IAAQ,CAClB;EAAC,CACa,CAAC;AAEjC,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAAzB,OAAA,GAEaC,eAAe","ignoreList":[]}
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _portalManager = require("./portal-manager.js");
9
+ var _context = _interopRequireDefault(require("./scroll-view-context/context"));
10
+ var _PortalHostView = _interopRequireDefault(require("./PortalHostView"));
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
+ /**
14
+ * COPIED FROM react-native-teleport 1.2.0 — `src/components/PortalHost.tsx`
15
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
16
+ *
17
+ * Changed: import paths only, for this flat directory.
18
+ */
19
+
20
+ /**
21
+ * PortalHost is a component that acts as an anchor for the portals.
22
+ * You can define multiple portal hosts in your app and use them to render different portals.
23
+ * Each portal host has a unique name that you can use to identify a necessary one among the others.
24
+ *
25
+ * @category components
26
+ * @param name - The name of the portal host. It's used by `<Portal />` component to identify the host.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * import { StyleSheet, View } from "react-native";
31
+ * import { PortalHost, PortalProvider } from "react-native-teleport";
32
+ * export default function App() {
33
+ * return (
34
+ * <PortalProvider>
35
+ * <PortalHost style={StyleSheet.absoluteFillObject} name="overlay" />
36
+ * </PortalProvider>
37
+ * );
38
+ * }
39
+ * ```
40
+ */const PortalHostComponent = ({
41
+ name,
42
+ children,
43
+ style
44
+ }) => {
45
+ const {
46
+ dispatch
47
+ } = (0, _portalManager.usePortalManagerContext)();
48
+ const scrollViewContext = (0, _react.useContext)(_context.default);
49
+ (0, _react.useEffect)(() => {
50
+ dispatch({
51
+ type: "REGISTER_HOST",
52
+ hostName: name
53
+ });
54
+ return () => {
55
+ dispatch({
56
+ type: "UNREGISTER_HOST",
57
+ hostName: name
58
+ });
59
+ };
60
+ }, [name, dispatch]);
61
+ (0, _react.useEffect)(() => {
62
+ dispatch({
63
+ type: "SET_HOST_SCROLL_VIEW_CONTEXT",
64
+ hostName: name,
65
+ value: scrollViewContext
66
+ });
67
+ }, [name, dispatch, scrollViewContext]);
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PortalHostView.default, {
69
+ name: name,
70
+ style: style,
71
+ children: children
72
+ });
73
+ };
74
+ var _default = exports.default = PortalHostComponent;
75
+ //# sourceMappingURL=PortalHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","require","_portalManager","_context","_interopRequireDefault","_PortalHostView","_jsxRuntime","e","__esModule","default","PortalHostComponent","name","children","style","dispatch","usePortalManagerContext","scrollViewContext","useContext","ScrollViewContext","useEffect","type","hostName","value","jsx","_default","exports"],"sourceRoot":"../../../src","sources":["teleport/PortalHost.tsx"],"mappings":";;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA0C,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAG,u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