@esmx/router 3.0.0-rc.54 → 3.0.0-rc.56
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/dist/location.mjs +2 -1
- package/dist/router.mjs +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +5 -5
- package/src/location.ts +3 -2
- package/src/router.ts +2 -2
- package/src/types.ts +1 -1
package/dist/location.mjs
CHANGED
|
@@ -4,7 +4,8 @@ export function normalizeURL(url, base) {
|
|
|
4
4
|
return url;
|
|
5
5
|
}
|
|
6
6
|
if (url.startsWith("//")) {
|
|
7
|
-
|
|
7
|
+
const protocol = base.protocol;
|
|
8
|
+
return new URL("".concat(protocol).concat(url));
|
|
8
9
|
}
|
|
9
10
|
if (url.startsWith("/")) {
|
|
10
11
|
const newBase = new URL(".", base);
|
package/dist/router.mjs
CHANGED
|
@@ -213,8 +213,6 @@ export class Router {
|
|
|
213
213
|
promiseResolve = resolve;
|
|
214
214
|
});
|
|
215
215
|
const router = new Router({
|
|
216
|
-
...this.options,
|
|
217
|
-
mode: RouterMode.memory,
|
|
218
216
|
rootStyle: {
|
|
219
217
|
position: "fixed",
|
|
220
218
|
top: "0",
|
|
@@ -227,6 +225,8 @@ export class Router {
|
|
|
227
225
|
alignItems: "center",
|
|
228
226
|
justifyContent: "center"
|
|
229
227
|
},
|
|
228
|
+
...this.options,
|
|
229
|
+
mode: RouterMode.memory,
|
|
230
230
|
root: void 0,
|
|
231
231
|
...layerOptions.routerOptions,
|
|
232
232
|
handleBackBoundary(router2) {
|
package/dist/types.d.ts
CHANGED
|
@@ -194,7 +194,7 @@ export interface RouterOptions {
|
|
|
194
194
|
apps?: RouterMicroApp;
|
|
195
195
|
normalizeURL?: (to: URL, from: URL | null) => URL;
|
|
196
196
|
fallback?: RouteHandleHook;
|
|
197
|
-
rootStyle?: Partial<CSSStyleDeclaration> | false;
|
|
197
|
+
rootStyle?: Partial<CSSStyleDeclaration> | false | null;
|
|
198
198
|
layer?: boolean;
|
|
199
199
|
zIndex?: number;
|
|
200
200
|
handleBackBoundary?: (router: Router) => void;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"template": "library",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"lint:js": "biome check --write --no-errors-on-unmatched",
|
|
6
|
-
"lint:css": "
|
|
6
|
+
"lint:css": "pnpm run lint:js",
|
|
7
7
|
"lint:type": "tsc --noEmit",
|
|
8
8
|
"test": "vitest run --pass-with-no-tests",
|
|
9
9
|
"coverage": "vitest run --coverage --pass-with-no-tests",
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"@types/node": "^24.0.0",
|
|
36
36
|
"@vitest/coverage-v8": "3.2.4",
|
|
37
37
|
"happy-dom": "^18.0.1",
|
|
38
|
-
"typescript": "5.
|
|
39
|
-
"unbuild": "3.
|
|
38
|
+
"typescript": "5.9.2",
|
|
39
|
+
"unbuild": "3.6.0",
|
|
40
40
|
"vitest": "3.2.4"
|
|
41
41
|
},
|
|
42
|
-
"version": "3.0.0-rc.
|
|
42
|
+
"version": "3.0.0-rc.56",
|
|
43
43
|
"type": "module",
|
|
44
44
|
"private": false,
|
|
45
45
|
"exports": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"template",
|
|
59
59
|
"public"
|
|
60
60
|
],
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "fe85a36d5b60665eb2a0e970b20071f581fc7bdc"
|
|
62
62
|
}
|
package/src/location.ts
CHANGED
|
@@ -14,8 +14,9 @@ export function normalizeURL(url: string | URL, base: URL): URL {
|
|
|
14
14
|
|
|
15
15
|
// Handle protocol-relative URLs (e.g., //example.com)
|
|
16
16
|
if (url.startsWith('//')) {
|
|
17
|
-
//
|
|
18
|
-
|
|
17
|
+
// Use the current base URL's protocol for security and consistency
|
|
18
|
+
const protocol = base.protocol;
|
|
19
|
+
return new URL(`${protocol}${url}`);
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
// Handle root-relative paths
|
package/src/router.ts
CHANGED
|
@@ -244,8 +244,6 @@ export class Router {
|
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
const router = new Router({
|
|
247
|
-
...this.options,
|
|
248
|
-
mode: RouterMode.memory,
|
|
249
247
|
rootStyle: {
|
|
250
248
|
position: 'fixed',
|
|
251
249
|
top: '0',
|
|
@@ -258,6 +256,8 @@ export class Router {
|
|
|
258
256
|
alignItems: 'center',
|
|
259
257
|
justifyContent: 'center'
|
|
260
258
|
},
|
|
259
|
+
...this.options,
|
|
260
|
+
mode: RouterMode.memory,
|
|
261
261
|
root: undefined,
|
|
262
262
|
...layerOptions.routerOptions,
|
|
263
263
|
handleBackBoundary(router) {
|
package/src/types.ts
CHANGED
|
@@ -267,7 +267,7 @@ export interface RouterOptions {
|
|
|
267
267
|
normalizeURL?: (to: URL, from: URL | null) => URL;
|
|
268
268
|
fallback?: RouteHandleHook;
|
|
269
269
|
|
|
270
|
-
rootStyle?: Partial<CSSStyleDeclaration> | false;
|
|
270
|
+
rootStyle?: Partial<CSSStyleDeclaration> | false | null;
|
|
271
271
|
layer?: boolean;
|
|
272
272
|
zIndex?: number;
|
|
273
273
|
handleBackBoundary?: (router: Router) => void;
|