@vertesia/ui 1.3.0-dev.20260621.071017Z → 1.3.0-dev.20260622.054226Z
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/lib/router/Router.d.ts.map +1 -1
- package/lib/router/Router.js +15 -5
- package/lib/router/Router.js.map +1 -1
- package/lib/shell/login/SigninScreen.js +9 -1
- package/lib/shell/login/SigninScreen.js.map +1 -1
- package/lib/vertesia-ui-router.js +1 -1
- package/lib/vertesia-ui-router.js.map +1 -1
- package/lib/vertesia-ui-shell.js +1 -1
- package/lib/vertesia-ui-shell.js.map +1 -1
- package/package.json +6 -6
- package/src/router/Router.tsx +14 -5
- package/src/shell/login/SigninScreen.tsx +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertesia/ui",
|
|
3
|
-
"version": "1.3.0-dev.
|
|
3
|
+
"version": "1.3.0-dev.20260622.054226Z",
|
|
4
4
|
"description": "Vertesia UI components and and hooks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"vega": "^6.2.0",
|
|
91
91
|
"vega-embed": "^7.1.0",
|
|
92
92
|
"vega-lite": "^6.4.3",
|
|
93
|
-
"@vertesia/common": "1.3.0-dev.
|
|
94
|
-
"@vertesia/fusion-ux": "1.3.0-dev.
|
|
95
|
-
"@vertesia/
|
|
96
|
-
"@vertesia/
|
|
93
|
+
"@vertesia/common": "1.3.0-dev.20260622.054226Z",
|
|
94
|
+
"@vertesia/fusion-ux": "1.3.0-dev.20260622.054226Z",
|
|
95
|
+
"@vertesia/client": "1.3.0-dev.20260622.054226Z",
|
|
96
|
+
"@vertesia/json": "1.3.0-dev.20260622.054226Z"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@rollup/plugin-commonjs": "^29.0.3",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"url": "https://github.com/vertesia/composableai.git",
|
|
186
186
|
"directory": "packages/ui"
|
|
187
187
|
},
|
|
188
|
-
"gitHead": "
|
|
188
|
+
"gitHead": "5de8a6d01d8d6631b32ec7d467e81fd16cda1b0d",
|
|
189
189
|
"scripts": {
|
|
190
190
|
"build": "rm -rf ./lib ./tsconfig.tsbuildinfo && tsc --build && pnpm exec rollup -c",
|
|
191
191
|
"lint": "biome lint src && pnpm run check:rtl-classes",
|
package/src/router/Router.tsx
CHANGED
|
@@ -187,11 +187,20 @@ export function useNavigate() {
|
|
|
187
187
|
|
|
188
188
|
export function useRouterBasePath() {
|
|
189
189
|
const { router } = useRouterContext();
|
|
190
|
-
//
|
|
191
|
-
//
|
|
192
|
-
//
|
|
193
|
-
//
|
|
194
|
-
|
|
190
|
+
// The base path apps prepend to build absolute in-app links (e.g. `${base}/items/${id}`). It MUST
|
|
191
|
+
// include the served `<base href>` mount so links stay on the mount and match the full
|
|
192
|
+
// `useLocation().pathname` (which carries the mount). `getMountBasename()` is '' for the
|
|
193
|
+
// origin-served Studio UI and the mount (no trailing slash) for gateway-served apps.
|
|
194
|
+
const mount = getMountBasename();
|
|
195
|
+
if (router instanceof NestedRouter) {
|
|
196
|
+
// NestedRouter.basePath is relative to the parent router, which sits at the mount, so it must
|
|
197
|
+
// be mount-prefixed too. A bare nested base of '/' (an app whose NestedRouterProvider has no
|
|
198
|
+
// basePath) would otherwise make `${base}/items` resolve to `//items` — a protocol-relative
|
|
199
|
+
// URL that escapes the app. Origin-served Studio (mount '') keeps the raw nested basePath.
|
|
200
|
+
if (!mount) return router.basePath;
|
|
201
|
+
return router.basePath === '/' ? mount : joinPath(mount, router.basePath);
|
|
202
|
+
}
|
|
203
|
+
return mount;
|
|
195
204
|
}
|
|
196
205
|
|
|
197
206
|
type UseParamsReturn<T> = T extends string ? string : Record<string, string>;
|
|
@@ -88,7 +88,15 @@ function SigninScreenImpl({
|
|
|
88
88
|
|
|
89
89
|
useEffect(() => {
|
|
90
90
|
if (!preservePath) {
|
|
91
|
-
|
|
91
|
+
// Reset to the app's mount root, not the bare origin. A gateway-mounted app carries a
|
|
92
|
+
// served `<base href>` deep mount; collapsing to '/' drops the app off that mount (the
|
|
93
|
+
// bare origin serves no app) and the address bar can no longer be reloaded. This effect
|
|
94
|
+
// also flashes briefly for already-authenticated users during the loading transition, so
|
|
95
|
+
// a bare '/' here loses the URL even on a normal login. Deriving the root from
|
|
96
|
+
// `document.baseURI` keeps it inside the mount; for the origin-served Studio UI the
|
|
97
|
+
// pathname is '/', so the behavior is unchanged.
|
|
98
|
+
const mountRoot = new URL(document.baseURI).pathname || '/';
|
|
99
|
+
history.replaceState({}, '', mountRoot);
|
|
92
100
|
}
|
|
93
101
|
}, [preservePath]);
|
|
94
102
|
|