@shellui/core 0.3.1 → 0.4.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.
Files changed (59) hide show
  1. package/package.json +2 -2
  2. package/src/app.tsx +11 -1
  3. package/src/components/ui/dialog.tsx +26 -6
  4. package/src/components/ui/sonner.tsx +9 -5
  5. package/src/features/admin/AdminView.tsx +1 -20
  6. package/src/features/auth/AuthProvider.tsx +68 -13
  7. package/src/features/auth/backends/shellui.ts +8 -1
  8. package/src/features/auth/components/AccessPendingView.tsx +112 -0
  9. package/src/features/auth/components/LoginView.tsx +17 -0
  10. package/src/features/auth/components/OAuthCallbackView.tsx +211 -48
  11. package/src/features/auth/hooks/useAuth.tsx +8 -1
  12. package/src/features/auth/utils/authRequestError.spec.ts +52 -0
  13. package/src/features/auth/utils/authRequestError.ts +45 -0
  14. package/src/features/auth/utils/index.ts +7 -0
  15. package/src/features/auth/utils/isTokenAutoRefreshDisabled.spec.ts +71 -0
  16. package/src/features/auth/utils/isTokenAutoRefreshDisabled.ts +18 -0
  17. package/src/features/config/types.ts +46 -0
  18. package/src/features/layouts/AppLayout.tsx +3 -3
  19. package/src/features/layouts/OverlayShell.tsx +10 -6
  20. package/src/features/modal/ModalContext.spec.ts +77 -0
  21. package/src/features/modal/ModalContext.tsx +12 -50
  22. package/src/features/modal/validateAndNormalizeUrl.ts +96 -0
  23. package/src/features/settings/SettingsIcons.tsx +35 -0
  24. package/src/features/settings/SettingsProvider.tsx +69 -4
  25. package/src/features/settings/SettingsRoutes.tsx +14 -6
  26. package/src/features/settings/SettingsView.tsx +11 -5
  27. package/src/features/settings/components/Advanced.tsx +117 -44
  28. package/src/features/settings/components/Develop.tsx +38 -0
  29. package/src/features/settings/components/Storage.tsx +138 -0
  30. package/src/features/settings/components/develop/StoragePickerTestButtons.tsx +148 -0
  31. package/src/features/settings/components/develop/UploadToastTestButton.tsx +29 -0
  32. package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +54 -0
  33. package/src/features/settings/utils/buildSettingsForPropagation.ts +34 -0
  34. package/src/features/settings/utils/toSettingsUser.spec.ts +4 -0
  35. package/src/features/settings/utils/toSettingsUser.ts +2 -0
  36. package/src/features/storage/StorageBridge.tsx +50 -0
  37. package/src/features/storage/StoragePickerContext.tsx +214 -0
  38. package/src/features/storage/api.spec.ts +303 -0
  39. package/src/features/storage/api.ts +414 -0
  40. package/src/features/storage/handleRequest.spec.ts +88 -0
  41. package/src/features/storage/handleRequest.ts +53 -0
  42. package/src/features/storage/quota.spec.ts +151 -0
  43. package/src/features/storage/quota.ts +104 -0
  44. package/src/features/storage/uploads/UploadToastCard.tsx +442 -0
  45. package/src/features/storage/uploads/UploadToaster.tsx +41 -0
  46. package/src/features/storage/uploads/handleTrackedUpload.spec.ts +170 -0
  47. package/src/features/storage/uploads/handleTrackedUpload.ts +97 -0
  48. package/src/features/storage/uploads/types.ts +24 -0
  49. package/src/features/storage/uploads/uploadQueue.spec.ts +118 -0
  50. package/src/features/storage/uploads/uploadQueue.ts +349 -0
  51. package/src/features/storage/uploads/useUploadQueue.ts +30 -0
  52. package/src/i18n/translations/en/common.json +33 -0
  53. package/src/i18n/translations/en/settings.json +47 -4
  54. package/src/i18n/translations/fr/common.json +33 -0
  55. package/src/i18n/translations/fr/settings.json +47 -4
  56. package/src/index.css +2 -1
  57. package/src/index.ts +2 -0
  58. package/src/lib/z-index.ts +9 -3
  59. package/src/service-worker/register.ts +4 -12
@@ -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 reloadApp = () => {
1087
+ const reloadOnce = () => {
1089
1088
  if (reloaded) return;
1090
1089
  reloaded = true;
1091
- // Use shellUI refresh message if available, otherwise fallback to window.location.reload
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
- reloadApp();
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
- reloadApp();
1115
+ reloadOnce();
1124
1116
  setTimeout(() => {
1125
1117
  isIntentionalUpdate = false;
1126
1118
  }, 1000);