@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,79 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.tsx`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths only, for this flat directory.
8
+ */
9
+ /// <reference lib="dom" />
10
+
11
+ import { useRef, useLayoutEffect, useCallback } from "react";
12
+ import { createPortal } from "react-dom";
13
+ import { usePortalRegistryContext } from "./portal-registry.js";
14
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
15
+ const supportsMoveBefore = typeof Element !== "undefined" && "moveBefore" in Element.prototype;
16
+ function moveElementTo(parent, child, before = null) {
17
+ if (supportsMoveBefore && child.parentNode) {
18
+ parent.moveBefore(child, before);
19
+ return;
20
+ }
21
+ if (child.parentNode) {
22
+ child.parentNode.removeChild(child);
23
+ }
24
+ parent.insertBefore(child, before);
25
+ }
26
+ export default function Portal({
27
+ hostName,
28
+ children,
29
+ style
30
+ }) {
31
+ const {
32
+ getHost,
33
+ registerPendingPortal,
34
+ unregisterPendingPortal
35
+ } = usePortalRegistryContext();
36
+ const elRef = useRef(null);
37
+ if (!elRef.current) {
38
+ elRef.current = document.createElement("div");
39
+ }
40
+ const sentinelRef = useRef(null);
41
+ useLayoutEffect(() => {
42
+ if (elRef.current && style) {
43
+ Object.assign(elRef.current.style, style);
44
+ }
45
+ }, [style]);
46
+ const teleportToHost = useCallback(() => {
47
+ const el = elRef.current;
48
+ if (!el) return;
49
+ const hostNode = hostName ? getHost(hostName) : null;
50
+ if (hostNode) {
51
+ // teleport view to the host
52
+ moveElementTo(hostNode, el);
53
+ } else if (sentinelRef.current && sentinelRef.current.parentElement) {
54
+ // keep view locally
55
+ const parent = sentinelRef.current.parentElement;
56
+ moveElementTo(parent, el, sentinelRef.current);
57
+ }
58
+ }, [hostName, getHost]);
59
+ useLayoutEffect(() => {
60
+ teleportToHost();
61
+ if (!hostName) return;
62
+ registerPendingPortal(hostName, teleportToHost);
63
+ return () => {
64
+ unregisterPendingPortal(hostName, teleportToHost);
65
+ };
66
+ }, [hostName, registerPendingPortal, unregisterPendingPortal, teleportToHost]);
67
+ return /*#__PURE__*/_jsxs(_Fragment, {
68
+ children: [/*#__PURE__*/createPortal(children, elRef.current), /*#__PURE__*/_jsx("div", {
69
+ ref: sentinelRef,
70
+ style: styles.anchor
71
+ })]
72
+ });
73
+ }
74
+ const styles = {
75
+ anchor: {
76
+ display: "contents"
77
+ }
78
+ };
79
+ //# sourceMappingURL=PortalView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRef","useLayoutEffect","useCallback","createPortal","usePortalRegistryContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","supportsMoveBefore","Element","prototype","moveElementTo","parent","child","before","parentNode","moveBefore","removeChild","insertBefore","Portal","hostName","children","style","getHost","registerPendingPortal","unregisterPendingPortal","elRef","current","document","createElement","sentinelRef","Object","assign","teleportToHost","el","hostNode","parentElement","ref","styles","anchor","display"],"sourceRoot":"../../../src","sources":["teleport/PortalView.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,EAAEC,eAAe,EAAEC,WAAW,QAAQ,OAAO;AAC5D,SAASC,YAAY,QAAQ,WAAW;AACxC,SAASC,wBAAwB,QAAQ,sBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAG7D,MAAMC,kBAAkB,GACtB,OAAOC,OAAO,KAAK,WAAW,IAAI,YAAY,IAAIA,OAAO,CAACC,SAAS;AAErE,SAASC,aAAaA,CACpBC,MAAe,EACfC,KAAc,EACdC,MAAsB,GAAG,IAAI,EAC7B;EACA,IAAIN,kBAAkB,IAAIK,KAAK,CAACE,UAAU,EAAE;IAC1CH,MAAM,CAACI,UAAU,CAACH,KAAK,EAAEC,MAAM,CAAC;IAChC;EACF;EAEA,IAA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,EAAE,EAAEJ,WAAW,CAACH,OAAO,CAAC;IAChD;EACF,CAAC,EAAE,CAACP,QAAQ,EAAEG,OAAO,CAAC,CAAC;EAEvBzB,eAAe,CAAC,MAAM;IACpBmC,cAAc,CAAC,CAAC;IAEhB,IAAI,CAACb,QAAQ,EAAE;IAEfI,qBAAqB,CAACJ,QAAQ,EAAEa,cAAc,CAAC;IAC/C,OAAO,MAAM;MACXR,uBAAuB,CAACL,QAAQ,EAAEa,cAAc,CAAC;IACnD,CAAC;EACH,CAAC,EAAE,CACDb,QAAQ,EACRI,qBAAqB,EACrBC,uBAAuB,EACvBQ,cAAc,CACf,CAAC;EAEF,oBACE1B,KAAA,CAAAF,SAAA;IAAAgB,QAAA,gBACGrB,YAAY,CAACqB,QAAQ,EAAEK,KAAK,CAACC,OAAO,CAAC,eAEtCxB,IAAA;MAAKkC,GAAG,EAAEP,WAAY;MAACR,KAAK,EAAEgB,MAAM,CAACC;IAAO,CAAE,CAAC;EAAA,CAC/C,CAAC;AAEP;AAEA,MAAMD,MAAM,GAAG;EACbC,MAAM,EAAE;IACNC,OAAO,EAAE;EACX;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/views/Portal/index.native.tsx`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths only, for this flat directory.
8
+ */
9
+ export { default } from "./specs/PortalViewNativeComponent.js";
10
+ //# sourceMappingURL=PortalView.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default"],"sourceRoot":"../../../src","sources":["teleport/PortalView.native.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,QAAQ,sCAAmC","ignoreList":[]}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * react-native-teleport, vendored.
5
+ *
6
+ * COPIED FROM react-native-teleport 1.2.0 — `src/index.ts`. MIT, Copyright (c)
7
+ * 2025 Kiryl Ziusko; the full licence is in `NOTICE` at the repository root and
8
+ * every file in this directory names the file it came from.
9
+ *
10
+ * It is here rather than as a dependency because Bloom needs its NATIVE
11
+ * re-parenting — moving one platform view between hosts instead of mounting a
12
+ * second one — and that arrives as Fabric components, not as JavaScript.
13
+ *
14
+ * WHAT IS DIFFERENT FROM UPSTREAM, and it is not their code: **Bloom mounts
15
+ * these portals from its ROOT LAYER, never from the origin screen.** Their own
16
+ * recipe mounts the `<Portal>` inside the screen the media starts on, which is
17
+ * correct for a navigator that keeps that screen alive — and measured against
18
+ * expo-router on web, where the origin route unmounts on the URL change, it
19
+ * takes the media with it (`count 1 -> 0 -> 0`). The portal is not what fails
20
+ * there; the ownership is. Same piece, mounted where it does not die.
21
+ *
22
+ * Changed: import paths only, for this flat directory. Their file layout uses
23
+ * `index.tsx` per component, which Bloom's family-layout gate reserves for pure
24
+ * barrels, so each one is named after what it exports.
25
+ */
26
+ export { default as PortalHost } from "./PortalHost.js";
27
+ export { default as Portal } from "./Portal.js";
28
+ export { default as PortalProvider } from "./PortalProvider.js";
29
+ export { default as usePortal } from "./use-portal.js";
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["default","PortalHost","Portal","PortalProvider","usePortal"],"sourceRoot":"../../../src","sources":["teleport/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,OAAO,IAAIC,UAAU,QAAQ,iBAAc;AACpD,SAASD,OAAO,IAAIE,MAAM,QAAQ,aAAU;AAC5C,SAASF,OAAO,IAAIG,cAAc,QAAQ,qBAAkB;AAC5D,SAASH,OAAO,IAAII,SAAS,QAAQ,iBAAc","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/PortalManager.tsx`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths only, for this flat directory.
8
+ */
9
+ import { createContext, useContext, useReducer, useMemo } from "react";
10
+ import { initialState, reducer } from "./reducer.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ const PortalManagerContext = /*#__PURE__*/createContext(undefined);
13
+ export const PortalManagerProvider = ({
14
+ children
15
+ }) => {
16
+ const [state, dispatch] = useReducer(reducer, initialState);
17
+ const context = useMemo(() => ({
18
+ state,
19
+ dispatch
20
+ }), [state, dispatch]);
21
+ return /*#__PURE__*/_jsx(PortalManagerContext.Provider, {
22
+ value: context,
23
+ children: children
24
+ });
25
+ };
26
+ export const usePortalManagerContext = () => {
27
+ const context = useContext(PortalManagerContext);
28
+ if (!context) {
29
+ throw new Error("usePortalContext must be used within PortalProvider");
30
+ }
31
+ return context;
32
+ };
33
+ //# sourceMappingURL=portal-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","useReducer","useMemo","initialState","reducer","jsx","_jsx","PortalManagerContext","undefined","PortalManagerProvider","children","state","dispatch","context","Provider","value","usePortalManagerContext","Error"],"sourceRoot":"../../../src","sources":["teleport/portal-manager.tsx"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SACEA,aAAa,EACbC,UAAU,EACVC,UAAU,EACVC,OAAO,QAEF,OAAO;AACd,SACEC,YAAY,EACZC,OAAO,QAGF,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEnB,MAAMC,oBAAoB,gBAAGR,aAAa,CAExCS,SAAS,CAAC;AAEZ,OAAO,MAAMC,qBAAqB,GAAGA,CAAC;EACpCC;AAGF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGX,UAAU,CAACG,OAAO,EAAED,YAAY,CAAC;EAC3D,MAAMU,OAAO,GAAGX,OAAO,CAAC,OAAO;IAAES,KAAK;IAAEC;EAAS,CAAC,CAAC,EAAE,CAACD,KAAK,EAAEC,QAAQ,CAAC,CAAC;EAEvE,oBACEN,IAAA,CAACC,oBAAoB,CAACO,QAAQ;IAACC,KAAK,EAAEF,OAAQ;IAAAH,QAAA,EAC3CA;EAAQ,CACoB,CAAC;AAEpC,CAAC;AAED,OAAO,MAAMM,uBAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMH,OAAO,GAAGb,UAAU,CAACO,oBAAoB,CAAC;EAEhD,IAAI,CAACM,OAAO,EAAE;IACZ,MAAM,IAAII,KAAK,CAAC,qDAAqD,CAAC;EACxE;EAEA,OAAOJ,OAAO;AAChB,CAAC","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/PortalRegistry.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: nothing — byte-for-byte, only its path.
8
+ */
9
+ import { createContext, useContext } from "react";
10
+ export const PortalRegistryContext = /*#__PURE__*/createContext(null);
11
+ export function usePortalRegistryContext() {
12
+ const context = useContext(PortalRegistryContext);
13
+ if (!context) {
14
+ throw new Error("usePortalRegistryContext must be used within a PortalRegistryContext");
15
+ }
16
+ return context;
17
+ }
18
+ //# sourceMappingURL=portal-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","PortalRegistryContext","usePortalRegistryContext","context","Error"],"sourceRoot":"../../../src","sources":["teleport/portal-registry.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,EAAEC,UAAU,QAAQ,OAAO;AASjD,OAAO,MAAMC,qBAAqB,gBAChCF,aAAa,CAAmC,IAAI,CAAC;AAEvD,OAAO,SAASG,wBAAwBA,CAAA,EAAG;EACzC,MAAMC,OAAO,GAAGH,UAAU,CAACC,qBAAqB,CAAC;EACjD,IAAI,CAACE,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CACb,sEACF,CAAC;EACH;EACA,OAAOD,OAAO;AAChB","ignoreList":[]}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/state/reducer.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: nothing — byte-for-byte, only its path.
8
+ */
9
+
10
+ export const initialState = {
11
+ removed: {},
12
+ hosts: {},
13
+ hostScrollViewContexts: {}
14
+ };
15
+ export const reducer = (state, action) => {
16
+ const cloned = {
17
+ ...state,
18
+ removed: {
19
+ ...state.removed
20
+ },
21
+ hostScrollViewContexts: {
22
+ ...state.hostScrollViewContexts
23
+ }
24
+ };
25
+ const hostRemoved = "name" in action ? cloned.removed[action.hostName] || {} : {};
26
+ cloned.removed[action.hostName] = hostRemoved;
27
+ const nameRemoved = "name" in action ? hostRemoved[action.name] || {} : {};
28
+ if ("name" in action) {
29
+ hostRemoved[action.name] = nameRemoved;
30
+ }
31
+ switch (action.type) {
32
+ case "REGISTER_HOST":
33
+ {
34
+ const hosts = {
35
+ ...cloned.hosts
36
+ };
37
+ hosts[action.hostName] = (hosts[action.hostName] || 0) + 1;
38
+ return {
39
+ ...cloned,
40
+ hosts
41
+ };
42
+ }
43
+ case "UNREGISTER_HOST":
44
+ {
45
+ const hosts = {
46
+ ...cloned.hosts
47
+ };
48
+ const count = (hosts[action.hostName] || 0) - 1;
49
+ if (count <= 0) {
50
+ delete hosts[action.hostName];
51
+ delete cloned.hostScrollViewContexts[action.hostName];
52
+ } else {
53
+ hosts[action.hostName] = count;
54
+ }
55
+ return {
56
+ ...cloned,
57
+ hosts
58
+ };
59
+ }
60
+ case "SET_HOST_SCROLL_VIEW_CONTEXT":
61
+ cloned.hostScrollViewContexts[action.hostName] = action.value;
62
+ return cloned;
63
+ case "REGISTER_PORTAL":
64
+ if (!nameRemoved[action.instanceId]) {
65
+ nameRemoved[action.instanceId] = false;
66
+ }
67
+ return cloned;
68
+ case "REMOVE_PORTAL":
69
+ Object.keys(nameRemoved).forEach(id => nameRemoved[id] = true);
70
+ return cloned;
71
+ case "CLEAR_REMOVED_ON_UNMOUNT":
72
+ delete nameRemoved[action.instanceId];
73
+ if (Object.keys(nameRemoved).length === 0) {
74
+ delete hostRemoved[action.name];
75
+ }
76
+ return cloned;
77
+ default:
78
+ return state;
79
+ }
80
+ };
81
+ //# sourceMappingURL=reducer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["initialState","removed","hosts","hostScrollViewContexts","reducer","state","action","cloned","hostRemoved","hostName","nameRemoved","name","type","count","value","instanceId","Object","keys","forEach","id","length"],"sourceRoot":"../../../src","sources":["teleport/reducer.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;;AA+BA,OAAO,MAAMA,YAAyB,GAAG;EACvCC,OAAO,EAAE,CAAC,CAAC;EACXC,KAAK,EAAE,CAAC,CAAC;EACTC,sBAAsB,EAAE,CAAC;AAC3B,CAAC;AAED,OAAO,MAAMC,OAAO,GAAGA,CAACC,KAAkB,EAAEC,MAAc,KAAkB;EAC1E,MAAMC,MAAM,GAAG;IACb,GAAGF,KAAK;IACRJ,OAAO,EAAE;MAAE,GAAGI,KAAK,CAACJ;IAAQ,CAAC;IAC7BE,sBAAsB,EAAE;MAAE,GAAGE,KAAK,CAACF;IAAuB;EAC5D,CAAC;EACD,MAAMK,WAAW,GACf,MAAM,IAAIF,MAAM,GAAGC,MAAM,CAACN,OAAO,CAACK,MAAM,CAACG,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;EAC/DF,MAAM,CAACN,OAAO,CAACK,MAAM,CAACG,QAAQ,CAAC,GAAGD,WAAW;EAC7C,MAAME,WAAW,GAAG,MAAM,IAAIJ,MAAM,GAAGE,WAAW,CAACF,MAAM,CAACK,IAAI,CAAC,IAAI,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P,WAAW,CAAC,CAACQ,OAAO,CAAEC,EAAE,IAAMT,WAAW,CAACS,EAAE,CAAC,GAAG,IAAK,CAAC;MAClE,OAAOZ,MAAM;IACf,KAAK,0BAA0B;MAC7B,OAAOG,WAAW,CAACJ,MAAM,CAACS,UAAU,CAAC;MACrC,IAAIC,MAAM,CAACC,IAAI,CAACP,WAAW,CAAC,CAACU,MAAM,KAAK,CAAC,EAAE;QACzC,OAAOZ,WAAW,CAACF,MAAM,CAACK,IAAI,CAAC;MACjC;MACA,OAAOJ,MAAM;IACf;MACE,OAAOF,KAAK;EAChB;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/ScrollViewContext/index.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths only, for this flat directory.
8
+ */
9
+ import { createContext } from "react";
10
+ const ScrollViewContext = /*#__PURE__*/createContext(null);
11
+ export default ScrollViewContext;
12
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","ScrollViewContext"],"sourceRoot":"../../../../src","sources":["teleport/scroll-view-context/context.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,OAAO;AAGrC,MAAMC,iBAAiB,gBAAGD,aAAa,CAAyB,IAAI,CAAC;AAErE,eAAeC,iBAAiB","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/contexts/ScrollViewContext/index.native.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths, and `ScrollView.Context` is reached through a cast
8
+ * because Bloom does not compile with their `react-native-strict-api` condition,
9
+ * which is the only place that property is declared.
10
+ */
11
+
12
+ import { ScrollView } from "react-native";
13
+ // Bloom does not compile with their `react-native-strict-api` condition, and
14
+ // `ScrollView.Context` is only declared there. Reached through the shape it has
15
+ // at runtime instead; the value and the behaviour are theirs, unchanged.
16
+ const ScrollViewContext = ScrollView.Context;
17
+ export default ScrollViewContext;
18
+ //# sourceMappingURL=context.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ScrollView","ScrollViewContext","Context"],"sourceRoot":"../../../../src","sources":["teleport/scroll-view-context/context.native.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,UAAU,QAAQ,cAAc;AAGzC;AACA;AACA;AACA,MAAMC,iBAAiB,GAAID,UAAU,CAClCE,OAAO;AAEV,eAAeD,iBAAiB","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["teleport/scroll-view-context/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/specs/PortalHostViewNativeComponent.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: nothing — byte-for-byte, only its path.
8
+ */
9
+ import { codegenNativeComponent } from "react-native";
10
+ export default codegenNativeComponent("PortalHostView", {
11
+ interfaceOnly: true
12
+ });
13
+ //# sourceMappingURL=PortalHostViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../../src","sources":["teleport/specs/PortalHostViewNativeComponent.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsB,QAAwB,cAAc;AAMrE,eAAeA,sBAAsB,CAAc,gBAAgB,EAAE;EACnEC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/specs/PortalViewNativeComponent.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: nothing — byte-for-byte, only its path.
8
+ */
9
+ import { codegenNativeComponent } from "react-native";
10
+ export default codegenNativeComponent("PortalView", {
11
+ interfaceOnly: true
12
+ });
13
+ //# sourceMappingURL=PortalViewNativeComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["codegenNativeComponent","interfaceOnly"],"sourceRoot":"../../../../src","sources":["teleport/specs/PortalViewNativeComponent.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,sBAAsB,QAAwB,cAAc;AAOrE,eAAeA,sBAAsB,CAAc,YAAY,EAAE;EAC/DC,aAAa,EAAE;AACjB,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=teleport-global.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["teleport/teleport-global.d.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["teleport/types.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/hooks/useId.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: nothing — byte-for-byte, only its path.
8
+ */
9
+ import { useRef } from "react";
10
+ let __idCounter = 0;
11
+ export default function useId(prefix = "uid") {
12
+ const idRef = useRef("");
13
+ if (!idRef.current) {
14
+ const n = ++__idCounter;
15
+ idRef.current = `${prefix}-${n}`;
16
+ }
17
+ return idRef.current;
18
+ }
19
+ //# sourceMappingURL=use-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useRef","__idCounter","useId","prefix","idRef","current","n"],"sourceRoot":"../../../src","sources":["teleport/use-id.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,OAAO;AAE9B,IAAIC,WAAW,GAAG,CAAC;AAEnB,eAAe,SAASC,KAAKA,CAACC,MAAM,GAAG,KAAK,EAAU;EACpD,MAAMC,KAAK,GAAGJ,MAAM,CAAS,EAAE,CAAC;EAChC,IAAI,CAACI,KAAK,CAACC,OAAO,EAAE;IAClB,MAAMC,CAAC,GAAG,EAAEL,WAAW;IACvBG,KAAK,CAACC,OAAO,GAAG,GAAGF,MAAM,IAAIG,CAAC,EAAE;EAClC;EACA,OAAOF,KAAK,CAACC,OAAO;AACtB","ignoreList":[]}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * COPIED FROM react-native-teleport 1.2.0 — `src/hooks/usePortal.ts`
5
+ * MIT, Copyright (c) 2025 Kiryl Ziusko. Full licence in `NOTICE` at the root.
6
+ *
7
+ * Changed: import paths only, for this flat directory.
8
+ */
9
+ import { usePortalManagerContext } from "./portal-manager.js";
10
+
11
+ /**
12
+ * The `usePortal` hook allows you to manage portals in imperative way.
13
+ *
14
+ * @category hooks
15
+ * @param `hostName` - `name` of the `<PortalHost />` component
16
+ * @returns an object that helps to manipulate portals
17
+ * @example
18
+ * ```tsx
19
+ * import { usePortal } from "react-native-teleport";
20
+ * export default function App() {
21
+ * const { removePortal, isHostAvailable } = usePortal("root");
22
+ * return (
23
+ * <View style={{ flex: 1 }}>
24
+ * <Text>{isHostAvailable ? "Host is available" : "Host is not available"}</Text>
25
+ * <Button title="Remove" onPress={() => removePortal("portal")} />
26
+ * </View>
27
+ * );
28
+ * }
29
+ * ```
30
+ */
31
+ export default function usePortal(hostName = "root") {
32
+ const {
33
+ state,
34
+ dispatch
35
+ } = usePortalManagerContext();
36
+ return {
37
+ /**
38
+ * Whether a `<PortalHost />` with the given `hostName` is currently mounted.
39
+ */
40
+ isHostAvailable: (state.hosts[hostName] ?? 0) > 0,
41
+ /**
42
+ * Remove portal from host container. Subsequent re-renders will not restore portal,
43
+ * but if you mount a new portal with the same name it will be shown (i. e. hook doesn't
44
+ * prevent new portal from being added).
45
+ *
46
+ * @param name - `name` of `<Portal />` component.
47
+ */
48
+ removePortal: name => dispatch({
49
+ type: "REMOVE_PORTAL",
50
+ hostName,
51
+ name
52
+ })
53
+ };
54
+ }
55
+ //# sourceMappingURL=use-portal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["usePortalManagerContext","usePortal","hostName","state","dispatch","isHostAvailable","hosts","removePortal","name","type"],"sourceRoot":"../../../src","sources":["teleport/use-portal.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,uBAAuB,QAAQ,qBAAkB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,SAASA,CAACC,QAAgB,GAAG,MAAM,EAAE;EAC3D,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGJ,uBAAuB,CAAC,CAAC;EAErD,OAAO;IACL;AACJ;AACA;IACIK,eAAe,EAAE,CAACF,KAAK,CAACG,KAAK,CAACJ,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IACjD;AACJ;AACA;AACA;AACA;AACA;AACA;IACIK,YAAY,EAAGC,IAAY,IACzBJ,QAAQ,CAAC;MAAEK,IAAI,EAAE,eAAe;MAAEP,QAAQ;MAAEM;IAAK,CAAC;EACtD,CAAC;AACH","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"MediaFlightLayer.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightLayer.tsx"],"names":[],"mappings":"AA+CA;;;;;GAKG;AACH,wBAAgB,gBAAgB,mDAkB/B;yBAlBe,gBAAgB"}
1
+ {"version":3,"file":"MediaFlightLayer.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/MediaFlightLayer.tsx"],"names":[],"mappings":"AA8CA;;;;;GAKG;AACH,wBAAgB,gBAAgB,mDAkB/B;yBAlBe,gBAAgB"}
@@ -1 +1 @@
1
- {"version":3,"file":"media-node.web.d.ts","sourceRoot":"","sources":["../../../../src/media-flight/media-node.web.ts"],"names":[],"mappings":"AA8DA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEnE,gFAAgF;AAChF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,EAAE,SAAS,GAAG,OAAO,CAAC;IAChC,iFAAiF;IACjF,WAAW,EAAE,cAAc,GAAG,SAAS,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,8EAA8E;IAC9E,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B;AAED,6EAA6E;AAC7E,eAAO,MAAM,SAAS,IAAI,CAAC;AAC3B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,UAAU,cAAc;IACtB,EAAE,EAAE,WAAW,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;CACrC;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB;;;;;;;;OAQG;IACH,MAAM,EAAE,eAAe,CAAC;CACzB;AAED,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,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,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,eAAe,GACvB,IAAI,CAgBN;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAehF;AAED,wDAAwD;AACxD,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,iFAAiF;AACjF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAMtE;AAED,8EAA8E;AAC9E,wBAAgB,aAAa,IAAI,SAAS,aAAa,EAAE,CAExD;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,IAAI,IAAI,CAUtC"}
@@ -0,0 +1,48 @@
1
+ import type { PortalProps } from "./types";
2
+ /**
3
+ * Portal helps you to render a component in a different place in the view hierarchy.
4
+ * This is useful when you need a view to visually “break out” of its parent container (for example: modals, toasts, floating UI, popovers).
5
+ *
6
+ * @category components
7
+ * @param hostName - The `name` of the `PortalHost`. It's used to identify the host where the content should be rendered.
8
+ * @param name - The name of the portal. It's used to identify the portal.
9
+ * @param children - The content that should be rendered in the portal.
10
+ * @example
11
+ * ```tsx
12
+ * import { useState } from "react";
13
+ * import { View, StyleSheet, Button } from "react-native";
14
+ * import { Portal } from "react-native-teleport";
15
+ * export default function InstantRootExample() {
16
+ * const [shouldBeTeleported, setTeleported] = useState(true);
17
+ * return (
18
+ * <View style={styles.container}>
19
+ * {shouldBeTeleported && (
20
+ * <Portal hostName={"overlay"}>
21
+ * <View style={styles.box} />
22
+ * </Portal>
23
+ * )}
24
+ * <Button
25
+ * title={shouldBeTeleported ? "Hide" : "Show"}
26
+ * onPress={() => setTeleported((t) => !t)}
27
+ * />
28
+ * </View>
29
+ * );
30
+ * }
31
+ * const styles = StyleSheet.create({
32
+ * container: {
33
+ * flex: 1,
34
+ * alignItems: "center",
35
+ * justifyContent: "center",
36
+ * },
37
+ * box: {
38
+ * width: 160,
39
+ * height: 160,
40
+ * marginVertical: 20,
41
+ * backgroundColor: "blue",
42
+ * },
43
+ * });
44
+ * ```
45
+ */
46
+ declare const PortalComponent: ({ hostName, name, style, children }: PortalProps) => import("react/jsx-runtime").JSX.Element;
47
+ export default PortalComponent;
48
+ //# sourceMappingURL=Portal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Portal.d.ts","sourceRoot":"","sources":["../../../../src/teleport/Portal.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,QAAA,MAAM,eAAe,GAAI,qCAAqC,WAAW,4CAqCxE,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { PortalHostProps } from "./types";
2
+ /**
3
+ * PortalHost is a component that acts as an anchor for the portals.
4
+ * You can define multiple portal hosts in your app and use them to render different portals.
5
+ * Each portal host has a unique name that you can use to identify a necessary one among the others.
6
+ *
7
+ * @category components
8
+ * @param name - The name of the portal host. It's used by `<Portal />` component to identify the host.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * import { StyleSheet, View } from "react-native";
13
+ * import { PortalHost, PortalProvider } from "react-native-teleport";
14
+ * export default function App() {
15
+ * return (
16
+ * <PortalProvider>
17
+ * <PortalHost style={StyleSheet.absoluteFillObject} name="overlay" />
18
+ * </PortalProvider>
19
+ * );
20
+ * }
21
+ * ```
22
+ */
23
+ declare const PortalHostComponent: ({ name, children, style }: PortalHostProps) => import("react/jsx-runtime").JSX.Element;
24
+ export default PortalHostComponent;
25
+ //# sourceMappingURL=PortalHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalHost.d.ts","sourceRoot":"","sources":["../../../../src/teleport/PortalHost.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAG/C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,mBAAmB,GAAI,2BAA2B,eAAe,4CAyBtE,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ import type { PortalHostProps } from "./types";
2
+ declare function PortalHost({ name, children, style }: PortalHostProps): import("react/jsx-runtime").JSX.Element;
3
+ declare const _default: import("react").MemoExoticComponent<typeof PortalHost>;
4
+ export default _default;
5
+ //# sourceMappingURL=PortalHostView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalHostView.d.ts","sourceRoot":"","sources":["../../../../src/teleport/PortalHostView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,eAAe,2CAiB7D;;AAED,wBAAgC"}
@@ -0,0 +1,4 @@
1
+ import type { PortalHostProps } from "./types";
2
+ declare const PortalHost: (props: PortalHostProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default PortalHost;
4
+ //# sourceMappingURL=PortalHostView.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalHostView.native.d.ts","sourceRoot":"","sources":["../../../../src/teleport/PortalHostView.native.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,QAAA,MAAM,UAAU,GAAI,OAAO,eAAe,4CAEzC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,23 @@
1
+ type PortalProviderProps = {
2
+ children: React.ReactNode;
3
+ };
4
+ /**
5
+ * Wraps your app with this component to use the teleport API.
6
+ *
7
+ * This component provides a context/registry for all Portals so that you can use imperative API, such as `usePortal` hook to manage Portals.
8
+ *
9
+ * @category components
10
+ * @example
11
+ * ```tsx
12
+ * import { PortalProvider } from "react-native-teleport";
13
+ * export default function App() {
14
+ * return (
15
+ * <PortalProvider>
16
+ * //* your main application code goes here
17
+ * </PortalProvider>
18
+ * );
19
+ * }
20
+ */
21
+ export default function PortalProvider({ children }: PortalProviderProps): import("react/jsx-runtime").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=PortalProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalProvider.d.ts","sourceRoot":"","sources":["../../../../src/teleport/PortalProvider.tsx"],"names":[],"mappings":"AAUA,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CASvE"}
@@ -0,0 +1,3 @@
1
+ import type { PortalProviderProps } from "./types";
2
+ export default function PortalProvider({ children }: PortalProviderProps): import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=PortalProviderView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PortalProviderView.d.ts","sourceRoot":"","sources":["../../../../src/teleport/PortalProviderView.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,mBAAmB,2CAwDvE"}