@shellui/core 0.2.0-alpha.4 → 0.2.0-beta.1
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 +2 -2
- package/src/app.tsx +2 -2
- package/src/components/ContentView.tsx +70 -135
- package/src/components/LoadingOverlay.tsx +5 -1
- package/src/components/ui/sidebar.tsx +2 -124
- package/src/constants/loading.ts +2 -0
- package/src/features/config/types.ts +2 -0
- package/src/features/layouts/AppLayout.tsx +22 -19
- package/src/features/layouts/LayoutFallback.tsx +8 -0
- package/src/features/layouts/OverlayShell.tsx +23 -9
- package/src/features/layouts/{AppBarLayout.tsx → appbar/AppBarLayout.tsx} +72 -78
- package/src/features/layouts/{FullscreenLayout.tsx → fullscreen/FullscreenLayout.tsx} +5 -11
- package/src/features/layouts/sidebar/BottomNavItem.tsx +88 -0
- package/src/features/layouts/sidebar/MobileBottomNav.tsx +168 -0
- package/src/features/layouts/sidebar/NavigationContent.tsx +159 -0
- package/src/features/layouts/sidebar/SidebarIcons.tsx +93 -0
- package/src/features/layouts/sidebar/SidebarInner.tsx +48 -0
- package/src/features/layouts/sidebar/SidebarLayout.tsx +86 -0
- package/src/features/layouts/sidebar/sidebarUtils.ts +23 -0
- package/src/features/layouts/sidebar/types.ts +8 -0
- package/src/features/layouts/utils.ts +29 -1
- package/src/features/layouts/{WindowsLayout.tsx → windows/WindowsLayout.tsx} +199 -204
- package/src/features/settings/SettingsView.tsx +178 -181
- package/src/{components → routes/components}/HomeView.tsx +1 -1
- package/src/{components → routes/components}/IndexRoute.tsx +4 -4
- package/src/routes/components/NavigationItemRoute.tsx +19 -0
- package/src/{components → routes/components}/NotFoundView.tsx +9 -4
- package/src/{components → routes/components}/RouteErrorBoundary.tsx +1 -1
- package/src/routes/components/RouteFallback.tsx +8 -0
- package/src/routes/hooks/useNavigationItems.ts +84 -0
- package/src/{router → routes}/routes.tsx +18 -16
- package/src/components/ViewRoute.tsx +0 -48
- package/src/dist/CookiePreferencesView.52b5aec8.js +0 -1182
- package/src/dist/CookiePreferencesView.52b5aec8.js.map +0 -1
- package/src/dist/DefaultLayout.045a82ff.js +0 -1964
- package/src/dist/DefaultLayout.045a82ff.js.map +0 -1
- package/src/dist/DefaultLayout.4454f259.js +0 -4414
- package/src/dist/DefaultLayout.4454f259.js.map +0 -1
- package/src/dist/FullscreenLayout.555c4987.js +0 -1054
- package/src/dist/FullscreenLayout.555c4987.js.map +0 -1
- package/src/dist/HomeView.ddfa7b68.js +0 -771
- package/src/dist/HomeView.ddfa7b68.js.map +0 -1
- package/src/dist/NotFoundView.c75be4f1.js +0 -811
- package/src/dist/NotFoundView.c75be4f1.js.map +0 -1
- package/src/dist/SettingsView.052b03a6.js +0 -4965
- package/src/dist/SettingsView.052b03a6.js.map +0 -1
- package/src/dist/ViewRoute.e6e3b142.js +0 -1042
- package/src/dist/ViewRoute.e6e3b142.js.map +0 -1
- package/src/dist/WindowsLayout.08724167.js +0 -1762
- package/src/dist/WindowsLayout.08724167.js.map +0 -1
- package/src/dist/esm.f0d741e6.js +0 -29520
- package/src/dist/esm.f0d741e6.js.map +0 -1
- package/src/dist/favicon.4367ac1e.svg +0 -14
- package/src/dist/index.parcel.36d65383.js +0 -54089
- package/src/dist/index.parcel.36d65383.js.map +0 -1
- package/src/dist/index.parcel.ca6d8a47.css +0 -3493
- package/src/dist/index.parcel.ca6d8a47.css.map +0 -1
- package/src/dist/index.parcel.html +0 -88
- package/src/features/layouts/DefaultLayout.tsx +0 -660
- package/src/features/layouts/LayoutProviders.tsx +0 -20
- /package/src/{router → routes}/router.tsx +0 -0
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { Navigate, useLocation } from 'react-router';
|
|
3
|
-
import { getNavPathPrefix } from '../features/layouts/utils';
|
|
4
|
-
import { ContentView } from './ContentView';
|
|
5
|
-
import type { NavigationItem } from '../features/config/types';
|
|
6
|
-
|
|
7
|
-
interface ViewRouteProps {
|
|
8
|
-
navigation: NavigationItem[];
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export const ViewRoute = ({ navigation }: ViewRouteProps) => {
|
|
12
|
-
const location = useLocation();
|
|
13
|
-
const pathname = location.pathname;
|
|
14
|
-
|
|
15
|
-
const navItem = useMemo(() => {
|
|
16
|
-
return navigation.find((item) => {
|
|
17
|
-
const pathPrefix = getNavPathPrefix(item);
|
|
18
|
-
return pathname === pathPrefix || pathname.startsWith(`${pathPrefix}/`);
|
|
19
|
-
});
|
|
20
|
-
}, [navigation, pathname]);
|
|
21
|
-
|
|
22
|
-
if (!navItem) {
|
|
23
|
-
return (
|
|
24
|
-
<Navigate
|
|
25
|
-
to="/"
|
|
26
|
-
replace
|
|
27
|
-
/>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
// Calculate the relative path from the navItem.path
|
|
31
|
-
// e.g. if item.path is "docs" and pathname is "/docs/intro", subPath is "intro"
|
|
32
|
-
const pathPrefix = getNavPathPrefix(navItem);
|
|
33
|
-
const subPath = pathname.length > pathPrefix.length ? pathname.slice(pathPrefix.length + 1) : '';
|
|
34
|
-
|
|
35
|
-
// Construct the final URL for the iframe
|
|
36
|
-
let finalUrl = navItem.url;
|
|
37
|
-
if (subPath) {
|
|
38
|
-
const baseUrl = navItem.url.endsWith('/') ? navItem.url : `${navItem.url}/`;
|
|
39
|
-
finalUrl = `${baseUrl}${subPath}`;
|
|
40
|
-
}
|
|
41
|
-
return (
|
|
42
|
-
<ContentView
|
|
43
|
-
url={finalUrl}
|
|
44
|
-
pathPrefix={navItem.path}
|
|
45
|
-
navItem={navItem}
|
|
46
|
-
/>
|
|
47
|
-
);
|
|
48
|
-
};
|