@mittwald/react-tunnel 0.2.0-alpha.105 → 0.2.0-alpha.1050

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 CHANGED
@@ -1,67 +1,102 @@
1
- "use client"
2
- /* */
3
- var m = Object.defineProperty;
4
- var g = (s, e, r) => e in s ? m(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
5
- var c = (s, e, r) => g(s, typeof e != "symbol" ? e + "" : e, r);
6
- import { jsx as C } from "react/jsx-runtime";
7
- import { useState as b, createContext as E, useContext as f, useId as v, useRef as w, useEffect as x } from "react";
8
- import { observable as a, makeObservable as y, action as p } from "mobx";
9
- import { observer as T } from "mobx-react-lite";
10
- const l = "default";
11
- class o {
12
- constructor() {
13
- c(this, "children", a.map(
14
- {},
15
- {
16
- deep: !1
17
- }
18
- ));
19
- c(this, "preparedChildren", /* @__PURE__ */ new Map());
20
- y(this, {
21
- deleteChildren: p.bound,
22
- setChildren: p.bound
23
- });
24
- }
25
- static useNew() {
26
- return b(() => new o())[0];
27
- }
28
- setChildren(e = l, r, n) {
29
- var i;
30
- const t = this.children.get(e) ?? a.map({}, { deep: !1 });
31
- t.set(r, n), (i = this.preparedChildren.get(e)) == null || i.delete(r), this.children.set(e, t);
32
- }
33
- prepareChildren(e = l, r, n) {
34
- const t = this.preparedChildren.get(e) ?? /* @__PURE__ */ new Map();
35
- t.set(r, n), this.preparedChildren.set(e, t);
36
- }
37
- deleteChildren(e = l, r) {
38
- var n, t;
39
- (n = this.children.get(e)) == null || n.delete(r), (t = this.preparedChildren.get(e)) == null || t.delete(r);
40
- }
41
- getChildren(e = l) {
42
- var n, t;
43
- const r = ((n = this.children.get(e)) == null ? void 0 : n.entries()) ?? ((t = this.preparedChildren.get(e)) == null ? void 0 : t.entries());
44
- if (r)
45
- return Array.from(r);
46
- }
47
- }
48
- const h = E(new o()), A = (s) => {
49
- const { children: e } = s;
50
- return /* @__PURE__ */ C(h.Provider, { value: o.useNew(), children: e });
51
- }, O = (s) => {
52
- const { children: e, id: r, staticEntryId: n } = s, t = f(h), i = v(), d = n ?? i, u = w(!1);
53
- return u.current || t.prepareChildren(r, d, e), x(() => (u.current = !0, t.setChildren(r, d, e), () => {
54
- t.deleteChildren(r, d);
55
- }), [e, r, d]), null;
56
- }, M = (s) => {
57
- const { children: e } = s;
58
- return typeof e == "function" ? e() : e;
59
- }, S = T((s) => {
60
- const { children: e, id: r } = s, n = f(h).getChildren(r);
61
- return n ? n.map(([t, i]) => /* @__PURE__ */ C(M, { children: i }, t)) : e;
1
+
2
+ import { createContext as e, useContext as t, useEffect as n, useId as r, useLayoutEffect as i, useRef as a, useState as o, useSyncExternalStore as s } from "react";
3
+ import { action as c, makeObservable as l, observable as u } from "mobx";
4
+ import { jsx as d } from "react/jsx-runtime";
5
+ import { observer as f } from "mobx-react-lite";
6
+ //#region src/TunnelState.ts
7
+ var p = "default", m = "default", h = class e {
8
+ id;
9
+ instanceId;
10
+ committedChildren = u.map({}, { deep: !1 });
11
+ renderPhaseChildren = /* @__PURE__ */ new Map();
12
+ nextIndex = 0;
13
+ constructor(e = m, t = m) {
14
+ this.id = e, this.instanceId = t, l(this, {
15
+ id: !1,
16
+ deleteChildren: c.bound,
17
+ setChildren: c.bound
18
+ });
19
+ }
20
+ static useNew(t) {
21
+ let n = r(), i = o(() => new e(t, n))[0];
22
+ return i.resetIndex(), i;
23
+ }
24
+ resetIndex() {
25
+ this.nextIndex = 0;
26
+ }
27
+ useEntryIndex() {
28
+ let e = a(this.instanceId), t = a(null);
29
+ return (t.current === null || e.current !== this.instanceId) && (e.current = this.instanceId, t.current = this.nextIndex++), t.current;
30
+ }
31
+ setChildren(e = p, t, n, r) {
32
+ let i = {
33
+ id: t,
34
+ index: n,
35
+ children: r
36
+ }, a = this.committedChildren.get(e) ?? u.map({}, { deep: !1 });
37
+ a.set(t, i), this.renderPhaseChildren.get(e)?.delete(t), this.committedChildren.set(e, a);
38
+ }
39
+ setRenderPhaseChildren(e = p, t, n, r) {
40
+ let i = {
41
+ id: t,
42
+ index: n,
43
+ children: r
44
+ }, a = this.renderPhaseChildren.get(e) ?? /* @__PURE__ */ new Map();
45
+ a.set(t, i), this.renderPhaseChildren.set(e, a);
46
+ }
47
+ deleteChildrenFromMap(e, t, n) {
48
+ let r = e.get(t);
49
+ r?.delete(n), r?.size === 0 && e.delete(t);
50
+ }
51
+ deleteChildren(e = p, t) {
52
+ this.deleteChildrenFromMap(this.committedChildren, e, t), this.deleteChildrenFromMap(this.renderPhaseChildren, e, t);
53
+ }
54
+ getEntries(e = p, t = !1) {
55
+ let n = this.committedChildren.get(e)?.values(), r = t ? this.renderPhaseChildren.get(e)?.values() : void 0, i = n ?? r;
56
+ if (i) return {
57
+ committed: !!n,
58
+ entries: Array.from(i).sort((e, t) => e.index - t.index)
59
+ };
60
+ }
61
+ }, g = e({ state: new h() }), _ = (e = m) => {
62
+ let n = t(g);
63
+ for (; n;) {
64
+ if (n.state.id === e) return n.state;
65
+ n = n.parentContext;
66
+ }
67
+ throw Error(`Could not get tunnel for provider ${e}. Please provider a TunnelProvider with this ID.`);
68
+ }, v = (e) => {
69
+ let { children: n, id: r } = e, i = t(g), a = h.useNew(r);
70
+ return /* @__PURE__ */ d(g.Provider, {
71
+ value: {
72
+ state: a,
73
+ parentContext: i
74
+ },
75
+ children: n
76
+ });
77
+ }, y = (e) => {
78
+ let { children: t, id: o, staticEntryId: s, providerId: c } = e, l = _(c), u = r(), d = s ?? u, f = l.useEntryIndex(), p = a(!1);
79
+ return p.current || l.setRenderPhaseChildren(o, d, f, t), i(() => {
80
+ p.current = !0, l.setChildren(o, d, f, t);
81
+ }, [
82
+ t,
83
+ o,
84
+ d,
85
+ f,
86
+ c
87
+ ]), n(() => () => {
88
+ l.deleteChildren(o, d);
89
+ }, [
90
+ o,
91
+ d,
92
+ c
93
+ ]), null;
94
+ }, b = (e) => {
95
+ let { children: t } = e;
96
+ return typeof t == "function" ? t() : t;
97
+ }, x = f((e) => {
98
+ let { children: t, id: n, providerId: r } = e, i = s(() => () => null, () => !1, () => !0), a = _(r).getEntries(n, i)?.entries.map((e) => /* @__PURE__ */ d(b, { children: e.children }, e.id));
99
+ return typeof t == "function" ? t(a) : a ?? t;
62
100
  });
63
- export {
64
- O as TunnelEntry,
65
- S as TunnelExit,
66
- A as TunnelProvider
67
- };
101
+ //#endregion
102
+ export { y as TunnelEntry, x as TunnelExit, v as TunnelProvider };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Tunnel.browser.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tunnel.browser.test.d.ts","sourceRoot":"","sources":["../../src/Tunnel.browser.test.tsx"],"names":[],"mappings":""}
@@ -1,13 +1,31 @@
1
+ import { ReactNode } from 'react';
1
2
  import { ObservableMap } from 'mobx';
2
- import { TunnelChildren } from './types';
3
+ export declare const defaultTunnelProviderId = "default";
4
+ export type TunnelChildren = ReactNode | undefined | ((tunnelChildren?: ReactNode | undefined) => ReactNode | undefined);
5
+ interface TunnelEntryState {
6
+ index: number;
7
+ id: string;
8
+ children: TunnelChildren;
9
+ }
10
+ interface TunnelEntries {
11
+ committed: boolean;
12
+ entries: TunnelEntryState[];
13
+ }
3
14
  export declare class TunnelState {
4
- readonly children: ObservableMap<string, ObservableMap<string, TunnelChildren>>;
5
- private readonly preparedChildren;
6
- constructor();
7
- static useNew(): TunnelState;
8
- setChildren(tunnelId: string | undefined, entryId: string, children: TunnelChildren): void;
9
- prepareChildren(tunnelId: string | undefined, entryId: string, children: TunnelChildren): void;
15
+ readonly id: string;
16
+ private instanceId;
17
+ readonly committedChildren: ObservableMap<string, ObservableMap<string, TunnelEntryState>>;
18
+ private readonly renderPhaseChildren;
19
+ private nextIndex;
20
+ constructor(id?: string, instanceId?: string);
21
+ static useNew(id?: string): TunnelState;
22
+ resetIndex(): void;
23
+ useEntryIndex(): number;
24
+ setChildren(tunnelId: string | undefined, entryId: string, index: number, children: TunnelChildren): void;
25
+ setRenderPhaseChildren(tunnelId: string | undefined, entryId: string, index: number, children: TunnelChildren): void;
26
+ private deleteChildrenFromMap;
10
27
  deleteChildren(tunnelId: string | undefined, entryId: string): void;
11
- getChildren(tunnelId?: string): [string, TunnelChildren][] | undefined;
28
+ getEntries(tunnelId?: string, useRenderPhaseFallback?: boolean): TunnelEntries | undefined;
12
29
  }
30
+ export {};
13
31
  //# sourceMappingURL=TunnelState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TunnelState.d.ts","sourceRoot":"","sources":["../../src/TunnelState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE1C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAI9C,qBAAa,WAAW;IACtB,SAAgB,QAAQ,+DAQtB;IAEF,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAG7B;;WASU,MAAM,IAAI,WAAW;IAI5B,WAAW,CAChB,QAAQ,EAAE,MAAM,YAAY,EAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,GACvB,IAAI;IAWA,eAAe,CACpB,QAAQ,EAAE,MAAM,YAAY,EAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,GACvB,IAAI;IASA,cAAc,CAAC,QAAQ,EAAE,MAAM,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAKnE,WAAW,CAChB,QAAQ,GAAE,MAAkB,GAC3B,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,GAAG,SAAS;CAQ1C"}
1
+ {"version":3,"file":"TunnelState.d.ts","sourceRoot":"","sources":["../../src/TunnelState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAA2B,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAI1C,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,SAAS,GACT,CAAC,CAAC,cAAc,CAAC,EAAE,SAAS,GAAG,SAAS,KAAK,SAAS,GAAG,SAAS,CAAC,CAAC;AAExE,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAED,UAAU,aAAa;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,qBAAa,WAAW;IACtB,SAAgB,EAAE,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,UAAU,CAAS;IAE3B,SAAgB,iBAAiB,iEAQ/B;IAEF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAGhC;IAEJ,OAAO,CAAC,SAAS,CAAK;gBAGpB,EAAE,SAA0B,EAC5B,UAAU,SAA0B;WAWxB,MAAM,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,WAAW;IAOvC,UAAU;IAIV,aAAa;IAUb,WAAW,CAChB,QAAQ,EAAE,MAAM,YAAY,EAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,cAAc,GACvB,IAAI;IAiBA,sBAAsB,CAC3B,QAAQ,EAAE,MAAM,YAAY,EAC5B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,cAAc,GACvB,IAAI;IAgBP,OAAO,CAAC,qBAAqB;IAYtB,cAAc,CAAC,QAAQ,EAAE,MAAM,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAcnE,UAAU,CACf,QAAQ,SAAY,EACpB,sBAAsB,UAAQ,GAC7B,aAAa,GAAG,SAAS;CAmB7B"}
@@ -1,11 +1,13 @@
1
- import { FC } from 'react';
2
- import { TunnelChildren } from '../types';
3
- interface Props {
1
+ import { FC, ReactNode } from 'react';
2
+ export type TunnelEntryChildren = ReactNode | undefined | (() => ReactNode | undefined);
3
+ export interface TunnelEntryProps {
4
4
  id?: string;
5
- children?: TunnelChildren;
5
+ children?: TunnelEntryChildren;
6
6
  /** Static entry ID instead of generated ID by `useId` */
7
7
  staticEntryId?: string;
8
+ /** Select a dedicated tunnel provider by ID. */
9
+ providerId?: string;
8
10
  }
9
- export declare const TunnelEntry: FC<Props>;
11
+ export declare const TunnelEntry: FC<TunnelEntryProps>;
10
12
  export default TunnelEntry;
11
13
  //# sourceMappingURL=TunnelEntry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TunnelEntry.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU,KAAK;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,KAAK,CAqBjC,CAAC;AAEF,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"TunnelEntry.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelEntry.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAI3C,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,SAAS,GACT,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC;AAElC,MAAM,WAAW,gBAAgB;IAC/B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,mBAAmB,CAAC;IAC/B,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CA+B5C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,7 +1,12 @@
1
- import { FC, PropsWithChildren } from 'react';
2
- interface Props extends PropsWithChildren {
1
+ import { FC } from 'react';
2
+ import { TunnelChildren } from '../TunnelState';
3
+ export type TunnelExitChildren = TunnelChildren;
4
+ export interface TunnelExitProps {
3
5
  id?: string;
6
+ /** Select a dedicated tunnel provider by ID. */
7
+ providerId?: string;
8
+ children?: TunnelExitChildren;
4
9
  }
5
- export declare const TunnelExit: FC<Props>;
10
+ export declare const TunnelExit: FC<TunnelExitProps>;
6
11
  export default TunnelExit;
7
12
  //# sourceMappingURL=TunnelExit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TunnelExit.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelExit.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAOnD,UAAU,KAAM,SAAQ,iBAAiB;IACvC,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAOD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,KAAK,CAU/B,CAAC;AAEH,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"TunnelExit.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelExit.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAOD,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAmBzC,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -1,4 +1,11 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
- export declare const TunnelProvider: FC<PropsWithChildren>;
2
+ export interface TunnelProviderProps extends PropsWithChildren {
3
+ /**
4
+ * Dedicated id for this tunnel provider. If not provided, the tunnel provider
5
+ * will be registered as a global provider.
6
+ */
7
+ id?: string;
8
+ }
9
+ export declare const TunnelProvider: FC<TunnelProviderProps>;
3
10
  export default TunnelProvider;
4
11
  //# sourceMappingURL=TunnelProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TunnelProvider.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAKnD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,iBAAiB,CAQhD,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"TunnelProvider.d.ts","sourceRoot":"","sources":["../../../src/components/TunnelProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,EAAE,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIpE,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAgBlD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -1,4 +1,9 @@
1
1
  import { TunnelState } from './TunnelState';
2
- export declare const tunnelContext: import('react').Context<TunnelState>;
2
+ interface TunnelContext {
3
+ state: TunnelState;
4
+ parentContext?: TunnelContext;
5
+ }
6
+ export declare const tunnelContext: import('react').Context<TunnelContext>;
3
7
  export default tunnelContext;
8
+ export declare const useTunnelState: (id?: string) => TunnelState;
4
9
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,eAAO,MAAM,aAAa,sCAAgD,CAAC;AAE3E,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,WAAW,EAAE,MAAM,eAAe,CAAC;AAErE,UAAU,aAAa;IACrB,KAAK,EAAE,WAAW,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B;AAED,eAAO,MAAM,aAAa,wCAExB,CAAC;AAEH,eAAe,aAAa,CAAC;AAE7B,eAAO,MAAM,cAAc,GAAI,WAA4B,gBAa1D,CAAC"}
@@ -1,4 +1,4 @@
1
- export { TunnelProvider } from './components/TunnelProvider';
2
- export { TunnelEntry } from './components/TunnelEntry';
3
- export { TunnelExit } from './components/TunnelExit';
1
+ export * from './components/TunnelProvider';
2
+ export * from './components/TunnelEntry';
3
+ export * from './components/TunnelExit';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mittwald/react-tunnel",
3
- "version": "0.2.0-alpha.105",
3
+ "version": "0.2.0-alpha.1050",
4
4
  "type": "module",
5
5
  "description": "It's like a Portal – but with React components",
6
6
  "keywords": [
@@ -22,43 +22,43 @@
22
22
  "files": [
23
23
  "dist"
24
24
  ],
25
+ "engines": {
26
+ "node": ">=24.0.0"
27
+ },
25
28
  "scripts": {
26
29
  "build": "vite build --config vite.build.config.ts",
27
30
  "clean": "rimraf dist",
28
- "test": "exit 0",
29
- "test:compile": "tsc --noEmit",
30
- "test:unit": "vitest run"
31
+ "test:browser": "vitest run --project=browser --browser.headless",
32
+ "test:browser:dev": "vitest dev --project=browser",
33
+ "test:compile": "tsc --noEmit"
31
34
  },
32
35
  "dependencies": {
33
- "mobx": "^6.13.6",
34
- "mobx-react-lite": "^4.1.0"
36
+ "mobx": "^6.16.1",
37
+ "mobx-react-lite": "^4.1.1"
35
38
  },
36
39
  "devDependencies": {
37
- "@mittwald/typescript-config": "workspace:*",
38
- "@testing-library/dom": "^10.4.0",
39
- "@testing-library/react": "^16.2.0",
40
- "@types/node": "^22.13.10",
41
- "@types/react": "^19",
42
- "@types/react-dom": "^19",
43
- "@vitejs/plugin-react": "^4.3.4",
44
- "@vitest/coverage-v8": "^3.0.8",
45
- "happy-dom": "^17.4.3",
46
- "nx": "^20.5.0",
47
- "prettier": "^3.5.3",
48
- "react": "^19",
49
- "react-dom": "^19",
50
- "rimraf": "^6.0.1",
51
- "typescript": "^5.8.2",
52
- "vite": "^6.2.1",
53
- "vite-plugin-banner": "^0.8.0",
54
- "vite-plugin-checker": "^0.9.0",
55
- "vite-plugin-dts": "^4.5.3",
56
- "vite-plugin-externalize-deps": "^0.9.0",
57
- "vitest": "^3.0.8"
40
+ "@mittwald/flow-core": "0.2.0-alpha.1050",
41
+ "@mittwald/typescript-config": "0.2.0-alpha.1050",
42
+ "@types/node": "^25.9.3",
43
+ "@types/react": "^19.2",
44
+ "@types/react-dom": "^19.2",
45
+ "@vitejs/plugin-react": "5.2.0",
46
+ "@vitest/browser-playwright": "^4.1.10",
47
+ "@vitest/coverage-v8": "^4.1.10",
48
+ "nx": "^22.7.5",
49
+ "react": "^19.2.0",
50
+ "react-dom": "^19.2.0",
51
+ "rimraf": "^6.1.3",
52
+ "typescript": "^6.0.3",
53
+ "unplugin-dts": "^1.0.3",
54
+ "vite": "^8.2.1",
55
+ "vite-plugin-externalize-deps": "^0.10.0",
56
+ "vitest": "^4.1.10",
57
+ "vitest-browser-react": "^2.2.0"
58
58
  },
59
59
  "peerDependencies": {
60
- "react": "^19",
61
- "react-dom": "^19"
60
+ "react": "^19.2.0",
61
+ "react-dom": "^19.2.0"
62
62
  },
63
- "gitHead": "18d2eabaa72039190af1557993e5bb02386af5b6"
63
+ "gitHead": "471bc6e6d01ecce59c2770ff706265b01633c54c"
64
64
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Tunnel.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Tunnel.test.d.ts","sourceRoot":"","sources":["../../src/Tunnel.test.tsx"],"names":[],"mappings":""}
@@ -1,3 +0,0 @@
1
- import { ReactNode } from 'react';
2
- export type TunnelChildren = ReactNode | undefined | (() => ReactNode | undefined);
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,SAAS,GACT,CAAC,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC"}