expo-router 0.0.45 → 1.0.0-rc2
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/build/ContextNavigationContainer.d.ts +1 -1
- package/build/ContextNavigationContainer.d.ts.map +1 -1
- package/build/ContextNavigationContainer.js +7 -1
- package/build/ContextNavigationContainer.js.map +1 -1
- package/build/LocationProvider.d.ts +1 -1
- package/build/LocationProvider.d.ts.map +1 -1
- package/build/Route.d.ts +3 -3
- package/build/Route.d.ts.map +1 -1
- package/build/fork/getPathFromState.d.ts +2 -2
- package/build/fork/getPathFromState.d.ts.map +1 -1
- package/build/fork/getStateFromPath.d.ts +2 -2
- package/build/fork/getStateFromPath.d.ts.map +1 -1
- package/build/getLinkingConfig.d.ts +1 -1
- package/build/getLinkingConfig.d.ts.map +1 -1
- package/build/getRoutes.d.ts +2 -2
- package/build/getRoutes.d.ts.map +1 -1
- package/build/layouts/Drawer.d.ts +2 -22
- package/build/layouts/Drawer.d.ts.map +1 -1
- package/build/layouts/Stack.d.ts +2 -22
- package/build/layouts/Stack.d.ts.map +1 -1
- package/build/layouts/Tabs.d.ts +4 -22
- package/build/layouts/Tabs.d.ts.map +1 -1
- package/build/layouts/Tabs.js +1 -1
- package/build/layouts/Tabs.js.map +1 -1
- package/build/layouts/withLayoutContext.d.ts +1 -1
- package/build/layouts/withLayoutContext.d.ts.map +1 -1
- package/build/link/Link.d.ts +2 -2
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +7 -2
- package/build/link/Link.js.map +1 -1
- package/build/link/href.d.ts +2 -2
- package/build/link/href.d.ts.map +1 -1
- package/build/link/useHref.d.ts +1 -1
- package/build/link/useHref.d.ts.map +1 -1
- package/build/link/useHref.js.map +1 -1
- package/build/link/useLinkToPath.d.ts.map +1 -1
- package/build/link/useLinkToPath.js +1 -1
- package/build/link/useLinkToPath.js.map +1 -1
- package/build/link/useLinkToPathProps.js +1 -1
- package/build/link/useLinkToPathProps.js.map +1 -1
- package/build/link/useLoadedNavigation.d.ts +1 -1
- package/build/link/useLoadedNavigation.d.ts.map +1 -1
- package/build/link/useRouter.d.ts +1 -1
- package/build/link/useRouter.d.ts.map +1 -1
- package/build/link/useRouter.js +1 -1
- package/build/link/useRouter.js.map +1 -1
- package/build/useFocusEffect.d.ts +1 -1
- package/build/useFocusEffect.d.ts.map +1 -1
- package/build/useScreens.d.ts +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/views/ErrorBoundary.d.ts.map +1 -1
- package/build/views/ErrorBoundary.js +1 -1
- package/build/views/ErrorBoundary.js.map +1 -1
- package/build/views/Layout.d.ts +1 -1
- package/build/views/Layout.d.ts.map +1 -1
- package/build/views/Layout.js +1 -1
- package/build/views/Layout.js.map +1 -1
- package/build/views/Screen.d.ts +1 -1
- package/build/views/Screen.d.ts.map +1 -1
- package/build/views/Sitemap.js +1 -3
- package/build/views/Sitemap.js.map +1 -1
- package/build/views/Splash.js +1 -1
- package/build/views/Splash.js.map +1 -1
- package/build/views/Try.d.ts +1 -1
- package/build/views/Try.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NavigationContainer } from "@react-navigation/native";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { useRootNavigation, useRootNavigationState } from "./useRootNavigation";
|
|
4
|
-
|
|
4
|
+
type NavigationContainerProps = React.ComponentProps<typeof NavigationContainer>;
|
|
5
5
|
export declare function useNavigationContainerContext(): [Partial<import("@react-navigation/native").NavigationContainerProps & {
|
|
6
6
|
theme?: import("@react-navigation/native").Theme | undefined;
|
|
7
7
|
linking?: import("@react-navigation/native").LinkingOptions<{}> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextNavigationContainer.d.ts","sourceRoot":"","sources":["../src/ContextNavigationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAEL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAK7B,
|
|
1
|
+
{"version":3,"file":"ContextNavigationContainer.d.ts","sourceRoot":"","sources":["../src/ContextNavigationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAEL,iBAAiB,EACjB,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAK7B,KAAK,wBAAwB,GAAG,KAAK,CAAC,cAAc,CAClD,OAAO,mBAAmB,CAC3B,CAAC;AASF,wBAAgB,6BAA6B;;;;;;;;;;;;;;;;aAQ5C;AAED,8GAA8G;AAC9G,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,wBAAwB,eAkBzE;AAmCD,wBAAgB,aAAa,CAC3B,KAAK,EAAE,IAAI,CACT,wBAAwB,EACxB,aAAa,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,CAC/C,QA6DF;yBAjEe,aAAa"}
|
|
@@ -28,6 +28,7 @@ export function ContextNavigationContainer(props) {
|
|
|
28
28
|
function InternalContextNavigationContainer() {
|
|
29
29
|
const [contextProps] = useNavigationContainerContext();
|
|
30
30
|
const [isReady, setReady] = React.useState(false);
|
|
31
|
+
const [isSplashReady, setSplashReady] = React.useState(false);
|
|
31
32
|
const ref = React.useMemo(() => (isReady ? navigationRef : null), [isReady]);
|
|
32
33
|
const root = useRootRouteNodeContext();
|
|
33
34
|
const linking = React.useMemo(() => getLinkingConfig(root), [root]);
|
|
@@ -35,9 +36,14 @@ function InternalContextNavigationContainer() {
|
|
|
35
36
|
contextProps.onReady?.();
|
|
36
37
|
}, [!!contextProps?.onReady]);
|
|
37
38
|
return (React.createElement(RootNavigationRef.Provider, { value: { ref } },
|
|
38
|
-
!
|
|
39
|
+
!isSplashReady && React.createElement(SplashScreen, null),
|
|
39
40
|
React.createElement(NavigationContainer, { ...contextProps, linking: linking, ref: navigationRef, onReady: () => {
|
|
40
41
|
setReady(true);
|
|
42
|
+
// Allow one cycle for the children to mount a splash screen
|
|
43
|
+
// that will prevent the splash screen from hiding.
|
|
44
|
+
requestAnimationFrame(() => {
|
|
45
|
+
setSplashReady(true);
|
|
46
|
+
});
|
|
41
47
|
} })));
|
|
42
48
|
}
|
|
43
49
|
export function RootContainer(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextNavigationContainer.js","sourceRoot":"","sources":["../src/ContextNavigationContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,aAAa,GAAG,4BAA4B,EAAE,CAAC;AAMrD,MAAM,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAKpD,CAAC,EAAE,EAAE,cAAa,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,UAAU,6BAA6B;IAC3C,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,0BAA0B,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;KACH;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,0BAA0B,CAAC,KAA+B;IACxE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CACtC,EAAE,CACH,CAAC;IAE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MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACtD,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC/B,CAAC;YAEF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC3B,OAAO,CAAC,IAAI,CACV,uDAAuD,YAAY,CAAC,IAAI,CACtE,IAAI,CACL,kFAAkF,CACpF,CAAC;aACH;SACF;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,MAAM,EACJ,aAAa,EACb,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,KAAK,GACN,GAAG,KAAK,CAAC;IACV,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,QAAQ,CAAC;YACP,aAAa;YACb,QAAQ;YACR,OAAO;YACP,YAAY;YACZ,aAAa;YACb,iBAAiB;YACjB,KAAK;SACN,CAAC,CAAC;IACL,CAAC,EAAE;QACD,aAAa;QACb,QAAQ;QACR,OAAO;QACP,YAAY;QACZ,aAAa;QACb,iBAAiB;QACjB,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,aAAa,CAAC,MAAM,GAAG,iBAAiB,CAAC;AACzC,aAAa,CAAC,QAAQ,GAAG,sBAAsB,CAAC;AAEhD,6CAA6C;AAC7C,aAAa,CAAC,MAAM,GAAG,GAAG,EAAE;IAC1B,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC","sourcesContent":["import {\n createNavigationContainerRef,\n NavigationContainer,\n} from \"@react-navigation/native\";\nimport React from \"react\";\n\nimport { useRootRouteNodeContext } from \"./context\";\nimport { getLinkingConfig } from \"./getLinkingConfig\";\nimport {\n RootNavigationRef,\n useRootNavigation,\n useRootNavigationState,\n} from \"./useRootNavigation\";\nimport { SplashScreen } from \"./views/Splash\";\n\nconst navigationRef = createNavigationContainerRef();\n\ntype NavigationContainerProps = React.ComponentProps<\n typeof NavigationContainer\n>;\n\nconst NavigationContainerContext = React.createContext<\n [\n Partial<NavigationContainerProps>,\n (props: Partial<NavigationContainerProps>) => void\n ]\n>([{}, function () {}]);\n\nexport function useNavigationContainerContext() {\n const context = React.useContext(NavigationContainerContext);\n if (!context) {\n throw new Error(\n \"useNavigationContainerContext must be used within a NavigationContainerContext\"\n );\n }\n return context;\n}\n\n/** react-navigation `NavigationContainer` with automatic `linking` prop generated from the routes context. */\nexport function ContextNavigationContainer(props: NavigationContainerProps) {\n const [state, setState] = React.useState<Partial<NavigationContainerProps>>(\n {}\n );\n\n return (\n <NavigationContainerContext.Provider\n value={[\n {\n ...props,\n ...state,\n },\n setState,\n ]}\n >\n <InternalContextNavigationContainer />\n </NavigationContainerContext.Provider>\n );\n}\n\nfunction InternalContextNavigationContainer() {\n const [contextProps] = useNavigationContainerContext();\n const [isReady, setReady] = React.useState(false);\n const [isSplashReady, setSplashReady] = React.useState(false);\n const ref = React.useMemo(() => (isReady ? navigationRef : null), [isReady]);\n const root = useRootRouteNodeContext();\n const linking = React.useMemo(() => getLinkingConfig(root), [root]);\n\n React.useEffect(() => {\n contextProps.onReady?.();\n }, [!!contextProps?.onReady]);\n\n return (\n <RootNavigationRef.Provider value={{ ref }}>\n {!isSplashReady && <SplashScreen />}\n {/* @ts-expect-error: children are required */}\n <NavigationContainer\n {...contextProps}\n linking={linking}\n ref={navigationRef}\n onReady={() => {\n setReady(true);\n // Allow one cycle for the children to mount a splash screen\n // that will prevent the splash screen from hiding.\n requestAnimationFrame(() => {\n setSplashReady(true);\n });\n }}\n />\n </RootNavigationRef.Provider>\n );\n}\n\nexport function RootContainer(\n props: Omit<\n NavigationContainerProps,\n \"independent\" | \"ref\" | \"children\" | \"linking\"\n >\n) {\n const [, setProps] = useNavigationContainerContext();\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== \"production\") {\n const restrictedProps = [\n \"theme\",\n \"fallback\",\n \"independent\",\n \"onReady\",\n \"initialState\",\n \"onStateChange\",\n \"onUnhandledAction\",\n \"children\",\n \"linking\",\n ];\n const invalidProps = Object.keys(props).filter((prop) =>\n restrictedProps.includes(prop)\n );\n\n if (invalidProps.length > 0) {\n console.warn(\n `RootContainer does not support the following props: ${invalidProps.join(\n \", \"\n )}. Learn more: https://expo.github.io/router/docs/features/container#restrictions`\n );\n }\n }\n }, [props]);\n\n const {\n documentTitle,\n fallback,\n onReady,\n initialState,\n onStateChange,\n onUnhandledAction,\n theme,\n } = props;\n React.useEffect(() => {\n setProps({\n documentTitle,\n fallback,\n onReady,\n initialState,\n onStateChange,\n onUnhandledAction,\n theme,\n });\n }, [\n documentTitle,\n fallback,\n onReady,\n initialState,\n onStateChange,\n onUnhandledAction,\n theme,\n ]);\n\n return null;\n}\n\nRootContainer.useRef = useRootNavigation;\nRootContainer.useState = useRootNavigationState;\n\n/** Get the root navigation container ref. */\nRootContainer.getRef = () => {\n return navigationRef;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,
|
|
1
|
+
{"version":3,"file":"LocationProvider.d.ts","sourceRoot":"","sources":["../src/LocationProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AA0I3C,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,eAM3E;AAcD,uLAAuL;AACvL,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,8CAA8C;AAC9C,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED,2CAA2C;AAC3C,wBAAgB,WAAW,IAAI,MAAM,EAAE,CAEtC"}
|
package/build/Route.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
/** The list of input keys will become optional, everything else will remain the same. */
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
|
+
export type DynamicConvention = {
|
|
5
5
|
name: string;
|
|
6
6
|
deep: boolean;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type RouteNode = {
|
|
9
9
|
/** Load a route into memory. Returns the exports from a route. */
|
|
10
10
|
loadRoute: () => any;
|
|
11
11
|
/** Loaded initial route name. */
|
package/build/Route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAKrD,yFAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"Route.d.ts","sourceRoot":"","sources":["../src/Route.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAc,MAAM,OAAO,CAAC;AAKrD,yFAAyF;AACzF,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACxD,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEtB,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG;IACtB,kEAAkE;IAClE,SAAS,EAAE,MAAM,GAAG,CAAC;IAErB,iCAAiC;IACjC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB;IACpB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,kCAAkC;IAClC,OAAO,EAAE,IAAI,GAAG,iBAAiB,EAAE,CAAC;IACpC,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,wFAAwF;IACxF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAWF,+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,GACL,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,eAkBA;AAED,wBAAgB,YAAY,IAAI,SAAS,GAAG,IAAI,CAE/C;AAED,wBAAgB,qBAAqB,CAAC,gBAAgB,CAAC,EAAE,MAAM,OAClD,SAAS,KAAK,SAAS,KAAG,MAAM,CAW5C;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAmC7D"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PathConfigMap } from "@react-navigation/core";
|
|
2
2
|
import type { NavigationState, PartialState } from "@react-navigation/routers";
|
|
3
|
-
|
|
3
|
+
type Options<ParamList extends object> = {
|
|
4
4
|
initialRouteName?: string;
|
|
5
5
|
screens: PathConfigMap<ParamList>;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export type State = NavigationState | Omit<PartialState<NavigationState>, "stale">;
|
|
8
8
|
/**
|
|
9
9
|
* Utility to serialize a navigation state object to a path string.
|
|
10
10
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPathFromState.d.ts","sourceRoot":"","sources":["../../src/fork/getPathFromState.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAEb,MAAM,2BAA2B,CAAC;AASnC,
|
|
1
|
+
{"version":3,"file":"getPathFromState.d.ts","sourceRoot":"","sources":["../../src/fork/getPathFromState.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAEd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EAEb,MAAM,2BAA2B,CAAC;AASnC,KAAK,OAAO,CAAC,SAAS,SAAS,MAAM,IAAI;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,KAAK,GACb,eAAe,GACf,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC,CAAC;AAgEjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,SAAS,SAAS,MAAM,EAC/D,KAAK,EAAE,KAAK,EAEZ,QAAQ,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAC5B,GACL,MAAM,CA2BR"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PathConfigMap } from "@react-navigation/core";
|
|
2
2
|
import type { NavigationState, PartialState } from "@react-navigation/routers";
|
|
3
|
-
|
|
3
|
+
type Options<ParamList extends object> = {
|
|
4
4
|
initialRouteName?: string;
|
|
5
5
|
screens: PathConfigMap<ParamList>;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type ResultState = PartialState<NavigationState> & {
|
|
8
8
|
state?: ResultState;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,2BAA2B,CAAC;AAUnC,
|
|
1
|
+
{"version":3,"file":"getStateFromPath.d.ts","sourceRoot":"","sources":["../../src/fork/getStateFromPath.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,2BAA2B,CAAC;AAUnC,KAAK,OAAO,CAAC,SAAS,SAAS,MAAM,IAAI;IACvC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,CAAC;CACnC,CAAC;AAqBF,KAAK,WAAW,GAAG,YAAY,CAAC,eAAe,CAAC,GAAG;IACjD,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAkBF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,SAAS,SAAS,MAAM,EAC/D,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAC3B,WAAW,GAAG,SAAS,CA8CzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAsB,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWpC,
|
|
1
|
+
{"version":3,"file":"getLinkingConfig.d.ts","sourceRoot":"","sources":["../src/getLinkingConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAsB,MAAM,0BAA0B,CAAC;AAE9E,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAWpC,KAAK,MAAM,GACP,MAAM,GACN;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAuDN,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,SAAS,EAAE,GACjB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAIxB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,GAAG,cAAc,CAAC,MAAM,CAAC,CA4B1E"}
|
package/build/getRoutes.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DynamicConvention, RouteNode } from "./Route";
|
|
2
2
|
import { RequireContext } from "./types";
|
|
3
|
-
export
|
|
3
|
+
export type FileNode = Pick<RouteNode, "contextKey" | "loadRoute"> & {
|
|
4
4
|
/** Like `(tab)/index` */
|
|
5
5
|
normalizedName: string;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type TreeNode = {
|
|
8
8
|
name: string;
|
|
9
9
|
children: TreeNode[];
|
|
10
10
|
parents: string[];
|
package/build/getRoutes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../src/getRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,
|
|
1
|
+
{"version":3,"file":"getRoutes.d.ts","sourceRoot":"","sources":["../src/getRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQvD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,MAAM,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,WAAW,CAAC,GAAG;IACnE,yBAAyB;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,QAAQ,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,8CAA8C;IAC9C,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,QAAQ,CA+C5D;AAsBD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,MAAM,GACX,iBAAiB,GAAG,IAAI,CAK1B;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAMlE;AA0MD,sEAAsE;AACtE,wBAAgB,SAAS,CAAC,aAAa,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAezE;AA4CD;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,GAChB,SAAS,GAAG,IAAI,CAgBlB"}
|
|
@@ -23,16 +23,11 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
23
23
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
24
24
|
navigation: any;
|
|
25
25
|
}) => DrawerNavigationOptions) | undefined;
|
|
26
|
-
defaultScreenOptions?: DrawerNavigationOptions | ((props: {
|
|
27
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
28
|
-
navigation: any;
|
|
29
|
-
options: DrawerNavigationOptions;
|
|
30
|
-
}) => DrawerNavigationOptions) | undefined;
|
|
31
26
|
} & {
|
|
32
27
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
33
28
|
} & {
|
|
34
29
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
35
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "
|
|
30
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
36
31
|
id?: string | undefined;
|
|
37
32
|
children: import("react").ReactNode;
|
|
38
33
|
screenListeners?: Partial<{
|
|
@@ -55,11 +50,6 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
55
50
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
56
51
|
navigation: any;
|
|
57
52
|
}) => DrawerNavigationOptions) | undefined;
|
|
58
|
-
defaultScreenOptions?: DrawerNavigationOptions | ((props: {
|
|
59
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
60
|
-
navigation: any;
|
|
61
|
-
options: DrawerNavigationOptions;
|
|
62
|
-
}) => DrawerNavigationOptions) | undefined;
|
|
63
53
|
}, "children"> & Partial<Pick<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
64
54
|
id?: string | undefined;
|
|
65
55
|
children: import("react").ReactNode;
|
|
@@ -83,16 +73,11 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
83
73
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
84
74
|
navigation: any;
|
|
85
75
|
}) => DrawerNavigationOptions) | undefined;
|
|
86
|
-
defaultScreenOptions?: DrawerNavigationOptions | ((props: {
|
|
87
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
88
|
-
navigation: any;
|
|
89
|
-
options: DrawerNavigationOptions;
|
|
90
|
-
}) => DrawerNavigationOptions) | undefined;
|
|
91
76
|
} & {
|
|
92
77
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
93
78
|
} & {
|
|
94
79
|
defaultStatus?: import("@react-navigation/routers").DrawerStatus | undefined;
|
|
95
|
-
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "
|
|
80
|
+
} & import("@react-navigation/drawer/lib/typescript/src/types").DrawerNavigationConfig, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
96
81
|
id?: string | undefined;
|
|
97
82
|
children: import("react").ReactNode;
|
|
98
83
|
screenListeners?: Partial<{
|
|
@@ -115,11 +100,6 @@ export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit
|
|
|
115
100
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
116
101
|
navigation: any;
|
|
117
102
|
}) => DrawerNavigationOptions) | undefined;
|
|
118
|
-
defaultScreenOptions?: DrawerNavigationOptions | ((props: {
|
|
119
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
120
|
-
navigation: any;
|
|
121
|
-
options: DrawerNavigationOptions;
|
|
122
|
-
}) => DrawerNavigationOptions) | undefined;
|
|
123
103
|
}, "children">> & import("react").RefAttributes<unknown>> & {
|
|
124
104
|
Screen: (props: import("../useScreens").ScreenProps<DrawerNavigationOptions>) => null;
|
|
125
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAMlC,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAMlC,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGD,CAAC;AAEnB,eAAe,MAAM,CAAC"}
|
package/build/layouts/Stack.d.ts
CHANGED
|
@@ -25,12 +25,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
25
25
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
26
26
|
navigation: any;
|
|
27
27
|
}) => NativeStackNavigationOptions) | undefined;
|
|
28
|
-
|
|
29
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
30
|
-
navigation: any;
|
|
31
|
-
options: NativeStackNavigationOptions;
|
|
32
|
-
}) => NativeStackNavigationOptions) | undefined;
|
|
33
|
-
} & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
28
|
+
} & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
34
29
|
id?: string | undefined;
|
|
35
30
|
children: import("react").ReactNode;
|
|
36
31
|
screenListeners?: Partial<{
|
|
@@ -55,11 +50,6 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
55
50
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
56
51
|
navigation: any;
|
|
57
52
|
}) => NativeStackNavigationOptions) | undefined;
|
|
58
|
-
defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
|
|
59
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
60
|
-
navigation: any;
|
|
61
|
-
options: NativeStackNavigationOptions;
|
|
62
|
-
}) => NativeStackNavigationOptions) | undefined;
|
|
63
53
|
}, "children"> & Partial<Pick<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
64
54
|
id?: string | undefined;
|
|
65
55
|
children: import("react").ReactNode;
|
|
@@ -85,12 +75,7 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
85
75
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
86
76
|
navigation: any;
|
|
87
77
|
}) => NativeStackNavigationOptions) | undefined;
|
|
88
|
-
|
|
89
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
90
|
-
navigation: any;
|
|
91
|
-
options: NativeStackNavigationOptions;
|
|
92
|
-
}) => NativeStackNavigationOptions) | undefined;
|
|
93
|
-
} & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "screenOptions" | "id" | "screenListeners" | "defaultScreenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
78
|
+
} & import("@react-navigation/routers").StackRouterOptions, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
94
79
|
id?: string | undefined;
|
|
95
80
|
children: import("react").ReactNode;
|
|
96
81
|
screenListeners?: Partial<{
|
|
@@ -115,11 +100,6 @@ export declare const Stack: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
115
100
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
116
101
|
navigation: any;
|
|
117
102
|
}) => NativeStackNavigationOptions) | undefined;
|
|
118
|
-
defaultScreenOptions?: NativeStackNavigationOptions | ((props: {
|
|
119
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
120
|
-
navigation: any;
|
|
121
|
-
options: NativeStackNavigationOptions;
|
|
122
|
-
}) => NativeStackNavigationOptions) | undefined;
|
|
123
103
|
}, "children">> & import("react").RefAttributes<unknown>> & {
|
|
124
104
|
Screen: (props: import("../useScreens").ScreenProps<NativeStackNavigationOptions>) => null;
|
|
125
105
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGK,CAAC;AAExB,eAAe,KAAK,CAAC"}
|
package/build/layouts/Tabs.d.ts
CHANGED
|
@@ -26,14 +26,9 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
26
26
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
27
27
|
navigation: any;
|
|
28
28
|
}) => BottomTabNavigationOptions) | undefined;
|
|
29
|
-
defaultScreenOptions?: BottomTabNavigationOptions | ((props: {
|
|
30
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
31
|
-
navigation: any;
|
|
32
|
-
options: BottomTabNavigationOptions;
|
|
33
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
34
29
|
} & {
|
|
35
30
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
36
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "
|
|
31
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
37
32
|
id?: string | undefined;
|
|
38
33
|
children: React.ReactNode;
|
|
39
34
|
screenListeners?: Partial<{
|
|
@@ -58,11 +53,6 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
58
53
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
59
54
|
navigation: any;
|
|
60
55
|
}) => BottomTabNavigationOptions) | undefined;
|
|
61
|
-
defaultScreenOptions?: BottomTabNavigationOptions | ((props: {
|
|
62
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
63
|
-
navigation: any;
|
|
64
|
-
options: BottomTabNavigationOptions;
|
|
65
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
66
56
|
}, "children"> & Partial<Pick<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
67
57
|
id?: string | undefined;
|
|
68
58
|
children: React.ReactNode;
|
|
@@ -88,14 +78,9 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
88
78
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
89
79
|
navigation: any;
|
|
90
80
|
}) => BottomTabNavigationOptions) | undefined;
|
|
91
|
-
defaultScreenOptions?: BottomTabNavigationOptions | ((props: {
|
|
92
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
93
|
-
navigation: any;
|
|
94
|
-
options: BottomTabNavigationOptions;
|
|
95
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
96
81
|
} & {
|
|
97
82
|
backBehavior?: import("@react-navigation/routers/lib/typescript/src/TabRouter").BackBehavior | undefined;
|
|
98
|
-
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "
|
|
83
|
+
} & import("@react-navigation/bottom-tabs/lib/typescript/src/types").BottomTabNavigationConfig, "children" | "initialRouteName" | "id" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
99
84
|
id?: string | undefined;
|
|
100
85
|
children: React.ReactNode;
|
|
101
86
|
screenListeners?: Partial<{
|
|
@@ -120,11 +105,6 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
120
105
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
121
106
|
navigation: any;
|
|
122
107
|
}) => BottomTabNavigationOptions) | undefined;
|
|
123
|
-
defaultScreenOptions?: BottomTabNavigationOptions | ((props: {
|
|
124
|
-
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
125
|
-
navigation: any;
|
|
126
|
-
options: BottomTabNavigationOptions;
|
|
127
|
-
}) => BottomTabNavigationOptions) | undefined;
|
|
128
108
|
}, "children">> & React.RefAttributes<unknown>> & {
|
|
129
109
|
Screen: (props: import("../useScreens").ScreenProps<import("@react-navigation/elements").HeaderOptions & {
|
|
130
110
|
title?: string | undefined;
|
|
@@ -132,6 +112,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
132
112
|
focused: boolean;
|
|
133
113
|
color: string;
|
|
134
114
|
position: import("@react-navigation/bottom-tabs/lib/typescript/src/types").LabelPosition;
|
|
115
|
+
children: string;
|
|
135
116
|
}) => React.ReactNode) | undefined;
|
|
136
117
|
tabBarShowLabel?: boolean | undefined;
|
|
137
118
|
tabBarLabelPosition?: import("@react-navigation/bottom-tabs/lib/typescript/src/types").LabelPosition | undefined;
|
|
@@ -164,6 +145,7 @@ export declare const Tabs: React.ForwardRefExoticComponent<Omit<Omit<import("@re
|
|
|
164
145
|
header?: ((props: import("@react-navigation/bottom-tabs").BottomTabHeaderProps) => React.ReactNode) | undefined;
|
|
165
146
|
headerShown?: boolean | undefined;
|
|
166
147
|
unmountOnBlur?: boolean | undefined;
|
|
148
|
+
freezeOnBlur?: boolean | undefined;
|
|
167
149
|
} & {
|
|
168
150
|
href?: Href | null | undefined;
|
|
169
151
|
}>) => null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAKpC,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Cf,CAAC;AAEH,eAAe,IAAI,CAAC"}
|
package/build/layouts/Tabs.js
CHANGED
|
@@ -2,8 +2,8 @@ import { Pressable } from "@bacons/react-views";
|
|
|
2
2
|
import { createBottomTabNavigator, } from "@react-navigation/bottom-tabs";
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Platform } from "react-native";
|
|
5
|
-
import { Link } from "../link/Link";
|
|
6
5
|
import { withLayoutContext } from "./withLayoutContext";
|
|
6
|
+
import { Link } from "../link/Link";
|
|
7
7
|
// This is the only way to access the navigator.
|
|
8
8
|
const BottomTabNavigator = createBottomTabNavigator().Navigator;
|
|
9
9
|
export const Tabs = withLayoutContext(BottomTabNavigator, (screens) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAEL,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAEL,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGpC,gDAAgD;AAChD,MAAM,kBAAkB,GAAG,wBAAwB,EAAE,CAAC,SAAS,CAAC;AAEhE,MAAM,CAAC,MAAM,IAAI,GAAG,iBAAiB,CAGnC,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;IAChC,oCAAoC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,IACE,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU;YACpC,MAAM,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,EAClC;YACA,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YAC5C,IAAI,OAAO,CAAC,YAAY,EAAE;gBACxB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;aACnE;YACD,OAAO;gBACL,GAAG,MAAM;gBACT,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,+CAA+C;oBAC/C,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;wBACtB,IAAI,IAAI,IAAI,IAAI,EAAE;4BAChB,OAAO,IAAI,CAAC;yBACb;wBACD,MAAM,QAAQ,GACZ,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CACtB,KAAK,CAAC,QAAQ,CACf,CAAC,CAAC,CAAC,CACF,oBAAC,SAAS,QAAE,KAAK,CAAC,QAAQ,CAAa,CACxC,CAAC;wBACJ,OAAO,CACL,oBAAC,IAAI,OACC,KAAK,EACT,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,QAAQ,CAAC,EAAE,KAAK,KAAK,EAC9B,QAAQ,EAAE,QAAQ,GAClB,CACH,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;SACH;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,eAAe,IAAI,CAAC","sourcesContent":["import { Pressable } from \"@bacons/react-views\";\nimport {\n BottomTabNavigationOptions,\n createBottomTabNavigator,\n} from \"@react-navigation/bottom-tabs\";\nimport React from \"react\";\nimport { Platform } from \"react-native\";\n\nimport { withLayoutContext } from \"./withLayoutContext\";\nimport { Link } from \"../link/Link\";\nimport { Href } from \"../link/href\";\n\n// This is the only way to access the navigator.\nconst BottomTabNavigator = createBottomTabNavigator().Navigator;\n\nexport const Tabs = withLayoutContext<\n BottomTabNavigationOptions & { href?: Href | null },\n typeof BottomTabNavigator\n>(BottomTabNavigator, (screens) => {\n // Support the `href` shortcut prop.\n return screens.map((screen) => {\n if (\n typeof screen.options !== \"function\" &&\n screen.options?.href !== undefined\n ) {\n const { href, ...options } = screen.options;\n if (options.tabBarButton) {\n throw new Error(\"Cannot use `href` and `tabBarButton` together.\");\n }\n return {\n ...screen,\n options: {\n ...options,\n // Force the button to go to the user's profile\n tabBarButton: (props) => {\n if (href == null) {\n return null;\n }\n const children =\n Platform.OS === \"web\" ? (\n props.children\n ) : (\n <Pressable>{props.children}</Pressable>\n );\n return (\n <Link\n {...props}\n style={[{ display: \"flex\" }, props.style]}\n href={href}\n asChild={Platform.OS !== \"web\"}\n children={children}\n />\n );\n },\n },\n };\n }\n return screen;\n });\n});\n\nexport default Tabs;\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ScreenProps } from "../useScreens";
|
|
3
|
-
|
|
3
|
+
type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
4
|
export declare function useFilterScreenChildren(children: React.ReactNode, { isCustomNavigator, contextKey, }?: {
|
|
5
5
|
isCustomNavigator?: boolean;
|
|
6
6
|
/** Used for sending developer hints */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,
|
|
1
|
+
{"version":3,"file":"withLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/withLayoutContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAoB,WAAW,EAAE,MAAM,eAAe,CAAC;AAG9D,KAAK,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAE1E,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,EACE,iBAAiB,EACjB,UAAU,GACX,GAAE;IACD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CAChB;;;EAgDP;AAED,2JAA2J;AAC3J,wBAAgB,iBAAiB,CAC/B,QAAQ,SAAS,MAAM,EACvB,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,EAElC,GAAG,EAAE,CAAC,EACN,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,EAAE,KAAK,WAAW,CAAC,QAAQ,CAAC,EAAE,GACxE,KAAK,CAAC,yBAAyB,CAChC,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,GACrE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAC/B,GAAG;IACF,MAAM,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAChD,CAmCA"}
|
package/build/link/Link.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { TextProps } from "@bacons/react-views";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { GestureResponderEvent } from "react-native";
|
|
4
4
|
import { Href } from "./href";
|
|
5
|
-
|
|
5
|
+
type Props = {
|
|
6
6
|
/** Path to route to. */
|
|
7
7
|
href: Href;
|
|
8
8
|
/** Forward props to child component. Useful for custom buttons. */
|
|
@@ -26,6 +26,6 @@ export declare function Redirect({ href }: {
|
|
|
26
26
|
* @param props.asChild Forward props to child component. Useful for custom buttons.
|
|
27
27
|
* @param props.children Child elements to render the content.
|
|
28
28
|
*/
|
|
29
|
-
export declare const Link: React.ForwardRefExoticComponent<Pick<Props, "children" | "replace" | "style" | "key" | "target" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onLayout" | "onTextLayout" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "adjustsFontSizeToFit" | "minimumFontScale" | "suppressHighlighting" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "
|
|
29
|
+
export declare const Link: React.ForwardRefExoticComponent<Pick<Props, "children" | "replace" | "style" | "key" | "target" | "lang" | "tabIndex" | "href" | "allowFontScaling" | "ellipsizeMode" | "lineBreakMode" | "numberOfLines" | "onLayout" | "onTextLayout" | "onPress" | "onPressIn" | "onPressOut" | "onLongPress" | "testID" | "nativeID" | "maxFontSizeMultiplier" | "adjustsFontSizeToFit" | "minimumFontScale" | "suppressHighlighting" | "disabled" | "selectable" | "selectionColor" | "textBreakStrategy" | "dataDetectorType" | "android_hyphenationFrequency" | "accessible" | "accessibilityActions" | "accessibilityLabel" | "accessibilityRole" | "accessibilityState" | "accessibilityHint" | "accessibilityValue" | "onAccessibilityAction" | "accessibilityLabelledBy" | "accessibilityLiveRegion" | "importantForAccessibility" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityViewIsModal" | "onAccessibilityEscape" | "onAccessibilityTap" | "onMagicTap" | "accessibilityIgnoresInvertColors" | "accessibilityLevel" | "hoverStyle" | "hrefAttrs" | "asChild"> & React.RefAttributes<Text>>;
|
|
30
30
|
export {};
|
|
31
31
|
//# sourceMappingURL=Link.d.ts.map
|
package/build/link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAY,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAK3C,KAAK,KAAK,GAAG;IACX,wBAAwB;IACxB,IAAI,EAAE,IAAI,CAAC;IAGX,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,sEAAsE;IACtE,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,OAAO,CAAC,EAAE,CACR,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,qBAAqB,KACvE,IAAI,CAAC;CACX,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAC;AAE9D,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,QAMhD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,IAAI,yjCAAmC,CAAC"}
|
package/build/link/Link.js
CHANGED
|
@@ -4,10 +4,10 @@ import { Text } from "@bacons/react-views";
|
|
|
4
4
|
import { Slot } from "@radix-ui/react-slot";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Platform } from "react-native";
|
|
7
|
-
import { useFocusEffect } from "../useFocusEffect";
|
|
8
7
|
import { resolveHref } from "./href";
|
|
9
8
|
import useLinkToPathProps from "./useLinkToPathProps";
|
|
10
9
|
import { useRouter } from "./useRouter";
|
|
10
|
+
import { useFocusEffect } from "../useFocusEffect";
|
|
11
11
|
/** Redirects to the href as soon as the component is mounted. */
|
|
12
12
|
export function Redirect({ href }) {
|
|
13
13
|
const router = useRouter();
|
|
@@ -30,7 +30,12 @@ function ExpoRouterLink({ href, replace,
|
|
|
30
30
|
// TODO: This does not prevent default on the anchor tag.
|
|
31
31
|
asChild, ...rest }, ref) {
|
|
32
32
|
// TODO: Auto use router's client-side event.
|
|
33
|
-
const resolvedHref = React.useMemo(() =>
|
|
33
|
+
const resolvedHref = React.useMemo(() => {
|
|
34
|
+
if (href == null) {
|
|
35
|
+
throw new Error("Link: href is required");
|
|
36
|
+
}
|
|
37
|
+
return resolveHref(href);
|
|
38
|
+
}, [href]);
|
|
34
39
|
const props = useLinkToPathProps({ href: resolvedHref, replace });
|
|
35
40
|
const onPress = (e) => {
|
|
36
41
|
if ("onPress" in rest) {
|
package/build/link/Link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,mCAAmC;AACnC,OAAO,EAAE,IAAI,EAAa,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,mCAAmC;AACnC,OAAO,EAAE,IAAI,EAAa,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAQ,WAAW,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;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AAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAS;YAChC,OAAO,EAAE,EAAE,OAAO,EAAE;SACrB,CAAC;KACH,CACF,CAAC;AACJ,CAAC","sourcesContent":["// Fork of @react-navigation/native Link.tsx with `href` and `replace` support added and\n// `to` / `action` support removed.\nimport { Text, TextProps } from \"@bacons/react-views\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { GestureResponderEvent, Platform } from \"react-native\";\n\nimport { Href, resolveHref } from \"./href\";\nimport useLinkToPathProps from \"./useLinkToPathProps\";\nimport { useRouter } from \"./useRouter\";\nimport { useFocusEffect } from \"../useFocusEffect\";\n\ntype Props = {\n /** Path to route to. */\n href: Href;\n\n // TODO(EvanBacon): This may need to be extracted for React Native style support.\n /** Forward props to child component. Useful for custom buttons. */\n asChild?: boolean;\n\n /** Should replace the current route without adding to the history. */\n replace?: boolean;\n\n onPress?: (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => void;\n} & (Omit<TextProps, \"href\"> & { children: React.ReactNode });\n\n/** Redirects to the href as soon as the component is mounted. */\nexport function Redirect({ href }: { href: Href }) {\n const router = useRouter();\n useFocusEffect(() => {\n router.replace(href);\n });\n return null;\n}\n\n/**\n * Component to render link to another route using a path.\n * Uses an anchor tag on the web.\n *\n * @param props.href Absolute path to route (e.g. `/feeds/hot`).\n * @param props.replace Should replace the current route without adding to the history.\n * @param props.asChild Forward props to child component. Useful for custom buttons.\n * @param props.children Child elements to render the content.\n */\nexport const Link = React.forwardRef(ExpoRouterLink);\n\nfunction ExpoRouterLink(\n {\n href,\n replace,\n // TODO: This does not prevent default on the anchor tag.\n asChild,\n ...rest\n }: Props,\n ref: React.ForwardedRef<Text>\n) {\n // TODO: Auto use router's client-side event.\n const resolvedHref = React.useMemo(() => {\n if (href == null) {\n throw new Error(\"Link: href is required\");\n }\n return resolveHref(href);\n }, [href]);\n\n const props = useLinkToPathProps({ href: resolvedHref, replace });\n\n const onPress = (\n e: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n if (\"onPress\" in rest) {\n rest.onPress?.(e);\n }\n props.onPress(e);\n };\n\n return React.createElement(\n // @ts-expect-error: slot is not type-safe\n asChild ? Slot : Text,\n {\n ref,\n ...props,\n ...rest,\n ...Platform.select({\n web: { onClick: onPress } as any,\n default: { onPress },\n }),\n }\n );\n}\n"]}
|
package/build/link/href.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Href = string | HrefObject;
|
|
2
|
+
export type HrefObject = {
|
|
3
3
|
/** Path representing the selected route `/[id]`. */
|
|
4
4
|
pathname?: string;
|
|
5
5
|
/** Query parameters for the path. */
|
package/build/link/href.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"href.d.ts","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"href.d.ts","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvC,MAAM,MAAM,UAAU,GAAG;IACvB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qCAAqC;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B,CAAC;AAEF,oEAAoE;AACpE,eAAO,MAAM,WAAW,SAAU,IAAI,KAAG,MAexC,CAAC"}
|
package/build/link/useHref.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HrefObject } from "./href";
|
|
2
2
|
/** @deprecated */
|
|
3
|
-
|
|
3
|
+
type RouteInfo = Omit<Required<HrefObject>, "query"> & {
|
|
4
4
|
/** Normalized path representing the selected route `/[id]?id=normal` -> `/normal` */
|
|
5
5
|
href: string;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHref.d.ts","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHref.d.ts","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAGpC,kBAAkB;AAClB,KAAK,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,GAAG;IACrD,qFAAqF;IACrF,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,kBAAkB;AAClB,wBAAgB,OAAO,IAAI,SAAS,CAUnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHref.js","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useHref.js","sourceRoot":"","sources":["../../src/link/useHref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQhF,kBAAkB;AAClB,MAAM,UAAU,OAAO;IACrB,OAAO,CAAC,IAAI,CACV,iFAAiF,CAClF,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,WAAW,EAAE;QACnB,QAAQ,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;QACjC,MAAM,EAAE,eAAe,EAAE;KAC1B,CAAC;AACJ,CAAC","sourcesContent":["import { HrefObject } from \"./href\";\nimport { usePathname, useSearchParams, useSegments } from \"../LocationProvider\";\n\n/** @deprecated */\ntype RouteInfo = Omit<Required<HrefObject>, \"query\"> & {\n /** Normalized path representing the selected route `/[id]?id=normal` -> `/normal` */\n href: string;\n};\n\n/** @deprecated */\nexport function useHref(): RouteInfo {\n console.warn(\n \"useHref is deprecated in favor of usePathname, useSearchParams, and useSegments\"\n );\n\n return {\n href: usePathname(),\n pathname: useSegments().join(\"/\"),\n params: useSearchParams(),\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkToPath.d.ts","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAcA,wBAAgB,aAAa,SAKpB,MAAM,UAAU,MAAM,
|
|
1
|
+
{"version":3,"file":"useLinkToPath.d.ts","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAcA,wBAAgB,aAAa,SAKpB,MAAM,UAAU,MAAM,UAsD9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkToPath.js","sourceRoot":"","sources":["../../src/link/useLinkToPath.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,iBAAiB,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAC9B,CAAC,EAAU,EAAE,KAAc,EAAE,EAAE;QAC7B,IAAI,YAAY,CAAC,EAAE,CAAC,EAAE;YACpB,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpB,OAAO;SACR;QAED,IAAI,UAAU,IAAI,IAAI,EAAE;YACtB,MAAM,IAAI,KAAK,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,OAAQ,CAAC,MAAM,CAAC,CAAC;QAE7D,IAAI,KAAK,EAAE;YACT,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAE1D,IAAI,MAAM,KAAK,SAAS,EAAE;gBACxB,IAAI,KAAK,EAAE;oBACT,aAAa;oBACb,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;iBACrB;gBACD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;aAC7B;iBAAM;gBACL,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;aACzB;SACF;aAAM;YACL,MAAM,IAAI,KAAK,CACb,kDAAkD,GAAG,EAAE,CACxD,CAAC;SACH;IACH,CAAC,EACD,CAAC,OAAO,EAAE,UAAU,CAAC,CACtB,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n getActionFromState,\n NavigationContainerRefContext,\n} from \"@react-navigation/core\";\nimport * as Linking from \"expo-linking\";\nimport * as React from \"react\";\n\nimport { resolve } from \"./path\";\nimport { useLinkingContext } from \"./useLinkingContext\";\n\nfunction isRemoteHref(href: string): boolean {\n return /:\\/\\//.test(href);\n}\n\nexport function useLinkToPath() {\n const navigation = React.useContext(NavigationContainerRefContext);\n const linking = useLinkingContext();\n\n const linkTo = React.useCallback(\n (to: string, event?: string) => {\n if (isRemoteHref(to)) {\n Linking.openURL(to);\n return;\n }\n\n if (navigation == null) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n if (to === \"..\" || to === \"../\") {\n navigation.goBack();\n return;\n }\n\n if (to.startsWith(\".\")) {\n let base = linking.getPathFromState?.(navigation.getRootState(), {\n ...linking.config,\n // @ts-expect-error: non-standard option\n preserveGroups: true,\n });\n\n if (base && !base.endsWith(\"/\")) {\n base += \"/..\";\n }\n to = resolve(base, to);\n }\n\n const state = linking.getStateFromPath!(to, linking!.config);\n\n if (state) {\n const action = getActionFromState(state, linking?.config);\n\n if (action !== undefined) {\n if (event) {\n // @ts-ignore\n action.type = event;\n }\n navigation.dispatch(action);\n } else {\n navigation.reset(state);\n }\n } else {\n throw new Error(\n \"Failed to parse the path to a navigation state: \" + to\n );\n }\n },\n [linking, navigation]\n );\n\n return linkTo;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Platform } from "react-native";
|
|
2
|
-
import { stripGroupSegmentsFromPath } from "../matchers";
|
|
3
2
|
import { useLinkToPath } from "./useLinkToPath";
|
|
3
|
+
import { stripGroupSegmentsFromPath } from "../matchers";
|
|
4
4
|
export default function useLinkToPathProps(props) {
|
|
5
5
|
const linkTo = useLinkToPath();
|
|
6
6
|
const onPress = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLinkToPathProps.js","sourceRoot":"","sources":["../../src/link/useLinkToPathProps.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useLinkToPathProps.js","sourceRoot":"","sources":["../../src/link/useLinkToPathProps.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAG1C;IACC,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;IAE/B,MAAM,OAAO,GAAG,CACd,CAA2E,EAC3E,EAAE;QACF,IAAI,YAAY,GAAG,KAAK,CAAC;QAEzB,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,EAAE;YAC/B,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;SAC/C;aAAM,IACL,CAAC,CAAC,CAAC,gBAAgB,IAAI,4BAA4B;YACnD,2EAA2E;YAC3E,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,mCAAmC;YAC1F,2EAA2E;YAC3E,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,oCAAoC;YAC5E,2EAA2E;YAC3E,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC,0CAA0C;UAC1G;YACA,CAAC,CAAC,cAAc,EAAE,CAAC;YACnB,YAAY,GAAG,IAAI,CAAC;SACrB;QAED,IAAI,YAAY,EAAE;YAChB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;SAC3D;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5C,iBAAiB,EAAE,MAAe;QAClC,OAAO;KACR,CAAC;AACJ,CAAC","sourcesContent":["import * as React from \"react\";\nimport { GestureResponderEvent, Platform } from \"react-native\";\n\nimport { useLinkToPath } from \"./useLinkToPath\";\nimport { stripGroupSegmentsFromPath } from \"../matchers\";\n\nexport default function useLinkToPathProps(props: {\n href: string;\n replace?: boolean;\n}) {\n const linkTo = useLinkToPath();\n\n const onPress = (\n e?: React.MouseEvent<HTMLAnchorElement, MouseEvent> | GestureResponderEvent\n ) => {\n let shouldHandle = false;\n\n if (Platform.OS !== \"web\" || !e) {\n shouldHandle = e ? !e.defaultPrevented : true;\n } else if (\n !e.defaultPrevented && // onPress prevented default\n // @ts-expect-error: these properties exist on web, but not in React Native\n !(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && // ignore clicks with modifier keys\n // @ts-expect-error: these properties exist on web, but not in React Native\n (e.button == null || e.button === 0) && // ignore everything but left clicks\n // @ts-expect-error: these properties exist on web, but not in React Native\n [undefined, null, \"\", \"self\"].includes(e.currentTarget?.target) // let browser handle \"target=_blank\" etc.\n ) {\n e.preventDefault();\n shouldHandle = true;\n }\n\n if (shouldHandle) {\n linkTo(props.href, props.replace ? \"REPLACE\" : undefined);\n }\n };\n\n return {\n href: stripGroupSegmentsFromPath(props.href),\n accessibilityRole: \"link\" as const,\n onPress,\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NavigationProp } from "@react-navigation/native";
|
|
2
|
-
|
|
2
|
+
type GenericNavigation = NavigationProp<ReactNavigation.RootParamList>;
|
|
3
3
|
/** Returns a callback which is invoked when the navigation state has loaded. */
|
|
4
4
|
export declare function useLoadedNavigation(): (fn: (navigation: GenericNavigation) => void) => void;
|
|
5
5
|
export declare function useOptionalNavigation(): GenericNavigation | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLoadedNavigation.d.ts","sourceRoot":"","sources":["../../src/link/useLoadedNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAKzE,
|
|
1
|
+
{"version":3,"file":"useLoadedNavigation.d.ts","sourceRoot":"","sources":["../../src/link/useLoadedNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAKzE,KAAK,iBAAiB,GAAG,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;AAEvE,gFAAgF;AAChF,wBAAgB,mBAAmB,sBA8Bb,iBAAiB,KAAK,IAAI,UAU/C;AAED,wBAAgB,qBAAqB,IAAI,iBAAiB,GAAG,IAAI,CAShE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../src/link/useRouter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useRouter.d.ts","sourceRoot":"","sources":["../../src/link/useRouter.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAM3C,wBAAgB,OAAO,WAGtB;AAED,KAAK,MAAM,GAAG;IACZ,qCAAqC;IACrC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,6CAA6C;IAC7C,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CACtD,CAAC;AAEF,wBAAgB,SAAS,IAAI,MAAM,CAkClC"}
|
package/build/link/useRouter.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
-
import { RootContainer } from "../ContextNavigationContainer";
|
|
3
2
|
import { resolveHref } from "./href";
|
|
4
3
|
import { useLinkToPath } from "./useLinkToPath";
|
|
5
4
|
import { useLoadedNavigation } from "./useLoadedNavigation";
|
|
5
|
+
import { RootContainer } from "../ContextNavigationContainer";
|
|
6
6
|
// Wraps useLinkTo to provide an API which is similar to the Link component.
|
|
7
7
|
export function useLink() {
|
|
8
8
|
console.warn("`useLink()` is deprecated in favor of `useRouter()`");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/link/useRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,
|
|
1
|
+
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../src/link/useRou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AI,EAAE,OAAO,EAAE,SAAS;YACtB,mBAAmB;YACnB,MAAM,CACP,CAAC;QACJ,CAAC;QACD,gCAAgC;QAChC,sEAAsE;KACvE,CAAC;AACJ,CAAC","sourcesContent":["import { useCallback } from \"react\";\n\nimport { Href, resolveHref } from \"./href\";\nimport { useLinkToPath } from \"./useLinkToPath\";\nimport { useLoadedNavigation } from \"./useLoadedNavigation\";\nimport { RootContainer } from \"../ContextNavigationContainer\";\n\n// Wraps useLinkTo to provide an API which is similar to the Link component.\nexport function useLink() {\n console.warn(\"`useLink()` is deprecated in favor of `useRouter()`\");\n return useRouter();\n}\n\ntype Router = {\n /** Navigate to the provided href. */\n push: (href: Href) => void;\n /** Navigate to route without appending to the history. */\n replace: (href: Href) => void;\n /** Go back in the history. */\n back: () => void;\n /** Update the current route query params. */\n setParams: (params?: Record<string, string>) => void;\n};\n\nexport function useRouter(): Router {\n const root = RootContainer.useRef();\n\n const pending = useLoadedNavigation();\n const linkTo = useLinkToPath();\n\n const push = useCallback(\n (url: Href) => pending(() => linkTo(resolveHref(url))),\n [pending, linkTo]\n );\n\n const replace = useCallback(\n (url: Href) => pending(() => linkTo(resolveHref(url), \"REPLACE\")),\n [pending, linkTo]\n );\n\n const back = useCallback(\n () => pending((navigation) => navigation.goBack()),\n [pending]\n );\n\n return {\n push,\n back,\n replace,\n setParams: (params) => {\n root?.current?.setParams(\n // @ts-expect-error\n params\n );\n },\n // TODO(EvanBacon): add `reload`\n // TODO(EvanBacon): add `canGoBack` but maybe more like a `hasContext`\n };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type EffectCallback = () => undefined | void | (() => void);
|
|
2
2
|
/**
|
|
3
3
|
* Hook to run an effect in a focused screen, similar to `React.useEffect`.
|
|
4
4
|
* This can be used to perform side-effects such as fetching data or subscribing to events.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.tsx"],"names":[],"mappings":"AAMA,
|
|
1
|
+
{"version":3,"file":"useFocusEffect.d.ts","sourceRoot":"","sources":["../src/useFocusEffect.tsx"],"names":[],"mappings":"AAMA,KAAK,cAAc,GAAG,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;AAE5D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,EACtB,yBAAyB,CAAC,EAAE,GAAG,QAuGhC"}
|
package/build/useScreens.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { RouteNode } from "./Route";
|
|
3
|
-
export
|
|
3
|
+
export type ScreenProps<TOptions extends Record<string, any> = Record<string, any>> = {
|
|
4
4
|
/** Name is required when used inside a Layout component. */
|
|
5
5
|
name?: string;
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,SAAS,EAGV,MAAM,SAAS,CAAC;AAIjB,
|
|
1
|
+
{"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAGL,SAAS,EAGV,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACxD;IACF,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,QAAQ,CAAC;IAGnB,SAAS,CAAC,EAAE,GAAG,CAAC;CACjB,CAAC;AA8DF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,SAAS,EAAE,CAUxE;AAMD,mFAAmF;AACnF,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,SAAS,kIA+C1D;AAED,oGAAoG;AACpG,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC;;sCA0B5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3C,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,kBAAkB,eAkEjE"}
|
|
@@ -35,7 +35,7 @@ export function ErrorBoundary({ error, retry }) {
|
|
|
35
35
|
},
|
|
36
36
|
] }, "Retry"))))))),
|
|
37
37
|
React.createElement(StackTrace, { error: error }),
|
|
38
|
-
process.env.NODE_ENV === "development" && (React.createElement(Link, { href: "/
|
|
38
|
+
process.env.NODE_ENV === "development" && (React.createElement(Link, { href: "/_sitemap", style: styles.link }, "Sitemap")))));
|
|
39
39
|
}
|
|
40
40
|
function StackTrace({ error }) {
|
|
41
41
|
return (React.createElement(ScrollView, { style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/views/ErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE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,IAAI,EAAE,CAAC;QACP,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,QAAQ;KACzB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QAEZ,uBAAuB;QACvB,UAAU,EAAE,MAAM;KACnB;IACD,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;QAClB,KAAK,EAAE,OAAO;KACf;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;YAC1B,OAAO,EAAE,SAAS;YAClB,GAAG,EAAE,aAAa;YAClB,OAAO,EAAE,WAAW;SACrB,CAAC;QACF,UAAU,EAAE,KAAK;KAClB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,EAAE;QACZ,YAAY,EAAE,EAAE;QAChB,uBAAuB;KACxB;IACD,IAAI,EAAE;QACJ,KAAK,EAAE,uBAAuB;QAC9B,mBAAmB,EAAE,OAAO;QAC5B,kBAAkB,EAAE,WAAW;QAC/B,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import { Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport React from \"react\";\nimport { Platform, ScrollView, TouchableOpacity } from \"react-native\";\nimport { SafeAreaView } from \"react-native-safe-area-context\";\n\nimport { ErrorBoundaryProps } from \"./Try\";\nimport { Link } from \"../link/Link\";\n\nexport function ErrorBoundary({ error, retry }: ErrorBoundaryProps) {\n return (\n <View style={[styles.container]}>\n <SafeAreaView\n style={{ flex: 1, maxWidth: 720, marginHorizontal: \"auto\" }}\n >\n <View\n style={{\n marginBottom: 12,\n flexDirection: \"row\",\n flexWrap: \"wrap\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <Text\n accessibilityRole=\"header\"\n accessibilityLevel={1}\n style={styles.title}\n >\n Something went wrong\n </Text>\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n <Pressable>\n {({ hovered }) => (\n <TouchableOpacity onPress={retry}>\n <View\n style={[\n {\n transitionDuration: \"100ms\",\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderColor: \"white\",\n borderWidth: 2,\n marginLeft: 8,\n },\n hovered && { backgroundColor: \"white\" },\n ]}\n >\n <Text\n style={[\n styles.buttonText,\n {\n transitionDuration: \"100ms\",\n color: hovered ? \"black\" : \"white\",\n },\n ]}\n >\n Retry\n </Text>\n </View>\n </TouchableOpacity>\n )}\n </Pressable>\n </View>\n </View>\n\n <StackTrace error={error} />\n {process.env.NODE_ENV === \"development\" && (\n <Link href=\"/_sitemap\" style={styles.link}>\n Sitemap\n </Link>\n )}\n </SafeAreaView>\n </View>\n );\n}\n\nfunction StackTrace({ error }: { error: Error }) {\n return (\n <ScrollView\n style={{\n marginVertical: 8,\n borderColor: \"rgba(255,255,255,0.5)\",\n borderWidth: 1,\n padding: 12,\n }}\n >\n <Text style={[styles.code, { color: \"white\" }]}>{error.stack}</Text>\n </ScrollView>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: \"black\",\n padding: 24,\n alignItems: \"stretch\",\n justifyContent: \"center\",\n },\n title: {\n color: \"white\",\n fontSize: 36,\n\n // textAlign: \"center\",\n fontWeight: \"bold\",\n },\n buttonText: {\n fontSize: 18,\n fontWeight: \"bold\",\n color: \"black\",\n },\n code: {\n fontFamily: Platform.select({\n default: \"Courier\",\n ios: \"Courier New\",\n android: \"monospace\",\n }),\n fontWeight: \"500\",\n },\n subtitle: {\n color: \"white\",\n fontSize: 14,\n marginBottom: 12,\n // textAlign: \"center\",\n },\n link: {\n color: \"rgba(255,255,255,0.4)\",\n textDecorationStyle: \"solid\",\n textDecorationLine: \"underline\",\n fontSize: 14,\n textAlign: \"center\",\n },\n});\n"]}
|
package/build/views/Layout.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const NavigatorContext: React.Context<{
|
|
|
7
7
|
descriptors: any;
|
|
8
8
|
router: RouterFactory<any, any, any>;
|
|
9
9
|
} | null>;
|
|
10
|
-
export
|
|
10
|
+
export type NavigatorProps = {
|
|
11
11
|
initialRouteName?: Parameters<typeof useNavigationBuilder>[1]["initialRouteName"];
|
|
12
12
|
screenOptions?: Parameters<typeof useNavigationBuilder>[1]["screenOptions"];
|
|
13
13
|
children?: Parameters<typeof useNavigationBuilder>[1]["children"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,eAAO,MAAM,gBAAgB;gBACf,MAAM;WACX,GAAG;gBACE,GAAG;iBACF,GAAG;YACR,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACvB,CAAC;AAMhB,
|
|
1
|
+
{"version":3,"file":"Layout.d.ts","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,eAAO,MAAM,gBAAgB;gBACf,MAAM;WACX,GAAG;gBACE,GAAG;iBACF,GAAG;YACR,cAAc,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACvB,CAAC;AAMhB,MAAM,MAAM,cAAc,GAAG;IAC3B,gBAAgB,CAAC,EAAE,UAAU,CAC3B,OAAO,oBAAoB,CAC5B,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC;IACzB,aAAa,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAClE,MAAM,CAAC,EAAE,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;CACrD,CAAC;AAEF,+DAA+D;AAC/D,wBAAgB,SAAS,CAAC,EACxB,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,MAAM,GACP,EAAE,cAAc,sBA2BhB;yBAhCe,SAAS;;;;;AAkEzB,wBAAgB,mBAAmB;;;;;;EAMlC;AAED,wBAAgB,OAAO,QActB;AAED,8CAA8C;AAC9C,wBAAgB,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,eAc3D;AAED,wBAAgB,aAAa,QAE5B;AAED,wBAAgB,gBAAgB,gBAM/B"}
|
package/build/views/Layout.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { StackRouter, useNavigationBuilder, } from "@react-navigation/native";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { Screen } from "./Screen";
|
|
3
4
|
import { useContextKey } from "../Route";
|
|
4
5
|
import { useFilterScreenChildren } from "../layouts/withLayoutContext";
|
|
5
6
|
import { useSortedScreens } from "../useScreens";
|
|
6
|
-
import { Screen } from "./Screen";
|
|
7
7
|
// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?
|
|
8
8
|
export const NavigatorContext = React.createContext(null);
|
|
9
9
|
if (process.env.NODE_ENV !== "production") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/views/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../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,MAAM,UAAU,IAAI,CAAC,KAAuC;IAC1D,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;IACnC,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IACnD,mDAAmD;IACnD,IAAI,OAAO,EAAE,UAAU,KAAK,UAAU,EAAE;QACtC,qCAAqC;QACrC,OAAO,CACL,oBAAC,SAAS,OAAK,KAAK;YAClB,oBAAC,aAAa,OAAG,CACP,CACb,CAAC;KACH;IAED,OAAO,oBAAC,aAAa,OAAG,CAAC;AAC3B,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CACL,oBAAC,SAAS;QACR,oBAAC,aAAa,OAAG,CACP,CACb,CAAC;AACJ,CAAC;AAED,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;AACtB,SAAS,CAAC,UAAU,GAAG,mBAAmB,CAAC;AAE3C,wCAAwC;AACxC,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC","sourcesContent":["import {\n RouterFactory,\n StackRouter,\n useNavigationBuilder,\n} from \"@react-navigation/native\";\nimport * as React from \"react\";\n\nimport { Screen } from \"./Screen\";\nimport { useContextKey } from \"../Route\";\nimport { useFilterScreenChildren } from \"../layouts/withLayoutContext\";\nimport { useSortedScreens } from \"../useScreens\";\n\n// TODO: This might already exist upstream, maybe something like `useCurrentRender` ?\nexport const NavigatorContext = React.createContext<{\n contextKey: string;\n state: any;\n navigation: any;\n descriptors: any;\n router: RouterFactory<any, any, any>;\n} | null>(null);\n\nif (process.env.NODE_ENV !== \"production\") {\n NavigatorContext.displayName = \"NavigatorContext\";\n}\n\nexport type NavigatorProps = {\n initialRouteName?: Parameters<\n typeof useNavigationBuilder\n >[1][\"initialRouteName\"];\n screenOptions?: Parameters<typeof useNavigationBuilder>[1][\"screenOptions\"];\n children?: Parameters<typeof useNavigationBuilder>[1][\"children\"];\n router?: Parameters<typeof useNavigationBuilder>[0];\n};\n\n/** An unstyled custom navigator. Good for basic web layouts */\nexport function Navigator({\n initialRouteName,\n screenOptions,\n children,\n router,\n}: NavigatorProps) {\n const contextKey = useContextKey();\n\n // Allows adding Screen components as children to configure routes.\n const { screens, children: otherSlot } = useFilterScreenChildren(children, {\n isCustomNavigator: true,\n contextKey,\n });\n\n const sorted = useSortedScreens(screens ?? []);\n\n if (!sorted.length) {\n console.warn(`Navigator at \"${contextKey}\" has no children.`);\n return null;\n }\n\n return (\n <QualifiedNavigator\n initialRouteName={initialRouteName}\n screenOptions={screenOptions}\n screens={sorted}\n contextKey={contextKey}\n router={router}\n >\n {otherSlot}\n </QualifiedNavigator>\n );\n}\n\nfunction QualifiedNavigator({\n initialRouteName,\n screenOptions,\n children,\n screens,\n contextKey,\n router = StackRouter,\n}: NavigatorProps & { contextKey: string; screens: React.ReactNode[] }) {\n const { state, navigation, descriptors, NavigationContent } =\n useNavigationBuilder(router, {\n // Used for getting the parent with navigation.getParent('/normalized/path')\n id: contextKey,\n children: screens,\n screenOptions,\n initialRouteName,\n });\n\n return (\n <NavigatorContext.Provider\n value={{\n contextKey,\n state,\n navigation,\n descriptors,\n router,\n }}\n >\n <NavigationContent>{children}</NavigationContent>\n </NavigatorContext.Provider>\n );\n}\n\nexport function useNavigatorContext() {\n const context = React.useContext(NavigatorContext);\n if (!context) {\n throw new Error(\"useNavigatorContext must be used within a <Navigator />\");\n }\n return context;\n}\n\nexport function useSlot() {\n const context = useNavigatorContext();\n\n const { state, descriptors } = context;\n\n const current = state.routes.find((route, i) => {\n return state.index === i;\n });\n\n if (!current) {\n return null;\n }\n\n return descriptors[current.key]?.render() ?? null;\n}\n\n/** Renders the currently selected content. */\nexport function Slot(props: Omit<NavigatorProps, \"children\">) {\n const contextKey = useContextKey();\n const context = React.useContext(NavigatorContext);\n // Ensure the context is for the current contextKey\n if (context?.contextKey !== contextKey) {\n // Qualify the content and re-export.\n return (\n <Navigator {...props}>\n <QualifiedSlot />\n </Navigator>\n );\n }\n\n return <QualifiedSlot />;\n}\n\nexport function QualifiedSlot() {\n return useSlot();\n}\n\nexport function DefaultNavigator() {\n return (\n <Navigator>\n <QualifiedSlot />\n </Navigator>\n );\n}\n\nNavigator.Slot = Slot;\nNavigator.useContext = useNavigatorContext;\n\n/** Used to configure route settings. */\nNavigator.Screen = Screen;\n"]}
|
package/build/views/Screen.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"Screen.d.ts","sourceRoot":"","sources":["../../src/views/Screen.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,CACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACxD;IACF;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,aAAa,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACvC,OAAO,CAAC,EAAE,QAAQ,CAAC;CACpB,CAAC;AAEF,sEAAsE;AACtE,wBAAgB,MAAM,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,IAAI,EACJ,QAAQ,EACR,OAAO,GACR,EAAE,WAAW,CAAC,QAAQ,CAAC,QAmBvB"}
|
package/build/views/Sitemap.js
CHANGED
|
@@ -95,9 +95,7 @@ function FileItem({ route, level = 0, parents = [], isInitial = false, }) {
|
|
|
95
95
|
// Ensure the modal pops
|
|
96
96
|
navigation.goBack();
|
|
97
97
|
}
|
|
98
|
-
}, style: { flex: 1, display: "flex" },
|
|
99
|
-
// @ts-expect-error: disabled not on type
|
|
100
|
-
disabled: disabled,
|
|
98
|
+
}, style: { flex: 1, display: "flex" }, disabled: disabled,
|
|
101
99
|
// Ensure we replace the history so you can't go back to this page.
|
|
102
100
|
replace: true },
|
|
103
101
|
React.createElement(View, { style: { flex: 1 } },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,eAAe;IACtB,MAAM,GAAG,GAAG,uBAAuB,EAAE,CAAC;IAEtC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAC/D,CAAC,GAAG,CAAC,CACN,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,O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QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC1D,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["import { Image, Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport { useNavigation } from \"@react-navigation/native\";\nimport { NativeStackNavigationOptions } from \"@react-navigation/native-stack\";\nimport React from \"react\";\nimport {\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { RouteNode, sortRoutes } from \"../Route\";\nimport { useRootRouteNodeContext } from \"../context\";\nimport { Link } from \"../link/Link\";\nimport { matchDeepDynamicRouteName } from \"../matchers\";\n\nconst INDENT = 24;\n\nfunction useSortedRoutes() {\n const ctx = useRootRouteNodeContext();\n\n const routes = React.useMemo(\n () => [ctx].filter((route) => !route.internal).sort(sortRoutes),\n [ctx]\n );\n return routes;\n}\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: \"sitemap\",\n headerShown: false,\n presentation: \"modal\",\n animation: \"default\",\n headerLargeTitle: false,\n headerTitleStyle: {\n color: \"white\",\n },\n\n headerTintColor: \"white\",\n headerLargeTitleStyle: {\n color: \"white\",\n },\n headerStyle: {\n backgroundColor: \"black\",\n // @ts-expect-error: mistyped\n borderBottomColor: \"#323232\",\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}\n >\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}\n >\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const navigation = useNavigation();\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split(\"/\")],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n \"/\" +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + \"/\" + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === \"index\" ? \"\" : v;\n })\n .filter(Boolean)\n .join(\"/\")\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split(\"/\");\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return (\n segments[segments.length - 2] + \"/\" + segments[segments.length - 1]\n );\n }\n\n const segmentCount = route.route.split(\"/\").length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join(\"/\");\n }, [route]);\n\n const info = isInitial ? \"Initial\" : route.generated ? \"Virtual\" : \"\";\n\n return (\n <>\n {!route.internal && (\n <Pressable>\n {({ pressed, hovered }) => (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== \"web\") {\n // Ensure the modal pops\n navigation.goBack();\n }\n }}\n style={{ flex: 1, display: \"flex\" }}\n // @ts-expect-error: disabled not on type\n disabled={disabled}\n // Ensure we replace the history so you can't go back to this page.\n replace\n >\n <View style={{ flex: 1 }}>\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered\n ? \"rgba(255,255,255,0.1)\"\n : \"transparent\",\n },\n pressed && { backgroundColor: \"#323232\" },\n disabled && { opacity: 0.4 },\n ]}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {!!info && (\n <Text\n style={[\n styles.virtual,\n !disabled && { marginRight: 8 },\n ]}\n >\n {info}\n </Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n </View>\n </Link>\n )}\n </Pressable>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/file.png\")}\n />\n );\n}\n\nfunction PkgIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/pkg.png\")}\n />\n );\n}\n\nfunction ForwardIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/forward.png\")}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"black\",\n flex: 1,\n alignItems: \"stretch\",\n },\n main: {\n marginHorizontal: \"auto\",\n flex: 1,\n\n alignItems: \"stretch\",\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: \"stretch\",\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: \"#323232\",\n borderRadius: 19,\n marginBottom: 12,\n overflow: \"hidden\",\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n transitionDuration: \"100ms\",\n },\n filename: { color: \"white\", fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: \"right\", color: \"white\" },\n image: { width: 24, height: 24, resizeMode: \"contain\" },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"Sitemap.js","sourceRoot":"","sources":["../../src/views/Sitemap.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,OAAO,EAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,eAAe;IACtB,MAAM,GAAG,GAAG,uBAAuB,EAAE,CAAC;IAEtC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,EAC/D,CAAC,GAAG,CAAC,CACN,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,OAAO;QACrB,SAAS,EAAE,SAAS;QACpB,gBAAgB,EAAE,KAAK;QACvB,gBAAgB,EAAE;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O,EAAE,KAAK,EAAE,OAAO,EAAE;IAC/C,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE;CACxD,CAAC,CAAC","sourcesContent":["import { Image, Pressable, StyleSheet, Text, View } from \"@bacons/react-views\";\nimport { useNavigation } from \"@react-navigation/native\";\nimport { NativeStackNavigationOptions } from \"@react-navigation/native-stack\";\nimport React from \"react\";\nimport {\n ScrollView,\n Platform,\n StatusBar,\n useWindowDimensions,\n} from \"react-native\";\nimport { useSafeAreaInsets } from \"react-native-safe-area-context\";\n\nimport { RouteNode, sortRoutes } from \"../Route\";\nimport { useRootRouteNodeContext } from \"../context\";\nimport { Link } from \"../link/Link\";\nimport { matchDeepDynamicRouteName } from \"../matchers\";\n\nconst INDENT = 24;\n\nfunction useSortedRoutes() {\n const ctx = useRootRouteNodeContext();\n\n const routes = React.useMemo(\n () => [ctx].filter((route) => !route.internal).sort(sortRoutes),\n [ctx]\n );\n return routes;\n}\n\nexport function getNavOptions(): NativeStackNavigationOptions {\n return {\n title: \"sitemap\",\n headerShown: false,\n presentation: \"modal\",\n animation: \"default\",\n headerLargeTitle: false,\n headerTitleStyle: {\n color: \"white\",\n },\n\n headerTintColor: \"white\",\n headerLargeTitleStyle: {\n color: \"white\",\n },\n headerStyle: {\n backgroundColor: \"black\",\n // @ts-expect-error: mistyped\n borderBottomColor: \"#323232\",\n },\n };\n}\n\nexport function Sitemap() {\n const { top, bottom } = useSafeAreaInsets();\n const { width } = useWindowDimensions();\n return (\n <View style={styles.container}>\n <StatusBar barStyle=\"light-content\" />\n <View\n style={[\n styles.main,\n {\n minWidth: Math.min(960, width * 0.9),\n },\n ]}\n >\n <ScrollView\n contentContainerStyle={[\n styles.scroll,\n {\n paddingTop: top + 12,\n paddingBottom: bottom + 12,\n },\n ]}\n style={{ flex: 1 }}\n >\n <FileSystemView />\n </ScrollView>\n </View>\n </View>\n );\n}\n\nfunction FileSystemView() {\n const routes = useSortedRoutes();\n\n return (\n <>\n {routes.map((child) => (\n <View key={child.contextKey} style={styles.itemContainer}>\n <FileItem route={child} />\n </View>\n ))}\n </>\n );\n}\n\nfunction FileItem({\n route,\n level = 0,\n parents = [],\n isInitial = false,\n}: {\n route: RouteNode;\n level?: number;\n parents?: string[];\n isInitial?: boolean;\n}) {\n const disabled = route.children.length > 0;\n\n const navigation = useNavigation();\n\n const segments = React.useMemo(\n () => [...parents, ...route.route.split(\"/\")],\n [parents, route.route]\n );\n\n const href = React.useMemo(() => {\n return (\n \"/\" +\n segments\n .map((v) => {\n // add an extra layer of entropy to the url for deep dynamic routes\n if (matchDeepDynamicRouteName(v)) {\n return v + \"/\" + Date.now();\n }\n // index must be erased but groups can be preserved.\n return v === \"index\" ? \"\" : v;\n })\n .filter(Boolean)\n .join(\"/\")\n );\n }, [segments, route.route]);\n\n const filename = React.useMemo(() => {\n const segments = route.contextKey.split(\"/\");\n // join last two segments for layout routes\n if (route.contextKey.match(/_layout\\.[jt]sx?$/)) {\n return (\n segments[segments.length - 2] + \"/\" + segments[segments.length - 1]\n );\n }\n\n const segmentCount = route.route.split(\"/\").length;\n\n // Join the segment count in reverse order\n // This presents files without layout routes as children with all relevant segments.\n return segments.slice(-segmentCount).join(\"/\");\n }, [route]);\n\n const info = isInitial ? \"Initial\" : route.generated ? \"Virtual\" : \"\";\n\n return (\n <>\n {!route.internal && (\n <Pressable>\n {({ pressed, hovered }) => (\n <Link\n accessibilityLabel={route.contextKey}\n href={href}\n onPress={() => {\n if (Platform.OS !== \"web\") {\n // Ensure the modal pops\n navigation.goBack();\n }\n }}\n style={{ flex: 1, display: \"flex\" }}\n disabled={disabled}\n // Ensure we replace the history so you can't go back to this page.\n replace\n >\n <View style={{ flex: 1 }}>\n <View\n style={[\n styles.itemPressable,\n {\n paddingLeft: INDENT + level * INDENT,\n backgroundColor: hovered\n ? \"rgba(255,255,255,0.1)\"\n : \"transparent\",\n },\n pressed && { backgroundColor: \"#323232\" },\n disabled && { opacity: 0.4 },\n ]}\n >\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {route.children.length ? <PkgIcon /> : <FileIcon />}\n <Text style={styles.filename}>{filename}</Text>\n </View>\n\n <View style={{ flexDirection: \"row\", alignItems: \"center\" }}>\n {!!info && (\n <Text\n style={[\n styles.virtual,\n !disabled && { marginRight: 8 },\n ]}\n >\n {info}\n </Text>\n )}\n {!disabled && <ForwardIcon />}\n </View>\n </View>\n </View>\n </Link>\n )}\n </Pressable>\n )}\n {route.children.map((child) => (\n <FileItem\n key={child.contextKey}\n route={child}\n isInitial={route.initialRouteName === child.route}\n parents={segments}\n level={level + (route.generated ? 0 : 1)}\n />\n ))}\n </>\n );\n}\n\nfunction FileIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/file.png\")}\n />\n );\n}\n\nfunction PkgIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/pkg.png\")}\n />\n );\n}\n\nfunction ForwardIcon() {\n return (\n <Image\n style={styles.image}\n source={require(\"expo-router/assets/forward.png\")}\n />\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n backgroundColor: \"black\",\n flex: 1,\n alignItems: \"stretch\",\n },\n main: {\n marginHorizontal: \"auto\",\n flex: 1,\n\n alignItems: \"stretch\",\n },\n scroll: {\n paddingHorizontal: 12,\n // flex: 1,\n // paddingTop: top + 12,\n alignItems: \"stretch\",\n },\n itemContainer: {\n borderWidth: 1,\n borderColor: \"#323232\",\n borderRadius: 19,\n marginBottom: 12,\n overflow: \"hidden\",\n },\n itemPressable: {\n paddingHorizontal: INDENT,\n paddingVertical: 16,\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n transitionDuration: \"100ms\",\n },\n filename: { color: \"white\", fontSize: 20, marginLeft: 12 },\n virtual: { textAlign: \"right\", color: \"white\" },\n image: { width: 24, height: 24, resizeMode: \"contain\" },\n});\n"]}
|
package/build/views/Splash.js
CHANGED
|
@@ -59,7 +59,7 @@ SplashScreen.preventAutoHideAsync = () => {
|
|
|
59
59
|
}
|
|
60
60
|
_preventAutoHideAsyncInvoked = true;
|
|
61
61
|
// Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
|
|
62
|
-
if (Platform.OS !== "web" && ErrorUtils
|
|
62
|
+
if (Platform.OS !== "web" && ErrorUtils?.getGlobalHandler) {
|
|
63
63
|
const originalHandler = ErrorUtils.getGlobalHandler();
|
|
64
64
|
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
65
65
|
SplashScreen.hideAsync();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Splash.js","sourceRoot":"","sources":["../../src/views/Splash.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,MAAM,WAAW,GAAa,EAAE,CAAC;AAEjC,IAAI,YAAY,GAA+C,IAAI,CAAC;AAEpE,IAAI;IACF,IAAI,kBAAkB,CAAC,gBAAgB,EAAE;QACvC,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;KAC9C;CACF;AAAC,OAAO,CAAC,EAAE;IACV,SAAS;CACV;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,YAAY;IAC1B,eAAe,EAAE,CAAC;IAClB,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,eAAe;IACtB,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAgB,IAAI,CAAC,CAAC;IAEhD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,0CAA0C;QAC1C,KAAK,CAAC,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;QAC1C,OAAO,GAAG,EAAE;YACV,IAAI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pC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,YAAY,CAAC,SAAS,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QAChB,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;KAC9B;IACD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE;QAC5B,YAAY,CAAC,SAAS,EAAE,CAAC;KAC1B;AACH,CAAC,CAAC;AAEF,+DAA+D","sourcesContent":["import { NativeModulesProxy } from \"expo-modules-core\";\nimport { nanoid } from \"nanoid/non-secure\";\nimport * as React from \"react\";\nimport { Platform } from \"react-native\";\nconst globalStack: string[] = [];\n\nlet SplashModule: typeof import(\"expo-splash-screen\") | null = null;\n\ntry {\n if (NativeModulesProxy.ExpoSplashScreen) {\n SplashModule = require(\"expo-splash-screen\");\n }\n} catch (e) {\n // Ignore\n}\n\n/**\n * A stack based component for keeping the splash screen visible.\n * Useful for stacked requests that need to be completed before the app is ready.\n * After all instances have been unmounted, the splash screen will be hidden.\n *\n * @example\n * ```tsx\n * function App() {\n * const [isLoading, setIsLoading] = React.useState(true);\n *\n * if (isLoading) {\n * return <SplashScreen />\n * }\n *\n * return <Text>Ready!</Text>\n * }\n * ```\n */\nexport function SplashScreen() {\n useGlobalSplash();\n return null;\n}\n\nfunction useGlobalSplash() {\n const stack = React.useRef<string | null>(null);\n\n React.useEffect(() => {\n // Create a stack entry on component mount\n stack.current = SplashScreen._pushEntry();\n return () => {\n if (stack.current) {\n // Update on component unmount\n SplashScreen._popEntry(stack.current);\n }\n };\n }, []);\n}\n\nSplashScreen.hideAsync = () => {\n SplashModule?.hideAsync();\n globalStack.length = 0;\n};\n\nlet _preventAutoHideAsyncInvoked = false;\n\nSplashScreen.preventAutoHideAsync = () => {\n // Memoize, this should only be called once.\n if (_preventAutoHideAsyncInvoked) {\n return;\n }\n _preventAutoHideAsyncInvoked = true;\n // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.\n if (Platform.OS !== \"web\" && ErrorUtils?.getGlobalHandler) {\n const originalHandler = ErrorUtils.getGlobalHandler();\n ErrorUtils.setGlobalHandler((error, isFatal) => {\n SplashScreen.hideAsync();\n originalHandler(error, isFatal);\n });\n }\n SplashModule?.preventAutoHideAsync();\n};\n\nSplashScreen._pushEntry = (): any => {\n const entry = nanoid();\n globalStack.push(entry);\n SplashScreen.preventAutoHideAsync();\n return entry;\n};\n\nSplashScreen._popEntry = (entry: string) => {\n const index = globalStack.indexOf(entry);\n if (index !== -1) {\n globalStack.splice(index, 1);\n }\n if (globalStack.length === 0) {\n SplashScreen.hideAsync();\n }\n};\n\n// TODO: Add some detection for if the splash screen is visible\n"]}
|
package/build/views/Try.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
/** Props passed to a page's `ErrorBoundary` export. */
|
|
3
|
-
export
|
|
3
|
+
export type ErrorBoundaryProps = {
|
|
4
4
|
/** Retry rendering the component by clearing the `error` state. */
|
|
5
5
|
retry: () => Promise<void>;
|
|
6
6
|
/** The error that was thrown. */
|
package/build/views/Try.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,uDAAuD;AACvD,
|
|
1
|
+
{"version":3,"file":"Try.d.ts","sourceRoot":"","sources":["../../src/views/Try.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,uDAAuD;AACvD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,mEAAmE;IACnE,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,iCAAiC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAGF,qBAAa,GAAI,SAAQ,KAAK,CAAC,SAAS,CACtC;IACE,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,EACD;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAClB;IACC,KAAK;;MAAwB;IAE7B,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,KAAK;;;IAO5C,KAAK,sBAMH;IAEF,MAAM;CAQP"}
|