@mittwald/react-tunnel 0.1.0-alpha.235 → 0.1.0-alpha.237
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.
- package/dist/index.js +16 -18
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var o = (s, e, t) =>
|
|
6
|
-
import C, { useRef as f, createContext as b, useContext as m, useId as v,
|
|
7
|
-
import { observable as a, makeObservable as
|
|
8
|
-
import { observer as
|
|
3
|
+
var g = Object.defineProperty;
|
|
4
|
+
var E = (s, e, t) => e in s ? g(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
5
|
+
var o = (s, e, t) => E(s, typeof e != "symbol" ? e + "" : e, t);
|
|
6
|
+
import C, { useRef as f, createContext as b, useContext as m, useId as v, useEffect as w } from "react";
|
|
7
|
+
import { observable as a, makeObservable as x, action as p } from "mobx";
|
|
8
|
+
import { observer as y } from "mobx-react-lite";
|
|
9
9
|
const l = "default";
|
|
10
10
|
class c {
|
|
11
11
|
constructor() {
|
|
@@ -16,7 +16,7 @@ class c {
|
|
|
16
16
|
}
|
|
17
17
|
));
|
|
18
18
|
o(this, "preparedChildren", /* @__PURE__ */ new Map());
|
|
19
|
-
|
|
19
|
+
x(this, {
|
|
20
20
|
deleteChildren: p.bound,
|
|
21
21
|
setChildren: p.bound
|
|
22
22
|
});
|
|
@@ -44,25 +44,23 @@ class c {
|
|
|
44
44
|
return Array.from(t);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
const h = b(new c()),
|
|
47
|
+
const h = b(new c()), P = (s) => {
|
|
48
48
|
const { children: e } = s;
|
|
49
49
|
return /* @__PURE__ */ C.createElement(h.Provider, { value: c.useNew() }, e);
|
|
50
|
-
},
|
|
50
|
+
}, A = (s) => {
|
|
51
51
|
const { children: e, id: t, staticEntryId: n } = s, r = m(h), i = v(), d = n ?? i, u = f(!1);
|
|
52
|
-
return u.current || r.prepareChildren(t, d, e), w(() => {
|
|
53
|
-
u.current = !0, r.setChildren(t, d, e);
|
|
54
|
-
}, [e, t, d]), x(() => () => {
|
|
52
|
+
return u.current || r.prepareChildren(t, d, e), w(() => (u.current = !0, r.setChildren(t, d, e), () => {
|
|
55
53
|
r.deleteChildren(t, d);
|
|
56
|
-
}, [e, t, d]), null;
|
|
57
|
-
},
|
|
54
|
+
}), [e, t, d]), null;
|
|
55
|
+
}, R = (s) => {
|
|
58
56
|
const { children: e } = s;
|
|
59
57
|
return typeof e == "function" ? e() : e;
|
|
60
|
-
}, O =
|
|
58
|
+
}, O = y((s) => {
|
|
61
59
|
const { children: e, id: t } = s, n = m(h).getChildren(t);
|
|
62
|
-
return n ? n.map(([r, i]) => /* @__PURE__ */ C.createElement(
|
|
60
|
+
return n ? n.map(([r, i]) => /* @__PURE__ */ C.createElement(R, { key: r }, i)) : e;
|
|
63
61
|
});
|
|
64
62
|
export {
|
|
65
|
-
|
|
63
|
+
A as TunnelEntry,
|
|
66
64
|
O as TunnelExit,
|
|
67
|
-
|
|
65
|
+
P as TunnelProvider
|
|
68
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/react-tunnel",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.237",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "It's like a Portal – but with React components",
|
|
6
6
|
"keywords": [
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"react": "^18.2.0",
|
|
59
59
|
"react-dom": "^18.2.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c995b4f9f3b042a09ea75608c723ff330e52d723"
|
|
62
62
|
}
|