first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import Stack from './StackClient';
export default Stack;
//# sourceMappingURL=BaseStack.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BaseStack.d.ts","sourceRoot":"","sources":["../../src/layouts/BaseStack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,eAAe,CAAC;AAElC,eAAe,KAAK,CAAC"}

8
node_modules/expo-router/build/layouts/BaseStack.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const StackClient_1 = __importDefault(require("./StackClient"));
exports.default = StackClient_1.default;
//# sourceMappingURL=BaseStack.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"BaseStack.js","sourceRoot":"","sources":["../../src/layouts/BaseStack.tsx"],"names":[],"mappings":";;;;;AAAA,gEAAkC;AAElC,kBAAe,qBAAK,CAAC","sourcesContent":["import Stack from './StackClient';\n\nexport default Stack;\n"]}

4
node_modules/expo-router/build/layouts/Drawer.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import Drawer from './DrawerClient';
export { Drawer };
export default Drawer;
//# sourceMappingURL=Drawer.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,gBAAgB,CAAC;AAKpC,OAAO,EAAE,MAAM,EAAE,CAAC;AAElB,eAAe,MAAM,CAAC"}

12
node_modules/expo-router/build/layouts/Drawer.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Drawer = void 0;
const DrawerClient_1 = __importDefault(require("./DrawerClient"));
exports.Drawer = DrawerClient_1.default;
const Screen_1 = require("../views/Screen");
DrawerClient_1.default.Screen = Screen_1.Screen;
exports.default = DrawerClient_1.default;
//# sourceMappingURL=Drawer.js.map

1
node_modules/expo-router/build/layouts/Drawer.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Drawer.js","sourceRoot":"","sources":["../../src/layouts/Drawer.tsx"],"names":[],"mappings":";;;;;;AAAA,kEAAoC;AAK3B,iBALF,sBAAM,CAKE;AAJf,4CAAyC;AAEzC,sBAAM,CAAC,MAAM,GAAG,eAAM,CAAC;AAIvB,kBAAe,sBAAM,CAAC","sourcesContent":["import Drawer from './DrawerClient';\nimport { Screen } from '../views/Screen';\n\nDrawer.Screen = Screen;\n\nexport { Drawer };\n\nexport default Drawer;\n"]}

View File

@@ -0,0 +1,106 @@
import { DrawerNavigationOptions, DrawerNavigationEventMap } from '@react-navigation/drawer';
import { DrawerNavigationState, ParamListBase } from '@react-navigation/native';
export declare const Drawer: import("react").ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
children: React.ReactNode;
layout?: ((props: {
state: DrawerNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<DrawerNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, DrawerNavigationState<ParamListBase>, DrawerNavigationOptions, DrawerNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
drawerItemPress: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "drawerItemPress", true>;
transitionStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureStart", unknown>;
gestureEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureCancel", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>;
}) => Partial<{
drawerItemPress: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "drawerItemPress", true>;
transitionStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureStart", unknown>;
gestureEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureCancel", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: DrawerNavigationOptions | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>;
theme: ReactNavigation.Theme;
}) => DrawerNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, DrawerNavigationOptions, import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & {
id?: undefined;
}, "children"> & Partial<Pick<Omit<import("@react-navigation/drawer").DrawerNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
children: React.ReactNode;
layout?: ((props: {
state: DrawerNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<DrawerNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, DrawerNavigationState<ParamListBase>, DrawerNavigationOptions, DrawerNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
drawerItemPress: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "drawerItemPress", true>;
transitionStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureStart", unknown>;
gestureEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureCancel", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>;
}) => Partial<{
drawerItemPress: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "drawerItemPress", true>;
transitionStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureStart: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureStart", unknown>;
gestureEnd: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "gestureCancel", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<DrawerNavigationEventMap & import("@react-navigation/native").EventMapCore<DrawerNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: DrawerNavigationOptions | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>;
theme: ReactNavigation.Theme;
}) => DrawerNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, DrawerNavigationOptions, import("@react-navigation/drawer").DrawerNavigationProp<ParamListBase, string, undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<DrawerNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<DrawerNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & {
id?: undefined;
}, "children">> & import("react").RefAttributes<unknown>> & {
Screen: (props: import("..").ScreenProps<DrawerNavigationOptions, DrawerNavigationState<ParamListBase>, DrawerNavigationEventMap>) => null;
Protected: typeof import("../views/Protected").Protected;
};
export default Drawer;
//# sourceMappingURL=DrawerClient.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DrawerClient.d.ts","sourceRoot":"","sources":["../../src/layouts/DrawerClient.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMhF,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKD,CAAC;AAEnB,eAAe,MAAM,CAAC"}

10
node_modules/expo-router/build/layouts/DrawerClient.js generated vendored Normal file
View File

@@ -0,0 +1,10 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.Drawer = void 0;
const drawer_1 = require("@react-navigation/drawer");
const withLayoutContext_1 = require("./withLayoutContext");
const DrawerNavigator = (0, drawer_1.createDrawerNavigator)().Navigator;
exports.Drawer = (0, withLayoutContext_1.withLayoutContext)(DrawerNavigator);
exports.default = exports.Drawer;
//# sourceMappingURL=DrawerClient.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"DrawerClient.js","sourceRoot":"","sources":["../../src/layouts/DrawerClient.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,qDAIkC;AAGlC,2DAAwD;AAExD,MAAM,eAAe,GAAG,IAAA,8BAAqB,GAAE,CAAC,SAAS,CAAC;AAE7C,QAAA,MAAM,GAAG,IAAA,qCAAiB,EAKrC,eAAe,CAAC,CAAC;AAEnB,kBAAe,cAAM,CAAC","sourcesContent":["'use client';\n\nimport {\n createDrawerNavigator,\n DrawerNavigationOptions,\n DrawerNavigationEventMap,\n} from '@react-navigation/drawer';\nimport { DrawerNavigationState, ParamListBase } from '@react-navigation/native';\n\nimport { withLayoutContext } from './withLayoutContext';\n\nconst DrawerNavigator = createDrawerNavigator().Navigator;\n\nexport const Drawer = withLayoutContext<\n DrawerNavigationOptions,\n typeof DrawerNavigator,\n DrawerNavigationState<ParamListBase>,\n DrawerNavigationEventMap\n>(DrawerNavigator);\n\nexport default Drawer;\n"]}

View File

@@ -0,0 +1,9 @@
import { type ComponentProps } from 'react';
import { RouterModal } from '../modal/web/ModalStack';
import { Screen } from '../views/Screen';
declare const _default: (({ children, ...props }: ComponentProps<typeof RouterModal>) => import("react").JSX.Element) & {
Screen: typeof Screen;
Protected: import("react").FunctionComponent<import("../views/Protected").ProtectedProps>;
};
export default _default;
//# sourceMappingURL=ExperimentalModalStack.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ExperimentalModalStack.d.ts","sourceRoot":"","sources":["../../src/layouts/ExperimentalModalStack.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIrD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;kDAGd,cAAc,CAAC,OAAO,WAAW,CAAC;;;;AAD7D,wBAYE"}

View File

@@ -0,0 +1,17 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const StackClient_1 = require("./StackClient");
const stack_utils_1 = require("./stack-utils");
const ModalStack_1 = require("../modal/web/ModalStack");
const Protected_1 = require("../views/Protected");
const Screen_1 = require("../views/Screen");
exports.default = Object.assign(({ children, ...props }) => {
const rnChildren = (0, react_1.useMemo)(() => (0, stack_utils_1.mapProtectedScreen)({ guard: true, children }).children, [children]);
return <ModalStack_1.RouterModal {...props} UNSTABLE_router={StackClient_1.stackRouterOverride} children={rnChildren}/>;
}, {
Screen: Screen_1.Screen,
Protected: Protected_1.Protected,
});
//# sourceMappingURL=ExperimentalModalStack.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"ExperimentalModalStack.js","sourceRoot":"","sources":["../../src/layouts/ExperimentalModalStack.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AACb,iCAAqD;AAErD,+CAAoD;AACpD,+CAAmD;AACnD,wDAAsD;AACtD,kDAA+C;AAC/C,4CAAyC;AAEzC,kBAAe,MAAM,CAAC,MAAM,CAC1B,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAsC,EAAE,EAAE;IAC7D,MAAM,UAAU,GAAG,IAAA,eAAO,EACxB,GAAG,EAAE,CAAC,IAAA,gCAAkB,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAC5D,CAAC,QAAQ,CAAC,CACX,CAAC;IACF,OAAO,CAAC,wBAAW,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,iCAAmB,CAAC,CAAC,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAG,CAAC;AAChG,CAAC,EACD;IACE,MAAM,EAAN,eAAM;IACN,SAAS,EAAT,qBAAS;CACV,CACF,CAAC","sourcesContent":["'use client';\nimport { useMemo, type ComponentProps } from 'react';\n\nimport { stackRouterOverride } from './StackClient';\nimport { mapProtectedScreen } from './stack-utils';\nimport { RouterModal } from '../modal/web/ModalStack';\nimport { Protected } from '../views/Protected';\nimport { Screen } from '../views/Screen';\n\nexport default Object.assign(\n ({ children, ...props }: ComponentProps<typeof RouterModal>) => {\n const rnChildren = useMemo(\n () => mapProtectedScreen({ guard: true, children }).children,\n [children]\n );\n return <RouterModal {...props} UNSTABLE_router={stackRouterOverride} children={rnChildren} />;\n },\n {\n Screen,\n Protected,\n }\n);\n"]}

View File

@@ -0,0 +1,2 @@
export declare const IsWithinLayoutContext: import("react").Context<boolean>;
//# sourceMappingURL=IsWithinLayoutContext.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IsWithinLayoutContext.d.ts","sourceRoot":"","sources":["../../src/layouts/IsWithinLayoutContext.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,kCAAuB,CAAC"}

View File

@@ -0,0 +1,7 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsWithinLayoutContext = void 0;
const react_1 = require("react");
exports.IsWithinLayoutContext = (0, react_1.createContext)(false);
//# sourceMappingURL=IsWithinLayoutContext.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"IsWithinLayoutContext.js","sourceRoot":"","sources":["../../src/layouts/IsWithinLayoutContext.ts"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAAsC;AAEzB,QAAA,qBAAqB,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC","sourcesContent":["'use client';\n\nimport { createContext } from 'react';\n\nexport const IsWithinLayoutContext = createContext(false);\n"]}

12
node_modules/expo-router/build/layouts/RootModal.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
type RootModalContextValue = {
root: boolean;
routes: never[];
addModal: (name: string) => void;
removeModal: (name: string) => void;
};
export declare const RootModalContext: import("react").Context<RootModalContextValue>;
export declare function RootModalProvider({ children }: {
children: React.ReactNode;
}): import("react").JSX.Element;
export {};
//# sourceMappingURL=RootModal.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"RootModal.d.ts","sourceRoot":"","sources":["../../src/layouts/RootModal.tsx"],"names":[],"mappings":"AAEA,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,gDAK3B,CAAC;AAEH,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,+BAe5E"}

26
node_modules/expo-router/build/layouts/RootModal.js generated vendored Normal file
View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RootModalContext = void 0;
exports.RootModalProvider = RootModalProvider;
const react_1 = require("react");
exports.RootModalContext = (0, react_1.createContext)({
root: true,
routes: [],
addModal: () => { },
removeModal: () => { },
});
function RootModalProvider({ children }) {
const parent = (0, react_1.use)(exports.RootModalContext);
const [state, setState] = (0, react_1.useState)(() => ({
root: false,
routes: [],
addModal: (name) => {
return parent.root ? setState((state) => ({ ...state })) : parent.addModal(name);
},
removeModal: (name) => {
return parent.root ? setState((state) => ({ ...state })) : parent.addModal(name);
},
}));
return <exports.RootModalContext.Provider value={state}>{children}</exports.RootModalContext.Provider>;
}
//# sourceMappingURL=RootModal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"RootModal.js","sourceRoot":"","sources":["../../src/layouts/RootModal.tsx"],"names":[],"mappings":";;;AAgBA,8CAeC;AA/BD,iCAAqD;AASxC,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAAwB;IACnE,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,EAAE;IACV,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;IAClB,WAAW,EAAE,GAAG,EAAE,GAAE,CAAC;CACtB,CAAC,CAAC;AAEH,SAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAiC;IAC3E,MAAM,MAAM,GAAG,IAAA,WAAG,EAAC,wBAAgB,CAAC,CAAC;IAErC,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAwB,GAAG,EAAE,CAAC,CAAC;QAC/D,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE,CAAC,IAAY,EAAE,EAAE;YACzB,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnF,CAAC;QACD,WAAW,EAAE,CAAC,IAAY,EAAE,EAAE;YAC5B,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnF,CAAC;KACF,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,wBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,wBAAgB,CAAC,QAAQ,CAAC,CAAC;AACzF,CAAC","sourcesContent":["import { createContext, use, useState } from 'react';\n\ntype RootModalContextValue = {\n root: boolean;\n routes: never[];\n addModal: (name: string) => void;\n removeModal: (name: string) => void;\n};\n\nexport const RootModalContext = createContext<RootModalContextValue>({\n root: true,\n routes: [],\n addModal: () => {},\n removeModal: () => {},\n});\n\nexport function RootModalProvider({ children }: { children: React.ReactNode }) {\n const parent = use(RootModalContext);\n\n const [state, setState] = useState<RootModalContextValue>(() => ({\n root: false,\n routes: [],\n addModal: (name: string) => {\n return parent.root ? setState((state) => ({ ...state })) : parent.addModal(name);\n },\n removeModal: (name: string) => {\n return parent.root ? setState((state) => ({ ...state })) : parent.addModal(name);\n },\n }));\n\n return <RootModalContext.Provider value={state}>{children}</RootModalContext.Provider>;\n}\n"]}

4
node_modules/expo-router/build/layouts/Stack.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import Stack from './StackClient';
export { Stack };
export default Stack;
//# sourceMappingURL=Stack.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Stack.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,eAAe,CAAC;AASlC,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAe,KAAK,CAAC"}

16
node_modules/expo-router/build/layouts/Stack.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stack = void 0;
const StackClient_1 = __importDefault(require("./StackClient"));
exports.Stack = StackClient_1.default;
const stack_utils_1 = require("./stack-utils");
// Note(@ubax): Importing StackToolbar from separate file for rsc to work correctly
const StackToolbar_1 = require("./stack-utils/toolbar/StackToolbar");
StackClient_1.default.Screen = stack_utils_1.StackScreen;
StackClient_1.default.Header = stack_utils_1.StackHeader;
StackClient_1.default.Toolbar = StackToolbar_1.StackToolbar;
exports.default = StackClient_1.default;
//# sourceMappingURL=Stack.js.map

1
node_modules/expo-router/build/layouts/Stack.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Stack.js","sourceRoot":"","sources":["../../src/layouts/Stack.tsx"],"names":[],"mappings":";;;;;;AAAA,gEAAkC;AASzB,gBATF,qBAAK,CASE;AARd,+CAAyD;AACzD,mFAAmF;AACnF,qEAAkE;AAElE,qBAAK,CAAC,MAAM,GAAG,yBAAW,CAAC;AAC3B,qBAAK,CAAC,MAAM,GAAG,yBAAW,CAAC;AAC3B,qBAAK,CAAC,OAAO,GAAG,2BAAY,CAAC;AAI7B,kBAAe,qBAAK,CAAC","sourcesContent":["import Stack from './StackClient';\nimport { StackScreen, StackHeader } from './stack-utils';\n// Note(@ubax): Importing StackToolbar from separate file for rsc to work correctly\nimport { StackToolbar } from './stack-utils/toolbar/StackToolbar';\n\nStack.Screen = StackScreen;\nStack.Header = StackHeader;\nStack.Toolbar = StackToolbar;\n\nexport { Stack };\n\nexport default Stack;\n"]}

View File

@@ -0,0 +1,4 @@
import Stack from './_web-modal';
export { Stack };
export default Stack;
//# sourceMappingURL=Stack.web.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Stack.web.d.ts","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,cAAc,CAAC;AAMjC,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB,eAAe,KAAK,CAAC"}

16
node_modules/expo-router/build/layouts/Stack.web.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Stack = void 0;
// This will be changed to `ExperimentalModalStack` in @expo/cli/src/start/server/metro/withMetroMultiPlatform.ts
// When the `EXPO_UNSTABLE_WEB_MODAL` env variable is truthy.
const _web_modal_1 = __importDefault(require("./_web-modal"));
exports.Stack = _web_modal_1.default;
const stack_utils_1 = require("./stack-utils");
_web_modal_1.default.Screen = stack_utils_1.StackScreen;
_web_modal_1.default.Header = stack_utils_1.StackHeader;
_web_modal_1.default.Toolbar = stack_utils_1.StackToolbar;
exports.default = _web_modal_1.default;
//# sourceMappingURL=Stack.web.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"Stack.web.js","sourceRoot":"","sources":["../../src/layouts/Stack.web.tsx"],"names":[],"mappings":";;;;;;AAAA,iHAAiH;AACjH,6DAA6D;AAC7D,8DAAiC;AAMxB,gBANF,oBAAK,CAME;AALd,+CAAuE;AAEvE,oBAAK,CAAC,MAAM,GAAG,yBAAW,CAAC;AAC3B,oBAAK,CAAC,MAAM,GAAG,yBAAW,CAAC;AAC3B,oBAAK,CAAC,OAAO,GAAG,0BAAY,CAAC;AAG7B,kBAAe,oBAAK,CAAC","sourcesContent":["// This will be changed to `ExperimentalModalStack` in @expo/cli/src/start/server/metro/withMetroMultiPlatform.ts\n// When the `EXPO_UNSTABLE_WEB_MODAL` env variable is truthy.\nimport Stack from './_web-modal';\nimport { StackScreen, StackHeader, StackToolbar } from './stack-utils';\n\nStack.Screen = StackScreen;\nStack.Header = StackHeader;\nStack.Toolbar = StackToolbar;\nexport { Stack };\n\nexport default Stack;\n"]}

181
node_modules/expo-router/build/layouts/StackClient.d.ts generated vendored Normal file
View File

@@ -0,0 +1,181 @@
import { ParamListBase, StackRouter as RNStackRouter, StackNavigationState, type RouteProp } from '@react-navigation/native';
import { NativeStackNavigationEventMap, NativeStackNavigationOptions } from '@react-navigation/native-stack';
import React, { ComponentProps } from 'react';
import { type StackScreenProps, StackSearchBar } from './stack-utils';
import { Protected } from '../views/Protected';
/**
* We extend NativeStackNavigationOptions with our custom props
* to allow for several extra props to be used on web, like modalWidth
*/
export type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {
webModalStyle?: {
/**
* Override the width of the modal (px or percentage). Only applies on web platform.
* @platform web
*/
width?: number | string;
/**
* Override the height of the modal (px or percentage). Applies on web desktop.
* @platform web
*/
height?: number | string;
/**
* Minimum height of the desktop modal (px or percentage). Overrides the default 640px clamp.
* @platform web
*/
minHeight?: number | string;
/**
* Minimum width of the desktop modal (px or percentage). Overrides the default 580px.
* @platform web
*/
minWidth?: number | string;
/**
* Override the border of the desktop modal (any valid CSS border value, e.g. '1px solid #ccc' or 'none').
* @platform web
*/
border?: string;
/**
* Override the overlay background color (any valid CSS color or rgba/hsla value).
* @platform web
*/
overlayBackground?: string;
/**
* Override the modal shadow filter (any valid CSS filter value, e.g. 'drop-shadow(0 4px 8px rgba(0,0,0,0.1))' or 'none').
* @platform web
*/
shadow?: string;
};
};
declare const RNStack: React.ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
children: React.ReactNode;
layout?: ((props: {
state: StackNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<NativeStackNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, StackNavigationState<ParamListBase>, NativeStackNavigationOptions, NativeStackNavigationEventMap>, RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
transitionStart: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "gestureCancel", unknown>;
sheetDetentChange: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "sheetDetentChange", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>;
}) => Partial<{
transitionStart: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "gestureCancel", unknown>;
sheetDetentChange: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "sheetDetentChange", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: NativeStackNavigationOptions | ((props: {
route: RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>;
theme: ReactNavigation.Theme;
}) => NativeStackNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & {
id?: undefined;
}, "children"> & Partial<Pick<Omit<import("@react-navigation/native-stack").NativeStackNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & {
children: React.ReactNode;
layout?: ((props: {
state: StackNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<NativeStackNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, StackNavigationState<ParamListBase>, NativeStackNavigationOptions, NativeStackNavigationEventMap>, RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
transitionStart: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "gestureCancel", unknown>;
sheetDetentChange: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "sheetDetentChange", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>;
}) => Partial<{
transitionStart: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "transitionEnd", unknown>;
gestureCancel: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "gestureCancel", unknown>;
sheetDetentChange: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "sheetDetentChange", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<NativeStackNavigationEventMap & import("@react-navigation/native").EventMapCore<StackNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: NativeStackNavigationOptions | ((props: {
route: RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>;
theme: ReactNavigation.Theme;
}) => NativeStackNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, NativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationProp<ParamListBase, string, undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<StackNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<StackNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & {
id?: undefined;
}, "children">> & React.RefAttributes<unknown>> & {
Screen: (props: import("../useScreens").ScreenProps<ExtendedStackNavigationOptions, StackNavigationState<ParamListBase>, NativeStackNavigationEventMap>) => null;
Protected: typeof Protected;
};
/**
* React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.
* When a screen has been uniquely identified, the Stack can only have one instance of that screen.
*
* Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.
*
* Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.
*
*/
export declare const stackRouterOverride: NonNullable<ComponentProps<typeof RNStack>['UNSTABLE_router']>;
/**
* Renders a native stack navigator.
*
* @hideType
*/
declare const Stack: ((props: ComponentProps<typeof RNStack>) => React.JSX.Element) & {
Screen: (({ children, options, ...rest }: StackScreenProps) => React.JSX.Element) & {
Title: typeof import("./stack-utils").StackScreenTitle;
BackButton: typeof import("./stack-utils").StackScreenBackButton;
};
Protected: React.FunctionComponent<import("../views/Protected").ProtectedProps>;
Header: typeof import("./stack-utils/StackHeaderComponent").StackHeaderComponent;
SearchBar: typeof StackSearchBar;
Toolbar: {
(props: import("./stack-utils").StackToolbarProps): React.JSX.Element;
Button: React.FC<import("./stack-utils").StackToolbarButtonProps>;
Menu: React.FC<import("./stack-utils").StackToolbarMenuProps>;
MenuAction: React.FC<import("./stack-utils").StackToolbarMenuActionProps>;
SearchBarSlot: React.FC<import("./stack-utils").StackToolbarSearchBarSlotProps>;
Spacer: React.FC<import("./stack-utils").StackToolbarSpacerProps>;
View: React.FC<import("./stack-utils").StackToolbarViewProps>;
Label: React.FC<import("./stack-utils").StackToolbarLabelProps>;
Icon: React.FC<import("./stack-utils").StackToolbarIconProps>;
Badge: React.FC<import("./stack-utils").StackToolbarBadgeProps>;
};
};
export default Stack;
export declare const StackRouter: typeof RNStackRouter;
//# sourceMappingURL=StackClient.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackClient.d.ts","sourceRoot":"","sources":["../../src/layouts/StackClient.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAKb,WAAW,IAAI,aAAa,EAE5B,oBAAoB,EACpB,KAAK,SAAS,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,EAAY,cAAc,EAAW,MAAM,OAAO,CAAC;AAcjE,OAAO,EACL,KAAK,gBAAgB,EAGrB,cAAc,EAKf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG,4BAA4B,GAAG;IAC1E,aAAa,CAAC,EAAE;QACd;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACxB;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACzB;;;WAGG;QACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC5B;;;WAGG;QACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3B;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB;;;WAGG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKU,CAAC;AA4CxB;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,WAAW,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,iBAAiB,CAAC,CA4U9F,CAAC;AA8DF;;;;GAIG;AACH,QAAA,MAAM,KAAK,WACD,cAAc,CAAC,OAAO,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;CA0DvC,CAAC;AAoCF,eAAe,KAAK,CAAC;AAErB,eAAO,MAAM,WAAW,EAAE,OAAO,aAMhC,CAAC"}

494
node_modules/expo-router/build/layouts/StackClient.js generated vendored Normal file
View File

@@ -0,0 +1,494 @@
"use strict";
'use client';
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackRouter = exports.stackRouterOverride = void 0;
const native_1 = require("@react-navigation/native");
const non_secure_1 = require("nanoid/non-secure");
const react_1 = __importStar(require("react"));
const withLayoutContext_1 = require("./withLayoutContext");
const createNativeStackNavigator_1 = require("../fork/native-stack/createNativeStackNavigator");
const LinkPreviewContext_1 = require("../link/preview/LinkPreviewContext");
const navigationParams_1 = require("../navigationParams");
const useScreens_1 = require("../useScreens");
const stack_utils_1 = require("./stack-utils");
const children_1 = require("../utils/children");
const Protected_1 = require("../views/Protected");
const NativeStackNavigator = (0, createNativeStackNavigator_1.createNativeStackNavigator)().Navigator;
const RNStack = (0, withLayoutContext_1.withLayoutContext)(NativeStackNavigator);
function isStackAction(action) {
return (action.type === 'PUSH' ||
action.type === 'NAVIGATE' ||
action.type === 'POP' ||
action.type === 'POP_TO_TOP' ||
action.type === 'REPLACE' ||
action.type === 'PRELOAD');
}
const isPreviewAction = (action) => !!action.payload &&
'params' in action.payload &&
typeof action.payload.params === 'object' &&
!!(0, navigationParams_1.getInternalExpoRouterParams)(action.payload?.params ?? undefined)[navigationParams_1.INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME];
const getZoomTransitionIdFromAction = (action) => {
const allParams = !!action.payload && 'params' in action.payload && typeof action.payload.params === 'object'
? action.payload.params
: undefined;
const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(allParams ?? undefined);
const val = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
if (val && typeof val === 'string') {
return val;
}
return undefined;
};
/**
* React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.
* When a screen has been uniquely identified, the Stack can only have one instance of that screen.
*
* Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.
*
* Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.
*
*/
const stackRouterOverride = (original) => {
return {
getStateForAction: (state, action, options) => {
if (action.target && action.target !== state.key) {
return null;
}
if (!isStackAction(action)) {
return original.getStateForAction(state, action, options);
}
// The dynamic getId added to an action, `router.push('screen', { singular: true })`
const actionSingularOptions = action.payload && 'singular' in action.payload
? action.payload.singular
: undefined;
// Handle if 'getID' or 'singular' is set.
function getIdFunction() {
// Actions can be fired by the user, so we do need to validate their structure.
if (!('payload' in action) ||
!action.payload ||
!('name' in action.payload) ||
typeof action.payload.name !== 'string') {
return;
}
const actionName = action.payload.name;
return (
// The dynamic singular added to an action, `router.push('screen', { singular: () => 'id' })`
getActionSingularIdFn(actionSingularOptions, actionName) ||
// The static getId added as a prop to `<Screen singular />` or `<Screen getId={} />`
options.routeGetIdList[actionName]);
}
const { routeParamList } = options;
switch (action.type) {
case 'PUSH':
case 'NAVIGATE': {
if (!state.routeNames.includes(action.payload.name)) {
return null;
}
// START FORK
const getId = getIdFunction();
// const getId = options.routeGetIdList[action.payload.name];
// END FORK
const id = getId?.({ params: action.payload.params });
let route;
if (id !== undefined) {
route = state.routes.findLast((route) => route.name === action.payload.name && id === getId?.({ params: route.params }));
}
else if (action.type === 'NAVIGATE') {
const currentRoute = state.routes[state.index];
// If the route matches the current one, then navigate to it
if (action.payload.name === currentRoute.name && !isPreviewAction(action)) {
route = currentRoute;
}
else if (action.payload.pop) {
route = state.routes.findLast((route) => route.name === action.payload.name);
}
}
// START FORK
let isPreloadedRoute = false;
if (isPreviewAction(action) && !route) {
route = state.preloadedRoutes.find((route) => route.name === action.payload.name && id === route.key);
isPreloadedRoute = !!route;
}
// END FORK
if (!route) {
route = state.preloadedRoutes.find((route) => route.name === action.payload.name && id === getId?.({ params: route.params }));
// START FORK
isPreloadedRoute = !!route;
// END FORK
}
let params;
if (action.type === 'NAVIGATE' && action.payload.merge && route) {
params =
action.payload.params !== undefined ||
routeParamList[action.payload.name] !== undefined
? {
...routeParamList[action.payload.name],
...route.params,
...action.payload.params,
}
: route.params;
}
else {
params =
routeParamList[action.payload.name] !== undefined
? {
...routeParamList[action.payload.name],
...action.payload.params,
}
: action.payload.params;
}
let routes;
if (route) {
if (action.type === 'NAVIGATE' && action.payload.pop) {
routes = [];
// Get all routes until the matching one
for (const r of state.routes) {
if (r.key === route.key) {
routes.push({
...route,
path: action.payload.path !== undefined ? action.payload.path : route.path,
params,
});
break;
}
routes.push(r);
}
}
else {
// START FORK
// If there is an id, then filter out the existing route with the same id.
// THIS ACTION IS DANGEROUS. This can cause React Native Screens to freeze
if (id !== undefined) {
routes = state.routes.filter((r) => r.key !== route.key);
}
else if (action.type === 'NAVIGATE' && state.routes.length > 0) {
// The navigation action should only replace the last route if it has the same name and path params.
const lastRoute = state.routes[state.routes.length - 1];
if ((0, useScreens_1.getSingularId)(lastRoute.name, { params: lastRoute.params }) ===
(0, useScreens_1.getSingularId)(route.name, { params })) {
routes = state.routes.slice(0, -1);
}
else {
routes = [...state.routes];
}
}
else {
routes = [...state.routes];
}
// If the routes length is the same as the state routes length, then we are navigating to a new route.
// Otherwise we are replacing an existing route.
// For preloaded route, we want to use the same key, so that preloaded screen is used.
const key = routes.length === state.routes.length && !isPreloadedRoute
? `${action.payload.name}-${(0, non_secure_1.nanoid)()}`
: route.key;
routes.push({
...route,
key,
path: action.type === 'NAVIGATE' && action.payload.path !== undefined
? action.payload.path
: route.path,
params,
});
// routes = state.routes.filter((r) => r.key !== route.key);
// routes.push({
// ...route,
// path:
// action.type === 'NAVIGATE' && action.payload.path !== undefined
// ? action.payload.path
// : route.path,
// params,
// });
// END FORK
}
}
else {
routes = [
...state.routes,
{
key: `${action.payload.name}-${(0, non_secure_1.nanoid)()}`,
name: action.payload.name,
path: action.type === 'NAVIGATE' ? action.payload.path : undefined,
params,
},
];
}
// START FORK
// return filterSingular(
const result = {
...state,
index: routes.length - 1,
preloadedRoutes: state.preloadedRoutes.filter((route) => routes[routes.length - 1].key !== route.key),
routes,
};
if (actionSingularOptions) {
return filterSingular(result, getId);
}
const zoomTransitionId = getZoomTransitionIdFromAction(action);
if (zoomTransitionId) {
const lastRoute = result.routes[result.routes.length - 1];
const key = lastRoute.key;
const modifiedLastRoute = {
...lastRoute,
params: {
...lastRoute.params,
[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME]: key,
},
};
return {
...result,
routes: [...result.routes.slice(0, -1), modifiedLastRoute],
};
}
return result;
// return {
// ...state,
// index: routes.length - 1,
// preloadedRoutes: state.preloadedRoutes.filter(
// (route) => routes[routes.length - 1].key !== route.key
// ),
// routes,
// };
// END FORK
}
case 'PRELOAD': {
// START FORK
// This will be the case for example for protected route
if (!state.routeNames.includes(action.payload.name)) {
return null;
}
// END FORK
const getId = options.routeGetIdList[action.payload.name];
const id = getId?.({ params: action.payload.params });
let route;
if (id !== undefined) {
route = state.routes.find((route) => route.name === action.payload.name && id === getId?.({ params: route.params }));
}
if (route) {
return {
...state,
routes: state.routes.map((r) => {
if (r.key !== route?.key) {
return r;
}
return {
...r,
params: routeParamList[action.payload.name] !== undefined
? {
...routeParamList[action.payload.name],
...action.payload.params,
}
: action.payload.params,
};
}),
};
}
else {
// START FORK
const currentPreloadedRoute = {
key: `${action.payload.name}-${(0, non_secure_1.nanoid)()}`,
name: action.payload.name,
params: routeParamList[action.payload.name] !== undefined
? {
...routeParamList[action.payload.name],
...action.payload.params,
}
: action.payload.params,
};
// END FORK
return {
...state,
// START FORK
// Adding the current preloaded route to the beginning of the preloadedRoutes array
// This ensures that the preloaded route will be the next one after the visible route
// and when navigation will happen, there will be no reshuffling
// This is a workaround for the link preview navigation issue, when screen would freeze after navigation from native side
// and reshuffling from react-navigation
preloadedRoutes: [currentPreloadedRoute].concat(state.preloadedRoutes.filter((r) => r.name !== action.payload.name || id !== getId?.({ params: r.params }))),
// preloadedRoutes: state.preloadedRoutes
// .filter(
// (r) =>
// r.name !== action.payload.name ||
// id !== getId?.({ params: r.params })
// )
// .concat({
// key: `${action.payload.name}-${nanoid()}`,
// name: action.payload.name,
// params:
// routeParamList[action.payload.name] !== undefined
// ? {
// ...routeParamList[action.payload.name],
// ...action.payload.params,
// }
// : action.payload.params,
// }),
// END FORK
};
}
}
default: {
return original.getStateForAction(state, action, options);
}
}
},
};
};
exports.stackRouterOverride = stackRouterOverride;
function getActionSingularIdFn(actionGetId, name) {
if (typeof actionGetId === 'function') {
return (options) => actionGetId(name, options.params ?? {});
}
else if (actionGetId === true) {
return (options) => (0, useScreens_1.getSingularId)(name, options);
}
return undefined;
}
/**
* If there is a dynamic singular on an action, then we need to filter the state to only have singular screens.
* As multiples may have been added before we did the singular navigation.
*/
function filterSingular(state, getId) {
if (!state) {
return state;
}
if (!state.routes) {
return state;
}
const currentIndex = state.index || state.routes.length - 1;
const current = state.routes[currentIndex];
const name = current.name;
const id = getId?.({ params: current.params });
if (!id) {
return state;
}
// TypeScript needs a type assertion here for the filter to work.
let routes = state.routes;
routes = routes.filter((route, index) => {
// If the route is the current route, keep it.
if (index === currentIndex) {
return true;
}
// Remove all other routes with the same name and id.
return name !== route.name || id !== getId?.({ params: route.params });
});
return {
...state,
index: routes.length - 1,
routes,
};
}
/**
* Renders a native stack navigator.
*
* @hideType
*/
const Stack = Object.assign((props) => {
const { isStackAnimationDisabled } = (0, LinkPreviewContext_1.useLinkPreviewContext)();
const screenOptionsWithCompositionAPIOptions = (0, react_1.useMemo)(() => {
const stackHeader = react_1.Children.toArray(props.children).find((child) => (0, children_1.isChildOfType)(child, stack_utils_1.StackHeader));
if (stackHeader) {
const screenStackProps = { children: stackHeader };
const currentOptions = props.screenOptions;
if (currentOptions) {
if (typeof currentOptions === 'function') {
return (...args) => {
const options = currentOptions(...args);
return (0, stack_utils_1.appendScreenStackPropsToOptions)(options, screenStackProps);
};
}
return (0, stack_utils_1.appendScreenStackPropsToOptions)(currentOptions, screenStackProps);
}
else {
return (0, stack_utils_1.appendScreenStackPropsToOptions)({}, screenStackProps);
}
}
else if (props.screenOptions) {
const screenOptions = props.screenOptions;
if (typeof screenOptions === 'function') {
return (0, stack_utils_1.validateStackPresentation)(screenOptions);
}
return (0, stack_utils_1.validateStackPresentation)(screenOptions);
}
return props.screenOptions;
}, [props.screenOptions, props.children]);
const screenOptions = (0, react_1.useMemo)(() => {
const condition = isStackAnimationDisabled ? () => true : shouldDisableAnimationBasedOnParams;
return disableAnimationInScreenOptions(screenOptionsWithCompositionAPIOptions, condition);
}, [screenOptionsWithCompositionAPIOptions, isStackAnimationDisabled]);
const rnChildren = (0, react_1.useMemo)(() => (0, stack_utils_1.mapProtectedScreen)({ guard: true, children: props.children }).children, [props.children]);
return (<RNStack {...props} children={rnChildren} screenOptions={screenOptions} UNSTABLE_router={exports.stackRouterOverride}/>);
}, {
Screen: stack_utils_1.StackScreen,
Protected: Protected_1.Protected,
Header: stack_utils_1.StackHeader,
SearchBar: stack_utils_1.StackSearchBar,
Toolbar: stack_utils_1.StackToolbar,
});
function disableAnimationInScreenOptions(options, condition) {
if (options && typeof options === 'function') {
return (props) => {
const oldOptions = options(props);
if (condition(props.route)) {
return {
...oldOptions,
animation: 'none',
};
}
return oldOptions ?? {};
};
}
return (props) => {
if (condition(props.route)) {
return {
...(options ?? {}),
animation: 'none',
};
}
return options ?? {};
};
}
function shouldDisableAnimationBasedOnParams(route) {
const expoParams = (0, navigationParams_1.getInternalExpoRouterParams)(route.params);
return !!expoParams[navigationParams_1.INTERNAL_EXPO_ROUTER_NO_ANIMATION_PARAM_NAME];
}
exports.default = Stack;
const StackRouter = (options) => {
const router = (0, native_1.StackRouter)(options);
return {
...router,
...(0, exports.stackRouterOverride)(router),
};
};
exports.StackRouter = StackRouter;
//# sourceMappingURL=StackClient.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,4 @@
import type { ComponentProps } from 'react';
import type { BottomTabNavigator } from './TabsClient';
export declare const tabRouterOverride: NonNullable<ComponentProps<BottomTabNavigator>['UNSTABLE_router']>;
//# sourceMappingURL=TabRouter.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabRouter.d.ts","sourceRoot":"","sources":["../../src/layouts/TabRouter.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,eAAO,MAAM,iBAAiB,EAAE,WAAW,CACzC,cAAc,CAAC,kBAAkB,CAAC,CAAC,iBAAiB,CAAC,CA8CtD,CAAC"}

45
node_modules/expo-router/build/layouts/TabRouter.js generated vendored Normal file
View File

@@ -0,0 +1,45 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.tabRouterOverride = void 0;
const tabRouterOverride = (original) => {
return {
...original,
getStateForAction: (state, action, options) => {
if (action.target && action.target !== state.key) {
return null;
}
if (isReplaceAction(action)) {
// Generate the state as if we were using JUMP_TO
let nextState = original.getStateForAction(state, {
...action,
type: 'JUMP_TO',
}, options);
if (!nextState || nextState.index === undefined || !Array.isArray(nextState.history)) {
return null;
}
// If the state is valid and we didn't JUMP_TO a single history state,
// then remove the previous state.
if (nextState.index !== 0) {
const previousIndex = nextState.index - 1;
nextState = {
...nextState,
key: `${nextState.key}-replace`,
// Omit the previous history entry that we are replacing
history: [
...nextState.history.slice(0, previousIndex),
...nextState.history.splice(nextState.index),
],
};
}
return nextState;
}
return original.getStateForAction(state, action, options);
},
};
};
exports.tabRouterOverride = tabRouterOverride;
function isReplaceAction(action) {
return action.type === 'REPLACE';
}
//# sourceMappingURL=TabRouter.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabRouter.js","sourceRoot":"","sources":["../../src/layouts/TabRouter.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAMN,MAAM,iBAAiB,GAE1B,CAAC,QAAQ,EAAE,EAAE;IACf,OAAO;QACL,GAAG,QAAQ;QACX,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YAC5C,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC;gBACjD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,eAAe,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC5B,iDAAiD;gBACjD,IAAI,SAAS,GAAG,QAAQ,CAAC,iBAAiB,CACxC,KAAK,EACL;oBACE,GAAG,MAAM;oBACT,IAAI,EAAE,SAAS;iBAChB,EACD,OAAO,CACR,CAAC;gBAEF,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;oBACrF,OAAO,IAAI,CAAC;gBACd,CAAC;gBAED,sEAAsE;gBACtE,kCAAkC;gBAClC,IAAI,SAAS,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;oBAC1B,MAAM,aAAa,GAAG,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC;oBAE1C,SAAS,GAAG;wBACV,GAAG,SAAS;wBACZ,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,UAAU;wBAC/B,wDAAwD;wBACxD,OAAO,EAAE;4BACP,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC;4BAC5C,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;yBAC7C;qBACF,CAAC;gBACJ,CAAC;gBAED,OAAO,SAAS,CAAC;YACnB,CAAC;YAED,OAAO,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,iBAAiB,qBA+C5B;AAEF,SAAS,eAAe,CACtB,MAAwB;IAExB,OAAO,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC;AACnC,CAAC","sourcesContent":["'use client';\nimport { type NavigationAction, type StackActionType } from '@react-navigation/native';\nimport type { ComponentProps } from 'react';\n\nimport type { BottomTabNavigator } from './TabsClient';\n\nexport const tabRouterOverride: NonNullable<\n ComponentProps<BottomTabNavigator>['UNSTABLE_router']\n> = (original) => {\n return {\n ...original,\n getStateForAction: (state, action, options) => {\n if (action.target && action.target !== state.key) {\n return null;\n }\n\n if (isReplaceAction(action)) {\n // Generate the state as if we were using JUMP_TO\n let nextState = original.getStateForAction(\n state,\n {\n ...action,\n type: 'JUMP_TO',\n },\n options\n );\n\n if (!nextState || nextState.index === undefined || !Array.isArray(nextState.history)) {\n return null;\n }\n\n // If the state is valid and we didn't JUMP_TO a single history state,\n // then remove the previous state.\n if (nextState.index !== 0) {\n const previousIndex = nextState.index - 1;\n\n nextState = {\n ...nextState,\n key: `${nextState.key}-replace`,\n // Omit the previous history entry that we are replacing\n history: [\n ...nextState.history.slice(0, previousIndex),\n ...nextState.history.splice(nextState.index),\n ],\n };\n }\n\n return nextState;\n }\n\n return original.getStateForAction(state, action, options);\n },\n };\n};\n\nfunction isReplaceAction(\n action: NavigationAction\n): action is Extract<StackActionType, { type: 'REPLACE' }> {\n return action.type === 'REPLACE';\n}\n"]}

4
node_modules/expo-router/build/layouts/Tabs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
import Tabs from './TabsClient';
export { Tabs };
export default Tabs;
//# sourceMappingURL=Tabs.d.ts.map

1
node_modules/expo-router/build/layouts/Tabs.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,cAAc,CAAC;AAKhC,OAAO,EAAE,IAAI,EAAE,CAAC;AAEhB,eAAe,IAAI,CAAC"}

12
node_modules/expo-router/build/layouts/Tabs.js generated vendored Normal file
View File

@@ -0,0 +1,12 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tabs = void 0;
const TabsClient_1 = __importDefault(require("./TabsClient"));
exports.Tabs = TabsClient_1.default;
const Screen_1 = require("../views/Screen");
TabsClient_1.default.Screen = Screen_1.Screen;
exports.default = TabsClient_1.default;
//# sourceMappingURL=Tabs.js.map

1
node_modules/expo-router/build/layouts/Tabs.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../src/layouts/Tabs.tsx"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAKvB,eALF,oBAAI,CAKE;AAJb,4CAAyC;AAEzC,oBAAI,CAAC,MAAM,GAAG,eAAM,CAAC;AAIrB,kBAAe,oBAAI,CAAC","sourcesContent":["import Tabs from './TabsClient';\nimport { Screen } from '../views/Screen';\n\nTabs.Screen = Screen;\n\nexport { Tabs };\n\nexport default Tabs;\n"]}

166
node_modules/expo-router/build/layouts/TabsClient.d.ts generated vendored Normal file
View File

@@ -0,0 +1,166 @@
import { BottomTabNavigationEventMap, BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
import { ParamListBase, TabNavigationState } from '@react-navigation/native';
import React, { ComponentProps } from 'react';
import { Href } from '../types';
import { Protected } from '../views/Protected';
declare const BottomTabNavigator: React.ComponentType<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & ({
children: React.ReactNode;
layout?: ((props: {
state: TabNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
}) => Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: BottomTabNavigationOptions | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
theme: ReactNavigation.Theme;
}) => BottomTabNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & ({
id?: undefined;
} | {
id: string;
}))>;
export type BottomTabNavigator = typeof BottomTabNavigator;
type TabsProps = BottomTabNavigationOptions & {
href?: Href | null;
};
declare const ExpoTabs: React.ForwardRefExoticComponent<Omit<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & ({
children: React.ReactNode;
layout?: ((props: {
state: TabNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
}) => Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: BottomTabNavigationOptions | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
theme: ReactNavigation.Theme;
}) => BottomTabNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & ({
id?: undefined;
} | {
id: string;
})), "children"> & Partial<Pick<Omit<import("@react-navigation/bottom-tabs").BottomTabNavigatorProps, "children" | "layout" | "initialRouteName" | "id" | "screenListeners" | "screenOptions" | "screenLayout" | "UNSTABLE_router" | "UNSTABLE_routeNamesChangeBehavior"> & import("@react-navigation/native").DefaultRouterOptions<string> & ({
children: React.ReactNode;
layout?: ((props: {
state: TabNavigationState<ParamListBase>;
navigation: import("@react-navigation/native").NavigationHelpers<ParamListBase, {}>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<BottomTabNavigationOptions, import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, TabNavigationState<ParamListBase>, BottomTabNavigationOptions, BottomTabNavigationEventMap>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
children: React.ReactNode;
}) => React.ReactElement) | undefined;
screenListeners?: Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}> | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
}) => Partial<{
tabPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabPress", true>;
tabLongPress: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "tabLongPress", unknown>;
transitionStart: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionStart", unknown>;
transitionEnd: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "transitionEnd", unknown>;
focus: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "focus", unknown>;
blur: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "blur", unknown>;
state: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "state", unknown>;
beforeRemove: import("@react-navigation/native").EventListenerCallback<BottomTabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<ParamListBase>>, "beforeRemove", true>;
}>) | undefined;
screenOptions?: BottomTabNavigationOptions | ((props: {
route: import("@react-navigation/native").RouteProp<ParamListBase, string>;
navigation: import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>;
theme: ReactNavigation.Theme;
}) => BottomTabNavigationOptions) | undefined;
screenLayout?: ((props: import("@react-navigation/native").ScreenLayoutArgs<ParamListBase, string, BottomTabNavigationOptions, import("@react-navigation/bottom-tabs").BottomTabNavigationProp<ParamListBase, string, string | undefined>>) => React.ReactElement) | undefined;
UNSTABLE_router?: (<Action extends Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>>(original: import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>) => Partial<import("@react-navigation/native").Router<TabNavigationState<ParamListBase>, Action>>) | undefined;
UNSTABLE_routeNamesChangeBehavior?: "firstMatch" | "lastUnhandled";
} & ({
id?: undefined;
} | {
id: string;
})), "children">> & React.RefAttributes<unknown>> & {
Screen: (props: import("..").ScreenProps<TabsProps, TabNavigationState<ParamListBase>, BottomTabNavigationEventMap>) => null;
Protected: typeof Protected;
};
/**
* Renders a tabs navigator.
*
* @hideType
*/
declare const Tabs: ((props: ComponentProps<typeof ExpoTabs>) => React.JSX.Element) & {
Screen: (props: import("..").ScreenProps<TabsProps, TabNavigationState<ParamListBase>, BottomTabNavigationEventMap>) => null;
Protected: React.FunctionComponent<import("../views/Protected").ProtectedProps>;
};
export default Tabs;
//# sourceMappingURL=TabsClient.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabsClient.d.ts","sourceRoot":"","sources":["../../src/layouts/TabsClient.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAE3B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAK9C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAuC,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAE3D,KAAK,SAAS,GAAG,0BAA0B,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CAAC;AAErE,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CZ,CAAC;AAEH;;;;GAIG;AACH,QAAA,MAAM,IAAI,WACA,cAAc,CAAC,OAAO,QAAQ,CAAC;;;CAOxC,CAAC;AAEF,eAAe,IAAI,CAAC"}

57
node_modules/expo-router/build/layouts/TabsClient.js generated vendored Normal file
View File

@@ -0,0 +1,57 @@
"use strict";
'use client';
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const bottom_tabs_1 = require("@react-navigation/bottom-tabs");
const react_1 = __importDefault(require("react"));
const react_native_1 = require("react-native");
const withLayoutContext_1 = require("./withLayoutContext");
const Link_1 = require("../link/Link");
const TabRouter_1 = require("./TabRouter");
const Protected_1 = require("../views/Protected");
// This is the only way to access the navigator.
const BottomTabNavigator = (0, bottom_tabs_1.createBottomTabNavigator)().Navigator;
const ExpoTabs = (0, withLayoutContext_1.withLayoutContext)(BottomTabNavigator, (screens) => {
// Support the `href` shortcut prop.
return screens.map((screen) => {
if (typeof screen.options !== 'function' && screen.options?.href !== undefined) {
const { href, ...options } = screen.options;
if (options.tabBarButton) {
throw new Error('Cannot use `href` and `tabBarButton` together.');
}
return {
...screen,
options: {
...options,
tabBarItemStyle: href == null ? { display: 'none' } : options.tabBarItemStyle,
// @ts-expect-error: TODO(@kitten): This isn't properly typed
tabBarButton: (props) => {
if (href == null) {
return null;
}
const children = react_native_1.Platform.OS === 'web' ? props.children : <react_native_1.Pressable>{props.children}</react_native_1.Pressable>;
// TODO: React Navigation types these props as Animated.WithAnimatedValue<StyleProp<ViewStyle>>
// While Link expects a TextStyle. We need to reconcile these types.
return (<Link_1.Link {...props} style={[{ display: 'flex' }, props.style]} href={href} asChild={react_native_1.Platform.OS !== 'web'} children={children}/>);
},
},
};
}
return screen;
});
});
/**
* Renders a tabs navigator.
*
* @hideType
*/
const Tabs = Object.assign((props) => {
return <ExpoTabs {...props} UNSTABLE_router={TabRouter_1.tabRouterOverride}/>;
}, {
Screen: ExpoTabs.Screen,
Protected: Protected_1.Protected,
});
exports.default = Tabs;
//# sourceMappingURL=TabsClient.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabsClient.js","sourceRoot":"","sources":["../../src/layouts/TabsClient.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAEb,+DAIuC;AAEvC,kDAA8C;AAC9C,+CAAmD;AAEnD,2DAAwD;AACxD,uCAAoC;AAEpC,2CAAgD;AAChD,kDAA+C;AAE/C,gDAAgD;AAChD,MAAM,kBAAkB,GAAG,IAAA,sCAAwB,GAAE,CAAC,SAAS,CAAC;AAMhE,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAKhC,kBAAkB,EAAE,CAAC,OAAO,EAAE,EAAE;IAChC,oCAAoC;IACpC,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC5B,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,UAAU,IAAI,MAAM,CAAC,OAAO,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;YAC/E,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;YAC5C,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;YACpE,CAAC;YACD,OAAO;gBACL,GAAG,MAAM;gBACT,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,eAAe,EAAE,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe;oBAC7E,6DAA6D;oBAC7D,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;wBACtB,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;4BACjB,OAAO,IAAI,CAAC;wBACd,CAAC;wBACD,MAAM,QAAQ,GACZ,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,wBAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,wBAAS,CAAC,CAAC;wBACnF,+FAA+F;wBAC/F,0EAA0E;wBAC1E,OAAO,CACL,CAAC,WAAI,CACH,IAAK,KAAa,CAAC,CACnB,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,KAAY,CAAC,CAAC,CACjD,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,OAAO,CAAC,CAAC,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAC/B,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACnB,CACH,CAAC;oBACJ,CAAC;iBACF;aACF,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CACxB,CAAC,KAAsC,EAAE,EAAE;IACzC,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,6BAAiB,CAAC,EAAG,CAAC;AACrE,CAAC,EACD;IACE,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,SAAS,EAAT,qBAAS;CACV,CACF,CAAC;AAEF,kBAAe,IAAI,CAAC","sourcesContent":["'use client';\n\nimport {\n BottomTabNavigationEventMap,\n BottomTabNavigationOptions,\n createBottomTabNavigator,\n} from '@react-navigation/bottom-tabs';\nimport { ParamListBase, TabNavigationState } from '@react-navigation/native';\nimport React, { ComponentProps } from 'react';\nimport { Pressable, Platform } from 'react-native';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { Link } from '../link/Link';\nimport { Href } from '../types';\nimport { tabRouterOverride } from './TabRouter';\nimport { Protected } from '../views/Protected';\n\n// This is the only way to access the navigator.\nconst BottomTabNavigator = createBottomTabNavigator().Navigator;\n\nexport type BottomTabNavigator = typeof BottomTabNavigator;\n\ntype TabsProps = BottomTabNavigationOptions & { href?: Href | null };\n\nconst ExpoTabs = withLayoutContext<\n TabsProps,\n typeof BottomTabNavigator,\n TabNavigationState<ParamListBase>,\n BottomTabNavigationEventMap\n>(BottomTabNavigator, (screens) => {\n // Support the `href` shortcut prop.\n return screens.map((screen) => {\n if (typeof screen.options !== 'function' && screen.options?.href !== undefined) {\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 tabBarItemStyle: href == null ? { display: 'none' } : options.tabBarItemStyle,\n // @ts-expect-error: TODO(@kitten): This isn't properly typed\n tabBarButton: (props) => {\n if (href == null) {\n return null;\n }\n const children =\n Platform.OS === 'web' ? props.children : <Pressable>{props.children}</Pressable>;\n // TODO: React Navigation types these props as Animated.WithAnimatedValue<StyleProp<ViewStyle>>\n // While Link expects a TextStyle. We need to reconcile these types.\n return (\n <Link\n {...(props as any)}\n style={[{ display: 'flex' }, props.style as any]}\n href={href}\n asChild={Platform.OS !== 'web'}\n children={children}\n />\n );\n },\n },\n };\n }\n return screen;\n });\n});\n\n/**\n * Renders a tabs navigator.\n *\n * @hideType\n */\nconst Tabs = Object.assign(\n (props: ComponentProps<typeof ExpoTabs>) => {\n return <ExpoTabs {...props} UNSTABLE_router={tabRouterOverride} />;\n },\n {\n Screen: ExpoTabs.Screen,\n Protected,\n }\n);\n\nexport default Tabs;\n"]}

View File

@@ -0,0 +1,3 @@
import BaseStack from './BaseStack';
export default BaseStack;
//# sourceMappingURL=_web-modal.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"_web-modal.d.ts","sourceRoot":"","sources":["../../src/layouts/_web-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,eAAe,SAAS,CAAC"}

8
node_modules/expo-router/build/layouts/_web-modal.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const BaseStack_1 = __importDefault(require("./BaseStack"));
exports.default = BaseStack_1.default;
//# sourceMappingURL=_web-modal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"_web-modal.js","sourceRoot":"","sources":["../../src/layouts/_web-modal.tsx"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AACpC,kBAAe,mBAAS,CAAC","sourcesContent":["import BaseStack from './BaseStack';\nexport default BaseStack;\n"]}

View File

@@ -0,0 +1,108 @@
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import { type ReactNode } from 'react';
import { type ColorValue, type StyleProp } from 'react-native';
import type { ScreenStackHeaderConfigProps } from 'react-native-screens';
export interface StackHeaderProps {
/**
* Child elements for custom header when `asChild` is true.
*/
children?: ReactNode;
/**
* Whether to hide the header completely. When set to `true`, the header will not be rendered.
*
* @default false
*/
hidden?: boolean;
/**
* When `true`, renders children as a custom header component, replacing the default header entirely.
* Use this to implement fully custom header layouts.
*
* @default false
*/
asChild?: boolean;
/**
* Whether the header should be transparent.
* When `true`, the header is absolutely positioned and content scrolls underneath.
*
* Auto-enabled when:
* - `style.backgroundColor` is 'transparent'
* - `blurEffect` is set (required for blur to work)
*
* @default false
*/
transparent?: boolean;
/**
* The blur effect to apply to the header background on iOS.
* Common values include 'regular', 'prominent', 'systemMaterial', etc.
*
* @platform ios
*/
blurEffect?: ScreenStackHeaderConfigProps['blurEffect'];
/**
* Style properties for the standard-sized header.
* - `color`: Tint color for header elements (similar to tintColor in React Navigation)
* - `backgroundColor`: Background color of the header
* - `shadowColor`: Set to 'transparent' to hide the header shadow/border
*/
style?: StyleProp<{
color?: ColorValue;
backgroundColor?: ScreenStackHeaderConfigProps['backgroundColor'];
shadowColor?: undefined | 'transparent';
}>;
/**
* Style properties for the large title header (iOS).
* - `backgroundColor`: Background color of the large title header
* - `shadowColor`: Set to 'transparent' to hide the large title shadow/border
*
* @platform ios
*/
largeStyle?: StyleProp<{
backgroundColor?: ScreenStackHeaderConfigProps['largeTitleBackgroundColor'];
shadowColor?: undefined | 'transparent';
}>;
}
/**
* The component used to configure header styling for a stack screen.
*
* Use this component to set header appearance properties like blur effect, background color,
* and shadow visibility.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Header
* blurEffect="systemMaterial"
* style={{ backgroundColor: '#fff' }}
* />
* <ScreenContent />
* </>
* );
* }
* ```
*
* @example
* When used inside a layout with Stack.Screen:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Header blurEffect="systemMaterial" />
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
export declare function StackHeaderComponent({ children, hidden, asChild, transparent, blurEffect, style, largeStyle, }: StackHeaderProps): null;
export declare function appendStackHeaderPropsToOptions(options: NativeStackNavigationOptions, props: StackHeaderProps): NativeStackNavigationOptions;
//# sourceMappingURL=StackHeaderComponent.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackHeaderComponent.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIzE,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC,YAAY,CAAC,CAAC;IACxD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;QAChB,KAAK,CAAC,EAAE,UAAU,CAAC;QACnB,eAAe,CAAC,EAAE,4BAA4B,CAAC,iBAAiB,CAAC,CAAC;QAClE,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;KACzC,CAAC,CAAC;IACH;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;QACrB,eAAe,CAAC,EAAE,4BAA4B,CAAC,2BAA2B,CAAC,CAAC;QAC5E,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;KACzC,CAAC,CAAC;CACJ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,MAAM,EACN,OAAO,EACP,WAAW,EACX,UAAU,EACV,KAAK,EACL,UAAU,GACX,EAAE,gBAAgB,QAelB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,gBAAgB,GACtB,4BAA4B,CAiD9B"}

View File

@@ -0,0 +1,100 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackHeaderComponent = StackHeaderComponent;
exports.appendStackHeaderPropsToOptions = appendStackHeaderPropsToOptions;
const react_1 = require("react");
const react_native_1 = require("react-native");
const composition_options_1 = require("../../fork/native-stack/composition-options");
/**
* The component used to configure header styling for a stack screen.
*
* Use this component to set header appearance properties like blur effect, background color,
* and shadow visibility.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Header
* blurEffect="systemMaterial"
* style={{ backgroundColor: '#fff' }}
* />
* <ScreenContent />
* </>
* );
* }
* ```
*
* @example
* When used inside a layout with Stack.Screen:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Header blurEffect="systemMaterial" />
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
function StackHeaderComponent({ children, hidden, asChild, transparent, blurEffect, style, largeStyle, }) {
const options = (0, react_1.useMemo)(() => appendStackHeaderPropsToOptions({},
// satisfies ensures every prop is listed here
{ children, hidden, asChild, transparent, blurEffect, style, largeStyle }), [children, hidden, asChild, transparent, blurEffect, style, largeStyle]);
(0, composition_options_1.useCompositionOption)(options);
return null;
}
function appendStackHeaderPropsToOptions(options, props) {
const flattenedStyle = react_native_1.StyleSheet.flatten(props.style);
const flattenedLargeStyle = react_native_1.StyleSheet.flatten(props.largeStyle);
if (props.hidden) {
return { ...options, headerShown: false };
}
if (props.asChild) {
return { ...options, header: () => props.children };
}
if (props.children && !props.asChild) {
console.warn(`To render a custom header, set the 'asChild' prop to true on Stack.Header.`);
}
// Determine if header should be transparent:
// 1. Explicitly set via `transparent` prop
// 2. Implicitly via backgroundColor === 'transparent'
// 3. Implicitly when blurEffect is set (required for blurEffect to work)
const isBackgroundTransparent = flattenedStyle?.backgroundColor === 'transparent';
const hasBlurEffect = props.blurEffect !== undefined;
const shouldBeTransparent = props.transparent === true ||
(props.transparent !== false && (isBackgroundTransparent || hasBlurEffect));
// Warn if blurEffect is set but transparent is explicitly false
if (props.blurEffect && props.transparent === false) {
console.warn(`Stack.Header: 'blurEffect' requires 'transparent' to be enabled.`);
}
return {
...options,
headerShown: !props.hidden,
headerBlurEffect: props.blurEffect,
...(shouldBeTransparent && { headerTransparent: true }),
...(props.transparent === false && { headerTransparent: false }),
...(flattenedStyle?.color && { headerTintColor: flattenedStyle.color }),
headerStyle: {
backgroundColor: flattenedStyle?.backgroundColor,
},
headerLargeStyle: {
backgroundColor: flattenedLargeStyle?.backgroundColor,
},
...(flattenedStyle?.shadowColor === 'transparent' && { headerShadowVisible: false }),
...(flattenedLargeStyle?.shadowColor === 'transparent' && {
headerLargeTitleShadowVisible: false,
}),
};
}
//# sourceMappingURL=StackHeaderComponent.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,100 @@
import type { ParamListBase, StackNavigationState } from '@react-navigation/native';
import type { NativeStackNavigationEventMap } from '@react-navigation/native-stack';
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import { type PropsWithChildren } from 'react';
import { StackScreenTitle, StackScreenBackButton } from './screen';
import type { ScreenProps as BaseScreenProps } from '../../useScreens';
type StackBaseScreenProps = BaseScreenProps<NativeStackNavigationOptions, StackNavigationState<ParamListBase>, NativeStackNavigationEventMap>;
export interface StackScreenProps extends PropsWithChildren {
/** Name is required when used inside a Layout component. */
name?: StackBaseScreenProps['name'];
/**
* Options to configure the screen.
*
* Accepts an object or a function returning an object.
* The function form `options={({ route }) => ({})}` is only supported when used inside a Layout component.
* When used inside a page component, pass an options object directly.
*/
options?: StackBaseScreenProps['options'];
/**
* Redirect to the nearest sibling route.
* If all children are `redirect={true}`, the layout will render `null` as there are no children to render.
*
* Only supported when used inside a Layout component.
*/
redirect?: StackBaseScreenProps['redirect'];
/**
* Initial params to pass to the route.
*
* Only supported when used inside a Layout component.
*/
initialParams?: StackBaseScreenProps['initialParams'];
/**
* Listeners for navigation events.
*
* Only supported when used inside a Layout component.
*/
listeners?: StackBaseScreenProps['listeners'];
/**
* Function to determine a unique ID for the screen.
* @deprecated Use `dangerouslySingular` instead.
*
* Only supported when used inside a Layout component.
*/
getId?: StackBaseScreenProps['getId'];
/**
* When enabled, the navigator will reuse an existing screen instead of pushing a new one.
*
* Only supported when used inside a Layout component.
*/
dangerouslySingular?: StackBaseScreenProps['dangerouslySingular'];
}
/**
* Component used to define a screen in a native stack navigator.
*
* Can be used in the `_layout.tsx` files, or directly in page components.
*
* When configuring header inside page components, prefer using `Stack.Toolbar`, `Stack.Header` and `Stack.Screen.*` components.
*
* @example
* ```tsx app/_layout.tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen
* name="home"
* options={{ title: 'Home' }}
* />
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx app/home.tsx
* import { Stack } from 'expo-router';
*
* export default function HomePage() {
* return (
* <>
* <Stack.Screen
* options={{ headerTransparent: true }}
* />
* <Stack.Screen.Title>Welcome Home</Stack.Screen.Title>
* // Page content
* </>
* );
* }
* ```
*/
export declare const StackScreen: (({ children, options, ...rest }: StackScreenProps) => import("react").JSX.Element) & {
Title: typeof StackScreenTitle;
BackButton: typeof StackScreenBackButton;
};
export declare function validateStackPresentation(options: NativeStackNavigationOptions): NativeStackNavigationOptions;
export declare function validateStackPresentation<F extends (...args: never[]) => NativeStackNavigationOptions>(options: F): F;
export declare function appendScreenStackPropsToOptions(options: NativeStackNavigationOptions, props: StackScreenProps): NativeStackNavigationOptions;
export {};
//# sourceMappingURL=StackScreen.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackScreen.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAGlF,OAAO,EACL,gBAAgB,EAEhB,qBAAqB,EAEtB,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAIvE,KAAK,oBAAoB,GAAG,eAAe,CACzC,4BAA4B,EAC5B,oBAAoB,CAAC,aAAa,CAAC,EACnC,6BAA6B,CAC9B,CAAC;AAEF,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,4DAA4D;IAC5D,IAAI,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAEpC;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAE1C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAE5C;;;;OAIG;IACH,aAAa,CAAC,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;IAEtD;;;;OAIG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC,WAAW,CAAC,CAAC;IAE9C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEtC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;CACnE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,WAAW,oCAC+B,gBAAgB;;;CAwBtE,CAAC;AAaF,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,4BAA4B,GACpC,4BAA4B,CAAC;AAChC,wBAAgB,yBAAyB,CACvC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,4BAA4B,EAC5D,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;AAwBjB,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,gBAAgB,GACtB,4BAA4B,CA6C9B"}

View File

@@ -0,0 +1,125 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackScreen = void 0;
exports.validateStackPresentation = validateStackPresentation;
exports.appendScreenStackPropsToOptions = appendScreenStackPropsToOptions;
const react_1 = require("react");
const StackHeaderComponent_1 = require("./StackHeaderComponent");
const screen_1 = require("./screen");
const toolbar_1 = require("./toolbar");
const children_1 = require("../../utils/children");
const Screen_1 = require("../../views/Screen");
/**
* Component used to define a screen in a native stack navigator.
*
* Can be used in the `_layout.tsx` files, or directly in page components.
*
* When configuring header inside page components, prefer using `Stack.Toolbar`, `Stack.Header` and `Stack.Screen.*` components.
*
* @example
* ```tsx app/_layout.tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen
* name="home"
* options={{ title: 'Home' }}
* />
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx app/home.tsx
* import { Stack } from 'expo-router';
*
* export default function HomePage() {
* return (
* <>
* <Stack.Screen
* options={{ headerTransparent: true }}
* />
* <Stack.Screen.Title>Welcome Home</Stack.Screen.Title>
* // Page content
* </>
* );
* }
* ```
*/
exports.StackScreen = Object.assign(function StackScreen({ children, options, ...rest }) {
// This component will only render when used inside a page.
if (process.env.NODE_ENV !== 'production' && typeof options === 'function') {
console.warn('Stack.Screen: Function-form options are not supported inside page components. Pass an options object directly.');
}
const ownOptions = (0, react_1.useMemo)(() => validateStackPresentation(typeof options === 'function' ? {} : (options ?? {})), [options]);
return (<>
<Screen_1.Screen {...rest} options={ownOptions}/>
{children}
</>);
}, {
Title: screen_1.StackScreenTitle,
BackButton: screen_1.StackScreenBackButton,
});
const VALID_PRESENTATIONS = [
'card',
'modal',
'transparentModal',
'containedModal',
'containedTransparentModal',
'fullScreenModal',
'formSheet',
'pageSheet',
];
function validateStackPresentation(options) {
if (typeof options === 'function') {
return (...args) => {
const resolved = options(...args);
validateStackPresentation(resolved);
return resolved;
};
}
const presentation = options.presentation;
if (presentation &&
!VALID_PRESENTATIONS.includes(presentation)) {
throw new Error(`Invalid presentation value "${presentation}" passed to Stack.Screen. Valid values are: ${VALID_PRESENTATIONS.map((v) => `"${v}"`).join(', ')}.`);
}
return options;
}
function appendScreenStackPropsToOptions(options, props) {
let updatedOptions = { ...options, ...props.options };
validateStackPresentation(updatedOptions);
function appendChildOptions(child, opts) {
if ((0, children_1.isChildOfType)(child, StackHeaderComponent_1.StackHeaderComponent)) {
return (0, StackHeaderComponent_1.appendStackHeaderPropsToOptions)(opts, child.props);
}
if ((0, children_1.isChildOfType)(child, screen_1.StackScreenTitle)) {
return (0, screen_1.appendStackScreenTitlePropsToOptions)(opts, child.props);
}
if ((0, children_1.isChildOfType)(child, screen_1.StackScreenBackButton)) {
return (0, screen_1.appendStackScreenBackButtonPropsToOptions)(opts, child.props);
}
if ((0, children_1.isChildOfType)(child, toolbar_1.StackToolbar)) {
const placement = child.props.placement ?? 'bottom';
if (placement === 'bottom') {
throw new Error(`Stack.Toolbar with placement="bottom" cannot be used inside Stack.Screen.`);
}
return (0, toolbar_1.appendStackToolbarPropsToOptions)(opts, child.props);
}
const typeName = typeof child.type === 'function'
? child.type.name || 'Unknown'
: String(child.type);
console.warn(`Unknown child element passed to Stack.Screen: ${typeName}`);
return opts;
}
react_1.Children.forEach(props.children, (child) => {
if ((0, react_1.isValidElement)(child)) {
updatedOptions = appendChildOptions(child, updatedOptions);
}
});
return updatedOptions;
}
//# sourceMappingURL=StackScreen.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,33 @@
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import type { SearchBarProps } from 'react-native-screens';
export interface StackSearchBarProps extends SearchBarProps {
}
/**
* A search bar component that integrates with the native stack header.
*
* > **Note:** Using `Stack.SearchBar` will automatically make the header visible
* (`headerShown: true`), as the search bar is rendered as part of the native header.
*
* To display the search bar in the bottom toolbar on iOS 26+, use
* `Stack.Toolbar.SearchBarSlot` inside `Stack.Toolbar`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.SearchBar
* placeholder="Search..."
* onChangeText={(text) => console.log(text)}
* />
* <ScreenContent />
* </>
* );
* }
* ```
*/
export declare function StackSearchBar({ ref, autoCapitalize, autoFocus, barTintColor, tintColor, cancelButtonText, disableBackButtonOverride, hideNavigationBar, hideWhenScrolling, inputType, obscureBackground, onBlur, onCancelButtonPress, onChangeText, onClose, onFocus, onOpen, onSearchButtonPress, placeholder, placement, allowToolbarIntegration, textColor, hintTextColor, headerIconColor, shouldShowHintSearchIcon, }: StackSearchBarProps): null;
export declare function appendStackSearchBarPropsToOptions(options: NativeStackNavigationOptions, props: StackSearchBarProps): NativeStackNavigationOptions;
//# sourceMappingURL=StackSearchBar.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackSearchBar.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackSearchBar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAO3D,MAAM,WAAW,mBAAoB,SAAQ,cAAc;CAAG;AAE9D;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,cAAc,EACd,SAAS,EACT,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,eAAe,EACf,wBAAwB,GACzB,EAAE,mBAAmB,QAgErB;AAED,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,mBAAmB,GACzB,4BAA4B,CAQ9B"}

View File

@@ -0,0 +1,101 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackSearchBar = StackSearchBar;
exports.appendStackSearchBarPropsToOptions = appendStackSearchBarPropsToOptions;
const react_1 = require("react");
const composition_options_1 = require("../../fork/native-stack/composition-options");
/**
* A search bar component that integrates with the native stack header.
*
* > **Note:** Using `Stack.SearchBar` will automatically make the header visible
* (`headerShown: true`), as the search bar is rendered as part of the native header.
*
* To display the search bar in the bottom toolbar on iOS 26+, use
* `Stack.Toolbar.SearchBarSlot` inside `Stack.Toolbar`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.SearchBar
* placeholder="Search..."
* onChangeText={(text) => console.log(text)}
* />
* <ScreenContent />
* </>
* );
* }
* ```
*/
function StackSearchBar({ ref, autoCapitalize, autoFocus, barTintColor, tintColor, cancelButtonText, disableBackButtonOverride, hideNavigationBar, hideWhenScrolling, inputType, obscureBackground, onBlur, onCancelButtonPress, onChangeText, onClose, onFocus, onOpen, onSearchButtonPress, placeholder, placement, allowToolbarIntegration, textColor, hintTextColor, headerIconColor, shouldShowHintSearchIcon, }) {
const options = (0, react_1.useMemo)(() => appendStackSearchBarPropsToOptions({},
// satisfies ensures every prop is listed here
{
ref,
autoCapitalize,
autoFocus,
barTintColor,
tintColor,
cancelButtonText,
disableBackButtonOverride,
hideNavigationBar,
hideWhenScrolling,
inputType,
obscureBackground,
onBlur,
onCancelButtonPress,
onChangeText,
onClose,
onFocus,
onOpen,
onSearchButtonPress,
placeholder,
placement,
allowToolbarIntegration,
textColor,
hintTextColor,
headerIconColor,
shouldShowHintSearchIcon,
}), [
ref,
autoCapitalize,
autoFocus,
barTintColor,
tintColor,
cancelButtonText,
disableBackButtonOverride,
hideNavigationBar,
hideWhenScrolling,
inputType,
obscureBackground,
onBlur,
onCancelButtonPress,
onChangeText,
onClose,
onFocus,
onOpen,
onSearchButtonPress,
placeholder,
placement,
allowToolbarIntegration,
textColor,
hintTextColor,
headerIconColor,
shouldShowHintSearchIcon,
]);
(0, composition_options_1.useCompositionOption)(options);
return null;
}
function appendStackSearchBarPropsToOptions(options, props) {
return {
...options,
headerShown: true,
headerSearchBarOptions: {
...props,
},
};
}
//# sourceMappingURL=StackSearchBar.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackSearchBar.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackSearchBar.tsx"],"names":[],"mappings":";;AAqCA,wCA0FC;AAED,gFAWC;AA3ID,iCAAgC;AAGhC,qFAAmF;AAOnF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,SAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,cAAc,EACd,SAAS,EACT,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,MAAM,EACN,mBAAmB,EACnB,YAAY,EACZ,OAAO,EACP,OAAO,EACP,MAAM,EACN,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,uBAAuB,EACvB,SAAS,EACT,aAAa,EACb,eAAe,EACf,wBAAwB,GACJ;IACpB,MAAM,OAAO,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE,CACH,kCAAkC,CAChC,EAAE;IACF,8CAA8C;IAC9C;QACE,GAAG;QACH,cAAc;QACd,SAAS;QACT,YAAY;QACZ,SAAS;QACT,gBAAgB;QAChB,yBAAyB;QACzB,iBAAiB;QACjB,iBAAiB;QACjB,SAAS;QACT,iBAAiB;QACjB,MAAM;QACN,mBAAmB;QACnB,YAAY;QACZ,OAAO;QACP,OAAO;QACP,MAAM;QACN,mBAAmB;QACnB,WAAW;QACX,SAAS;QACT,uBAAuB;QACvB,SAAS;QACT,aAAa;QACb,eAAe;QACf,wBAAwB;KAC4B,CACvD,EACH;QACE,GAAG;QACH,cAAc;QACd,SAAS;QACT,YAAY;QACZ,SAAS;QACT,gBAAgB;QAChB,yBAAyB;QACzB,iBAAiB;QACjB,iBAAiB;QACjB,SAAS;QACT,iBAAiB;QACjB,MAAM;QACN,mBAAmB;QACnB,YAAY;QACZ,OAAO;QACP,OAAO;QACP,MAAM;QACN,mBAAmB;QACnB,WAAW;QACX,SAAS;QACT,uBAAuB;QACvB,SAAS;QACT,aAAa;QACb,eAAe;QACf,wBAAwB;KACzB,CACF,CAAC;IACF,IAAA,0CAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,kCAAkC,CAChD,OAAqC,EACrC,KAA0B;IAE1B,OAAO;QACL,GAAG,OAAO;QACV,WAAW,EAAE,IAAI;QACjB,sBAAsB,EAAE;YACtB,GAAG,KAAK;SACT;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport { useMemo } from 'react';\nimport type { SearchBarProps } from 'react-native-screens';\n\nimport { useCompositionOption } from '../../fork/native-stack/composition-options';\n\n// TODO: Discuss adding SearchBarSlot to react-native-screens header items\n// and exposing it as Stack.Header.SearchBarPreferredSlot\n// https://linear.app/expo/issue/ENG-18555\nexport interface StackSearchBarProps extends SearchBarProps {}\n\n/**\n * A search bar component that integrates with the native stack header.\n *\n * > **Note:** Using `Stack.SearchBar` will automatically make the header visible\n * (`headerShown: true`), as the search bar is rendered as part of the native header.\n *\n * To display the search bar in the bottom toolbar on iOS 26+, use\n * `Stack.Toolbar.SearchBarSlot` inside `Stack.Toolbar`.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.SearchBar\n * placeholder=\"Search...\"\n * onChangeText={(text) => console.log(text)}\n * />\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n */\nexport function StackSearchBar({\n ref,\n autoCapitalize,\n autoFocus,\n barTintColor,\n tintColor,\n cancelButtonText,\n disableBackButtonOverride,\n hideNavigationBar,\n hideWhenScrolling,\n inputType,\n obscureBackground,\n onBlur,\n onCancelButtonPress,\n onChangeText,\n onClose,\n onFocus,\n onOpen,\n onSearchButtonPress,\n placeholder,\n placement,\n allowToolbarIntegration,\n textColor,\n hintTextColor,\n headerIconColor,\n shouldShowHintSearchIcon,\n}: StackSearchBarProps) {\n const options = useMemo(\n () =>\n appendStackSearchBarPropsToOptions(\n {},\n // satisfies ensures every prop is listed here\n {\n ref,\n autoCapitalize,\n autoFocus,\n barTintColor,\n tintColor,\n cancelButtonText,\n disableBackButtonOverride,\n hideNavigationBar,\n hideWhenScrolling,\n inputType,\n obscureBackground,\n onBlur,\n onCancelButtonPress,\n onChangeText,\n onClose,\n onFocus,\n onOpen,\n onSearchButtonPress,\n placeholder,\n placement,\n allowToolbarIntegration,\n textColor,\n hintTextColor,\n headerIconColor,\n shouldShowHintSearchIcon,\n } satisfies Record<keyof StackSearchBarProps, unknown>\n ),\n [\n ref,\n autoCapitalize,\n autoFocus,\n barTintColor,\n tintColor,\n cancelButtonText,\n disableBackButtonOverride,\n hideNavigationBar,\n hideWhenScrolling,\n inputType,\n obscureBackground,\n onBlur,\n onCancelButtonPress,\n onChangeText,\n onClose,\n onFocus,\n onOpen,\n onSearchButtonPress,\n placeholder,\n placement,\n allowToolbarIntegration,\n textColor,\n hintTextColor,\n headerIconColor,\n shouldShowHintSearchIcon,\n ]\n );\n useCompositionOption(options);\n return null;\n}\n\nexport function appendStackSearchBarPropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackSearchBarProps\n): NativeStackNavigationOptions {\n return {\n ...options,\n headerShown: true,\n headerSearchBarOptions: {\n ...props,\n },\n };\n}\n"]}

View File

@@ -0,0 +1,9 @@
import { StackHeaderComponent } from './StackHeaderComponent';
export declare const StackHeader: typeof StackHeaderComponent;
export type { StackHeaderProps } from './StackHeaderComponent';
export { StackSearchBar, type StackSearchBarProps } from './StackSearchBar';
export * from './toolbar';
export * from './screen';
export { StackScreen, appendScreenStackPropsToOptions, validateStackPresentation, type StackScreenProps, } from './StackScreen';
export { mapProtectedScreen } from './mapProtectedScreen';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,eAAO,MAAM,WAAW,6BAAuB,CAAC;AAEhD,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5E,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,OAAO,EACL,WAAW,EACX,+BAA+B,EAC/B,yBAAyB,EACzB,KAAK,gBAAgB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}

View File

@@ -0,0 +1,30 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapProtectedScreen = exports.validateStackPresentation = exports.appendScreenStackPropsToOptions = exports.StackScreen = exports.StackSearchBar = exports.StackHeader = void 0;
const StackHeaderComponent_1 = require("./StackHeaderComponent");
exports.StackHeader = StackHeaderComponent_1.StackHeaderComponent;
var StackSearchBar_1 = require("./StackSearchBar");
Object.defineProperty(exports, "StackSearchBar", { enumerable: true, get: function () { return StackSearchBar_1.StackSearchBar; } });
__exportStar(require("./toolbar"), exports);
__exportStar(require("./screen"), exports);
var StackScreen_1 = require("./StackScreen");
Object.defineProperty(exports, "StackScreen", { enumerable: true, get: function () { return StackScreen_1.StackScreen; } });
Object.defineProperty(exports, "appendScreenStackPropsToOptions", { enumerable: true, get: function () { return StackScreen_1.appendScreenStackPropsToOptions; } });
Object.defineProperty(exports, "validateStackPresentation", { enumerable: true, get: function () { return StackScreen_1.validateStackPresentation; } });
var mapProtectedScreen_1 = require("./mapProtectedScreen");
Object.defineProperty(exports, "mapProtectedScreen", { enumerable: true, get: function () { return mapProtectedScreen_1.mapProtectedScreen; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iEAA8D;AACjD,QAAA,WAAW,GAAG,2CAAoB,CAAC;AAGhD,mDAA4E;AAAnE,gHAAA,cAAc,OAAA;AAEvB,4CAA0B;AAC1B,2CAAyB;AAEzB,6CAKuB;AAJrB,0GAAA,WAAW,OAAA;AACX,8HAAA,+BAA+B,OAAA;AAC/B,wHAAA,yBAAyB,OAAA;AAI3B,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA","sourcesContent":["import { StackHeaderComponent } from './StackHeaderComponent';\nexport const StackHeader = StackHeaderComponent;\n\nexport type { StackHeaderProps } from './StackHeaderComponent';\nexport { StackSearchBar, type StackSearchBarProps } from './StackSearchBar';\n\nexport * from './toolbar';\nexport * from './screen';\n\nexport {\n StackScreen,\n appendScreenStackPropsToOptions,\n validateStackPresentation,\n type StackScreenProps,\n} from './StackScreen';\n\nexport { mapProtectedScreen } from './mapProtectedScreen';\n"]}

View File

@@ -0,0 +1,3 @@
import { type ProtectedProps } from '../../views/Protected';
export declare function mapProtectedScreen(props: ProtectedProps): ProtectedProps;
//# sourceMappingURL=mapProtectedScreen.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mapProtectedScreen.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/mapProtectedScreen.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAGvE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,cAAc,GAAG,cAAc,CA8BxE"}

View File

@@ -0,0 +1,76 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapProtectedScreen = mapProtectedScreen;
const react_1 = __importStar(require("react"));
const StackHeaderComponent_1 = require("./StackHeaderComponent");
const StackScreen_1 = require("./StackScreen");
const children_1 = require("../../utils/children");
const Protected_1 = require("../../views/Protected");
const Screen_1 = require("../../views/Screen");
function mapProtectedScreen(props) {
return {
...props,
children: react_1.Children.toArray(props.children)
.map((child, index) => {
if ((0, children_1.isChildOfType)(child, StackScreen_1.StackScreen)) {
const { children, options: childOptions, ...rest } = child.props;
const options = typeof childOptions === 'function'
? (...params) => (0, StackScreen_1.appendScreenStackPropsToOptions)(childOptions(...params), { children })
: (0, StackScreen_1.appendScreenStackPropsToOptions)(childOptions ?? {}, { children });
return <Screen_1.Screen key={rest.name} {...rest} options={options}/>;
}
else if ((0, children_1.isChildOfType)(child, Protected_1.Protected)) {
return <Protected_1.Protected key={`${index}-${props.guard}`} {...mapProtectedScreen(child.props)}/>;
}
else if ((0, children_1.isChildOfType)(child, StackHeaderComponent_1.StackHeaderComponent)) {
// Ignore Stack.Header, because it can be used to set header options for Stack
// and we use this function to process children of Stack, as well.
return null;
}
else {
if (react_1.default.isValidElement(child)) {
console.warn(`Unknown child element passed to Stack: ${child.type}`);
}
else {
console.warn(`Unknown child element passed to Stack: ${child}`);
}
}
return null;
})
.filter(Boolean),
};
}
//# sourceMappingURL=mapProtectedScreen.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mapProtectedScreen.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/mapProtectedScreen.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,gDA8BC;AAtCD,+CAAwC;AAExC,iEAA8D;AAC9D,+CAA6E;AAC7E,mDAAqD;AACrD,qDAAuE;AACvE,+CAA4C;AAE5C,SAAgB,kBAAkB,CAAC,KAAqB;IACtD,OAAO;QACL,GAAG,KAAK;QACR,QAAQ,EAAE,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC;aACvC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;YACpB,IAAI,IAAA,wBAAa,EAAC,KAAK,EAAE,yBAAW,CAAC,EAAE,CAAC;gBACtC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;gBACjE,MAAM,OAAO,GACX,OAAO,YAAY,KAAK,UAAU;oBAChC,CAAC,CAAC,CAAC,GAAG,MAAuC,EAAE,EAAE,CAC7C,IAAA,6CAA+B,EAAC,YAAY,CAAC,GAAG,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC;oBAC1E,CAAC,CAAC,IAAA,6CAA+B,EAAC,YAAY,IAAI,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;gBACxE,OAAO,CAAC,eAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAG,CAAC;YAChE,CAAC;iBAAM,IAAI,IAAA,wBAAa,EAAC,KAAK,EAAE,qBAAS,CAAC,EAAE,CAAC;gBAC3C,OAAO,CAAC,qBAAS,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAG,CAAC;YAC5F,CAAC;iBAAM,IAAI,IAAA,wBAAa,EAAC,KAAK,EAAE,2CAAoB,CAAC,EAAE,CAAC;gBACtD,8EAA8E;gBAC9E,kEAAkE;gBAClE,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,IAAI,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;oBAChC,OAAO,CAAC,IAAI,CAAC,0CAA0C,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;gBACvE,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,IAAI,CAAC,0CAA0C,KAAK,EAAE,CAAC,CAAC;gBAClE,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAC;KACnB,CAAC;AACJ,CAAC","sourcesContent":["import React, { Children } from 'react';\n\nimport { StackHeaderComponent } from './StackHeaderComponent';\nimport { StackScreen, appendScreenStackPropsToOptions } from './StackScreen';\nimport { isChildOfType } from '../../utils/children';\nimport { Protected, type ProtectedProps } from '../../views/Protected';\nimport { Screen } from '../../views/Screen';\n\nexport function mapProtectedScreen(props: ProtectedProps): ProtectedProps {\n return {\n ...props,\n children: Children.toArray(props.children)\n .map((child, index) => {\n if (isChildOfType(child, StackScreen)) {\n const { children, options: childOptions, ...rest } = child.props;\n const options =\n typeof childOptions === 'function'\n ? (...params: Parameters<typeof childOptions>) =>\n appendScreenStackPropsToOptions(childOptions(...params), { children })\n : appendScreenStackPropsToOptions(childOptions ?? {}, { children });\n return <Screen key={rest.name} {...rest} options={options} />;\n } else if (isChildOfType(child, Protected)) {\n return <Protected key={`${index}-${props.guard}`} {...mapProtectedScreen(child.props)} />;\n } else if (isChildOfType(child, StackHeaderComponent)) {\n // Ignore Stack.Header, because it can be used to set header options for Stack\n // and we use this function to process children of Stack, as well.\n return null;\n } else {\n if (React.isValidElement(child)) {\n console.warn(`Unknown child element passed to Stack: ${child.type}`);\n } else {\n console.warn(`Unknown child element passed to Stack: ${child}`);\n }\n }\n return null;\n })\n .filter(Boolean),\n };\n}\n"]}

View File

@@ -0,0 +1,73 @@
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import type { ImageSourcePropType } from 'react-native';
import type { ScreenStackHeaderConfigProps } from 'react-native-screens';
export interface StackScreenBackButtonProps {
/**
* The title to display for the back button.
*/
children?: string;
/**
* Style for the back button title.
*/
style?: NativeStackNavigationOptions['headerBackTitleStyle'];
/**
* Whether to show a context menu when long pressing the back button.
*
* @platform ios
*/
withMenu?: boolean;
/**
* The display mode for the back button.
*
* @platform ios
*/
displayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];
/**
* Whether to hide the back button.
*/
hidden?: boolean;
/**
* Custom image source for the back button.
*/
src?: ImageSourcePropType;
}
/**
* Component to configure the back button.
*
* Can be used inside Stack.Screen in a layout or directly inside a screen component.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="detail">
* <Stack.Screen.BackButton displayMode="minimal">Back</Stack.Screen.BackButton>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Screen.BackButton hidden />
* <ScreenContent />
* </>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
export declare function StackScreenBackButton({ children, style, withMenu, displayMode, hidden, src, }: StackScreenBackButtonProps): null;
export declare function appendStackScreenBackButtonPropsToOptions(options: NativeStackNavigationOptions, props: StackScreenBackButtonProps): NativeStackNavigationOptions;
//# sourceMappingURL=StackScreenBackButton.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackScreenBackButton.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/screen/StackScreenBackButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAIzE,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,4BAA4B,CAAC,sBAAsB,CAAC,CAAC;IAC7D;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,4BAA4B,CAAC,uBAAuB,CAAC,CAAC;IACpE;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,mBAAmB,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,GAAG,GACJ,EAAE,0BAA0B,QAe5B;AAED,wBAAgB,yCAAyC,CACvD,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,0BAA0B,GAChC,4BAA4B,CAU9B"}

View File

@@ -0,0 +1,62 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackScreenBackButton = StackScreenBackButton;
exports.appendStackScreenBackButtonPropsToOptions = appendStackScreenBackButtonPropsToOptions;
const react_1 = require("react");
const composition_options_1 = require("../../../fork/native-stack/composition-options");
/**
* Component to configure the back button.
*
* Can be used inside Stack.Screen in a layout or directly inside a screen component.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="detail">
* <Stack.Screen.BackButton displayMode="minimal">Back</Stack.Screen.BackButton>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Screen.BackButton hidden />
* <ScreenContent />
* </>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
function StackScreenBackButton({ children, style, withMenu, displayMode, hidden, src, }) {
const options = (0, react_1.useMemo)(() => appendStackScreenBackButtonPropsToOptions({},
// satisfies ensures every prop is listed here
{ children, style, withMenu, displayMode, hidden, src }), [children, style, withMenu, displayMode, hidden, src]);
(0, composition_options_1.useCompositionOption)(options);
return null;
}
function appendStackScreenBackButtonPropsToOptions(options, props) {
return {
...options,
headerBackTitle: props.children,
headerBackTitleStyle: props.style,
headerBackImageSource: props.src,
headerBackButtonDisplayMode: props.displayMode,
headerBackButtonMenuEnabled: props.withMenu,
headerBackVisible: !props.hidden,
};
}
//# sourceMappingURL=StackScreenBackButton.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackScreenBackButton.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/screen/StackScreenBackButton.tsx"],"names":[],"mappings":";;AA2EA,sDAsBC;AAED,8FAaC;AA/GD,iCAAgC;AAIhC,wFAAsF;AAiCtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,SAAgB,qBAAqB,CAAC,EACpC,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,WAAW,EACX,MAAM,EACN,GAAG,GACwB;IAC3B,MAAM,OAAO,GAAG,IAAA,eAAO,EACrB,GAAG,EAAE,CACH,yCAAyC,CACvC,EAAE;IACF,8CAA8C;IAC9C,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAGpD,CACF,EACH,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,CAAC,CACtD,CAAC;IACF,IAAA,0CAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,yCAAyC,CACvD,OAAqC,EACrC,KAAiC;IAEjC,OAAO;QACL,GAAG,OAAO;QACV,eAAe,EAAE,KAAK,CAAC,QAAQ;QAC/B,oBAAoB,EAAE,KAAK,CAAC,KAAK;QACjC,qBAAqB,EAAE,KAAK,CAAC,GAAG;QAChC,2BAA2B,EAAE,KAAK,CAAC,WAAW;QAC9C,2BAA2B,EAAE,KAAK,CAAC,QAAQ;QAC3C,iBAAiB,EAAE,CAAC,KAAK,CAAC,MAAM;KACjC,CAAC;AACJ,CAAC","sourcesContent":["import { NativeStackNavigationOptions } from '@react-navigation/native-stack';\nimport { useMemo } from 'react';\nimport type { ImageSourcePropType } from 'react-native';\nimport type { ScreenStackHeaderConfigProps } from 'react-native-screens';\n\nimport { useCompositionOption } from '../../../fork/native-stack/composition-options';\n\nexport interface StackScreenBackButtonProps {\n /**\n * The title to display for the back button.\n */\n children?: string;\n /**\n * Style for the back button title.\n */\n style?: NativeStackNavigationOptions['headerBackTitleStyle'];\n /**\n * Whether to show a context menu when long pressing the back button.\n *\n * @platform ios\n */\n withMenu?: boolean;\n /**\n * The display mode for the back button.\n *\n * @platform ios\n */\n displayMode?: ScreenStackHeaderConfigProps['backButtonDisplayMode'];\n /**\n * Whether to hide the back button.\n */\n hidden?: boolean;\n /**\n * Custom image source for the back button.\n */\n src?: ImageSourcePropType;\n}\n\n/**\n * Component to configure the back button.\n *\n * Can be used inside Stack.Screen in a layout or directly inside a screen component.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"detail\">\n * <Stack.Screen.BackButton displayMode=\"minimal\">Back</Stack.Screen.BackButton>\n * </Stack.Screen>\n * </Stack>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Screen.BackButton hidden />\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * > **Note:** If multiple instances of this component are rendered for the same screen,\n * the last one rendered in the component tree takes precedence.\n */\nexport function StackScreenBackButton({\n children,\n style,\n withMenu,\n displayMode,\n hidden,\n src,\n}: StackScreenBackButtonProps) {\n const options = useMemo(\n () =>\n appendStackScreenBackButtonPropsToOptions(\n {},\n // satisfies ensures every prop is listed here\n { children, style, withMenu, displayMode, hidden, src } satisfies Record<\n keyof StackScreenBackButtonProps,\n unknown\n >\n ),\n [children, style, withMenu, displayMode, hidden, src]\n );\n useCompositionOption(options);\n return null;\n}\n\nexport function appendStackScreenBackButtonPropsToOptions(\n options: NativeStackNavigationOptions,\n props: StackScreenBackButtonProps\n): NativeStackNavigationOptions {\n return {\n ...options,\n headerBackTitle: props.children,\n headerBackTitleStyle: props.style,\n headerBackImageSource: props.src,\n headerBackButtonDisplayMode: props.displayMode,\n headerBackButtonMenuEnabled: props.withMenu,\n headerBackVisible: !props.hidden,\n };\n}\n"]}

View File

@@ -0,0 +1,105 @@
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import React from 'react';
import { type StyleProp, type TextStyle } from 'react-native';
export type StackScreenTitleProps = {
/**
* The title content. Pass a string for a plain text title,
* or a custom component when `asChild` is enabled.
*/
children?: React.ReactNode;
/**
* Use this to render a custom component as the header title.
*
* @example
* ```tsx
* <Stack.Screen.Title asChild>
* <MyCustomTitle />
* </Stack.Screen.Title>
* ```
*/
asChild?: boolean;
style?: StyleProp<{
fontFamily?: TextStyle['fontFamily'];
fontSize?: TextStyle['fontSize'];
fontWeight?: Exclude<TextStyle['fontWeight'], number>;
color?: string;
textAlign?: 'left' | 'center';
}>;
/**
* Style properties for the large title header.
*
* @platform ios
*/
largeStyle?: StyleProp<{
fontFamily?: TextStyle['fontFamily'];
fontSize?: TextStyle['fontSize'];
fontWeight?: Exclude<TextStyle['fontWeight'], number>;
color?: string;
}>;
/**
* Enables large title mode.
*
* @platform ios
*/
large?: boolean;
};
/**
* Component to set the screen title.
*
* Can be used inside Stack.Screen in a layout or directly inside a screen component.
*
* @example
* String title in a layout:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Screen.Title large>Home</Stack.Screen.Title>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* String title inside a screen:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Screen.Title>My Page</Stack.Screen.Title>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @example
* Custom component as the title using `asChild`:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Screen.Title asChild>
* <MyCustomTitle />
* </Stack.Screen.Title>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
export declare function StackScreenTitle({ children, asChild, style, largeStyle, large, }: StackScreenTitleProps): null;
export declare function appendStackScreenTitlePropsToOptions(options: NativeStackNavigationOptions, props: StackScreenTitleProps): NativeStackNavigationOptions;
//# sourceMappingURL=StackScreenTitle.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackScreenTitle.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/screen/StackScreenTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAK1E,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;OAGG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;QAChB,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QACjC,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;QAGtD,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,SAAS,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;KAC/B,CAAC,CAAC;IACH;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;QACrB,UAAU,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;QACrC,QAAQ,CAAC,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;QACjC,UAAU,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,CAAC;QAGtD,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;IACH;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,OAAO,EACP,KAAK,EACL,UAAU,EACV,KAAK,GACN,EAAE,qBAAqB,QAevB;AAED,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,qBAAqB,GAC3B,4BAA4B,CA+C9B"}

View File

@@ -0,0 +1,147 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackScreenTitle = StackScreenTitle;
exports.appendStackScreenTitlePropsToOptions = appendStackScreenTitlePropsToOptions;
const react_1 = __importStar(require("react"));
const react_native_1 = require("react-native");
const composition_options_1 = require("../../../fork/native-stack/composition-options");
const style_1 = require("../../../utils/style");
/**
* Component to set the screen title.
*
* Can be used inside Stack.Screen in a layout or directly inside a screen component.
*
* @example
* String title in a layout:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Screen.Title large>Home</Stack.Screen.Title>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* String title inside a screen:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Screen.Title>My Page</Stack.Screen.Title>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @example
* Custom component as the title using `asChild`:
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Screen.Title asChild>
* <MyCustomTitle />
* </Stack.Screen.Title>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* > **Note:** If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*/
function StackScreenTitle({ children, asChild, style, largeStyle, large, }) {
const options = (0, react_1.useMemo)(() => appendStackScreenTitlePropsToOptions({},
// satisfies ensures every prop is listed here
{ children, asChild, style, largeStyle, large }), [children, asChild, style, largeStyle, large]);
(0, composition_options_1.useCompositionOption)(options);
return null;
}
function appendStackScreenTitlePropsToOptions(options, props) {
const flattenedStyle = react_native_1.StyleSheet.flatten(props.style);
const flattenedLargeStyle = react_native_1.StyleSheet.flatten(props.largeStyle);
let titleOptions = props.asChild
? { headerTitle: () => <>{props.children}</> }
: { title: props.children };
if (props.asChild && typeof props.children === 'string') {
if (__DEV__) {
console.warn("Stack.Screen.Title: 'asChild' expects a custom component as children, string received.");
}
titleOptions = {};
}
if (!props.asChild && props.children != null && typeof props.children !== 'string') {
if (__DEV__) {
console.warn('Stack.Screen.Title: Component passed to Stack.Screen.Title without `asChild` enabled. In order to render a custom component as the title, set `asChild` to true.');
}
titleOptions = {};
}
return {
...options,
...titleOptions,
headerLargeTitle: props.large,
headerTitleAlign: flattenedStyle?.textAlign,
headerTitleStyle: {
...flattenedStyle,
...(flattenedStyle?.fontWeight
? {
fontWeight: (0, style_1.convertFontWeightToStringFontWeight)(flattenedStyle?.fontWeight),
}
: {}),
},
headerLargeTitleStyle: {
...flattenedLargeStyle,
...(flattenedLargeStyle?.fontWeight
? {
fontWeight: (0, style_1.convertFontWeightToStringFontWeight)(flattenedLargeStyle?.fontWeight),
}
: {}),
},
};
}
//# sourceMappingURL=StackScreenTitle.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
export { StackScreenTitle, appendStackScreenTitlePropsToOptions, type StackScreenTitleProps, } from './StackScreenTitle';
export { StackScreenBackButton, appendStackScreenBackButtonPropsToOptions, type StackScreenBackButtonProps, } from './StackScreenBackButton';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/screen/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,oCAAoC,EACpC,KAAK,qBAAqB,GAC3B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,qBAAqB,EACrB,yCAAyC,EACzC,KAAK,0BAA0B,GAChC,MAAM,yBAAyB,CAAC"}

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.appendStackScreenBackButtonPropsToOptions = exports.StackScreenBackButton = exports.appendStackScreenTitlePropsToOptions = exports.StackScreenTitle = void 0;
var StackScreenTitle_1 = require("./StackScreenTitle");
Object.defineProperty(exports, "StackScreenTitle", { enumerable: true, get: function () { return StackScreenTitle_1.StackScreenTitle; } });
Object.defineProperty(exports, "appendStackScreenTitlePropsToOptions", { enumerable: true, get: function () { return StackScreenTitle_1.appendStackScreenTitlePropsToOptions; } });
var StackScreenBackButton_1 = require("./StackScreenBackButton");
Object.defineProperty(exports, "StackScreenBackButton", { enumerable: true, get: function () { return StackScreenBackButton_1.StackScreenBackButton; } });
Object.defineProperty(exports, "appendStackScreenBackButtonPropsToOptions", { enumerable: true, get: function () { return StackScreenBackButton_1.appendStackScreenBackButtonPropsToOptions; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/screen/index.tsx"],"names":[],"mappings":";;;AAAA,uDAI4B;AAH1B,oHAAA,gBAAgB,OAAA;AAChB,wIAAA,oCAAoC,OAAA;AAItC,iEAIiC;AAH/B,8HAAA,qBAAqB,OAAA;AACrB,kJAAA,yCAAyC,OAAA","sourcesContent":["export {\n StackScreenTitle,\n appendStackScreenTitlePropsToOptions,\n type StackScreenTitleProps,\n} from './StackScreenTitle';\n\nexport {\n StackScreenBackButton,\n appendStackScreenBackButtonPropsToOptions,\n type StackScreenBackButtonProps,\n} from './StackScreenBackButton';\n"]}

View File

@@ -0,0 +1,3 @@
import StackToolbar from './StackToolbarClient';
export { StackToolbar };
//# sourceMappingURL=StackToolbar.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackToolbar.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,sBAAsB,CAAC;AAiBhD,OAAO,EAAE,YAAY,EAAE,CAAC"}

View File

@@ -0,0 +1,24 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackToolbar = void 0;
const StackToolbarButton_1 = require("./StackToolbarButton");
const StackToolbarClient_1 = __importDefault(require("./StackToolbarClient"));
exports.StackToolbar = StackToolbarClient_1.default;
const StackToolbarMenu_1 = require("./StackToolbarMenu");
const StackToolbarSearchBarSlot_1 = require("./StackToolbarSearchBarSlot");
const StackToolbarSpacer_1 = require("./StackToolbarSpacer");
const StackToolbarView_1 = require("./StackToolbarView");
const toolbar_primitives_1 = require("./toolbar-primitives");
StackToolbarClient_1.default.Button = StackToolbarButton_1.StackToolbarButton;
StackToolbarClient_1.default.Menu = StackToolbarMenu_1.StackToolbarMenu;
StackToolbarClient_1.default.MenuAction = StackToolbarMenu_1.StackToolbarMenuAction;
StackToolbarClient_1.default.SearchBarSlot = StackToolbarSearchBarSlot_1.StackToolbarSearchBarSlot;
StackToolbarClient_1.default.Spacer = StackToolbarSpacer_1.StackToolbarSpacer;
StackToolbarClient_1.default.View = StackToolbarView_1.StackToolbarView;
StackToolbarClient_1.default.Label = toolbar_primitives_1.StackToolbarLabel;
StackToolbarClient_1.default.Icon = toolbar_primitives_1.StackToolbarIcon;
StackToolbarClient_1.default.Badge = toolbar_primitives_1.StackToolbarBadge;
//# sourceMappingURL=StackToolbar.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackToolbar.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbar.tsx"],"names":[],"mappings":";;;;;;AAAA,6DAA0D;AAC1D,8EAAgD;AAiBvC,uBAjBF,4BAAY,CAiBE;AAhBrB,yDAA8E;AAC9E,2EAAwE;AACxE,6DAA0D;AAC1D,yDAAsD;AACtD,6DAA8F;AAE9F,4BAAY,CAAC,MAAM,GAAG,uCAAkB,CAAC;AACzC,4BAAY,CAAC,IAAI,GAAG,mCAAgB,CAAC;AACrC,4BAAY,CAAC,UAAU,GAAG,yCAAsB,CAAC;AACjD,4BAAY,CAAC,aAAa,GAAG,qDAAyB,CAAC;AACvD,4BAAY,CAAC,MAAM,GAAG,uCAAkB,CAAC;AACzC,4BAAY,CAAC,IAAI,GAAG,mCAAgB,CAAC;AACrC,4BAAY,CAAC,KAAK,GAAG,sCAAiB,CAAC;AACvC,4BAAY,CAAC,IAAI,GAAG,qCAAgB,CAAC;AACrC,4BAAY,CAAC,KAAK,GAAG,sCAAiB,CAAC","sourcesContent":["import { StackToolbarButton } from './StackToolbarButton';\nimport StackToolbar from './StackToolbarClient';\nimport { StackToolbarMenu, StackToolbarMenuAction } from './StackToolbarMenu';\nimport { StackToolbarSearchBarSlot } from './StackToolbarSearchBarSlot';\nimport { StackToolbarSpacer } from './StackToolbarSpacer';\nimport { StackToolbarView } from './StackToolbarView';\nimport { StackToolbarBadge, StackToolbarIcon, StackToolbarLabel } from './toolbar-primitives';\n\nStackToolbar.Button = StackToolbarButton;\nStackToolbar.Menu = StackToolbarMenu;\nStackToolbar.MenuAction = StackToolbarMenuAction;\nStackToolbar.SearchBarSlot = StackToolbarSearchBarSlot;\nStackToolbar.Spacer = StackToolbarSpacer;\nStackToolbar.View = StackToolbarView;\nStackToolbar.Label = StackToolbarLabel;\nStackToolbar.Icon = StackToolbarIcon;\nStackToolbar.Badge = StackToolbarBadge;\n\nexport { StackToolbar };\n"]}

View File

@@ -0,0 +1,163 @@
import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';
import type { ImageRef } from 'expo-image';
import { type ReactNode } from 'react';
import { type StyleProp, type TextStyle } from 'react-native';
import { type StackHeaderItemSharedProps } from './shared';
export interface StackToolbarButtonProps {
accessibilityLabel?: string;
accessibilityHint?: string;
/**
* There are two ways to specify the content of the button:
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="star.fill">As text passed as children</Stack.Toolbar.Button>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button>
* <Stack.Toolbar.Icon sf="star.fill" />
* <Stack.Toolbar.Label>As components</Stack.Toolbar.Label>
* <Stack.Toolbar.Badge>3</Stack.Toolbar.Badge>
* </Stack.Toolbar.Button>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only. Badge is only supported in left/right placements, not in bottom (iOS toolbar limitation).
*/
children?: ReactNode;
disabled?: boolean;
/**
* Whether the button should be hidden.
*
* @default false
*/
hidden?: boolean;
/**
* Whether to hide the shared background.
*
* @platform iOS 26+
*/
hidesSharedBackground?: boolean;
/**
* Icon to display in the button.
*
* Can be a string representing an SFSymbol or an image source.
*
* > **Note**: When used in `placement="bottom"`, only string SFSymbols are supported. Use the `image` prop to provide custom images.
*/
icon?: StackHeaderItemSharedProps['icon'];
/**
* Image to display in the button.
*
* > **Note**: This prop is only supported in toolbar with `placement="bottom"`.
*/
image?: ImageRef;
/**
* Controls how image-based icons are rendered on iOS.
*
* - `'template'`: iOS applies tint color to the icon
* - `'original'`: Preserves original icon colors (useful for multi-color icons)
*
* **Default behavior:**
* - If `tintColor` is specified, defaults to `'template'`
* - If no `tintColor`, defaults to `'original'`
*
* This prop only affects image-based icons (not SF Symbols).
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.
*
* @platform ios
*/
iconRenderingMode?: 'template' | 'original';
onPress?: () => void;
/**
* Whether to separate the background of this item from other header items.
*
* @default false
*/
separateBackground?: boolean;
/**
* Whether the button is in a selected state
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information
*/
selected?: boolean;
/**
* Style for the label of the header item.
*/
style?: StyleProp<TextStyle>;
/**
* The tint color to apply to the button item
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.
*/
tintColor?: StackHeaderItemSharedProps['tintColor'];
/**
* @default 'plain'
*/
variant?: StackHeaderItemSharedProps['variant'];
}
/**
* A button used inside `Stack.Toolbar`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
* </Stack.Toolbar>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @platform ios
*/
export declare const StackToolbarButton: React.FC<StackToolbarButtonProps>;
export declare function convertStackToolbarButtonPropsToRNHeaderItem(props: StackToolbarButtonProps): NativeStackHeaderItemButton | undefined;
//# sourceMappingURL=StackToolbarButton.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackToolbarButton.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAA+B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAI3F,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAMlB,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAE1C;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;;;OAIG;IACH,SAAS,CAAC,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD;;OAEG;IACH,OAAO,CAAC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;CACjD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+ChE,CAAC;AAEF,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,uBAAuB,GAC7B,2BAA2B,GAAG,SAAS,CAWzC"}

View File

@@ -0,0 +1,102 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackToolbarButton = void 0;
exports.convertStackToolbarButtonPropsToRNHeaderItem = convertStackToolbarButtonPropsToRNHeaderItem;
const react_1 = require("react");
const react_native_1 = require("react-native");
const context_1 = require("./context");
const shared_1 = require("./shared");
const toolbar_primitives_1 = require("./toolbar-primitives");
const native_1 = require("../../../toolbar/native");
const children_1 = require("../../../utils/children");
/**
* A button used inside `Stack.Toolbar`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
* </Stack.Toolbar>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @platform ios
*/
const StackToolbarButton = (props) => {
const placement = (0, context_1.useToolbarPlacement)();
const validChildren = (0, react_1.useMemo)(() => (0, children_1.filterAllowedChildrenElements)(props.children, ALLOWED_CHILDREN), [props.children]);
if (process.env.NODE_ENV !== 'production') {
// Skip validation for string children
if (typeof props.children !== 'string') {
const allChildren = react_1.Children.toArray(props.children);
if (allChildren.length !== validChildren.length) {
throw new Error(`Stack.Toolbar.Button only accepts a single string or Stack.Toolbar.Label, Stack.Toolbar.Icon, and Stack.Toolbar.Badge as its children.`);
}
}
}
if (process.env.NODE_ENV !== 'production' && placement === 'bottom') {
const hasBadge = (0, children_1.getFirstChildOfType)(props.children, toolbar_primitives_1.StackToolbarBadge);
if (hasBadge) {
console.warn('Stack.Toolbar.Badge is not supported in bottom toolbar (iOS limitation). The badge will be ignored.');
}
}
if (placement !== 'bottom') {
throw new Error('Stack.Toolbar.Button must be used inside a Stack.Toolbar');
}
const sharedProps = (0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(props, true);
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
const icon = sharedProps?.icon?.type === 'sfSymbol' ? sharedProps.icon.name : undefined;
const xcassetName = (0, shared_1.extractXcassetName)(props);
const imageRenderingMode = (0, shared_1.extractIconRenderingMode)(props) ?? props.iconRenderingMode;
return (<NativeToolbarButton {...sharedProps} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode}/>);
};
exports.StackToolbarButton = StackToolbarButton;
function convertStackToolbarButtonPropsToRNHeaderItem(props) {
if (props.hidden) {
return undefined;
}
return {
...(0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(props),
type: 'button',
onPress: props.onPress ?? (() => { }),
selected: !!props.selected,
};
}
const ALLOWED_CHILDREN = [toolbar_primitives_1.StackToolbarLabel, toolbar_primitives_1.StackToolbarIcon, toolbar_primitives_1.StackToolbarBadge];
/**
* Native toolbar button component for bottom toolbar.
* Renders as RouterToolbarItem.
*/
const NativeToolbarButton = (props) => {
const id = (0, react_1.useId)();
const renderingMode = props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');
return (<native_1.RouterToolbarItem accessibilityHint={props.accessibilityHint} accessibilityLabel={props.accessibilityLabel} barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant} disabled={props.disabled} hidden={props.hidden} hidesSharedBackground={props.hidesSharedBackground} identifier={id} image={props.image} imageRenderingMode={renderingMode} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={props.icon} xcassetName={props.xcassetName} title={props.label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
};
// #endregion
//# sourceMappingURL=StackToolbarButton.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,107 @@
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
import React, { type ReactNode } from 'react';
import { type ToolbarPlacement } from './context';
export interface StackToolbarProps {
/**
* Child elements to compose the toolbar. Can include Stack.Toolbar.Button,
* Stack.Toolbar.Menu, Stack.Toolbar.View, Stack.Toolbar.Spacer, and
* Stack.Toolbar.SearchBarSlot (bottom only) components.
*/
children?: ReactNode;
/**
* The placement of the toolbar.
*
* - `'left'`: Renders items in the left area of the header.
* - `'right'`: Renders items in the right area of the header.
* - `'bottom'`: Renders items in the bottom toolbar (iOS only).
*
* @default 'bottom'
*/
placement?: ToolbarPlacement;
/**
* When `true`, renders children as a custom component in the header area,
* replacing the default header layout.
*
* Only applies to `placement="left"` and `placement="right"`.
*
* @default false
*/
asChild?: boolean;
}
/**
* The component used to configure the stack toolbar.
*
* - Use `placement="left"` to customize the left side of the header.
* - Use `placement="right"` to customize the right side of the header.
* - Use `placement="bottom"` (default) to show a bottom toolbar (iOS only).
*
* If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*
* > **Note:** Using `Stack.Toolbar` with `placement="left"` or `placement="right"` will
* automatically make the header visible (`headerShown: true`), as the toolbar is rendered
* as part of the native header.
*
* > **Note:** `Stack.Toolbar` with `placement="bottom"` can only be used inside **page**
* components, not in layout components.
*
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
* </Stack.Toolbar>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Button icon="ellipsis.circle" onPress={() => alert('Right button pressed!')} />
* </Stack.Toolbar>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
* </Stack.Toolbar>
* <Stack.Toolbar>
* <Stack.Toolbar.Spacer />
* <Stack.Toolbar.Button icon="magnifyingglass" onPress={() => {}} />
* <Stack.Toolbar.Spacer />
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @experimental
* @platform ios
*/
export declare const StackToolbar: {
(props: StackToolbarProps): React.JSX.Element;
Button: React.FC<import("./StackToolbarButton").StackToolbarButtonProps>;
Menu: React.FC<import("./StackToolbarMenu").StackToolbarMenuProps>;
MenuAction: React.FC<import("./StackToolbarMenu").StackToolbarMenuActionProps>;
SearchBarSlot: React.FC<import("./StackToolbarSearchBarSlot").StackToolbarSearchBarSlotProps>;
Spacer: React.FC<import("./StackToolbarSpacer").StackToolbarSpacerProps>;
View: React.FC<import("./StackToolbarView").StackToolbarViewProps>;
Label: React.FC<import("./toolbar-primitives").StackToolbarLabelProps>;
Icon: React.FC<import("./toolbar-primitives").StackToolbarIconProps>;
Badge: React.FC<import("./toolbar-primitives").StackToolbarBadgeProps>;
};
export declare function appendStackToolbarPropsToOptions(options: NativeStackNavigationOptions, props: StackToolbarProps): NativeStackNavigationOptions;
export default StackToolbar;
//# sourceMappingURL=StackToolbarClient.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackToolbarClient.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarClient.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,KAAK,EAAE,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAiBjF,OAAO,EAAgD,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAOhG,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,eAAO,MAAM,YAAY;YAAW,iBAAiB;;;;;;;;;;CAWpD,CAAC;AAgFF,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,4BAA4B,EACrC,KAAK,EAAE,iBAAiB,GACvB,4BAA4B,CAqC9B;AAYD,eAAe,YAAY,CAAC"}

View File

@@ -0,0 +1,223 @@
"use strict";
'use client';
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackToolbar = void 0;
exports.appendStackToolbarPropsToOptions = appendStackToolbarPropsToOptions;
const react_1 = __importStar(require("react"));
const StackToolbarButton_1 = require("./StackToolbarButton");
const StackToolbarMenu_1 = require("./StackToolbarMenu");
const StackToolbarSearchBarSlot_1 = require("./StackToolbarSearchBarSlot");
const StackToolbarSpacer_1 = require("./StackToolbarSpacer");
const StackToolbarView_1 = require("./StackToolbarView");
const context_1 = require("./context");
const toolbar_primitives_1 = require("./toolbar-primitives");
const composition_options_1 = require("../../../fork/native-stack/composition-options");
const NativeMenuContext_1 = require("../../../link/NativeMenuContext");
const native_1 = require("../../../toolbar/native");
const children_1 = require("../../../utils/children");
/**
* The component used to configure the stack toolbar.
*
* - Use `placement="left"` to customize the left side of the header.
* - Use `placement="right"` to customize the right side of the header.
* - Use `placement="bottom"` (default) to show a bottom toolbar (iOS only).
*
* If multiple instances of this component are rendered for the same screen,
* the last one rendered in the component tree takes precedence.
*
* > **Note:** Using `Stack.Toolbar` with `placement="left"` or `placement="right"` will
* automatically make the header visible (`headerShown: true`), as the toolbar is rendered
* as part of the native header.
*
* > **Note:** `Stack.Toolbar` with `placement="bottom"` can only be used inside **page**
* components, not in layout components.
*
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Layout() {
* return (
* <Stack>
* <Stack.Screen name="index">
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
* </Stack.Toolbar>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Button icon="ellipsis.circle" onPress={() => alert('Right button pressed!')} />
* </Stack.Toolbar>
* </Stack.Screen>
* </Stack>
* );
* }
* ```
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="left">
* <Stack.Toolbar.Button icon="sidebar.left" onPress={() => alert('Left button pressed!')} />
* </Stack.Toolbar>
* <Stack.Toolbar>
* <Stack.Toolbar.Spacer />
* <Stack.Toolbar.Button icon="magnifyingglass" onPress={() => {}} />
* <Stack.Toolbar.Spacer />
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @experimental
* @platform ios
*/
const StackToolbar = (props) => {
const parentPlacement = (0, context_1.useToolbarPlacement)();
if (parentPlacement) {
throw new Error(`Stack.Toolbar cannot be nested inside another Stack.Toolbar.`);
}
if (props.placement === 'bottom' || !props.placement) {
return <StackToolbarBottom {...props}/>;
}
return <StackToolbarHeader {...props} key={props.placement}/>;
};
exports.StackToolbar = StackToolbar;
const StackToolbarBottom = ({ children }) => {
return (<context_1.ToolbarPlacementContext.Provider value="bottom">
<NativeMenuContext_1.NativeMenuContext value>
<native_1.RouterToolbarHost>{children}</native_1.RouterToolbarHost>
</NativeMenuContext_1.NativeMenuContext>
</context_1.ToolbarPlacementContext.Provider>);
};
const StackToolbarHeader = ({ children, placement, asChild }) => {
if (placement !== 'left' && placement !== 'right') {
throw new Error(`Invalid placement "${placement}" for Stack.Toolbar. Expected "left" or "right".`);
}
const options = (0, react_1.useMemo)(() => appendStackToolbarPropsToOptions({},
// satisfies ensures every prop is listed here
{ children, placement, asChild }), [children, placement, asChild]);
(0, composition_options_1.useCompositionOption)(options);
return null;
};
function convertToolbarChildrenToUnstableItems(children, side) {
const allChildren = react_1.default.Children.toArray(children);
const actions = allChildren.filter((child) => (0, children_1.isChildOfType)(child, StackToolbarButton_1.StackToolbarButton) ||
(0, children_1.isChildOfType)(child, StackToolbarMenu_1.StackToolbarMenu) ||
(0, children_1.isChildOfType)(child, StackToolbarSpacer_1.StackToolbarSpacer) ||
(0, children_1.isChildOfType)(child, StackToolbarView_1.StackToolbarView));
if (actions.length !== allChildren.length && process.env.NODE_ENV !== 'production') {
const otherElements = allChildren
.filter((child) => !actions.some((action) => action === child))
.map((e) => {
if ((0, react_1.isValidElement)(e)) {
if (e.type === react_1.Fragment) {
return '<Fragment>';
}
else {
return e.type?.name ?? e.type;
}
}
return String(e);
});
console.warn(`Stack.Toolbar with placement="${side}" only accepts <Stack.Toolbar.Button>, <Stack.Toolbar.Menu>, <Stack.Toolbar.View>, and <Stack.Toolbar.Spacer> as children. Found invalid children: ${otherElements.join(', ')}`);
}
return () => actions
.map((action) => {
if ((0, children_1.isChildOfType)(action, StackToolbarButton_1.StackToolbarButton)) {
return (0, StackToolbarButton_1.convertStackToolbarButtonPropsToRNHeaderItem)(action.props);
}
else if ((0, children_1.isChildOfType)(action, StackToolbarMenu_1.StackToolbarMenu)) {
return (0, StackToolbarMenu_1.convertStackToolbarMenuPropsToRNHeaderItem)(action.props);
}
else if ((0, children_1.isChildOfType)(action, StackToolbarSpacer_1.StackToolbarSpacer)) {
return (0, StackToolbarSpacer_1.convertStackToolbarSpacerPropsToRNHeaderItem)(action.props);
}
return (0, StackToolbarView_1.convertStackToolbarViewPropsToRNHeaderItem)(action.props);
})
.filter((item) => !!item);
}
function appendStackToolbarPropsToOptions(options, props) {
const { children, placement = 'bottom', asChild } = props;
if (placement === 'bottom') {
// Bottom toolbar doesn't modify navigation options
return options;
}
if (asChild) {
if (placement === 'left') {
return {
...options,
headerShown: true,
headerLeft: () => children,
};
}
else {
return {
...options,
headerShown: true,
headerRight: () => children,
};
}
}
if (placement === 'left') {
return {
...options,
headerShown: true,
unstable_headerLeftItems: convertToolbarChildrenToUnstableItems(children, 'left'),
};
}
return {
...options,
headerShown: true,
unstable_headerRightItems: convertToolbarChildrenToUnstableItems(children, 'right'),
};
}
exports.StackToolbar.Button = StackToolbarButton_1.StackToolbarButton;
exports.StackToolbar.Menu = StackToolbarMenu_1.StackToolbarMenu;
exports.StackToolbar.MenuAction = StackToolbarMenu_1.StackToolbarMenuAction;
exports.StackToolbar.SearchBarSlot = StackToolbarSearchBarSlot_1.StackToolbarSearchBarSlot;
exports.StackToolbar.Spacer = StackToolbarSpacer_1.StackToolbarSpacer;
exports.StackToolbar.View = StackToolbarView_1.StackToolbarView;
exports.StackToolbar.Label = toolbar_primitives_1.StackToolbarLabel;
exports.StackToolbar.Icon = toolbar_primitives_1.StackToolbarIcon;
exports.StackToolbar.Badge = toolbar_primitives_1.StackToolbarBadge;
exports.default = exports.StackToolbar;
//# sourceMappingURL=StackToolbarClient.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,255 @@
import type { NativeStackHeaderItemMenu, NativeStackHeaderItemMenuAction } from '@react-navigation/native-stack';
import type { ImageRef } from 'expo-image';
import { type ReactNode } from 'react';
import { type ImageSourcePropType } from 'react-native';
import type { SFSymbol } from 'sf-symbols-typescript';
import { type StackHeaderItemSharedProps } from './shared';
export interface StackToolbarMenuProps {
accessibilityLabel?: string;
accessibilityHint?: string;
/**
* Menu content - can include icons, labels, badges and menu actions.
*
* @example
* ```tsx
* <Stack.Toolbar.Menu>
* <Stack.Toolbar.Icon sfSymbol="ellipsis.circle" />
* <Stack.Toolbar.Label>Options</Stack.Toolbar.Label>
* <Stack.Toolbar.MenuAction onPress={() => {}}>Action 1</Stack.Toolbar.MenuAction>
* </Stack.Toolbar.Menu>
* ```
*/
children?: ReactNode;
/**
* If `true`, the menu item will be displayed as destructive.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.
*/
destructive?: boolean;
disabled?: boolean;
/**
* Image to display for the menu item.
*
* > **Note**: This prop is only supported in toolbar with `placement="bottom"`.
*/
image?: ImageRef;
/**
* Whether to hide the shared background.
*
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
*
* @platform iOS 26+
*/
hidesSharedBackground?: boolean;
/**
* Whether the menu should be hidden.
*
* @default false
*/
hidden?: boolean;
/**
* Icon for the menu item.
*
* Can be an SF Symbol name or an image source.
*
* > **Note**: When used in `placement="bottom"`, only string SFSymbols are supported. Use the `image` prop to provide custom images.
*/
icon?: StackHeaderItemSharedProps['icon'];
/**
* Controls how image-based icons are rendered on iOS.
*
* - `'template'`: iOS applies tint color to the icon (useful for monochrome icons)
* - `'original'`: Preserves original icon colors (useful for multi-color icons)
*
* **Default behavior:**
* - If `tintColor` is specified, defaults to `'template'`
* - If no `tintColor`, defaults to `'original'`
*
* This prop only affects image-based icons (not SF Symbols).
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.
*
* @platform ios
*/
iconRenderingMode?: 'template' | 'original';
/**
* If `true`, the menu will be displayed inline.
* This means that the menu will not be collapsed
*
* > **Note**: Inline menus are only supported in submenus.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.
*/
inline?: boolean;
/**
* If `true`, the menu will be displayed as a palette.
* This means that the menu will be displayed as one row
*
* > **Note**: Palette menus are only supported in submenus.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.
*/
palette?: boolean;
/**
* Whether to separate the background of this item from other header items.
*
* @default false
*/
separateBackground?: boolean;
/**
* Style for the label of the header item.
*/
style?: StackHeaderItemSharedProps['style'];
/**
* The tint color to apply to the button item
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.
*/
tintColor?: StackHeaderItemSharedProps['tintColor'];
/**
* Optional title to show on top of the menu.
*/
title?: string;
/**
* @default 'plain'
*/
variant?: StackHeaderItemSharedProps['variant'];
/**
* The preferred size of the menu elements.
*
* > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.
*
* @platform iOS 16.0+
*/
elementSize?: 'auto' | 'small' | 'medium' | 'large';
}
/**
* Use as `Stack.Toolbar.Menu` to provide menus in iOS toolbar.
* It accepts `Stack.Toolbar.MenuAction` and nested `Stack.Toolbar.Menu`
* elements. Menu can be configured using both component props and child
* elements.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
* import { Alert } from 'react-native';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Menu icon="ellipsis.circle">
* <Stack.Toolbar.MenuAction onPress={() => Alert.alert('Action pressed!')}>
* Action 1
* </Stack.Toolbar.MenuAction>
* </Stack.Toolbar.Menu>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.
*
* @platform ios
*/
export declare const StackToolbarMenu: React.FC<StackToolbarMenuProps>;
export declare function convertStackToolbarMenuPropsToRNHeaderItem(props: StackToolbarMenuProps, isBottomPlacement?: boolean): NativeStackHeaderItemMenu | undefined;
export interface StackToolbarMenuActionProps {
/**
* Can be an Icon, Label or string title.
*/
children?: ReactNode;
/**
* If `true`, the menu item will be disabled and not selectable.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.
*/
disabled?: boolean;
icon?: SFSymbol | ImageSourcePropType;
/**
* Image to display for the menu action.
*
* > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.
*/
image?: ImageRef;
/**
* Controls how image-based icons are rendered on iOS.
*
* - `'template'`: iOS applies tint color to the icon (useful for monochrome icons)
* - `'original'`: Preserves original icon colors (useful for multi-color icons)
*
* **Default behavior:**
* - If `tintColor` is specified, defaults to `'template'`
* - If no `tintColor`, defaults to `'original'`
*
* This prop only affects image-based icons (not SF Symbols).
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.
*
* @platform ios
*/
iconRenderingMode?: 'template' | 'original';
/**
* If `true`, the menu item will be displayed as destructive.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.
*/
destructive?: boolean;
/**
* If `true`, the menu will be kept presented after the action is selected.
*
* This is marked as unstable, because when action is selected it will recreate the menu,
* which will close all opened submenus and reset the scroll position.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.
*/
unstable_keepPresented?: boolean;
/**
* If `true`, the menu item will be displayed as selected.
*/
isOn?: boolean;
onPress?: () => void;
/**
* An elaborated title that explains the purpose of the action.
*/
discoverabilityLabel?: string;
/**
* An optional subtitle for the menu item.
*
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.
*/
subtitle?: string;
hidden?: boolean;
}
/**
* An action item for a `Stack.Toolbar.Menu`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Menu icon="ellipsis.circle">
* <Stack.Toolbar.MenuAction onPress={() => alert('Action pressed!')}>
* Action 1
* </Stack.Toolbar.MenuAction>
* </Stack.Toolbar.Menu>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @platform ios
*/
export declare const StackToolbarMenuAction: React.FC<StackToolbarMenuActionProps>;
export declare function convertStackToolbarMenuActionPropsToRNHeaderItem(props: StackToolbarMenuActionProps): NativeStackHeaderItemMenuAction;
//# sourceMappingURL=StackToolbarMenu.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"StackToolbarMenu.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAGL,KAAK,mBAAmB,EAGzB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAIL,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AA6BlB,MAAM,WAAW,qBAAqB;IACpC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAC1C;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,KAAK,CAAC,EAAE,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAC5C;;;;OAIG;IACH,SAAS,CAAC,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACpD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,CAAC,EAAE,0BAA0B,CAAC,SAAS,CAAC,CAAC;IAEhD;;;;;;;;OAQG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsD5D,CAAC;AAEF,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,qBAAqB,EAC5B,iBAAiB,GAAE,OAAe,GACjC,yBAAyB,GAAG,SAAS,CAsCvC;AAiED,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IAEtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAiBxE,CAAC;AAEF,wBAAgB,gDAAgD,CAC9D,KAAK,EAAE,2BAA2B,GACjC,+BAA+B,CAwBjC"}

View File

@@ -0,0 +1,256 @@
"use strict";
'use client';
Object.defineProperty(exports, "__esModule", { value: true });
exports.StackToolbarMenuAction = exports.StackToolbarMenu = void 0;
exports.convertStackToolbarMenuPropsToRNHeaderItem = convertStackToolbarMenuPropsToRNHeaderItem;
exports.convertStackToolbarMenuActionPropsToRNHeaderItem = convertStackToolbarMenuActionPropsToRNHeaderItem;
const react_1 = require("react");
const react_native_1 = require("react-native");
const context_1 = require("./context");
const shared_1 = require("./shared");
const toolbar_primitives_1 = require("./toolbar-primitives");
const elements_1 = require("../../../link/elements");
const native_1 = require("../../../link/preview/native");
const children_1 = require("../../../utils/children");
/**
* Computes the label and menu title from children and title prop.
*
* - If only `title` prop is provided, it is used for both the label (button text) and menu title
* - If only `.Label` child is provided, it is used for the label and the menu title is an empty string
* - If both `.Label` child and `title` prop are provided. `.Label` is used for the label, and `title` is used for the menu title
*/
function computeMenuLabelAndTitle(children, title) {
const labelChild = (0, children_1.getFirstChildOfType)(children, toolbar_primitives_1.StackToolbarLabel);
const labelFromChild = labelChild?.props.children;
return {
label: labelFromChild ?? title ?? '',
menuTitle: title ?? '',
};
}
/**
* Use as `Stack.Toolbar.Menu` to provide menus in iOS toolbar.
* It accepts `Stack.Toolbar.MenuAction` and nested `Stack.Toolbar.Menu`
* elements. Menu can be configured using both component props and child
* elements.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
* import { Alert } from 'react-native';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Menu icon="ellipsis.circle">
* <Stack.Toolbar.MenuAction onPress={() => Alert.alert('Action pressed!')}>
* Action 1
* </Stack.Toolbar.MenuAction>
* </Stack.Toolbar.Menu>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.
*
* @platform ios
*/
const StackToolbarMenu = (props) => {
const placement = (0, context_1.useToolbarPlacement)();
if (placement !== 'bottom') {
// For placement other than bottom, this component will not render, and should be
// converted to RN header item using convertStackToolbarMenuPropsToRNHeaderItem.
// So if we reach here, it means we're not inside a toolbar or something else is wrong.
throw new Error('Stack.Toolbar.Menu must be used inside a Stack.Toolbar');
}
const validChildren = (0, react_1.useMemo)(() => (0, children_1.filterAllowedChildrenElements)(props.children, ALLOWED_CHILDREN), [props.children]);
const sharedProps = convertStackToolbarMenuPropsToRNHeaderItem(props, true);
const computedLabel = sharedProps?.label;
const computedMenuTitle = sharedProps?.menu?.title;
const icon = sharedProps?.icon?.type === 'sfSymbol' ? sharedProps.icon.name : undefined;
const xcassetName = (0, shared_1.extractXcassetName)(props);
const imageRenderingMode = (0, shared_1.extractIconRenderingMode)(props) ?? props.iconRenderingMode;
if (process.env.NODE_ENV !== 'production') {
const allChildren = react_1.Children.toArray(props.children);
if (allChildren.length !== validChildren.length) {
throw new Error(`Stack.Toolbar.Menu only accepts Stack.Toolbar.Menu, Stack.Toolbar.MenuAction, Stack.Toolbar.Label, Stack.Toolbar.Icon, and Stack.Toolbar.Badge as its children.`);
}
}
if (process.env.NODE_ENV !== 'production') {
const hasBadge = (0, children_1.getFirstChildOfType)(props.children, toolbar_primitives_1.StackToolbarBadge);
if (hasBadge) {
console.warn('Stack.Toolbar.Badge is not supported in bottom toolbar (iOS limitation). The badge will be ignored.');
}
}
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
return (<NativeToolbarMenu {...props} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode} label={computedLabel} title={computedMenuTitle} children={validChildren}/>);
};
exports.StackToolbarMenu = StackToolbarMenu;
function convertStackToolbarMenuPropsToRNHeaderItem(props, isBottomPlacement = false) {
if (props.hidden) {
return undefined;
}
const { title, ...rest } = props;
const actions = react_1.Children.toArray(props.children).filter((child) => (0, children_1.isChildOfType)(child, exports.StackToolbarMenuAction) || (0, children_1.isChildOfType)(child, exports.StackToolbarMenu));
const { label: computedLabel, menuTitle: computedMenuTitle } = computeMenuLabelAndTitle(props.children, title);
const sharedProps = (0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(rest, isBottomPlacement);
const item = {
...sharedProps,
label: computedLabel,
type: 'menu',
menu: {
multiselectable: true,
items: actions
.map((action) => {
if ((0, children_1.isChildOfType)(action, exports.StackToolbarMenu)) {
return convertStackToolbarSubmenuMenuPropsToRNHeaderItem(action.props);
}
return convertStackToolbarMenuActionPropsToRNHeaderItem(action.props);
})
.filter((i) => !!i),
},
};
if (computedMenuTitle) {
item.menu.title = computedMenuTitle;
}
return item;
}
// Custom menu action icons are not supported in react-navigation yet
// But they are supported in react-native-screens
// TODO(@ubax): Remove this workaround once react-navigation supports custom icons for menu actions.
// https://linear.app/expo/issue/ENG-19853/remove-custom-conversion-logic-for-icon-from-packagesexpo
function convertImageIconToPlatformIcon(icon) {
return icon.tinted
? { type: 'templateSource', templateSource: icon.source }
: { type: 'imageSource', imageSource: icon.source };
}
function convertStackToolbarSubmenuMenuPropsToRNHeaderItem(props) {
if (props.hidden) {
return undefined;
}
const sharedProps = (0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(props);
const actions = react_1.Children.toArray(props.children).filter((child) => (0, children_1.isChildOfType)(child, exports.StackToolbarMenuAction) || (0, children_1.isChildOfType)(child, exports.StackToolbarMenu));
const item = {
type: 'submenu',
items: actions
.map((action) => {
if ((0, children_1.isChildOfType)(action, exports.StackToolbarMenu)) {
return convertStackToolbarSubmenuMenuPropsToRNHeaderItem(action.props);
}
return convertStackToolbarMenuActionPropsToRNHeaderItem(action.props);
})
.filter((i) => !!i),
label: sharedProps.label || props.title || '',
multiselectable: true,
};
if (props.inline !== undefined) {
item.inline = props.inline;
}
if (props.palette !== undefined) {
item.layout = props.palette ? 'palette' : 'default';
}
if (props.destructive !== undefined) {
item.destructive = props.destructive;
}
// TODO: Add elementSize to react-native-screens
if (sharedProps.icon) {
if (sharedProps.icon.type === 'sfSymbol') {
item.icon = sharedProps.icon;
}
else {
item.icon = convertImageIconToPlatformIcon(sharedProps.icon);
}
}
return item;
}
/**
* An action item for a `Stack.Toolbar.Menu`.
*
* @example
* ```tsx
* import { Stack } from 'expo-router';
*
* export default function Page() {
* return (
* <>
* <Stack.Toolbar placement="right">
* <Stack.Toolbar.Menu icon="ellipsis.circle">
* <Stack.Toolbar.MenuAction onPress={() => alert('Action pressed!')}>
* Action 1
* </Stack.Toolbar.MenuAction>
* </Stack.Toolbar.Menu>
* </Stack.Toolbar>
* <ScreenContent />
* </>
* );
* }
* ```
*
* @platform ios
*/
const StackToolbarMenuAction = (props) => {
const placement = (0, context_1.useToolbarPlacement)();
if (placement !== 'bottom') {
throw new Error('Stack.Toolbar.MenuAction must be used inside a Stack.Toolbar.Menu');
}
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
const icon = typeof props.icon === 'string' ? props.icon : undefined;
return (<NativeToolbarMenuAction {...props} icon={icon} image={props.image} imageRenderingMode={props.iconRenderingMode}/>);
};
exports.StackToolbarMenuAction = StackToolbarMenuAction;
function convertStackToolbarMenuActionPropsToRNHeaderItem(props) {
const { children, isOn, unstable_keepPresented, icon, ...rest } = props;
const sharedProps = (0, shared_1.convertStackHeaderSharedPropsToRNSharedHeaderItem)(props);
const item = {
...rest,
description: props.subtitle,
type: 'action',
label: sharedProps.label,
state: isOn ? 'on' : 'off',
onPress: props.onPress ?? (() => { }),
};
if (unstable_keepPresented !== undefined) {
item.keepsMenuPresented = unstable_keepPresented;
}
if (sharedProps.icon) {
if (sharedProps.icon.type === 'sfSymbol') {
item.icon = sharedProps.icon;
}
else {
item.icon = convertImageIconToPlatformIcon(sharedProps.icon);
}
}
return item;
}
/**
* Native toolbar menu component for bottom toolbar.
* Renders as NativeLinkPreviewAction.
*/
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, label, destructive, children, icon, xcassetName, image, imageRenderingMode, tintColor, variant, style, elementSize, }) => {
const identifier = (0, react_1.useId)();
const titleStyle = react_native_1.StyleSheet.flatten(style);
const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');
return (<native_1.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={icon} xcassetName={xcassetName}
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
image={image} imageRenderingMode={renderingMode} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={title ?? ''} label={label} onSelected={() => { }} children={children} identifier={identifier}/>);
};
// #endregion
// #region NativeToolbarMenuAction
/**
* Native toolbar menu action - reuses LinkMenuAction.
*/
const NativeToolbarMenuAction = elements_1.LinkMenuAction;
// #endregion
const ALLOWED_CHILDREN = [
exports.StackToolbarMenu,
exports.StackToolbarMenuAction,
NativeToolbarMenu,
NativeToolbarMenuAction,
toolbar_primitives_1.StackToolbarLabel,
toolbar_primitives_1.StackToolbarIcon,
toolbar_primitives_1.StackToolbarBadge,
];
//# sourceMappingURL=StackToolbarMenu.js.map

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More