@shellui/core 0.5.0-alpha.2 → 0.5.0-alpha.4
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 +5 -4
- package/postcss.config.js +7 -1
- package/schemas/shellui.config.schema.json +28 -1
- package/src/app.tsx +2 -2
- package/src/features/auth/backends/shellui.ts +3 -3
- package/src/features/auth/components/LoginView.tsx +13 -4
- package/src/features/auth/components/OAuthCallbackView.tsx +47 -8
- package/src/features/auth/types.ts +4 -4
- package/src/features/auth/utils/cliCallback.spec.ts +96 -0
- package/src/features/auth/utils/cliCallback.ts +118 -0
- package/src/features/auth/utils/decodeJwtPayload.ts +1 -1
- package/src/features/auth/utils/getUserFromSdkSettings.ts +2 -2
- package/src/features/auth/utils/hashHasOAuthTokens.spec.ts +16 -0
- package/src/features/auth/utils/hashHasOAuthTokens.ts +11 -0
- package/src/features/auth/utils/index.ts +8 -0
- package/src/features/auth/utils/toAuthSessionFromSettingsUser.spec.ts +1 -1
- package/src/features/config/ConfigProvider.ts +2 -2
- package/src/features/config/types.ts +22 -1
- package/src/features/config/useConfig.ts +2 -2
- package/src/features/storage/uploads/UploadToaster.tsx +1 -1
- package/src/features/storage/uploads/handleTrackedUpload.ts +1 -1
- package/src/i18n/translations/en/settings.json +4 -4
- package/src/i18n/translations/fr/settings.json +4 -4
- package/src/index.css +2 -4
- package/src/index.ts +3 -2
- package/src/routes/components/HomeView.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shellui/core",
|
|
3
|
-
"version": "0.5.0-alpha.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.0-alpha.4",
|
|
4
|
+
"description": "Shellui Core - Core React application runtime",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react",
|
|
42
42
|
"microfrontend"
|
|
43
43
|
],
|
|
44
|
-
"author": "
|
|
44
|
+
"author": "Shellui",
|
|
45
45
|
"license": "MIT",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"roarr": "^7.21.4",
|
|
64
64
|
"sonner": "^2.0.7",
|
|
65
65
|
"tailwind-merge": "^3.5.0",
|
|
66
|
+
"tailwindcss": "^4.2.0",
|
|
66
67
|
"vaul": "^1.1.2",
|
|
67
68
|
"workbox-cacheable-response": "^7.4.0",
|
|
68
69
|
"workbox-expiration": "^7.4.0",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"workbox-routing": "^7.4.0",
|
|
71
72
|
"workbox-strategies": "^7.4.0",
|
|
72
73
|
"workbox-window": "^7.4.0",
|
|
73
|
-
"@shellui/sdk": "0.5.0-alpha.
|
|
74
|
+
"@shellui/sdk": "0.5.0-alpha.4"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
77
|
"react": "^18.0.0 || ^19.0.0",
|
package/postcss.config.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
const coreSrc = path.join(path.dirname(fileURLToPath(import.meta.url)), 'src');
|
|
5
|
+
|
|
6
|
+
/** Fallback if Vite ever loads this file. CLI start/build use inline PostCSS with the same `base`. */
|
|
1
7
|
export default {
|
|
2
8
|
plugins: {
|
|
3
|
-
'@tailwindcss/postcss': {},
|
|
9
|
+
'@tailwindcss/postcss': { base: coreSrc },
|
|
4
10
|
autoprefixer: {},
|
|
5
11
|
},
|
|
6
12
|
};
|
|
@@ -115,6 +115,10 @@
|
|
|
115
115
|
"$ref": "#/definitions/LegalDocumentsConfig",
|
|
116
116
|
"description": "Legal documents content rendered as markdown."
|
|
117
117
|
},
|
|
118
|
+
"dev": {
|
|
119
|
+
"$ref": "#/definitions/DevConfig",
|
|
120
|
+
"description": "CLI-only companion for `shellui start` (spawn or follow a colocated app). Never shipped to the browser."
|
|
121
|
+
},
|
|
118
122
|
"$schema": {
|
|
119
123
|
"type": "string",
|
|
120
124
|
"description": "JSON Schema URL for editor autocomplete and validation."
|
|
@@ -122,6 +126,25 @@
|
|
|
122
126
|
},
|
|
123
127
|
"additionalProperties": false
|
|
124
128
|
},
|
|
129
|
+
"DevConfig": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"description": "CLI-only companion for `shellui start`. Not shipped to the browser.",
|
|
132
|
+
"properties": {
|
|
133
|
+
"run": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"description": "Command to spawn in the project root (e.g. `vite`)."
|
|
136
|
+
},
|
|
137
|
+
"url": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "URL (or host:port) to wait for before the shell opens, and to follow in follow-only mode."
|
|
140
|
+
},
|
|
141
|
+
"name": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"description": "Log prefix for the companion (default: `app`)."
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"additionalProperties": false
|
|
147
|
+
},
|
|
125
148
|
"ThemeAsset": {
|
|
126
149
|
"anyOf": [
|
|
127
150
|
{
|
|
@@ -327,7 +350,7 @@
|
|
|
327
350
|
},
|
|
328
351
|
"required": ["url"],
|
|
329
352
|
"additionalProperties": false,
|
|
330
|
-
"description": "Optional storage-service wiring for the shell and admin panel. When set, admin shows the Storage sidebar (files explorer, statistics, Django admin). Settings → Storage (quota) appears when `url` is set, unless `showInSettings` is false.
|
|
353
|
+
"description": "Optional storage-service wiring for the shell and admin panel. When set, admin shows the Storage sidebar (files explorer, statistics, Django admin). Settings → Storage (quota) appears when `url` is set, unless `showInSettings` is false. Shellui will also use this for the SDK file API (`shellui.storage`)."
|
|
331
354
|
},
|
|
332
355
|
"ThemeRef": {
|
|
333
356
|
"anyOf": [
|
|
@@ -829,6 +852,10 @@
|
|
|
829
852
|
"type": "string",
|
|
830
853
|
"description": "Admin content URL loaded in the admin route view (e.g. \"https://example.com/admin\")."
|
|
831
854
|
},
|
|
855
|
+
"loginUrl": {
|
|
856
|
+
"type": "string",
|
|
857
|
+
"description": "Public origin (or URL) of this shell where /login and OAuth /login/callback live. Used by shellui login. Not the iframe admin app (adminUrl)."
|
|
858
|
+
},
|
|
832
859
|
"publishableKey": {
|
|
833
860
|
"type": "string",
|
|
834
861
|
"description": "Optional Supabase publishable key (public key)."
|
package/src/app.tsx
CHANGED
|
@@ -116,7 +116,7 @@ const AppContent = () => {
|
|
|
116
116
|
|
|
117
117
|
const App = () => {
|
|
118
118
|
const [isLoading, setIsLoading] = useState(true);
|
|
119
|
-
// Initialize
|
|
119
|
+
// Initialize Shellui SDK to support recursive nesting
|
|
120
120
|
useLayoutEffect(() => {
|
|
121
121
|
shellui.init().then(() => {
|
|
122
122
|
setIsLoading(false);
|
|
@@ -136,7 +136,7 @@ const App = () => {
|
|
|
136
136
|
<I18nProvider>
|
|
137
137
|
<DialogProvider>
|
|
138
138
|
<SonnerProvider>
|
|
139
|
-
{/* Toaster + upload progress live at
|
|
139
|
+
{/* Toaster + upload progress live at Shellui root so they survive navigation. */}
|
|
140
140
|
<Toaster />
|
|
141
141
|
<UploadToaster />
|
|
142
142
|
<AppContent />
|
|
@@ -69,7 +69,7 @@ export const createShellUIAuthBackend = ({
|
|
|
69
69
|
},
|
|
70
70
|
exchangeOAuthCode: async ({ provider, code, redirectUri, oauthClientId, nowSeconds }) => {
|
|
71
71
|
if (!backendUrl) {
|
|
72
|
-
throw new Error('Missing
|
|
72
|
+
throw new Error('Missing Shellui backend URL.');
|
|
73
73
|
}
|
|
74
74
|
const selectedCompanyId = getShellUILoginCompanyId(companyId);
|
|
75
75
|
if (!selectedCompanyId) {
|
|
@@ -135,7 +135,7 @@ export const createShellUIAuthBackend = ({
|
|
|
135
135
|
},
|
|
136
136
|
startOAuth: (provider, redirectPath, oauthClientId) => {
|
|
137
137
|
if (!backendUrl) {
|
|
138
|
-
throw new Error('Missing
|
|
138
|
+
throw new Error('Missing Shellui backend URL.');
|
|
139
139
|
}
|
|
140
140
|
const redirectToUrl = new URL(
|
|
141
141
|
`${window.location.origin}${normalizeRedirectPath(redirectPath)}`,
|
|
@@ -213,7 +213,7 @@ export const createShellUIAuthBackend = ({
|
|
|
213
213
|
},
|
|
214
214
|
sendMagicLink: async (email, redirectPath) => {
|
|
215
215
|
if (!backendUrl) {
|
|
216
|
-
throw new Error('Missing
|
|
216
|
+
throw new Error('Missing Shellui backend URL.');
|
|
217
217
|
}
|
|
218
218
|
const emailRedirectTo = `${window.location.origin}${normalizeRedirectPath(redirectPath)}`;
|
|
219
219
|
const response = await fetch(`${backendUrl}/api/v1/otp`, {
|
|
@@ -12,6 +12,7 @@ import { useAuth } from '../hooks/useAuth';
|
|
|
12
12
|
import type { AuthSettings, LoginMethod } from '../types';
|
|
13
13
|
import {
|
|
14
14
|
buildAuthUrlWithNext,
|
|
15
|
+
captureCliCallbackFromSearch,
|
|
15
16
|
formatProviderLabel,
|
|
16
17
|
getOAuthProviderCandidates,
|
|
17
18
|
getPreferredBackendProvider,
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
isAccessPendingErrorCode,
|
|
20
21
|
isLoginMethod,
|
|
21
22
|
normalizeNextPath,
|
|
23
|
+
redirectToCliCallback,
|
|
22
24
|
} from '../utils';
|
|
23
25
|
import { AppBrandIcon } from '../../layouts/branding/AppBrandIcon';
|
|
24
26
|
import { AccessPendingView } from './AccessPendingView';
|
|
@@ -92,6 +94,7 @@ export const LoginView = () => {
|
|
|
92
94
|
startWeb3Ethereum,
|
|
93
95
|
getAuthSettings,
|
|
94
96
|
sendMagicLink,
|
|
97
|
+
session,
|
|
95
98
|
} = useAuth();
|
|
96
99
|
const configuredSettings = useMemo<AuthSettings>(() => {
|
|
97
100
|
const configuredMethods = Array.isArray(config.backend?.login?.methods)
|
|
@@ -136,6 +139,10 @@ export const LoginView = () => {
|
|
|
136
139
|
return buildAuthUrlWithNext(urls.loginCallback, nextPath);
|
|
137
140
|
}, [nextPath]);
|
|
138
141
|
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
captureCliCallbackFromSearch(location.search);
|
|
144
|
+
}, [location.search]);
|
|
145
|
+
|
|
139
146
|
useEffect(() => {
|
|
140
147
|
const params = new URLSearchParams(location.search);
|
|
141
148
|
const rawErr = params.get(SHELLUI_OAUTH_ERROR_PARAM);
|
|
@@ -161,17 +168,19 @@ export const LoginView = () => {
|
|
|
161
168
|
}, [location.hash, location.pathname, location.search, navigate, t]);
|
|
162
169
|
|
|
163
170
|
useEffect(() => {
|
|
164
|
-
if (authEvent === 'oauth_callback' && isAuthenticated) {
|
|
171
|
+
if (authEvent === 'oauth_callback' && isAuthenticated && session) {
|
|
165
172
|
clearAuthEvent();
|
|
173
|
+
if (redirectToCliCallback(session)) return;
|
|
166
174
|
navigate(nextPath, { replace: true });
|
|
167
175
|
}
|
|
168
|
-
}, [authEvent, clearAuthEvent, isAuthenticated, navigate, nextPath]);
|
|
176
|
+
}, [authEvent, clearAuthEvent, isAuthenticated, navigate, nextPath, session]);
|
|
169
177
|
|
|
170
178
|
useEffect(() => {
|
|
171
|
-
if (!authLoading && isAuthenticated) {
|
|
179
|
+
if (!authLoading && isAuthenticated && session) {
|
|
180
|
+
if (redirectToCliCallback(session)) return;
|
|
172
181
|
navigate(nextPath, { replace: true });
|
|
173
182
|
}
|
|
174
|
-
}, [authLoading, isAuthenticated, navigate, nextPath]);
|
|
183
|
+
}, [authLoading, isAuthenticated, navigate, nextPath, session]);
|
|
175
184
|
|
|
176
185
|
const supportsOAuth = configuredSettings.methods.includes('oauth');
|
|
177
186
|
const supportsMagicLink = configuredSettings.methods.includes('magic_link');
|
|
@@ -3,9 +3,13 @@ import { useLocation, useNavigate } from 'react-router';
|
|
|
3
3
|
import urls from '../../../constants/urls';
|
|
4
4
|
import {
|
|
5
5
|
buildAuthUrlWithNext,
|
|
6
|
+
captureCliCallbackFromSearch,
|
|
7
|
+
hashHasOAuthTokens,
|
|
6
8
|
inferAccessPendingErrorCode,
|
|
7
9
|
isAccessPendingErrorCode,
|
|
8
10
|
normalizeNextPath,
|
|
11
|
+
redirectCliCallbackError,
|
|
12
|
+
redirectToCliCallback,
|
|
9
13
|
} from '../utils';
|
|
10
14
|
import { useAuth } from '../hooks/useAuth';
|
|
11
15
|
import { AccessPendingView } from './AccessPendingView';
|
|
@@ -78,7 +82,7 @@ const looksLikeUsedOAuthCode = (message: string | null | undefined) => {
|
|
|
78
82
|
export const OAuthCallbackView = () => {
|
|
79
83
|
const location = useLocation();
|
|
80
84
|
const navigate = useNavigate();
|
|
81
|
-
const { completeOAuthCallback, isAuthenticated } = useAuth();
|
|
85
|
+
const { completeOAuthCallback, isAuthenticated, isLoading, session } = useAuth();
|
|
82
86
|
const [localError, setLocalError] = useState<string | null>(null);
|
|
83
87
|
const [pendingAccess, setPendingAccess] = useState<PendingAccess | null>(null);
|
|
84
88
|
const [isWorking, setIsWorking] = useState(true);
|
|
@@ -88,27 +92,57 @@ export const OAuthCallbackView = () => {
|
|
|
88
92
|
const params = new URLSearchParams(location.search);
|
|
89
93
|
return normalizeNextPath(params.get('next')) ?? '/';
|
|
90
94
|
}, [location.search]);
|
|
95
|
+
const fragmentHasTokens = useMemo(() => hashHasOAuthTokens(location.hash), [location.hash]);
|
|
91
96
|
|
|
92
97
|
useEffect(() => {
|
|
93
|
-
|
|
98
|
+
captureCliCallbackFromSearch(location.search);
|
|
99
|
+
}, [location.search]);
|
|
100
|
+
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (!isAuthenticated || !session) return;
|
|
103
|
+
if (redirectToCliCallback(session)) return;
|
|
94
104
|
navigate(nextPath, { replace: true });
|
|
95
|
-
}, [isAuthenticated, navigate, nextPath]);
|
|
105
|
+
}, [isAuthenticated, navigate, nextPath, session]);
|
|
96
106
|
|
|
97
107
|
useEffect(() => {
|
|
98
108
|
if (isAuthenticated) return;
|
|
109
|
+
// Identity bounce lands with tokens in the hash; AuthProvider restores the session.
|
|
110
|
+
// Stay on "Completing…" while hash is present or auth bootstrap is still running.
|
|
111
|
+
if (fragmentHasTokens || isLoading) {
|
|
112
|
+
setIsWorking(true);
|
|
113
|
+
setLocalError(null);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
99
116
|
|
|
100
117
|
const params = new URLSearchParams(location.search);
|
|
101
118
|
const oauthError = params.get('error');
|
|
102
119
|
if (oauthError) {
|
|
120
|
+
if (redirectCliCallbackError(oauthError)) return;
|
|
103
121
|
setLocalError(oauthError);
|
|
104
122
|
setIsWorking(false);
|
|
105
123
|
return;
|
|
106
124
|
}
|
|
107
125
|
|
|
126
|
+
const bounceError = params.get(SHELLUI_OAUTH_ERROR_PARAM);
|
|
127
|
+
if (bounceError) {
|
|
128
|
+
const bounceCode = params.get(SHELLUI_OAUTH_ERROR_CODE_PARAM) || 'oauth_error';
|
|
129
|
+
if (redirectCliCallbackError(bounceError, bounceCode)) return;
|
|
130
|
+
if (isAccessPendingErrorCode(bounceCode)) {
|
|
131
|
+
setPendingAccess({ message: bounceError, code: bounceCode });
|
|
132
|
+
setIsWorking(false);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
setLocalError(bounceError);
|
|
136
|
+
setIsWorking(false);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
108
140
|
const code = params.get('code');
|
|
109
141
|
const provider = params.get('provider');
|
|
110
142
|
if (!code || !provider) {
|
|
111
|
-
|
|
143
|
+
const message = 'Missing OAuth callback parameters.';
|
|
144
|
+
if (redirectCliCallbackError(message)) return;
|
|
145
|
+
setLocalError(message);
|
|
112
146
|
setIsWorking(false);
|
|
113
147
|
return;
|
|
114
148
|
}
|
|
@@ -116,6 +150,7 @@ export const OAuthCallbackView = () => {
|
|
|
116
150
|
// If a previous attempt already learned this login is pending, show it without re-exchanging.
|
|
117
151
|
const cachedPending = readPendingForCode(code);
|
|
118
152
|
if (cachedPending) {
|
|
153
|
+
if (redirectCliCallbackError(cachedPending.message, cachedPending.code)) return;
|
|
119
154
|
setPendingAccess(cachedPending);
|
|
120
155
|
setIsWorking(false);
|
|
121
156
|
navigate(buildLoginPendingUrl(nextPath, cachedPending), { replace: true });
|
|
@@ -161,6 +196,7 @@ export const OAuthCallbackView = () => {
|
|
|
161
196
|
code: pendingCode,
|
|
162
197
|
};
|
|
163
198
|
writePendingForCode(code, pending);
|
|
199
|
+
if (redirectCliCallbackError(pending.message, pending.code)) return;
|
|
164
200
|
setPendingAccess(pending);
|
|
165
201
|
setIsWorking(false);
|
|
166
202
|
if (!cancelled) {
|
|
@@ -172,6 +208,7 @@ export const OAuthCallbackView = () => {
|
|
|
172
208
|
// Code was likely consumed by a cancelled first attempt that already marked pending.
|
|
173
209
|
const recovered = readPendingForCode(code);
|
|
174
210
|
if (recovered && looksLikeUsedOAuthCode(result.error)) {
|
|
211
|
+
if (redirectCliCallbackError(recovered.message, recovered.code)) return;
|
|
175
212
|
setPendingAccess(recovered);
|
|
176
213
|
setIsWorking(false);
|
|
177
214
|
if (!cancelled) {
|
|
@@ -180,15 +217,15 @@ export const OAuthCallbackView = () => {
|
|
|
180
217
|
return;
|
|
181
218
|
}
|
|
182
219
|
|
|
183
|
-
|
|
220
|
+
const message = result.error ?? 'Unable to complete OAuth login.';
|
|
221
|
+
if (redirectCliCallbackError(message, result.errorCode)) return;
|
|
222
|
+
setLocalError(message);
|
|
184
223
|
setIsWorking(false);
|
|
185
224
|
return;
|
|
186
225
|
}
|
|
187
226
|
|
|
188
227
|
clearPendingForCode(code);
|
|
189
|
-
|
|
190
|
-
navigate(nextPath, { replace: true });
|
|
191
|
-
}
|
|
228
|
+
// Session is set in AuthProvider; the authenticated effect handles CLI bounce / next.
|
|
192
229
|
};
|
|
193
230
|
|
|
194
231
|
void run();
|
|
@@ -197,7 +234,9 @@ export const OAuthCallbackView = () => {
|
|
|
197
234
|
};
|
|
198
235
|
}, [
|
|
199
236
|
completeOAuthCallback,
|
|
237
|
+
fragmentHasTokens,
|
|
200
238
|
isAuthenticated,
|
|
239
|
+
isLoading,
|
|
201
240
|
location.pathname,
|
|
202
241
|
location.search,
|
|
203
242
|
navigate,
|
|
@@ -9,9 +9,9 @@ export interface AuthSession {
|
|
|
9
9
|
userName: string | null;
|
|
10
10
|
userAvatarUrl: string | null;
|
|
11
11
|
userIsStaff: boolean;
|
|
12
|
-
/** True when JWT `user_metadata.is_company_owner` is set for the active company (
|
|
12
|
+
/** True when JWT `user_metadata.is_company_owner` is set for the active company (Shellui auth). */
|
|
13
13
|
userIsCompanyOwner: boolean;
|
|
14
|
-
/** Sorted unique group names from JWT `user_metadata.groups` (
|
|
14
|
+
/** Sorted unique group names from JWT `user_metadata.groups` (Shellui auth). */
|
|
15
15
|
userGroups: string[];
|
|
16
16
|
userPreferences?: UserPreferences | null;
|
|
17
17
|
}
|
|
@@ -22,10 +22,10 @@ export interface AuthUser {
|
|
|
22
22
|
name: string | null;
|
|
23
23
|
profilePicture: string | null;
|
|
24
24
|
isStaff: boolean;
|
|
25
|
-
/** Company owner for the JWT tenant (`user_metadata.is_company_owner`,
|
|
25
|
+
/** Company owner for the JWT tenant (`user_metadata.is_company_owner`, Shellui auth). */
|
|
26
26
|
isCompanyOwner: boolean;
|
|
27
27
|
authProvider: string | null;
|
|
28
|
-
/** Group names from the access token; empty if none or not a
|
|
28
|
+
/** Group names from the access token; empty if none or not a Shellui JWT. */
|
|
29
29
|
groups: string[];
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { describe, expect, test, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
CLI_CALLBACK_PARAM,
|
|
4
|
+
captureCliCallbackFromSearch,
|
|
5
|
+
isLoopbackCliCallbackUrl,
|
|
6
|
+
redirectCliCallbackError,
|
|
7
|
+
redirectToCliCallback,
|
|
8
|
+
} from './cliCallback';
|
|
9
|
+
|
|
10
|
+
const createStorageMock = () => {
|
|
11
|
+
const data = new Map<string, string>();
|
|
12
|
+
return {
|
|
13
|
+
getItem: vi.fn((key: string) => data.get(key) ?? null),
|
|
14
|
+
setItem: vi.fn((key: string, value: string) => {
|
|
15
|
+
data.set(key, value);
|
|
16
|
+
}),
|
|
17
|
+
removeItem: vi.fn((key: string) => {
|
|
18
|
+
data.delete(key);
|
|
19
|
+
}),
|
|
20
|
+
clear: vi.fn(() => {
|
|
21
|
+
data.clear();
|
|
22
|
+
}),
|
|
23
|
+
key: vi.fn(() => null),
|
|
24
|
+
get length() {
|
|
25
|
+
return data.size;
|
|
26
|
+
},
|
|
27
|
+
} as unknown as Storage;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
describe('cliCallback', () => {
|
|
31
|
+
beforeEach(() => {
|
|
32
|
+
Object.defineProperty(globalThis, 'sessionStorage', {
|
|
33
|
+
configurable: true,
|
|
34
|
+
value: createStorageMock(),
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
vi.unstubAllGlobals();
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
test('isLoopbackCliCallbackUrl accepts only loopback http(s)', () => {
|
|
43
|
+
expect(isLoopbackCliCallbackUrl('http://127.0.0.1:8765/callback')).toBe(true);
|
|
44
|
+
expect(isLoopbackCliCallbackUrl('http://localhost/callback')).toBe(true);
|
|
45
|
+
expect(isLoopbackCliCallbackUrl('http://[::1]/callback')).toBe(true);
|
|
46
|
+
expect(isLoopbackCliCallbackUrl('https://evil.example/callback')).toBe(false);
|
|
47
|
+
expect(isLoopbackCliCallbackUrl('not-a-url')).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
test('capture + redirectToCliCallback assigns fragment tokens', () => {
|
|
51
|
+
const assign = vi.fn();
|
|
52
|
+
vi.stubGlobal('location', { assign });
|
|
53
|
+
captureCliCallbackFromSearch(
|
|
54
|
+
`?${CLI_CALLBACK_PARAM}=${encodeURIComponent('http://127.0.0.1:9/callback')}`,
|
|
55
|
+
);
|
|
56
|
+
expect(
|
|
57
|
+
redirectToCliCallback({
|
|
58
|
+
accessToken: 'a',
|
|
59
|
+
refreshToken: 'r',
|
|
60
|
+
tokenType: 'bearer',
|
|
61
|
+
expiresAt: 123,
|
|
62
|
+
}),
|
|
63
|
+
).toBe(true);
|
|
64
|
+
expect(assign).toHaveBeenCalledTimes(1);
|
|
65
|
+
const target = String(assign.mock.calls[0][0]);
|
|
66
|
+
expect(target.startsWith('http://127.0.0.1:9/callback#')).toBe(true);
|
|
67
|
+
expect(target).toContain('access_token=a');
|
|
68
|
+
expect(target).toContain('refresh_token=r');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('rejects non-loopback capture', () => {
|
|
72
|
+
captureCliCallbackFromSearch(
|
|
73
|
+
`?${CLI_CALLBACK_PARAM}=${encodeURIComponent('https://evil.example/x')}`,
|
|
74
|
+
);
|
|
75
|
+
expect(
|
|
76
|
+
redirectToCliCallback({
|
|
77
|
+
accessToken: 'a',
|
|
78
|
+
refreshToken: 'r',
|
|
79
|
+
tokenType: 'bearer',
|
|
80
|
+
expiresAt: 1,
|
|
81
|
+
}),
|
|
82
|
+
).toBe(false);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('redirectCliCallbackError uses query params', () => {
|
|
86
|
+
const assign = vi.fn();
|
|
87
|
+
vi.stubGlobal('location', { assign });
|
|
88
|
+
captureCliCallbackFromSearch(
|
|
89
|
+
`?${CLI_CALLBACK_PARAM}=${encodeURIComponent('http://127.0.0.1:9/callback')}`,
|
|
90
|
+
);
|
|
91
|
+
expect(redirectCliCallbackError('Nope', 'access_pending')).toBe(true);
|
|
92
|
+
const target = String(assign.mock.calls[0][0]);
|
|
93
|
+
expect(target).toContain('shellui_oauth_error=Nope');
|
|
94
|
+
expect(target).toContain('shellui_oauth_error_code=access_pending');
|
|
95
|
+
});
|
|
96
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { AuthSession } from '../types';
|
|
2
|
+
|
|
3
|
+
/** Query param on `/login` used by `shellui login`. */
|
|
4
|
+
export const CLI_CALLBACK_PARAM = 'shellui_cli_callback';
|
|
5
|
+
|
|
6
|
+
const CLI_CALLBACK_STORAGE_KEY = 'shellui.cli_callback';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* True when the URL is an http(s) loopback address (CLI OAuth bounce target).
|
|
10
|
+
*/
|
|
11
|
+
export function isLoopbackCliCallbackUrl(raw: string): boolean {
|
|
12
|
+
try {
|
|
13
|
+
const url = new URL(raw);
|
|
14
|
+
if (url.protocol !== 'http:' && url.protocol !== 'https:') return false;
|
|
15
|
+
const host = url.hostname.toLowerCase().replace(/^\[|\]$/g, '');
|
|
16
|
+
return host === '127.0.0.1' || host === 'localhost' || host === '::1';
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Persist a loopback CLI callback from the current location search (survives OAuth round-trip).
|
|
24
|
+
*/
|
|
25
|
+
export function captureCliCallbackFromSearch(search: string): void {
|
|
26
|
+
if (typeof sessionStorage === 'undefined') return;
|
|
27
|
+
const raw = new URLSearchParams(search.startsWith('?') ? search.slice(1) : search).get(
|
|
28
|
+
CLI_CALLBACK_PARAM,
|
|
29
|
+
);
|
|
30
|
+
if (!raw || !isLoopbackCliCallbackUrl(raw)) return;
|
|
31
|
+
try {
|
|
32
|
+
sessionStorage.setItem(CLI_CALLBACK_STORAGE_KEY, raw);
|
|
33
|
+
} catch {
|
|
34
|
+
// ignore quota / private mode
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function readStoredCliCallback(): string | null {
|
|
39
|
+
if (typeof sessionStorage === 'undefined') return null;
|
|
40
|
+
try {
|
|
41
|
+
const raw = sessionStorage.getItem(CLI_CALLBACK_STORAGE_KEY);
|
|
42
|
+
if (!raw || !isLoopbackCliCallbackUrl(raw)) {
|
|
43
|
+
sessionStorage.removeItem(CLI_CALLBACK_STORAGE_KEY);
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
return raw;
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function clearStoredCliCallback(): void {
|
|
53
|
+
if (typeof sessionStorage === 'undefined') return;
|
|
54
|
+
try {
|
|
55
|
+
sessionStorage.removeItem(CLI_CALLBACK_STORAGE_KEY);
|
|
56
|
+
} catch {
|
|
57
|
+
// ignore
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* If a CLI loopback callback is pending, redirect there with tokens in the fragment.
|
|
63
|
+
* @returns true when navigation was started
|
|
64
|
+
*/
|
|
65
|
+
export function redirectToCliCallback(
|
|
66
|
+
session: Pick<AuthSession, 'accessToken' | 'refreshToken' | 'tokenType' | 'expiresAt'>,
|
|
67
|
+
): boolean {
|
|
68
|
+
const callback = readStoredCliCallback();
|
|
69
|
+
if (!callback) return false;
|
|
70
|
+
clearStoredCliCallback();
|
|
71
|
+
const params = new URLSearchParams();
|
|
72
|
+
params.set('access_token', session.accessToken);
|
|
73
|
+
params.set('refresh_token', session.refreshToken);
|
|
74
|
+
params.set('token_type', session.tokenType || 'bearer');
|
|
75
|
+
if (Number.isFinite(session.expiresAt)) {
|
|
76
|
+
params.set('expires_at', String(session.expiresAt));
|
|
77
|
+
}
|
|
78
|
+
const href = `${callback}#${params.toString()}`;
|
|
79
|
+
if (typeof window !== 'undefined' && typeof window.location?.assign === 'function') {
|
|
80
|
+
window.location.assign(href);
|
|
81
|
+
} else if (typeof location !== 'undefined' && typeof location.assign === 'function') {
|
|
82
|
+
location.assign(href);
|
|
83
|
+
} else {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* If a CLI loopback callback is pending, redirect there with an OAuth error in the query.
|
|
91
|
+
* @returns true when navigation was started
|
|
92
|
+
*/
|
|
93
|
+
export function redirectCliCallbackError(message: string, errorCode?: string | null): boolean {
|
|
94
|
+
const callback = readStoredCliCallback();
|
|
95
|
+
if (!callback) return false;
|
|
96
|
+
clearStoredCliCallback();
|
|
97
|
+
try {
|
|
98
|
+
const url = new URL(callback);
|
|
99
|
+
url.searchParams.set(
|
|
100
|
+
'shellui_oauth_error',
|
|
101
|
+
(message || 'OAuth sign-in failed.').replace(/\r|\n/g, ' ').trim().slice(0, 500),
|
|
102
|
+
);
|
|
103
|
+
if (errorCode && errorCode.trim()) {
|
|
104
|
+
url.searchParams.set('shellui_oauth_error_code', errorCode.trim().slice(0, 64));
|
|
105
|
+
}
|
|
106
|
+
const href = url.toString();
|
|
107
|
+
if (typeof window !== 'undefined' && typeof window.location?.assign === 'function') {
|
|
108
|
+
window.location.assign(href);
|
|
109
|
+
} else if (typeof location !== 'undefined' && typeof location.assign === 'function') {
|
|
110
|
+
location.assign(href);
|
|
111
|
+
} else {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return true;
|
|
115
|
+
} catch {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -14,7 +14,7 @@ export const decodeJwtPayload = (token: string): Record<string, unknown> | null
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
/** Normalizes `user_metadata.groups` from a
|
|
17
|
+
/** Normalizes `user_metadata.groups` from a Shellui auth JWT to sorted unique names. */
|
|
18
18
|
export const normalizeJwtUserGroups = (raw: unknown): string[] => {
|
|
19
19
|
if (!Array.isArray(raw)) return [];
|
|
20
20
|
const names = raw
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { shellui, type Settings, type SettingsUser } from '@shellui/sdk';
|
|
2
2
|
|
|
3
|
-
// Retrieves the current user from
|
|
3
|
+
// Retrieves the current user from Shellui initial settings when available.
|
|
4
4
|
export const getUserFromSdkSettings = (): SettingsUser | null => {
|
|
5
5
|
const initialSettings = shellui.initialSettings as Settings | null;
|
|
6
6
|
return initialSettings?.user ?? null;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
// Retrieves the current access token from
|
|
9
|
+
// Retrieves the current access token from Shellui initial settings when available.
|
|
10
10
|
export const getAccessTokenFromSdkSettings = (): string | null => {
|
|
11
11
|
const initialSettings = shellui.initialSettings as Settings | null;
|
|
12
12
|
return initialSettings?.accessToken ?? null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { describe, expect, test } from 'vitest';
|
|
2
|
+
import { hashHasOAuthTokens } from './hashHasOAuthTokens';
|
|
3
|
+
|
|
4
|
+
describe('hashHasOAuthTokens', () => {
|
|
5
|
+
test('detects access + refresh in hash', () => {
|
|
6
|
+
expect(hashHasOAuthTokens('#access_token=a&refresh_token=b')).toBe(true);
|
|
7
|
+
expect(hashHasOAuthTokens('access_token=a&refresh_token=b')).toBe(true);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
test('rejects incomplete hash', () => {
|
|
11
|
+
expect(hashHasOAuthTokens('#access_token=a')).toBe(false);
|
|
12
|
+
expect(hashHasOAuthTokens('#error=denied')).toBe(false);
|
|
13
|
+
expect(hashHasOAuthTokens('')).toBe(false);
|
|
14
|
+
expect(hashHasOAuthTokens(null)).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True when the location hash looks like an identity fragment bounce
|
|
3
|
+
* (`#access_token=…&refresh_token=…`).
|
|
4
|
+
*/
|
|
5
|
+
export function hashHasOAuthTokens(locationHash: string | null | undefined): boolean {
|
|
6
|
+
if (!locationHash) return false;
|
|
7
|
+
const params = new URLSearchParams(locationHash.replace(/^#/, ''));
|
|
8
|
+
const access = params.get('access_token');
|
|
9
|
+
const refresh = params.get('refresh_token');
|
|
10
|
+
return Boolean(access && refresh);
|
|
11
|
+
}
|
|
@@ -5,12 +5,20 @@ export {
|
|
|
5
5
|
} from './clientLoginContext';
|
|
6
6
|
export { buildAuthUrlWithNext } from './buildAuthUrlWithNext';
|
|
7
7
|
export { buildSessionFromParams } from './buildSessionFromParams';
|
|
8
|
+
export { hashHasOAuthTokens } from './hashHasOAuthTokens';
|
|
8
9
|
export {
|
|
9
10
|
AuthRequestError,
|
|
10
11
|
getAuthRequestErrorCode,
|
|
11
12
|
inferAccessPendingErrorCode,
|
|
12
13
|
isAccessPendingErrorCode,
|
|
13
14
|
} from './authRequestError';
|
|
15
|
+
export {
|
|
16
|
+
CLI_CALLBACK_PARAM,
|
|
17
|
+
captureCliCallbackFromSearch,
|
|
18
|
+
isLoopbackCliCallbackUrl,
|
|
19
|
+
redirectCliCallbackError,
|
|
20
|
+
redirectToCliCallback,
|
|
21
|
+
} from './cliCallback';
|
|
14
22
|
export { clearStoredAuthSession } from './clearStoredAuthSession';
|
|
15
23
|
export { decodeJwtPayload } from './decodeJwtPayload';
|
|
16
24
|
export { formatProviderLabel } from './formatProviderLabel';
|
|
@@ -45,7 +45,7 @@ describe('toAuthSessionFromSettingsUser', () => {
|
|
|
45
45
|
vi.useRealTimers();
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
it('reads groups and staff from
|
|
48
|
+
it('reads groups and staff from Shellui JWT user_metadata when present', () => {
|
|
49
49
|
const settingsUser = {
|
|
50
50
|
id: 'user-1',
|
|
51
51
|
email: 'user@example.com',
|
|
@@ -20,7 +20,7 @@ export interface ConfigProviderProps {
|
|
|
20
20
|
let configLogged = false;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Provides
|
|
23
|
+
* Provides Shellui config (loaded from @shellui/config at build time) via context.
|
|
24
24
|
* Children can use useConfig() to read config.
|
|
25
25
|
*/
|
|
26
26
|
export function ConfigProvider(props: ConfigProviderProps): ReturnType<typeof createElement> {
|
|
@@ -39,7 +39,7 @@ export function ConfigProvider(props: ConfigProviderProps): ReturnType<typeof cr
|
|
|
39
39
|
}
|
|
40
40
|
return resolved;
|
|
41
41
|
} catch (err) {
|
|
42
|
-
logger.error('Failed to load
|
|
42
|
+
logger.error('Failed to load Shellui config:', { error: err });
|
|
43
43
|
return {} as ShellUIConfig;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -155,6 +155,12 @@ export interface BackendConfig {
|
|
|
155
155
|
adminPathname?: string;
|
|
156
156
|
/** Admin content URL loaded in the admin route view (e.g. "https://example.com/admin"). */
|
|
157
157
|
adminUrl?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Public origin (or full URL) of this shell — where `/login` and OAuth `/login/callback` live.
|
|
160
|
+
* Used by `shellui login`. Not the iframe admin app (`adminUrl`).
|
|
161
|
+
* Example: `https://app.example.com` or `http://127.0.0.1:4000`.
|
|
162
|
+
*/
|
|
163
|
+
loginUrl?: string;
|
|
158
164
|
/** Optional Supabase publishable key (public key). */
|
|
159
165
|
publishableKey?: string;
|
|
160
166
|
/** Optional login capabilities used by frontend for immediate rendering. */
|
|
@@ -167,7 +173,7 @@ export interface BackendConfig {
|
|
|
167
173
|
* Optional storage-service wiring for the shell and admin panel.
|
|
168
174
|
* When set, admin shows the Storage sidebar (files explorer, statistics, Django admin).
|
|
169
175
|
* Settings → Storage (quota) appears when `url` is set, unless `showInSettings` is false.
|
|
170
|
-
*
|
|
176
|
+
* Shellui will also use this for the SDK file API (`shellui.storage`).
|
|
171
177
|
*/
|
|
172
178
|
export interface StorageConfig {
|
|
173
179
|
/** Base URL of storage-service (e.g. `http://localhost:8001`). */
|
|
@@ -276,4 +282,19 @@ export interface ShellUIConfig {
|
|
|
276
282
|
cookieConsent?: CookieConsentConfig;
|
|
277
283
|
/** Legal documents content rendered as markdown. */
|
|
278
284
|
legalDocuments?: LegalDocumentsConfig;
|
|
285
|
+
/**
|
|
286
|
+
* CLI-only companion for `shellui start`. Spawn `run` and/or follow `url`.
|
|
287
|
+
* Stripped before the config is sent to the browser.
|
|
288
|
+
*/
|
|
289
|
+
dev?: DevConfig;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** Companion process for local `shellui start` (not used at runtime in the shell). */
|
|
293
|
+
export interface DevConfig {
|
|
294
|
+
/** Command to spawn in the project root (e.g. `vite`). */
|
|
295
|
+
run?: string;
|
|
296
|
+
/** URL (or host:port) to wait for / follow. */
|
|
297
|
+
url?: string;
|
|
298
|
+
/** Log prefix name (default: `app`). */
|
|
299
|
+
name?: string;
|
|
279
300
|
}
|
|
@@ -2,7 +2,7 @@ import { useContext } from 'react';
|
|
|
2
2
|
import { ConfigContext, type ConfigContextValue } from './ConfigProvider';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Hook to access
|
|
5
|
+
* Hook to access Shellui configuration from ConfigProvider context.
|
|
6
6
|
* Must be used within a ConfigProvider.
|
|
7
7
|
* @returns {ConfigContextValue} Configuration object and loading state
|
|
8
8
|
*/
|
|
@@ -16,7 +16,7 @@ export function useConfig(): ConfigContextValue {
|
|
|
16
16
|
);
|
|
17
17
|
if (typeof window !== 'undefined' && process.env.NODE_ENV === 'development') {
|
|
18
18
|
// eslint-disable-next-line no-console
|
|
19
|
-
console.error('[
|
|
19
|
+
console.error('[Shellui] ConfigProvider error:', error);
|
|
20
20
|
}
|
|
21
21
|
throw error;
|
|
22
22
|
}
|
|
@@ -10,7 +10,7 @@ function isShellUiRoot(): boolean {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Custom upload toast at the outermost
|
|
13
|
+
* Custom upload toast at the outermost Shellui window. Nested iframes never
|
|
14
14
|
* render it — they post uploads / demo requests up so the root can show this
|
|
15
15
|
* panel above modals and keep it while the user navigates.
|
|
16
16
|
*/
|
|
@@ -32,7 +32,7 @@ function toErrorPayload(err: unknown): StorageResponsePayload['error'] {
|
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Runs a storage upload with toaster progress. Folder placeholders skip the toast.
|
|
35
|
-
* Uploads keep running at
|
|
35
|
+
* Uploads keep running at Shellui root regardless of route changes.
|
|
36
36
|
*/
|
|
37
37
|
export async function handleTrackedUpload(
|
|
38
38
|
input: HandleStorageRequestInput,
|
|
@@ -278,14 +278,14 @@
|
|
|
278
278
|
},
|
|
279
279
|
"logging": {
|
|
280
280
|
"title": "Logging",
|
|
281
|
-
"description": "Enable or disable logging for specific namespaces. This helps you control which parts of
|
|
281
|
+
"description": "Enable or disable logging for specific namespaces. This helps you control which parts of Shellui output debug information.",
|
|
282
282
|
"shellsdk": {
|
|
283
283
|
"label": "Show ShellSDK logs",
|
|
284
|
-
"description": "Enable logging for
|
|
284
|
+
"description": "Enable logging for Shellui SDK operations"
|
|
285
285
|
},
|
|
286
286
|
"shellcore": {
|
|
287
287
|
"label": "Show ShellCore logs",
|
|
288
|
-
"description": "Enable logging for
|
|
288
|
+
"description": "Enable logging for Shellui Core operations"
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
"auth": {
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
},
|
|
298
298
|
"testing": {
|
|
299
299
|
"title": "Testing",
|
|
300
|
-
"description": "Test
|
|
300
|
+
"description": "Test Shellui features and functionality.",
|
|
301
301
|
"toastNotifications": {
|
|
302
302
|
"title": "Toast Notifications",
|
|
303
303
|
"buttons": {
|
|
@@ -278,14 +278,14 @@
|
|
|
278
278
|
},
|
|
279
279
|
"logging": {
|
|
280
280
|
"title": "Journalisation",
|
|
281
|
-
"description": "Activez ou désactivez la journalisation pour des espaces de noms spécifiques. Cela vous aide à contrôler quelles parties de
|
|
281
|
+
"description": "Activez ou désactivez la journalisation pour des espaces de noms spécifiques. Cela vous aide à contrôler quelles parties de Shellui affichent des informations de débogage.",
|
|
282
282
|
"shellsdk": {
|
|
283
283
|
"label": "Afficher les journaux ShellSDK",
|
|
284
|
-
"description": "Activez la journalisation pour les opérations
|
|
284
|
+
"description": "Activez la journalisation pour les opérations Shellui SDK"
|
|
285
285
|
},
|
|
286
286
|
"shellcore": {
|
|
287
287
|
"label": "Afficher les journaux ShellCore",
|
|
288
|
-
"description": "Activez la journalisation pour les opérations
|
|
288
|
+
"description": "Activez la journalisation pour les opérations Shellui Core"
|
|
289
289
|
}
|
|
290
290
|
},
|
|
291
291
|
"auth": {
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
},
|
|
298
298
|
"testing": {
|
|
299
299
|
"title": "Tests",
|
|
300
|
-
"description": "Testez les fonctionnalités de
|
|
300
|
+
"description": "Testez les fonctionnalités de Shellui.",
|
|
301
301
|
"toastNotifications": {
|
|
302
302
|
"title": "Notifications Toast",
|
|
303
303
|
"buttons": {
|
package/src/index.css
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
1
|
+
@import 'tailwindcss' source(none);
|
|
2
2
|
|
|
3
|
-
/*
|
|
4
|
-
* Without this, Tailwind v4 skips source files inside node_modules,
|
|
5
|
-
* which breaks consumers that use @shellui/cli with the core's src/. */
|
|
3
|
+
/* Scan only this package's src — never the consumer project (cwd). */
|
|
6
4
|
@source ".";
|
|
7
5
|
|
|
8
6
|
@custom-variant dark (&:is(.dark *));
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Shellui Core - Main entry point
|
|
3
3
|
* Exports the App component, types, and utilities for use in config files and other packages.
|
|
4
4
|
*
|
|
5
|
-
* CSS is imported as a side effect. When using
|
|
5
|
+
* CSS is imported as a side effect. When using Shellui, run 'shellui build' to build your application.
|
|
6
6
|
* The CLI will handle all CSS processing and bundling.
|
|
7
7
|
*/
|
|
8
8
|
import './index.css';
|
|
@@ -10,6 +10,7 @@ import './index.css';
|
|
|
10
10
|
export { default as App } from './app.js';
|
|
11
11
|
export type {
|
|
12
12
|
ShellUIConfig,
|
|
13
|
+
DevConfig,
|
|
13
14
|
ThemeAsset,
|
|
14
15
|
NavigationItem,
|
|
15
16
|
NavigationGroup,
|
|
@@ -11,7 +11,7 @@ export const HomeView = () => {
|
|
|
11
11
|
className="m-0 text-3xl font-light text-foreground"
|
|
12
12
|
style={{ fontFamily: 'var(--heading-font-family, inherit)' }}
|
|
13
13
|
>
|
|
14
|
-
{t('welcome', { title: config?.title ?? '
|
|
14
|
+
{t('welcome', { title: config?.title ?? 'Shellui' })}
|
|
15
15
|
</h1>
|
|
16
16
|
<p className="mt-4 text-lg text-muted-foreground">{t('getStarted')}</p>
|
|
17
17
|
<div className="mt-8 p-4 rounded-lg bg-muted/50 border border-border text-left">
|