@liteforge/router 0.1.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/LICENSE +21 -0
- package/README.md +296 -0
- package/dist/components.d.ts +75 -0
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +475 -0
- package/dist/components.js.map +1 -0
- package/dist/guards.d.ts +103 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +268 -0
- package/dist/guards.js.map +1 -0
- package/dist/history.d.ts +33 -0
- package/dist/history.d.ts.map +1 -0
- package/dist/history.js +315 -0
- package/dist/history.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/lazy.d.ts +197 -0
- package/dist/lazy.d.ts.map +1 -0
- package/dist/lazy.js +458 -0
- package/dist/lazy.js.map +1 -0
- package/dist/middleware.d.ts +69 -0
- package/dist/middleware.d.ts.map +1 -0
- package/dist/middleware.js +215 -0
- package/dist/middleware.js.map +1 -0
- package/dist/route-matcher.d.ts +80 -0
- package/dist/route-matcher.d.ts.map +1 -0
- package/dist/route-matcher.js +482 -0
- package/dist/route-matcher.js.map +1 -0
- package/dist/router.d.ts +26 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +393 -0
- package/dist/router.js.map +1 -0
- package/dist/types.d.ts +459 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +62 -0
package/dist/guards.js
ADDED
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { emitGuardRun } from '@liteforge/core';
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Guard Definition
|
|
4
|
+
// =============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Define a named route guard
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const authGuard = defineGuard('auth', ({ to, from, use }) => {
|
|
11
|
+
* const auth = use('auth');
|
|
12
|
+
* if (!auth.isAuthenticated()) {
|
|
13
|
+
* return `/login?redirect=${encodeURIComponent(to.path)}`;
|
|
14
|
+
* }
|
|
15
|
+
* return true;
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* // Parameterized guard
|
|
19
|
+
* const roleGuard = defineGuard('role', ({ use, param }) => {
|
|
20
|
+
* return use('auth').hasRole(param) || '/unauthorized';
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function defineGuard(name, handler) {
|
|
25
|
+
return { name, handler };
|
|
26
|
+
}
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// Guard Registry
|
|
29
|
+
// =============================================================================
|
|
30
|
+
/**
|
|
31
|
+
* Guard registry for managing named guards
|
|
32
|
+
*/
|
|
33
|
+
export class GuardRegistry {
|
|
34
|
+
constructor() {
|
|
35
|
+
this.guards = new Map();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Register a guard
|
|
39
|
+
*/
|
|
40
|
+
register(guard) {
|
|
41
|
+
if (this.guards.has(guard.name)) {
|
|
42
|
+
console.warn(`Guard "${guard.name}" is being overwritten`);
|
|
43
|
+
}
|
|
44
|
+
this.guards.set(guard.name, guard);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Register multiple guards
|
|
48
|
+
*/
|
|
49
|
+
registerAll(guards) {
|
|
50
|
+
for (const guard of guards) {
|
|
51
|
+
this.register(guard);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get a guard by name
|
|
56
|
+
*/
|
|
57
|
+
get(name) {
|
|
58
|
+
return this.guards.get(name);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Check if a guard exists
|
|
62
|
+
*/
|
|
63
|
+
has(name) {
|
|
64
|
+
return this.guards.has(name);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Unregister a guard
|
|
68
|
+
*/
|
|
69
|
+
unregister(name) {
|
|
70
|
+
return this.guards.delete(name);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Get all guard names
|
|
74
|
+
*/
|
|
75
|
+
names() {
|
|
76
|
+
return Array.from(this.guards.keys());
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Clear all guards
|
|
80
|
+
*/
|
|
81
|
+
clear() {
|
|
82
|
+
this.guards.clear();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Get the internal map (for route compilation)
|
|
86
|
+
*/
|
|
87
|
+
getMap() {
|
|
88
|
+
return this.guards;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
// =============================================================================
|
|
92
|
+
// Guard Execution
|
|
93
|
+
// =============================================================================
|
|
94
|
+
/**
|
|
95
|
+
* Execute a single guard and normalize the result
|
|
96
|
+
*/
|
|
97
|
+
async function executeGuard(guard, context) {
|
|
98
|
+
const startTime = performance.now();
|
|
99
|
+
try {
|
|
100
|
+
const result = await guard.handler(context);
|
|
101
|
+
const normalized = normalizeGuardResult(result);
|
|
102
|
+
const duration = performance.now() - startTime;
|
|
103
|
+
// Emit guard run event (zero cost if debug not enabled)
|
|
104
|
+
emitGuardRun(guard.name, context.to.path, normalized.allowed, duration);
|
|
105
|
+
return normalized;
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
const duration = performance.now() - startTime;
|
|
109
|
+
// Emit guard run event with failure (zero cost if debug not enabled)
|
|
110
|
+
emitGuardRun(guard.name, context.to.path, false, duration);
|
|
111
|
+
console.error(`Guard "${guard.name}" threw an error:`, error);
|
|
112
|
+
// Treat errors as blocking navigation
|
|
113
|
+
return { allowed: false };
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Normalize guard result to a consistent format
|
|
118
|
+
*/
|
|
119
|
+
export function normalizeGuardResult(result) {
|
|
120
|
+
if (result === true) {
|
|
121
|
+
return { allowed: true };
|
|
122
|
+
}
|
|
123
|
+
if (result === false) {
|
|
124
|
+
return { allowed: false };
|
|
125
|
+
}
|
|
126
|
+
// String or NavigationTarget - redirect
|
|
127
|
+
return { allowed: false, redirect: result };
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Run all guards for a route match
|
|
131
|
+
* Guards are run in order; first failing guard stops execution
|
|
132
|
+
*/
|
|
133
|
+
export async function runGuards(guards, context) {
|
|
134
|
+
for (const guard of guards) {
|
|
135
|
+
const result = await executeGuard(guard, context);
|
|
136
|
+
if (!result.allowed) {
|
|
137
|
+
return result;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return { allowed: true };
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Resolve guards from guard specification using the registry
|
|
144
|
+
* This is called at navigation time to support dynamic guard registration
|
|
145
|
+
*/
|
|
146
|
+
export function resolveGuardsFromSpec(guardSpec, registry) {
|
|
147
|
+
if (!guardSpec)
|
|
148
|
+
return [];
|
|
149
|
+
const guards = [];
|
|
150
|
+
const guardList = Array.isArray(guardSpec) ? guardSpec : [guardSpec];
|
|
151
|
+
for (const g of guardList) {
|
|
152
|
+
if (typeof g === 'string') {
|
|
153
|
+
// Parse parameterized guard (e.g., 'role:admin')
|
|
154
|
+
const colonIndex = g.indexOf(':');
|
|
155
|
+
const guardName = colonIndex >= 0 ? g.slice(0, colonIndex) : g;
|
|
156
|
+
const param = colonIndex >= 0 ? g.slice(colonIndex + 1) : undefined;
|
|
157
|
+
const registered = registry.get(guardName);
|
|
158
|
+
if (registered) {
|
|
159
|
+
// Create a wrapper that passes the param
|
|
160
|
+
if (param !== undefined) {
|
|
161
|
+
guards.push({
|
|
162
|
+
name: g,
|
|
163
|
+
handler: (ctx) => registered.handler({ ...ctx, param }),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
guards.push(registered);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// If guard not found, skip it (allows dynamic registration)
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
// Direct guard object
|
|
174
|
+
guards.push(g);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return guards;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Collect all guards for a matched route chain
|
|
181
|
+
* (including parent route guards for nested routes)
|
|
182
|
+
* Resolves string guards from the registry at runtime
|
|
183
|
+
*/
|
|
184
|
+
export function collectRouteGuards(route, registry) {
|
|
185
|
+
const guards = [];
|
|
186
|
+
// Walk up the parent chain and collect guards (parents first)
|
|
187
|
+
let current = route;
|
|
188
|
+
const chain = [];
|
|
189
|
+
while (current) {
|
|
190
|
+
chain.unshift(current);
|
|
191
|
+
current = current.parent;
|
|
192
|
+
}
|
|
193
|
+
// Add guards from each route in the chain
|
|
194
|
+
for (const r of chain) {
|
|
195
|
+
// First add inline guards (RouteGuard objects defined directly)
|
|
196
|
+
guards.push(...r.guards);
|
|
197
|
+
// Then resolve string guards from the registry (if registry provided)
|
|
198
|
+
if (registry && r.guardSpec) {
|
|
199
|
+
const resolvedGuards = resolveGuardsFromSpec(r.guardSpec, registry);
|
|
200
|
+
// Filter out guards that are already in the inline guards (by reference comparison)
|
|
201
|
+
// and filter out object guards since those are already in r.guards
|
|
202
|
+
for (const g of resolvedGuards) {
|
|
203
|
+
// Only add if it's not already present (comparing by name for string-resolved guards)
|
|
204
|
+
if (!r.guards.some(existing => existing === g || existing.name === g.name)) {
|
|
205
|
+
guards.push(g);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return guards;
|
|
211
|
+
}
|
|
212
|
+
// =============================================================================
|
|
213
|
+
// Built-in Guards
|
|
214
|
+
// =============================================================================
|
|
215
|
+
/**
|
|
216
|
+
* Create a simple authentication guard
|
|
217
|
+
*/
|
|
218
|
+
export function createAuthGuard(isAuthenticated, loginPath = '/login') {
|
|
219
|
+
return defineGuard('auth', ({ to }) => {
|
|
220
|
+
if (isAuthenticated()) {
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
// Redirect to login with return URL
|
|
224
|
+
const redirectTo = encodeURIComponent(to.path + to.search);
|
|
225
|
+
return `${loginPath}?redirect=${redirectTo}`;
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Create a role-based guard
|
|
230
|
+
* Usage: guard: 'role:admin' or guard: 'role:editor'
|
|
231
|
+
*/
|
|
232
|
+
export function createRoleGuard(hasRole, unauthorizedPath = '/unauthorized') {
|
|
233
|
+
return defineGuard('role', ({ param }) => {
|
|
234
|
+
if (!param) {
|
|
235
|
+
console.warn('Role guard requires a role parameter (e.g., "role:admin")');
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
return hasRole(param) || unauthorizedPath;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Create a confirmation guard that can be used for unsaved changes
|
|
243
|
+
*/
|
|
244
|
+
export function createConfirmGuard(shouldConfirm, message = 'You have unsaved changes. Are you sure you want to leave?') {
|
|
245
|
+
return defineGuard('confirm', () => {
|
|
246
|
+
if (!shouldConfirm()) {
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
// In browser environment, use confirm dialog
|
|
250
|
+
if (typeof window !== 'undefined' && window.confirm) {
|
|
251
|
+
return window.confirm(message);
|
|
252
|
+
}
|
|
253
|
+
// In non-browser environment, allow navigation
|
|
254
|
+
return true;
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Create a guest-only guard (redirects authenticated users)
|
|
259
|
+
*/
|
|
260
|
+
export function createGuestGuard(isAuthenticated, homePath = '/') {
|
|
261
|
+
return defineGuard('guest', () => {
|
|
262
|
+
if (!isAuthenticated()) {
|
|
263
|
+
return true;
|
|
264
|
+
}
|
|
265
|
+
return homePath;
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=guards.js.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,EAAE,EAAE;QACvC,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;YAC1E,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,gBAAgB,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,aAA4B,EAC5B,UAAkB,2DAA2D;IAE7E,OAAO,WAAW,CAAC,SAAS,EAAE,GAAG,EAAE;QACjC,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC;YACrB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,6CAA6C;QAC7C,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpD,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;QACD,+CAA+C;QAC/C,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAC9B,eAA8B,EAC9B,WAAmB,GAAG;IAEtB,OAAO,WAAW,CAAC,OAAO,EAAE,GAAG,EAAE;QAC/B,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { History, NavigationTarget } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Convert NavigationTarget to a href string
|
|
4
|
+
*/
|
|
5
|
+
export declare function targetToHref(target: NavigationTarget, base?: string): string;
|
|
6
|
+
export interface MemoryHistoryOptions {
|
|
7
|
+
/** Initial entries (defaults to ['/']) */
|
|
8
|
+
initialEntries?: string[];
|
|
9
|
+
/** Initial index (defaults to last entry) */
|
|
10
|
+
initialIndex?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Create a memory-based history for testing and SSR
|
|
14
|
+
*/
|
|
15
|
+
export declare function createMemoryHistory(options?: MemoryHistoryOptions): History;
|
|
16
|
+
export interface BrowserHistoryOptions {
|
|
17
|
+
/** Base path for all routes (e.g., '/app') */
|
|
18
|
+
base?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a browser-based history using the History API
|
|
22
|
+
*/
|
|
23
|
+
export declare function createBrowserHistory(options?: BrowserHistoryOptions): History;
|
|
24
|
+
export interface HashHistoryOptions {
|
|
25
|
+
/** Hash prefix (defaults to '#') */
|
|
26
|
+
hashPrefix?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Create a hash-based history using the URL hash
|
|
30
|
+
* Useful for environments where you can't configure the server
|
|
31
|
+
*/
|
|
32
|
+
export declare function createHashHistory(options?: HashHistoryOptions): History;
|
|
33
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../src/history.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAIP,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAcpB;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,GAAE,MAAW,GAAG,MAAM,CAkBhF;AAMD,MAAM,WAAW,oBAAoB;IACnC,0CAA0C;IAC1C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,oBAAyB,GAAG,OAAO,CA2I/E;AAQD,MAAM,WAAW,qBAAqB;IACpC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,OAAO,CAoGjF;AAMD,MAAM,WAAW,kBAAkB;IACjC,oCAAoC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAiG3E"}
|
package/dist/history.js
ADDED
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
import { createLocation, normalizePath, stringifyQuery } from './route-matcher.js';
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Utility Functions
|
|
4
|
+
// =============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Generate a unique key for history entries
|
|
7
|
+
*/
|
|
8
|
+
function createKey() {
|
|
9
|
+
return Math.random().toString(36).substring(2, 10);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Convert NavigationTarget to a href string
|
|
13
|
+
*/
|
|
14
|
+
export function targetToHref(target, base = '') {
|
|
15
|
+
if (typeof target === 'string') {
|
|
16
|
+
// If already absolute, return as is
|
|
17
|
+
if (target.startsWith('/')) {
|
|
18
|
+
return target;
|
|
19
|
+
}
|
|
20
|
+
// Relative path - join with base
|
|
21
|
+
return normalizePath(base + '/' + target);
|
|
22
|
+
}
|
|
23
|
+
let href = target.path;
|
|
24
|
+
if (target.query && Object.keys(target.query).length > 0) {
|
|
25
|
+
href += '?' + stringifyQuery(target.query);
|
|
26
|
+
}
|
|
27
|
+
if (target.hash) {
|
|
28
|
+
href += '#' + target.hash;
|
|
29
|
+
}
|
|
30
|
+
return href;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a memory-based history for testing and SSR
|
|
34
|
+
*/
|
|
35
|
+
export function createMemoryHistory(options = {}) {
|
|
36
|
+
const { initialEntries = ['/'], initialIndex } = options;
|
|
37
|
+
// Initialize entries
|
|
38
|
+
const entries = initialEntries.map((path) => {
|
|
39
|
+
const questionIndex = path.indexOf('?');
|
|
40
|
+
const hashIndex = path.indexOf('#');
|
|
41
|
+
let pathname = path;
|
|
42
|
+
let search = '';
|
|
43
|
+
let hash = '';
|
|
44
|
+
if (hashIndex >= 0) {
|
|
45
|
+
hash = path.slice(hashIndex + 1);
|
|
46
|
+
pathname = path.slice(0, hashIndex);
|
|
47
|
+
}
|
|
48
|
+
if (questionIndex >= 0 && (hashIndex < 0 || questionIndex < hashIndex)) {
|
|
49
|
+
const searchEnd = hashIndex >= 0 ? hashIndex : path.length;
|
|
50
|
+
search = path.slice(questionIndex + 1, searchEnd);
|
|
51
|
+
pathname = path.slice(0, questionIndex);
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
path: normalizePath(pathname),
|
|
55
|
+
search,
|
|
56
|
+
hash,
|
|
57
|
+
state: null,
|
|
58
|
+
key: createKey(),
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
// Current index in the history stack
|
|
62
|
+
let index = initialIndex ?? entries.length - 1;
|
|
63
|
+
// Listeners for location changes
|
|
64
|
+
const listeners = new Set();
|
|
65
|
+
// Get current location from entry
|
|
66
|
+
function getLocation() {
|
|
67
|
+
const entry = entries[index];
|
|
68
|
+
let href = entry.path;
|
|
69
|
+
if (entry.search)
|
|
70
|
+
href += '?' + entry.search;
|
|
71
|
+
if (entry.hash)
|
|
72
|
+
href += '#' + entry.hash;
|
|
73
|
+
return createLocation(href, entry.state);
|
|
74
|
+
}
|
|
75
|
+
// Notify all listeners
|
|
76
|
+
function notifyListeners(action) {
|
|
77
|
+
const location = getLocation();
|
|
78
|
+
for (const listener of listeners) {
|
|
79
|
+
listener(location, action);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// Parse target into entry components
|
|
83
|
+
function parseTarget(target) {
|
|
84
|
+
const location = createLocation(target);
|
|
85
|
+
return {
|
|
86
|
+
path: location.path,
|
|
87
|
+
search: location.search,
|
|
88
|
+
hash: location.hash,
|
|
89
|
+
state: location.state,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
const history = {
|
|
93
|
+
get location() {
|
|
94
|
+
return getLocation();
|
|
95
|
+
},
|
|
96
|
+
push(target) {
|
|
97
|
+
const parsed = parseTarget(target);
|
|
98
|
+
const entry = {
|
|
99
|
+
...parsed,
|
|
100
|
+
key: createKey(),
|
|
101
|
+
};
|
|
102
|
+
// Remove any forward entries
|
|
103
|
+
entries.splice(index + 1);
|
|
104
|
+
// Add new entry
|
|
105
|
+
entries.push(entry);
|
|
106
|
+
index = entries.length - 1;
|
|
107
|
+
notifyListeners('push');
|
|
108
|
+
},
|
|
109
|
+
replace(target) {
|
|
110
|
+
const parsed = parseTarget(target);
|
|
111
|
+
const entry = {
|
|
112
|
+
...parsed,
|
|
113
|
+
key: createKey(),
|
|
114
|
+
};
|
|
115
|
+
// Replace current entry
|
|
116
|
+
entries[index] = entry;
|
|
117
|
+
notifyListeners('replace');
|
|
118
|
+
},
|
|
119
|
+
back() {
|
|
120
|
+
this.go(-1);
|
|
121
|
+
},
|
|
122
|
+
forward() {
|
|
123
|
+
this.go(1);
|
|
124
|
+
},
|
|
125
|
+
go(delta) {
|
|
126
|
+
const newIndex = index + delta;
|
|
127
|
+
// Bounds check
|
|
128
|
+
if (newIndex < 0 || newIndex >= entries.length) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
index = newIndex;
|
|
132
|
+
notifyListeners('pop');
|
|
133
|
+
},
|
|
134
|
+
listen(listener) {
|
|
135
|
+
listeners.add(listener);
|
|
136
|
+
return () => {
|
|
137
|
+
listeners.delete(listener);
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
createHref(target) {
|
|
141
|
+
return targetToHref(target);
|
|
142
|
+
},
|
|
143
|
+
destroy() {
|
|
144
|
+
listeners.clear();
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
return history;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Create a browser-based history using the History API
|
|
151
|
+
*/
|
|
152
|
+
export function createBrowserHistory(options = {}) {
|
|
153
|
+
const { base = '' } = options;
|
|
154
|
+
const normalizedBase = base ? normalizePath(base) : '';
|
|
155
|
+
// Listeners for location changes
|
|
156
|
+
const listeners = new Set();
|
|
157
|
+
// Get current location from window.location
|
|
158
|
+
function getLocation() {
|
|
159
|
+
let path = window.location.pathname;
|
|
160
|
+
// Remove base from path
|
|
161
|
+
if (normalizedBase && path.startsWith(normalizedBase)) {
|
|
162
|
+
path = path.slice(normalizedBase.length) || '/';
|
|
163
|
+
}
|
|
164
|
+
const href = path + window.location.search + window.location.hash;
|
|
165
|
+
return createLocation(href, window.history.state);
|
|
166
|
+
}
|
|
167
|
+
// Notify all listeners
|
|
168
|
+
function notifyListeners(action) {
|
|
169
|
+
const location = getLocation();
|
|
170
|
+
for (const listener of listeners) {
|
|
171
|
+
listener(location, action);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
// Handle popstate events (back/forward navigation)
|
|
175
|
+
function handlePopState() {
|
|
176
|
+
notifyListeners('pop');
|
|
177
|
+
}
|
|
178
|
+
// Add popstate listener
|
|
179
|
+
window.addEventListener('popstate', handlePopState);
|
|
180
|
+
// Build full URL with base
|
|
181
|
+
function buildUrl(target) {
|
|
182
|
+
const href = targetToHref(target);
|
|
183
|
+
if (normalizedBase) {
|
|
184
|
+
// Don't double-add base
|
|
185
|
+
if (href.startsWith(normalizedBase)) {
|
|
186
|
+
return href;
|
|
187
|
+
}
|
|
188
|
+
return normalizedBase + (href.startsWith('/') ? href : '/' + href);
|
|
189
|
+
}
|
|
190
|
+
return href;
|
|
191
|
+
}
|
|
192
|
+
const history = {
|
|
193
|
+
get location() {
|
|
194
|
+
return getLocation();
|
|
195
|
+
},
|
|
196
|
+
push(target) {
|
|
197
|
+
const url = buildUrl(target);
|
|
198
|
+
const state = typeof target === 'object' ? target.state : undefined;
|
|
199
|
+
window.history.pushState(state ?? null, '', url);
|
|
200
|
+
notifyListeners('push');
|
|
201
|
+
},
|
|
202
|
+
replace(target) {
|
|
203
|
+
const url = buildUrl(target);
|
|
204
|
+
const state = typeof target === 'object' ? target.state : undefined;
|
|
205
|
+
window.history.replaceState(state ?? null, '', url);
|
|
206
|
+
notifyListeners('replace');
|
|
207
|
+
},
|
|
208
|
+
back() {
|
|
209
|
+
window.history.back();
|
|
210
|
+
},
|
|
211
|
+
forward() {
|
|
212
|
+
window.history.forward();
|
|
213
|
+
},
|
|
214
|
+
go(delta) {
|
|
215
|
+
window.history.go(delta);
|
|
216
|
+
},
|
|
217
|
+
listen(listener) {
|
|
218
|
+
listeners.add(listener);
|
|
219
|
+
return () => {
|
|
220
|
+
listeners.delete(listener);
|
|
221
|
+
};
|
|
222
|
+
},
|
|
223
|
+
createHref(target) {
|
|
224
|
+
return buildUrl(target);
|
|
225
|
+
},
|
|
226
|
+
destroy() {
|
|
227
|
+
window.removeEventListener('popstate', handlePopState);
|
|
228
|
+
listeners.clear();
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
return history;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Create a hash-based history using the URL hash
|
|
235
|
+
* Useful for environments where you can't configure the server
|
|
236
|
+
*/
|
|
237
|
+
export function createHashHistory(options = {}) {
|
|
238
|
+
const { hashPrefix = '#' } = options;
|
|
239
|
+
// Listeners for location changes
|
|
240
|
+
const listeners = new Set();
|
|
241
|
+
// Get current location from hash
|
|
242
|
+
function getLocation() {
|
|
243
|
+
let hash = window.location.hash;
|
|
244
|
+
// Remove hash prefix
|
|
245
|
+
if (hash.startsWith(hashPrefix)) {
|
|
246
|
+
hash = hash.slice(hashPrefix.length);
|
|
247
|
+
}
|
|
248
|
+
// Ensure leading slash
|
|
249
|
+
if (!hash.startsWith('/')) {
|
|
250
|
+
hash = '/' + hash;
|
|
251
|
+
}
|
|
252
|
+
return createLocation(hash, window.history.state);
|
|
253
|
+
}
|
|
254
|
+
// Notify all listeners
|
|
255
|
+
function notifyListeners(action) {
|
|
256
|
+
const location = getLocation();
|
|
257
|
+
for (const listener of listeners) {
|
|
258
|
+
listener(location, action);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Handle hashchange events
|
|
262
|
+
function handleHashChange() {
|
|
263
|
+
notifyListeners('pop');
|
|
264
|
+
}
|
|
265
|
+
// Add hashchange listener
|
|
266
|
+
window.addEventListener('hashchange', handleHashChange);
|
|
267
|
+
// Build hash URL
|
|
268
|
+
function buildHashUrl(target) {
|
|
269
|
+
const href = targetToHref(target);
|
|
270
|
+
return hashPrefix + href;
|
|
271
|
+
}
|
|
272
|
+
const history = {
|
|
273
|
+
get location() {
|
|
274
|
+
return getLocation();
|
|
275
|
+
},
|
|
276
|
+
push(target) {
|
|
277
|
+
const url = buildHashUrl(target);
|
|
278
|
+
const state = typeof target === 'object' ? target.state : undefined;
|
|
279
|
+
// Use pushState to enable state while still using hash
|
|
280
|
+
window.history.pushState(state ?? null, '', url);
|
|
281
|
+
notifyListeners('push');
|
|
282
|
+
},
|
|
283
|
+
replace(target) {
|
|
284
|
+
const url = buildHashUrl(target);
|
|
285
|
+
const state = typeof target === 'object' ? target.state : undefined;
|
|
286
|
+
window.history.replaceState(state ?? null, '', url);
|
|
287
|
+
notifyListeners('replace');
|
|
288
|
+
},
|
|
289
|
+
back() {
|
|
290
|
+
window.history.back();
|
|
291
|
+
},
|
|
292
|
+
forward() {
|
|
293
|
+
window.history.forward();
|
|
294
|
+
},
|
|
295
|
+
go(delta) {
|
|
296
|
+
window.history.go(delta);
|
|
297
|
+
},
|
|
298
|
+
listen(listener) {
|
|
299
|
+
listeners.add(listener);
|
|
300
|
+
return () => {
|
|
301
|
+
listeners.delete(listener);
|
|
302
|
+
};
|
|
303
|
+
},
|
|
304
|
+
createHref(target) {
|
|
305
|
+
return buildHashUrl(target);
|
|
306
|
+
},
|
|
307
|
+
destroy() {
|
|
308
|
+
window.removeEventListener('hashchange', handleHashChange);
|
|
309
|
+
listeners.clear();
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
return history;
|
|
313
|
+
}
|
|
314
|
+
/* v8 ignore st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e,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QAED,IAAI;YACF,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACxB,CAAC;QAED,OAAO;YACL,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC;QAED,EAAE,CAAC,KAAa;YACd,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAED,MAAM,CAAC,QAAyB;YAC9B,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACxB,OAAO,GAAG,EAAE;gBACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAC7B,CAAC,CAAC;QACJ,CAAC;QAED,UAAU,CAAC,MAAwB;YACjC,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC;QAC9B,CAAC;QAED,OAAO;YACL,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;YAC3D,SAAS,CAAC,KAAK,EAAE,CAAC;QACpB,CAAC;KACF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,oBAAoB"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { Location, QueryParams, RouteParams, NavigationTarget, RouteDefinition, RouteComponent, LazyComponent, LazyImportFn, RouteLazyConfig, RouteMeta, CompiledRoute, MatchedRoute, RouteMatch, GuardContext, GuardResult, GuardFunction, RouteGuard, MiddlewareContext, MiddlewareFunction, RouteMiddleware, PreloadContext, PreloadFunction, TransitionContext, TransitionHooks, History, HistoryEntry, HistoryListener, RouterOptions, NavigateOptions, Router, ScrollBehavior, LazyDefaults, LinkProps, RouterOutletProps, ExtractParams, TypedParams, } from './types.js';
|
|
2
|
+
export { parsePath, parseQuery, stringifyQuery, createLocation, normalizePath, joinPaths, compilePath, compileRoute, compileRoutes, matchRoute, matchRoutes, findRouteByName, generatePath, isPathActive, flattenRoutes, } from './route-matcher.js';
|
|
3
|
+
export { createMemoryHistory, createBrowserHistory, createHashHistory, targetToHref, } from './history.js';
|
|
4
|
+
export type { MemoryHistoryOptions, BrowserHistoryOptions, HashHistoryOptions, } from './history.js';
|
|
5
|
+
export { defineGuard, GuardRegistry, runGuards, collectRouteGuards, normalizeGuardResult, createAuthGuard, createRoleGuard, createConfirmGuard, createGuestGuard, } from './guards.js';
|
|
6
|
+
export { defineMiddleware, composeMiddleware, runMiddleware, createLoggerMiddleware, createScrollMiddleware, createTitleMiddleware, createAnalyticsMiddleware, createLoadingMiddleware, } from './middleware.js';
|
|
7
|
+
export { createRouter, setActiveRouter, getActiveRouter, getActiveRouterOrNull, } from './router.js';
|
|
8
|
+
export type { RouterInternal } from './router.js';
|
|
9
|
+
export { RouterOutlet, Link, NavLink } from './components.js';
|
|
10
|
+
export type { RouterOutletConfig, LinkConfig } from './components.js';
|
|
11
|
+
export { lazy, prefetchAll, isLazyComponent, getLazyDelay, getLazyLoading, getLazyError, createPreloadOnHover, createPreloadOnVisible, resolveModuleExport, isWrappedLazyComponent, detectInlineLazyImport, wrapInlineLazy, processRouteComponent, } from './lazy.js';
|
|
12
|
+
export type { LazyOptions, LazyComponentWithMethods } from './lazy.js';
|
|
13
|
+
export type { CompileRouteOptions } from './route-matcher.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAEV,QAAQ,EACR,WAAW,EACX,WAAW,EACX,gBAAgB,EAGhB,eAAe,EACf,cAAc,EACd,aAAa,EACb,YAAY,EACZ,eAAe,EACf,SAAS,EACT,aAAa,EACb,YAAY,EACZ,UAAU,EAGV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EAGV,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EAGf,cAAc,EACd,eAAe,EAGf,iBAAiB,EACjB,eAA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