@shellui/core 0.5.3 → 0.6.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/README.md +2 -0
- package/package.json +6 -4
- package/schemas/shellui.config.schema.json +104 -64
- package/src/app.tsx +5 -3
- package/src/components/ContentView.tsx +14 -23
- package/src/components/LoadingOverlay.tsx +1 -1
- package/src/components/ui/sonner.spec.tsx +138 -0
- package/src/components/ui/sonner.tsx +5 -5
- package/src/components/ui/switch.tsx +1 -1
- package/src/features/admin/AdminView.tsx +14 -3
- package/src/features/ai/AiBridge.tsx +106 -0
- package/src/features/ai/AiUnavailableResponder.tsx +39 -0
- package/src/features/ai/README.md +52 -0
- package/src/features/ai/ShellAiHost.tsx +24 -0
- package/src/features/ai/adapters/ollama.ts +170 -0
- package/src/features/ai/adapters/promptApi.spec.ts +135 -0
- package/src/features/ai/adapters/promptApi.ts +222 -0
- package/src/features/ai/adapters/webllm.experimental.spec.ts +69 -0
- package/src/features/ai/adapters/webllm.spec.ts +527 -0
- package/src/features/ai/adapters/webllm.ts +142 -0
- package/src/features/ai/aiDisabledResponses.spec.ts +29 -0
- package/src/features/ai/aiDisabledResponses.ts +32 -0
- package/src/features/ai/browserInstallStore.spec.ts +58 -0
- package/src/features/ai/browserInstallStore.ts +76 -0
- package/src/features/ai/catalog.ts +31 -0
- package/src/features/ai/createRegistry.ts +83 -0
- package/src/features/ai/developHarness.spec.ts +108 -0
- package/src/features/ai/developHarness.ts +161 -0
- package/src/features/ai/engine/formatAiError.spec.ts +85 -0
- package/src/features/ai/engine/formatAiError.ts +132 -0
- package/src/features/ai/engine/mapInitProgress.ts +9 -0
- package/src/features/ai/engine/normalizeWebLlmModule.spec.ts +47 -0
- package/src/features/ai/engine/vite-worker.d.ts +6 -0
- package/src/features/ai/engine/webllm.worker.ts +51 -0
- package/src/features/ai/engine/webllmEngine.ts +1011 -0
- package/src/features/ai/handleRequest.spec.ts +288 -0
- package/src/features/ai/handleRequest.ts +325 -0
- package/src/features/ai/isAiFeatureEnabled.spec.ts +15 -0
- package/src/features/ai/isAiFeatureEnabled.ts +9 -0
- package/src/features/ai/promptApiSupport.spec.ts +64 -0
- package/src/features/ai/promptApiSupport.ts +117 -0
- package/src/features/ai/registry.spec.ts +100 -0
- package/src/features/ai/registry.ts +131 -0
- package/src/features/ai/status.spec.ts +92 -0
- package/src/features/ai/status.ts +85 -0
- package/src/features/ai/types.ts +100 -0
- package/src/features/ai/webLlmBrowserSupport.spec.ts +86 -0
- package/src/features/ai/webLlmBrowserSupport.ts +92 -0
- package/src/features/alertDialog/DialogContext.tsx +3 -1
- package/src/features/auth/AuthProvider.tsx +254 -39
- package/src/features/auth/backends/index.ts +8 -0
- package/src/features/auth/backends/shellui.spec.ts +201 -0
- package/src/features/auth/backends/shellui.ts +93 -16
- package/src/features/auth/backends/supabase.ts +8 -0
- package/src/features/auth/backends/types.ts +16 -1
- package/src/features/auth/components/LoginButton.tsx +26 -2
- package/src/features/auth/components/LoginView.tsx +114 -133
- package/src/features/auth/components/SessionLoadingView.tsx +21 -0
- package/src/features/auth/hooks/useAuth.tsx +12 -0
- package/src/features/auth/shellAccountRequests.ts +76 -0
- package/src/features/auth/utils/authRequestError.ts +4 -1
- package/src/features/auth/utils/authSessionPersistence.spec.ts +11 -0
- package/src/features/auth/utils/authSessionPersistence.ts +12 -0
- package/src/features/auth/utils/index.ts +4 -0
- package/src/features/auth/utils/resolveLoginSettings.spec.ts +33 -0
- package/src/features/auth/utils/resolveLoginSettings.ts +33 -0
- package/src/features/auth/utils/shareInFlight.spec.ts +41 -0
- package/src/features/auth/utils/shareInFlight.ts +14 -0
- package/src/features/config/ConfigProvider.ts +9 -1
- package/src/features/config/types.ts +43 -0
- package/src/features/layouts/appbar/AppBarLayout.tsx +8 -3
- package/src/features/layouts/filterNavigationForAuthState.spec.ts +41 -0
- package/src/features/layouts/floating/FloatingLayout.tsx +9 -4
- package/src/features/layouts/floating/layoutChromeStore.ts +3 -1
- package/src/features/layouts/sidebar/SidebarLayout.tsx +9 -4
- package/src/features/layouts/utils.ts +6 -2
- package/src/features/layouts/windows/WindowsLayout.tsx +8 -3
- package/src/features/messaging/MessagingSecurityBootstrap.tsx +6 -6
- package/src/features/security/trustedFrames.spec.ts +65 -0
- package/src/features/security/trustedFrames.ts +52 -0
- package/src/features/settings/SettingsIcons.tsx +17 -0
- package/src/features/settings/SettingsProvider.tsx +29 -4
- package/src/features/settings/SettingsRoutes.tsx +8 -0
- package/src/features/settings/SettingsView.tsx +21 -4
- package/src/features/settings/components/Ai.tsx +830 -0
- package/src/features/settings/components/Develop.tsx +4 -0
- package/src/features/settings/components/Storage.tsx +197 -32
- package/src/features/settings/components/UserSettingsPanel.tsx +160 -12
- package/src/features/settings/components/createUserSettingsRoute.tsx +4 -0
- package/src/features/settings/components/develop/AiTestTools.tsx +231 -0
- package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +54 -1
- package/src/features/settings/utils/buildSettingsForPropagation.ts +15 -1
- package/src/features/settings/utils/mergePreferencesIntoSettings.spec.ts +6 -0
- package/src/features/settings/utils/shouldShowStorageSettings.spec.ts +49 -0
- package/src/features/settings/utils/shouldShowStorageSettings.ts +19 -0
- package/src/features/storage/uploads/UploadToastCard.tsx +2 -442
- package/src/features/storage/uploads/UploadToaster.tsx +2 -44
- package/src/features/storage/uploads/uploadQueue.ts +128 -308
- package/src/features/storage/uploads/useUploadQueue.ts +7 -3
- package/src/features/transfers/TransferToastCard.tsx +467 -0
- package/src/features/transfers/TransferToaster.tsx +50 -0
- package/src/features/transfers/index.ts +33 -0
- package/src/features/transfers/transferQueue.spec.ts +97 -0
- package/src/features/transfers/transferQueue.ts +442 -0
- package/src/features/transfers/types.ts +38 -0
- package/src/features/transfers/useTransferQueue.ts +30 -0
- package/src/i18n/translations/en/common.json +46 -2
- package/src/i18n/translations/en/settings.json +151 -2
- package/src/i18n/translations/fr/common.json +46 -2
- package/src/i18n/translations/fr/settings.json +151 -2
- package/src/index.css +57 -4
- package/src/index.ts +1 -0
- package/src/routes/components/NavigationItemRoute.tsx +2 -1
|
@@ -34,14 +34,16 @@ import type { NavigationItem } from '../config/types';
|
|
|
34
34
|
import { cn } from '../../lib/utils';
|
|
35
35
|
import { useAuth } from '../auth/hooks/useAuth';
|
|
36
36
|
import { getLegalDocuments } from '../legal/legalDocuments';
|
|
37
|
-
import {
|
|
37
|
+
import { shouldShowStorageSettings } from './utils/shouldShowStorageSettings';
|
|
38
|
+
import { isAiFeatureEnabled } from '../ai/isAiFeatureEnabled';
|
|
38
39
|
|
|
39
40
|
export const SettingsView = () => {
|
|
40
41
|
const location = useLocation();
|
|
41
42
|
const navigate = useNavigate();
|
|
42
43
|
const { settings } = useSettings();
|
|
43
44
|
const { config } = useConfig();
|
|
44
|
-
const { user, session, logout, isAuthenticated } =
|
|
45
|
+
const { user, session, logout, isAuthenticated, supportsAccountDeletion, supportsProfileUpdate } =
|
|
46
|
+
useAuth();
|
|
45
47
|
const { t, i18n } = useTranslation('settings');
|
|
46
48
|
// Re-check isTauri after mount and after a short delay so we catch late-injected __TAURI__ in dev
|
|
47
49
|
const [isTauriEnv, setIsTauriEnv] = useState(() => isTauri());
|
|
@@ -85,11 +87,21 @@ export const SettingsView = () => {
|
|
|
85
87
|
if (getLegalDocuments(config).length === 0) {
|
|
86
88
|
routes = routes.filter((route) => route.path !== 'legal-documents');
|
|
87
89
|
}
|
|
88
|
-
if (!
|
|
90
|
+
if (!isAiFeatureEnabled(config)) {
|
|
91
|
+
routes = routes.filter((route) => route.path !== 'ai');
|
|
92
|
+
}
|
|
93
|
+
const aiEnabledForStorage = isAiFeatureEnabled(config) && settings.ai?.enabled !== false;
|
|
94
|
+
if (
|
|
95
|
+
!shouldShowStorageSettings({
|
|
96
|
+
config,
|
|
97
|
+
isAuthenticated,
|
|
98
|
+
aiEnabled: aiEnabledForStorage,
|
|
99
|
+
})
|
|
100
|
+
) {
|
|
89
101
|
routes = routes.filter((route) => route.path !== 'storage');
|
|
90
102
|
}
|
|
91
103
|
return routes;
|
|
92
|
-
}, [filteredRoutes, config, isAuthenticated]);
|
|
104
|
+
}, [filteredRoutes, config, isAuthenticated, settings.ai?.enabled]);
|
|
93
105
|
|
|
94
106
|
// Application settings from navigation items with settings URL
|
|
95
107
|
const applicationRoutes = useMemo(() => {
|
|
@@ -125,11 +137,15 @@ export const SettingsView = () => {
|
|
|
125
137
|
accessToken: session?.accessToken ?? null,
|
|
126
138
|
settingsAccessToken: settings.accessToken ?? null,
|
|
127
139
|
rawUserSettings: settings.user ?? null,
|
|
140
|
+
canDeleteAccount: supportsAccountDeletion,
|
|
141
|
+
canEditName: supportsProfileUpdate,
|
|
128
142
|
}),
|
|
129
143
|
[
|
|
130
144
|
user,
|
|
131
145
|
logout,
|
|
132
146
|
t,
|
|
147
|
+
supportsAccountDeletion,
|
|
148
|
+
supportsProfileUpdate,
|
|
133
149
|
settings.developerFeatures.enabled,
|
|
134
150
|
settings.accessToken,
|
|
135
151
|
settings.user,
|
|
@@ -158,6 +174,7 @@ export const SettingsView = () => {
|
|
|
158
174
|
),
|
|
159
175
|
...userRoute,
|
|
160
176
|
...settingsNavRoutes.filter((route) => route.path === 'storage'),
|
|
177
|
+
...settingsNavRoutes.filter((route) => route.path === 'ai'),
|
|
161
178
|
],
|
|
162
179
|
},
|
|
163
180
|
{
|