@shellui/core 0.1.0 → 0.2.0-alpha.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 +4 -2
- package/src/components/AppPathView.tsx +31 -0
- package/src/components/ContentView.tsx +14 -6
- package/src/components/HomeView.tsx +9 -2
- package/src/components/IndexRoute.tsx +37 -0
- package/src/components/NotFoundView.tsx +3 -2
- package/src/components/ViewRoute.tsx +11 -7
- package/src/components/ui/tooltip.tsx +52 -0
- package/src/constants/urls.ts +2 -0
- package/src/features/config/ConfigProvider.ts +20 -76
- package/src/features/config/shellui-config.d.ts +13 -0
- package/src/features/config/types.ts +14 -3
- package/src/features/config/useConfig.ts +1 -10
- package/src/features/cookieConsent/cookieConsent.ts +2 -4
- package/src/features/layouts/AppBarLayout.tsx +260 -0
- package/src/features/layouts/AppLayout.tsx +6 -0
- package/src/features/layouts/DefaultLayout.tsx +25 -17
- package/src/features/layouts/OverlayShell.tsx +19 -8
- package/src/features/layouts/WindowsLayout.tsx +11 -9
- package/src/features/layouts/utils.ts +44 -0
- package/src/features/sentry/initSentry.ts +82 -12
- package/src/features/settings/SettingsProvider.tsx +2 -1
- package/src/features/settings/SettingsView.tsx +79 -15
- package/src/features/settings/components/Advanced.tsx +17 -2
- package/src/features/settings/components/ApplicationSettingsPanel.tsx +25 -0
- package/src/features/settings/components/Develop.tsx +68 -4
- package/src/i18n/translations/en/common.json +5 -0
- package/src/i18n/translations/en/settings.json +3 -1
- package/src/i18n/translations/fr/common.json +5 -0
- package/src/i18n/translations/fr/settings.json +3 -1
- package/src/index.css +10 -0
- package/src/lib/z-index.ts +2 -0
- package/src/router/routes.tsx +18 -5
- package/tailwind.config.js +1 -1
package/src/router/routes.tsx
CHANGED
|
@@ -7,9 +7,6 @@ import { flattenNavigationItems } from '../features/layouts/utils';
|
|
|
7
7
|
import urls from '../constants/urls';
|
|
8
8
|
|
|
9
9
|
// Lazy load route components
|
|
10
|
-
const HomeView = lazy(() =>
|
|
11
|
-
import('../components/HomeView').then((m) => ({ default: m.HomeView })),
|
|
12
|
-
);
|
|
13
10
|
const SettingsView = lazy(() =>
|
|
14
11
|
import('../features/settings/SettingsView').then((m) => ({ default: m.SettingsView })),
|
|
15
12
|
);
|
|
@@ -21,9 +18,15 @@ const CookiePreferencesView = lazy(() =>
|
|
|
21
18
|
const ViewRoute = lazy(() =>
|
|
22
19
|
import('../components/ViewRoute').then((m) => ({ default: m.ViewRoute })),
|
|
23
20
|
);
|
|
21
|
+
const IndexRoute = lazy(() =>
|
|
22
|
+
import('../components/IndexRoute').then((m) => ({ default: m.IndexRoute })),
|
|
23
|
+
);
|
|
24
24
|
const NotFoundView = lazy(() =>
|
|
25
25
|
import('../components/NotFoundView').then((m) => ({ default: m.NotFoundView })),
|
|
26
26
|
);
|
|
27
|
+
const AppPathView = lazy(() =>
|
|
28
|
+
import('../components/AppPathView').then((m) => ({ default: m.AppPathView })),
|
|
29
|
+
);
|
|
27
30
|
|
|
28
31
|
function RouteFallback() {
|
|
29
32
|
return (
|
|
@@ -59,6 +62,15 @@ export const createRoutes = (config: ShellUIConfig): RouteObject[] => {
|
|
|
59
62
|
</Suspense>
|
|
60
63
|
),
|
|
61
64
|
},
|
|
65
|
+
{
|
|
66
|
+
// App-path route: renders component-based nav items so they can be loaded in an iframe
|
|
67
|
+
path: `${urls.appPath.replace(/^\//, '')}/:path/*`,
|
|
68
|
+
element: (
|
|
69
|
+
<Suspense fallback={<RouteFallback />}>
|
|
70
|
+
<AppPathView />
|
|
71
|
+
</Suspense>
|
|
72
|
+
),
|
|
73
|
+
},
|
|
62
74
|
{
|
|
63
75
|
// Catch-all route
|
|
64
76
|
path: '*',
|
|
@@ -88,17 +100,18 @@ export const createRoutes = (config: ShellUIConfig): RouteObject[] => {
|
|
|
88
100
|
path: '/',
|
|
89
101
|
element: (
|
|
90
102
|
<Suspense fallback={<RouteFallback />}>
|
|
91
|
-
<
|
|
103
|
+
<IndexRoute />
|
|
92
104
|
</Suspense>
|
|
93
105
|
),
|
|
94
106
|
},
|
|
95
107
|
],
|
|
96
108
|
};
|
|
97
109
|
|
|
98
|
-
// Add navigation routes
|
|
110
|
+
// Add navigation routes (skip items with path '' or '/' — they are shown at "/" via IndexRoute)
|
|
99
111
|
if (config.navigation && config.navigation.length > 0) {
|
|
100
112
|
const navigationItems = flattenNavigationItems(config.navigation);
|
|
101
113
|
navigationItems.forEach((item) => {
|
|
114
|
+
if (item.path === '' || item.path === '/') return;
|
|
102
115
|
(layoutRoute.children as RouteObject[]).push({
|
|
103
116
|
path: `/${item.path}/*`,
|
|
104
117
|
element: (
|
package/tailwind.config.js
CHANGED