expo-router 6.1.0-canary-20251015-a6a1272 → 7.0.0-canary-20251031-b135dff
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/internal/routing.d.ts +7 -0
- package/build/internal/routing.d.ts.map +1 -0
- package/build/internal/routing.js +21 -0
- package/build/internal/routing.js.map +1 -0
- package/build/internal/rsc.d.ts +5 -0
- package/build/internal/rsc.d.ts.map +1 -0
- package/build/internal/rsc.js +18 -0
- package/build/internal/rsc.js.map +1 -0
- package/build/internal/static.d.ts +3 -0
- package/build/internal/static.d.ts.map +1 -0
- package/build/internal/static.js +8 -0
- package/build/internal/static.js.map +1 -0
- package/build/internal/testing.d.ts +3 -0
- package/build/internal/testing.d.ts.map +1 -0
- package/build/internal/testing.js +11 -0
- package/build/internal/testing.js.map +1 -0
- package/build/internal/utils.d.ts +2 -0
- package/build/internal/utils.d.ts.map +1 -0
- package/build/internal/utils.js +6 -0
- package/build/internal/utils.js.map +1 -0
- 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/IsWithinLayoutContext.d.ts +2 -0
- package/build/layouts/IsWithinLayoutContext.d.ts.map +1 -0
- package/build/layouts/IsWithinLayoutContext.js +7 -0
- package/build/layouts/IsWithinLayoutContext.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/layouts/withLayoutContext.d.ts.map +1 -1
- package/build/layouts/withLayoutContext.js +5 -2
- package/build/layouts/withLayoutContext.js.map +1 -1
- package/build/loaders/ServerDataLoaderContext.d.ts +2 -1
- package/build/loaders/ServerDataLoaderContext.d.ts.map +1 -1
- package/build/loaders/ServerDataLoaderContext.js.map +1 -1
- 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 → NativeBottomTabsNavigator.d.ts} +3 -3
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsNavigator.js → NativeBottomTabsNavigator.js} +49 -14
- package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -0
- package/build/native-tabs/NativeBottomTabsRouter.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsRouter.js → NativeBottomTabsRouter.js} +1 -1
- package/build/native-tabs/NativeBottomTabsRouter.js.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeTabTrigger.d.ts → NativeTabTrigger.d.ts} +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeTabTrigger.js → NativeTabTrigger.js} +9 -5
- package/build/native-tabs/NativeTabTrigger.js.map +1 -0
- package/build/native-tabs/NativeTabs.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeTabs.js → NativeTabs.js} +2 -0
- package/build/native-tabs/NativeTabs.js.map +1 -0
- package/build/native-tabs/NativeTabsTriggerTabBar.d.ts.map +1 -0
- package/build/native-tabs/NativeTabsTriggerTabBar.js.map +1 -0
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -0
- package/build/native-tabs/NativeTabsView.js +103 -0
- package/build/native-tabs/NativeTabsView.js.map +1 -0
- package/build/native-tabs/NativeTabsView.web.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/NativeTabsView.web.js → NativeTabsView.web.js} +18 -57
- package/build/native-tabs/NativeTabsView.web.js.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/appearance.d.ts → appearance.d.ts} +2 -2
- package/build/native-tabs/appearance.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/appearance.js → appearance.js} +18 -6
- package/build/native-tabs/appearance.js.map +1 -0
- package/build/native-tabs/common/elements.d.ts +1 -1
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/index.d.ts +4 -4
- package/build/native-tabs/index.d.ts.map +1 -1
- package/build/native-tabs/index.js +3 -3
- package/build/native-tabs/index.js.map +1 -1
- package/build/native-tabs/{NativeBottomTabs/types.d.ts → types.d.ts} +19 -6
- package/build/native-tabs/types.d.ts.map +1 -0
- package/build/native-tabs/types.js.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/utils.d.ts → utils/children.d.ts} +1 -3
- package/build/native-tabs/utils/children.d.ts.map +1 -0
- package/build/native-tabs/{NativeBottomTabs/utils.js → utils/children.js} +1 -7
- package/build/native-tabs/utils/children.js.map +1 -0
- package/build/native-tabs/utils/icon.d.ts +25 -0
- package/build/native-tabs/utils/icon.d.ts.map +1 -0
- package/build/native-tabs/utils/icon.js +68 -0
- package/build/native-tabs/utils/icon.js.map +1 -0
- package/build/native-tabs/utils/index.d.ts +4 -0
- package/build/native-tabs/utils/index.d.ts.map +1 -0
- package/build/native-tabs/utils/index.js +11 -0
- package/build/native-tabs/utils/index.js.map +1 -0
- package/build/native-tabs/utils/label.d.ts +6 -0
- package/build/native-tabs/utils/label.d.ts.map +1 -0
- package/build/native-tabs/utils/label.js +15 -0
- package/build/native-tabs/utils/label.js.map +1 -0
- package/build/renderRootComponent.d.ts.map +1 -1
- package/build/renderRootComponent.js +4 -7
- package/build/renderRootComponent.js.map +1 -1
- package/build/split-view/elements.d.ts +10 -0
- package/build/split-view/elements.d.ts.map +1 -0
- package/build/split-view/elements.js +15 -0
- package/build/split-view/elements.js.map +1 -0
- package/build/split-view/index.d.ts +2 -0
- package/build/split-view/index.d.ts.map +1 -0
- package/build/split-view/index.js +6 -0
- package/build/split-view/index.js.map +1 -0
- package/build/split-view/split-view.d.ts +13 -0
- package/build/split-view/split-view.d.ts.map +1 -0
- package/build/split-view/split-view.js +93 -0
- package/build/split-view/split-view.js.map +1 -0
- package/build/static/html.d.ts +5 -15
- package/build/static/html.d.ts.map +1 -1
- package/build/static/html.js +9 -25
- package/build/static/html.js.map +1 -1
- package/build/static/registerRootComponent.d.ts +11 -0
- package/build/static/registerRootComponent.d.ts.map +1 -0
- package/build/static/registerRootComponent.js +11 -0
- package/build/static/registerRootComponent.js.map +1 -0
- package/build/types.d.ts +4 -2
- package/build/types.d.ts.map +1 -1
- package/build/types.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/internal/routing.d.ts +1 -0
- package/internal/routing.js +1 -0
- package/internal/rsc.d.ts +1 -0
- package/internal/rsc.js +1 -0
- package/internal/static.d.ts +1 -0
- package/internal/static.js +1 -0
- package/internal/testing.d.ts +1 -0
- package/internal/testing.js +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/package.json +13 -11
- package/plugin/build/index.js +10 -0
- package/plugin/options.json +5 -0
- package/plugin/src/index.ts +17 -1
- package/rsc/headers.d.ts +1 -1
- package/rsc/headers.js +1 -1
- package/unstable-split-view.d.ts +1 -0
- package/unstable-split-view.js +1 -0
- package/build/getRoutesSSR.d.ts +0 -20
- package/build/getRoutesSSR.d.ts.map +0 -1
- package/build/getRoutesSSR.js +0 -97
- package/build/getRoutesSSR.js.map +0 -1
- 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/loadStaticParamsAsync.d.ts +0 -9
- package/build/loadStaticParamsAsync.d.ts.map +0 -1
- package/build/loadStaticParamsAsync.js +0 -163
- package/build/loadStaticParamsAsync.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabs.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +0 -187
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/appearance.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/appearance.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/types.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/types.js.map +0 -1
- package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +0 -1
- package/build/native-tabs/NativeBottomTabs/utils.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/rsc/middleware.d.ts +0 -8
- package/build/rsc/middleware.d.ts.map +0 -1
- package/build/rsc/middleware.js +0 -105
- package/build/rsc/middleware.js.map +0 -1
- package/build/rsc/path.d.ts +0 -34
- package/build/rsc/path.d.ts.map +0 -1
- package/build/rsc/path.js +0 -174
- package/build/rsc/path.js.map +0 -1
- package/build/rsc/router/create-expo-pages.d.ts +0 -20
- package/build/rsc/router/create-expo-pages.d.ts.map +0 -1
- package/build/rsc/router/create-expo-pages.js +0 -21
- package/build/rsc/router/create-expo-pages.js.map +0 -1
- package/build/rsc/router/create-pages.d.ts +0 -80
- package/build/rsc/router/create-pages.d.ts.map +0 -1
- package/build/rsc/router/create-pages.js +0 -232
- package/build/rsc/router/create-pages.js.map +0 -1
- package/build/rsc/router/defineRouter.d.ts +0 -30
- package/build/rsc/router/defineRouter.d.ts.map +0 -1
- package/build/rsc/router/defineRouter.js +0 -171
- package/build/rsc/router/defineRouter.js.map +0 -1
- package/build/rsc/router/expo-definedRouter.d.ts +0 -3
- package/build/rsc/router/expo-definedRouter.d.ts.map +0 -1
- package/build/rsc/router/expo-definedRouter.js +0 -112
- package/build/rsc/router/expo-definedRouter.js.map +0 -1
- package/build/rsc/router/noopRouter.d.ts +0 -3
- package/build/rsc/router/noopRouter.d.ts.map +0 -1
- package/build/rsc/router/noopRouter.js +0 -7
- package/build/rsc/router/noopRouter.js.map +0 -1
- package/build/rsc/rsc-renderer.d.ts +0 -44
- package/build/rsc/rsc-renderer.d.ts.map +0 -1
- package/build/rsc/rsc-renderer.js +0 -200
- package/build/rsc/rsc-renderer.js.map +0 -1
- package/build/rsc/server.d.ts +0 -65
- package/build/rsc/server.d.ts.map +0 -1
- package/build/rsc/server.js +0 -89
- package/build/rsc/server.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/typed-routes/generate.d.ts +0 -8
- package/build/typed-routes/generate.d.ts.map +0 -1
- package/build/typed-routes/generate.js +0 -186
- package/build/typed-routes/generate.js.map +0 -1
- package/build/typed-routes/index.d.ts +0 -35
- package/build/typed-routes/index.d.ts.map +0 -1
- package/build/typed-routes/index.js +0 -99
- package/build/typed-routes/index.js.map +0 -1
- package/build/typed-routes/testSetup.d.ts +0 -2
- package/build/typed-routes/testSetup.d.ts.map +0 -1
- package/build/typed-routes/testSetup.js +0 -42
- package/build/typed-routes/testSetup.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
- /package/build/native-tabs/{NativeBottomTabs/NativeBottomTabsRouter.d.ts → NativeBottomTabsRouter.d.ts} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/NativeTabs.d.ts → NativeTabs.d.ts} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/NativeTabsTriggerTabBar.d.ts → NativeTabsTriggerTabBar.d.ts} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/NativeTabsTriggerTabBar.js → NativeTabsTriggerTabBar.js} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/NativeTabsView.d.ts → NativeTabsView.d.ts} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/NativeTabsView.web.d.ts → NativeTabsView.web.d.ts} +0 -0
- /package/build/native-tabs/{NativeBottomTabs/types.js → types.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAclC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/native-tabs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAkC;AAclC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export * from './common/elements';\nexport type {\n NativeTabsProps,\n NativeTabTriggerProps,\n NativeTabsLabelStyle,\n NativeTabsActiveStyleType,\n NativeTabOptions,\n SymbolOrImageSource,\n NativeTabsTabBarItemLabelVisibilityMode,\n NativeTabsBlurEffect,\n NativeTabsTabBarMinimizeBehavior,\n NativeTabsTabBarItemRole,\n NativeTabsTriggerTabBarProps,\n} from './types';\nexport { NativeTabsTriggerTabBar } from './NativeTabsTriggerTabBar';\nexport { NativeTabTrigger } from './NativeTabTrigger';\nexport { NativeTabs } from './NativeTabs';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultRouterOptions
|
|
1
|
+
import type { DefaultRouterOptions } from '@react-navigation/native';
|
|
2
2
|
import type { PropsWithChildren } from 'react';
|
|
3
3
|
import type { ColorValue, ImageSourcePropType, TextStyle } from 'react-native';
|
|
4
4
|
import type { BottomTabsScreenProps } from 'react-native-screens';
|
|
@@ -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
|
*
|
|
@@ -226,7 +232,7 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
226
232
|
/**
|
|
227
233
|
* The background color of the tab bar.
|
|
228
234
|
*/
|
|
229
|
-
backgroundColor?: ColorValue
|
|
235
|
+
backgroundColor?: ColorValue;
|
|
230
236
|
/**
|
|
231
237
|
* The background color of every badge in the tab bar.
|
|
232
238
|
*/
|
|
@@ -322,9 +328,16 @@ export interface NativeTabsProps extends PropsWithChildren {
|
|
|
322
328
|
*/
|
|
323
329
|
badgeTextColor?: ColorValue;
|
|
324
330
|
}
|
|
325
|
-
export interface NativeTabsViewProps extends NativeTabsProps {
|
|
331
|
+
export interface NativeTabsViewProps extends Omit<NativeTabsProps, 'labelStyle' | 'iconColor' | 'backgroundColor' | 'badgeBackgroundColor' | 'blurEffect' | 'indicatorColor' | 'badgeTextColor'> {
|
|
326
332
|
focusedIndex: number;
|
|
327
|
-
|
|
333
|
+
tabs: NativeTabsViewTabItem[];
|
|
334
|
+
onTabChange: (tabKey: string) => void;
|
|
335
|
+
}
|
|
336
|
+
export interface NativeTabsViewTabItem {
|
|
337
|
+
options: ExtendedNativeTabOptions;
|
|
338
|
+
routeKey: string;
|
|
339
|
+
name: string;
|
|
340
|
+
contentRenderer: () => React.ReactNode;
|
|
328
341
|
}
|
|
329
342
|
export declare const SUPPORTED_TAB_BAR_ITEM_LABEL_VISIBILITY_MODES: readonly ["auto", "selected", "labeled", "unlabeled"];
|
|
330
343
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB;IAC5D;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;OAGG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,kBAAkB,CAAC,EAAE,oBAAoB,CAAC;IAC1C;;OAEG;IACH,UAAU,CAAC,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H,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB;;;;OAIG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B;;;;OAIG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/native-tabs/types.ts"],"names":[],"mappings":";;;AA4La,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;AAsLE,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 { DefaultRouterOptions } 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;\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\n extends Omit<\n NativeTabsProps,\n | 'labelStyle'\n | 'iconColor'\n | 'backgroundColor'\n | 'badgeBackgroundColor'\n | 'blurEffect'\n | 'indicatorColor'\n | 'badgeTextColor'\n > {\n focusedIndex: number;\n tabs: NativeTabsViewTabItem[];\n onTabChange: (tabKey: string) => void;\n}\n\nexport interface NativeTabsViewTabItem {\n options: ExtendedNativeTabOptions;\n routeKey: string;\n name: string;\n contentRenderer: () => React.ReactNode;\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,5 @@
|
|
|
1
1
|
import type { JSXElementConstructor, ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import type { ExtendedNativeTabOptions } from './types';
|
|
4
3
|
export declare function filterAllowedChildrenElements<Components extends JSXElementConstructor<any>[]>(children: ReactNode | ReactNode[], components: Components): React.ReactElement<React.ComponentProps<Components[number]>, Components[number]>[];
|
|
5
4
|
export declare function isChildOfType<T extends JSXElementConstructor<any>>(child: ReactNode, type: T): child is React.ReactElement<React.ComponentProps<T>, T>;
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
5
|
+
//# sourceMappingURL=children.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,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"}
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.filterAllowedChildrenElements = filterAllowedChildrenElements;
|
|
7
7
|
exports.isChildOfType = isChildOfType;
|
|
8
|
-
exports.shouldTabBeVisible = shouldTabBeVisible;
|
|
9
8
|
const react_1 = __importDefault(require("react"));
|
|
10
9
|
function filterAllowedChildrenElements(children, components) {
|
|
11
10
|
return react_1.default.Children.toArray(children).filter((child) => react_1.default.isValidElement(child) && components.includes(child.type));
|
|
@@ -13,9 +12,4 @@ function filterAllowedChildrenElements(children, components) {
|
|
|
13
12
|
function isChildOfType(child, type) {
|
|
14
13
|
return react_1.default.isValidElement(child) && child.type === type;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
|
-
// The <NativeTab.Trigger> always sets `hidden` to defined boolean value.
|
|
18
|
-
// If it is not defined, then it was not specified, and we should hide the tab.
|
|
19
|
-
return options.hidden === false;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=utils.js.map
|
|
15
|
+
//# sourceMappingURL=children.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"children.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/children.ts"],"names":[],"mappings":";;;;;AAGA,sEAUC;AAED,sCAKC;AAnBD,kDAA0B;AAE1B,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","sourcesContent":["import type { JSXElementConstructor, ReactNode } from 'react';\nimport React from 'react';\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"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ColorValue, ImageSourcePropType } from 'react-native';
|
|
2
|
+
import type { BottomTabsScreenProps } from 'react-native-screens';
|
|
3
|
+
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
4
|
+
import type { NativeTabOptions, NativeTabsProps } from '../types';
|
|
5
|
+
export declare function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {
|
|
6
|
+
default?: ColorValue;
|
|
7
|
+
selected?: ColorValue;
|
|
8
|
+
};
|
|
9
|
+
type AwaitedIcon = {
|
|
10
|
+
sf?: SFSymbol;
|
|
11
|
+
drawable?: string;
|
|
12
|
+
} | {
|
|
13
|
+
src?: ImageSourcePropType;
|
|
14
|
+
};
|
|
15
|
+
export declare function useAwaitedScreensIcon(icon: NativeTabOptions['icon']): {
|
|
16
|
+
sf?: SFSymbol;
|
|
17
|
+
drawable?: string;
|
|
18
|
+
} | {
|
|
19
|
+
src?: ImageSourcePropType;
|
|
20
|
+
} | undefined;
|
|
21
|
+
export declare function convertOptionsIconToRNScreensPropsIcon(icon: AwaitedIcon | undefined): BottomTabsScreenProps['icon'];
|
|
22
|
+
export declare function getRNScreensAndroidIconResourceFromAwaitedIcon(icon: AwaitedIcon | undefined): BottomTabsScreenProps['iconResource'];
|
|
23
|
+
export declare function getRNScreensAndroidIconResourceNameFromAwaitedIcon(icon: AwaitedIcon | undefined): BottomTabsScreenProps['iconResourceName'];
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAElE,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB,CAUA;AAED,KAAK,WAAW,GACZ;IACE,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACD;IACE,GAAG,CAAC,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEN,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;UAHxD,mBAAmB;cAyB9B;AAMD,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,qBAAqB,CAAC,MAAM,CAAC,CAU/B;AAED,wBAAgB,8CAA8C,CAC5D,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,qBAAqB,CAAC,cAAc,CAAC,CAKvC;AAED,wBAAgB,kDAAkD,CAChE,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,qBAAqB,CAAC,kBAAkB,CAAC,CAK3C"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertIconColorPropToObject = convertIconColorPropToObject;
|
|
4
|
+
exports.useAwaitedScreensIcon = useAwaitedScreensIcon;
|
|
5
|
+
exports.convertOptionsIconToRNScreensPropsIcon = convertOptionsIconToRNScreensPropsIcon;
|
|
6
|
+
exports.getRNScreensAndroidIconResourceFromAwaitedIcon = getRNScreensAndroidIconResourceFromAwaitedIcon;
|
|
7
|
+
exports.getRNScreensAndroidIconResourceNameFromAwaitedIcon = getRNScreensAndroidIconResourceNameFromAwaitedIcon;
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
function convertIconColorPropToObject(iconColor) {
|
|
10
|
+
if (iconColor) {
|
|
11
|
+
if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {
|
|
12
|
+
return iconColor;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
default: iconColor,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
function useAwaitedScreensIcon(icon) {
|
|
21
|
+
const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;
|
|
22
|
+
const [awaitedIcon, setAwaitedIcon] = (0, react_1.useState)(undefined);
|
|
23
|
+
(0, react_1.useEffect)(() => {
|
|
24
|
+
const loadIcon = async () => {
|
|
25
|
+
if (src && src instanceof Promise) {
|
|
26
|
+
const awaitedSrc = await src;
|
|
27
|
+
if (awaitedSrc) {
|
|
28
|
+
const currentAwaitedIcon = { src: awaitedSrc };
|
|
29
|
+
setAwaitedIcon(currentAwaitedIcon);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
loadIcon();
|
|
34
|
+
// Checking `src` rather then icon here, to avoid unnecessary re-renders
|
|
35
|
+
// The icon object can be recreated, while src should stay the same
|
|
36
|
+
// In this case as we control `VectorIcon`, it will only change if `family` or `name` props change
|
|
37
|
+
// So we should be safe with promise resolving
|
|
38
|
+
}, [src]);
|
|
39
|
+
return (0, react_1.useMemo)(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);
|
|
40
|
+
}
|
|
41
|
+
function isAwaitedIcon(icon) {
|
|
42
|
+
return !icon || !('src' in icon && icon.src instanceof Promise);
|
|
43
|
+
}
|
|
44
|
+
function convertOptionsIconToRNScreensPropsIcon(icon) {
|
|
45
|
+
if (!icon) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
if ('sf' in icon && icon.sf) {
|
|
49
|
+
return { sfSymbolName: icon.sf };
|
|
50
|
+
}
|
|
51
|
+
else if ('src' in icon && icon.src) {
|
|
52
|
+
return { templateSource: icon.src };
|
|
53
|
+
}
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
function getRNScreensAndroidIconResourceFromAwaitedIcon(icon) {
|
|
57
|
+
if (icon && 'src' in icon && icon.src) {
|
|
58
|
+
return icon.src;
|
|
59
|
+
}
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
function getRNScreensAndroidIconResourceNameFromAwaitedIcon(icon) {
|
|
63
|
+
if (icon && 'drawable' in icon && icon.drawable) {
|
|
64
|
+
return icon.drawable;
|
|
65
|
+
}
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":";;AAOA,oEAaC;AAWD,sDAsBC;AAMD,wFAYC;AAED,wGAOC;AAED,gHAOC;AAzFD,iCAAqD;AAOrD,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;AAWD,SAAgB,qBAA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AAC,EAAE,EAAE,CAAC;QAC5B,OAAO,EAAE,YAAY,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC;IACnC,CAAC;SAAM,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACrC,OAAO,EAAE,cAAc,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;IACtC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,8CAA8C,CAC5D,IAA6B;IAE7B,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAgB,kDAAkD,CAChE,IAA6B;IAE7B,IAAI,IAAI,IAAI,UAAU,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type { BottomTabsScreenProps } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { NativeTabOptions, NativeTabsProps } from '../types';\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\ntype AwaitedIcon =\n | {\n sf?: SFSymbol;\n drawable?: string;\n }\n | {\n src?: ImageSourcePropType;\n };\n\nexport function useAwaitedScreensIcon(icon: NativeTabOptions['icon']) {\n const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;\n const [awaitedIcon, setAwaitedIcon] = useState<AwaitedIcon | undefined>(undefined);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (src && src instanceof Promise) {\n const awaitedSrc = await src;\n if (awaitedSrc) {\n const currentAwaitedIcon = { src: awaitedSrc };\n setAwaitedIcon(currentAwaitedIcon);\n }\n }\n };\n loadIcon();\n // Checking `src` rather then icon here, to avoid unnecessary re-renders\n // The icon object can be recreated, while src should stay the same\n // In this case as we control `VectorIcon`, it will only change if `family` or `name` props change\n // So we should be safe with promise resolving\n }, [src]);\n\n return useMemo(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);\n}\n\nfunction isAwaitedIcon(icon: NativeTabOptions['icon']): icon is AwaitedIcon {\n return !icon || !('src' in icon && icon.src instanceof Promise);\n}\n\nexport function convertOptionsIconToRNScreensPropsIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['icon'] {\n if (!icon) {\n return undefined;\n }\n if ('sf' in icon && icon.sf) {\n return { sfSymbolName: icon.sf };\n } else if ('src' in icon && icon.src) {\n return { templateSource: icon.src };\n }\n return undefined;\n}\n\nexport function getRNScreensAndroidIconResourceFromAwaitedIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResource'] {\n if (icon && 'src' in icon && icon.src) {\n return icon.src;\n }\n return undefined;\n}\n\nexport function getRNScreensAndroidIconResourceNameFromAwaitedIcon(\n icon: AwaitedIcon | undefined\n): BottomTabsScreenProps['iconResourceName'] {\n if (icon && 'drawable' in icon && icon.drawable) {\n return icon.drawable;\n }\n return undefined;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertIconColorPropToObject = exports.isChildOfType = exports.filterAllowedChildrenElements = exports.convertLabelStylePropToObject = void 0;
|
|
4
|
+
var label_1 = require("./label");
|
|
5
|
+
Object.defineProperty(exports, "convertLabelStylePropToObject", { enumerable: true, get: function () { return label_1.convertLabelStylePropToObject; } });
|
|
6
|
+
var children_1 = require("./children");
|
|
7
|
+
Object.defineProperty(exports, "filterAllowedChildrenElements", { enumerable: true, get: function () { return children_1.filterAllowedChildrenElements; } });
|
|
8
|
+
Object.defineProperty(exports, "isChildOfType", { enumerable: true, get: function () { return children_1.isChildOfType; } });
|
|
9
|
+
var icon_1 = require("./icon");
|
|
10
|
+
Object.defineProperty(exports, "convertIconColorPropToObject", { enumerable: true, get: function () { return icon_1.convertIconColorPropToObject; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/index.ts"],"names":[],"mappings":";;;AAAA,iCAAwD;AAA/C,sHAAA,6BAA6B,OAAA;AACtC,uCAA0E;AAAjE,yHAAA,6BAA6B,OAAA;AAAE,yGAAA,aAAa,OAAA;AACrD,+BAAsD;AAA7C,oHAAA,4BAA4B,OAAA","sourcesContent":["export { convertLabelStylePropToObject } from './label';\nexport { filterAllowedChildrenElements, isChildOfType } from './children';\nexport { convertIconColorPropToObject } from './icon';\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NativeTabsLabelStyle, NativeTabsProps } from '../types';
|
|
2
|
+
export declare function convertLabelStylePropToObject(labelStyle: NativeTabsProps['labelStyle']): {
|
|
3
|
+
default?: NativeTabsLabelStyle;
|
|
4
|
+
selected?: NativeTabsLabelStyle;
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=label.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEtE,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertLabelStylePropToObject = convertLabelStylePropToObject;
|
|
4
|
+
function convertLabelStylePropToObject(labelStyle) {
|
|
5
|
+
if (labelStyle) {
|
|
6
|
+
if (typeof labelStyle === 'object' && ('default' in labelStyle || 'selected' in labelStyle)) {
|
|
7
|
+
return labelStyle;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
default: labelStyle,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/label.ts"],"names":[],"mappings":";;AAEA,sEAaC;AAbD,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","sourcesContent":["import type { NativeTabsLabelStyle, NativeTabsProps } from '../types';\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"]}
|
|
@@ -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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AA+C;QAC/C,UAAU,CAAC,GAAG,EAAE;YACd,MAAM,KAAK,CAAC;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"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface SplitViewColumnProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
export declare function SplitViewColumn(props: SplitViewColumnProps): import("react").JSX.Element;
|
|
5
|
+
interface SplitViewColumnProps {
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function SplitViewInspector(props: SplitViewColumnProps): import("react").JSX.Element;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":"AAGA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,+BAM1D;AAED,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,+BAE7D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SplitViewColumn = SplitViewColumn;
|
|
4
|
+
exports.SplitViewInspector = SplitViewInspector;
|
|
5
|
+
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
|
+
const react_native_screens_1 = require("react-native-screens");
|
|
7
|
+
function SplitViewColumn(props) {
|
|
8
|
+
return (<react_native_screens_1.SplitViewScreen.Column>
|
|
9
|
+
<react_native_safe_area_context_1.SafeAreaProvider>{props.children}</react_native_safe_area_context_1.SafeAreaProvider>
|
|
10
|
+
</react_native_screens_1.SplitViewScreen.Column>);
|
|
11
|
+
}
|
|
12
|
+
function SplitViewInspector(props) {
|
|
13
|
+
return <react_native_screens_1.SplitViewScreen.Inspector>{props.children}</react_native_screens_1.SplitViewScreen.Inspector>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":";;AAOA,0CAMC;AAMD,gDAEC;AArBD,mFAAkE;AAClE,+DAAuD;AAMvD,SAAgB,eAAe,CAAC,KAA2B;IACzD,OAAO,CACL,CAAC,sCAAe,CAAC,MAAM,CACrB;MAAA,CAAC,iDAAgB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,iDAAgB,CACtD;IAAA,EAAE,sCAAe,CAAC,MAAM,CAAC,CAC1B,CAAC;AACJ,CAAC;AAMD,SAAgB,kBAAkB,CAAC,KAA2B;IAC5D,OAAO,CAAC,sCAAe,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,sCAAe,CAAC,SAAS,CAAC,CAAC;AACjF,CAAC","sourcesContent":["import { SafeAreaProvider } from 'react-native-safe-area-context';\nimport { SplitViewScreen } from 'react-native-screens';\n\ninterface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewColumn(props: SplitViewColumnProps) {\n return (\n <SplitViewScreen.Column>\n <SafeAreaProvider>{props.children}</SafeAreaProvider>\n </SplitViewScreen.Column>\n );\n}\n\ninterface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewInspector(props: SplitViewColumnProps) {\n return <SplitViewScreen.Inspector>{props.children}</SplitViewScreen.Inspector>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-view/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SplitView = void 0;
|
|
4
|
+
var split_view_1 = require("./split-view");
|
|
5
|
+
Object.defineProperty(exports, "SplitView", { enumerable: true, get: function () { return split_view_1.SplitView; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-view/index.tsx"],"names":[],"mappings":";;;AAAA,2CAAyD;AAAhD,uGAAA,SAAS,OAAA","sourcesContent":["export { SplitView, SplitViewProps } from './split-view';\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type SplitViewHostProps } from 'react-native-screens';
|
|
3
|
+
import { SplitViewColumn, SplitViewInspector } from './elements';
|
|
4
|
+
export interface SplitViewProps extends Omit<SplitViewHostProps, 'children'> {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps): React.JSX.Element;
|
|
8
|
+
export declare const SplitView: typeof SplitViewNavigator & {
|
|
9
|
+
Column: typeof SplitViewColumn;
|
|
10
|
+
Inspector: typeof SplitViewInspector;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=split-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-view.d.ts","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAAkC,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/F,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMjE,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAC1E,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,EAAE,cAAc,qBAgE9E;AAED,eAAO,MAAM,SAAS;;;CAGpB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.SplitView = void 0;
|
|
40
|
+
const expo_constants_1 = __importDefault(require("expo-constants"));
|
|
41
|
+
const react_1 = __importStar(require("react"));
|
|
42
|
+
const react_native_screens_1 = require("react-native-screens");
|
|
43
|
+
const elements_1 = require("./elements");
|
|
44
|
+
const IsWithinLayoutContext_1 = require("../layouts/IsWithinLayoutContext");
|
|
45
|
+
const Navigator_1 = require("../views/Navigator");
|
|
46
|
+
const IsWithinSplitViewContext = (0, react_1.createContext)(false);
|
|
47
|
+
function SplitViewNavigator({ children, ...splitViewHostProps }) {
|
|
48
|
+
if ((0, react_1.use)(IsWithinSplitViewContext)) {
|
|
49
|
+
throw new Error('There can only be one SplitView in the navigation hierarchy.');
|
|
50
|
+
}
|
|
51
|
+
// TODO: Add better way of detecting if SplitView is rendered inside Native navigator.
|
|
52
|
+
if ((0, react_1.use)(IsWithinLayoutContext_1.IsWithinLayoutContext)) {
|
|
53
|
+
throw new Error('SplitView cannot be used inside another navigator, except for Slot.');
|
|
54
|
+
}
|
|
55
|
+
if (!expo_constants_1.default.expoConfig?.extra?.router?.unstable_splitView) {
|
|
56
|
+
throw new Error('SplitView is not enabled. Make sure to enable it in your expo-router configuration with "unstable_splitView": true. After enabling, make sure to prebuild your app.');
|
|
57
|
+
}
|
|
58
|
+
if (process.env.EXPO_OS !== 'ios') {
|
|
59
|
+
console.warn('SplitView is only supported on iOS. The SplitView will behave like a Slot navigator on other platforms.');
|
|
60
|
+
return <Navigator_1.Slot />;
|
|
61
|
+
}
|
|
62
|
+
const WrappedSlot = () => (<IsWithinLayoutContext_1.IsWithinLayoutContext value>
|
|
63
|
+
<Navigator_1.Slot />
|
|
64
|
+
</IsWithinLayoutContext_1.IsWithinLayoutContext>);
|
|
65
|
+
const allChildrenArray = react_1.default.Children.toArray(children);
|
|
66
|
+
const columnChildren = allChildrenArray.filter((child) => (0, react_1.isValidElement)(child) && child.type === elements_1.SplitViewColumn);
|
|
67
|
+
const inspectorChildren = allChildrenArray.filter((child) => (0, react_1.isValidElement)(child) && child.type === elements_1.SplitViewInspector);
|
|
68
|
+
const numberOfSidebars = columnChildren.length;
|
|
69
|
+
const numberOfInspectors = inspectorChildren.length;
|
|
70
|
+
if (allChildrenArray.length !== columnChildren.length + inspectorChildren.length) {
|
|
71
|
+
console.warn('Only SplitView.Column and SplitView.Inspector components are allowed as direct children of SplitView.');
|
|
72
|
+
}
|
|
73
|
+
if (numberOfSidebars > 2) {
|
|
74
|
+
throw new Error('There can only be two SplitView.Column in the SplitView.');
|
|
75
|
+
}
|
|
76
|
+
if (numberOfSidebars + numberOfInspectors === 0) {
|
|
77
|
+
console.warn('No SplitView.Column and SplitView.Inspector found in SplitView.');
|
|
78
|
+
return <Navigator_1.Slot />;
|
|
79
|
+
}
|
|
80
|
+
// The key is needed, because number of columns cannot be changed dynamically
|
|
81
|
+
return (<react_native_screens_1.SplitViewHost key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>
|
|
82
|
+
{columnChildren}
|
|
83
|
+
<react_native_screens_1.SplitViewScreen.Column>
|
|
84
|
+
<WrappedSlot />
|
|
85
|
+
</react_native_screens_1.SplitViewScreen.Column>
|
|
86
|
+
{inspectorChildren}
|
|
87
|
+
</react_native_screens_1.SplitViewHost>);
|
|
88
|
+
}
|
|
89
|
+
exports.SplitView = Object.assign(SplitViewNavigator, {
|
|
90
|
+
Column: elements_1.SplitViewColumn,
|
|
91
|
+
Inspector: elements_1.SplitViewInspector,
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=split-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-view.js","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAuC;AACvC,+CAAkF;AAClF,+DAA+F;AAE/F,yCAAiE;AACjE,4EAAyE;AACzE,kDAA0C;AAE1C,MAAM,wBAAwB,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;AAMtD,SAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAkB;IAC7E,IAAI,IAAA,WAAG,EAAC,wBAAwB,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,sFAAsF;IACtF,IAAI,IAAA,WAAG,EAAC,6CAAqB,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;IACzF,CAAC;IAED,IAAI,CAAC,wBAAS,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QAC7D,MAAM,IAAI,KAAK,CACb,qKAAqK,CACtK,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CACV,yGAAyG,CAC1G,CAAC;QACF,OAAO,CAAC,gBAAI,CAAC,AAAD,EAAG,CAAC;IAClB,CAAC;IAED,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,CACxB,CAAC,6CAAqB,CAAC,KAAK,CAC1B;MAAA,CAAC,gBAAI,CAAC,AAAD,EACP;IAAA,EAAE,6CAAqB,CAAC,CACzB,CAAC;IAEF,MAAM,gBAAgB,GAAG,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;I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,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACzD,MAAM,EAAE,0BAAe;IACvB,SAAS,EAAE,6BAAkB;CAC9B,CAAC,CAAC","sourcesContent":["import Constants from 'expo-constants';\nimport React, { createContext, isValidElement, use, type ReactNode } from 'react';\nimport { SplitViewHost, SplitViewScreen, type SplitViewHostProps } from 'react-native-screens';\n\nimport { SplitViewColumn, SplitViewInspector } from './elements';\nimport { IsWithinLayoutContext } from '../layouts/IsWithinLayoutContext';\nimport { Slot } from '../views/Navigator';\n\nconst IsWithinSplitViewContext = createContext(false);\n\nexport interface SplitViewProps extends Omit<SplitViewHostProps, 'children'> {\n children?: ReactNode;\n}\n\nfunction SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps) {\n if (use(IsWithinSplitViewContext)) {\n throw new Error('There can only be one SplitView in the navigation hierarchy.');\n }\n\n // TODO: Add better way of detecting if SplitView is rendered inside Native navigator.\n if (use(IsWithinLayoutContext)) {\n throw new Error('SplitView cannot be used inside another navigator, except for Slot.');\n }\n\n if (!Constants.expoConfig?.extra?.router?.unstable_splitView) {\n throw new Error(\n 'SplitView is not enabled. Make sure to enable it in your expo-router configuration with \"unstable_splitView\": true. After enabling, make sure to prebuild your app.'\n );\n }\n\n if (process.env.EXPO_OS !== 'ios') {\n console.warn(\n 'SplitView is only supported on iOS. The SplitView will behave like a Slot navigator on other platforms.'\n );\n return <Slot />;\n }\n\n const WrappedSlot = () => (\n <IsWithinLayoutContext value>\n <Slot />\n </IsWithinLayoutContext>\n );\n\n const allChildrenArray = React.Children.toArray(children);\n const columnChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewColumn\n );\n const inspectorChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewInspector\n );\n const numberOfSidebars = columnChildren.length;\n const numberOfInspectors = inspectorChildren.length;\n\n if (allChildrenArray.length !== columnChildren.length + inspectorChildren.length) {\n console.warn(\n 'Only SplitView.Column and SplitView.Inspector components are allowed as direct children of SplitView.'\n );\n }\n\n if (numberOfSidebars > 2) {\n throw new Error('There can only be two SplitView.Column in the SplitView.');\n }\n\n if (numberOfSidebars + numberOfInspectors === 0) {\n console.warn('No SplitView.Column and SplitView.Inspector found in SplitView.');\n return <Slot />;\n }\n\n // The key is needed, because number of columns cannot be changed dynamically\n return (\n <SplitViewHost key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>\n {columnChildren}\n <SplitViewScreen.Column>\n <WrappedSlot />\n </SplitViewScreen.Column>\n {inspectorChildren}\n </SplitViewHost>\n );\n}\n\nexport const SplitView = Object.assign(SplitViewNavigator, {\n Column: SplitViewColumn,\n Inspector: SplitViewInspector,\n});\n"]}
|
package/build/static/html.d.ts
CHANGED
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import React, { type PropsWithChildren } from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { ServerDataLoaderData } from '../loaders/ServerDataLoaderContext';
|
|
8
3
|
/**
|
|
9
4
|
* 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
5
|
*/
|
|
11
6
|
export declare function ScrollViewStyleReset(): React.JSX.Element;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
7
|
+
export declare function InnerRoot({ children, loadedData, }: PropsWithChildren<{
|
|
8
|
+
loadedData: ServerDataLoaderData;
|
|
9
|
+
}>): React.JSX.Element;
|
|
20
10
|
//# sourceMappingURL=html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/static/html.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAA2B,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAEnG;;GAEG;AACH,wBAAgB,oBAAoB,sBASnC;AAED,wBAAgB,SAAS,CAAC,EACxB,QAAQ,EACR,UAAU,GACX,EAAE,iBAAiB,CAAC;IAAE,UAAU,EAAE,oBAAoB,CAAA;CAAE,CAAC,qBASzD"}
|