@shellui/core 0.7.0-alpha.1 → 0.7.0-alpha.10

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 (69) hide show
  1. package/package.json +2 -2
  2. package/schemas/shellui.config.schema.json +37 -4
  3. package/src/components/ContentView.tsx +19 -8
  4. package/src/components/ui/sidebar.tsx +11 -5
  5. package/src/features/admin/AdminView.tsx +9 -6
  6. package/src/features/auth/AuthProvider.tsx +25 -4
  7. package/src/features/auth/appBackend/appBackendSessions.spec.ts +134 -0
  8. package/src/features/auth/appBackend/appBackendSessions.ts +168 -17
  9. package/src/features/auth/appBackend/childFrames.spec.ts +328 -0
  10. package/src/features/auth/appBackend/childFrames.ts +180 -0
  11. package/src/features/auth/appBackend/frameAuth.ts +47 -10
  12. package/src/features/auth/appBackend/silentSignIn.spec.ts +18 -0
  13. package/src/features/auth/appBackend/silentSignIn.ts +15 -1
  14. package/src/features/auth/appBackend/tokenExchange.spec.ts +98 -0
  15. package/src/features/auth/appBackend/tokenExchange.ts +76 -0
  16. package/src/features/auth/components/OAuthCallbackView.tsx +7 -5
  17. package/src/features/auth/utils/buildOAuthSessionRedirectTo.spec.ts +42 -1
  18. package/src/features/auth/utils/buildOAuthSessionRedirectTo.ts +23 -0
  19. package/src/features/auth/utils/canRestoreStoredSession.spec.ts +29 -0
  20. package/src/features/auth/utils/canRestoreStoredSession.ts +12 -0
  21. package/src/features/auth/utils/index.ts +7 -1
  22. package/src/features/auth/utils/resolveSdkLoginRedirectPath.spec.ts +41 -0
  23. package/src/features/auth/utils/resolveSdkLoginRedirectPath.ts +31 -0
  24. package/src/features/auth/utils/webPkce.spec.ts +23 -0
  25. package/src/features/auth/utils/webPkce.ts +23 -6
  26. package/src/features/chromeActions/computeActionInsets.ts +7 -4
  27. package/src/features/config/types.ts +30 -4
  28. package/src/features/layouts/appbar/AppBarLayout.tsx +63 -30
  29. package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +12 -23
  30. package/src/features/layouts/chrome/ContentDragOverlay.tsx +5 -6
  31. package/src/features/layouts/chrome/DesktopChrome.tsx +37 -0
  32. package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +15 -4
  33. package/src/features/layouts/chrome/MacStrip.tsx +33 -0
  34. package/src/features/layouts/chrome/constants.ts +33 -8
  35. package/src/features/layouts/chrome/index.ts +8 -0
  36. package/src/features/layouts/chrome/stripDragMap.ts +35 -0
  37. package/src/features/layouts/chrome/stripNoDrag.spec.tsx +103 -0
  38. package/src/features/layouts/chrome/useScrollHideChrome.ts +3 -8
  39. package/src/features/layouts/filterNavigationForAuthState.spec.ts +5 -3
  40. package/src/features/layouts/floating/FloatingBottomDock.tsx +199 -20
  41. package/src/features/layouts/floating/FloatingLayout.tsx +13 -8
  42. package/src/features/layouts/floating/FloatingSidebar.tsx +144 -70
  43. package/src/features/layouts/floating/computeFloatingInsets.ts +22 -4
  44. package/src/features/layouts/floating/useFloatingChrome.ts +3 -1
  45. package/src/features/layouts/floating/useSoftKeyboard.spec.ts +39 -0
  46. package/src/features/layouts/floating/useSoftKeyboard.ts +82 -0
  47. package/src/features/layouts/fullscreen/FullscreenLayout.tsx +38 -10
  48. package/src/features/layouts/sidebar/NavigationContent.tsx +14 -6
  49. package/src/features/layouts/sidebar/SidebarIcons.tsx +3 -9
  50. package/src/features/layouts/sidebar/SidebarInner.tsx +50 -39
  51. package/src/features/layouts/sidebar/SidebarLayout.tsx +8 -11
  52. package/src/features/layouts/utils.ts +4 -3
  53. package/src/features/layouts/windows/DesktopDots.tsx +76 -0
  54. package/src/features/layouts/windows/WindowsLayout.tsx +184 -125
  55. package/src/features/layouts/windows/deskDots.spec.ts +52 -0
  56. package/src/features/layouts/windows/deskDots.ts +314 -0
  57. package/src/features/settings/SettingsProvider.tsx +158 -2
  58. package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +8 -7
  59. package/src/features/settings/utils/buildSettingsForPropagation.ts +4 -6
  60. package/src/features/theme/applyTheme.ts +8 -0
  61. package/src/features/theme/navContrast.spec.ts +49 -0
  62. package/src/features/theme/navContrast.ts +108 -0
  63. package/src/features/transfers/transferQueue.spec.ts +6 -2
  64. package/src/i18n/translations/en/common.json +25 -0
  65. package/src/i18n/translations/fr/common.json +25 -0
  66. package/src/index.css +935 -46
  67. package/src/index.ts +1 -0
  68. package/src/routes/hooks/useNavigationItems.ts +14 -3
  69. package/src/routes/hooks/withShellSearch.spec.ts +13 -0
package/src/index.ts CHANGED
@@ -27,6 +27,7 @@ export type {
27
27
  BackendType,
28
28
  BackendConfig,
29
29
  AppBackendConfig,
30
+ ChildFramesConfig,
30
31
  AuthConfig,
31
32
  AdministrationConfig,
32
33
  StorageConfig,
@@ -61,7 +61,7 @@ export function useNavigationItems() {
61
61
  const navHashPath = getHashPathFromUrl(navigationItem.url).replace(/^\/+|\/+$/g, '');
62
62
  const segments = [navHashPath, subPath].filter(Boolean);
63
63
  const fullHashPath = `/${segments.join('/')}`;
64
- return `${base}#${fullHashPath}`;
64
+ return `${base}#${fullHashPath}${location.search}`;
65
65
  }
66
66
 
67
67
  let finalUrl = navigationItem.url;
@@ -71,8 +71,9 @@ export function useNavigationItems() {
71
71
  : `${navigationItem.url}/`;
72
72
  finalUrl = `${baseUrl}${subPath}`;
73
73
  }
74
- return finalUrl;
75
- }, [navigationItem, location.pathname]);
74
+ // Deep links keep their query (`/app/users?page=2` opens the app at `?page=2`).
75
+ return withShellSearch(finalUrl, location.search);
76
+ }, [navigationItem, location.pathname, location.search]);
76
77
 
77
78
  return {
78
79
  url,
@@ -82,3 +83,13 @@ export function useNavigationItems() {
82
83
  navigationItems,
83
84
  };
84
85
  }
86
+
87
+ /** Adds the shell query to an app URL, before any hash. */
88
+ export function withShellSearch(url: string, search: string): string {
89
+ const query = search.replace(/^\?/, '');
90
+ if (!query) return url;
91
+ const hashAt = url.indexOf('#');
92
+ const beforeHash = hashAt >= 0 ? url.slice(0, hashAt) : url;
93
+ const hash = hashAt >= 0 ? url.slice(hashAt) : '';
94
+ return `${beforeHash}${beforeHash.includes('?') ? '&' : '?'}${query}${hash}`;
95
+ }
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { withShellSearch } from './useNavigationItems';
3
+
4
+ describe('withShellSearch', () => {
5
+ it('keeps the deep-link query', () => {
6
+ expect(withShellSearch('/app/users/7', '?tab=x')).toBe('/app/users/7?tab=x');
7
+ expect(withShellSearch('https://a.example/x?a=1', '?b=2')).toBe('https://a.example/x?a=1&b=2');
8
+ expect(withShellSearch('https://a.example/#/users', '?b=2')).toBe(
9
+ 'https://a.example/?b=2#/users',
10
+ );
11
+ expect(withShellSearch('/app', '')).toBe('/app');
12
+ });
13
+ });