expo-router 6.1.0-canary-20251013-623c5a6 → 7.0.0-canary-20251023-4c86f95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_error.js +36 -3
- package/build/ExpoRoot.js +1 -1
- package/build/ExpoRoot.js.map +1 -1
- package/build/global-state/router-store.d.ts +2 -0
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +16 -12
- package/build/global-state/router-store.js.map +1 -1
- package/build/global-state/routing.d.ts +12 -4
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +35 -10
- package/build/global-state/routing.js.map +1 -1
- package/build/global-state/storeContext.d.ts +2 -0
- package/build/global-state/storeContext.d.ts.map +1 -1
- package/build/layouts/BaseStack.d.ts +3 -0
- package/build/layouts/BaseStack.d.ts.map +1 -0
- package/build/layouts/BaseStack.js +8 -0
- package/build/layouts/BaseStack.js.map +1 -0
- package/build/layouts/ExperimentalModalStack.d.ts +9 -0
- package/build/layouts/ExperimentalModalStack.d.ts.map +1 -0
- package/build/layouts/ExperimentalModalStack.js +15 -0
- package/build/layouts/ExperimentalModalStack.js.map +1 -0
- package/build/layouts/Stack.web.d.ts +1 -14
- package/build/layouts/Stack.web.d.ts.map +1 -1
- package/build/layouts/Stack.web.js +10 -13
- package/build/layouts/Stack.web.js.map +1 -1
- package/build/layouts/_web-modal.d.ts +3 -0
- package/build/layouts/_web-modal.d.ts.map +1 -0
- package/build/layouts/_web-modal.js +8 -0
- package/build/layouts/_web-modal.js.map +1 -0
- package/build/modal/web/ModalStack.d.ts.map +1 -1
- package/build/modal/web/ModalStack.js +7 -2
- package/build/modal/web/ModalStack.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js +4 -0
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +6 -2
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +7 -4
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js +15 -14
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/types.d.ts +8 -2
- package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/types.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/utils.d.ts +10 -1
- package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/utils.js +24 -0
- package/build/native-tabs/NativeBottomTabs/utils.js.map +1 -1
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +4 -7
- package/build/renderRootComponent.js.map +1 -1
- package/build/static/html.d.ts +1 -9
- package/build/static/html.d.ts.map +1 -1
- package/build/static/html.js +0 -26
- package/build/static/html.js.map +1 -1
- package/build/ui/TabRouter.d.ts +3 -4
- package/build/ui/TabRouter.d.ts.map +1 -1
- package/build/ui/TabRouter.js +14 -67
- package/build/ui/TabRouter.js.map +1 -1
- package/build/ui/TabTrigger.d.ts +4 -5
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +9 -8
- package/build/ui/TabTrigger.js.map +1 -1
- package/build/ui/Tabs.d.ts +0 -1
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js.map +1 -1
- package/html.js +1 -1
- package/package.json +9 -8
- package/build/getServerManifest.d.ts +0 -88
- package/build/getServerManifest.d.ts.map +0 -1
- package/build/getServerManifest.js +0 -238
- package/build/getServerManifest.js.map +0 -1
- package/build/routes-manifest.d.ts +0 -28
- package/build/routes-manifest.d.ts.map +0 -1
- package/build/routes-manifest.js +0 -30
- package/build/routes-manifest.js.map +0 -1
- package/build/static/getRootComponent.d.ts +0 -2
- package/build/static/getRootComponent.d.ts.map +0 -1
- package/build/static/getRootComponent.js +0 -25
- package/build/static/getRootComponent.js.map +0 -1
- package/build/static/getServerManifest.d.ts +0 -22
- package/build/static/getServerManifest.d.ts.map +0 -1
- package/build/static/getServerManifest.js +0 -50
- package/build/static/getServerManifest.js.map +0 -1
- package/build/static/renderStaticContent.d.ts +0 -15
- package/build/static/renderStaticContent.d.ts.map +0 -1
- package/build/static/renderStaticContent.js +0 -130
- package/build/static/renderStaticContent.js.map +0 -1
- package/build/utils/html.d.ts +0 -12
- package/build/utils/html.d.ts.map +0 -1
- package/build/utils/html.js +0 -29
- package/build/utils/html.js.map +0 -1
- package/node/render.js +0 -3
|
@@ -212,11 +212,17 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
212
212
|
/**
|
|
213
213
|
* The style of the every tab label in the tab bar.
|
|
214
214
|
*/
|
|
215
|
-
labelStyle?: NativeTabsLabelStyle
|
|
215
|
+
labelStyle?: NativeTabsLabelStyle | {
|
|
216
|
+
default?: NativeTabsLabelStyle;
|
|
217
|
+
selected?: NativeTabsLabelStyle;
|
|
218
|
+
};
|
|
216
219
|
/**
|
|
217
220
|
* The color of every tab icon in the tab bar.
|
|
218
221
|
*/
|
|
219
|
-
iconColor?: ColorValue
|
|
222
|
+
iconColor?: ColorValue | {
|
|
223
|
+
default?: ColorValue;
|
|
224
|
+
selected?: ColorValue;
|
|
225
|
+
};
|
|
220
226
|
/**
|
|
221
227
|
* The tint color of the tab icon.
|
|
222
228
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,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IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":";;;AAkMa,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AAuKE,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC;AAiEX,MAAM,4BAA4B,GAAG;IACnC,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SymbolOrImageSource;\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SymbolOrImageSource;\n /**\n * Title of the tab screen, displayed in the tab bar item.\n *\n * @platform android\n * @platform iOS\n */\n title?: string;\n /**\n * Specifies content of tab bar item badge.\n *\n * On Android, the value is interpreted in the following order:\n * - If the string can be parsed to integer, displays the value as a number\n * - Otherwise if the string is empty, displays \"small dot\" badge\n * - Otherwise, displays the value as a text\n *\n * On iOS, badge is displayed as regular string.\n *\n * @platform android\n * @platform ios\n */\n badgeValue?: string;\n /**\n * The style of the tab label when the tab is selected.\n */\n selectedLabelStyle?: NativeTabsLabelStyle;\n /**\n * The style of all the tab labels, when the tab is selected\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. If you override the `title`,\n * `icon`, or `selectedIcon`, note that this is not officially supported\n * by Apple and may lead to unexpected results.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The color of the icon when the tab is selected.\n */\n selectedIconColor?: ColorValue;\n /**\n * The color of the badge when the tab is selected.\n */\n selectedBadgeBackgroundColor?: ColorValue;\n /**\n * The color of all the badges when the tab is selected.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the background when the tab is selected.\n */\n backgroundColor?: ColorValue;\n /**\n * The blur effect to apply when the tab is selected.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow when the tab is selected.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * The color of the icon when the tab is selected.\n *\n * On iOS 26+ you can change the icon color in the scroll edge state.\n */\n iconColor?: ColorValue;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The position adjustment for all the labels when the tab is selected.\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The position adjustment for the label when the tab is selected.\n *\n * @platform iOS\n */\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsLabelStyle {\n /**\n * The font family of the tab label.\n */\n fontFamily?: TextStyle['fontFamily'];\n /**\n * The font size of the tab label.\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * The font weight of the tab label.\n */\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n /**\n * The font style of the tab label.\n */\n fontStyle?: TextStyle['fontStyle'];\n /**\n * The color of the tab label.\n */\n color?: TextStyle['color'];\n}\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\n/**\n * @platform android\n * @platform web\n */\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?: NativeTabsLabelStyle;\n // disabledLabelStyle?: NativeTabsLabelStyle;\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue;\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue | null;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n\nexport interface NativeTabsTriggerTabBarProps {\n /**\n * The style of the every tab label in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * The background color of the tab bar, when the tab is selected\n */\n backgroundColor?: ColorValue;\n /**\n * The color of every tab icon, when the tab is selected\n *\n * @platform iOS\n */\n iconColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The blur effect applied to the tab bar, when the tab is selected\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow when the tab is selected.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The color of the badge text.\n *\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/types.ts"],"names":[],"mappings":";;;AAkMa,QAAA,sBAAsB,GAAG;IACpC,MAAM;IACN,eAAe;IACf,YAAY;IACZ,OAAO;IACP,MAAM;IACN,SAAS;IACT,WAAW;IACX,yBAAyB;IACzB,oBAAoB;IACpB,gBAAgB;IAChB,qBAAqB;IACrB,sBAAsB;IACtB,8BAA8B;IAC9B,yBAAyB;IACzB,qBAAqB;IACrB,0BAA0B;IAC1B,2BAA2B;IAC3B,6BAA6B;IAC7B,wBAAwB;IACxB,oBAAoB;IACpB,yBAAyB;IACzB,0BAA0B;CAClB,CAAC;AA4KE,QAAA,6CAA6C,GAAG;IAC3D,MAAM;IACN,UAAU;IACV,SAAS;IACT,WAAW;CACH,CAAC;AAUE,QAAA,oCAAoC,GAAG;IAClD,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC;AAiEX,MAAM,4BAA4B,GAAG;IACnC,WAAW;IACX,UAAU;IACV,WAAW;IACX,WAAW;IACX,UAAU;IACV,SAAS;IACT,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC","sourcesContent":["import type {\n DefaultRouterOptions,\n ParamListBase,\n TabNavigationState,\n TabRouterOptions,\n useNavigationBuilder,\n} from '@react-navigation/native';\nimport type { PropsWithChildren } from 'react';\nimport type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nexport interface NativeTabOptions extends DefaultRouterOptions {\n /**\n * The icon to display in the tab bar.\n * @platform android\n * @platform iOS\n */\n icon?: SymbolOrImageSource;\n /**\n * The icon to display when the tab is selected.\n * @platform iOS\n */\n selectedIcon?: SymbolOrImageSource;\n /**\n * Title of the tab screen, displayed in the tab bar item.\n *\n * @platform android\n * @platform iOS\n */\n title?: string;\n /**\n * Specifies content of tab bar item badge.\n *\n * On Android, the value is interpreted in the following order:\n * - If the string can be parsed to integer, displays the value as a number\n * - Otherwise if the string is empty, displays \"small dot\" badge\n * - Otherwise, displays the value as a text\n *\n * On iOS, badge is displayed as regular string.\n *\n * @platform android\n * @platform ios\n */\n badgeValue?: string;\n /**\n * The style of the tab label when the tab is selected.\n */\n selectedLabelStyle?: NativeTabsLabelStyle;\n /**\n * The style of all the tab labels, when the tab is selected\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. If you override the `title`,\n * `icon`, or `selectedIcon`, note that this is not officially supported\n * by Apple and may lead to unexpected results.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n /**\n * The color of the icon when the tab is selected.\n */\n selectedIconColor?: ColorValue;\n /**\n * The color of the badge when the tab is selected.\n */\n selectedBadgeBackgroundColor?: ColorValue;\n /**\n * The color of all the badges when the tab is selected.\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the background when the tab is selected.\n */\n backgroundColor?: ColorValue;\n /**\n * The blur effect to apply when the tab is selected.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow when the tab is selected.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * The color of the icon when the tab is selected.\n *\n * On iOS 26+ you can change the icon color in the scroll edge state.\n */\n iconColor?: ColorValue;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The position adjustment for all the labels when the tab is selected.\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The position adjustment for the label when the tab is selected.\n *\n * @platform iOS\n */\n selectedTitlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport type SymbolOrImageSource =\n | {\n /**\n * The name of the SF Symbol to use as an icon.\n * @platform iOS\n */\n sf?: SFSymbol;\n /**\n * The name of the drawable resource to use as an icon.\n * @platform android\n */\n drawable?: string;\n }\n | {\n /**\n * The image source to use as an icon.\n */\n src?: ImageSourcePropType | Promise<ImageSourcePropType | null>;\n };\n\nexport interface ExtendedNativeTabOptions extends NativeTabOptions {\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n specialEffects?: BottomTabsScreenProps['specialEffects'];\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\nexport interface NativeTabsLabelStyle {\n /**\n * The font family of the tab label.\n */\n fontFamily?: TextStyle['fontFamily'];\n /**\n * The font size of the tab label.\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * The font weight of the tab label.\n */\n fontWeight?: NumericFontWeight | `${NumericFontWeight}`;\n /**\n * The font style of the tab label.\n */\n fontStyle?: TextStyle['fontStyle'];\n /**\n * The color of the tab label.\n */\n color?: TextStyle['color'];\n}\n\nexport const SUPPORTED_BLUR_EFFECTS = [\n 'none',\n 'systemDefault',\n 'extraLight',\n 'light',\n 'dark',\n 'regular',\n 'prominent',\n 'systemUltraThinMaterial',\n 'systemThinMaterial',\n 'systemMaterial',\n 'systemThickMaterial',\n 'systemChromeMaterial',\n 'systemUltraThinMaterialLight',\n 'systemThinMaterialLight',\n 'systemMaterialLight',\n 'systemThickMaterialLight',\n 'systemChromeMaterialLight',\n 'systemUltraThinMaterialDark',\n 'systemThinMaterialDark',\n 'systemMaterialDark',\n 'systemThickMaterialDark',\n 'systemChromeMaterialDark',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiblureffect/style)\n */\nexport type NativeTabsBlurEffect = (typeof SUPPORTED_BLUR_EFFECTS)[number];\n\n/**\n * @platform android\n * @platform web\n */\nexport interface NativeTabsActiveStyleType {\n /**\n * @platform android\n * @platform web\n */\n color?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n fontSize?: TextStyle['fontSize'];\n /**\n * @platform android\n */\n iconColor?: ColorValue;\n /**\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n\nexport interface NativeTabsProps extends PropsWithChildren {\n // #region common props\n /**\n * The style of the every tab label in the tab bar.\n */\n labelStyle?:\n | NativeTabsLabelStyle\n | {\n default?: NativeTabsLabelStyle;\n selected?: NativeTabsLabelStyle;\n };\n // disabledLabelStyle?: NativeTabsLabelStyle;\n /**\n * The color of every tab icon in the tab bar.\n */\n iconColor?: ColorValue | { default?: ColorValue; selected?: ColorValue };\n /**\n * The tint color of the tab icon.\n *\n * Can be overridden by icon color and label color for each tab individually.\n */\n tintColor?: ColorValue;\n /**\n * The background color of the tab bar.\n */\n backgroundColor?: ColorValue | null;\n /**\n * The background color of every badge in the tab bar.\n */\n badgeBackgroundColor?: ColorValue;\n // #endregion common props\n // #region iOS props\n /**\n * Specifies the minimize behavior for the tab bar.\n *\n * Available starting from iOS 26.\n *\n * The following values are currently supported:\n *\n * - `automatic` - resolves to the system default minimize behavior\n * - `never` - the tab bar does not minimize\n * - `onScrollDown` - the tab bar minimizes when scrolling down and\n * expands when scrolling back up\n * - `onScrollUp` - the tab bar minimizes when scrolling up and expands\n * when scrolling back down\n *\n * @see The supported values correspond to the official [UIKit documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior).\n *\n * @default automatic\n *\n * @platform iOS 26+\n */\n minimizeBehavior?: NativeTabsTabBarMinimizeBehavior;\n /**\n * The blur effect applied to the tab bar.\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbaritem/titlepositionadjustment)\n *\n * @platform iOS\n */\n titlePositionAdjustment?: {\n horizontal?: number;\n vertical?: number;\n };\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n // #endregion iOS props\n // #region android props\n /**\n * Disables the active indicator for the tab bar.\n *\n * @platform android\n */\n disableIndicator?: boolean;\n /**\n * The behavior when navigating back with the back button.\n *\n * @platform android\n */\n backBehavior?: 'none' | 'initialRoute' | 'history';\n /**\n * The visibility mode of the tab item label.\n *\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\n labelVisibilityMode?: NativeTabsTabBarItemLabelVisibilityMode;\n /**\n * The color of the ripple effect when the tab is pressed.\n *\n * @platform android\n */\n rippleColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform android\n * @platform web\n */\n indicatorColor?: ColorValue;\n /**\n * The color of the badge text.\n *\n * @platform android\n * @platform web\n */\n badgeTextColor?: ColorValue;\n // #endregion android props\n}\nexport interface NativeTabsViewProps extends NativeTabsProps {\n focusedIndex: number;\n builder: ReturnType<\n typeof useNavigationBuilder<\n TabNavigationState<ParamListBase>,\n TabRouterOptions,\n Record<string, (...args: any) => void>,\n NativeTabOptions,\n Record<string, any>\n >\n >;\n}\n\nexport const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES = [\n 'auto',\n 'selected',\n 'labeled',\n 'unlabeled',\n] as const;\n\n/**\n * @see [Material Components documentation](https://github.com/material-components/material-components-android/blob/master/docs/components/BottomNavigation.md#making-navigation-bar-accessible)\n *\n * @platform android\n */\nexport type NativeTabsTabBarItemLabelVisibilityMode =\n (typeof SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES)[number];\n\nexport const SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\n\n/**\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uitabbarcontroller/minimizebehavior)\n *\n * @platform iOS 26\n */\nexport type NativeTabsTabBarMinimizeBehavior =\n (typeof SUPPORTED_TAB_BAR_MINIMIZE_BEHAVIORS)[number];\n\nexport interface NativeTabTriggerProps {\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n *\n * > **Note**: Marking a tab as `hidden` means it cannot be navigated to in any way.\n */\n hidden?: boolean;\n /**\n * The options for the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components as children to customize the tab, rather then raw options.\n */\n options?: NativeTabOptions;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n *\n * @default false\n * @platform iOS\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform iOS\n */\n disableScrollToTop?: boolean;\n /**\n * The children of the trigger.\n *\n * Use `Icon`, `Label`, and `Badge` components to customize the tab.\n */\n children?: React.ReactNode;\n /**\n * System-provided tab bar item with predefined icon and title\n *\n * Uses Apple's built-in tab bar items (e.g., bookmarks, contacts, downloads) with\n * standard iOS styling and localized titles. Custom `icon` or `selectedIcon`\n * properties will override the system icon, but the system-defined title cannot\n * be customized.\n *\n * @see {@link https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem|UITabBarItem.SystemItem}\n * @platform ios\n */\n role?: NativeTabsTabBarItemRole;\n}\n\nconst SUPPORTED_TAB_BAR_ITEM_ROLES = [\n 'bookmarks',\n 'contacts',\n 'downloads',\n 'favorites',\n 'featured',\n 'history',\n 'more',\n 'mostRecent',\n 'mostViewed',\n 'recents',\n 'search',\n 'topRated',\n] as const;\n\nexport type NativeTabsTabBarItemRole = (typeof SUPPORTED_TAB_BAR_ITEM_ROLES)[number];\n\nexport interface NativeTabsTriggerTabBarProps {\n /**\n * The style of the every tab label in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n labelStyle?: NativeTabsLabelStyle;\n /**\n * The background color of the tab bar, when the tab is selected\n */\n backgroundColor?: ColorValue;\n /**\n * The color of every tab icon, when the tab is selected\n *\n * @platform iOS\n */\n iconColor?: ColorValue;\n /**\n * The background color of every badge in the tab bar.\n *\n * @platform iOS\n * @platform web\n */\n badgeBackgroundColor?: ColorValue;\n /**\n * The blur effect applied to the tab bar, when the tab is selected\n *\n * @platform iOS\n */\n blurEffect?: NativeTabsBlurEffect;\n /**\n * The color of the shadow when the tab is selected.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarappearance/shadowcolor)\n *\n * @platform iOS\n */\n shadowColor?: ColorValue;\n /**\n * When set to `true`, the tab bar will not become transparent when scrolled to the edge.\n *\n * @platform iOS\n */\n disableTransparentOnScrollEdge?: boolean;\n /**\n * The color of the badge text.\n *\n * @platform web\n */\n badgeTextColor?: ColorValue;\n /**\n * The color of the tab indicator.\n *\n * @platform web\n */\n indicatorColor?: ColorValue;\n}\n"]}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import type { JSXElementConstructor, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ColorValue } from 'react-native';
|
|
4
|
+
import type { ExtendedNativeTabOptions, NativeTabsLabelStyle, NativeTabsProps } from './types';
|
|
4
5
|
export declare function filterAllowedChildrenElements<Components extends JSXElementConstructor<any>[]>(children: ReactNode | ReactNode[], components: Components): React.ReactElement<React.ComponentProps<Components[number]>, Components[number]>[];
|
|
5
6
|
export declare function isChildOfType<T extends JSXElementConstructor<any>>(child: ReactNode, type: T): child is React.ReactElement<React.ComponentProps<T>, T>;
|
|
6
7
|
export declare function shouldTabBeVisible(options: ExtendedNativeTabOptions): boolean;
|
|
8
|
+
export declare function convertLabelStylePropToObject(labelStyle: NativeTabsProps['labelStyle']): {
|
|
9
|
+
default?: NativeTabsLabelStyle;
|
|
10
|
+
selected?: NativeTabsLabelStyle;
|
|
11
|
+
};
|
|
12
|
+
export declare function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {
|
|
13
|
+
default?: ColorValue;
|
|
14
|
+
selected?: ColorValue;
|
|
15
|
+
};
|
|
7
16
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/F,wBAAgB,6BAA6B,CAAC,UAAU,SAAS,qBAAqB,CAAC,GAAG,CAAC,EAAE,EAC3F,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,EACjC,UAAU,EAAE,UAAU,GACrB,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAOpF;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,qBAAqB,CAAC,GAAG,CAAC,EAChE,KAAK,EAAE,SAAS,EAChB,IAAI,EAAE,CAAC,GACN,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAEzD;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAI7E;AAED,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,eAAe,CAAC,YAAY,CAAC,GAAG;IACxF,OAAO,CAAC,EAAE,oBAAoB,CAAC;IAC/B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;CACjC,CAUA;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB,CAUA"}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.filterAllowedChildrenElements = filterAllowedChildrenElements;
|
|
7
7
|
exports.isChildOfType = isChildOfType;
|
|
8
8
|
exports.shouldTabBeVisible = shouldTabBeVisible;
|
|
9
|
+
exports.convertLabelStylePropToObject = convertLabelStylePropToObject;
|
|
10
|
+
exports.convertIconColorPropToObject = convertIconColorPropToObject;
|
|
9
11
|
const react_1 = __importDefault(require("react"));
|
|
10
12
|
function filterAllowedChildrenElements(children, components) {
|
|
11
13
|
return react_1.default.Children.toArray(children).filter((child) => react_1.default.isValidElement(child) && components.includes(child.type));
|
|
@@ -18,4 +20,26 @@ function shouldTabBeVisible(options) {
|
|
|
18
20
|
// If it is not defined, then it was not specified, and we should hide the tab.
|
|
19
21
|
return options.hidden === false;
|
|
20
22
|
}
|
|
23
|
+
function convertLabelStylePropToObject(labelStyle) {
|
|
24
|
+
if (labelStyle) {
|
|
25
|
+
if (typeof labelStyle === 'object' && ('default' in labelStyle || 'selected' in labelStyle)) {
|
|
26
|
+
return labelStyle;
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
default: labelStyle,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {};
|
|
33
|
+
}
|
|
34
|
+
function convertIconColorPropToObject(iconColor) {
|
|
35
|
+
if (iconColor) {
|
|
36
|
+
if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {
|
|
37
|
+
return iconColor;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
default: iconColor,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
21
45
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/utils.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/utils.ts"],"names":[],"mappings":";;;;;AAMA,sEAUC;AAED,sCAKC;AAED,gDAIC;AAED,sEAaC;AAED,oEAaC;AA1DD,kDAA0B;AAK1B,SAAgB,6BAA6B,CAC3C,QAAiC,EACjC,UAAsB;IAEtB,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,CAC5C,CACE,KAAK,EACsF,EAAE,CAC7F,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAiC,CAAC,CAC9F,CAAC;AACJ,CAAC;AAED,SAAgB,aAAa,CAC3B,KAAgB,EAChB,IAAO;IAEP,OAAO,eAAK,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;AAC5D,CAAC;AAED,SAAgB,kBAAkB,CAAC,OAAiC;IAClE,yEAAyE;IACzE,+EAA+E;IAC/E,OAAO,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC;AAClC,CAAC;AAED,SAAgB,6BAA6B,CAAC,UAAyC;IAIrF,IAAI,UAAU,EAAE,CAAC;QACf,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,SAAS,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC,EAAE,CAAC;YAC5F,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO;YACL,OAAO,EAAE,UAAkC;SAC5C,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAgB,4BAA4B,CAAC,SAAuC;IAIlF,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,IAAI,SAAS,IAAI,UAAU,IAAI,SAAS,CAAC,EAAE,CAAC;YACzF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO;YACL,OAAO,EAAE,SAAuB;SACjC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import type { JSXElementConstructor, ReactNode } from 'react';\nimport React from 'react';\nimport type { ColorValue } from 'react-native';\n\nimport type { ExtendedNativeTabOptions, NativeTabsLabelStyle, NativeTabsProps } from './types';\n\nexport function filterAllowedChildrenElements<Components extends JSXElementConstructor<any>[]>(\n children: ReactNode | ReactNode[],\n components: Components\n): React.ReactElement<React.ComponentProps<Components[number]>, Components[number]>[] {\n return React.Children.toArray(children).filter(\n (\n child\n ): child is React.ReactElement<React.ComponentProps<Components[number]>, Components[number]> =>\n React.isValidElement(child) && components.includes(child.type as (props: any) => ReactNode)\n );\n}\n\nexport function isChildOfType<T extends JSXElementConstructor<any>>(\n child: ReactNode,\n type: T\n): child is React.ReactElement<React.ComponentProps<T>, T> {\n return React.isValidElement(child) && child.type === type;\n}\n\nexport function shouldTabBeVisible(options: ExtendedNativeTabOptions): boolean {\n // The <NativeTab.Trigger> always sets `hidden` to defined boolean value.\n // If it is not defined, then it was not specified, and we should hide the tab.\n return options.hidden === false;\n}\n\nexport function convertLabelStylePropToObject(labelStyle: NativeTabsProps['labelStyle']): {\n default?: NativeTabsLabelStyle;\n selected?: NativeTabsLabelStyle;\n} {\n if (labelStyle) {\n if (typeof labelStyle === 'object' && ('default' in labelStyle || 'selected' in labelStyle)) {\n return labelStyle;\n }\n return {\n default: labelStyle as NativeTabsLabelStyle,\n };\n }\n return {};\n}\n\nexport function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {\n default?: ColorValue;\n selected?: ColorValue;\n} {\n if (iconColor) {\n if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {\n return iconColor;\n }\n return {\n default: iconColor as ColorValue,\n };\n }\n return {};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+C/B;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"renderRootComponent.d.ts","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+C/B;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,QAsCtE"}
|
|
@@ -78,18 +78,15 @@ function convertError(error) {
|
|
|
78
78
|
*/
|
|
79
79
|
function renderRootComponent(Component) {
|
|
80
80
|
try {
|
|
81
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
82
|
+
require('@expo/log-box/lib').setupLogBox();
|
|
83
|
+
}
|
|
81
84
|
// This must be delayed so the user has a chance to call it first.
|
|
82
85
|
setTimeout(() => {
|
|
83
86
|
SplashScreen._internal_preventAutoHideAsync?.();
|
|
84
87
|
});
|
|
85
88
|
React.startTransition(() => {
|
|
86
|
-
|
|
87
|
-
const { withErrorOverlay } = require('@expo/metro-runtime/error-overlay');
|
|
88
|
-
(0, expo_1.registerRootComponent)(withErrorOverlay(Component));
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
(0, expo_1.registerRootComponent)(Component);
|
|
92
|
-
}
|
|
89
|
+
(0, expo_1.registerRootComponent)(Component);
|
|
93
90
|
});
|
|
94
91
|
}
|
|
95
92
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderRootComponent.js","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,
|
|
1
|
+
{"version":3,"file":"renderRootComponent.js","sourceRoot":"","sources":["../src/renderRootComponent.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,kDAsCC;AA1FD,+BAA6C;AAC7C,6CAA+B;AAC/B,+CAAoC;AAEpC,6DAA+C;AAE/C,SAAS,YAAY,CAAC,GAAQ;IAC5B,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,EAAE,CAAC;QAC9D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,KAAK,MAAM,CAAC,SAAS,CAAC;AACpC,CAAC;AAED,SAAS,aAAa,CAAC,KAAU;IAC/B,OAAO,CACL,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;QAC9B,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAClC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAU;IAC9B,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;QAC3C,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,OAAO,IAAI,KAAK,CAAC,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AAC;QACd,CAAC,CAAC,CAAC;QAEH,+CAA+C;IACjD,CAAC;AACH,CAAC","sourcesContent":["import { registerRootComponent } from 'expo';\nimport * as React from 'react';\nimport { View } from 'react-native';\n\nimport * as SplashScreen from './utils/splash';\n\nfunction isBaseObject(obj: any) {\n if (Object.prototype.toString.call(obj) !== '[object Object]') {\n return false;\n }\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) {\n return true;\n }\n return proto === Object.prototype;\n}\n\nfunction isErrorShaped(error: any): error is Error {\n return (\n error &&\n typeof error === 'object' &&\n typeof error.name === 'string' &&\n typeof error.message === 'string'\n );\n}\n\n/**\n * After we throw this error, any number of tools could handle it.\n * This check ensures the error is always in a reason state before surfacing it to the runtime.\n */\nfunction convertError(error: any) {\n if (isErrorShaped(error)) {\n return error;\n }\n\n if (process.env.NODE_ENV === 'development') {\n if (error == null) {\n return new Error('A null/undefined error was thrown.');\n }\n }\n\n if (isBaseObject(error)) {\n return new Error(JSON.stringify(error));\n }\n\n return new Error(String(error));\n}\n\n/**\n * Register and mount the root component using the predefined rendering\n * method. This function ensures the Splash Screen and errors are handled correctly.\n */\nexport function renderRootComponent(Component: React.ComponentType<any>) {\n try {\n if (process.env.NODE_ENV !== 'production') {\n require('@expo/log-box/lib').setupLogBox();\n }\n\n // This must be delayed so the user has a chance to call it first.\n setTimeout(() => {\n SplashScreen._internal_preventAutoHideAsync?.();\n });\n\n React.startTransition(() => {\n registerRootComponent(Component);\n });\n } catch (e) {\n // Hide the splash screen if there was an error so the user can see it.\n SplashScreen.hideAsync();\n\n const error = convertError(e);\n // Prevent the app from throwing confusing:\n // ERROR Invariant Violation: \"main\" has not been registered. This can happen if:\n // * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.\n // * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.\n registerRootComponent(() => <View />);\n\n // Console is pretty useless on native, on web you get interactive stack traces.\n if (process.env.EXPO_OS === 'web') {\n console.error(error);\n console.error(`A runtime error has occurred while rendering the root component.`);\n }\n\n // Give React a tick to render before throwing.\n setTimeout(() => {\n throw error;\n });\n\n // TODO: Render a production-only error screen.\n }\n}\n"]}
|
package/build/static/html.d.ts
CHANGED
|
@@ -4,17 +4,9 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React
|
|
7
|
+
import React from 'react';
|
|
8
8
|
/**
|
|
9
9
|
* Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).
|
|
10
10
|
*/
|
|
11
11
|
export declare function ScrollViewStyleReset(): React.JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* Injects loader data into the HTML as a script tag for client-side hydration.
|
|
14
|
-
* The data is serialized as JSON and made available on the `globalThis.__EXPO_ROUTER_LOADER_DATA__` global.
|
|
15
|
-
*/
|
|
16
|
-
export declare function PreloadedDataScript({ data }: {
|
|
17
|
-
data: Record<string, unknown>;
|
|
18
|
-
}): React.JSX.Element;
|
|
19
|
-
export declare function Html({ children }: PropsWithChildren): React.JSX.Element;
|
|
20
12
|
//# sourceMappingURL=html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;GAEG;AACH,wBAAgB,oBAAoB,sBASnC"}
|
package/build/static/html.js
CHANGED
|
@@ -4,8 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ScrollViewStyleReset = ScrollViewStyleReset;
|
|
7
|
-
exports.PreloadedDataScript = PreloadedDataScript;
|
|
8
|
-
exports.Html = Html;
|
|
9
7
|
/**
|
|
10
8
|
* Copyright © 2023 650 Industries.
|
|
11
9
|
*
|
|
@@ -13,7 +11,6 @@ exports.Html = Html;
|
|
|
13
11
|
* LICENSE file in the root directory of this source tree.
|
|
14
12
|
*/
|
|
15
13
|
const react_1 = __importDefault(require("react"));
|
|
16
|
-
const html_1 = require("../utils/html");
|
|
17
14
|
/**
|
|
18
15
|
* Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).
|
|
19
16
|
*/
|
|
@@ -22,27 +19,4 @@ function ScrollViewStyleReset() {
|
|
|
22
19
|
__html: `#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}`,
|
|
23
20
|
}}/>);
|
|
24
21
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Injects loader data into the HTML as a script tag for client-side hydration.
|
|
27
|
-
* The data is serialized as JSON and made available on the `globalThis.__EXPO_ROUTER_LOADER_DATA__` global.
|
|
28
|
-
*/
|
|
29
|
-
function PreloadedDataScript({ data }) {
|
|
30
|
-
const safeJson = (0, html_1.escapeUnsafeCharacters)(JSON.stringify(data));
|
|
31
|
-
return (<script id="expo-router-data" type="module" dangerouslySetInnerHTML={{
|
|
32
|
-
// NOTE(@hassankhan): The double serialization used here isn't as much of a problem server-side, but allows faster
|
|
33
|
-
// client-side parsing using native `JSON.parse()`. See https://v8.dev/blog/cost-of-javascript-2019#json
|
|
34
|
-
__html: `globalThis.__EXPO_ROUTER_LOADER_DATA__ = JSON.parse(${JSON.stringify(safeJson)});`,
|
|
35
|
-
}}/>);
|
|
36
|
-
}
|
|
37
|
-
function Html({ children }) {
|
|
38
|
-
return (<html lang="en">
|
|
39
|
-
<head>
|
|
40
|
-
<meta charSet="utf-8"/>
|
|
41
|
-
<meta httpEquiv="X-UA-Compatible" content="IE=edge"/>
|
|
42
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
|
|
43
|
-
<ScrollViewStyleReset />
|
|
44
|
-
</head>
|
|
45
|
-
<body>{children}</body>
|
|
46
|
-
</html>);
|
|
47
|
-
}
|
|
48
22
|
//# sourceMappingURL=html.js.map
|
package/build/static/html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"html.js","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":";;;;;AAWA,oDASC;AApBD;;;;;GAKG;AACH,kDAA0B;AAE1B;;GAEG;AACH,SAAgB,oBAAoB;IAClC,OAAO,CACL,CAAC,KAAK,CACJ,EAAE,CAAC,YAAY,CACf,uBAAuB,CAAC,CAAC;YACvB,MAAM,EAAE,sEAAsE;SAC/E,CAAC,EACF,CACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport React from 'react';\n\n/**\n * Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).\n */\nexport function ScrollViewStyleReset() {\n return (\n <style\n id=\"expo-reset\"\n dangerouslySetInnerHTML={{\n __html: `#root,body,html{height:100%}body{overflow:hidden}#root{display:flex}`,\n }}\n />\n );\n}\n"]}
|
package/build/ui/TabRouter.d.ts
CHANGED
|
@@ -3,18 +3,17 @@ import { TriggerMap } from './common';
|
|
|
3
3
|
export type ExpoTabRouterOptions = RNTabRouterOptions & {
|
|
4
4
|
triggerMap: TriggerMap;
|
|
5
5
|
};
|
|
6
|
-
export type ExpoTabsResetValue = 'always' | 'onFocus' | 'never';
|
|
7
6
|
export type ExpoTabActionType = RNTabActionType | CommonNavigationAction | {
|
|
8
7
|
type: 'JUMP_TO';
|
|
9
8
|
source?: string;
|
|
10
9
|
target?: string;
|
|
11
10
|
payload: {
|
|
12
11
|
name: string;
|
|
13
|
-
|
|
12
|
+
resetOnFocus?: boolean;
|
|
14
13
|
params?: object;
|
|
15
14
|
};
|
|
16
15
|
};
|
|
17
|
-
export declare function ExpoTabRouter(
|
|
16
|
+
export declare function ExpoTabRouter(options: ExpoTabRouterOptions): Router<TabNavigationState<ParamListBase>, {
|
|
18
17
|
type: "GO_BACK";
|
|
19
18
|
source?: string;
|
|
20
19
|
target?: string;
|
|
@@ -97,7 +96,7 @@ export declare function ExpoTabRouter({ triggerMap, ...options }: ExpoTabRouterO
|
|
|
97
96
|
target?: string;
|
|
98
97
|
payload: {
|
|
99
98
|
name: string;
|
|
100
|
-
|
|
99
|
+
resetOnFocus?: boolean;
|
|
101
100
|
params?: object;
|
|
102
101
|
};
|
|
103
102
|
}>;
|
|
@@ -1 +1 @@
|
|
|
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,EACvC,MAAM,0BAA0B,CAAC;
|
|
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,EACvC,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,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,sBAAsB,GACtB;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;;;;;;;;cAZzD,CAAF;YAAsB,CAAC;aAEV,CAAC;WACD,CAAC;;;;;;;;cASsB,CAAC;aAAwB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAS/B,CAAC;;;;;;;cAI8B,CAAC;;;;;;;;cAKxD,CAAJ;;;;;UA5BU,SAAS;aACN,MAAM;aACN,MAAM;aACN;QACP,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;GAmDN"}
|
package/build/ui/TabRouter.js
CHANGED
|
@@ -1,42 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.ExpoTabRouter = ExpoTabRouter;
|
|
37
4
|
const native_1 = require("@react-navigation/native");
|
|
38
|
-
|
|
39
|
-
function ExpoTabRouter({ triggerMap, ...options }) {
|
|
5
|
+
function ExpoTabRouter(options) {
|
|
40
6
|
const rnTabRouter = (0, native_1.TabRouter)(options);
|
|
41
7
|
const router = {
|
|
42
8
|
...rnTabRouter,
|
|
@@ -44,49 +10,30 @@ function ExpoTabRouter({ triggerMap, ...options }) {
|
|
|
44
10
|
if (action.type !== 'JUMP_TO') {
|
|
45
11
|
return rnTabRouter.getStateForAction(state, action, options);
|
|
46
12
|
}
|
|
47
|
-
const
|
|
48
|
-
const trigger = triggerMap[name];
|
|
49
|
-
if (!trigger) {
|
|
50
|
-
// This is probably for a different navigator
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
else if (trigger.type === 'external') {
|
|
54
|
-
Linking.openURL(trigger.href);
|
|
55
|
-
return state;
|
|
56
|
-
}
|
|
57
|
-
const route = state.routes.find((route) => route.name === trigger.routeNode.route);
|
|
13
|
+
const route = state.routes.find((route) => route.name === action.payload.name);
|
|
58
14
|
if (!route) {
|
|
59
15
|
// This shouldn't occur, but lets just hand it off to the next navigator in case.
|
|
60
16
|
return null;
|
|
61
17
|
}
|
|
62
18
|
// We should reset if this is the first time visiting the route
|
|
63
19
|
let shouldReset = !state.history.some((item) => item.key === route?.key) && !route.state;
|
|
64
|
-
if (!shouldReset && '
|
|
65
|
-
|
|
66
|
-
case 'never': {
|
|
67
|
-
shouldReset = false;
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
case 'always': {
|
|
71
|
-
shouldReset = true;
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
case 'onFocus': {
|
|
75
|
-
shouldReset = state.routes[state.index].key === route.key;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
default: {
|
|
79
|
-
// TypeScript trick to ensure all use-cases are accounted for
|
|
80
|
-
action.payload.reset;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
20
|
+
if (!shouldReset && 'resetOnFocus' in action.payload && action.payload.resetOnFocus) {
|
|
21
|
+
shouldReset = state.routes[state.index].key !== route.key;
|
|
83
22
|
}
|
|
84
23
|
if (shouldReset) {
|
|
85
24
|
options.routeParamList[route.name] = {
|
|
86
25
|
...options.routeParamList[route.name],
|
|
87
|
-
...trigger.action.payload.params,
|
|
88
26
|
};
|
|
89
|
-
|
|
27
|
+
state = {
|
|
28
|
+
...state,
|
|
29
|
+
routes: state.routes.map((r) => {
|
|
30
|
+
if (r.key !== route.key) {
|
|
31
|
+
return r;
|
|
32
|
+
}
|
|
33
|
+
return { ...r, state: undefined };
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
return rnTabRouter.getStateForAction(state, action, options);
|
|
90
37
|
}
|
|
91
38
|
else {
|
|
92
39
|
return rnTabRouter.getStateForRouteFocus(state, route.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabRouter.js","sourceRoot":"","sources":["../../src/ui/TabRouter.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TabRouter.js","sourceRoot":"","sources":["../../src/ui/TabRouter.tsx"],"names":[],"mappings":";;AA8BA,sCAgDC;AA9ED,qDAQkC;AAsBlC,SAAgB,aAAa,CAAC,OAA6B;IACzD,MAAM,WAAW,GAAG,IAAA,kBAAW,EAAC,OAAO,CAAC,CAAC;IAEzC,MAAM,MAAM,GAGR;QACF,GAAG,WAAW;QACd,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO;YACtC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC9B,OAAO,WAAW,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC/D,CAAC;YAED,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YAE/E,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,iFAAiF;gBACjF,OAAO,IAAI,CAAC;YACd,CAAC;YAED,+DAA+D;YAC/D,IAAI,WAAW,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;YAEzF,IAAI,CAAC,WAAW,IAAI,cAAc,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;gBACpF,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAAC;YAC5D,CAAC;YAED,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG;oBACnC,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC;iBACtC,CAAC;gBACF,KAAK,GAAG;oBACN,GAAG,KAAK;oBACR,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;wBAC7B,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC;4BACxB,OAAO,CAAC,CAAC;wBACX,CAAC;wBACD,OAAO,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;oBACpC,CAAC,CAAC;iBACH,CAAC;gBACF,OAAO,WAAW,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,OAAO,WAAW,CAAC,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;KACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n CommonNavigationAction,\n ParamListBase,\n TabRouter as RNTabRouter,\n Router,\n TabActionType as RNTabActionType,\n TabNavigationState,\n TabRouterOptions as RNTabRouterOptions,\n} from '@react-navigation/native';\n\nimport { TriggerMap } from './common';\n\nexport type ExpoTabRouterOptions = RNTabRouterOptions & {\n triggerMap: TriggerMap;\n};\n\nexport type ExpoTabActionType =\n | RNTabActionType\n | CommonNavigationAction\n | {\n type: 'JUMP_TO';\n source?: string;\n target?: string;\n payload: {\n name: string;\n resetOnFocus?: boolean;\n params?: object;\n };\n };\n\nexport function ExpoTabRouter(options: ExpoTabRouterOptions) {\n const rnTabRouter = RNTabRouter(options);\n\n const router: Router<\n TabNavigationState<ParamListBase>,\n ExpoTabActionType | CommonNavigationAction\n > = {\n ...rnTabRouter,\n getStateForAction(state, action, options) {\n if (action.type !== 'JUMP_TO') {\n return rnTabRouter.getStateForAction(state, action, options);\n }\n\n const route = state.routes.find((route) => route.name === action.payload.name);\n\n if (!route) {\n // This shouldn't occur, but lets just hand it off to the next navigator in case.\n return null;\n }\n\n // We should reset if this is the first time visiting the route\n let shouldReset = !state.history.some((item) => item.key === route?.key) && !route.state;\n\n if (!shouldReset && 'resetOnFocus' in action.payload && action.payload.resetOnFocus) {\n shouldReset = state.routes[state.index].key !== route.key;\n }\n\n if (shouldReset) {\n options.routeParamList[route.name] = {\n ...options.routeParamList[route.name],\n };\n state = {\n ...state,\n routes: state.routes.map((r) => {\n if (r.key !== route.key) {\n return r;\n }\n return { ...r, state: undefined };\n }),\n };\n return rnTabRouter.getStateForAction(state, action, options);\n } else {\n return rnTabRouter.getStateForRouteFocus(state, route.key);\n }\n },\n };\n\n return router;\n}\n"]}
|
package/build/ui/TabTrigger.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { TabNavigationState } from '@react-navigation/native';
|
|
2
2
|
import { ReactNode, ReactElement, ComponentProps } from 'react';
|
|
3
3
|
import { View, PressableProps } from 'react-native';
|
|
4
|
-
import { ExpoTabsResetValue } from './TabRouter';
|
|
5
4
|
import type { TriggerMap } from './common';
|
|
6
5
|
import type { Href } from '../types';
|
|
7
6
|
type PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {
|
|
@@ -24,7 +23,7 @@ export type TabTriggerProps = PressablePropsWithoutFunctionChildren & {
|
|
|
24
23
|
/**
|
|
25
24
|
* Resets the route when switching to a tab.
|
|
26
25
|
*/
|
|
27
|
-
|
|
26
|
+
resetOnFocus?: boolean;
|
|
28
27
|
};
|
|
29
28
|
export type TabTriggerOptions = {
|
|
30
29
|
name: string;
|
|
@@ -51,7 +50,7 @@ export type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren & React.
|
|
|
51
50
|
* </Tabs>
|
|
52
51
|
* ```
|
|
53
52
|
*/
|
|
54
|
-
export declare function TabTrigger({ asChild, name, href,
|
|
53
|
+
export declare function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps): import("react").JSX.Element;
|
|
55
54
|
/**
|
|
56
55
|
* @hidden
|
|
57
56
|
*/
|
|
@@ -61,9 +60,9 @@ export declare function isTabTrigger(child: ReactElement<any>): child is ReactEl
|
|
|
61
60
|
*/
|
|
62
61
|
export type SwitchToOptions = {
|
|
63
62
|
/**
|
|
64
|
-
* Navigate and reset the history.
|
|
63
|
+
* Navigate and reset the history on route focus.
|
|
65
64
|
*/
|
|
66
|
-
|
|
65
|
+
resetOnFocus?: boolean;
|
|
67
66
|
};
|
|
68
67
|
export type Trigger = TriggerMap[string] & {
|
|
69
68
|
isFocused: boolean;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,EA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