one 1.1.485 → 1.1.486
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/cjs/hooks.cjs +8 -5
- package/dist/cjs/hooks.js +7 -6
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/hooks.native.js +7 -6
- package/dist/cjs/hooks.native.js.map +2 -2
- package/dist/cjs/router/Route.cjs +4 -1
- package/dist/cjs/router/Route.js +2 -2
- package/dist/cjs/router/Route.js.map +1 -1
- package/dist/cjs/router/Route.native.js +4 -2
- package/dist/cjs/router/Route.native.js.map +2 -2
- package/dist/cjs/router/RouteInfoContext.cjs +61 -0
- package/dist/cjs/router/RouteInfoContext.js +51 -0
- package/dist/cjs/router/RouteInfoContext.js.map +6 -0
- package/dist/cjs/router/RouteInfoContext.native.js +50 -0
- package/dist/cjs/router/RouteInfoContext.native.js.map +6 -0
- package/dist/esm/hooks.js +9 -7
- package/dist/esm/hooks.js.map +1 -1
- package/dist/esm/hooks.mjs +10 -7
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js +11 -7
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/router/Route.js +2 -1
- package/dist/esm/router/Route.js.map +1 -1
- package/dist/esm/router/Route.mjs +4 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js +4 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/RouteInfoContext.js +38 -0
- package/dist/esm/router/RouteInfoContext.js.map +6 -0
- package/dist/esm/router/RouteInfoContext.mjs +37 -0
- package/dist/esm/router/RouteInfoContext.mjs.map +1 -0
- package/dist/esm/router/RouteInfoContext.native.js +39 -0
- package/dist/esm/router/RouteInfoContext.native.js.map +1 -0
- package/package.json +15 -15
- package/src/hooks.tsx +29 -8
- package/src/router/Route.tsx +7 -2
- package/src/router/RouteInfoContext.tsx +94 -0
- package/types/hooks.d.ts.map +1 -1
- package/types/layouts/Drawer.d.ts +14 -4
- package/types/layouts/Drawer.d.ts.map +1 -1
- package/types/layouts/Stack.d.ts +14 -4
- package/types/layouts/Stack.d.ts.map +1 -1
- package/types/layouts/Tabs.d.ts +14 -4
- package/types/layouts/Tabs.d.ts.map +1 -1
- package/types/router/Route.d.ts.map +1 -1
- package/types/router/RouteInfoContext.d.ts +27 -0
- package/types/router/RouteInfoContext.d.ts.map +1 -0
- package/types/views/Navigator.d.ts +2 -2
- package/types/views/Navigator.d.ts.map +1 -1
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { createContext, useContext } from "react";
|
2
2
|
import { getContextKey } from "./matchers.mjs";
|
3
|
+
import { RouteInfoContextProvider } from "./RouteInfoContext.mjs";
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
4
5
|
const RouteParamsContext = createContext({}),
|
5
6
|
CurrentRouteContext = React.createContext(null);
|
@@ -21,7 +22,9 @@ function Route({
|
|
21
22
|
value: route?.params,
|
22
23
|
children: /* @__PURE__ */jsx(CurrentRouteContext.Provider, {
|
23
24
|
value: node,
|
24
|
-
children
|
25
|
+
children: /* @__PURE__ */jsx(RouteInfoContextProvider, {
|
26
|
+
children
|
27
|
+
})
|
25
28
|
})
|
26
29
|
});
|
27
30
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","createContext","useContext","getContextKey","jsx","RouteParamsContext","CurrentRouteContext","process","env","NODE_ENV","displayName","useRouteNode","useContextKey","node","Error","contextKey","Route","children","route","Provider","value","params"],"sources":["../../../src/router/Route.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,IAASC,aAAA,EAAeC,UAAA,QAAkC;AAGjE,SAASC,aAAA,QAAqB;
|
1
|
+
{"version":3,"names":["React","createContext","useContext","getContextKey","RouteInfoContextProvider","jsx","RouteParamsContext","CurrentRouteContext","process","env","NODE_ENV","displayName","useRouteNode","useContextKey","node","Error","contextKey","Route","children","route","Provider","value","params"],"sources":["../../../src/router/Route.tsx"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,KAAA,IAASC,aAAA,EAAeC,UAAA,QAAkC;AAGjE,SAASC,aAAA,QAAqB;AAC9B,SAASC,wBAAA,QAAgC;AAgFjC,SAAAC,GAAA;AApCD,MAAMC,kBAAA,GAAqBL,aAAA,CAEhC,CAAC,CAAC;EAEEM,mBAAA,GAAsBP,KAAA,CAAMC,aAAA,CAAgC,IAAI;AAElEO,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBAC3BH,mBAAA,CAAoBI,WAAA,GAAc;AAI7B,SAASC,aAAA,EAAiC;EAC/C,OAAOV,UAAA,CAAWK,mBAAmB;AACvC;AAEO,SAASM,cAAA,EAAwB;EACtC,MAAMC,IAAA,GAAOF,YAAA,CAAa;EAC1B,IAAIE,IAAA,IAAQ,MACV,MAAM,IAAIC,KAAA,CAAM,oDAAoD;EAEtE,OAAOZ,aAAA,CAAcW,IAAA,CAAKE,UAAU;AACtC;AAGO,SAASC,MAAM;EACpBC,QAAA;EACAJ,IAAA;EACAK;AACF,GAIG;EACD,OACE,eAAAd,GAAA,CAACC,kBAAA,CAAmBc,QAAA,EAAnB;IAA4BC,KAAA,EAAOF,KAAA,EAAOG,MAAA;IACzCJ,QAAA,iBAAAb,GAAA,CAACE,mBAAA,CAAoBa,QAAA,EAApB;MAA6BC,KAAA,EAAOP,IAAA;MACnCI,QAAA,iBAAAb,GAAA,CAACD,wBAAA;QAA0Bc;MAAA,CAAS;IAAA,CACtC;EAAA,CACF;AAEJ","ignoreList":[]}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
2
|
import React, { createContext, useContext } from "react";
|
3
3
|
import { getContextKey } from "./matchers.native.js";
|
4
|
+
import { RouteInfoContextProvider } from "./RouteInfoContext.native.js";
|
4
5
|
var RouteParamsContext = /* @__PURE__ */createContext({}),
|
5
6
|
CurrentRouteContext = /* @__PURE__ */React.createContext(null);
|
6
7
|
process.env.NODE_ENV !== "production" && (CurrentRouteContext.displayName = "RouteNode");
|
@@ -22,7 +23,9 @@ function Route(param) {
|
|
22
23
|
value: route?.params,
|
23
24
|
children: /* @__PURE__ */_jsx(CurrentRouteContext.Provider, {
|
24
25
|
value: node,
|
25
|
-
children
|
26
|
+
children: /* @__PURE__ */_jsx(RouteInfoContextProvider, {
|
27
|
+
children
|
28
|
+
})
|
26
29
|
})
|
27
30
|
});
|
28
31
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","React","createContext","useContext","getContextKey","RouteParamsContext","CurrentRouteContext","process","env","NODE_ENV","displayName","useRouteNode","useContextKey","node","Error","contextKey","Route","param","children","route","Provider","value","params"],"sources":["../../../src/router/Route.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAOA,GAAA,IAASC,IAAA,2BAAe;AAG/B,OAAAC,KAAS,IAAAC,aAAA,EAAqBC,UAAA;
|
1
|
+
{"version":3,"names":["jsx","_jsx","React","createContext","useContext","getContextKey","RouteInfoContextProvider","RouteParamsContext","CurrentRouteContext","process","env","NODE_ENV","displayName","useRouteNode","useContextKey","node","Error","contextKey","Route","param","children","route","Provider","value","params"],"sources":["../../../src/router/Route.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAAOA,GAAA,IAASC,IAAA,2BAAe;AAG/B,OAAAC,KAAS,IAAAC,aAAA,EAAqBC,UAAA;AAC9B,SAASC,aAAA,8BAAgC;AAgFjC,SAAAC,wBAAA;AApCD,IAAAC,kBAAM,kBAEXJ,aAEI;EAAAK,mBAA4B,kBAAoCN,KAAA,CAAAC,aAAA;AAElEM,OAAA,CAAQC,GAAA,CAAIC,QAAA,KAAa,iBAC3BH,mBAAA,CAAoBI,WAAA,GAAc;AAI7B,SAASC,aAAA,EAAiC;EAC/C,OAAOT,UAAA,CAAWI,mBAAmB;AACvC;AAEO,SAASM,cAAA,EAAwB;EACtC,IAAAC,IAAM,GAAAF,YAAO;EACb,IAAIE,IAAA,IAAQ,MACV,MAAM,IAAIC,KAAA,CAAM,oDAAoD;EAEtE,OAAOX,aAAA,CAAcU,IAAA,CAAKE,UAAU;AACtC;AAGO,SAASC,MAAMC,KAAA;EACpB;IAAAC,QAAA;IAAAL,IAAA;IAAAM;EAAA,IAAAF,KAAA;EACA,sBAAAlB,IAAA,CAAAM,kBAAA,CAAAe,QAAA;IACAC,KAAA,EAAAF,KAAA,EAAAG,MAAA;IAKCJ,QAAA,iBAAAnB,IAAA,CAAAO,mBAAA,CAAAc,QAAA;MACDC,KACE,EAAAR,IAAA;MAMJK,QAAA,iBAAAnB,IAAA,CAAAK,wBAAA","ignoreList":[]}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { createContext, useRef } from "react";
|
2
|
+
import { useStateForPath } from "@react-navigation/core";
|
3
|
+
import { getRouteInfo } from "./router";
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
5
|
+
const RouteInfoContext = createContext(void 0);
|
6
|
+
function RouteInfoContextProvider({ children }) {
|
7
|
+
const currentState = useStateForPath(), currentStateRef = useRef(void 0), lastStateRef = useRef(void 0), cachedRouteInfoValueRef = useRef(void 0), lazilyCalculatedRouteInfo = useRef();
|
8
|
+
return currentState && currentStateRef.current !== currentState && (lazilyCalculatedRouteInfo.current = makeLazilyCalculatedRouteInfo({
|
9
|
+
currentStateRef,
|
10
|
+
lastStateRef,
|
11
|
+
cachedRouteInfoValueRef
|
12
|
+
})), currentStateRef.current = currentState, /* @__PURE__ */ jsx(
|
13
|
+
RouteInfoContext.Provider,
|
14
|
+
{
|
15
|
+
value: currentState ? lazilyCalculatedRouteInfo.current : void 0,
|
16
|
+
children
|
17
|
+
}
|
18
|
+
);
|
19
|
+
}
|
20
|
+
function makeLazilyCalculatedRouteInfo({
|
21
|
+
currentStateRef,
|
22
|
+
lastStateRef,
|
23
|
+
cachedRouteInfoValueRef
|
24
|
+
}) {
|
25
|
+
return new Proxy({}, {
|
26
|
+
get(_, p) {
|
27
|
+
const state = currentStateRef.current;
|
28
|
+
if (!state)
|
29
|
+
throw new Error("[lazilyCalculatedRouteInfo] cannot get state");
|
30
|
+
return (!cachedRouteInfoValueRef.current || lastStateRef.current !== state) && (cachedRouteInfoValueRef.current = getRouteInfo(state), lastStateRef.current = state), cachedRouteInfoValueRef.current[p];
|
31
|
+
}
|
32
|
+
});
|
33
|
+
}
|
34
|
+
export {
|
35
|
+
RouteInfoContext,
|
36
|
+
RouteInfoContextProvider
|
37
|
+
};
|
38
|
+
//# sourceMappingURL=RouteInfoContext.js.map
|
@@ -0,0 +1,6 @@
|
|
1
|
+
{
|
2
|
+
"version": 3,
|
3
|
+
"sources": ["../../../src/router/RouteInfoContext.tsx"],
|
4
|
+
"mappings": "AACA,SAAS,eAAe,cAAc;AAEtC,SAAS,uBAAuB;AAChC,SAAS,oBAAoB;AAsDzB;AApDG,MAAM,mBAAmB,cAAqC,MAAS;AAsBvE,SAAS,yBAAyB,EAAE,SAAS,GAAkC;AACpF,QAAM,eAAe,gBAAgB,GAO/B,kBAAkB,OAA4B,MAAS,GAOvD,eAAe,OAA4B,MAAS,GACpD,0BAA0B,OAA8B,MAAS,GAEjE,4BAA4B,OAA8B;AAEhE,SAAI,gBAAgB,gBAAgB,YAAY,iBAC9C,0BAA0B,UAAU,8BAA8B;AAAA,IAChE;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC,IAEH,gBAAgB,UAAU,cAGxB;AAAA,IAAC,iBAAiB;AAAA,IAAjB;AAAA,MACC,OAAO,eAAe,0BAA0B,UAAU;AAAA,MAEzD;AAAA;AAAA,EACH;AAEJ;AAEA,SAAS,8BAA8B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,SAAO,IAAI,MAAM,CAAC,GAAU;AAAA,IAC1B,IAAI,GAAG,GAAoB;AACzB,YAAM,QAAQ,gBAAgB;AAC9B,UAAI,CAAC;AAGH,cAAM,IAAI,MAAM,8CAA8C;AAIhE,cAAI,CAAC,wBAAwB,WAAW,aAAa,YAAY,WAC/D,wBAAwB,UAAU,aAAa,KAAK,GACpD,aAAa,UAAU,QAGlB,wBAAwB,QAAS,CAAC;AAAA,IAC3C;AAAA,EACF,CAAC;AACH;",
|
5
|
+
"names": []
|
6
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { createContext, useRef } from "react";
|
2
|
+
import { useStateForPath } from "@react-navigation/core";
|
3
|
+
import { getRouteInfo } from "./router.mjs";
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
5
|
+
const RouteInfoContext = createContext(void 0);
|
6
|
+
function RouteInfoContextProvider({
|
7
|
+
children
|
8
|
+
}) {
|
9
|
+
const currentState = useStateForPath(),
|
10
|
+
currentStateRef = useRef(void 0),
|
11
|
+
lastStateRef = useRef(void 0),
|
12
|
+
cachedRouteInfoValueRef = useRef(void 0),
|
13
|
+
lazilyCalculatedRouteInfo = useRef();
|
14
|
+
return currentState && currentStateRef.current !== currentState && (lazilyCalculatedRouteInfo.current = makeLazilyCalculatedRouteInfo({
|
15
|
+
currentStateRef,
|
16
|
+
lastStateRef,
|
17
|
+
cachedRouteInfoValueRef
|
18
|
+
})), currentStateRef.current = currentState, /* @__PURE__ */jsx(RouteInfoContext.Provider, {
|
19
|
+
value: currentState ? lazilyCalculatedRouteInfo.current : void 0,
|
20
|
+
children
|
21
|
+
});
|
22
|
+
}
|
23
|
+
function makeLazilyCalculatedRouteInfo({
|
24
|
+
currentStateRef,
|
25
|
+
lastStateRef,
|
26
|
+
cachedRouteInfoValueRef
|
27
|
+
}) {
|
28
|
+
return new Proxy({}, {
|
29
|
+
get(_, p) {
|
30
|
+
const state = currentStateRef.current;
|
31
|
+
if (!state) throw new Error("[lazilyCalculatedRouteInfo] cannot get state");
|
32
|
+
return (!cachedRouteInfoValueRef.current || lastStateRef.current !== state) && (cachedRouteInfoValueRef.current = getRouteInfo(state), lastStateRef.current = state), cachedRouteInfoValueRef.current[p];
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
export { RouteInfoContext, RouteInfoContextProvider };
|
37
|
+
//# sourceMappingURL=RouteInfoContext.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["createContext","useRef","useStateForPath","getRouteInfo","jsx","RouteInfoContext","RouteInfoContextProvider","children","currentState","currentStateRef","lastStateRef","cachedRouteInfoValueRef","lazilyCalculatedRouteInfo","current","makeLazilyCalculatedRouteInfo","Provider","value","Proxy","get","_","p","state","Error"],"sources":["../../../src/router/RouteInfoContext.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,aAAA,EAAeC,MAAA,QAAc;AAEtC,SAASC,eAAA,QAAuB;AAChC,SAASC,YAAA,QAAoB;AAsDzB,SAAAC,GAAA;AApDG,MAAMC,gBAAA,GAAmBL,aAAA,CAAqC,MAAS;AAsBvE,SAASM,yBAAyB;EAAEC;AAAS,GAAkC;EACpF,MAAMC,YAAA,GAAeN,eAAA,CAAgB;IAO/BO,eAAA,GAAkBR,MAAA,CAA4B,MAAS;IAOvDS,YAAA,GAAeT,MAAA,CAA4B,MAAS;IACpDU,uBAAA,GAA0BV,MAAA,CAA8B,MAAS;IAEjEW,yBAAA,GAA4BX,MAAA,CAA8B;EAEhE,OAAIO,YAAA,IAAgBC,eAAA,CAAgBI,OAAA,KAAYL,YAAA,KAC9CI,yBAAA,CAA0BC,OAAA,GAAUC,6BAAA,CAA8B;IAChEL,eAAA;IACAC,YAAA;IACAC;EACF,CAAC,IAEHF,eAAA,CAAgBI,OAAA,GAAUL,YAAA,EAGxB,eAAAJ,GAAA,CAACC,gBAAA,CAAiBU,QAAA,EAAjB;IACCC,KAAA,EAAOR,YAAA,GAAeI,yBAAA,CAA0BC,OAAA,GAAU;IAEzDN;EAAA,CACH;AAEJ;AAEA,SAASO,8BAA8B;EACrCL,eAAA;EACAC,YAAA;EACAC;AACF,GAIG;EACD,OAAO,IAAIM,KAAA,CAAM,CAAC,GAAU;IAC1BC,IAAIC,CAAA,EAAGC,CAAA,EAAoB;MACzB,MAAMC,KAAA,GAAQZ,eAAA,CAAgBI,OAAA;MAC9B,IAAI,CAACQ,KAAA,EAGH,MAAM,IAAIC,KAAA,CAAM,8CAA8C;MAIhE,QAAI,CAACX,uBAAA,CAAwBE,OAAA,IAAWH,YAAA,CAAaG,OAAA,KAAYQ,KAAA,MAC/DV,uBAAA,CAAwBE,OAAA,GAAUV,YAAA,CAAakB,KAAK,GACpDX,YAAA,CAAaG,OAAA,GAAUQ,KAAA,GAGlBV,uBAAA,CAAwBE,OAAA,CAASO,CAAC;IAC3C;EACF,CAAC;AACH","ignoreList":[]}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { createContext, useRef } from "react";
|
3
|
+
import { useStateForPath } from "@react-navigation/core";
|
4
|
+
import { getRouteInfo } from "./router.native.js";
|
5
|
+
var RouteInfoContext = /* @__PURE__ */createContext(void 0);
|
6
|
+
function RouteInfoContextProvider(param) {
|
7
|
+
var {
|
8
|
+
children
|
9
|
+
} = param,
|
10
|
+
currentState = useStateForPath(),
|
11
|
+
currentStateRef = useRef(void 0),
|
12
|
+
lastStateRef = useRef(void 0),
|
13
|
+
cachedRouteInfoValueRef = useRef(void 0),
|
14
|
+
lazilyCalculatedRouteInfo = useRef();
|
15
|
+
return currentState && currentStateRef.current !== currentState && (lazilyCalculatedRouteInfo.current = makeLazilyCalculatedRouteInfo({
|
16
|
+
currentStateRef,
|
17
|
+
lastStateRef,
|
18
|
+
cachedRouteInfoValueRef
|
19
|
+
})), currentStateRef.current = currentState, /* @__PURE__ */_jsx(RouteInfoContext.Provider, {
|
20
|
+
value: currentState ? lazilyCalculatedRouteInfo.current : void 0,
|
21
|
+
children
|
22
|
+
});
|
23
|
+
}
|
24
|
+
function makeLazilyCalculatedRouteInfo(param) {
|
25
|
+
var {
|
26
|
+
currentStateRef,
|
27
|
+
lastStateRef,
|
28
|
+
cachedRouteInfoValueRef
|
29
|
+
} = param;
|
30
|
+
return new Proxy({}, {
|
31
|
+
get(_, p) {
|
32
|
+
var state = currentStateRef.current;
|
33
|
+
if (!state) throw new Error("[lazilyCalculatedRouteInfo] cannot get state");
|
34
|
+
return (!cachedRouteInfoValueRef.current || lastStateRef.current !== state) && (cachedRouteInfoValueRef.current = getRouteInfo(state), lastStateRef.current = state), cachedRouteInfoValueRef.current[p];
|
35
|
+
}
|
36
|
+
});
|
37
|
+
}
|
38
|
+
export { RouteInfoContext, RouteInfoContextProvider };
|
39
|
+
//# sourceMappingURL=RouteInfoContext.native.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","createContext","useRef","useStateForPath","getRouteInfo","RouteInfoContext","RouteInfoContextProvider","param","children","currentState","currentStateRef","lastStateRef","cachedRouteInfoValueRef","lazilyCalculatedRouteInfo","current","makeLazilyCalculatedRouteInfo","Provider","value","Proxy","get","_","p","state","Error"],"sources":["../../../src/router/RouteInfoContext.tsx"],"sourcesContent":[null],"mappings":"AACA,SAASA,GAAA,IAAAC,IAAA,QAAe,mBAAc;AAEtC,SAASC,aAAA,EAAAC,MAAA,QAAuB;AAChC,SAASC,eAAA,QAAoB;AAsDzB,SAAAC,YAAA;AApDG,IAAAC,gBAAM,kBAAwDJ,aAAS;AAsBvE,SAASK,yBAAyBC,KAAE;EACzC;MAAMC;IAAA,IAAAD,KAAe;IAAAE,YAAgB,GAO/BN,eAAA,EAAkB;IAAAO,eAOlB,GAAAR,MAAA,MAAe;IAAAS,YACf,GAAAT,MAAA;IAAAU,uBAEA,GAAAV,MAAA;IAAAW,yBAA0D,GAAAX,MAAA;EAEhE,OAAIO,YAAA,IAAgBC,eAAA,CAAgBI,OAAA,KAAYL,YAAA,KAC9CI,yBAAA,CAA0BC,OAAA,GAAUC,6BAAA,CAA8B;IAChEL,eAAA;IACAC,YAAA;IACAC;EACF,CAAC,IAEHF,eAAA,CAAgBI,OAAA,GAAUL,YAAA,EAGxB,eAAAT,IAAA,CAAAK,gBAAA,CAAAW,QAAA;IAACC,KAAA,EAAAR,YAAiB,GAAAI,yBAAA,CAAAC,OAAA;IAAjBN;EAAA;AAC2D;AAEzD,SAAAO,8BAAAR,KAAA;EACH;IAAAG,eAAA;IAAAC,YAAA;IAAAC;EAAA,IAAAL,KAAA;EAEJ,WAAAW,KAAA;IAEAC,IAAAC,CAAS,EAAAC,CAAA;MACP,IAAAC,KAAA,GAAAZ,eAAA,CAAAI,OAAA;MACA,KAAAQ,KAAA,EACA,UAAAC,KAAA;MAKC,SAAAX,uBAAA,CAAAE,OAAA,IAAAH,YAAA,CAAAG,OAAA,KAAAQ,KAAA,MAAAV,uBAAA,CAAAE,OAAA,GAAAV,YAAA,CAAAkB,KAAA,GAAAX,YAAA,CAAAG,OAAA,GAAAQ,KAAA,GAAAV,uBAAA,CAAAE,OAAA,CAAAO,CAAA;IACD;EAA4B,EAC1B;AACE;AACA,SAGEhB,gBAAU,EAIZC,wBAAK","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "one",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.486",
|
4
4
|
"license": "BSD-3-Clause",
|
5
5
|
"sideEffects": [
|
6
6
|
"setup.mjs",
|
@@ -87,24 +87,24 @@
|
|
87
87
|
"@babel/types": "^7.26.10",
|
88
88
|
"@radix-ui/react-slot": "^1.0.2",
|
89
89
|
"@react-native-masked-view/masked-view": "^0.3.1",
|
90
|
-
"@react-navigation/bottom-tabs": "~7",
|
91
|
-
"@react-navigation/core": "~7",
|
92
|
-
"@react-navigation/drawer": "~7",
|
93
|
-
"@react-navigation/elements": "~2",
|
94
|
-
"@react-navigation/native": "~7",
|
95
|
-
"@react-navigation/native-stack": "~7",
|
96
|
-
"@react-navigation/routers": "~7",
|
90
|
+
"@react-navigation/bottom-tabs": "~7.3.4",
|
91
|
+
"@react-navigation/core": "~7.8.0",
|
92
|
+
"@react-navigation/drawer": "~7.3.3",
|
93
|
+
"@react-navigation/elements": "~2.3.2",
|
94
|
+
"@react-navigation/native": "~7.1.0",
|
95
|
+
"@react-navigation/native-stack": "~7.3.4",
|
96
|
+
"@react-navigation/routers": "~7.3.2",
|
97
97
|
"@swc/core": "^1.10.4",
|
98
98
|
"@ungap/structured-clone": "^1.2.0",
|
99
|
-
"@vxrn/compiler": "1.1.
|
100
|
-
"@vxrn/resolve": "1.1.
|
101
|
-
"@vxrn/tslib-lite": "1.1.
|
102
|
-
"@vxrn/universal-color-scheme": "1.1.
|
103
|
-
"@vxrn/use-isomorphic-layout-effect": "1.1.
|
99
|
+
"@vxrn/compiler": "1.1.486",
|
100
|
+
"@vxrn/resolve": "1.1.486",
|
101
|
+
"@vxrn/tslib-lite": "1.1.486",
|
102
|
+
"@vxrn/universal-color-scheme": "1.1.486",
|
103
|
+
"@vxrn/use-isomorphic-layout-effect": "1.1.486",
|
104
104
|
"babel-dead-code-elimination": "^1.0.9",
|
105
105
|
"citty": "^0.1.6",
|
106
106
|
"core-js": "^3.38.1",
|
107
|
-
"create-vxrn": "1.1.
|
107
|
+
"create-vxrn": "1.1.486",
|
108
108
|
"escape-string-regexp": "^5.0.0",
|
109
109
|
"expo-linking": "~6.3.1",
|
110
110
|
"expo-modules-core": "2.1.2",
|
@@ -130,7 +130,7 @@
|
|
130
130
|
"vite": "^6.1.0",
|
131
131
|
"vite-plugin-barrel": "^0.4.1",
|
132
132
|
"vite-tsconfig-paths": "^5.0.1",
|
133
|
-
"vxrn": "1.1.
|
133
|
+
"vxrn": "1.1.486",
|
134
134
|
"ws": "^8.18.0",
|
135
135
|
"xxhashjs": "^0.2.2"
|
136
136
|
},
|
package/src/hooks.tsx
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
import React, { createContext, type ReactNode } from 'react'
|
1
|
+
import React, { createContext, useContext, type ReactNode } from 'react'
|
2
2
|
import type { OneRouter } from './interfaces/router'
|
3
3
|
import { router } from './router/imperative-api'
|
4
|
-
import { RouteParamsContext } from './router/Route'
|
4
|
+
import { RouteParamsContext, useRouteNode } from './router/Route'
|
5
5
|
import { navigationRef, useStoreRootState, useStoreRouteInfo } from './router/router'
|
6
|
+
import { RouteInfoContext } from './router/RouteInfoContext'
|
6
7
|
|
7
8
|
type SearchParams = OneRouter.SearchParams
|
8
9
|
|
@@ -11,7 +12,25 @@ export function useRootNavigationState() {
|
|
11
12
|
}
|
12
13
|
|
13
14
|
export function useRouteInfo() {
|
14
|
-
|
15
|
+
// This uses the `useStateForPath` hook under the hood, which will be always correct
|
16
|
+
// when used in a page, but will not be correct when used in a layout.
|
17
|
+
// See the comment in `RouteInfoContext` for more details.
|
18
|
+
const routeInfoFromContext = useContext(RouteInfoContext)
|
19
|
+
|
20
|
+
// This uses `navigationRef.getRootState()` under the hood, which has the
|
21
|
+
// issue of returning an incomplete state during the first render of nested navigators.
|
22
|
+
// See: https://github.com/react-navigation/react-navigation/pull/12521#issue-2958644406
|
23
|
+
const routeInfoFromRootState = useStoreRouteInfo()
|
24
|
+
|
25
|
+
const routeNode = useRouteNode()
|
26
|
+
|
27
|
+
if (routeNode?.type === 'layout') {
|
28
|
+
// We are in a layout, do not consider using `RouteInfoContextProvider`.
|
29
|
+
return routeInfoFromRootState
|
30
|
+
}
|
31
|
+
|
32
|
+
// We are in a page, prioritize `routeInfoFromContext` over `routeInfoFromRootState` because it is more accurate.
|
33
|
+
return routeInfoFromContext || routeInfoFromRootState
|
15
34
|
}
|
16
35
|
|
17
36
|
/** @return the root `<NavigationContainer />` ref for the app. The `ref.current` may be `null` if the `<NavigationContainer />` hasn't mounted yet. */
|
@@ -57,7 +76,7 @@ export function useRouter(): OneRouter.Router {
|
|
57
76
|
* @returns the current global pathname with query params attached. This may change in the future to include the hostname from a predefined universal link, i.e. `/foobar?hey=world` becomes `https://acme.dev/foobar?hey=world`
|
58
77
|
*/
|
59
78
|
export function useUnstableGlobalHref(): string {
|
60
|
-
return
|
79
|
+
return useRouteInfo().unstable_globalHref
|
61
80
|
}
|
62
81
|
|
63
82
|
/**
|
@@ -80,12 +99,12 @@ export function useUnstableGlobalHref(): string {
|
|
80
99
|
* ```
|
81
100
|
*/
|
82
101
|
export function useSegments<TSegments extends string[] = string[]>(): TSegments {
|
83
|
-
return
|
102
|
+
return useRouteInfo().segments as TSegments
|
84
103
|
}
|
85
104
|
|
86
105
|
/** @returns global selected pathname without query parameters. */
|
87
106
|
export function usePathname(): string {
|
88
|
-
return
|
107
|
+
return useRouteInfo().pathname
|
89
108
|
}
|
90
109
|
|
91
110
|
/**
|
@@ -97,8 +116,10 @@ export function usePathname(): string {
|
|
97
116
|
*
|
98
117
|
* @see `useParams`
|
99
118
|
*/
|
100
|
-
export function useActiveParams<
|
101
|
-
|
119
|
+
export function useActiveParams<
|
120
|
+
TParams extends Object = SearchParams
|
121
|
+
>(): Partial<TParams> {
|
122
|
+
return useRouteInfo().params as Partial<TParams>
|
102
123
|
}
|
103
124
|
|
104
125
|
/** @deprecated @see `useParams` */
|
package/src/router/Route.tsx
CHANGED
@@ -2,6 +2,7 @@ import React, { createContext, useContext, type ReactNode } from 'react'
|
|
2
2
|
import type { ErrorBoundaryProps } from '../views/Try'
|
3
3
|
import type { One } from '../vite/types'
|
4
4
|
import { getContextKey } from './matchers'
|
5
|
+
import { RouteInfoContextProvider } from './RouteInfoContext'
|
5
6
|
|
6
7
|
export type DynamicConvention = { name: string; deep: boolean; notFound?: boolean }
|
7
8
|
|
@@ -45,7 +46,9 @@ export type RouteNode = {
|
|
45
46
|
middlewares?: RouteNode[]
|
46
47
|
}
|
47
48
|
|
48
|
-
export const RouteParamsContext = createContext<
|
49
|
+
export const RouteParamsContext = createContext<
|
50
|
+
Record<string, string | undefined> | undefined
|
51
|
+
>({})
|
49
52
|
|
50
53
|
const CurrentRouteContext = React.createContext<RouteNode | null>(null)
|
51
54
|
|
@@ -78,7 +81,9 @@ export function Route({
|
|
78
81
|
}) {
|
79
82
|
return (
|
80
83
|
<RouteParamsContext.Provider value={route?.params}>
|
81
|
-
<CurrentRouteContext.Provider value={node}>
|
84
|
+
<CurrentRouteContext.Provider value={node}>
|
85
|
+
<RouteInfoContextProvider>{children}</RouteInfoContextProvider>
|
86
|
+
</CurrentRouteContext.Provider>
|
82
87
|
</RouteParamsContext.Provider>
|
83
88
|
)
|
84
89
|
}
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import type React from 'react'
|
2
|
+
import { createContext, useRef } from 'react'
|
3
|
+
import type { UrlObject } from './getNormalizedStatePath'
|
4
|
+
import { useStateForPath } from '@react-navigation/core'
|
5
|
+
import { getRouteInfo } from './router'
|
6
|
+
|
7
|
+
export const RouteInfoContext = createContext<UrlObject | undefined>(undefined)
|
8
|
+
|
9
|
+
/**
|
10
|
+
* Provides the route info (a `UrlObject`) through a context for child page.
|
11
|
+
* Such context can be used to implement hooks such as `usePathname`.
|
12
|
+
*
|
13
|
+
* **IMPORTANT**: The current implementation uses `useStateForPath` - which will not return the a complete state if it isn't being called from a component under a leaf route node.
|
14
|
+
* In other words, the provided route info may not be correct when used in a `_layout`. For example, if the user is on a page `/blog/123`:
|
15
|
+
*
|
16
|
+
* ```
|
17
|
+
* app
|
18
|
+
* ├── _layout.tsx
|
19
|
+
* ├── index.tsx
|
20
|
+
* └── blog
|
21
|
+
* ├── _layout.tsx - in BlogLayout, pathname will be "/blog"
|
22
|
+
* └── [id].tsx - in BlogPage, pathname will be "/blog/123"
|
23
|
+
* ```
|
24
|
+
*
|
25
|
+
* The returned value is lazily calculated and cached, so we won't waste CPU cycles to calculate it if no one is asking for it.
|
26
|
+
*
|
27
|
+
* This is implemented with the `useStateForPath` hook provided by React Navigation, which is known to be safe for not returning a stale or incomplete state when used in pages. See: https://github.com/react-navigation/react-navigation/pull/12521
|
28
|
+
*/
|
29
|
+
export function RouteInfoContextProvider({ children }: { children: React.ReactNode }) {
|
30
|
+
const currentState = useStateForPath()
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Ref to hold the current state. Do not update it immediately, because we also
|
34
|
+
* rely on this ref to make `lazilyCalculatedRouteInfo` a new object when the
|
35
|
+
* state changes.
|
36
|
+
*/
|
37
|
+
const currentStateRef = useRef<typeof currentState>(undefined)
|
38
|
+
|
39
|
+
/**
|
40
|
+
* This is used by the lazilyCalculatedRouteInfo to determine if it should
|
41
|
+
* update the cached route info. After doing so, lazilyCalculatedRouteInfo
|
42
|
+
* should update it to the current state.
|
43
|
+
*/
|
44
|
+
const lastStateRef = useRef<typeof currentState>(undefined)
|
45
|
+
const cachedRouteInfoValueRef = useRef<UrlObject | undefined>(undefined)
|
46
|
+
|
47
|
+
const lazilyCalculatedRouteInfo = useRef<UrlObject | undefined>()
|
48
|
+
|
49
|
+
if (currentState && currentStateRef.current !== currentState) {
|
50
|
+
lazilyCalculatedRouteInfo.current = makeLazilyCalculatedRouteInfo({
|
51
|
+
currentStateRef,
|
52
|
+
lastStateRef,
|
53
|
+
cachedRouteInfoValueRef,
|
54
|
+
})
|
55
|
+
}
|
56
|
+
currentStateRef.current = currentState
|
57
|
+
|
58
|
+
return (
|
59
|
+
<RouteInfoContext.Provider
|
60
|
+
value={currentState ? lazilyCalculatedRouteInfo.current : undefined}
|
61
|
+
>
|
62
|
+
{children}
|
63
|
+
</RouteInfoContext.Provider>
|
64
|
+
)
|
65
|
+
}
|
66
|
+
|
67
|
+
function makeLazilyCalculatedRouteInfo({
|
68
|
+
currentStateRef,
|
69
|
+
lastStateRef,
|
70
|
+
cachedRouteInfoValueRef,
|
71
|
+
}: {
|
72
|
+
currentStateRef: React.MutableRefObject<ReturnType<typeof useStateForPath> | undefined>
|
73
|
+
lastStateRef: React.MutableRefObject<ReturnType<typeof useStateForPath> | undefined>
|
74
|
+
cachedRouteInfoValueRef: React.MutableRefObject<UrlObject | undefined>
|
75
|
+
}) {
|
76
|
+
return new Proxy({} as any, {
|
77
|
+
get(_, p: keyof UrlObject) {
|
78
|
+
const state = currentStateRef.current
|
79
|
+
if (!state) {
|
80
|
+
// This should not happen because in the `RouteInfoContext.Provider` we
|
81
|
+
// should only provide lazilyCalculatedRouteInfo if state is not undefined.
|
82
|
+
throw new Error('[lazilyCalculatedRouteInfo] cannot get state')
|
83
|
+
}
|
84
|
+
|
85
|
+
// Update the cached route info if it's outdated
|
86
|
+
if (!cachedRouteInfoValueRef.current || lastStateRef.current !== state) {
|
87
|
+
cachedRouteInfoValueRef.current = getRouteInfo(state)
|
88
|
+
lastStateRef.current = state
|
89
|
+
}
|
90
|
+
|
91
|
+
return cachedRouteInfoValueRef.current![p]
|
92
|
+
},
|
93
|
+
})
|
94
|
+
}
|
package/types/hooks.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAMpD,KAAK,YAAY,GAAG,SAAS,CAAC,YAAY,CAAA;AAE1C,wBAAgB,sBAAsB,0BAErC;AAED,wBAAgB,YAAY,wDAoB3B;AAED,uJAAuJ;AACvJ,wBAAgB,yBAAyB,4BAExC;AAID,wBAAgB,MAAM,CAAC,EAAE,EAAU,EAAE,QAAQ,EAAE,EAAE;IAAE,EAAE,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,sHAyBrF;AAED,wBAAgB,SAAS,IAAI,SAAS,CAAC,MAAM,CAE5C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,SAAS,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,SAAS,CAE9E;AAED,kEAAkE;AAClE,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,OAAO,SAAS,MAAM,GAAG,YAAY,KAClC,OAAO,CAAC,OAAO,CAAC,CAEpB;AAED,mCAAmC;AACnC,eAAO,MAAM,oBAAoB,kBAAY,CAAA;AAE7C,yCAAyC;AACzC,eAAO,MAAM,qBAAqB,wBAAkB,CAAA;AAEpD;;;;;GAKG;AAEH,wBAAgB,SAAS,CAAC,OAAO,SAAS,MAAM,GAAG,YAAY,KAAK,OAAO,CAAC,OAAO,CAAC,CAwBnF"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type DrawerNavigationOptions, type DrawerNavigationEventMap } from '@react-navigation/drawer';
|
2
2
|
import type { DrawerNavigationState, ParamListBase } from '@react-navigation/native';
|
3
|
-
export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "
|
3
|
+
export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
4
4
|
children: React.ReactNode;
|
5
5
|
layout?: ((props: {
|
6
6
|
state: DrawerNavigationState<ParamListBase>;
|
@@ -45,10 +45,15 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
45
45
|
theme: ReactNavigation.Theme;
|
46
46
|
children: React.ReactElement;
|
47
47
|
}) => React.ReactElement) | undefined;
|
48
|
-
|
48
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
49
|
+
type: string;
|
50
|
+
payload?: object;
|
51
|
+
source?: string;
|
52
|
+
target?: string;
|
53
|
+
}>>(original: import("@react-navigation/routers").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
|
49
54
|
} & {
|
50
55
|
id?: undefined;
|
51
|
-
}, "children"> & Partial<Pick<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "
|
56
|
+
}, "children"> & Partial<Pick<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
52
57
|
children: React.ReactNode;
|
53
58
|
layout?: ((props: {
|
54
59
|
state: DrawerNavigationState<ParamListBase>;
|
@@ -93,7 +98,12 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
93
98
|
theme: ReactNavigation.Theme;
|
94
99
|
children: React.ReactElement;
|
95
100
|
}) => React.ReactElement) | undefined;
|
96
|
-
|
101
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
102
|
+
type: string;
|
103
|
+
payload?: object;
|
104
|
+
source?: string;
|
105
|
+
target?: string;
|
106
|
+
}>>(original: import("@react-navigation/routers").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
|
97
107
|
} & {
|
98
108
|
id?: undefined;
|
99
109
|
}, "children">> & import("react").RefAttributes<unknown>> & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAMpF,eAAO,MAAM,MAAM;
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC9B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAMpF,eAAO,MAAM,MAAM;cAQ2Q,MAAO,SAAS;;;;;kBAAmb,MAAO,SAAS;UAAW,MAAO,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAod,gBAAiB,KAAK;;;;;eAAiO,gBAAiB,KAAK;kBAAmB,MAAO,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;cAAtxC,MAAO,SAAS;;;;;kBAAmb,MAAO,SAAS;UAAW,MAAO,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAAod,gBAAiB,KAAK;;;;;eAAiO,gBAAiB,KAAK;kBAAmB,MAAO,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;;CAHliD,CAAA;AAElB,eAAe,MAAM,CAAA"}
|
package/types/layouts/Stack.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ParamListBase, StackNavigationState } from '@react-navigation/native';
|
2
2
|
import { type NativeStackNavigationEventMap, type NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
3
|
-
export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "
|
3
|
+
export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
4
4
|
children: React.ReactNode;
|
5
5
|
layout?: ((props: {
|
6
6
|
state: StackNavigationState<ParamListBase>;
|
@@ -41,10 +41,15 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
41
41
|
theme: ReactNavigation.Theme;
|
42
42
|
children: React.ReactElement;
|
43
43
|
}) => React.ReactElement) | undefined;
|
44
|
-
|
44
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
45
|
+
type: string;
|
46
|
+
payload?: object;
|
47
|
+
source?: string;
|
48
|
+
target?: string;
|
49
|
+
}>>(original: import("@react-navigation/routers").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
|
45
50
|
} & {
|
46
51
|
id?: undefined;
|
47
|
-
}, "children"> & Partial<Pick<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "
|
52
|
+
}, "children"> & Partial<Pick<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
48
53
|
children: React.ReactNode;
|
49
54
|
layout?: ((props: {
|
50
55
|
state: StackNavigationState<ParamListBase>;
|
@@ -85,7 +90,12 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
85
90
|
theme: ReactNavigation.Theme;
|
86
91
|
children: React.ReactElement;
|
87
92
|
}) => React.ReactElement) | undefined;
|
88
|
-
|
93
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
94
|
+
type: string;
|
95
|
+
payload?: object;
|
96
|
+
source?: string;
|
97
|
+
target?: string;
|
98
|
+
}>>(original: import("@react-navigation/routers").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
|
89
99
|
} & {
|
90
100
|
id?: undefined;
|
91
101
|
}, "children">> & import("react").RefAttributes<unknown>> & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACnF,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAElC,MAAM,gCAAgC,CAAA;AAMvC,eAAO,MAAM,KAAK;
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACnF,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAElC,MAAM,gCAAgC,CAAA;AAMvC,eAAO,MAAM,KAAK;cAQ6N,MAAO,SAAS;;;;;kBAAmb,MAAO,SAAS;UAAW,MAAO,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;eAAod,gBAAiB,KAAK;;;;;eAAiO,gBAAiB,KAAK;kBAAmB,MAAO,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;cAAtxC,MAAO,SAAS;;;;;kBAAmb,MAAO,SAAS;UAAW,MAAO,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;eAAod,gBAAiB,KAAK;;;;;eAAiO,gBAAiB,KAAK;kBAAmB,MAAO,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;;CAH9+C,CAAA;AAEvB,eAAe,KAAK,CAAA"}
|
package/types/layouts/Tabs.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { type BottomTabNavigationEventMap, type BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
|
2
2
|
import type { ParamListBase, TabNavigationState } from '@react-navigation/native';
|
3
|
-
export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "
|
3
|
+
export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
4
4
|
children: React.ReactNode;
|
5
5
|
layout?: ((props: {
|
6
6
|
state: TabNavigationState<ParamListBase>;
|
@@ -41,10 +41,15 @@ export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<Omit<i
|
|
41
41
|
theme: ReactNavigation.Theme;
|
42
42
|
children: React.ReactElement;
|
43
43
|
}) => React.ReactElement) | undefined;
|
44
|
-
|
44
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
45
|
+
type: string;
|
46
|
+
payload?: object;
|
47
|
+
source?: string;
|
48
|
+
target?: string;
|
49
|
+
}>>(original: import("@react-navigation/routers").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
|
45
50
|
} & {
|
46
51
|
id?: undefined;
|
47
|
-
}, "children"> & Partial<Pick<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "
|
52
|
+
}, "children"> & Partial<Pick<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "initialRouteName" | "layout" | "id" | "screenOptions" | "screenListeners" | "screenLayout" | "UNSTABLE_router"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
48
53
|
children: React.ReactNode;
|
49
54
|
layout?: ((props: {
|
50
55
|
state: TabNavigationState<ParamListBase>;
|
@@ -85,7 +90,12 @@ export declare const Tabs: import("react").ForwardRefExoticComponent<Omit<Omit<i
|
|
85
90
|
theme: ReactNavigation.Theme;
|
86
91
|
children: React.ReactElement;
|
87
92
|
}) => React.ReactElement) | undefined;
|
88
|
-
|
93
|
+
UNSTABLE_router?: (<Action extends Readonly<{
|
94
|
+
type: string;
|
95
|
+
payload?: object;
|
96
|
+
source?: string;
|
97
|
+
target?: string;
|
98
|
+
}>>(original: import("@react-navigation/routers").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/routers").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
|
89
99
|
} & {
|
90
100
|
id?: undefined;
|
91
101
|
}, "children">> & import("react").RefAttributes<unknown>> & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAGhC,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAoCjF,eAAO,MAAM,IAAI;
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAGhC,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAoCjF,eAAO,MAAM,IAAI;cAtBM,MAAM,SAAS;;;;;kBAmBV,MAG3B,SAAS;UAAW,MAAO,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;eAYsC,gBAAiB,KAAK;;;;;eAU/C,gBAAG,KAAK;kBACN,MAAC,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;cA9CpC,MAAM,SAAS;;;;;kBAmBV,MAG3B,SAAS;UAAW,MAAO,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;eAYsC,gBAAiB,KAAK;;;;;eAU/C,gBAAG,KAAK;kBACN,MAAC,YAAY;UAAW,MAAO,YAAY;;;;;;;;;;;CAmB1D,CAAA;AAED,eAAe,IAAI,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../../src/router/Route.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../../src/router/Route.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA6B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAIxC,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAEnF,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAA;IACvD,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACvC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,GAAG,CAAA;IAClC,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC7B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;KAC3C,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE;QACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAA;KAC3C,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,4BAA4B;IAC5B,IAAI,EAAE,GAAG,CAAC,SAAS,CAAA;IACnB,kEAAkE;IAClE,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;IACrC,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,oBAAoB;IACpB,QAAQ,EAAE,SAAS,EAAE,CAAA;IACrB,kCAAkC;IAClC,OAAO,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAAA;IACnC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAA;IAClB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oLAAoL;IACpL,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,qBAAqB;IACrB,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;IACrB,yBAAyB;IACzB,WAAW,CAAC,EAAE,SAAS,EAAE,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,kBAAkB,+DAE1B,CAAA;AAQL,+DAA+D;AAC/D,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,wBAAgB,aAAa,IAAI,MAAM,CAMtC;AAED,iEAAiE;AACjE,wBAAgB,KAAK,CAAC,EACpB,QAAQ,EACR,IAAI,EACJ,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,SAAS,CAAA;IACnB,IAAI,EAAE,SAAS,CAAA;IACf,KAAK,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;KAAE,CAAA;CACxD,2CAQA"}
|