@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
@@ -0,0 +1,40 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/state/reducer.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ import type { ScrollViewContextValue } from "./scroll-view-context/types";
8
+ export type PortalState = {
9
+ removed: Record<string, Record<string, Record<string, boolean>>>;
10
+ hosts: Record<string, number>;
11
+ hostScrollViewContexts: Record<string, ScrollViewContextValue | undefined>;
12
+ };
13
+ export type Action = {
14
+ type: "REMOVE_PORTAL";
15
+ hostName: string;
16
+ name: string;
17
+ } | {
18
+ type: "CLEAR_REMOVED_ON_UNMOUNT";
19
+ hostName: string;
20
+ name: string;
21
+ instanceId: string;
22
+ } | {
23
+ type: "REGISTER_PORTAL";
24
+ hostName: string;
25
+ name: string;
26
+ instanceId: string;
27
+ } | {
28
+ type: "REGISTER_HOST";
29
+ hostName: string;
30
+ } | {
31
+ type: "UNREGISTER_HOST";
32
+ hostName: string;
33
+ } | {
34
+ type: "SET_HOST_SCROLL_VIEW_CONTEXT";
35
+ hostName: string;
36
+ value: ScrollViewContextValue;
37
+ };
38
+ export declare const initialState: PortalState;
39
+ export declare const reducer: (state: PortalState, action: Action) => PortalState;
40
+ //# sourceMappingURL=reducer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/teleport/reducer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACjE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,sBAAsB,GAAG,SAAS,CAAC,CAAC;CAC5E,CAAC;AAEF,MAAM,MAAM,MAAM,GACd;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzD;IACE,IAAI,EAAE,0BAA0B,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC7C;IACE,IAAI,EAAE,8BAA8B,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,sBAAsB,CAAC;CAC/B,CAAC;AAEN,eAAO,MAAM,YAAY,EAAE,WAI1B,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,OAAO,WAAW,EAAE,QAAQ,MAAM,KAAG,WAmD5D,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ScrollViewContextValue } from "./types";
2
+ declare const ScrollViewContext: import("react").Context<ScrollViewContextValue>;
3
+ export default ScrollViewContext;
4
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../../src/teleport/scroll-view-context/context.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEtD,QAAA,MAAM,iBAAiB,iDAA8C,CAAC;AAEtE,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/ScrollViewContext/index.native.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths, and `ScrollView.Context` is reached through a cast
6
+ * because Bloom does not compile with their `react-native-strict-api` condition,
7
+ * which is the only place that property is declared.
8
+ */
9
+ import type { Context } from "react";
10
+ import type { ScrollViewContextValue } from "./types";
11
+ declare const ScrollViewContext: Context<ScrollViewContextValue>;
12
+ export default ScrollViewContext;
13
+ //# sourceMappingURL=context.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.native.d.ts","sourceRoot":"","sources":["../../../../../src/teleport/scroll-view-context/context.native.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAKtD,QAAA,MAAM,iBAAiB,iCACb,CAAC;AAEX,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/ScrollViewContext/types.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ export type ScrollViewContextValue = {
8
+ horizontal: boolean;
9
+ } | null;
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/teleport/scroll-view-context/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,UAAU,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/specs/PortalHostViewNativeComponent.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ import { type ViewProps } from "react-native";
8
+ interface NativeProps extends ViewProps {
9
+ name?: string;
10
+ }
11
+ declare const _default: import("react-native").HostComponent<NativeProps>;
12
+ export default _default;
13
+ //# sourceMappingURL=PortalHostViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalHostViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../src/teleport/specs/PortalHostViewNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;;AAED,wBAEG"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/specs/PortalViewNativeComponent.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ import { type ViewProps } from "react-native";
8
+ interface NativeProps extends ViewProps {
9
+ name?: string;
10
+ hostName?: string;
11
+ }
12
+ declare const _default: import("react-native").HostComponent<NativeProps>;
13
+ export default _default;
14
+ //# sourceMappingURL=PortalViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../../src/teleport/specs/PortalViewNativeComponent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtE,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;AAED,wBAEG"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/types/index.ts`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ import type { StyleProp, ViewStyle } from "react-native";
8
+ export type PortalProviderProps = {
9
+ children: React.ReactNode;
10
+ };
11
+ export type PortalHostProps = {
12
+ name: string;
13
+ style?: StyleProp<ViewStyle>;
14
+ children?: React.ReactNode;
15
+ };
16
+ export type PortalProps = {
17
+ name?: string;
18
+ hostName?: string;
19
+ style?: StyleProp<ViewStyle>;
20
+ children?: React.ReactNode;
21
+ };
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/teleport/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AACF,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export default function useId(prefix?: string): string;
2
+ //# sourceMappingURL=use-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-id.d.ts","sourceRoot":"","sources":["../../../../src/teleport/use-id.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,MAAM,SAAQ,GAAG,MAAM,CAOpD"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * The `usePortal` hook allows you to manage portals in imperative way.
3
+ *
4
+ * @category hooks
5
+ * @param `hostName` - `name` of the `<PortalHost />` component
6
+ * @returns an object that helps to manipulate portals
7
+ * @example
8
+ * ```tsx
9
+ * import { usePortal } from "react-native-teleport";
10
+ * export default function App() {
11
+ * const { removePortal, isHostAvailable } = usePortal("root");
12
+ * return (
13
+ * <View style={{ flex: 1 }}>
14
+ * <Text>{isHostAvailable ? "Host is available" : "Host is not available"}</Text>
15
+ * <Button title="Remove" onPress={() => removePortal("portal")} />
16
+ * </View>
17
+ * );
18
+ * }
19
+ * ```
20
+ */
21
+ export default function usePortal(hostName?: string): {
22
+ /**
23
+ * Whether a `<PortalHost />` with the given `hostName` is currently mounted.
24
+ */
25
+ isHostAvailable: boolean;
26
+ /**
27
+ * Remove portal from host container. Subsequent re-renders will not restore portal,
28
+ * but if you mount a new portal with the same name it will be shown (i. e. hook doesn't
29
+ * prevent new portal from being added).
30
+ *
31
+ * @param name - `name` of `<Portal />` component.
32
+ */
33
+ removePortal: (name: string) => void;
34
+ };
35
+ //# sourceMappingURL=use-portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-portal.d.ts","sourceRoot":"","sources":["../../../../src/teleport/use-portal.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,QAAQ,GAAE,MAAe;IAIvD;;OAEG;;IAEH;;;;;;OAMG;yBACkB,MAAM;EAG9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyhq/bloom",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
6
6
  "main": "lib/commonjs/index.js",
@@ -624,6 +624,20 @@
624
624
  "default": "./lib/commonjs/media-flight/index.js"
625
625
  }
626
626
  },
627
+ "./teleport": {
628
+ "react-native": {
629
+ "types": "./lib/typescript/module/teleport/index.d.ts",
630
+ "default": "./src/teleport/index.ts"
631
+ },
632
+ "import": {
633
+ "types": "./lib/typescript/module/teleport/index.d.ts",
634
+ "default": "./lib/module/teleport/index.js"
635
+ },
636
+ "require": {
637
+ "types": "./lib/typescript/commonjs/teleport/index.d.ts",
638
+ "default": "./lib/commonjs/teleport/index.js"
639
+ }
640
+ },
627
641
  "./pressable-scale": {
628
642
  "react-native": {
629
643
  "types": "./lib/typescript/module/pressable-scale/index.d.ts",
@@ -1457,6 +1471,7 @@
1457
1471
  "./package.json": "./package.json"
1458
1472
  },
1459
1473
  "files": [
1474
+ "NOTICE",
1460
1475
  "src",
1461
1476
  "lib",
1462
1477
  "docs/*.mdx",
@@ -4,11 +4,10 @@
4
4
  * ## The problem it exists for
5
5
  *
6
6
  * A shared-element transition normally assumes the ORIGIN screen is still
7
- * mounted while the element travels which is why `react-native-teleport` needs
8
- * `presentation: 'transparentModal'` and has no web story at all. Under
9
- * expo-router on web the origin route is UNMOUNTED the moment the URL changes,
10
- * so anything the origin was rendering (a `VideoView`, a decoded image) is gone
11
- * before the first frame of the transition.
7
+ * mounted while the element travels. Under expo-router on web the origin route
8
+ * is UNMOUNTED the moment the URL changes, so anything the origin was rendering
9
+ * (a `VideoView`, a decoded image) is gone before the first frame of the
10
+ * transition.
12
11
  *
13
12
  * The fix is to move the surface OUT of both screens for the duration of the
14
13
  * flight. `<MediaFlightLayer>` is mounted ONCE at the app root and renders
@@ -225,6 +225,47 @@ function pick(claims: readonly MediaNodeClaim[]): MediaNodeClaim | null {
225
225
  return best;
226
226
  }
227
227
 
228
+ /**
229
+ * An element that can be MOVED rather than removed and re-inserted.
230
+ *
231
+ * `moveBefore` is newer than TypeScript's DOM library, so the capability is
232
+ * named here and checked at runtime rather than assumed.
233
+ */
234
+ interface MovingParent {
235
+ moveBefore(node: Node, child: Node | null): void;
236
+ }
237
+
238
+ /**
239
+ * DERIVED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.tsx`,
240
+ * its `moveElementTo`. MIT, Copyright (c) 2025 Kiryl Ziusko; see `NOTICE`.
241
+ *
242
+ * Changed: typed for TypeScript's DOM library, which does not know `moveBefore`
243
+ * yet, and reduced to the append case Bloom needs (no `before` sibling).
244
+ *
245
+ * Why it is worth taking rather than keeping `appendChild`: `appendChild` of an
246
+ * ATTACHED node is a remove followed by an insert, and the only reason media
247
+ * survives it is that HTML's removal steps await a stable state and abort if
248
+ * the node is back in a document by then. `moveBefore` does not run the removal
249
+ * steps at all — it is the state-preserving primitive, which matters for
250
+ * anything the abort does not cover: focus, `<iframe>`s, CSS animations.
251
+ *
252
+ * Measured for a playing `<video>` in Chrome 151: indistinguishable from
253
+ * `appendChild` (ct 0.60 -> 1.00, never paused, 6 frames, worst frame gap
254
+ * 100 ms — the clip's own cadence — under both), while a real removal pauses
255
+ * and freezes. So this is not a fix for a defect Bloom has; it is the correct
256
+ * primitive for the ones it does not have yet.
257
+ */
258
+ function moveInto(parent: HTMLElement, child: HTMLElement): void {
259
+ if (supportsMoveBefore && child.parentNode !== null) {
260
+ (parent as unknown as MovingParent).moveBefore(child, null);
261
+ return;
262
+ }
263
+ parent.appendChild(child);
264
+ }
265
+
266
+ const supportsMoveBefore =
267
+ typeof Element !== 'undefined' && 'moveBefore' in Element.prototype;
268
+
228
269
  /**
229
270
  * Put the wrapper where its top claim says, in ONE synchronous move.
230
271
  *
@@ -237,7 +278,7 @@ function place(record: MediaNodeRecord): void {
237
278
  const target = topClaim(record)?.el ?? holder(reg);
238
279
  if (target === null) return;
239
280
  if (record.wrapper.parentElement === target) return;
240
- target.appendChild(record.wrapper);
281
+ moveInto(target, record.wrapper);
241
282
  }
242
283
 
243
284
  function sameRender(a: MediaNodeRender, b: MediaNodeRender): boolean {
@@ -0,0 +1,97 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/components/Portal.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import { useContext, useEffect } from "react";
8
+ import { usePortalManagerContext } from "./portal-manager";
9
+ import ScrollViewContext from "./scroll-view-context/context";
10
+ import PortalView from "./PortalView";
11
+ import useId from "./use-id";
12
+ import type { PortalProps } from "./types";
13
+
14
+ /**
15
+ * Portal helps you to render a component in a different place in the view hierarchy.
16
+ * This is useful when you need a view to visually “break out” of its parent container (for example: modals, toasts, floating UI, popovers).
17
+ *
18
+ * @category components
19
+ * @param hostName - The `name` of the `PortalHost`. It's used to identify the host where the content should be rendered.
20
+ * @param name - The name of the portal. It's used to identify the portal.
21
+ * @param children - The content that should be rendered in the portal.
22
+ * @example
23
+ * ```tsx
24
+ * import { useState } from "react";
25
+ * import { View, StyleSheet, Button } from "react-native";
26
+ * import { Portal } from "react-native-teleport";
27
+ * export default function InstantRootExample() {
28
+ * const [shouldBeTeleported, setTeleported] = useState(true);
29
+ * return (
30
+ * <View style={styles.container}>
31
+ * {shouldBeTeleported && (
32
+ * <Portal hostName={"overlay"}>
33
+ * <View style={styles.box} />
34
+ * </Portal>
35
+ * )}
36
+ * <Button
37
+ * title={shouldBeTeleported ? "Hide" : "Show"}
38
+ * onPress={() => setTeleported((t) => !t)}
39
+ * />
40
+ * </View>
41
+ * );
42
+ * }
43
+ * const styles = StyleSheet.create({
44
+ * container: {
45
+ * flex: 1,
46
+ * alignItems: "center",
47
+ * justifyContent: "center",
48
+ * },
49
+ * box: {
50
+ * width: 160,
51
+ * height: 160,
52
+ * marginVertical: 20,
53
+ * backgroundColor: "blue",
54
+ * },
55
+ * });
56
+ * ```
57
+ */
58
+ const PortalComponent = ({ hostName, name, style, children }: PortalProps) => {
59
+ const sourceScrollViewContext = useContext(ScrollViewContext);
60
+ const { state, dispatch } = usePortalManagerContext();
61
+ const instanceId = useId();
62
+
63
+ const scrollViewContext =
64
+ hostName && state.hosts[hostName]
65
+ ? (state.hostScrollViewContexts[hostName] ?? null)
66
+ : sourceScrollViewContext;
67
+
68
+ const isRemoved =
69
+ hostName && name ? state.removed[hostName]?.[name]?.[instanceId] : false;
70
+
71
+ useEffect(() => {
72
+ if (!hostName || !name) {
73
+ return;
74
+ }
75
+
76
+ dispatch({ type: "REGISTER_PORTAL", hostName, name, instanceId });
77
+
78
+ return () => {
79
+ dispatch({
80
+ type: "CLEAR_REMOVED_ON_UNMOUNT",
81
+ hostName,
82
+ name,
83
+ instanceId,
84
+ });
85
+ };
86
+ }, [dispatch, hostName, name, instanceId]);
87
+
88
+ return (
89
+ <ScrollViewContext.Provider value={scrollViewContext}>
90
+ <PortalView hostName={hostName} name={name} style={style}>
91
+ {isRemoved ? null : children}
92
+ </PortalView>
93
+ </ScrollViewContext.Provider>
94
+ );
95
+ };
96
+
97
+ export default PortalComponent;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/components/PortalHost.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import { useContext, useEffect } from "react";
8
+ import { usePortalManagerContext } from "./portal-manager";
9
+ import ScrollViewContext from "./scroll-view-context/context";
10
+ import type { PortalHostProps } from "./types";
11
+ import PortalHost from "./PortalHostView";
12
+
13
+ /**
14
+ * PortalHost is a component that acts as an anchor for the portals.
15
+ * You can define multiple portal hosts in your app and use them to render different portals.
16
+ * Each portal host has a unique name that you can use to identify a necessary one among the others.
17
+ *
18
+ * @category components
19
+ * @param name - The name of the portal host. It's used by `<Portal />` component to identify the host.
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * import { StyleSheet, View } from "react-native";
24
+ * import { PortalHost, PortalProvider } from "react-native-teleport";
25
+ * export default function App() {
26
+ * return (
27
+ * <PortalProvider>
28
+ * <PortalHost style={StyleSheet.absoluteFillObject} name="overlay" />
29
+ * </PortalProvider>
30
+ * );
31
+ * }
32
+ * ```
33
+ */
34
+ const PortalHostComponent = ({ name, children, style }: PortalHostProps) => {
35
+ const { dispatch } = usePortalManagerContext();
36
+ const scrollViewContext = useContext(ScrollViewContext);
37
+
38
+ useEffect(() => {
39
+ dispatch({ type: "REGISTER_HOST", hostName: name });
40
+
41
+ return () => {
42
+ dispatch({ type: "UNREGISTER_HOST", hostName: name });
43
+ };
44
+ }, [name, dispatch]);
45
+
46
+ useEffect(() => {
47
+ dispatch({
48
+ type: "SET_HOST_SCROLL_VIEW_CONTEXT",
49
+ hostName: name,
50
+ value: scrollViewContext,
51
+ });
52
+ }, [name, dispatch, scrollViewContext]);
53
+
54
+ return (
55
+ <PortalHost name={name} style={style}>
56
+ {children}
57
+ </PortalHost>
58
+ );
59
+ };
60
+
61
+ export default PortalHostComponent;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/PortalHost/index.native.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import PortalHostNativeComponent from "./specs/PortalHostViewNativeComponent";
8
+ import type { PortalHostProps } from "./types";
9
+
10
+ const PortalHost = (props: PortalHostProps) => {
11
+ return <PortalHostNativeComponent pointerEvents="box-none" {...props} />;
12
+ };
13
+
14
+ export default PortalHost;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/PortalHost/index.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import { memo, useEffect } from "react";
8
+ import { usePortalRegistryContext } from "./portal-registry";
9
+ import type { PortalHostProps } from "./types";
10
+
11
+ function PortalHost({ name, children, style }: PortalHostProps) {
12
+ const { registerHost } = usePortalRegistryContext();
13
+
14
+ useEffect(() => {
15
+ return () => {
16
+ registerHost(name, null);
17
+ };
18
+ }, [name, registerHost]);
19
+
20
+ return (
21
+ <div
22
+ style={{ ...style, pointerEvents: "none" } as React.CSSProperties}
23
+ ref={(ref) => registerHost(name, ref)}
24
+ >
25
+ {children}
26
+ </div>
27
+ );
28
+ }
29
+
30
+ export default memo(PortalHost);
@@ -0,0 +1,51 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/PortalProvider.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import PortalHost from "./PortalHost";
8
+ import NativePortalProvider from "./PortalProviderView";
9
+ import { PortalManagerProvider } from "./portal-manager";
10
+
11
+ type PortalProviderProps = {
12
+ children: React.ReactNode;
13
+ };
14
+
15
+ /**
16
+ * Wraps your app with this component to use the teleport API.
17
+ *
18
+ * This component provides a context/registry for all Portals so that you can use imperative API, such as `usePortal` hook to manage Portals.
19
+ *
20
+ * @category components
21
+ * @example
22
+ * ```tsx
23
+ * import { PortalProvider } from "react-native-teleport";
24
+ * export default function App() {
25
+ * return (
26
+ * <PortalProvider>
27
+ * //* your main application code goes here
28
+ * </PortalProvider>
29
+ * );
30
+ * }
31
+ */
32
+ export default function PortalProvider({ children }: PortalProviderProps) {
33
+ return (
34
+ <NativePortalProvider>
35
+ <PortalManagerProvider>
36
+ {children}
37
+ <PortalHost name="root" style={styles.root} />
38
+ </PortalManagerProvider>
39
+ </NativePortalProvider>
40
+ );
41
+ }
42
+
43
+ const styles = {
44
+ root: {
45
+ position: "absolute",
46
+ top: 0,
47
+ bottom: 0,
48
+ left: 0,
49
+ right: 0,
50
+ },
51
+ } as const;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/PortalProvider/index.native.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: nothing — byte-for-byte, only its path.
6
+ */
7
+ import type { PortalProviderProps } from "./types";
8
+
9
+ export default function PortalProvider({ children }: PortalProviderProps) {
10
+ return children;
11
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/PortalProvider/index.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ import { useCallback, useMemo, useRef } from "react";
8
+ import { PortalRegistryContext } from "./portal-registry";
9
+ import type { PortalProviderProps } from "./types";
10
+
11
+ export default function PortalProvider({ children }: PortalProviderProps) {
12
+ const hostsRef = useRef<Map<string, HTMLElement>>(new Map());
13
+ const pendingPortalsRef = useRef<Map<string, Set<() => void>>>(new Map());
14
+
15
+ const registerHost = useCallback((name: string, node: HTMLElement | null) => {
16
+ if (node) {
17
+ hostsRef.current.set(name, node);
18
+ } else {
19
+ hostsRef.current.delete(name);
20
+ }
21
+
22
+ const callbacks = pendingPortalsRef.current.get(name);
23
+ if (callbacks) {
24
+ callbacks.forEach((callback) => callback());
25
+ }
26
+ }, []);
27
+ const getHost = useCallback(
28
+ (name: string) => hostsRef.current.get(name) ?? null,
29
+ [],
30
+ );
31
+ const registerPendingPortal = useCallback(
32
+ (name: string, callback: () => void) => {
33
+ const callbacks = pendingPortalsRef.current.get(name) ?? new Set();
34
+ callbacks.add(callback);
35
+ pendingPortalsRef.current.set(name, callbacks);
36
+ },
37
+ [],
38
+ );
39
+ const unregisterPendingPortal = useCallback(
40
+ (name: string, callback: () => void) => {
41
+ const callbacks = pendingPortalsRef.current.get(name);
42
+ if (callbacks) {
43
+ callbacks.delete(callback);
44
+ if (callbacks.size === 0) {
45
+ pendingPortalsRef.current.delete(name);
46
+ }
47
+ }
48
+ },
49
+ [],
50
+ );
51
+
52
+ const value = useMemo(
53
+ () => ({
54
+ registerHost,
55
+ getHost,
56
+ registerPendingPortal,
57
+ unregisterPendingPortal,
58
+ }),
59
+ [registerHost, getHost, registerPendingPortal, unregisterPendingPortal],
60
+ );
61
+
62
+ return (
63
+ <PortalRegistryContext.Provider value={value}>
64
+ {children}
65
+ </PortalRegistryContext.Provider>
66
+ );
67
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.native.tsx`
3
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
4
+ *
5
+ * Changed: import paths only, for this flat directory.
6
+ */
7
+ export { default } from "./specs/PortalViewNativeComponent";