@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.
Files changed (61) hide show
  1. package/package.json +2 -2
  2. package/src/app.tsx +2 -2
  3. package/src/components/ContentView.tsx +70 -135
  4. package/src/components/LoadingOverlay.tsx +5 -1
  5. package/src/components/ui/sidebar.tsx +2 -124
  6. package/src/constants/loading.ts +2 -0
  7. package/src/features/config/types.ts +2 -0
  8. package/src/features/layouts/AppLayout.tsx +22 -19
  9. package/src/features/layouts/LayoutFallback.tsx +8 -0
  10. package/src/features/layouts/OverlayShell.tsx +23 -9
  11. package/src/features/layouts/{AppBarLayout.tsx → appbar/AppBarLayout.tsx} +72 -78
  12. package/src/features/layouts/{FullscreenLayout.tsx → fullscreen/FullscreenLayout.tsx} +5 -11
  13. package/src/features/layouts/sidebar/BottomNavItem.tsx +88 -0
  14. package/src/features/layouts/sidebar/MobileBottomNav.tsx +168 -0
  15. package/src/features/layouts/sidebar/NavigationContent.tsx +159 -0
  16. package/src/features/layouts/sidebar/SidebarIcons.tsx +93 -0
  17. package/src/features/layouts/sidebar/SidebarInner.tsx +48 -0
  18. package/src/features/layouts/sidebar/SidebarLayout.tsx +86 -0
  19. package/src/features/layouts/sidebar/sidebarUtils.ts +23 -0
  20. package/src/features/layouts/sidebar/types.ts +8 -0
  21. package/src/features/layouts/utils.ts +29 -1
  22. package/src/features/layouts/{WindowsLayout.tsx → windows/WindowsLayout.tsx} +199 -204
  23. package/src/features/settings/SettingsView.tsx +178 -181
  24. package/src/{components → routes/components}/HomeView.tsx +1 -1
  25. package/src/{components → routes/components}/IndexRoute.tsx +4 -4
  26. package/src/routes/components/NavigationItemRoute.tsx +19 -0
  27. package/src/{components → routes/components}/NotFoundView.tsx +9 -4
  28. package/src/{components → routes/components}/RouteErrorBoundary.tsx +1 -1
  29. package/src/routes/components/RouteFallback.tsx +8 -0
  30. package/src/routes/hooks/useNavigationItems.ts +84 -0
  31. package/src/{router → routes}/routes.tsx +18 -16
  32. package/src/components/ViewRoute.tsx +0 -48
  33. package/src/dist/CookiePreferencesView.52b5aec8.js +0 -1182
  34. package/src/dist/CookiePreferencesView.52b5aec8.js.map +0 -1
  35. package/src/dist/DefaultLayout.045a82ff.js +0 -1964
  36. package/src/dist/DefaultLayout.045a82ff.js.map +0 -1
  37. package/src/dist/DefaultLayout.4454f259.js +0 -4414
  38. package/src/dist/DefaultLayout.4454f259.js.map +0 -1
  39. package/src/dist/FullscreenLayout.555c4987.js +0 -1054
  40. package/src/dist/FullscreenLayout.555c4987.js.map +0 -1
  41. package/src/dist/HomeView.ddfa7b68.js +0 -771
  42. package/src/dist/HomeView.ddfa7b68.js.map +0 -1
  43. package/src/dist/NotFoundView.c75be4f1.js +0 -811
  44. package/src/dist/NotFoundView.c75be4f1.js.map +0 -1
  45. package/src/dist/SettingsView.052b03a6.js +0 -4965
  46. package/src/dist/SettingsView.052b03a6.js.map +0 -1
  47. package/src/dist/ViewRoute.e6e3b142.js +0 -1042
  48. package/src/dist/ViewRoute.e6e3b142.js.map +0 -1
  49. package/src/dist/WindowsLayout.08724167.js +0 -1762
  50. package/src/dist/WindowsLayout.08724167.js.map +0 -1
  51. package/src/dist/esm.f0d741e6.js +0 -29520
  52. package/src/dist/esm.f0d741e6.js.map +0 -1
  53. package/src/dist/favicon.4367ac1e.svg +0 -14
  54. package/src/dist/index.parcel.36d65383.js +0 -54089
  55. package/src/dist/index.parcel.36d65383.js.map +0 -1
  56. package/src/dist/index.parcel.ca6d8a47.css +0 -3493
  57. package/src/dist/index.parcel.ca6d8a47.css.map +0 -1
  58. package/src/dist/index.parcel.html +0 -88
  59. package/src/features/layouts/DefaultLayout.tsx +0 -660
  60. package/src/features/layouts/LayoutProviders.tsx +0 -20
  61. /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
- };