@shellui/core 0.3.1 → 0.4.0
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 +11 -1
- package/src/components/ui/dialog.tsx +26 -6
- package/src/components/ui/sonner.tsx +9 -5
- package/src/features/admin/AdminView.tsx +1 -20
- package/src/features/auth/AuthProvider.tsx +68 -13
- package/src/features/auth/backends/shellui.ts +8 -1
- package/src/features/auth/components/AccessPendingView.tsx +112 -0
- package/src/features/auth/components/LoginView.tsx +17 -0
- package/src/features/auth/components/OAuthCallbackView.tsx +211 -48
- package/src/features/auth/hooks/useAuth.tsx +8 -1
- package/src/features/auth/utils/authRequestError.spec.ts +52 -0
- package/src/features/auth/utils/authRequestError.ts +45 -0
- package/src/features/auth/utils/index.ts +7 -0
- package/src/features/auth/utils/isTokenAutoRefreshDisabled.spec.ts +71 -0
- package/src/features/auth/utils/isTokenAutoRefreshDisabled.ts +18 -0
- package/src/features/config/types.ts +46 -0
- package/src/features/layouts/AppLayout.tsx +3 -3
- package/src/features/layouts/OverlayShell.tsx +10 -6
- package/src/features/settings/SettingsIcons.tsx +35 -0
- package/src/features/settings/SettingsProvider.tsx +69 -4
- package/src/features/settings/SettingsRoutes.tsx +14 -6
- package/src/features/settings/SettingsView.tsx +11 -5
- package/src/features/settings/components/Advanced.tsx +117 -44
- package/src/features/settings/components/Develop.tsx +38 -0
- package/src/features/settings/components/Storage.tsx +138 -0
- package/src/features/settings/components/develop/StoragePickerTestButtons.tsx +148 -0
- package/src/features/settings/components/develop/UploadToastTestButton.tsx +29 -0
- package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +54 -0
- package/src/features/settings/utils/buildSettingsForPropagation.ts +34 -0
- package/src/features/settings/utils/toSettingsUser.spec.ts +4 -0
- package/src/features/settings/utils/toSettingsUser.ts +2 -0
- package/src/features/storage/StorageBridge.tsx +50 -0
- package/src/features/storage/StoragePickerContext.tsx +214 -0
- package/src/features/storage/api.spec.ts +303 -0
- package/src/features/storage/api.ts +414 -0
- package/src/features/storage/handleRequest.spec.ts +88 -0
- package/src/features/storage/handleRequest.ts +53 -0
- package/src/features/storage/quota.spec.ts +151 -0
- package/src/features/storage/quota.ts +104 -0
- package/src/features/storage/uploads/UploadToastCard.tsx +442 -0
- package/src/features/storage/uploads/UploadToaster.tsx +41 -0
- package/src/features/storage/uploads/handleTrackedUpload.spec.ts +170 -0
- package/src/features/storage/uploads/handleTrackedUpload.ts +97 -0
- package/src/features/storage/uploads/types.ts +24 -0
- package/src/features/storage/uploads/uploadQueue.spec.ts +118 -0
- package/src/features/storage/uploads/uploadQueue.ts +349 -0
- package/src/features/storage/uploads/useUploadQueue.ts +30 -0
- package/src/i18n/translations/en/common.json +33 -0
- package/src/i18n/translations/en/settings.json +47 -4
- package/src/i18n/translations/fr/common.json +33 -0
- package/src/i18n/translations/fr/settings.json +47 -4
- package/src/index.css +2 -1
- package/src/index.ts +2 -0
- package/src/lib/z-index.ts +9 -3
- package/src/service-worker/register.ts +4 -12
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import type { UploadItem, UploadItemStatus, UploadQueueSummary } from './types';
|
|
2
|
+
|
|
3
|
+
export const UPLOAD_TOAST_ID = 'shellui-upload-progress';
|
|
4
|
+
export const UPLOAD_TOAST_DEMO_MESSAGE = 'SHELLUI_UPLOAD_TOAST_DEMO';
|
|
5
|
+
|
|
6
|
+
type UploadListener = () => void;
|
|
7
|
+
|
|
8
|
+
type AddUploadInput = {
|
|
9
|
+
id?: string;
|
|
10
|
+
name: string;
|
|
11
|
+
path: string;
|
|
12
|
+
bucket: string;
|
|
13
|
+
size: number;
|
|
14
|
+
demo?: boolean;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const listeners = new Set<UploadListener>();
|
|
18
|
+
const abortControllers = new Map<string, AbortController>();
|
|
19
|
+
const demoTimers = new Map<string, ReturnType<typeof setInterval>>();
|
|
20
|
+
const demoStartTimeouts: ReturnType<typeof setTimeout>[] = [];
|
|
21
|
+
|
|
22
|
+
let items: UploadItem[] = [];
|
|
23
|
+
let expanded = false;
|
|
24
|
+
|
|
25
|
+
function emit(): void {
|
|
26
|
+
listeners.forEach((listener) => listener());
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function createId(): string {
|
|
30
|
+
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {
|
|
31
|
+
return crypto.randomUUID();
|
|
32
|
+
}
|
|
33
|
+
return `upload-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function patchItem(id: string, patch: Partial<UploadItem>): void {
|
|
37
|
+
const index = items.findIndex((item) => item.id === id);
|
|
38
|
+
if (index === -1) return;
|
|
39
|
+
items = items.map((item) => (item.id === id ? { ...item, ...patch } : item));
|
|
40
|
+
emit();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function clearDemoStartTimeouts(): void {
|
|
44
|
+
demoStartTimeouts.forEach((timeout) => clearTimeout(timeout));
|
|
45
|
+
demoStartTimeouts.length = 0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function clearDemoTimer(id: string): void {
|
|
49
|
+
const timer = demoTimers.get(id);
|
|
50
|
+
if (timer !== undefined) {
|
|
51
|
+
clearInterval(timer);
|
|
52
|
+
demoTimers.delete(id);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function subscribeUploadQueue(listener: UploadListener): () => void {
|
|
57
|
+
listeners.add(listener);
|
|
58
|
+
return () => {
|
|
59
|
+
listeners.delete(listener);
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function getUploadQueue(): UploadItem[] {
|
|
64
|
+
return items;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function isUploadToastExpanded(): boolean {
|
|
68
|
+
return expanded;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function setUploadToastExpanded(value: boolean): void {
|
|
72
|
+
if (expanded === value) return;
|
|
73
|
+
expanded = value;
|
|
74
|
+
emit();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function getUploadSummary(list: UploadItem[] = items): UploadQueueSummary {
|
|
78
|
+
const uploading = list.filter((item) => item.status === 'uploading').length;
|
|
79
|
+
const success = list.filter((item) => item.status === 'success').length;
|
|
80
|
+
const error = list.filter((item) => item.status === 'error').length;
|
|
81
|
+
const cancelled = list.filter((item) => item.status === 'cancelled').length;
|
|
82
|
+
const bytesUploaded = list.reduce((sum, item) => {
|
|
83
|
+
if (item.status === 'success') return sum + item.size;
|
|
84
|
+
if (item.status === 'uploading') {
|
|
85
|
+
return sum + Math.min(item.bytesUploaded, item.size || item.bytesUploaded);
|
|
86
|
+
}
|
|
87
|
+
return sum;
|
|
88
|
+
}, 0);
|
|
89
|
+
const bytesTotal = list.reduce((sum, item) => sum + item.size, 0);
|
|
90
|
+
const percent =
|
|
91
|
+
bytesTotal > 0
|
|
92
|
+
? Math.min(100, Math.max(0, Math.round((bytesUploaded / bytesTotal) * 100)))
|
|
93
|
+
: uploading > 0
|
|
94
|
+
? 0
|
|
95
|
+
: list.length > 0
|
|
96
|
+
? 100
|
|
97
|
+
: 0;
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
total: list.length,
|
|
101
|
+
uploading,
|
|
102
|
+
success,
|
|
103
|
+
error,
|
|
104
|
+
cancelled,
|
|
105
|
+
bytesUploaded,
|
|
106
|
+
bytesTotal,
|
|
107
|
+
percent,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function getItemPercent(item: UploadItem): number {
|
|
112
|
+
if (item.status === 'success') return 100;
|
|
113
|
+
if (item.size <= 0) return 0;
|
|
114
|
+
return Math.min(100, Math.max(0, Math.round((item.bytesUploaded / item.size) * 100)));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function addUpload(input: AddUploadInput): { id: string; signal: AbortSignal } {
|
|
118
|
+
const id = input.id ?? createId();
|
|
119
|
+
const existing = abortControllers.get(id);
|
|
120
|
+
existing?.abort();
|
|
121
|
+
clearDemoTimer(id);
|
|
122
|
+
|
|
123
|
+
const controller = new AbortController();
|
|
124
|
+
abortControllers.set(id, controller);
|
|
125
|
+
|
|
126
|
+
const next: UploadItem = {
|
|
127
|
+
id,
|
|
128
|
+
name: input.name,
|
|
129
|
+
path: input.path,
|
|
130
|
+
bucket: input.bucket,
|
|
131
|
+
size: Math.max(0, input.size),
|
|
132
|
+
bytesUploaded: 0,
|
|
133
|
+
status: 'uploading',
|
|
134
|
+
demo: input.demo,
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
items = [...items.filter((item) => item.id !== id), next];
|
|
138
|
+
emit();
|
|
139
|
+
return { id, signal: controller.signal };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function setUploadProgress(id: string, loaded: number, total?: number): void {
|
|
143
|
+
const item = items.find((entry) => entry.id === id);
|
|
144
|
+
if (!item || item.status !== 'uploading') return;
|
|
145
|
+
const size = total && total > 0 ? total : item.size;
|
|
146
|
+
patchItem(id, {
|
|
147
|
+
bytesUploaded: Math.max(0, loaded),
|
|
148
|
+
size: size > 0 ? size : item.size,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export function completeUpload(id: string): void {
|
|
153
|
+
const item = items.find((entry) => entry.id === id);
|
|
154
|
+
if (!item || item.status !== 'uploading') return;
|
|
155
|
+
abortControllers.delete(id);
|
|
156
|
+
clearDemoTimer(id);
|
|
157
|
+
patchItem(id, {
|
|
158
|
+
status: 'success',
|
|
159
|
+
bytesUploaded: item.size || item.bytesUploaded,
|
|
160
|
+
error: undefined,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export function failUpload(id: string, message: string): void {
|
|
165
|
+
const item = items.find((entry) => entry.id === id);
|
|
166
|
+
if (!item || item.status !== 'uploading') return;
|
|
167
|
+
abortControllers.delete(id);
|
|
168
|
+
clearDemoTimer(id);
|
|
169
|
+
patchItem(id, { status: 'error', error: message });
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export function markUploadCancelled(id: string): void {
|
|
173
|
+
if (!items.some((item) => item.id === id)) return;
|
|
174
|
+
abortControllers.delete(id);
|
|
175
|
+
clearDemoTimer(id);
|
|
176
|
+
patchItem(id, { status: 'cancelled' });
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Abort an in-progress upload and keep it visible as cancelled. */
|
|
180
|
+
export function interruptUpload(id: string): void {
|
|
181
|
+
const item = items.find((entry) => entry.id === id);
|
|
182
|
+
if (!item || item.status !== 'uploading') return;
|
|
183
|
+
abortControllers.get(id)?.abort();
|
|
184
|
+
markUploadCancelled(id);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Remove a finished (or cancelled) item from the toaster. */
|
|
188
|
+
export function removeUpload(id: string): void {
|
|
189
|
+
const item = items.find((entry) => entry.id === id);
|
|
190
|
+
if (!item) return;
|
|
191
|
+
if (item.status === 'uploading') {
|
|
192
|
+
abortControllers.get(id)?.abort();
|
|
193
|
+
}
|
|
194
|
+
abortControllers.delete(id);
|
|
195
|
+
clearDemoTimer(id);
|
|
196
|
+
const next = items.filter((entry) => entry.id !== id);
|
|
197
|
+
if (next.length === items.length) return;
|
|
198
|
+
items = next;
|
|
199
|
+
if (items.length === 0) expanded = false;
|
|
200
|
+
emit();
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function dismissFinishedUploads(): void {
|
|
204
|
+
const keep = items.filter((item) => item.status === 'uploading');
|
|
205
|
+
items.forEach((item) => {
|
|
206
|
+
if (item.status === 'uploading') return;
|
|
207
|
+
abortControllers.delete(item.id);
|
|
208
|
+
clearDemoTimer(item.id);
|
|
209
|
+
});
|
|
210
|
+
if (keep.length === items.length) return;
|
|
211
|
+
items = keep;
|
|
212
|
+
if (items.length === 0) expanded = false;
|
|
213
|
+
emit();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function interruptAllUploads(): void {
|
|
217
|
+
const uploading = items.filter((item) => item.status === 'uploading');
|
|
218
|
+
if (uploading.length === 0) return;
|
|
219
|
+
uploading.forEach((item) => {
|
|
220
|
+
abortControllers.get(item.id)?.abort();
|
|
221
|
+
markUploadCancelled(item.id);
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Close the toaster: cancel leftover uploads and hide the panel. */
|
|
226
|
+
export function closeUploadToaster(): void {
|
|
227
|
+
resetUploadQueue();
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export function resetUploadQueue(): void {
|
|
231
|
+
abortControllers.forEach((controller) => controller.abort());
|
|
232
|
+
abortControllers.clear();
|
|
233
|
+
demoTimers.forEach((timer) => clearInterval(timer));
|
|
234
|
+
demoTimers.clear();
|
|
235
|
+
clearDemoStartTimeouts();
|
|
236
|
+
items = [];
|
|
237
|
+
expanded = false;
|
|
238
|
+
emit();
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const DEMO_FILES: Array<{
|
|
242
|
+
name: string;
|
|
243
|
+
path: string;
|
|
244
|
+
bucket: string;
|
|
245
|
+
size: number;
|
|
246
|
+
durationMs: number;
|
|
247
|
+
outcome: Extract<UploadItemStatus, 'success' | 'error'>;
|
|
248
|
+
error?: string;
|
|
249
|
+
}> = [
|
|
250
|
+
{
|
|
251
|
+
name: 'quarterly-report.pdf',
|
|
252
|
+
path: 'docs/quarterly-report.pdf',
|
|
253
|
+
bucket: 'company',
|
|
254
|
+
size: 2_450_000,
|
|
255
|
+
durationMs: 3600,
|
|
256
|
+
outcome: 'success',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: 'team-offsite.jpg',
|
|
260
|
+
path: 'photos/team-offsite.jpg',
|
|
261
|
+
bucket: 'company',
|
|
262
|
+
size: 6_200_000,
|
|
263
|
+
durationMs: 7200,
|
|
264
|
+
outcome: 'success',
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
name: 'budget.xlsx',
|
|
268
|
+
path: 'docs/budget.xlsx',
|
|
269
|
+
bucket: 'company',
|
|
270
|
+
size: 840_000,
|
|
271
|
+
durationMs: 2400,
|
|
272
|
+
outcome: 'error',
|
|
273
|
+
error: 'Quota exceeded',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
name: 'archive.zip',
|
|
277
|
+
path: 'backup/archive.zip',
|
|
278
|
+
bucket: 'company',
|
|
279
|
+
size: 18_500_000,
|
|
280
|
+
durationMs: 9800,
|
|
281
|
+
outcome: 'success',
|
|
282
|
+
},
|
|
283
|
+
];
|
|
284
|
+
|
|
285
|
+
function clearDemoUploads(): void {
|
|
286
|
+
clearDemoStartTimeouts();
|
|
287
|
+
items
|
|
288
|
+
.filter((item) => item.demo)
|
|
289
|
+
.forEach((item) => {
|
|
290
|
+
abortControllers.get(item.id)?.abort();
|
|
291
|
+
abortControllers.delete(item.id);
|
|
292
|
+
clearDemoTimer(item.id);
|
|
293
|
+
});
|
|
294
|
+
items = items.filter((item) => !item.demo);
|
|
295
|
+
if (items.length === 0) expanded = false;
|
|
296
|
+
emit();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Ask the root shell to show the demo toaster (no-op network). Safe to call from iframes. */
|
|
300
|
+
export function requestUploadToastDemo(): void {
|
|
301
|
+
if (typeof window === 'undefined') return;
|
|
302
|
+
const message = { type: UPLOAD_TOAST_DEMO_MESSAGE, payload: {} };
|
|
303
|
+
if (window.parent !== window) {
|
|
304
|
+
window.parent.postMessage(message, '*');
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
window.postMessage(message, '*');
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Simulated uploads for the Develop panel — no network requests. */
|
|
311
|
+
export function startUploadToastDemo(): void {
|
|
312
|
+
clearDemoUploads();
|
|
313
|
+
expanded = false;
|
|
314
|
+
|
|
315
|
+
DEMO_FILES.forEach((spec, index) => {
|
|
316
|
+
const timeout = setTimeout(() => {
|
|
317
|
+
const { id, signal } = addUpload({
|
|
318
|
+
name: spec.name,
|
|
319
|
+
path: spec.path,
|
|
320
|
+
bucket: spec.bucket,
|
|
321
|
+
size: spec.size,
|
|
322
|
+
demo: true,
|
|
323
|
+
});
|
|
324
|
+
const startedAt = Date.now();
|
|
325
|
+
const timer = setInterval(() => {
|
|
326
|
+
if (signal.aborted) {
|
|
327
|
+
clearDemoTimer(id);
|
|
328
|
+
return;
|
|
329
|
+
}
|
|
330
|
+
const ratio = Math.min(1, (Date.now() - startedAt) / spec.durationMs);
|
|
331
|
+
setUploadProgress(id, Math.round(spec.size * ratio), spec.size);
|
|
332
|
+
if (ratio < 1) return;
|
|
333
|
+
clearDemoTimer(id);
|
|
334
|
+
if (spec.outcome === 'error') {
|
|
335
|
+
failUpload(id, spec.error || 'Upload failed');
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
completeUpload(id);
|
|
339
|
+
}, 80);
|
|
340
|
+
demoTimers.set(id, timer);
|
|
341
|
+
}, index * 180);
|
|
342
|
+
demoStartTimeouts.push(timeout);
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function isUploadSignalAborted(id: string, signal?: AbortSignal): boolean {
|
|
347
|
+
const item = items.find((entry) => entry.id === id);
|
|
348
|
+
return Boolean(signal?.aborted) || !item || item.status === 'cancelled';
|
|
349
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
getUploadQueue,
|
|
4
|
+
getUploadSummary,
|
|
5
|
+
isUploadToastExpanded,
|
|
6
|
+
subscribeUploadQueue,
|
|
7
|
+
} from './uploadQueue';
|
|
8
|
+
import type { UploadItem, UploadQueueSummary } from './types';
|
|
9
|
+
|
|
10
|
+
export function useUploadQueue(): {
|
|
11
|
+
items: UploadItem[];
|
|
12
|
+
summary: UploadQueueSummary;
|
|
13
|
+
expanded: boolean;
|
|
14
|
+
} {
|
|
15
|
+
const [items, setItems] = useState<UploadItem[]>(getUploadQueue);
|
|
16
|
+
const [expanded, setExpanded] = useState(isUploadToastExpanded);
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
return subscribeUploadQueue(() => {
|
|
20
|
+
setItems(getUploadQueue());
|
|
21
|
+
setExpanded(isUploadToastExpanded());
|
|
22
|
+
});
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
items,
|
|
27
|
+
summary: getUploadSummary(items),
|
|
28
|
+
expanded,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -31,5 +31,38 @@
|
|
|
31
31
|
"tryAgain": "Try again",
|
|
32
32
|
"goToHome": "Go to home",
|
|
33
33
|
"errorDetails": "Error details"
|
|
34
|
+
},
|
|
35
|
+
"uploads": {
|
|
36
|
+
"titleUploading_one": "Uploading {{count}} file",
|
|
37
|
+
"titleUploading_other": "Uploading {{count}} files",
|
|
38
|
+
"titleComplete_one": "{{count}} file uploaded",
|
|
39
|
+
"titleComplete_other": "{{count}} files uploaded",
|
|
40
|
+
"titleFailed_one": "{{count}} file failed",
|
|
41
|
+
"titleFailed_other": "{{count}} files failed",
|
|
42
|
+
"titleMixed": "{{success}} uploaded, {{errors}} failed",
|
|
43
|
+
"titleCancelled_one": "{{count}} file cancelled",
|
|
44
|
+
"titleCancelled_other": "{{count}} files cancelled",
|
|
45
|
+
"bytesProgress": "{{uploaded}} of {{total}}",
|
|
46
|
+
"filesProgress": "{{done}} of {{total}} done",
|
|
47
|
+
"progressPercent": "{{percent}}%",
|
|
48
|
+
"errorCount_one": "{{count}} error",
|
|
49
|
+
"errorCount_other": "{{count}} errors",
|
|
50
|
+
"cancelledCount_one": "{{count}} cancelled",
|
|
51
|
+
"cancelledCount_other": "{{count}} cancelled",
|
|
52
|
+
"expand": "Show files",
|
|
53
|
+
"collapse": "Hide files",
|
|
54
|
+
"dismiss": "Dismiss",
|
|
55
|
+
"closeAndCancel": "Cancel remaining uploads and close",
|
|
56
|
+
"cancelFile": "Cancel upload",
|
|
57
|
+
"removeFile": "Remove",
|
|
58
|
+
"cancelAll": "Cancel all",
|
|
59
|
+
"statusUploading": "Uploading",
|
|
60
|
+
"statusComplete": "Uploaded",
|
|
61
|
+
"statusError": "Failed",
|
|
62
|
+
"statusCancelled": "Cancelled"
|
|
63
|
+
},
|
|
64
|
+
"storagePicker": {
|
|
65
|
+
"title": "Select files or folders",
|
|
66
|
+
"description": "Choose items, then confirm."
|
|
34
67
|
}
|
|
35
68
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"advanced": "Advanced",
|
|
15
15
|
"dataPrivacy": "Data Privacy",
|
|
16
16
|
"legalDocuments": "Legal documents",
|
|
17
|
+
"storage": "Storage",
|
|
17
18
|
"develop": "Develop",
|
|
18
19
|
"serviceWorker": "Service Worker"
|
|
19
20
|
},
|
|
@@ -113,15 +114,19 @@
|
|
|
113
114
|
"description": "Allow this app to send error reports to help fix issues."
|
|
114
115
|
},
|
|
115
116
|
"developerFeatures": {
|
|
116
|
-
"label": "
|
|
117
|
-
"description": "
|
|
117
|
+
"label": "Developer mode",
|
|
118
|
+
"description": "Turn on developer mode to unlock technical tools and diagnostics in this app.",
|
|
119
|
+
"badge": "Active",
|
|
120
|
+
"hintDisabled": "When enabled, a Develop panel appears in Settings with logging, layout overrides, and other technical options.",
|
|
121
|
+
"hintEnabled": "Developer mode is on. Open the Develop panel in Settings for technical tools and diagnostics."
|
|
118
122
|
},
|
|
119
123
|
"dangerZone": {
|
|
120
124
|
"title": "Danger Zone",
|
|
121
|
-
"description": "
|
|
125
|
+
"description": "These actions permanently change or erase app data. Proceed with care.",
|
|
126
|
+
"badge": "Irreversible",
|
|
122
127
|
"reset": {
|
|
123
128
|
"title": "Reset All Data",
|
|
124
|
-
"warning": "This
|
|
129
|
+
"warning": "This permanently deletes your settings, preferences, and other app data stored on this device.",
|
|
125
130
|
"button": "Reset All Data",
|
|
126
131
|
"toast": {
|
|
127
132
|
"title": "Reset All Data?",
|
|
@@ -136,6 +141,18 @@
|
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
},
|
|
144
|
+
"storage": {
|
|
145
|
+
"description": "See how much of your storage quota is in use.",
|
|
146
|
+
"yourUsage": "Your usage",
|
|
147
|
+
"organization": "Organization",
|
|
148
|
+
"noPersonalLimit": "No personal limit. Your files count toward the organization quota.",
|
|
149
|
+
"usedOfMax": "{{used}} of {{max}}",
|
|
150
|
+
"usedOnly": "{{used}} used",
|
|
151
|
+
"signInRequired": "Sign in to see your storage usage.",
|
|
152
|
+
"loading": "Loading storage usage…",
|
|
153
|
+
"error": "Unable to load storage usage.",
|
|
154
|
+
"retry": "Try again"
|
|
155
|
+
},
|
|
139
156
|
"dataPrivacy": {
|
|
140
157
|
"title": "Data Privacy",
|
|
141
158
|
"description": "Manage your data privacy settings and cookie preferences.",
|
|
@@ -269,6 +286,13 @@
|
|
|
269
286
|
"description": "Enable logging for ShellUI Core operations"
|
|
270
287
|
}
|
|
271
288
|
},
|
|
289
|
+
"auth": {
|
|
290
|
+
"title": "Auth",
|
|
291
|
+
"disableTokenAutoRefresh": {
|
|
292
|
+
"label": "Disable token auto-refresh",
|
|
293
|
+
"description": "Stop refreshing the access token in the background so it can expire. Useful for testing expired-token handling."
|
|
294
|
+
}
|
|
295
|
+
},
|
|
272
296
|
"testing": {
|
|
273
297
|
"title": "Testing",
|
|
274
298
|
"description": "Test ShellUI features and functionality.",
|
|
@@ -387,6 +411,13 @@
|
|
|
387
411
|
"dialogClosed": "Dialog closed"
|
|
388
412
|
}
|
|
389
413
|
},
|
|
414
|
+
"uploadProgress": {
|
|
415
|
+
"title": "Upload progress toast",
|
|
416
|
+
"description": "Preview the upload toaster with sample files. Nothing is actually uploaded.",
|
|
417
|
+
"buttons": {
|
|
418
|
+
"simulate": "Test upload toast"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
390
421
|
"modalTesting": {
|
|
391
422
|
"title": "Modal Testing",
|
|
392
423
|
"description": "Opens the settings in a modal. Close with the × button or by clicking outside.",
|
|
@@ -405,6 +436,18 @@
|
|
|
405
436
|
"drawerBottomHalf": "Drawer bottom (60vh)",
|
|
406
437
|
"closeDrawer": "Close drawer"
|
|
407
438
|
}
|
|
439
|
+
},
|
|
440
|
+
"storagePicker": {
|
|
441
|
+
"title": "Storage picker",
|
|
442
|
+
"errorTitle": "Picker unavailable",
|
|
443
|
+
"error": "Could not open the storage picker.",
|
|
444
|
+
"remove": "Remove {{name}}",
|
|
445
|
+
"buttons": {
|
|
446
|
+
"folders": "Select folder",
|
|
447
|
+
"foldersMultiple": "Select folders",
|
|
448
|
+
"files": "Select files",
|
|
449
|
+
"filesAndFolders": "Select files and folders"
|
|
450
|
+
}
|
|
408
451
|
}
|
|
409
452
|
}
|
|
410
453
|
}
|
|
@@ -31,5 +31,38 @@
|
|
|
31
31
|
"tryAgain": "Réessayer",
|
|
32
32
|
"goToHome": "Retour à l'accueil",
|
|
33
33
|
"errorDetails": "Détails de l'erreur"
|
|
34
|
+
},
|
|
35
|
+
"uploads": {
|
|
36
|
+
"titleUploading_one": "Envoi de {{count}} fichier",
|
|
37
|
+
"titleUploading_other": "Envoi de {{count}} fichiers",
|
|
38
|
+
"titleComplete_one": "{{count}} fichier envoyé",
|
|
39
|
+
"titleComplete_other": "{{count}} fichiers envoyés",
|
|
40
|
+
"titleFailed_one": "{{count}} fichier a échoué",
|
|
41
|
+
"titleFailed_other": "{{count}} fichiers ont échoué",
|
|
42
|
+
"titleMixed": "{{success}} envoyés, {{errors}} en échec",
|
|
43
|
+
"titleCancelled_one": "{{count}} fichier annulé",
|
|
44
|
+
"titleCancelled_other": "{{count}} fichiers annulés",
|
|
45
|
+
"bytesProgress": "{{uploaded}} sur {{total}}",
|
|
46
|
+
"filesProgress": "{{done}} sur {{total}} terminés",
|
|
47
|
+
"progressPercent": "{{percent}} %",
|
|
48
|
+
"errorCount_one": "{{count}} erreur",
|
|
49
|
+
"errorCount_other": "{{count}} erreurs",
|
|
50
|
+
"cancelledCount_one": "{{count}} annulé",
|
|
51
|
+
"cancelledCount_other": "{{count}} annulés",
|
|
52
|
+
"expand": "Afficher les fichiers",
|
|
53
|
+
"collapse": "Masquer les fichiers",
|
|
54
|
+
"dismiss": "Fermer",
|
|
55
|
+
"closeAndCancel": "Annuler les envois en cours et fermer",
|
|
56
|
+
"cancelFile": "Interrompre l'envoi",
|
|
57
|
+
"removeFile": "Retirer",
|
|
58
|
+
"cancelAll": "Tout annuler",
|
|
59
|
+
"statusUploading": "Envoi en cours",
|
|
60
|
+
"statusComplete": "Envoyé",
|
|
61
|
+
"statusError": "Échec",
|
|
62
|
+
"statusCancelled": "Annulé"
|
|
63
|
+
},
|
|
64
|
+
"storagePicker": {
|
|
65
|
+
"title": "Sélectionner des fichiers ou dossiers",
|
|
66
|
+
"description": "Choisissez des éléments, puis confirmez."
|
|
34
67
|
}
|
|
35
68
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"advanced": "Avancé",
|
|
15
15
|
"dataPrivacy": "Confidentialité des données",
|
|
16
16
|
"legalDocuments": "Documents légaux",
|
|
17
|
+
"storage": "Stockage",
|
|
17
18
|
"develop": "Développement",
|
|
18
19
|
"serviceWorker": "Service Worker"
|
|
19
20
|
},
|
|
@@ -113,15 +114,19 @@
|
|
|
113
114
|
"description": "Autoriser cette application à envoyer des rapports d'erreurs pour aider à corriger les problèmes."
|
|
114
115
|
},
|
|
115
116
|
"developerFeatures": {
|
|
116
|
-
"label": "
|
|
117
|
-
"description": "Activez les outils et
|
|
117
|
+
"label": "Mode développeur",
|
|
118
|
+
"description": "Activez le mode développeur pour débloquer les outils techniques et les diagnostics dans l'application.",
|
|
119
|
+
"badge": "Actif",
|
|
120
|
+
"hintDisabled": "Une fois activé, un panneau Développer apparaît dans les Paramètres avec les journaux, les options de mise en page et d'autres outils techniques.",
|
|
121
|
+
"hintEnabled": "Le mode développeur est activé. Ouvrez le panneau Développer dans les Paramètres pour accéder aux outils techniques et diagnostics."
|
|
118
122
|
},
|
|
119
123
|
"dangerZone": {
|
|
120
124
|
"title": "Zone de danger",
|
|
121
|
-
"description": "
|
|
125
|
+
"description": "Ces actions modifient ou effacent définitivement les données de l'application. Procédez avec prudence.",
|
|
126
|
+
"badge": "Irréversible",
|
|
122
127
|
"reset": {
|
|
123
128
|
"title": "Réinitialiser toutes les données",
|
|
124
|
-
"warning": "Cela
|
|
129
|
+
"warning": "Cela supprime définitivement vos paramètres, préférences et autres données d'application stockées sur cet appareil.",
|
|
125
130
|
"button": "Réinitialiser toutes les données",
|
|
126
131
|
"toast": {
|
|
127
132
|
"title": "Réinitialiser toutes les données ?",
|
|
@@ -136,6 +141,18 @@
|
|
|
136
141
|
}
|
|
137
142
|
}
|
|
138
143
|
},
|
|
144
|
+
"storage": {
|
|
145
|
+
"description": "Consultez l'utilisation de votre quota de stockage.",
|
|
146
|
+
"yourUsage": "Votre utilisation",
|
|
147
|
+
"organization": "Organisation",
|
|
148
|
+
"noPersonalLimit": "Aucune limite personnelle. Vos fichiers comptent dans le quota de l'organisation.",
|
|
149
|
+
"usedOfMax": "{{used}} sur {{max}}",
|
|
150
|
+
"usedOnly": "{{used}} utilisés",
|
|
151
|
+
"signInRequired": "Connectez-vous pour voir votre utilisation du stockage.",
|
|
152
|
+
"loading": "Chargement de l'utilisation du stockage…",
|
|
153
|
+
"error": "Impossible de charger l'utilisation du stockage.",
|
|
154
|
+
"retry": "Réessayer"
|
|
155
|
+
},
|
|
139
156
|
"dataPrivacy": {
|
|
140
157
|
"title": "Confidentialité des données",
|
|
141
158
|
"description": "Gérez vos paramètres de confidentialité des données et vos préférences de cookies.",
|
|
@@ -269,6 +286,13 @@
|
|
|
269
286
|
"description": "Activez la journalisation pour les opérations ShellUI Core"
|
|
270
287
|
}
|
|
271
288
|
},
|
|
289
|
+
"auth": {
|
|
290
|
+
"title": "Authentification",
|
|
291
|
+
"disableTokenAutoRefresh": {
|
|
292
|
+
"label": "Désactiver le rafraîchissement automatique du jeton",
|
|
293
|
+
"description": "Arrête le rafraîchissement du jeton d'accès en arrière-plan pour qu'il puisse expirer. Utile pour tester la gestion des jetons expirés."
|
|
294
|
+
}
|
|
295
|
+
},
|
|
272
296
|
"testing": {
|
|
273
297
|
"title": "Tests",
|
|
274
298
|
"description": "Testez les fonctionnalités de ShellUI.",
|
|
@@ -387,6 +411,13 @@
|
|
|
387
411
|
"dialogClosed": "Dialogue fermé"
|
|
388
412
|
}
|
|
389
413
|
},
|
|
414
|
+
"uploadProgress": {
|
|
415
|
+
"title": "Toast de progression d'envoi",
|
|
416
|
+
"description": "Aperçu du toaster d'envoi avec des fichiers d'exemple. Rien n'est réellement envoyé.",
|
|
417
|
+
"buttons": {
|
|
418
|
+
"simulate": "Tester le toast d'envoi"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
390
421
|
"modalTesting": {
|
|
391
422
|
"title": "Tests du modal",
|
|
392
423
|
"description": "Ouvre les paramètres dans un modal. Fermez avec le bouton × ou en cliquant à l'extérieur.",
|
|
@@ -405,6 +436,18 @@
|
|
|
405
436
|
"drawerBottomHalf": "Tiroir bas (60vh)",
|
|
406
437
|
"closeDrawer": "Fermer le tiroir"
|
|
407
438
|
}
|
|
439
|
+
},
|
|
440
|
+
"storagePicker": {
|
|
441
|
+
"title": "Sélecteur de stockage",
|
|
442
|
+
"errorTitle": "Sélecteur indisponible",
|
|
443
|
+
"error": "Impossible d’ouvrir le sélecteur de stockage.",
|
|
444
|
+
"remove": "Retirer {{name}}",
|
|
445
|
+
"buttons": {
|
|
446
|
+
"folders": "Sélectionner un dossier",
|
|
447
|
+
"foldersMultiple": "Sélectionner des dossiers",
|
|
448
|
+
"files": "Sélectionner des fichiers",
|
|
449
|
+
"filesAndFolders": "Sélectionner fichiers et dossiers"
|
|
450
|
+
}
|
|
408
451
|
}
|
|
409
452
|
}
|
|
410
453
|
}
|
package/src/index.css
CHANGED
|
@@ -237,7 +237,8 @@
|
|
|
237
237
|
|
|
238
238
|
/* Toaster must receive pointer events when a modal has body pointer-events: none (e.g. Radix).
|
|
239
239
|
* Without this, pointerdown never fires on iPad when a modal is open. */
|
|
240
|
-
[data-sonner-toaster]
|
|
240
|
+
[data-sonner-toaster],
|
|
241
|
+
[data-upload-toast] {
|
|
241
242
|
pointer-events: auto !important;
|
|
242
243
|
}
|
|
243
244
|
|