@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
package/src/lib/z-index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Central z-index scale for overlay layers.
|
|
3
|
-
* Order (bottom to top): modal/drawer → toast → alert-dialog.
|
|
3
|
+
* Order (bottom to top): modal/drawer → toast → tooltip → alert-dialog.
|
|
4
4
|
* Use these constants everywhere so stacking stays consistent.
|
|
5
5
|
*/
|
|
6
6
|
export const Z_INDEX = {
|
|
@@ -9,16 +9,22 @@ export const Z_INDEX = {
|
|
|
9
9
|
/** Modal overlay and content (settings panel, etc.) */
|
|
10
10
|
MODAL_OVERLAY: 10000,
|
|
11
11
|
MODAL_CONTENT: 10001,
|
|
12
|
-
/** Tooltip content (above modals so tooltips show over dialogs if needed) */
|
|
13
|
-
TOOLTIP: 10002,
|
|
14
12
|
/** Drawer overlay and content (slide-out panels; same level as modal) */
|
|
15
13
|
DRAWER_OVERLAY: 10000,
|
|
16
14
|
DRAWER_CONTENT: 10001,
|
|
17
15
|
/** Toasts (above modals so they stay clickable when modal is open) */
|
|
18
16
|
TOAST: 10100,
|
|
17
|
+
/** Tooltip content (above toasts so labels on the upload toaster stay visible) */
|
|
18
|
+
TOOLTIP: 10150,
|
|
19
19
|
/** Alert dialog overlay and content (confirmations; above toasts) */
|
|
20
20
|
ALERT_DIALOG_OVERLAY: 10200,
|
|
21
21
|
ALERT_DIALOG_CONTENT: 10201,
|
|
22
|
+
/**
|
|
23
|
+
* Storage file/folder picker (stacks above the generic URL modal so Develop
|
|
24
|
+
* inside Settings can open a picker without replacing settings).
|
|
25
|
+
*/
|
|
26
|
+
STORAGE_PICKER_OVERLAY: 10050,
|
|
27
|
+
STORAGE_PICKER_CONTENT: 10051,
|
|
22
28
|
/** Cookie consent (above everything to ensure visibility) */
|
|
23
29
|
COOKIE_CONSENT_OVERLAY: 10300,
|
|
24
30
|
COOKIE_CONSENT_CONTENT: 10301,
|
|
@@ -1049,7 +1049,6 @@ export async function updateServiceWorker(): Promise<void> {
|
|
|
1049
1049
|
// This prevents the service worker from being disabled after refresh
|
|
1050
1050
|
// The user explicitly clicked "Install Now", so we must keep the service worker enabled
|
|
1051
1051
|
if (typeof window !== 'undefined') {
|
|
1052
|
-
const STORAGE_KEY = 'shellui:settings';
|
|
1053
1052
|
try {
|
|
1054
1053
|
const stored = localStorage.getItem(STORAGE_KEY);
|
|
1055
1054
|
if (stored) {
|
|
@@ -1085,22 +1084,15 @@ export async function updateServiceWorker(): Promise<void> {
|
|
|
1085
1084
|
|
|
1086
1085
|
// Set up reload handler before sending skip waiting
|
|
1087
1086
|
let reloaded = false;
|
|
1088
|
-
const
|
|
1087
|
+
const reloadOnce = () => {
|
|
1089
1088
|
if (reloaded) return;
|
|
1090
1089
|
reloaded = true;
|
|
1091
|
-
|
|
1092
|
-
const sent = shellui.sendMessageToParent({
|
|
1093
|
-
type: 'SHELLUI_REFRESH_PAGE',
|
|
1094
|
-
payload: {},
|
|
1095
|
-
});
|
|
1096
|
-
if (!sent) {
|
|
1097
|
-
window.location.reload();
|
|
1098
|
-
}
|
|
1090
|
+
reloadApp();
|
|
1099
1091
|
};
|
|
1100
1092
|
|
|
1101
1093
|
// Add one-time listener for controlling event (Workbox or native controllerchange)
|
|
1102
1094
|
const updateControllingHandler = () => {
|
|
1103
|
-
|
|
1095
|
+
reloadOnce();
|
|
1104
1096
|
wb?.removeEventListener('controlling', updateControllingHandler);
|
|
1105
1097
|
// Reset flag after reload is triggered
|
|
1106
1098
|
setTimeout(() => {
|
|
@@ -1120,7 +1112,7 @@ export async function updateServiceWorker(): Promise<void> {
|
|
|
1120
1112
|
// Fallback: reload if controlling event doesn't fire within 2 seconds
|
|
1121
1113
|
setTimeout(() => {
|
|
1122
1114
|
wb?.removeEventListener('controlling', updateControllingHandler);
|
|
1123
|
-
|
|
1115
|
+
reloadOnce();
|
|
1124
1116
|
setTimeout(() => {
|
|
1125
1117
|
isIntentionalUpdate = false;
|
|
1126
1118
|
}, 1000);
|