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

6
node_modules/expo-router/build/ui/Slot.d.ts generated vendored Normal file
View File

@@ -0,0 +1,6 @@
import { type ForwardRefExoticComponent, type Component, type RefAttributes } from 'react';
import { type ViewProps } from 'react-native';
export interface Slot<Props = ViewProps, Ref = Component<ViewProps>> extends ForwardRefExoticComponent<Props & RefAttributes<Ref>> {
}
export declare const Slot: Slot;
//# sourceMappingURL=Slot.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../src/ui/Slot.tsx"],"names":[],"mappings":"AACA,OAAc,EAGZ,KAAK,yBAAyB,EAC9B,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAoC1D,MAAM,WAAW,IAAI,CAAC,KAAK,GAAG,SAAS,EAAE,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CACjE,SAAQ,yBAAyB,CAAC,KAAK,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;CAAG;AAElE,eAAO,MAAM,IAAI,EAAE,IAA8C,CAAC"}

70
node_modules/expo-router/build/ui/Slot.js generated vendored Normal file
View File

@@ -0,0 +1,70 @@
"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.Slot = void 0;
const react_slot_1 = require("@radix-ui/react-slot");
const react_1 = __importStar(require("react"));
const react_native_1 = require("react-native");
/**
* RadixUI has special logic to handle the merging of `style` and `className` props.
* On the web styles are not allowed so Radix does not handle this scenario.
* This could be fixed upstream (PR open), but it may not as RN is not their target
* platform.
*
* This shim calls `StyleSheet.flatten` on the styles before we render the <Slot />
*
* @see https://github.com/expo/expo/issues/31352
* @see https://github.com/radix-ui/primitives/issues/3107
* @param Component
* @returns
*/
function ShimSlotForReactNative(Component) {
return (0, react_1.forwardRef)(function RNSlotHOC({ style, ...props }, ref) {
style = (0, react_1.useMemo)(() => react_native_1.StyleSheet.flatten(style), [style]);
if (process.env.NODE_ENV !== 'production') {
if (react_1.default.isValidElement(props.children)) {
if (typeof props.children.props === 'object' &&
props.children.props !== null &&
'style' in props.children.props &&
Array.isArray(props.children.props.style)) {
throw new Error(`[expo-router]: You are passing an array of styles to a child of <Slot>. Consider flattening the styles with StyleSheet.flatten before passing them to the child component.`);
}
}
}
return <Component ref={ref} {...props} style={style}/>;
});
}
exports.Slot = ShimSlotForReactNative(react_slot_1.Slot);
//# sourceMappingURL=Slot.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"Slot.js","sourceRoot":"","sources":["../../src/ui/Slot.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuD;AACvD,+CAMe;AACf,+CAA0D;AAE1D;;;;;;;;;;;;GAYG;AACH,SAAS,sBAAsB,CAAC,SAAyB;IACvD,OAAO,IAAA,kBAAU,EAAC,SAAS,SAAS,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG;QAC3D,KAAK,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE,CAAC,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAC1D,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IAAI,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACzC,IACE,OAAO,KAAK,CAAC,QAAQ,CAAC,KAAK,KAAK,QAAQ;oBACxC,KAAK,CAAC,QAAQ,CAAC,KAAK,KAAK,IAAI;oBAC7B,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK;oBAC/B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EACzC,CAAC;oBACD,MAAM,IAAI,KAAK,CACb,4KAA4K,CAC7K,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QACD,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC;AAKY,QAAA,IAAI,GAAS,sBAAsB,CAAC,iBAAO,CAAS,CAAC","sourcesContent":["import { Slot as RUISlot } from '@radix-ui/react-slot';\nimport React, {\n forwardRef,\n useMemo,\n type ForwardRefExoticComponent,\n type Component,\n type RefAttributes,\n} from 'react';\nimport { StyleSheet, type ViewProps } from 'react-native';\n\n/**\n * RadixUI has special logic to handle the merging of `style` and `className` props.\n * On the web styles are not allowed so Radix does not handle this scenario.\n * This could be fixed upstream (PR open), but it may not as RN is not their target\n * platform.\n *\n * This shim calls `StyleSheet.flatten` on the styles before we render the <Slot />\n *\n * @see https://github.com/expo/expo/issues/31352\n * @see https://github.com/radix-ui/primitives/issues/3107\n * @param Component\n * @returns\n */\nfunction ShimSlotForReactNative(Component: typeof RUISlot): typeof RUISlot {\n return forwardRef(function RNSlotHOC({ style, ...props }, ref) {\n style = useMemo(() => StyleSheet.flatten(style), [style]);\n if (process.env.NODE_ENV !== 'production') {\n if (React.isValidElement(props.children)) {\n if (\n typeof props.children.props === 'object' &&\n props.children.props !== null &&\n 'style' in props.children.props &&\n Array.isArray(props.children.props.style)\n ) {\n throw new Error(\n `[expo-router]: You are passing an array of styles to a child of <Slot>. Consider flattening the styles with StyleSheet.flatten before passing them to the child component.`\n );\n }\n }\n }\n return <Component ref={ref} {...props} style={style} />;\n });\n}\n\nexport interface Slot<Props = ViewProps, Ref = Component<ViewProps>>\n extends ForwardRefExoticComponent<Props & RefAttributes<Ref>> {}\n\nexport const Slot: Slot = ShimSlotForReactNative(RUISlot) as Slot;\n"]}

182
node_modules/expo-router/build/ui/TabContext.d.ts generated vendored Normal file
View File

@@ -0,0 +1,182 @@
import { BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';
import { DefaultNavigatorOptions, NavigationAction, NavigationProp, ParamListBase, TabActionHelpers, TabNavigationState, TabRouterOptions, useNavigationBuilder } from '@react-navigation/native';
import { TriggerMap } from './common';
export type ExpoTabsProps = ExpoTabsNavigatorOptions;
export type ExpoTabsNavigatorScreenOptions = {
detachInactiveScreens?: boolean;
unmountOnBlur?: boolean;
freezeOnBlur?: boolean;
lazy?: boolean;
};
export type ExpoTabsNavigatorOptions = DefaultNavigatorOptions<ParamListBase, string | undefined, TabNavigationState<ParamListBase>, ExpoTabsScreenOptions, TabNavigationEventMap, ExpoTabsNavigationProp<ParamListBase>> & Omit<TabRouterOptions, 'initialRouteName'> & ExpoTabsNavigatorScreenOptions;
export type ExpoTabsNavigationProp<ParamList extends ParamListBase, RouteName extends keyof ParamList = keyof ParamList, NavigatorID extends string | undefined = undefined> = NavigationProp<ParamList, RouteName, NavigatorID, TabNavigationState<ParamListBase>, ExpoTabsScreenOptions, TabNavigationEventMap>;
export type ExpoTabsScreenOptions = Pick<BottomTabNavigationOptions, 'title' | 'lazy' | 'freezeOnBlur'> & {
params?: object;
title: string;
action: NavigationAction;
};
export type TabNavigationEventMap = {
/**
* Event which fires on tapping on the tab in the tab bar.
*/
tabPress: {
data: undefined;
canPreventDefault: true;
};
/**
* Event which fires on long press on the tab in the tab bar.
*/
tabLongPress: {
data: undefined;
};
};
/**
* The React Navigation custom navigator.
*
* @see [`useNavigationBuilder`](https://reactnavigation.org/docs/custom-navigators/#usenavigationbuilder) hook from React Navigation for more information.
*/
export type TabsContextValue = ReturnType<typeof useNavigationBuilder<TabNavigationState<any>, TabRouterOptions, TabActionHelpers<ParamListBase>, ExpoTabsNavigatorScreenOptions, TabNavigationEventMap>>;
export type TabContextValue = TabsDescriptor['options'];
export declare const TabContext: import("react").Context<ExpoTabsNavigatorScreenOptions>;
/**
* @hidden
*/
export declare const TabTriggerMapContext: import("react").Context<TriggerMap>;
/**
* @hidden
*/
export declare const TabsDescriptorsContext: import("react").Context<Record<string, import("@react-navigation/native").Descriptor<ExpoTabsNavigatorScreenOptions, Omit<{
dispatch(action: Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}> | ((state: Readonly<TabNavigationState<any>>) => Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined, options?: {
merge?: boolean;
pop?: boolean;
} | undefined] : never): void;
navigate<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
path?: string;
merge?: boolean;
pop?: boolean;
} : never): void;
navigateDeprecated<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
navigateDeprecated<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
merge?: boolean;
} : never): void;
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
reset(state: TabNavigationState<any> | import("@react-navigation/native").PartialState<TabNavigationState<any>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<ParamListBase, {}> | undefined>(id?: string): T;
getState(): TabNavigationState<any>;
} & import("@react-navigation/native").PrivateValueStore<[ParamListBase, unknown, unknown]>, "getParent"> & {
getParent<T = NavigationProp<ParamListBase, string, string | undefined, Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>, {}, {}> | undefined>(id?: string | undefined): T;
setOptions(options: Partial<ExpoTabsNavigatorScreenOptions>): void;
} & {
setParams(params: Partial<object | undefined>): void;
replaceParams(params: object | undefined): void;
} & import("@react-navigation/native").EventConsumer<TabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<any>>> & import("@react-navigation/native").PrivateValueStore<[ParamListBase, string, TabNavigationEventMap]> & TabActionHelpers<ParamListBase>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>>;
/**
* @hidden
*/
export declare const TabsNavigatorContext: import("react").Context<({
dispatch(action: Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}> | ((state: Readonly<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>>) => Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined, options?: {
merge?: boolean;
pop?: boolean;
} | undefined] : never): void;
navigate<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
path?: string;
merge?: boolean;
pop?: boolean;
} : never): void;
navigateDeprecated<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
navigateDeprecated<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
merge?: boolean;
} : never): void;
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
reset(state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}> | import("@react-navigation/native").PartialState<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<ParamListBase, {}> | undefined>(id?: string): T;
getState(): Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>;
} & import("@react-navigation/native").PrivateValueStore<[ParamListBase, unknown, unknown]> & import("@react-navigation/native").EventEmitter<TabNavigationEventMap> & {
setParams(params: Partial<object | undefined>): void;
replaceParams(params: object | undefined): void;
} & TabActionHelpers<ParamListBase>) | null>;
/**
* @hidden
*/
export declare const TabsStateContext: import("react").Context<TabNavigationState<any>>;
export type Route = TabNavigationState<ParamListBase>['routes'][number];
export type TabsDescriptor = TabsContextValue['descriptors'][number];
//# sourceMappingURL=TabContext.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabContext.d.ts","sourceRoot":"","sources":["../../src/ui/TabContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,wBAAwB,CAAC;AAErD,MAAM,MAAM,8BAA8B,GAAG;IAC3C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAC5D,aAAa,EACb,MAAM,GAAG,SAAS,EAClB,kBAAkB,CAAC,aAAa,CAAC,EACjC,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,CAAC,aAAa,CAAC,CACtC,GAEC,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,GAC1C,8BAA8B,CAAC;AAEjC,MAAM,MAAM,sBAAsB,CAChC,SAAS,SAAS,aAAa,EAC/B,SAAS,SAAS,MAAM,SAAS,GAAG,MAAM,SAAS,EACnD,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,IAChD,cAAc,CAChB,SAAS,EACT,SAAS,EACT,WAAW,EACX,kBAAkB,CAAC,aAAa,CAAC,EACjC,qBAAqB,EACrB,qBAAqB,CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,0BAA0B,EAC1B,OAAO,GAAG,MAAM,GAAG,cAAc,CAClC,GAAG;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,QAAQ,EAAE;QAAE,IAAI,EAAE,SAAS,CAAC;QAAC,iBAAiB,EAAE,IAAI,CAAA;KAAE,CAAC;IACvD;;OAEG;IACH,YAAY,EAAE;QAAE,IAAI,EAAE,SAAS,CAAA;KAAE,CAAC;CACnC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CACvC,OAAO,oBAAoB,CACzB,kBAAkB,CAAC,GAAG,CAAC,EACvB,gBAAgB,EAChB,gBAAgB,CAAC,aAAa,CAAC,EAC/B,8BAA8B,EAC9B,qBAAqB,CACtB,CACF,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;AAExD,eAAO,MAAM,UAAU,yDAAqC,CAAC;AAC7D;;GAEG;AACH,eAAO,MAAM,oBAAoB,qCAAgC,CAAC;AAClE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;eAqB0hI,CAAC;cAA4B,CAAC;cAA4B,CAAC;;sGAAwI,CAAC,6BAA6B,CAAC;aAAqB,CAAC;WAA0B,CAAC;;;;;YAAyN,CAAC;aAA2B,CAAC;WAA0B,CAAC;;gHAAyJ,CAAC;;;;aAAwN,CAAC;;qGAA8I,CAAC;;;;;;;;;;;;;;;;;;;;;;uWArB3gK,CAAC;AACzF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;eAzD/B,CAAF;cAEE,CAAC;cACa,CAAC;;;;;eAOL,CAAC;;;;;;eAWc,CAAC;cAA4B,CAAC;cAEpC,CAAC;;sGAOrB,CAAC,6BAC0B,CAAC;aAAqB,CAAC;WAA0B,CAAC;;;;;YAMpE,CAAC;aACP,CAAF;WAA0B,CAAC;;gHAOyB,CAAC;;;;aAWtD,CAAD;;qGAKuB,CAAC;;;;;eAQd,CAAC;;;;;;;;eAK+I,CAAC;;;;;;;;;;;;;;eAAmiB,CAAC;;;;;;;;4CAjBjmB,CAAC;AAC/F;;GAEG;AACH,eAAO,MAAM,gBAAgB,kDAS3B,CAAC;AAEH,MAAM,MAAM,KAAK,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}

31
node_modules/expo-router/build/ui/TabContext.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TabsStateContext = exports.TabsNavigatorContext = exports.TabsDescriptorsContext = exports.TabTriggerMapContext = exports.TabContext = void 0;
const react_1 = require("react");
exports.TabContext = (0, react_1.createContext)({});
/**
* @hidden
*/
exports.TabTriggerMapContext = (0, react_1.createContext)({});
/**
* @hidden
*/
exports.TabsDescriptorsContext = (0, react_1.createContext)({});
/**
* @hidden
*/
exports.TabsNavigatorContext = (0, react_1.createContext)(null);
/**
* @hidden
*/
exports.TabsStateContext = (0, react_1.createContext)({
type: 'tab',
preloadedRouteKeys: [],
history: [],
index: -1,
key: '',
stale: false,
routeNames: [],
routes: [],
});
//# sourceMappingURL=TabContext.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"TabContext.js","sourceRoot":"","sources":["../../src/ui/TabContext.tsx"],"names":[],"mappings":";;;AAWA,iCAAsC;AA2EzB,QAAA,UAAU,GAAG,IAAA,qBAAa,EAAkB,EAAE,CAAC,CAAC;AAC7D;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAAa,EAAE,CAAC,CAAC;AAClE;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAA,qBAAa,EAAkC,EAAE,CAAC,CAAC;AACzF;;GAEG;AACU,QAAA,oBAAoB,GAAG,IAAA,qBAAa,EAAwC,IAAI,CAAC,CAAC;AAC/F;;GAEG;AACU,QAAA,gBAAgB,GAAG,IAAA,qBAAa,EAA4B;IACvE,IAAI,EAAE,KAAK;IACX,kBAAkB,EAAE,EAAE;IACtB,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,CAAC,CAAC;IACT,GAAG,EAAE,EAAE;IACP,KAAK,EAAE,KAAK;IACZ,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,EAAE;CACX,CAAC,CAAC","sourcesContent":["import { BottomTabNavigationOptions } from '@react-navigation/bottom-tabs';\nimport {\n DefaultNavigatorOptions,\n NavigationAction,\n NavigationProp,\n ParamListBase,\n TabActionHelpers,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport { createContext } from 'react';\n\nimport { TriggerMap } from './common';\n\nexport type ExpoTabsProps = ExpoTabsNavigatorOptions;\n\nexport type ExpoTabsNavigatorScreenOptions = {\n detachInactiveScreens?: boolean;\n unmountOnBlur?: boolean;\n freezeOnBlur?: boolean;\n lazy?: boolean;\n};\n\nexport type ExpoTabsNavigatorOptions = DefaultNavigatorOptions<\n ParamListBase,\n string | undefined,\n TabNavigationState<ParamListBase>,\n ExpoTabsScreenOptions,\n TabNavigationEventMap,\n ExpoTabsNavigationProp<ParamListBase>\n> &\n // Should be set through `unstable_settings`\n Omit<TabRouterOptions, 'initialRouteName'> &\n ExpoTabsNavigatorScreenOptions;\n\nexport type ExpoTabsNavigationProp<\n ParamList extends ParamListBase,\n RouteName extends keyof ParamList = keyof ParamList,\n NavigatorID extends string | undefined = undefined,\n> = NavigationProp<\n ParamList,\n RouteName,\n NavigatorID,\n TabNavigationState<ParamListBase>,\n ExpoTabsScreenOptions,\n TabNavigationEventMap\n>;\n\nexport type ExpoTabsScreenOptions = Pick<\n BottomTabNavigationOptions,\n 'title' | 'lazy' | 'freezeOnBlur'\n> & {\n params?: object;\n title: string;\n action: NavigationAction;\n};\n\nexport type TabNavigationEventMap = {\n /**\n * Event which fires on tapping on the tab in the tab bar.\n */\n tabPress: { data: undefined; canPreventDefault: true };\n /**\n * Event which fires on long press on the tab in the tab bar.\n */\n tabLongPress: { data: undefined };\n};\n\n/**\n * The React Navigation custom navigator.\n *\n * @see [`useNavigationBuilder`](https://reactnavigation.org/docs/custom-navigators/#usenavigationbuilder) hook from React Navigation for more information.\n */\nexport type TabsContextValue = ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<any>,\n TabRouterOptions,\n TabActionHelpers<ParamListBase>,\n ExpoTabsNavigatorScreenOptions,\n TabNavigationEventMap\n >\n>;\n\nexport type TabContextValue = TabsDescriptor['options'];\n\nexport const TabContext = createContext<TabContextValue>({});\n/**\n * @hidden\n */\nexport const TabTriggerMapContext = createContext<TriggerMap>({});\n/**\n * @hidden\n */\nexport const TabsDescriptorsContext = createContext<TabsContextValue['descriptors']>({});\n/**\n * @hidden\n */\nexport const TabsNavigatorContext = createContext<TabsContextValue['navigation'] | null>(null);\n/**\n * @hidden\n */\nexport const TabsStateContext = createContext<TabsContextValue['state']>({\n type: 'tab',\n preloadedRouteKeys: [],\n history: [],\n index: -1,\n key: '',\n stale: false,\n routeNames: [],\n routes: [],\n});\n\nexport type Route = TabNavigationState<ParamListBase>['routes'][number];\nexport type TabsDescriptor = TabsContextValue['descriptors'][number];\n"]}

25
node_modules/expo-router/build/ui/TabList.d.ts generated vendored Normal file
View File

@@ -0,0 +1,25 @@
import { ReactElement, ComponentProps } from 'react';
import { ViewProps } from 'react-native';
export type TabListProps = ViewProps & {
/** Forward props to child component and removes the extra `<View>`. Useful for custom wrappers. */
asChild?: boolean;
};
/**
* Wrapper component for `TabTriggers`. `TabTriggers` within the `TabList` define the tabs.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
export declare function TabList({ asChild, style, ...props }: TabListProps): import("react").JSX.Element;
/**
* @hidden
*/
export declare function isTabList(child: ReactElement<any>): child is ReactElement<ComponentProps<typeof TabList>>;
//# sourceMappingURL=TabList.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"TabList.d.ts","sourceRoot":"","sources":["../../src/ui/TabList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAoB,SAAS,EAAE,MAAM,cAAc,CAAC;AAI3D,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG;IACrC,mGAAmG;IACnG,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAGjE;AAED;;GAEG;AACH,wBAAgB,SAAS,CACvB,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,GACvB,KAAK,IAAI,YAAY,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,CAAC,CAEvD"}

40
node_modules/expo-router/build/ui/TabList.js generated vendored Normal file
View File

@@ -0,0 +1,40 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TabList = TabList;
exports.isTabList = isTabList;
const react_native_1 = require("react-native");
const common_1 = require("./common");
/**
* Wrapper component for `TabTriggers`. `TabTriggers` within the `TabList` define the tabs.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
function TabList({ asChild, style, ...props }) {
const Comp = asChild ? common_1.ViewSlot : react_native_1.View;
return <Comp style={[styles.tabList, style]} {...props}/>;
}
/**
* @hidden
*/
function isTabList(child) {
return child.type === TabList;
}
const styles = react_native_1.StyleSheet.create({
tabList: {
flexDirection: 'row',
justifyContent: 'space-between',
},
tabTrigger: {
flexDirection: 'row',
justifyContent: 'space-between',
},
});
//# sourceMappingURL=TabList.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"TabList.js","sourceRoot":"","sources":["../../src/ui/TabList.tsx"],"names":[],"mappings":";;AAuBA,0BAGC;AAKD,8BAIC;AAlCD,+CAA2D;AAE3D,qCAAoC;AAOpC;;;;;;;;;;;;GAYG;AACH,SAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB;IAChE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,iBAAQ,CAAC,CAAC,CAAC,mBAAI,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7D,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS,CACvB,KAAwB;IAExB,OAAO,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC;AAChC,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;IACD,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC","sourcesContent":["import { ReactElement, ComponentProps } from 'react';\nimport { View, StyleSheet, ViewProps } from 'react-native';\n\nimport { ViewSlot } from './common';\n\nexport type TabListProps = ViewProps & {\n /** Forward props to child component and removes the extra `<View>`. Useful for custom wrappers. */\n asChild?: boolean;\n};\n\n/**\n * Wrapper component for `TabTriggers`. `TabTriggers` within the `TabList` define the tabs.\n *\n * @example\n * ```tsx\n * <Tabs>\n * <TabSlot />\n * <TabList>\n * <TabTrigger name=\"home\" href=\"/\" />\n * </TabList>\n * </Tabs>\n * ```\n */\nexport function TabList({ asChild, style, ...props }: TabListProps) {\n const Comp = asChild ? ViewSlot : View;\n return <Comp style={[styles.tabList, style]} {...props} />;\n}\n\n/**\n * @hidden\n */\nexport function isTabList(\n child: ReactElement<any>\n): child is ReactElement<ComponentProps<typeof TabList>> {\n return child.type === TabList;\n}\n\nconst styles = StyleSheet.create({\n tabList: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n tabTrigger: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n"]}

115
node_modules/expo-router/build/ui/TabRouter.d.ts generated vendored Normal file
View File

@@ -0,0 +1,115 @@
import { CommonNavigationAction, ParamListBase, Router, TabActionType as RNTabActionType, TabNavigationState, TabRouterOptions as RNTabRouterOptions, type StackActionType } from '@react-navigation/native';
import { TriggerMap } from './common';
export type ExpoTabRouterOptions = RNTabRouterOptions & {
triggerMap: TriggerMap;
};
type ReplaceAction = Extract<StackActionType, {
type: 'REPLACE';
}>;
export type ExpoTabActionType = RNTabActionType | CommonNavigationAction | ReplaceAction | {
type: 'JUMP_TO';
source?: string;
target?: string;
payload: {
name: string;
resetOnFocus?: boolean;
params?: object;
};
};
export declare function ExpoTabRouter(options: ExpoTabRouterOptions): Router<TabNavigationState<ParamListBase>, {
type: "GO_BACK";
source?: string;
target?: string;
} | {
type: "NAVIGATE";
payload: {
name: string;
params?: object;
path?: string;
merge?: boolean;
pop?: boolean;
};
source?: string;
target?: string;
} | {
type: "NAVIGATE_DEPRECATED";
payload: {
name: string;
params?: object;
merge?: boolean;
};
source?: string;
target?: string;
} | {
type: "RESET";
payload: (Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}> | import("@react-navigation/native").PartialState<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>> | (Omit<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>, "routes"> & {
routes: Omit<import("@react-navigation/native").Route<string>, "key">[];
})) | undefined;
source?: string;
target?: string;
} | {
type: "SET_PARAMS";
payload: {
params?: object;
};
source?: string;
target?: string;
} | {
type: "REPLACE_PARAMS";
payload: {
params?: object;
};
source?: string;
target?: string;
} | {
type: "PRELOAD";
payload: {
name: string;
params?: object;
};
source?: string;
target?: string;
} | {
type: "REPLACE";
payload: {
name: string;
params?: object;
};
source?: string;
target?: string;
} | RNTabActionType | {
type: "JUMP_TO";
source?: string;
target?: string;
payload: {
name: string;
resetOnFocus?: boolean;
params?: object;
};
}>;
export {};
//# sourceMappingURL=TabRouter.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"TabRouter.d.ts","sourceRoot":"","sources":["../../src/ui/TabRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,aAAa,EAEb,MAAM,EACN,aAAa,IAAI,eAAe,EAChC,kBAAkB,EAClB,gBAAgB,IAAI,kBAAkB,EACtC,KAAK,eAAe,EAErB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IACtD,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,KAAK,aAAa,GAAG,OAAO,CAAC,eAAe,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAEnE,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,sBAAsB,GACtB,aAAa,GACb;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;CACH,CAAC;AAEN,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB;;;;;;;;cAjBzD,CAAC;YAAsB,CAAC;aAAuB,CAAC;WAE/C,CAAC;;;;;;;;cAQS,CAAC;aACM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAWJ,CAAC;;;;;;;cAKV,CAAD;;;;;;;;cAKqB,CAAC;;;;;;;;cAzC3B,CAAD;;;;;UAgBW,SAAS;aACN,MAAM;aACN,MAAM;aACN;QACP,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;GAiFN"}

75
node_modules/expo-router/build/ui/TabRouter.js generated vendored Normal file
View File

@@ -0,0 +1,75 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpoTabRouter = ExpoTabRouter;
const native_1 = require("@react-navigation/native");
function ExpoTabRouter(options) {
const rnTabRouter = (0, native_1.TabRouter)(options);
const router = {
...rnTabRouter,
getStateForAction(state, action, options) {
if (isReplaceAction(action)) {
action = {
...action,
type: 'JUMP_TO',
};
// Generate the state as if we were using JUMP_TO
const nextState = rnTabRouter.getStateForAction(state, action, options);
if (!nextState || nextState.index === undefined || !Array.isArray(nextState.history)) {
return null;
}
// We can assert that nextState is TabNavigationState here, because we checked for index and history above
state = nextState;
// If the state is valid and we didn't JUMP_TO a single history state,
// then remove the previous state.
if (state.index !== 0) {
const previousIndex = state.index - 1;
state = {
...state,
key: `${state.key}-replace`,
// Omit the previous history entry that we are replacing
history: [
...state.history.slice(0, previousIndex),
...state.history.splice(state.index),
],
};
}
}
else if (action.type !== 'JUMP_TO') {
return rnTabRouter.getStateForAction(state, action, options);
}
const route = state.routes.find((route) => route.name === action.payload.name);
if (!route || !state) {
// This shouldn't occur, but lets just hand it off to the next navigator in case.
return null;
}
// We should reset if this is the first time visiting the route
let shouldReset = !state.history?.some((item) => item.key === route?.key) && !route.state;
if (!shouldReset && 'resetOnFocus' in action.payload && action.payload.resetOnFocus) {
shouldReset = state.routes[state.index ?? 0].key !== route.key;
}
if (shouldReset) {
options.routeParamList[route.name] = {
...options.routeParamList[route.name],
};
state = {
...state,
routes: state.routes.map((r) => {
if (r.key !== route.key) {
return r;
}
return { ...r, state: undefined };
}),
};
return rnTabRouter.getStateForAction(state, action, options);
}
else {
return rnTabRouter.getStateForRouteFocus(state, route.key);
}
},
};
return router;
}
function isReplaceAction(action) {
return action.type === 'REPLACE';
}
//# sourceMappingURL=TabRouter.js.map

1
node_modules/expo-router/build/ui/TabRouter.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

73
node_modules/expo-router/build/ui/TabSlot.d.ts generated vendored Normal file
View File

@@ -0,0 +1,73 @@
import { ComponentProps, ReactElement } from 'react';
import { ScreenContainer } from 'react-native-screens';
import { TabsDescriptor } from './TabContext';
import { TabListProps } from './TabList';
export type TabSlotProps = ComponentProps<typeof ScreenContainer> & {
/**
* Remove inactive screens.
*/
detachInactiveScreens?: boolean;
/**
* Override how the `Screen` component is rendered.
*/
renderFn?: typeof defaultTabsSlotRender;
};
/**
* Options provided to the `UseTabSlotOptions`.
*/
export type TabsSlotRenderOptions = {
/**
* Index of screen.
*/
index: number;
/**
* Whether the screen is focused.
*/
isFocused: boolean;
/**
* Whether the screen has been loaded.
*/
loaded: boolean;
/**
* Should the screen be unloaded when inactive.
*/
detachInactiveScreens: boolean;
};
/**
* Returns a `ReactElement` of the current tab.
*
* @example
* ```tsx
* function MyTabSlot() {
* const slot = useTabSlot();
*
* return slot;
* }
* ```
*/
export declare function useTabSlot({ detachInactiveScreens, style, renderFn, }?: TabSlotProps): import("react").JSX.Element;
/**
* Renders the current tab.
*
* @see [`useTabSlot`](#usetabslot) for a hook version of this component.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
export declare function TabSlot(props: TabSlotProps): import("react").JSX.Element;
/**
* @hidden
*/
export declare function defaultTabsSlotRender(descriptor: TabsDescriptor, { isFocused, loaded, detachInactiveScreens }: TabsSlotRenderOptions): import("react").JSX.Element | null;
/**
* @hidden
*/
export declare function isTabSlot(child: ReactElement<any>): child is ReactElement<TabListProps>;
//# sourceMappingURL=TabSlot.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"TabSlot.d.ts","sourceRoot":"","sources":["../../src/ui/TabSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAY,MAAM,OAAO,CAAC;AAE/D,OAAO,EAAE,eAAe,EAAU,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAc,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,OAAO,eAAe,CAAC,GAAG;IAClE;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,qBAAqB,CAAC;CACzC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,qBAAqB,EAAE,OAAO,CAAC;CAChC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,qBAAuE,EACvE,KAAK,EACL,QAAgC,GACjC,GAAE,YAAiB,+BA8BnB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAE1C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,cAAc,EAC1B,EAAE,SAAS,EAAE,MAAM,EAAE,qBAAqB,EAAE,EAAE,qBAAqB,sCAuBpE;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,GAAG,KAAK,IAAI,YAAY,CAAC,YAAY,CAAC,CAEvF"}

108
node_modules/expo-router/build/ui/TabSlot.js generated vendored Normal file
View File

@@ -0,0 +1,108 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTabSlot = useTabSlot;
exports.TabSlot = TabSlot;
exports.defaultTabsSlotRender = defaultTabsSlotRender;
exports.isTabSlot = isTabSlot;
const react_1 = require("react");
const react_native_1 = require("react-native");
const react_native_screens_1 = require("react-native-screens");
const TabContext_1 = require("./TabContext");
const Navigator_1 = require("../views/Navigator");
/**
* Returns a `ReactElement` of the current tab.
*
* @example
* ```tsx
* function MyTabSlot() {
* const slot = useTabSlot();
*
* return slot;
* }
* ```
*/
function useTabSlot({ detachInactiveScreens = ['android', 'ios', 'web'].includes(react_native_1.Platform.OS), style, renderFn = defaultTabsSlotRender, } = {}) {
const { state, descriptors } = (0, Navigator_1.useNavigatorContext)();
const focusedRouteKey = state.routes[state.index].key;
const [loaded, setLoaded] = (0, react_1.useState)({ [focusedRouteKey]: true });
if (!loaded[focusedRouteKey]) {
setLoaded({ ...loaded, [focusedRouteKey]: true });
}
return (<react_native_screens_1.ScreenContainer enabled={detachInactiveScreens} hasTwoStates style={[styles.screenContainer, style]}>
{state.routes.map((route, index) => {
const descriptor = descriptors[route.key];
return (<TabContext_1.TabContext.Provider key={descriptor.route.key} value={descriptor.options}>
{renderFn(descriptor, {
index,
isFocused: state.index === index,
loaded: loaded[route.key],
detachInactiveScreens,
})}
</TabContext_1.TabContext.Provider>);
})}
</react_native_screens_1.ScreenContainer>);
}
/**
* Renders the current tab.
*
* @see [`useTabSlot`](#usetabslot) for a hook version of this component.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
function TabSlot(props) {
return useTabSlot(props);
}
/**
* @hidden
*/
function defaultTabsSlotRender(descriptor, { isFocused, loaded, detachInactiveScreens }) {
const { lazy = true, unmountOnBlur, freezeOnBlur } = descriptor.options;
if (unmountOnBlur && !isFocused) {
return null;
}
if (lazy && !loaded && !isFocused) {
// Don't render a lazy screen if we've never navigated to it
return null;
}
return (<react_native_screens_1.Screen key={descriptor.route.key} enabled={detachInactiveScreens} activityState={isFocused ? 2 : 0} freezeOnBlur={freezeOnBlur} style={[styles.screen, isFocused ? styles.focused : styles.unfocused]}>
{descriptor.render()}
</react_native_screens_1.Screen>);
}
/**
* @hidden
*/
function isTabSlot(child) {
return child.type === TabSlot;
}
const styles = react_native_1.StyleSheet.create({
screen: {
flex: 1,
position: 'relative',
height: '100%',
},
screenContainer: {
flexShrink: 0,
flexGrow: 1,
},
focused: {
zIndex: 1,
display: 'flex',
flexShrink: 0,
flexGrow: 1,
},
unfocused: {
zIndex: -1,
display: 'none',
flexShrink: 1,
flexGrow: 0,
},
});
//# sourceMappingURL=TabSlot.js.map

1
node_modules/expo-router/build/ui/TabSlot.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

88
node_modules/expo-router/build/ui/TabTrigger.d.ts generated vendored Normal file
View File

@@ -0,0 +1,88 @@
import { TabNavigationState } from '@react-navigation/native';
import { ReactNode, ReactElement, ComponentProps } from 'react';
import { View, PressableProps } from 'react-native';
import type { TriggerMap } from './common';
import type { Href } from '../types';
type PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {
children?: ReactNode | undefined;
};
export type TabTriggerProps = PressablePropsWithoutFunctionChildren & {
/**
* Name of tab. When used within a `TabList` this sets the name of the tab.
* Otherwise, this references the name.
*/
name: string;
/**
* Name of tab. Required when used within a `TabList`.
*/
href?: Href;
/**
* Forward props to child component. Useful for custom wrappers.
*/
asChild?: boolean;
/**
* Resets the route when switching to a tab.
*/
resetOnFocus?: boolean;
};
export type TabTriggerOptions = {
name: string;
href: Href;
};
export type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren & React.RefAttributes<View> & {
isFocused?: boolean;
href?: string;
};
/**
* Creates a trigger to navigate to a tab. When used as child of `TabList`, its
* functionality slightly changes since the `href` prop is required,
* and the trigger also defines what routes are present in the `Tabs`.
*
* When used outside of `TabList`, this component no longer requires an `href`.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
export declare function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps): import("react").JSX.Element;
/**
* @hidden
*/
export declare function isTabTrigger(child: ReactElement<any>): child is ReactElement<ComponentProps<typeof TabTrigger>>;
/**
* Options for `switchTab` function.
*/
export type SwitchToOptions = {
/**
* Navigate and reset the history on route focus.
*/
resetOnFocus?: boolean;
};
export type Trigger = TriggerMap[string] & {
isFocused: boolean;
resolvedHref: string;
route: TabNavigationState<any>['routes'][number];
};
export type UseTabTriggerResult = {
switchTab: (name: string, options: SwitchToOptions) => void;
getTrigger: (name: string) => Trigger | undefined;
trigger?: Trigger;
triggerProps: TriggerProps;
};
export type TriggerProps = {
isFocused: boolean;
onPress: PressableProps['onPress'];
onLongPress: PressableProps['onLongPress'];
};
/**
* Utility hook creating custom `TabTrigger`.
*/
export declare function useTabTrigger(options: TabTriggerProps): UseTabTriggerResult;
export {};
//# sourceMappingURL=TabTrigger.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"TabTrigger.d.ts","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAO,YAAY,EAAE,cAAc,EAAe,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,IAAI,EAAyB,cAAc,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,qCAAqC,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IAC9E,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,qCAAqC,GAAG;IACpE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,qCAAqC,GACrE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAIJ;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,eAAe,+BA4B1F;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,GACvB,KAAK,IAAI,YAAY,CAAC,cAAc,CAAC,OAAO,UAAU,CAAC,CAAC,CAE1D;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5D,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,SAAS,CAAC;IAClD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,mBAAmB,CA6G3E"}

158
node_modules/expo-router/build/ui/TabTrigger.js generated vendored Normal file
View File

@@ -0,0 +1,158 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TabTrigger = TabTrigger;
exports.isTabTrigger = isTabTrigger;
exports.useTabTrigger = useTabTrigger;
const react_slot_1 = require("@radix-ui/react-slot");
const react_1 = require("react");
const react_native_1 = require("react-native");
const TabContext_1 = require("./TabContext");
const getPathFromState_1 = require("../fork/getPathFromState");
const imperative_api_1 = require("../imperative-api");
const useLinkToPathProps_1 = require("../link/useLinkToPathProps");
const matchers_1 = require("../matchers");
const Navigator_1 = require("../views/Navigator");
const TabTriggerSlot = react_slot_1.Slot;
/**
* Creates a trigger to navigate to a tab. When used as child of `TabList`, its
* functionality slightly changes since the `href` prop is required,
* and the trigger also defines what routes are present in the `Tabs`.
*
* When used outside of `TabList`, this component no longer requires an `href`.
*
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
function TabTrigger({ asChild, name, href, resetOnFocus, ...props }) {
const { trigger, triggerProps } = useTabTrigger({
name,
resetOnFocus,
...props,
});
// Pressable doesn't accept the extra props, so only pass them if we are using asChild
if (asChild) {
return (<TabTriggerSlot style={styles.tabTrigger} {...props} {...triggerProps} href={trigger?.resolvedHref}>
{props.children}
</TabTriggerSlot>);
}
else {
// These props are not typed, but are allowed by React Native Web
const reactNativeWebProps = { href: trigger?.resolvedHref };
return (<react_native_1.Pressable style={styles.tabTrigger} {...reactNativeWebProps} {...props} {...triggerProps}>
{props.children}
</react_native_1.Pressable>);
}
}
/**
* @hidden
*/
function isTabTrigger(child) {
return child.type === TabTrigger;
}
/**
* Utility hook creating custom `TabTrigger`.
*/
function useTabTrigger(options) {
const { state, navigation } = (0, Navigator_1.useNavigatorContext)();
const { name, resetOnFocus, onPress, onLongPress } = options;
const triggerMap = (0, react_1.use)(TabContext_1.TabTriggerMapContext);
const getTrigger = (0, react_1.useCallback)((name) => {
const config = triggerMap[name];
if (!config) {
return;
}
return {
isFocused: state.index === config.index,
route: state.routes[config.index],
resolvedHref: (0, matchers_1.stripGroupSegmentsFromPath)((0, getPathFromState_1.appendBaseUrl)(config.href)),
...config,
};
}, [triggerMap]);
const trigger = name !== undefined ? getTrigger(name) : undefined;
const switchTab = (0, react_1.useCallback)((name, options) => {
const config = triggerMap[name];
if (config) {
if (config.type === 'external') {
return imperative_api_1.router.navigate(config.href);
}
else {
return navigation?.dispatch({
...config.action,
type: 'JUMP_TO',
payload: {
...config.action.payload,
...options,
},
});
}
}
else {
return navigation?.dispatch({
type: 'JUMP_TO',
payload: {
name,
},
});
}
}, [navigation, triggerMap]);
const handleOnPress = (0, react_1.useCallback)((event) => {
onPress?.(event);
if (!trigger)
return;
if (event?.isDefaultPrevented())
return;
navigation?.emit({
type: 'tabPress',
target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,
canPreventDefault: true,
});
if (!(0, useLinkToPathProps_1.shouldHandleMouseEvent)(event))
return;
if (!trigger.isFocused) {
switchTab(name, { resetOnFocus });
}
}, [onPress, name, resetOnFocus, trigger]);
const handleOnLongPress = (0, react_1.useCallback)((event) => {
onLongPress?.(event);
if (!trigger)
return;
if (event?.isDefaultPrevented())
return;
navigation?.emit({
type: 'tabLongPress',
target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,
});
if (!(0, useLinkToPathProps_1.shouldHandleMouseEvent)(event))
return;
if (!trigger.isFocused) {
switchTab(name, {
resetOnFocus,
});
}
}, [onLongPress, name, resetOnFocus, trigger]);
const triggerProps = {
isFocused: Boolean(trigger?.isFocused),
onPress: handleOnPress,
onLongPress: handleOnLongPress,
};
return {
switchTab,
getTrigger,
trigger,
triggerProps,
};
}
const styles = react_native_1.StyleSheet.create({
tabTrigger: {
flexDirection: 'row',
justifyContent: 'space-between',
},
});
//# sourceMappingURL=TabTrigger.js.map

1
node_modules/expo-router/build/ui/TabTrigger.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

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

@@ -0,0 +1,255 @@
import { DefaultNavigatorOptions, ParamListBase, TabActionHelpers, TabNavigationState, TabRouterOptions } from '@react-navigation/native';
import { PropsWithChildren } from 'react';
import { ViewProps } from 'react-native';
import { ExpoTabsScreenOptions, TabNavigationEventMap, TabsContextValue } from './TabContext';
import { ScreenTrigger } from './common';
export * from './TabContext';
export * from './TabList';
export * from './TabSlot';
export * from './TabTrigger';
/**
* Options to provide to the Tab Router.
*/
export type UseTabsOptions = Omit<DefaultNavigatorOptions<ParamListBase, any, TabNavigationState<any>, ExpoTabsScreenOptions, TabNavigationEventMap, any>, 'children'> & {
backBehavior?: TabRouterOptions['backBehavior'];
};
export type TabsProps = ViewProps & {
/** Forward props to child component and removes the extra `<View>`. Useful for custom wrappers. */
asChild?: boolean;
options?: UseTabsOptions;
};
/**
* Root component for the headless tabs.
*
* @see [`useTabsWithChildren`](#usetabswithchildrenoptions) for a hook version of this component.
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
export declare function Tabs(props: TabsProps): import("react").JSX.Element;
export type UseTabsWithChildrenOptions = PropsWithChildren<UseTabsOptions>;
export type UseTabsWithTriggersOptions = UseTabsOptions & {
triggers: ScreenTrigger[];
};
/**
* Hook version of `Tabs`. The returned NavigationContent component
* should be rendered. Using the hook requires using the `<TabList />`
* and `<TabTrigger />` components exported from Expo Router.
*
* The `useTabsWithTriggers()` hook can be used for custom components.
*
* @see [`Tabs`](#tabs) for the component version of this hook.
* @example
* ```tsx
* export function MyTabs({ children }) {
* const { NavigationContent } = useTabsWithChildren({ children })
*
* return <NavigationContent />
* }
* ```
*/
export declare function useTabsWithChildren(options: UseTabsWithChildrenOptions): {
state: TabNavigationState<any>;
navigation: {
dispatch(action: Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}> | ((state: Readonly<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>>) => Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined, options?: {
merge?: boolean;
pop?: boolean;
} | undefined] : never): void;
navigate<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
path?: string;
merge?: boolean;
pop?: boolean;
} : never): void;
navigateDeprecated<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
navigateDeprecated<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
merge?: boolean;
} : never): void;
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
reset(state: Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}> | import("@react-navigation/native").PartialState<Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<ParamListBase, {}> | undefined>(id?: string): T;
getState(): Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>;
} & import("@react-navigation/native").PrivateValueStore<[ParamListBase, unknown, unknown]> & import("@react-navigation/native").EventEmitter<TabNavigationEventMap> & {
setParams(params: Partial<object | undefined>): void;
replaceParams(params: object | undefined): void;
} & TabActionHelpers<ParamListBase>;
describe: (route: import("@react-navigation/native").RouteProp<ParamListBase>, placeholder: boolean) => import("@react-navigation/native").Descriptor<import("./TabContext").ExpoTabsNavigatorScreenOptions, Omit<{
dispatch(action: Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}> | ((state: Readonly<TabNavigationState<any>>) => Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined, options?: {
merge?: boolean;
pop?: boolean;
} | undefined] : never): void;
navigate<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
path?: string;
merge?: boolean;
pop?: boolean;
} : never): void;
navigateDeprecated<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
navigateDeprecated<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
merge?: boolean;
} : never): void;
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
reset(state: TabNavigationState<any> | import("@react-navigation/native").PartialState<TabNavigationState<any>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<ParamListBase, {}> | undefined>(id?: string): T;
getState(): TabNavigationState<any>;
} & import("@react-navigation/native").PrivateValueStore<[ParamListBase, unknown, unknown]>, "getParent"> & {
getParent<T = import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>, {}, {}> | undefined>(id?: string | undefined): T;
setOptions(options: Partial<import("./TabContext").ExpoTabsNavigatorScreenOptions>): void;
} & {
setParams(params: Partial<object | undefined>): void;
replaceParams(params: object | undefined): void;
} & import("@react-navigation/native").EventConsumer<TabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<any>>> & import("@react-navigation/native").PrivateValueStore<[ParamListBase, string, TabNavigationEventMap]> & TabActionHelpers<ParamListBase>, import("@react-navigation/native").RouteProp<ParamListBase, string>>;
descriptors: Record<string, import("@react-navigation/native").Descriptor<import("./TabContext").ExpoTabsNavigatorScreenOptions, Omit<{
dispatch(action: Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}> | ((state: Readonly<TabNavigationState<any>>) => Readonly<{
type: string;
payload?: object;
source?: string;
target?: string;
}>)): void;
navigate<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined, options?: {
merge?: boolean;
pop?: boolean;
} | undefined] : never): void;
navigate<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
path?: string;
merge?: boolean;
pop?: boolean;
} : never): void;
navigateDeprecated<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
navigateDeprecated<RouteName extends string>(options: RouteName extends unknown ? {
name: RouteName;
params: object | undefined;
merge?: boolean;
} : never): void;
preload<RouteName extends string>(...args: RouteName extends unknown ? [screen: RouteName, params?: object | undefined] : never): void;
reset(state: TabNavigationState<any> | import("@react-navigation/native").PartialState<TabNavigationState<any>>): void;
goBack(): void;
isFocused(): boolean;
canGoBack(): boolean;
getId(): string | undefined;
getParent<T = import("@react-navigation/native").NavigationHelpers<ParamListBase, {}> | undefined>(id?: string): T;
getState(): TabNavigationState<any>;
} & import("@react-navigation/native").PrivateValueStore<[ParamListBase, unknown, unknown]>, "getParent"> & {
getParent<T = import("@react-navigation/native").NavigationProp<ParamListBase, string, string | undefined, Readonly<{
key: string;
index: number;
routeNames: string[];
history?: unknown[];
routes: import("@react-navigation/native").NavigationRoute<ParamListBase, string>[];
type: string;
stale: false;
}>, {}, {}> | undefined>(id?: string | undefined): T;
setOptions(options: Partial<import("./TabContext").ExpoTabsNavigatorScreenOptions>): void;
} & {
setParams(params: Partial<object | undefined>): void;
replaceParams(params: object | undefined): void;
} & import("@react-navigation/native").EventConsumer<TabNavigationEventMap & import("@react-navigation/native").EventMapCore<TabNavigationState<any>>> & import("@react-navigation/native").PrivateValueStore<[ParamListBase, string, TabNavigationEventMap]> & TabActionHelpers<ParamListBase>, import("@react-navigation/native").RouteProp<ParamListBase, string>>>;
NavigationContent: ({ children }: {
children: React.ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
};
/**
* Alternative hook version of `Tabs` that uses explicit triggers
* instead of `children`.
*
* @see [`Tabs`](#tabs) for the component version of this hook.
* @example
* ```tsx
* export function MyTabs({ children }) {
* const { NavigationContent } = useTabsWithChildren({ triggers: [] })
*
* return <NavigationContent />
* }
* ```
*/
export declare function useTabsWithTriggers(options: UseTabsWithTriggersOptions): TabsContextValue;
//# sourceMappingURL=Tabs.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/ui/Tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAEjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EASL,iBAAiB,EAClB,MAAM,OAAO,CAAC;AACf,OAAO,EAAc,SAAS,EAAQ,MAAM,cAAc,CAAC;AAE3D,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EAErB,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAKtB,OAAO,EAAY,aAAa,EAAqB,MAAM,UAAU,CAAC;AAQtE,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAE7B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAC/B,uBAAuB,CACrB,aAAa,EACb,GAAG,EACH,kBAAkB,CAAC,GAAG,CAAC,EACvB,qBAAqB,EACrB,qBAAqB,EACrB,GAAG,CACJ,EACD,UAAU,CACX,GAAG;IACF,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;CACjD,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG;IAClC,mGAAmG;IACnG,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BAsBpC;AAGD,MAAM,MAAM,0BAA0B,GAAG,iBAAiB,CAAC,cAAc,CAAC,CAAC;AAG3E,MAAM,MAAM,0BAA0B,GAAG,cAAc,GAAG;IACxD,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B;;;;;mBA1FvE,CAAA;kBACC,CAAC;kBACC,CAAC;;;;;mBAQA,CAAH;;;;;;mBAYmB,CAAA;kBAA4B,CAAC;kBAA6B,CAAA;;0GAQnE,CAAC,6BAA6B,CAAC;iBAAqB,CAAC;eAA0B,CAAC;;;;;gBAY9D,CAAA;iBAC3B,CAAF;eAA0B,CAAC;;oHAIvB,CAAC;;;;iBAOG,CAAH;;yGAM2C,CAAC;;;;;mBASV,CAAC;;;;;;;;mBASI,CAAC;;;;;;;;;;;;;;mBAkBY,CAAC;;;;;;;;;;;;;;;;;mBAuBc,CAAC;kBAGpD,CAAC;kBAA4B,CAAC;;0GAOtC,CAAC,6BAER,CAAC;iBAGC,CAAA;eAA0B,CAAC;;;;;gBASzB,CAAC;iBAEP,CAAD;eAGD,CAAD;;oHAQgB,CAAC;;;;iBAMC,CAAC;;yGAIY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAkDrB,CAAC;kBAET,CAAH;kBACW,CAAC;;0GAE8D,CAAC,6BAA6B,CAAC;iBAAqB,CAAC;eAG1H,CAAF;;;;;gBAUE,CAAC;iBAID,CAAL;eAA0B,CAAC;;oHAE+E,CAAC;;;;iBAcvG,CAAC;;yGAMF,CAAD;;;;;;;;;;;;;;;;;;;;;;;;;;EAvKF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,gBAAgB,CAiEzF"}

196
node_modules/expo-router/build/ui/Tabs.js generated vendored Normal file
View File

@@ -0,0 +1,196 @@
"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.Tabs = Tabs;
exports.useTabsWithChildren = useTabsWithChildren;
exports.useTabsWithTriggers = useTabsWithTriggers;
const native_1 = require("@react-navigation/native");
const react_1 = require("react");
const react_native_1 = require("react-native");
const TabContext_1 = require("./TabContext");
const TabList_1 = require("./TabList");
const TabRouter_1 = require("./TabRouter");
const TabSlot_1 = require("./TabSlot");
const TabTrigger_1 = require("./TabTrigger");
const common_1 = require("./common");
const useComponent_1 = require("./useComponent");
const Route_1 = require("../Route");
const hooks_1 = require("../hooks");
const href_1 = require("../link/href");
const url_1 = require("../utils/url");
const Navigator_1 = require("../views/Navigator");
__exportStar(require("./TabContext"), exports);
__exportStar(require("./TabList"), exports);
__exportStar(require("./TabSlot"), exports);
__exportStar(require("./TabTrigger"), exports);
/**
* Root component for the headless tabs.
*
* @see [`useTabsWithChildren`](#usetabswithchildrenoptions) for a hook version of this component.
* @example
* ```tsx
* <Tabs>
* <TabSlot />
* <TabList>
* <TabTrigger name="home" href="/" />
* </TabList>
* </Tabs>
* ```
*/
function Tabs(props) {
const { children, asChild, options, ...rest } = props;
const Comp = asChild ? common_1.ViewSlot : react_native_1.View;
const { NavigationContent } = useTabsWithChildren({
// asChild adds an extra layer, so we need to process the child's children
children: asChild &&
(0, react_1.isValidElement)(children) &&
children.props &&
typeof children.props === 'object' &&
'children' in children.props
? children.props.children
: children,
...options,
});
return (<Comp style={styles.tabsRoot} {...rest}>
<NavigationContent>{children}</NavigationContent>
</Comp>);
}
/**
* Hook version of `Tabs`. The returned NavigationContent component
* should be rendered. Using the hook requires using the `<TabList />`
* and `<TabTrigger />` components exported from Expo Router.
*
* The `useTabsWithTriggers()` hook can be used for custom components.
*
* @see [`Tabs`](#tabs) for the component version of this hook.
* @example
* ```tsx
* export function MyTabs({ children }) {
* const { NavigationContent } = useTabsWithChildren({ children })
*
* return <NavigationContent />
* }
* ```
*/
function useTabsWithChildren(options) {
const { children, ...rest } = options;
return useTabsWithTriggers({ triggers: parseTriggersFromChildren(children), ...rest });
}
/**
* Alternative hook version of `Tabs` that uses explicit triggers
* instead of `children`.
*
* @see [`Tabs`](#tabs) for the component version of this hook.
* @example
* ```tsx
* export function MyTabs({ children }) {
* const { NavigationContent } = useTabsWithChildren({ triggers: [] })
*
* return <NavigationContent />
* }
* ```
*/
function useTabsWithTriggers(options) {
const { triggers, ...rest } = options;
// Ensure we extend the parent triggers, so we can trigger them as well
const parentTriggerMap = (0, react_1.use)(TabContext_1.TabTriggerMapContext);
const routeNode = (0, Route_1.useRouteNode)();
const contextKey = (0, Route_1.useContextKey)();
const linking = (0, react_1.use)(native_1.LinkingContext).options;
const routeInfo = (0, hooks_1.useRouteInfo)();
if (!routeNode || !linking) {
throw new Error('No RouteNode. This is likely a bug in expo-router.');
}
const initialRouteName = routeNode.initialRouteName;
const { children, triggerMap } = (0, common_1.triggersToScreens)(triggers, routeNode, linking, initialRouteName, parentTriggerMap, routeInfo, contextKey);
const navigatorContext = (0, native_1.useNavigationBuilder)(TabRouter_1.ExpoTabRouter, {
children,
...rest,
triggerMap,
id: contextKey,
initialRouteName,
});
const { state, descriptors, navigation, describe, NavigationContent: RNNavigationContent, } = navigatorContext;
const navigatorContextValue = (0, react_1.useMemo)(() => ({
...navigatorContext,
contextKey,
router: TabRouter_1.ExpoTabRouter,
}), [navigatorContext, contextKey, TabRouter_1.ExpoTabRouter]);
const NavigationContent = (0, useComponent_1.useComponent)((children) => (<TabContext_1.TabTriggerMapContext.Provider value={triggerMap}>
<Navigator_1.NavigatorContext.Provider value={navigatorContextValue}>
<RNNavigationContent>{children}</RNNavigationContent>
</Navigator_1.NavigatorContext.Provider>
</TabContext_1.TabTriggerMapContext.Provider>));
return { state, descriptors, navigation, NavigationContent, describe };
}
function parseTriggersFromChildren(children, screenTriggers = [], isInTabList = false) {
react_1.Children.forEach(children, (child) => {
if (!child || !(0, react_1.isValidElement)(child) || (0, TabSlot_1.isTabSlot)(child)) {
return;
}
if (isFragment(child) && typeof child.props.children !== 'function') {
return parseTriggersFromChildren(child.props.children, screenTriggers, isInTabList || (0, TabList_1.isTabList)(child));
}
if ((0, TabList_1.isTabList)(child) && typeof child.props.children !== 'function') {
let children = child.props.children;
// <TabList asChild /> adds an extra layer. We need to parse the child's children
if (child.props.asChild &&
(0, react_1.isValidElement)(children) &&
children.props &&
typeof children.props === 'object' &&
'children' in children.props) {
children = children.props.children;
}
return parseTriggersFromChildren(children, screenTriggers, isInTabList || (0, TabList_1.isTabList)(child));
}
// We should only process TabTriggers within the TabList. All other components will be ignored
if (!isInTabList || !(0, TabTrigger_1.isTabTrigger)(child)) {
return;
}
const { href, name } = child.props;
if (!href) {
if (process.env.NODE_ENV === 'development') {
console.warn(`<TabTrigger name={${name}}> does not have a 'href' prop. TabTriggers within a <TabList /> are required to have an href.`);
}
return;
}
const resolvedHref = (0, href_1.resolveHref)(href);
if ((0, url_1.shouldLinkExternally)(resolvedHref)) {
return screenTriggers.push({
type: 'external',
name,
href: resolvedHref,
});
}
if (!name) {
if (process.env.NODE_ENV === 'development') {
console.warn(`<TabTrigger> does not have a 'name' prop. TabTriggers within a <TabList /> are required to have a name.`);
}
return;
}
return screenTriggers.push({ type: 'internal', href: resolvedHref, name });
});
return screenTriggers;
}
function isFragment(child) {
return child.type === react_1.Fragment;
}
const styles = react_native_1.StyleSheet.create({
tabsRoot: {
flex: 1,
},
});
//# sourceMappingURL=Tabs.js.map

1
node_modules/expo-router/build/ui/Tabs.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

40
node_modules/expo-router/build/ui/common.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
import { LinkingOptions, ParamListBase, PartialRoute, Route } from '@react-navigation/native';
import type { ExpoTabActionType } from './TabRouter';
import { UrlObject } from '../LocationProvider';
import { RouteNode } from '../Route';
import { Href } from '../types';
import { Slot } from './Slot';
export declare const ViewSlot: Slot<import("react-native").ViewProps, import("react").Component<import("react-native").ViewProps, {}, any>>;
export type ScreenTrigger = {
type: 'internal';
href: Href;
name: string;
} | {
type: 'external';
name: string;
href: string;
};
type JumpToNavigationAction = Extract<ExpoTabActionType, {
type: 'JUMP_TO';
}>;
type TriggerConfig = {
type: 'internal';
name: string;
href: string;
routeNode: RouteNode;
action: JumpToNavigationAction;
} | {
type: 'external';
name: string;
href: string;
};
export type TriggerMap = Record<string, TriggerConfig & {
index: number;
}>;
export declare function triggersToScreens(triggers: ScreenTrigger[], layoutRouteNode: RouteNode, linking: LinkingOptions<ParamListBase>, initialRouteName: undefined | string, parentTriggerMap: TriggerMap, routeInfo: UrlObject, contextKey: string): {
children: import("react").JSX.Element[];
triggerMap: TriggerMap;
};
export declare function stateToAction(state: PartialRoute<Route<string, object | undefined>> | undefined, startAtRoute?: string): JumpToNavigationAction;
export {};
//# sourceMappingURL=common.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/ui/common.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAE9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,eAAO,MAAM,QAAQ,8GAAO,CAAC;AAE7B,MAAM,MAAM,aAAa,GACrB;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEN,KAAK,sBAAsB,GAAG,OAAO,CAAC,iBAAiB,EAAE;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC,CAAC;AAC9E,KAAK,aAAa,GACd;IACE,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,sBAAsB,CAAC;CAChC,GACD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE3E,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,aAAa,EAAE,EACzB,eAAe,EAAE,SAAS,EAC1B,OAAO,EAAE,cAAc,CAAC,aAAa,CAAC,EACtC,gBAAgB,EAAE,SAAS,GAAG,MAAM,EACpC,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM;;;EAyInB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,SAAS,EAClE,YAAY,CAAC,EAAE,MAAM,GACpB,sBAAsB,CAsCxB"}

147
node_modules/expo-router/build/ui/common.js generated vendored Normal file
View File

@@ -0,0 +1,147 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewSlot = void 0;
exports.triggersToScreens = triggersToScreens;
exports.stateToAction = stateToAction;
const href_1 = require("../link/href");
const sortRoutes_1 = require("../sortRoutes");
const useScreens_1 = require("../useScreens");
const Slot_1 = require("./Slot");
const constants_1 = require("../constants");
exports.ViewSlot = Slot_1.Slot;
function triggersToScreens(triggers, layoutRouteNode, linking, initialRouteName, parentTriggerMap, routeInfo, contextKey) {
const configs = [];
for (const trigger of triggers) {
if (trigger.name in parentTriggerMap) {
const parentTrigger = parentTriggerMap[trigger.name];
throw new Error(`Trigger ${JSON.stringify({
name: trigger.name,
href: trigger.href,
})} has the same name as parent trigger ${JSON.stringify({
name: parentTrigger.name,
href: parentTrigger.href,
})}. Triggers must have unique names.`);
}
if (trigger.type === 'external') {
configs.push(trigger);
continue;
}
let resolvedHref = (0, href_1.resolveHref)(trigger.href);
if (resolvedHref.startsWith('../')) {
throw new Error('Trigger href cannot link to a parent directory');
}
const segmentsWithoutGroups = contextKey.split('/').filter((segment) => {
return !(segment.startsWith('(') && segment.endsWith(')'));
});
resolvedHref = (0, href_1.resolveHrefStringWithSegments)(resolvedHref, {
...routeInfo,
segments: segmentsWithoutGroups,
}, { relativeToDirectory: true });
let state = linking.getStateFromPath?.(resolvedHref, linking.config)?.routes[0];
if (!state) {
// This shouldn't occur, as you should get the global +not-found
console.warn(`Unable to find screen for trigger ${JSON.stringify(trigger)}. Does this point to a valid screen?`);
continue;
}
let routeState = state;
if (routeState.name === constants_1.NOT_FOUND_ROUTE_NAME) {
if (process.env.NODE_ENV !== 'production') {
console.warn(`Tab trigger '${trigger.name}' has the href '${trigger.href}' which points to a +not-found route.`);
}
continue;
}
const targetStateName = layoutRouteNode.route || '__root';
// The state object is the current state from the rootNavigator
// We need to work out the state for just this trigger
while (state?.state) {
if (state.name === targetStateName)
break;
state = state.state.routes[state.state.index ?? state.state.routes.length - 1];
}
routeState = state.state?.routes[state.state.index ?? state.state.routes.length - 1] || state;
const routeNode = layoutRouteNode.children.find((child) => child.route === routeState?.name);
if (!routeNode) {
console.warn(`Unable to find routeNode for trigger ${JSON.stringify(trigger)}. This might be a bug with Expo Router`);
continue;
}
const duplicateTrigger = trigger.type === 'internal' &&
configs.find((config) => {
if (config.type === 'external') {
return false;
}
return config.routeNode.route === routeNode.route;
});
if (duplicateTrigger) {
const duplicateTriggerText = `${JSON.stringify({ name: duplicateTrigger.name, href: duplicateTrigger.href })} and ${JSON.stringify({ name: trigger.name, href: trigger.href })}`;
throw new Error(`A navigator cannot contain multiple trigger components that map to the same sub-segment. Consider adding a shared group and assigning a group to each trigger. Conflicting triggers:\n\t${duplicateTriggerText}.\nBoth triggers map to route ${routeNode.route}.`);
}
configs.push({
...trigger,
href: resolvedHref,
routeNode,
action: stateToAction(state, layoutRouteNode.route),
});
}
const sortFn = (0, sortRoutes_1.sortRoutesWithInitial)(initialRouteName);
const sortedConfigs = configs.sort((a, b) => {
// External routes should be last. They will eventually be dropped
if (a.type === 'external' && b.type === 'external') {
return 0;
}
else if (a.type === 'external') {
return 1;
}
else if (b.type === 'external') {
return -1;
}
return sortFn(a.routeNode, b.routeNode);
});
const children = [];
const triggerMap = { ...parentTriggerMap };
for (const [index, config] of sortedConfigs.entries()) {
triggerMap[config.name] = { ...config, index };
if (config.type === 'internal') {
children.push((0, useScreens_1.routeToScreen)(config.routeNode));
}
}
return {
children,
triggerMap,
};
}
function stateToAction(state, startAtRoute) {
const rootPayload = {};
let payload = rootPayload;
startAtRoute = startAtRoute === '' ? '__root' : startAtRoute;
let foundStartingPoint = startAtRoute === undefined || !state?.state;
while (state) {
if (foundStartingPoint) {
if (payload === rootPayload) {
payload.name = state.name;
}
else {
payload.screen = state.name;
}
payload.params = state.params ? { ...state.params } : {};
state = state.state?.routes[state.state?.routes.length - 1];
if (state) {
payload.params ??= {};
payload = payload.params;
}
}
else {
if (state.name === startAtRoute) {
foundStartingPoint = true;
}
const nextState = state.state?.routes[state.state?.routes.length - 1];
if (nextState) {
state = nextState;
}
}
}
return {
type: 'JUMP_TO',
payload: rootPayload,
};
}
//# sourceMappingURL=common.js.map

1
node_modules/expo-router/build/ui/common.js.map generated vendored Normal file

File diff suppressed because one or more lines are too long

2
node_modules/expo-router/build/ui/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export * from './Tabs';
//# sourceMappingURL=index.d.ts.map

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

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}

18
node_modules/expo-router/build/ui/index.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"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 });
__exportStar(require("./Tabs"), exports);
//# sourceMappingURL=index.js.map

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

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAAuB","sourcesContent":["export * from './Tabs';\n"]}

10
node_modules/expo-router/build/ui/useComponent.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
import { JSX } from 'react';
/**
* Copied from @react-navigation/core
*/
type Render = (children: React.ReactNode) => JSX.Element;
export declare function useComponent(render: Render): import("react").ForwardRefExoticComponent<{
children: React.ReactNode;
} & import("react").RefAttributes<unknown>>;
export {};
//# sourceMappingURL=useComponent.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useComponent.d.ts","sourceRoot":"","sources":["../../src/ui/useComponent.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiC,GAAG,EAAE,MAAM,OAAO,CAAC;AAE3D;;GAEG;AACH,KAAK,MAAM,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,CAAC;AAWzD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM;cAaD,KAAK,CAAC,SAAS;4CAYxD"}

25
node_modules/expo-router/build/ui/useComponent.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useComponent = useComponent;
const react_1 = require("react");
const NavigationContent = ({ render, children }) => {
return render(children);
};
function useComponent(render) {
const renderRef = (0, react_1.useRef)(render);
// Normally refs shouldn't be mutated in render
// But we return a component which will be rendered
// So it's just for immediate consumption
renderRef.current = render;
(0, react_1.useEffect)(() => {
renderRef.current = null;
});
return (0, react_1.useRef)((0, react_1.forwardRef)(({ children }, _ref) => {
const render = renderRef.current;
if (render === null) {
throw new Error('The returned component must be rendered in the same render phase as the hook.');
}
return <NavigationContent render={render}>{children}</NavigationContent>;
})).current;
}
//# sourceMappingURL=useComponent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useComponent.js","sourceRoot":"","sources":["../../src/ui/useComponent.tsx"],"names":[],"mappings":";;AAgBA,oCAyBC;AAzCD,iCAA2D;AAY3D,MAAM,iBAAiB,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAS,EAAE,EAAE;IACxD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1B,CAAC,CAAC;AAEF,SAAgB,YAAY,CAAC,MAAc;IACzC,MAAM,SAAS,GAAG,IAAA,cAAM,EAAgB,MAAM,CAAC,CAAC;IAEhD,+CAA+C;IAC/C,mDAAmD;IACnD,yCAAyC;IACzC,SAAS,CAAC,OAAO,GAAG,MAAM,CAAC;IAE3B,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,cAAM,EACX,IAAA,kBAAU,EAAC,CAAC,EAAE,QAAQ,EAAiC,EAAE,IAAI,EAAE,EAAE;QAC/D,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QAEjC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,+EAA+E,CAChF,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC,CAAC;IAC3E,CAAC,CAAC,CACH,CAAC,OAAO,CAAC;AACZ,CAAC","sourcesContent":["import { useRef, forwardRef, useEffect, JSX } from 'react';\n\n/**\n * Copied from @react-navigation/core\n */\ntype Render = (children: React.ReactNode) => JSX.Element;\n\ntype Props = {\n render: Render;\n children: React.ReactNode;\n};\n\nconst NavigationContent = ({ render, children }: Props) => {\n return render(children);\n};\n\nexport function useComponent(render: Render) {\n const renderRef = useRef<Render | null>(render);\n\n // Normally refs shouldn't be mutated in render\n // But we return a component which will be rendered\n // So it's just for immediate consumption\n renderRef.current = render;\n\n useEffect(() => {\n renderRef.current = null;\n });\n\n return useRef(\n forwardRef(({ children }: { children: React.ReactNode }, _ref) => {\n const render = renderRef.current;\n\n if (render === null) {\n throw new Error(\n 'The returned component must be rendered in the same render phase as the hook.'\n );\n }\n\n return <NavigationContent render={render}>{children}</NavigationContent>;\n })\n ).current;\n}\n"]}