@shellui/core 0.6.2 → 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.
- package/package.json +2 -2
- package/schemas/shellui.config.schema.json +147 -70
- package/src/app.tsx +2 -0
- package/src/components/ContentView.tsx +21 -30
- package/src/components/iframeUrlSafety.spec.ts +67 -0
- package/src/components/iframeUrlSafety.ts +50 -0
- package/src/components/ui/sidebar.tsx +11 -5
- package/src/features/admin/AdminView.tsx +9 -6
- package/src/features/auth/AuthProvider.tsx +49 -5
- package/src/features/auth/appBackend/AppBackendSessionHost.tsx +58 -0
- package/src/features/auth/appBackend/appBackendSessions.spec.ts +329 -0
- package/src/features/auth/appBackend/appBackendSessions.ts +443 -0
- package/src/features/auth/appBackend/childFrames.spec.ts +328 -0
- package/src/features/auth/appBackend/childFrames.ts +180 -0
- package/src/features/auth/appBackend/configSchema.spec.ts +41 -0
- package/src/features/auth/appBackend/frameAuth.ts +204 -0
- package/src/features/auth/appBackend/identity.spec.ts +201 -0
- package/src/features/auth/appBackend/identity.ts +173 -0
- package/src/features/auth/appBackend/silentSignIn.spec.ts +225 -0
- package/src/features/auth/appBackend/silentSignIn.ts +254 -0
- package/src/features/auth/appBackend/tokenExchange.spec.ts +98 -0
- package/src/features/auth/appBackend/tokenExchange.ts +76 -0
- package/src/features/auth/backends/shellui.spec.ts +51 -19
- package/src/features/auth/backends/shellui.ts +20 -5
- package/src/features/auth/backends/types.ts +7 -2
- package/src/features/auth/components/LoginView.tsx +40 -18
- package/src/features/auth/components/OAuthCallbackView.tsx +33 -4
- package/src/features/auth/utils/authRequestError.ts +3 -0
- package/src/features/auth/utils/buildOAuthSessionRedirectTo.spec.ts +42 -1
- package/src/features/auth/utils/buildOAuthSessionRedirectTo.ts +23 -0
- package/src/features/auth/utils/canRestoreStoredSession.spec.ts +29 -0
- package/src/features/auth/utils/canRestoreStoredSession.ts +12 -0
- package/src/features/auth/utils/index.ts +16 -1
- package/src/features/auth/utils/loginCancelTarget.spec.ts +73 -0
- package/src/features/auth/utils/loginCancelTarget.ts +45 -0
- package/src/features/auth/utils/loginPanelFrame.spec.ts +24 -0
- package/src/features/auth/utils/loginPanelFrame.ts +14 -0
- package/src/features/auth/utils/resolveSdkLoginRedirectPath.spec.ts +41 -0
- package/src/features/auth/utils/resolveSdkLoginRedirectPath.ts +31 -0
- package/src/features/auth/utils/webPkce.spec.ts +119 -0
- package/src/features/auth/utils/webPkce.ts +169 -0
- package/src/features/chromeActions/computeActionInsets.ts +7 -4
- package/src/features/config/types.ts +70 -3
- package/src/features/layouts/appbar/AppBarLayout.tsx +63 -30
- package/src/features/layouts/chrome/CollapsedDesktopTitlebar.tsx +12 -23
- package/src/features/layouts/chrome/ContentDragOverlay.tsx +5 -6
- package/src/features/layouts/chrome/DesktopChrome.tsx +37 -0
- package/src/features/layouts/chrome/DesktopHistoryButtons.tsx +15 -4
- package/src/features/layouts/chrome/MacStrip.tsx +33 -0
- package/src/features/layouts/chrome/constants.ts +33 -8
- package/src/features/layouts/chrome/index.ts +8 -0
- package/src/features/layouts/chrome/stripDragMap.ts +35 -0
- package/src/features/layouts/chrome/stripNoDrag.spec.tsx +103 -0
- package/src/features/layouts/chrome/useScrollHideChrome.ts +3 -8
- package/src/features/layouts/filterNavigationForAuthState.spec.ts +5 -3
- package/src/features/layouts/floating/FloatingBottomDock.tsx +199 -20
- package/src/features/layouts/floating/FloatingLayout.tsx +13 -8
- package/src/features/layouts/floating/FloatingSidebar.tsx +144 -70
- package/src/features/layouts/floating/computeFloatingInsets.ts +22 -4
- package/src/features/layouts/floating/useFloatingChrome.ts +3 -1
- package/src/features/layouts/floating/useSoftKeyboard.spec.ts +39 -0
- package/src/features/layouts/floating/useSoftKeyboard.ts +82 -0
- package/src/features/layouts/fullscreen/FullscreenLayout.tsx +38 -10
- package/src/features/layouts/sidebar/NavigationContent.tsx +14 -6
- package/src/features/layouts/sidebar/SidebarIcons.tsx +3 -9
- package/src/features/layouts/sidebar/SidebarInner.tsx +50 -39
- package/src/features/layouts/sidebar/SidebarLayout.tsx +8 -11
- package/src/features/layouts/utils.ts +4 -3
- package/src/features/layouts/windows/DesktopDots.tsx +76 -0
- package/src/features/layouts/windows/WindowsLayout.tsx +184 -125
- package/src/features/layouts/windows/deskDots.spec.ts +52 -0
- package/src/features/layouts/windows/deskDots.ts +314 -0
- package/src/features/settings/SettingsProvider.tsx +198 -29
- package/src/features/settings/utils/buildSettingsForPropagation.spec.ts +379 -4
- package/src/features/settings/utils/buildSettingsForPropagation.ts +65 -39
- package/src/features/theme/applyTheme.ts +8 -0
- package/src/features/theme/navContrast.spec.ts +49 -0
- package/src/features/theme/navContrast.ts +108 -0
- package/src/features/transfers/transferQueue.spec.ts +6 -2
- package/src/i18n/translations/en/common.json +27 -0
- package/src/i18n/translations/fr/common.json +27 -0
- package/src/index.css +935 -46
- package/src/index.ts +2 -0
- package/src/routes/hooks/useNavigationItems.ts +14 -3
- package/src/routes/hooks/withShellSearch.spec.ts +13 -0
package/src/index.ts
CHANGED
|
@@ -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
|
-
|
|
75
|
-
|
|
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
|
+
});
|