nexa-router 0.9.0 → 0.11.0
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/index.d.ts +12 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +48 -36
- package/dist/index.js.map +1 -1
- package/dist/route.d.ts +14 -1
- package/dist/route.d.ts.map +1 -1
- package/dist/route.js +49 -9
- package/dist/route.js.map +1 -1
- package/dist/view.d.ts.map +1 -1
- package/dist/view.js +19 -11
- package/dist/view.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RouteDef, type Guard } from './route';
|
|
2
2
|
import { type Component } from 'nexa-runtime';
|
|
3
|
-
export type { RouteDef, Guard } from './route';
|
|
4
|
-
export { matchPath } from './route';
|
|
3
|
+
export type { RouteDef, MatchedRoute, Guard } from './route';
|
|
4
|
+
export { matchPath, matchRoutes, ROUTER_DEPTH_KEY } from './route';
|
|
5
5
|
export { Link } from './link';
|
|
6
6
|
export { createGuards } from './guards';
|
|
7
7
|
export { RouterView } from './view';
|
|
@@ -21,7 +21,10 @@ type RouterConfig = {
|
|
|
21
21
|
beforeEach: Guard[];
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
type ResolvedRoute =
|
|
24
|
+
export type ResolvedRoute = {
|
|
25
|
+
route: RouteDef;
|
|
26
|
+
path: string;
|
|
27
|
+
params: Record<string, string>;
|
|
25
28
|
component: Component | LazyComponent;
|
|
26
29
|
loaded: boolean;
|
|
27
30
|
};
|
|
@@ -29,11 +32,16 @@ export declare function createRouter(config: RouterConfig): {
|
|
|
29
32
|
navigate: (path: string) => Promise<void>;
|
|
30
33
|
beforeEach: (guard: Guard) => void;
|
|
31
34
|
currentRoute: import("nexa-reactivity").Signal<ResolvedRoute | null>;
|
|
35
|
+
currentRouteChain: import("nexa-reactivity").Signal<ResolvedRoute[] | null>;
|
|
32
36
|
currentPath: import("nexa-reactivity").Signal<string>;
|
|
33
37
|
params: import("nexa-reactivity").Signal<Record<string, string>>;
|
|
34
38
|
query: import("nexa-reactivity").Signal<Record<string, string>>;
|
|
35
39
|
loading: import("nexa-reactivity").Signal<boolean>;
|
|
36
|
-
loadComponent: (route:
|
|
40
|
+
loadComponent: (route: {
|
|
41
|
+
path: string;
|
|
42
|
+
component?: RouteComponent | null;
|
|
43
|
+
loaded: boolean;
|
|
44
|
+
}) => Promise<Component | null>;
|
|
37
45
|
scrollPositions: Map<string, number>;
|
|
38
46
|
};
|
|
39
47
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,QAAQ,EAAqB,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/F,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAEnC,KAAK,aAAa,GAAG,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,CAAA;AAC1D,KAAK,cAAc,GAAG,SAAS,GAAG,aAAa,CAAA;AAE/C,wBAAgB,IAAI,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IAAE,OAAO,EAAE,SAAS,CAAA;CAAE,CAAC,GAAG,aAAa,CAErF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG;QAAE,SAAS,CAAC,EAAE,cAAc,CAAA;KAAE,CAAC,EAAE,CAAA;IACxE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,MAAM,CAAC,EAAE;QAAE,UAAU,EAAE,KAAK,EAAE,CAAA;KAAE,CAAA;CACjC,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,SAAS,EAAE,SAAS,GAAG,aAAa,CAAA;IACpC,MAAM,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY;qBAyEjB,MAAM;wBAJT,KAAK;;;;;;;2BAbI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,KAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;;EA4DrI"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { signal, computed } from 'nexa-reactivity';
|
|
2
|
-
import {
|
|
3
|
-
export { matchPath } from './route';
|
|
2
|
+
import { matchRoutes, parseQuery } from './route';
|
|
3
|
+
export { matchPath, matchRoutes, ROUTER_DEPTH_KEY } from './route';
|
|
4
4
|
export { Link } from './link';
|
|
5
5
|
export { createGuards } from './guards';
|
|
6
6
|
export { RouterView } from './view';
|
|
@@ -9,53 +9,64 @@ export function lazy(middleware) {
|
|
|
9
9
|
}
|
|
10
10
|
export function createRouter(config) {
|
|
11
11
|
const currentPath = signal(window.location.pathname + window.location.search);
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const rawQuery = computed(() => {
|
|
13
|
+
return currentPath.value.includes('?') ? currentPath.value.split('?')[1] || '' : '';
|
|
14
|
+
});
|
|
15
|
+
const query = computed(() => parseQuery(rawQuery.value));
|
|
14
16
|
const guards = config.guards?.beforeEach ?? [];
|
|
15
17
|
const loading = signal(false);
|
|
16
18
|
const loadedComponents = new Map();
|
|
17
19
|
const pendingPromises = new Map();
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
let component = route.component;
|
|
26
|
-
if (!component)
|
|
27
|
-
return { ...route, component: null, loaded: true };
|
|
28
|
-
if (typeof component === 'function') {
|
|
29
|
-
if (loadedComponents.has(route.path)) {
|
|
30
|
-
return { ...route, component: loadedComponents.get(route.path), loaded: true };
|
|
31
|
-
}
|
|
32
|
-
return { ...route, component, loaded: false };
|
|
33
|
-
}
|
|
34
|
-
loadedComponents.set(route.path, component);
|
|
35
|
-
return { ...route, component, loaded: true };
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const fallback = config.routes.find(r => r.path === '*');
|
|
39
|
-
if (fallback && fallback.component) {
|
|
40
|
-
if (typeof fallback.component === 'function') {
|
|
41
|
-
if (loadedComponents.has(fallback.path)) {
|
|
42
|
-
return { ...fallback, component: loadedComponents.get(fallback.path), loaded: true };
|
|
43
|
-
}
|
|
44
|
-
return { ...fallback, component: fallback.component, loaded: false };
|
|
20
|
+
function resolveComponent(seg) {
|
|
21
|
+
const comp = seg.route.component;
|
|
22
|
+
if (!comp)
|
|
23
|
+
return { component: null, loaded: true };
|
|
24
|
+
if (typeof comp === 'function') {
|
|
25
|
+
if (loadedComponents.has(seg.path)) {
|
|
26
|
+
return { component: loadedComponents.get(seg.path), loaded: true };
|
|
45
27
|
}
|
|
46
|
-
return {
|
|
28
|
+
return { component: comp, loaded: false };
|
|
47
29
|
}
|
|
30
|
+
loadedComponents.set(seg.path, comp);
|
|
31
|
+
return { component: comp, loaded: true };
|
|
32
|
+
}
|
|
33
|
+
function buildChain(chain) {
|
|
34
|
+
return chain.map(seg => ({
|
|
35
|
+
route: seg.route,
|
|
36
|
+
path: seg.path,
|
|
37
|
+
params: seg.params,
|
|
38
|
+
...resolveComponent(seg),
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
const currentRouteChain = computed(() => {
|
|
42
|
+
const [pathname] = currentPath.value.split('?');
|
|
43
|
+
const result = matchRoutes(config.routes, pathname);
|
|
44
|
+
if (result)
|
|
45
|
+
return buildChain(result.chain);
|
|
46
|
+
const wildcard = config.routes.find(r => r.path === '*');
|
|
47
|
+
if (wildcard)
|
|
48
|
+
return buildChain([{ route: wildcard, params: {}, path: pathname }]);
|
|
48
49
|
return null;
|
|
49
50
|
});
|
|
51
|
+
const params = computed(() => {
|
|
52
|
+
const chain = currentRouteChain.value;
|
|
53
|
+
if (!chain || chain.length === 0)
|
|
54
|
+
return {};
|
|
55
|
+
return chain.reduce((acc, seg) => ({ ...acc, ...seg.params }), {});
|
|
56
|
+
});
|
|
57
|
+
const currentRoute = computed(() => {
|
|
58
|
+
const chain = currentRouteChain.value;
|
|
59
|
+
if (!chain || chain.length === 0)
|
|
60
|
+
return null;
|
|
61
|
+
return chain[chain.length - 1];
|
|
62
|
+
});
|
|
50
63
|
async function loadComponent(route) {
|
|
51
64
|
if (route.loaded || !route.component)
|
|
52
65
|
return route.component;
|
|
53
|
-
if (loadedComponents.has(route.path))
|
|
66
|
+
if (loadedComponents.has(route.path))
|
|
54
67
|
return loadedComponents.get(route.path);
|
|
55
|
-
|
|
56
|
-
if (pendingPromises.has(route.path)) {
|
|
68
|
+
if (pendingPromises.has(route.path))
|
|
57
69
|
return pendingPromises.get(route.path);
|
|
58
|
-
}
|
|
59
70
|
const promise = route.component().then(mod => {
|
|
60
71
|
loadedComponents.set(route.path, mod.default);
|
|
61
72
|
pendingPromises.delete(route.path);
|
|
@@ -99,6 +110,7 @@ export function createRouter(config) {
|
|
|
99
110
|
navigate,
|
|
100
111
|
beforeEach,
|
|
101
112
|
currentRoute,
|
|
113
|
+
currentRouteChain,
|
|
102
114
|
currentPath,
|
|
103
115
|
params,
|
|
104
116
|
query,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,UAAU,EAAgD,MAAM,SAAS,CAAA;AAI/F,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAKnC,MAAM,UAAU,IAAI,CAAC,UAAiD;IACpE,OAAO,UAAU,CAAA;AACnB,CAAC;AAgBD,MAAM,UAAU,YAAY,CAAC,MAAoB;IAC/C,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;IAC7E,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC7B,OAAO,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EA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AACH,CAAC"}
|
package/dist/route.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import type { Component } from 'nexa-runtime';
|
|
2
2
|
export type RouteDef = {
|
|
3
3
|
path: string;
|
|
4
|
-
component
|
|
4
|
+
component?: Component | (() => Promise<{
|
|
5
|
+
default: Component;
|
|
6
|
+
}>);
|
|
7
|
+
children?: RouteDef[];
|
|
8
|
+
};
|
|
9
|
+
export type MatchedRoute = {
|
|
10
|
+
route: RouteDef;
|
|
11
|
+
params: Record<string, string>;
|
|
12
|
+
path: string;
|
|
5
13
|
};
|
|
6
14
|
export type Guard = (to: string, from: string) => boolean | Promise<boolean>;
|
|
15
|
+
export declare const ROUTER_DEPTH_KEY = "__routerDepth__";
|
|
7
16
|
export declare function matchPath(pattern: string, path: string): Record<string, string> | null;
|
|
17
|
+
export declare function matchRoutes(routes: RouteDef[], pathname: string): {
|
|
18
|
+
chain: MatchedRoute[];
|
|
19
|
+
params: Record<string, string>;
|
|
20
|
+
} | null;
|
|
8
21
|
export declare function parseQuery(search: string): Record<string, string>;
|
|
9
22
|
//# sourceMappingURL=route.d.ts.map
|
package/dist/route.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,SAAS,GAAG,CAAC,MAAM,OAAO,CAAC;QAAE,OAAO,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC,CAAA;IAC/D,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,QAAQ,CAAA;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;AAE5E,eAAO,MAAM,gBAAgB,oBAAoB,CAAA;AA4BjD,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAMtF;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,QAAQ,EAAE,EAClB,QAAQ,EAAE,MAAM,GACf;IAAE,KAAK,EAAE,YAAY,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,GAAG,IAAI,CAElE;AAiCD,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAGjE"}
|
package/dist/route.js
CHANGED
|
@@ -1,23 +1,63 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export const ROUTER_DEPTH_KEY = '__routerDepth__';
|
|
2
|
+
function joinPaths(parent, child) {
|
|
3
|
+
if (!child)
|
|
4
|
+
return parent;
|
|
5
|
+
if (child.startsWith('/'))
|
|
6
|
+
return child;
|
|
7
|
+
const base = parent.endsWith('/') ? parent : parent + '/';
|
|
8
|
+
return base + child;
|
|
9
|
+
}
|
|
10
|
+
function matchSegment(pattern, pathname) {
|
|
3
11
|
const patternParts = pattern.split('/').filter(Boolean);
|
|
4
12
|
const pathParts = pathname.split('/').filter(Boolean);
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
13
|
+
if (pattern === '*')
|
|
14
|
+
return { params: {}, consumed: pathParts.length };
|
|
15
|
+
if (patternParts.length > pathParts.length)
|
|
8
16
|
return null;
|
|
9
|
-
}
|
|
10
17
|
const params = {};
|
|
11
18
|
for (let i = 0; i < patternParts.length; i++) {
|
|
12
19
|
if (patternParts[i].startsWith(':')) {
|
|
13
|
-
|
|
14
|
-
params[name] = pathParts[i];
|
|
20
|
+
params[patternParts[i].slice(1)] = pathParts[i];
|
|
15
21
|
}
|
|
16
22
|
else if (patternParts[i] !== pathParts[i]) {
|
|
17
23
|
return null;
|
|
18
24
|
}
|
|
19
25
|
}
|
|
20
|
-
return params;
|
|
26
|
+
return { params, consumed: patternParts.length };
|
|
27
|
+
}
|
|
28
|
+
export function matchPath(pattern, path) {
|
|
29
|
+
const [pathname] = path.split('?');
|
|
30
|
+
const result = matchSegment(pattern, pathname);
|
|
31
|
+
if (!result)
|
|
32
|
+
return null;
|
|
33
|
+
const len = pathname.split('/').filter(Boolean).length;
|
|
34
|
+
return result.consumed === len ? result.params : null;
|
|
35
|
+
}
|
|
36
|
+
export function matchRoutes(routes, pathname) {
|
|
37
|
+
return tryMatchLevel(routes, pathname, '');
|
|
38
|
+
}
|
|
39
|
+
function tryMatchLevel(routes, pathname, parentPath) {
|
|
40
|
+
for (const route of routes) {
|
|
41
|
+
const fullPath = joinPaths(parentPath, route.path);
|
|
42
|
+
const match = matchSegment(fullPath, pathname);
|
|
43
|
+
if (!match)
|
|
44
|
+
continue;
|
|
45
|
+
const entry = { route, params: match.params, path: fullPath };
|
|
46
|
+
const remaining = pathname.split('/').filter(Boolean).slice(match.consumed);
|
|
47
|
+
if (route.children) {
|
|
48
|
+
const deeper = tryMatchLevel(route.children, pathname, fullPath);
|
|
49
|
+
if (deeper) {
|
|
50
|
+
return {
|
|
51
|
+
chain: [entry, ...deeper.chain],
|
|
52
|
+
params: { ...match.params, ...deeper.params },
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (remaining.length === 0) {
|
|
57
|
+
return { chain: [entry], params: match.params };
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
21
61
|
}
|
|
22
62
|
export function parseQuery(search) {
|
|
23
63
|
const params = new URLSearchParams(search);
|
package/dist/route.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"route.js","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"route.js","sourceRoot":"","sources":["../src/route.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAC,MAAM,gBAAgB,GAAG,iBAAiB,CAAA;AAEjD,SAAS,SAAS,CAAC,MAAc,EAAE,KAAa;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,MAAM,CAAA;IACzB,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAA;IACvC,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,GAAG,CAAA;IACzD,OAAO,IAAI,GAAG,KAAK,CAAA;AACrB,CAAC;AAED,SAAS,YAAY,CAAC,OAAe,EAAE,QAAgB;IACrD,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IACvD,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAErD,IAAI,OAAO,KAAK,GAAG;QAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,MAAM,EAAE,CAAA;IACtE,IAAI,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,MAA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E,CAAC,CAAA;AAC7C,CAAC"}
|
package/dist/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,kCAsErB,CAAA"}
|
package/dist/view.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h } from 'nexa-runtime';
|
|
1
|
+
import { defineComponent, h, provide, inject } from 'nexa-runtime';
|
|
2
2
|
import { signal, effect } from 'nexa-reactivity';
|
|
3
|
+
import { ROUTER_DEPTH_KEY } from './route';
|
|
3
4
|
export const RouterView = defineComponent({
|
|
4
5
|
name: 'RouterView',
|
|
5
6
|
props: {
|
|
@@ -8,14 +9,17 @@ export const RouterView = defineComponent({
|
|
|
8
9
|
keepAlive: { type: Boolean, default: false }
|
|
9
10
|
},
|
|
10
11
|
setup(props) {
|
|
12
|
+
const parentDepth = inject(ROUTER_DEPTH_KEY, 0) ?? 0;
|
|
13
|
+
provide(ROUTER_DEPTH_KEY, parentDepth + 1);
|
|
11
14
|
const cache = new Map();
|
|
12
15
|
const resolvedComponent = signal(null);
|
|
13
16
|
effect(() => {
|
|
14
|
-
const
|
|
15
|
-
if (!
|
|
17
|
+
const chain = props.router.currentRouteChain?.value;
|
|
18
|
+
if (!chain || parentDepth >= chain.length) {
|
|
16
19
|
resolvedComponent.value = null;
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
22
|
+
const route = chain[parentDepth];
|
|
19
23
|
if (route.loaded) {
|
|
20
24
|
resolvedComponent.value = route.component;
|
|
21
25
|
return;
|
|
@@ -27,26 +31,30 @@ export const RouterView = defineComponent({
|
|
|
27
31
|
}
|
|
28
32
|
});
|
|
29
33
|
return () => {
|
|
30
|
-
const
|
|
31
|
-
if (!
|
|
32
|
-
return
|
|
34
|
+
const chain = props.router.currentRouteChain?.value;
|
|
35
|
+
if (!chain || parentDepth >= chain.length) {
|
|
36
|
+
return parentDepth === 0
|
|
37
|
+
? h('div', { class: 'n-router-empty' }, '404 Not Found')
|
|
38
|
+
: null;
|
|
39
|
+
}
|
|
40
|
+
const route = chain[parentDepth];
|
|
33
41
|
const component = resolvedComponent.value;
|
|
34
42
|
if (!component) {
|
|
35
43
|
return h('div', { class: 'n-router-loading' }, 'Loading...');
|
|
36
44
|
}
|
|
37
45
|
const vnode = h(component, {
|
|
38
|
-
params:
|
|
46
|
+
params: route.params,
|
|
39
47
|
query: props.router.query.value
|
|
40
48
|
});
|
|
41
49
|
let rendered = vnode;
|
|
42
50
|
if (props.keepAlive) {
|
|
43
|
-
const
|
|
44
|
-
if (cache.has(
|
|
45
|
-
const cached = cache.get(
|
|
51
|
+
const key = props.router.currentPath.value + ':' + parentDepth;
|
|
52
|
+
if (cache.has(key)) {
|
|
53
|
+
const cached = cache.get(key);
|
|
46
54
|
if (cached.el)
|
|
47
55
|
vnode.el = cached.el;
|
|
48
56
|
}
|
|
49
|
-
cache.set(
|
|
57
|
+
cache.set(key, vnode);
|
|
50
58
|
}
|
|
51
59
|
if (props.transition) {
|
|
52
60
|
return h('transition', { name: props.transition, mode: 'out-in' }, [rendered]);
|
package/dist/view.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,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AK,CAAC,CAAA;YACvB,CAAC;YAED,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;gBACrB,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;YAChF,CAAC;YAED,OAAO,QAAQ,CAAA;QACjB,CAAC,CAAA;IACH,CAAC;CACF,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexa-router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"nexa-runtime": "0.
|
|
16
|
+
"nexa-runtime": "0.11.0"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"dist"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"nexa-reactivity": "0.
|
|
25
|
+
"nexa-reactivity": "0.11.0"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"build": "tsc",
|