@idealyst/navigation 1.2.71 → 1.2.73
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/navigation",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.73",
|
|
4
4
|
"description": "Cross-platform navigation library for React and React Native",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@idealyst/camera": "^1.2.30",
|
|
48
|
-
"@idealyst/components": "^1.2.
|
|
48
|
+
"@idealyst/components": "^1.2.73",
|
|
49
49
|
"@idealyst/microphone": "^1.2.30",
|
|
50
|
-
"@idealyst/theme": "^1.2.
|
|
50
|
+
"@idealyst/theme": "^1.2.73",
|
|
51
51
|
"@react-navigation/bottom-tabs": ">=7.0.0",
|
|
52
52
|
"@react-navigation/drawer": ">=7.0.0",
|
|
53
53
|
"@react-navigation/native": ">=7.0.0",
|
|
@@ -75,13 +75,13 @@
|
|
|
75
75
|
"@idealyst/audio-playback": "^1.2.46",
|
|
76
76
|
"@idealyst/blur": "^1.2.40",
|
|
77
77
|
"@idealyst/camera": "^1.2.30",
|
|
78
|
-
"@idealyst/components": "^1.2.
|
|
78
|
+
"@idealyst/components": "^1.2.73",
|
|
79
79
|
"@idealyst/datagrid": "^1.2.30",
|
|
80
80
|
"@idealyst/datepicker": "^1.2.30",
|
|
81
81
|
"@idealyst/lottie": "^1.2.38",
|
|
82
|
-
"@idealyst/markdown": "^1.2.
|
|
82
|
+
"@idealyst/markdown": "^1.2.73",
|
|
83
83
|
"@idealyst/microphone": "^1.2.30",
|
|
84
|
-
"@idealyst/theme": "^1.2.
|
|
84
|
+
"@idealyst/theme": "^1.2.73",
|
|
85
85
|
"@types/react": "^19.1.8",
|
|
86
86
|
"@types/react-dom": "^19.1.6",
|
|
87
87
|
"react": "^19.1.0",
|
|
@@ -204,7 +204,7 @@ const parseParameterizedPath = (path: string, rootRoute: any): { routeName: stri
|
|
|
204
204
|
return null;
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
const UnwrappedNavigatorProvider = ({ route }: NavigatorProviderProps) => {
|
|
207
|
+
const UnwrappedNavigatorProvider = ({ route, floatingComponent }: NavigatorProviderProps) => {
|
|
208
208
|
|
|
209
209
|
const navigation = useNavigation();
|
|
210
210
|
|
|
@@ -331,18 +331,19 @@ const UnwrappedNavigatorProvider = ({ route }: NavigatorProviderProps) => {
|
|
|
331
331
|
goBack,
|
|
332
332
|
}}>
|
|
333
333
|
<RouteComponent />
|
|
334
|
+
{floatingComponent}
|
|
334
335
|
</NavigatorContext.Provider>
|
|
335
336
|
)
|
|
336
337
|
};
|
|
337
338
|
|
|
338
|
-
const NavigatorProvider = ({ route }: NavigatorProviderProps) => {
|
|
339
|
+
const NavigatorProvider = ({ route, floatingComponent }: NavigatorProviderProps) => {
|
|
339
340
|
const {rt} = useUnistyles()
|
|
340
341
|
|
|
341
342
|
const isDarkMode = rt.themeName === 'dark';
|
|
342
343
|
|
|
343
344
|
return (
|
|
344
345
|
<NavigationContainer theme={isDarkMode ? DarkTheme : DefaultTheme}>
|
|
345
|
-
<UnwrappedNavigatorProvider route={route} />
|
|
346
|
+
<UnwrappedNavigatorProvider route={route} floatingComponent={floatingComponent} />
|
|
346
347
|
</NavigationContainer>
|
|
347
348
|
)
|
|
348
349
|
};
|
|
@@ -223,6 +223,7 @@ function getParentPath(path: string): string | null {
|
|
|
223
223
|
|
|
224
224
|
export const NavigatorProvider = ({
|
|
225
225
|
route,
|
|
226
|
+
floatingComponent,
|
|
226
227
|
}: NavigatorProviderProps) => {
|
|
227
228
|
const reactRouterNavigate = useNavigate();
|
|
228
229
|
const location = useLocation();
|
|
@@ -319,6 +320,7 @@ export const NavigatorProvider = ({
|
|
|
319
320
|
goBack,
|
|
320
321
|
}}>
|
|
321
322
|
<RouteComponent />
|
|
323
|
+
{floatingComponent}
|
|
322
324
|
</NavigatorContext.Provider>
|
|
323
325
|
);
|
|
324
326
|
};
|
package/src/context/types.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { NavigatorParam } from "../routing";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -25,6 +26,13 @@ export type NavigateParams = {
|
|
|
25
26
|
|
|
26
27
|
export type NavigatorProviderProps = {
|
|
27
28
|
route: NavigatorParam;
|
|
29
|
+
/**
|
|
30
|
+
* Optional component to render alongside the route hierarchy.
|
|
31
|
+
* This component has access to the NavigatorContext (useNavigator hook)
|
|
32
|
+
* but is not tied to any specific screen.
|
|
33
|
+
* Useful for global floating UI like FABs, toasts, or audio players.
|
|
34
|
+
*/
|
|
35
|
+
floatingComponent?: React.ReactNode;
|
|
28
36
|
_overrideNavigation?: any; // Used in the drawer navigator which has to provide its own navigation object
|
|
29
37
|
};
|
|
30
38
|
|