@openwebf/react-router 0.3.2 → 0.3.3
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 +62 -2
- package/dist/index.esm.js +134 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +137 -22
- package/dist/index.js.map +1 -1
- package/dist/routes/Routes.d.ts +24 -0
- package/dist/routes/Routes.d.ts.map +1 -1
- package/dist/routes/utils.d.ts +37 -0
- package/dist/routes/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/routes/router.d.ts +0 -79
- package/dist/routes/router.d.ts.map +0 -1
- package/dist/routes/routerConfig.d.ts +0 -147
- package/dist/routes/routerConfig.d.ts.map +0 -1
- package/dist/utils/CreateComponent.d.ts +0 -86
- package/dist/utils/CreateComponent.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -78,6 +78,43 @@ declare const WebFRouter: {
|
|
|
78
78
|
*/
|
|
79
79
|
restorablePopAndPushNamed: <T extends RoutePath>(path: T, state?: any) => Promise<string>;
|
|
80
80
|
};
|
|
81
|
+
/**
|
|
82
|
+
* Route parameters extracted from dynamic routes
|
|
83
|
+
*/
|
|
84
|
+
interface RouteParams {
|
|
85
|
+
[key: string]: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Route match result
|
|
89
|
+
*/
|
|
90
|
+
interface RouteMatch {
|
|
91
|
+
path: string;
|
|
92
|
+
params: RouteParams;
|
|
93
|
+
isExact: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Convert a route pattern to a regular expression
|
|
97
|
+
* @param pattern Route pattern like "/user/:userId" or "/category/:catId/product/:prodId"
|
|
98
|
+
* @returns Object with regex and parameter names
|
|
99
|
+
*/
|
|
100
|
+
declare function pathToRegex(pattern: string): {
|
|
101
|
+
regex: RegExp;
|
|
102
|
+
paramNames: string[];
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Match a pathname against a route pattern and extract parameters
|
|
106
|
+
* @param pattern Route pattern like "/user/:userId"
|
|
107
|
+
* @param pathname Actual pathname like "/user/123"
|
|
108
|
+
* @returns Match result with extracted parameters or null if no match
|
|
109
|
+
*/
|
|
110
|
+
declare function matchPath(pattern: string, pathname: string): RouteMatch | null;
|
|
111
|
+
/**
|
|
112
|
+
* Find the best matching route from a list of route patterns
|
|
113
|
+
* @param routes Array of route patterns
|
|
114
|
+
* @param pathname Current pathname
|
|
115
|
+
* @returns Best match or null if no routes match
|
|
116
|
+
*/
|
|
117
|
+
declare function matchRoutes(routes: string[], pathname: string): RouteMatch | null;
|
|
81
118
|
|
|
82
119
|
/**
|
|
83
120
|
* Route Component
|
|
@@ -149,6 +186,10 @@ declare function useRouteContext(): {
|
|
|
149
186
|
* State data passed during route navigation
|
|
150
187
|
*/
|
|
151
188
|
params: any;
|
|
189
|
+
/**
|
|
190
|
+
* Route parameters extracted from dynamic routes (e.g., :userId in /user/:userId)
|
|
191
|
+
*/
|
|
192
|
+
routeParams: RouteParams | undefined;
|
|
152
193
|
/**
|
|
153
194
|
* Current active path from router
|
|
154
195
|
*/
|
|
@@ -186,6 +227,7 @@ interface Location {
|
|
|
186
227
|
* const location = useLocation();
|
|
187
228
|
*
|
|
188
229
|
* console.log('Current path:', location.pathname);
|
|
230
|
+
|
|
189
231
|
* console.log('Location state:', location.state);
|
|
190
232
|
* console.log('Is active:', location.isActive);
|
|
191
233
|
*
|
|
@@ -196,6 +238,24 @@ interface Location {
|
|
|
196
238
|
declare function useLocation(): Location & {
|
|
197
239
|
isActive: boolean;
|
|
198
240
|
};
|
|
241
|
+
/**
|
|
242
|
+
* Hook to get route parameters from dynamic routes
|
|
243
|
+
*
|
|
244
|
+
* @returns Route parameters object with parameter names as keys and values as strings
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* ```tsx
|
|
248
|
+
* // For route pattern "/user/:userId" and actual path "/user/123"
|
|
249
|
+
* function UserPage() {
|
|
250
|
+
* const params = useParams();
|
|
251
|
+
*
|
|
252
|
+
* console.log(params.userId); // "123"
|
|
253
|
+
*
|
|
254
|
+
* return <div>User ID: {params.userId}</div>;
|
|
255
|
+
* }
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
declare function useParams(): RouteParams;
|
|
199
259
|
/**
|
|
200
260
|
* Route configuration object
|
|
201
261
|
*/
|
|
@@ -345,5 +405,5 @@ interface WebFRouterLinkElement extends WebFElementWithMethods<{}> {
|
|
|
345
405
|
}
|
|
346
406
|
declare const WebFRouterLink: FC<WebFHybridRouterProps>;
|
|
347
407
|
|
|
348
|
-
export { Route, Routes, WebFRouter, WebFRouterLink, useLocation, useNavigate, useRouteContext, useRoutes };
|
|
349
|
-
export type { HybridRouterChangeEvent, HybridRouterChangeEventHandler, Location, NavigateFunction, NavigateOptions, NavigationMethods, RouteObject, RouteProps, RoutesProps, WebFHybridRouterProps, WebFRouterLinkElement };
|
|
408
|
+
export { Route, Routes, WebFRouter, WebFRouterLink, matchPath, matchRoutes, pathToRegex, useLocation, useNavigate, useParams, useRouteContext, useRoutes };
|
|
409
|
+
export type { HybridRouterChangeEvent, HybridRouterChangeEventHandler, Location, NavigateFunction, NavigateOptions, NavigationMethods, RouteMatch, RouteObject, RouteParams, RouteProps, RoutesProps, WebFHybridRouterProps, WebFRouterLinkElement };
|
package/dist/index.esm.js
CHANGED
|
@@ -142,6 +142,65 @@ const WebFRouter = {
|
|
|
142
142
|
return webf.hybridHistory.restorablePopAndPushNamed(path, { arguments: state });
|
|
143
143
|
})
|
|
144
144
|
};
|
|
145
|
+
/**
|
|
146
|
+
* Convert a route pattern to a regular expression
|
|
147
|
+
* @param pattern Route pattern like "/user/:userId" or "/category/:catId/product/:prodId"
|
|
148
|
+
* @returns Object with regex and parameter names
|
|
149
|
+
*/
|
|
150
|
+
function pathToRegex(pattern) {
|
|
151
|
+
const paramNames = [];
|
|
152
|
+
// Escape special regex characters except : and *
|
|
153
|
+
let regexPattern = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
|
|
154
|
+
// Replace :param with named capture groups
|
|
155
|
+
regexPattern = regexPattern.replace(/:([^\/]+)/g, (_, paramName) => {
|
|
156
|
+
paramNames.push(paramName);
|
|
157
|
+
return '([^/]+)';
|
|
158
|
+
});
|
|
159
|
+
// Add anchors for exact matching
|
|
160
|
+
regexPattern = `^${regexPattern}$`;
|
|
161
|
+
return {
|
|
162
|
+
regex: new RegExp(regexPattern),
|
|
163
|
+
paramNames
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Match a pathname against a route pattern and extract parameters
|
|
168
|
+
* @param pattern Route pattern like "/user/:userId"
|
|
169
|
+
* @param pathname Actual pathname like "/user/123"
|
|
170
|
+
* @returns Match result with extracted parameters or null if no match
|
|
171
|
+
*/
|
|
172
|
+
function matchPath(pattern, pathname) {
|
|
173
|
+
const { regex, paramNames } = pathToRegex(pattern);
|
|
174
|
+
const match = pathname.match(regex);
|
|
175
|
+
if (!match) {
|
|
176
|
+
return null;
|
|
177
|
+
}
|
|
178
|
+
// Extract parameters from capture groups
|
|
179
|
+
const params = {};
|
|
180
|
+
paramNames.forEach((paramName, index) => {
|
|
181
|
+
params[paramName] = match[index + 1]; // +1 because match[0] is the full match
|
|
182
|
+
});
|
|
183
|
+
return {
|
|
184
|
+
path: pattern,
|
|
185
|
+
params,
|
|
186
|
+
isExact: true
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Find the best matching route from a list of route patterns
|
|
191
|
+
* @param routes Array of route patterns
|
|
192
|
+
* @param pathname Current pathname
|
|
193
|
+
* @returns Best match or null if no routes match
|
|
194
|
+
*/
|
|
195
|
+
function matchRoutes(routes, pathname) {
|
|
196
|
+
for (const route of routes) {
|
|
197
|
+
const match = matchPath(route, pathname);
|
|
198
|
+
if (match) {
|
|
199
|
+
return match;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
145
204
|
|
|
146
205
|
var isFunction = function (value) {
|
|
147
206
|
return typeof value === 'function';
|
|
@@ -161,7 +220,7 @@ function useMemoizedFn(fn) {
|
|
|
161
220
|
fnRef.current = useMemo(function () {
|
|
162
221
|
return fn;
|
|
163
222
|
}, [fn]);
|
|
164
|
-
var memoizedFn = useRef();
|
|
223
|
+
var memoizedFn = useRef(undefined);
|
|
165
224
|
if (!memoizedFn.current) {
|
|
166
225
|
memoizedFn.current = function () {
|
|
167
226
|
var args = [];
|
|
@@ -253,6 +312,7 @@ function Route({ path, prerender = false, element, title }) {
|
|
|
253
312
|
const RouteContext = createContext({
|
|
254
313
|
path: undefined,
|
|
255
314
|
params: undefined,
|
|
315
|
+
routeParams: undefined,
|
|
256
316
|
activePath: undefined,
|
|
257
317
|
routeEventKind: undefined
|
|
258
318
|
});
|
|
@@ -287,6 +347,7 @@ function useRouteContext() {
|
|
|
287
347
|
* const location = useLocation();
|
|
288
348
|
*
|
|
289
349
|
* console.log('Current path:', location.pathname);
|
|
350
|
+
|
|
290
351
|
* console.log('Location state:', location.state);
|
|
291
352
|
* console.log('Is active:', location.isActive);
|
|
292
353
|
*
|
|
@@ -298,25 +359,46 @@ function useLocation() {
|
|
|
298
359
|
const context = useRouteContext();
|
|
299
360
|
// Create location object from context
|
|
300
361
|
const location = useMemo(() => {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}
|
|
310
|
-
// For inactive routes, return the global location without state
|
|
362
|
+
const currentPath = context.path || context.activePath || WebFRouter.path;
|
|
363
|
+
let pathname = currentPath;
|
|
364
|
+
// Check if the current component's route matches the active path
|
|
365
|
+
const isCurrentRoute = context.path === context.activePath;
|
|
366
|
+
// Get state - prioritize context params, fallback to WebFRouter.state
|
|
367
|
+
const state = (context.isActive || isCurrentRoute)
|
|
368
|
+
? (context.params || WebFRouter.state)
|
|
369
|
+
: WebFRouter.state;
|
|
311
370
|
return {
|
|
312
|
-
pathname
|
|
313
|
-
state
|
|
314
|
-
isActive:
|
|
315
|
-
key: `${
|
|
371
|
+
pathname,
|
|
372
|
+
state,
|
|
373
|
+
isActive: context.isActive,
|
|
374
|
+
key: `${pathname}-${Date.now()}`
|
|
316
375
|
};
|
|
317
376
|
}, [context.isActive, context.path, context.activePath, context.params]);
|
|
318
377
|
return location;
|
|
319
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Hook to get route parameters from dynamic routes
|
|
381
|
+
*
|
|
382
|
+
* @returns Route parameters object with parameter names as keys and values as strings
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```tsx
|
|
386
|
+
* // For route pattern "/user/:userId" and actual path "/user/123"
|
|
387
|
+
* function UserPage() {
|
|
388
|
+
* const params = useParams();
|
|
389
|
+
*
|
|
390
|
+
* console.log(params.userId); // "123"
|
|
391
|
+
*
|
|
392
|
+
* return <div>User ID: {params.userId}</div>;
|
|
393
|
+
* }
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
function useParams() {
|
|
397
|
+
const context = useRouteContext();
|
|
398
|
+
return useMemo(() => {
|
|
399
|
+
return context.routeParams || {};
|
|
400
|
+
}, [context.routeParams]);
|
|
401
|
+
}
|
|
320
402
|
/**
|
|
321
403
|
* Routes component that wraps multiple Route components and provides shared context
|
|
322
404
|
*
|
|
@@ -336,11 +418,17 @@ function RouteContextProvider({ path, children }) {
|
|
|
336
418
|
const globalContext = useContext(RouteContext);
|
|
337
419
|
// Create a route-specific context that only updates when this route is active
|
|
338
420
|
const routeSpecificContext = useMemo(() => {
|
|
339
|
-
//
|
|
340
|
-
|
|
421
|
+
// Check if this route pattern matches the active path
|
|
422
|
+
const match = globalContext.activePath ? matchPath(path, globalContext.activePath) : null;
|
|
423
|
+
if (match) {
|
|
424
|
+
// Use route params from Flutter event if available, otherwise from local matching
|
|
425
|
+
const effectiveRouteParams = globalContext.routeParams || match.params;
|
|
426
|
+
// For matching routes, always try to get state from WebFRouter if params is undefined
|
|
427
|
+
const effectiveParams = globalContext.params !== undefined ? globalContext.params : WebFRouter.state;
|
|
341
428
|
return {
|
|
342
429
|
path,
|
|
343
|
-
params:
|
|
430
|
+
params: effectiveParams,
|
|
431
|
+
routeParams: effectiveRouteParams,
|
|
344
432
|
activePath: globalContext.activePath,
|
|
345
433
|
routeEventKind: globalContext.routeEventKind
|
|
346
434
|
};
|
|
@@ -349,33 +437,55 @@ function RouteContextProvider({ path, children }) {
|
|
|
349
437
|
return {
|
|
350
438
|
path,
|
|
351
439
|
params: undefined,
|
|
440
|
+
routeParams: undefined,
|
|
352
441
|
activePath: globalContext.activePath,
|
|
353
442
|
routeEventKind: undefined
|
|
354
443
|
};
|
|
355
|
-
}, [path, globalContext.activePath, globalContext.params, globalContext.routeEventKind]);
|
|
444
|
+
}, [path, globalContext.activePath, globalContext.params, globalContext.routeParams, globalContext.routeEventKind]);
|
|
356
445
|
return (React.createElement(RouteContext.Provider, { value: routeSpecificContext }, children));
|
|
357
446
|
}
|
|
358
447
|
function Routes({ children }) {
|
|
359
448
|
// State to track current route information
|
|
360
449
|
const [routeState, setRouteState] = useState({
|
|
361
450
|
path: undefined,
|
|
362
|
-
activePath:
|
|
451
|
+
activePath: WebFRouter.path, // Initialize with current path
|
|
363
452
|
params: undefined,
|
|
453
|
+
routeParams: undefined,
|
|
364
454
|
routeEventKind: undefined
|
|
365
455
|
});
|
|
366
456
|
// Listen to hybridrouterchange event
|
|
367
457
|
useEffect(() => {
|
|
368
458
|
const handleRouteChange = (event) => {
|
|
369
459
|
const routeEvent = event;
|
|
460
|
+
// Check for new event detail structure with params
|
|
461
|
+
const eventDetail = event.detail;
|
|
370
462
|
// Only update activePath for push events
|
|
371
463
|
const newActivePath = (routeEvent.kind === 'didPushNext' || routeEvent.kind === 'didPush')
|
|
372
464
|
? routeEvent.path
|
|
373
465
|
: routeState.activePath;
|
|
466
|
+
// For dynamic routes, extract parameters from the path using registered route patterns
|
|
467
|
+
let routeParams = (eventDetail === null || eventDetail === void 0 ? void 0 : eventDetail.params) || undefined;
|
|
468
|
+
if (!routeParams && newActivePath) {
|
|
469
|
+
// Try to extract parameters from registered route patterns
|
|
470
|
+
const registeredRoutes = Array.from(document.querySelectorAll('webf-router-link'));
|
|
471
|
+
for (const routeElement of registeredRoutes) {
|
|
472
|
+
const routePath = routeElement.getAttribute('path');
|
|
473
|
+
if (routePath && routePath.includes(':')) {
|
|
474
|
+
const match = matchPath(routePath, newActivePath);
|
|
475
|
+
if (match) {
|
|
476
|
+
routeParams = match.params;
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
const eventState = (eventDetail === null || eventDetail === void 0 ? void 0 : eventDetail.state) || routeEvent.state;
|
|
374
483
|
// Update state based on event kind
|
|
375
484
|
setRouteState({
|
|
376
485
|
path: routeEvent.path,
|
|
377
486
|
activePath: newActivePath,
|
|
378
|
-
params:
|
|
487
|
+
params: eventState,
|
|
488
|
+
routeParams: routeParams, // Use params from Flutter if available
|
|
379
489
|
routeEventKind: routeEvent.kind
|
|
380
490
|
});
|
|
381
491
|
};
|
|
@@ -390,9 +500,10 @@ function Routes({ children }) {
|
|
|
390
500
|
const globalContextValue = useMemo(() => ({
|
|
391
501
|
path: undefined,
|
|
392
502
|
params: routeState.params,
|
|
503
|
+
routeParams: routeState.routeParams, // Pass through route params from Flutter
|
|
393
504
|
activePath: routeState.activePath,
|
|
394
505
|
routeEventKind: routeState.routeEventKind
|
|
395
|
-
}), [routeState.activePath, routeState.params, routeState.routeEventKind]);
|
|
506
|
+
}), [routeState.activePath, routeState.params, routeState.routeParams, routeState.routeEventKind]);
|
|
396
507
|
// Wrap each Route component with its own context provider
|
|
397
508
|
const wrappedChildren = useMemo(() => {
|
|
398
509
|
return Children.map(children, (child) => {
|
|
@@ -508,5 +619,5 @@ function useNavigate() {
|
|
|
508
619
|
}, []);
|
|
509
620
|
}
|
|
510
621
|
|
|
511
|
-
export { Route, Routes, WebFRouter, WebFRouterLink, useLocation, useNavigate, useRouteContext, useRoutes };
|
|
622
|
+
export { Route, Routes, WebFRouter, WebFRouterLink, matchPath, matchRoutes, pathToRegex, useLocation, useNavigate, useParams, useRouteContext, useRoutes };
|
|
512
623
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../src/routes/utils.ts","../node_modules/ahooks/es/utils/index.js","../node_modules/ahooks/es/utils/isDev.js","../node_modules/ahooks/es/useMemoizedFn/index.js","../src/utils/RouterLink.tsx","../src/routes/Route.tsx","../src/routes/Routes.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * Router management module\n *\n * Encapsulates routing navigation functionality with route guard mechanism for permission checks\n */\n// eslint-disable-next-line no-restricted-imports\nimport { webf } from '@openwebf/webf-enterprise-typings';\n\ntype RoutePath = string;\n\n/**\n * WebF Router object - provides comprehensive navigation APIs\n * Combines web-like history management with Flutter-like navigation patterns\n */\nexport const WebFRouter = {\n /**\n * Get the current state object associated with the history entry\n */\n get state() {\n return webf.hybridHistory.state;\n },\n \n /**\n * Get the current route path\n */\n get path() {\n return webf.hybridHistory.path as RoutePath\n },\n \n /**\n * Navigate to a specified route\n * Applies route guards for permission checks before navigation\n */\n push: async <P extends RoutePath>(path: P, state?: any) => {\n\n webf.hybridHistory.pushNamed(path, { arguments: state })\n },\n \n /**\n * Replace the current route without adding to history\n * Applies route guards for permission checks before navigation\n */\n replace: async <P extends RoutePath>(path: P, state?: any) => {\n webf.hybridHistory.pushReplacementNamed(path, { arguments: state});\n },\n \n /**\n * Navigate back to the previous route\n */\n back: () => {\n webf.hybridHistory.back();\n },\n \n /**\n * Close the current screen and return to the previous one\n * Flutter-style navigation method\n */\n pop: (result?: any) => {\n webf.hybridHistory.pop(result);\n },\n \n /**\n * Pop routes until reaching a specific route\n */\n popUntil: (path: RoutePath) => {\n webf.hybridHistory.popUntil(path)\n },\n \n /**\n * Pop the current route and push a new named route\n */\n popAndPushNamed: async <T extends RoutePath>(path: T, state?: any) => {\n webf.hybridHistory.popAndPushNamed(path, {arguments: state})\n },\n \n /**\n * Push a new route and remove routes until reaching a specific route\n */\n pushNamedAndRemoveUntil: async <T extends RoutePath>(path: T, state: any, untilPath: RoutePath) => {\n webf.hybridHistory.pushNamedAndRemoveUntil(state, path, untilPath)\n },\n \n /**\n * Push a new route and remove all routes until a specific route (Flutter-style)\n */\n pushNamedAndRemoveUntilRoute: async <T extends RoutePath>(newPath: T, untilPath: RoutePath, state?: any) => {\n webf.hybridHistory.pushNamedAndRemoveUntilRoute(newPath, untilPath, { arguments: state })\n },\n \n /**\n * Check if the navigator can go back\n */\n canPop: (): boolean => {\n return webf.hybridHistory.canPop();\n },\n \n /**\n * Pop the current route if possible\n * Returns true if the pop was successful, false otherwise\n */\n maybePop: (result?: any): boolean => {\n return webf.hybridHistory.maybePop(result);\n },\n \n /**\n * Push a new state to the history stack (web-style navigation)\n */\n pushState: (state: any, name: string) => {\n webf.hybridHistory.pushState(state, name);\n },\n \n /**\n * Replace the current history entry with a new one (web-style navigation)\n */\n replaceState: (state: any, name: string) => {\n webf.hybridHistory.replaceState(state, name);\n },\n \n /**\n * Pop and push with restoration capability\n * Returns a restoration ID string\n */\n restorablePopAndPushState: (state: any, name: string): string => {\n return webf.hybridHistory.restorablePopAndPushState(state, name);\n },\n \n /**\n * Pop and push named route with restoration capability\n * Returns a restoration ID string\n */\n restorablePopAndPushNamed: async <T extends RoutePath>(path: T, state?: any): Promise<string> => {\n return webf.hybridHistory.restorablePopAndPushNamed(path, { arguments: state });\n }\n}\n","export var isObject = function (value) {\n return value !== null && typeof value === 'object';\n};\nexport var isFunction = function (value) {\n return typeof value === 'function';\n};\nexport var isString = function (value) {\n return typeof value === 'string';\n};\nexport var isBoolean = function (value) {\n return typeof value === 'boolean';\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isUndef = function (value) {\n return typeof value === 'undefined';\n};","var isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';\nexport default isDev;","import { useMemo, useRef } from 'react';\nimport { isFunction } from '../utils';\nimport isDev from '../utils/isDev';\nfunction useMemoizedFn(fn) {\n if (isDev) {\n if (!isFunction(fn)) {\n console.error(\"useMemoizedFn expected parameter is a function, got \".concat(typeof fn));\n }\n }\n var fnRef = useRef(fn);\n // why not write `fnRef.current = fn`?\n // https://github.com/alibaba/hooks/issues/728\n fnRef.current = useMemo(function () {\n return fn;\n }, [fn]);\n var memoizedFn = useRef();\n if (!memoizedFn.current) {\n memoizedFn.current = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fnRef.current.apply(this, args);\n };\n }\n return memoizedFn.current;\n}\nexport default useMemoizedFn;","import React, { EventHandler, FC, ReactNode, SyntheticEvent, useState } from \"react\";\nimport { createWebFComponent, WebFElementWithMethods } from \"@openwebf/react-core-ui\";\n\nexport interface HybridRouterChangeEvent extends SyntheticEvent {\n readonly state: any;\n readonly kind: 'didPushNext' | 'didPush' | 'didPop' | 'didPopNext';\n readonly path: string;\n}\n\nexport type HybridRouterChangeEventHandler = EventHandler<HybridRouterChangeEvent>;\n\nexport interface WebFHybridRouterProps {\n path: string;\n title?: string;\n onScreen?: HybridRouterChangeEventHandler;\n offScreen?: HybridRouterChangeEventHandler;\n children?: ReactNode;\n}\n\n// Define the element interface for WebFRouterLink\nexport interface WebFRouterLinkElement extends WebFElementWithMethods<{}> {}\n\n// Create the raw component using createWebFComponent\nconst RawWebFRouterLink = createWebFComponent<WebFRouterLinkElement, WebFHybridRouterProps>({\n tagName: 'webf-router-link',\n displayName: 'WebFRouterLink',\n \n // Map props to attributes\n attributeProps: ['path', 'title'],\n \n // Event handlers\n events: [\n {\n propName: 'onScreen',\n eventName: 'onscreen',\n handler: (callback) => (event) => {\n // Cast through unknown first for proper type conversion\n callback(event as unknown as HybridRouterChangeEvent);\n },\n },\n {\n propName: 'offScreen',\n eventName: 'offscreen',\n handler: (callback) => (event) => {\n // Cast through unknown first for proper type conversion\n callback(event as unknown as HybridRouterChangeEvent);\n },\n },\n ],\n});\n\nexport const WebFRouterLink: FC<WebFHybridRouterProps> = function (props: WebFHybridRouterProps) {\n const [isRender, enableRender] = useState(false);\n\n const handleOnScreen = (event: HybridRouterChangeEvent) => {\n enableRender(true);\n \n if (props.onScreen) {\n props.onScreen(event);\n }\n };\n\n return (\n <RawWebFRouterLink title={props.title} path={props.path} onScreen={handleOnScreen} offScreen={props.offScreen}>\n {isRender ? props.children : null}\n </RawWebFRouterLink>\n );\n}","/**\n * Route Component\n *\n * This component is a core part of the application routing system, responsible for:\n * 1. Managing page rendering and lifecycle\n * 2. Providing route context (RouteContext)\n * 3. Handling page navigation bar (AppBar)\n * 4. Providing page lifecycle hooks\n */\n\nimport React, { useState } from 'react'\n// import { Router, RouterEvents$ } from './router'\nimport { useMemoizedFn } from 'ahooks';\nimport { WebFRouterLink } from '../utils/RouterLink';\n\n/**\n * Route component props interface\n */\nexport interface RouteProps {\n /**\n * Page title\n * Displayed in the center of the navigation bar\n */\n title?: string\n /**\n * Page path\n * Must be a member of the RoutePath enum\n */\n path: string\n /**\n * Whether to pre-render\n * If true, the page will be rendered when the app starts, rather than waiting for route navigation\n * Can be used to improve page switching performance or preload data\n *\n * @default false\n */\n prerender?: boolean\n /**\n * Page content\n * The actual page component to render\n */\n element: React.ReactNode\n}\n\n/**\n * Route Component\n *\n * Responsible for managing page rendering, lifecycle and navigation bar\n */\nexport function Route({path, prerender = false, element, title }: RouteProps) {\n // Mark whether the page has been rendered\n const [hasRendered, updateRender] = useState(false)\n\n /**\n * Rendering control logic\n */\n const shouldPrerender = prerender;\n const shouldRenderChildren = shouldPrerender || hasRendered\n\n /**\n * Handle page display event\n */\n const handleOnScreen = useMemoizedFn(() => {\n updateRender(true);\n })\n\n /**\n * Handle page hide event\n */\n const handleOffScreen = useMemoizedFn(() => {\n })\n\n return (\n <WebFRouterLink path={path} title={title} onScreen={handleOnScreen} offScreen={handleOffScreen}>\n {shouldRenderChildren ? element : null}\n </WebFRouterLink>\n )\n}\n","import React, { createContext, useContext, useMemo, Children, isValidElement, useState, useEffect } from 'react';\nimport { Route } from './Route';\nimport { WebFRouter } from './utils';\nimport { HybridRouterChangeEvent } from '../utils/RouterLink';\n\n/**\n * Route context interface\n *\n * Provides page route related state and methods, accessed through the useRouteContext hook\n *\n * @template S - Page state type, defaults to undefined\n */\ninterface RouteContext<S = any> {\n /**\n * Page path\n * Current route path, corresponds to RoutePath enum\n */\n path: string | undefined\n /**\n * Page state\n * State data passed during route navigation\n */\n params: S | undefined\n /**\n * Current active path from router\n */\n activePath: string | undefined\n /**\n * Route event kind\n */\n routeEventKind?: 'didPushNext' | 'didPush' | 'didPop' | 'didPopNext'\n}\n\n/**\n * Route context default value\n */\nconst RouteContext = createContext<RouteContext>({\n path: undefined,\n params: undefined,\n activePath: undefined,\n routeEventKind: undefined\n});\n\n/**\n * Hook to get route context\n *\n * Use generic parameters to specify the route path and automatically infer the corresponding state type\n *\n * @template T - Route path type, must be a member of the RoutePath enum\n * @returns Type-safe route context object\n *\n * @example\n * ```tsx\n * const { params, path, isActive } = useRouteContext();\n * ```\n */\nexport function useRouteContext() {\n const context = useContext<RouteContext>(RouteContext);\n\n // isActive is true only for push events with matching path\n const isActive = (context.routeEventKind === 'didPush' || context.routeEventKind === 'didPushNext')\n && context.path === context.activePath;\n\n return {\n ...context,\n isActive\n };\n}\n\n/**\n * Location object interface\n */\nexport interface Location {\n /**\n * The path of the current location\n */\n pathname: string;\n /**\n * The state object associated with this location\n */\n state: any;\n /**\n * A unique key for this location\n */\n key?: string;\n}\n\n/**\n * Hook to get the current location\n * \n * @returns Current location object with pathname and state\n * \n * @example\n * ```tsx\n * function MyComponent() {\n * const location = useLocation();\n * \n * console.log('Current path:', location.pathname);\n * console.log('Location state:', location.state);\n * console.log('Is active:', location.isActive);\n * \n * return <div>Current path: {location.pathname}</div>;\n * }\n * ```\n */\nexport function useLocation(): Location & { isActive: boolean } {\n const context = useRouteContext();\n\n // Create location object from context\n const location = useMemo(() => {\n // For active routes, return the current location with state\n if (context.isActive) {\n return {\n pathname: context.path || context.activePath || WebFRouter.path,\n state: context.params,\n isActive: true,\n key: `${context.path}-active-${Date.now()}`\n };\n }\n\n // For inactive routes, return the global location without state\n return {\n pathname: context.activePath || WebFRouter.path,\n state: undefined,\n isActive: false,\n key: `${context.activePath}-inactive`\n };\n }, [context.isActive, context.path, context.activePath, context.params]);\n\n return location;\n}\n\n/**\n * Route configuration object\n */\nexport interface RouteObject {\n /**\n * Path for the route\n */\n path: string;\n /**\n * Element to render for this route\n */\n element: React.ReactNode;\n /**\n * Whether to pre-render this route\n */\n prerender?: boolean;\n /**\n * Child routes (not supported yet)\n */\n children?: RouteObject[];\n}\n\n/**\n * Props for the Routes component\n */\nexport interface RoutesProps {\n /**\n * Route components as children\n */\n children: React.ReactNode;\n}\n\n/**\n * Routes component that wraps multiple Route components and provides shared context\n * \n * @example\n * ```tsx\n * <Routes sharedData={{ user: currentUser, theme: 'dark' }}>\n * <Route path=\"/\" element={<Home />} />\n * <Route path=\"/about\" element={<About />} />\n * <Route path=\"/profile\" element={<Profile />} />\n * </Routes>\n * ```\n */\n/**\n * Route-specific context provider that only updates when the route is active\n */\nfunction RouteContextProvider({ path, children }: { path: string, children: React.ReactNode }) {\n const globalContext = useContext(RouteContext);\n\n // Create a route-specific context that only updates when this route is active\n const routeSpecificContext = useMemo(() => {\n // Only update if this route is the active one\n if (globalContext.activePath === path) {\n return {\n path,\n params: globalContext.params,\n activePath: globalContext.activePath,\n routeEventKind: globalContext.routeEventKind\n };\n }\n // Return previous values if not active\n return {\n path,\n params: undefined,\n activePath: globalContext.activePath,\n routeEventKind: undefined\n };\n }, [path, globalContext.activePath, globalContext.params, globalContext.routeEventKind]);\n\n return (\n <RouteContext.Provider value={routeSpecificContext}>\n {children}\n </RouteContext.Provider>\n );\n}\n\nexport function Routes({ children }: RoutesProps) {\n // State to track current route information\n const [routeState, setRouteState] = useState<RouteContext>({\n path: undefined,\n activePath: undefined,\n params: undefined,\n routeEventKind: undefined\n });\n\n // Listen to hybridrouterchange event\n useEffect(() => {\n const handleRouteChange = (event: Event) => {\n const routeEvent = event as unknown as HybridRouterChangeEvent;\n // Only update activePath for push events\n const newActivePath = (routeEvent.kind === 'didPushNext' || routeEvent.kind === 'didPush')\n ? routeEvent.path\n : routeState.activePath;\n\n // Update state based on event kind\n setRouteState({\n path: routeEvent.path,\n activePath: newActivePath,\n params: routeEvent.state,\n routeEventKind: routeEvent.kind\n });\n };\n\n // Add event listener\n document.addEventListener('hybridrouterchange', handleRouteChange);\n\n // Cleanup on unmount\n return () => {\n document.removeEventListener('hybridrouterchange', handleRouteChange);\n };\n }, [routeState.activePath]);\n\n // Global context value\n const globalContextValue = useMemo(() => ({\n path: undefined,\n params: routeState.params,\n activePath: routeState.activePath,\n routeEventKind: routeState.routeEventKind\n }), [routeState.activePath, routeState.params, routeState.routeEventKind]);\n\n // Wrap each Route component with its own context provider\n const wrappedChildren = useMemo(() => {\n return Children.map(children, (child: React.ReactNode) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n // Ensure only Route components are direct children\n if (child.type !== Route) {\n console.warn('Routes component should only contain Route components as direct children');\n return child;\n }\n\n // Wrap each Route with its own context provider\n const routePath = child.props.path;\n return (\n <RouteContextProvider key={routePath} path={routePath}>\n {child}\n </RouteContextProvider>\n );\n });\n }, [children]);\n\n return (\n <RouteContext.Provider value={globalContextValue}>\n {wrappedChildren}\n </RouteContext.Provider>\n );\n}\n\n/**\n * Hook to create routes from a configuration object\n * \n * @param routes Array of route configuration objects\n * @returns React element tree of Routes and Route components\n * \n * @example\n * ```tsx\n * function App() {\n * const routes = useRoutes([\n * { path: '/', element: <Home /> },\n * { path: '/about', element: <About /> },\n * { path: '/users', element: <Users /> },\n * { path: '/contact', element: <Contact /> }\n * ]);\n * \n * return routes;\n * }\n * ```\n */\nexport function useRoutes(routes: RouteObject[]): React.ReactElement | null {\n // Convert route objects to Route components\n const routeElements = useMemo(() => {\n return routes.map((route) => {\n if (route.children && route.children.length > 0) {\n console.warn('Nested routes are not supported yet');\n }\n\n return (\n <Route\n key={route.path}\n path={route.path}\n element={route.element}\n prerender={route.prerender}\n />\n );\n });\n }, [routes]);\n\n // Return Routes component with Route children\n return <Routes>{routeElements}</Routes>;\n}\n\n\n/**\n * Navigation function type\n */\nexport interface NavigateFunction {\n (to: string, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\n/**\n * Navigation options\n */\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n}\n\n/**\n * Extended navigation object with additional methods\n */\nexport interface NavigationMethods {\n /**\n * Navigate to a route or go back\n */\n navigate: NavigateFunction;\n\n /**\n * Close the current screen and return to the previous one\n */\n pop: (result?: any) => void;\n\n /**\n * Pop routes until reaching a specific route\n */\n popUntil: (path: string) => void;\n\n /**\n * Pop the current route and push a new route\n */\n popAndPush: (path: string, state?: any) => Promise<void>;\n\n /**\n * Push a new route and remove all routes until a specific route\n */\n pushAndRemoveUntil: (newPath: string, untilPath: string, state?: any) => Promise<void>;\n\n /**\n * Check if the navigator can go back\n */\n canPop: () => boolean;\n\n /**\n * Pop the current route if possible\n */\n maybePop: (result?: any) => boolean;\n}\n\n/**\n * Hook to navigate between routes programmatically\n * \n * @example\n * ```tsx\n * function LoginPage() {\n * const { navigate, pop, canPop } = useNavigate();\n * \n * const handleLogin = async () => {\n * await login();\n * navigate('/dashboard');\n * };\n * \n * const handleReplace = () => {\n * navigate('/home', { replace: true });\n * };\n * \n * const handleWithState = () => {\n * navigate('/profile', { state: { from: 'login' } });\n * };\n * \n * const goBack = () => {\n * if (canPop()) {\n * pop();\n * } else {\n * navigate('/');\n * }\n * };\n * }\n * ```\n */\nexport function useNavigate(): NavigationMethods {\n return useMemo(() => {\n function navigate(to: string | number, options?: NavigateOptions): void {\n if (typeof to === 'number') {\n // Handle relative navigation (e.g., -1 for back)\n if (to === -1) {\n WebFRouter.back();\n } else {\n console.warn('Relative navigation other than -1 is not supported yet');\n }\n return;\n }\n\n // Handle absolute navigation\n if (options?.replace) {\n WebFRouter.replace(to, options.state);\n } else {\n WebFRouter.push(to, options?.state);\n }\n }\n\n return {\n navigate: navigate as NavigateFunction,\n pop: WebFRouter.pop,\n popUntil: WebFRouter.popUntil,\n popAndPush: WebFRouter.popAndPushNamed,\n pushAndRemoveUntil: WebFRouter.pushNamedAndRemoveUntilRoute,\n canPop: WebFRouter.canPop,\n maybePop: WebFRouter.maybePop\n };\n }, []);\n}"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACnG,QAAQ,SAAS,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE;AACtG,QAAQ,SAAS,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAA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mB,EAAE,OAAyB,EAAA;AAC9D,YAAA,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;;AAE1B,gBAAA,IAAI,EAAE,KAAK,EAAE,EAAE;oBACb,UAAU,CAAC,IAAI,EAAE;;qBACZ;AACL,oBAAA,OAAO,CAAC,IAAI,CAAC,wDAAwD,CAAC;;gBAExE;;;YAIF,IAAI,OAAO,aAAP,OAAO,KAAA,MAAA,GAAA,MAAA,GAAP,OAAO,CAAE,OAAO,EAAE;gBACpB,UAAU,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC;;iBAChC;AACL,gBAAA,UAAU,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,KAAA,IAAA,IAAP,OAAO,KAAA,MAAA,GAAA,MAAA,GAAP,OAAO,CAAE,KAAK,CAAC;;;QAIvC,OAAO;AACL,YAAA,QAAQ,EAAE,QAA4B;YACtC,GAAG,EAAE,UAAU,CAAC,GAAG;YACnB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,UAAU,EAAE,UAAU,CAAC,eAAe;YACtC,kBAAkB,EAAE,UAAU,CAAC,4BAA4B;YAC3D,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,QAAQ,EAAE,UAAU,CAAC;SACtB;KACF,EAAE,EAAE,CAAC;AACR;;;;","x_google_ignoreList":[0,2,3,4]}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../node_modules/tslib/tslib.es6.js","../src/routes/utils.ts","../node_modules/ahooks/es/utils/index.js","../node_modules/ahooks/es/utils/isDev.js","../node_modules/ahooks/es/useMemoizedFn/index.js","../src/utils/RouterLink.tsx","../src/routes/Route.tsx","../src/routes/Routes.tsx"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","/**\n * Router management module\n *\n * Encapsulates routing navigation functionality with route guard mechanism for permission checks\n */\n// eslint-disable-next-line no-restricted-imports\nimport { webf } from '@openwebf/webf-enterprise-typings';\n\ntype RoutePath = string;\n\n/**\n * WebF Router object - provides comprehensive navigation APIs\n * Combines web-like history management with Flutter-like navigation patterns\n */\nexport const WebFRouter = {\n /**\n * Get the current state object associated with the history entry\n */\n get state() {\n return webf.hybridHistory.state;\n },\n \n /**\n * Get the current route path\n */\n get path() {\n return webf.hybridHistory.path as RoutePath\n },\n \n /**\n * Navigate to a specified route\n * Applies route guards for permission checks before navigation\n */\n push: async <P extends RoutePath>(path: P, state?: any) => {\n\n webf.hybridHistory.pushNamed(path, { arguments: state })\n },\n \n /**\n * Replace the current route without adding to history\n * Applies route guards for permission checks before navigation\n */\n replace: async <P extends RoutePath>(path: P, state?: any) => {\n webf.hybridHistory.pushReplacementNamed(path, { arguments: state});\n },\n \n /**\n * Navigate back to the previous route\n */\n back: () => {\n webf.hybridHistory.back();\n },\n \n /**\n * Close the current screen and return to the previous one\n * Flutter-style navigation method\n */\n pop: (result?: any) => {\n webf.hybridHistory.pop(result);\n },\n \n /**\n * Pop routes until reaching a specific route\n */\n popUntil: (path: RoutePath) => {\n webf.hybridHistory.popUntil(path)\n },\n \n /**\n * Pop the current route and push a new named route\n */\n popAndPushNamed: async <T extends RoutePath>(path: T, state?: any) => {\n webf.hybridHistory.popAndPushNamed(path, {arguments: state})\n },\n \n /**\n * Push a new route and remove routes until reaching a specific route\n */\n pushNamedAndRemoveUntil: async <T extends RoutePath>(path: T, state: any, untilPath: RoutePath) => {\n webf.hybridHistory.pushNamedAndRemoveUntil(state, path, untilPath)\n },\n \n /**\n * Push a new route and remove all routes until a specific route (Flutter-style)\n */\n pushNamedAndRemoveUntilRoute: async <T extends RoutePath>(newPath: T, untilPath: RoutePath, state?: any) => {\n webf.hybridHistory.pushNamedAndRemoveUntilRoute(newPath, untilPath, { arguments: state })\n },\n \n /**\n * Check if the navigator can go back\n */\n canPop: (): boolean => {\n return webf.hybridHistory.canPop();\n },\n \n /**\n * Pop the current route if possible\n * Returns true if the pop was successful, false otherwise\n */\n maybePop: (result?: any): boolean => {\n return webf.hybridHistory.maybePop(result);\n },\n \n /**\n * Push a new state to the history stack (web-style navigation)\n */\n pushState: (state: any, name: string) => {\n webf.hybridHistory.pushState(state, name);\n },\n \n /**\n * Replace the current history entry with a new one (web-style navigation)\n */\n replaceState: (state: any, name: string) => {\n webf.hybridHistory.replaceState(state, name);\n },\n \n /**\n * Pop and push with restoration capability\n * Returns a restoration ID string\n */\n restorablePopAndPushState: (state: any, name: string): string => {\n return webf.hybridHistory.restorablePopAndPushState(state, name);\n },\n \n /**\n * Pop and push named route with restoration capability\n * Returns a restoration ID string\n */\n restorablePopAndPushNamed: async <T extends RoutePath>(path: T, state?: any): Promise<string> => {\n return webf.hybridHistory.restorablePopAndPushNamed(path, { arguments: state });\n }\n}\n\n/**\n * Route parameters extracted from dynamic routes\n */\nexport interface RouteParams {\n [key: string]: string;\n}\n\n/**\n * Route match result\n */\nexport interface RouteMatch {\n path: string;\n params: RouteParams;\n isExact: boolean;\n}\n\n/**\n * Convert a route pattern to a regular expression\n * @param pattern Route pattern like \"/user/:userId\" or \"/category/:catId/product/:prodId\"\n * @returns Object with regex and parameter names\n */\nexport function pathToRegex(pattern: string): { regex: RegExp; paramNames: string[] } {\n const paramNames: string[] = [];\n \n // Escape special regex characters except : and *\n let regexPattern = pattern.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&');\n \n // Replace :param with named capture groups\n regexPattern = regexPattern.replace(/:([^\\/]+)/g, (_, paramName) => {\n paramNames.push(paramName);\n return '([^/]+)';\n });\n \n // Add anchors for exact matching\n regexPattern = `^${regexPattern}$`;\n \n return {\n regex: new RegExp(regexPattern),\n paramNames\n };\n}\n\n/**\n * Match a pathname against a route pattern and extract parameters\n * @param pattern Route pattern like \"/user/:userId\"\n * @param pathname Actual pathname like \"/user/123\"\n * @returns Match result with extracted parameters or null if no match\n */\nexport function matchPath(pattern: string, pathname: string): RouteMatch | null {\n const { regex, paramNames } = pathToRegex(pattern);\n const match = pathname.match(regex);\n \n if (!match) {\n return null;\n }\n \n // Extract parameters from capture groups\n const params: RouteParams = {};\n paramNames.forEach((paramName, index) => {\n params[paramName] = match[index + 1]; // +1 because match[0] is the full match\n });\n \n return {\n path: pattern,\n params,\n isExact: true\n };\n}\n\n/**\n * Find the best matching route from a list of route patterns\n * @param routes Array of route patterns\n * @param pathname Current pathname\n * @returns Best match or null if no routes match\n */\nexport function matchRoutes(routes: string[], pathname: string): RouteMatch | null {\n for (const route of routes) {\n const match = matchPath(route, pathname);\n if (match) {\n return match;\n }\n }\n return null;\n}\n","export var isObject = function (value) {\n return value !== null && typeof value === 'object';\n};\nexport var isFunction = function (value) {\n return typeof value === 'function';\n};\nexport var isString = function (value) {\n return typeof value === 'string';\n};\nexport var isBoolean = function (value) {\n return typeof value === 'boolean';\n};\nexport var isNumber = function (value) {\n return typeof value === 'number';\n};\nexport var isUndef = function (value) {\n return typeof value === 'undefined';\n};","var isDev = process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test';\nexport default isDev;","import { useMemo, useRef } from 'react';\nimport { isFunction } from '../utils';\nimport isDev from '../utils/isDev';\nfunction useMemoizedFn(fn) {\n if (isDev) {\n if (!isFunction(fn)) {\n console.error(\"useMemoizedFn expected parameter is a function, got \".concat(typeof fn));\n }\n }\n var fnRef = useRef(fn);\n // why not write `fnRef.current = fn`?\n // https://github.com/alibaba/hooks/issues/728\n fnRef.current = useMemo(function () {\n return fn;\n }, [fn]);\n var memoizedFn = useRef(undefined);\n if (!memoizedFn.current) {\n memoizedFn.current = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return fnRef.current.apply(this, args);\n };\n }\n return memoizedFn.current;\n}\nexport default useMemoizedFn;","import React, { EventHandler, FC, ReactNode, SyntheticEvent, useState } from \"react\";\nimport { createWebFComponent, WebFElementWithMethods } from \"@openwebf/react-core-ui\";\n\nexport interface HybridRouterChangeEvent extends SyntheticEvent {\n readonly state: any;\n readonly kind: 'didPushNext' | 'didPush' | 'didPop' | 'didPopNext';\n readonly path: string;\n}\n\nexport type HybridRouterChangeEventHandler = EventHandler<HybridRouterChangeEvent>;\n\nexport interface WebFHybridRouterProps {\n path: string;\n title?: string;\n onScreen?: HybridRouterChangeEventHandler;\n offScreen?: HybridRouterChangeEventHandler;\n children?: ReactNode;\n}\n\n// Define the element interface for WebFRouterLink\nexport interface WebFRouterLinkElement extends WebFElementWithMethods<{}> {}\n\n// Create the raw component using createWebFComponent\nconst RawWebFRouterLink = createWebFComponent<WebFRouterLinkElement, WebFHybridRouterProps>({\n tagName: 'webf-router-link',\n displayName: 'WebFRouterLink',\n \n // Map props to attributes\n attributeProps: ['path', 'title'],\n \n // Event handlers\n events: [\n {\n propName: 'onScreen',\n eventName: 'onscreen',\n handler: (callback) => (event) => {\n // Cast through unknown first for proper type conversion\n callback(event as unknown as HybridRouterChangeEvent);\n },\n },\n {\n propName: 'offScreen',\n eventName: 'offscreen',\n handler: (callback) => (event) => {\n // Cast through unknown first for proper type conversion\n callback(event as unknown as HybridRouterChangeEvent);\n },\n },\n ],\n});\n\nexport const WebFRouterLink: FC<WebFHybridRouterProps> = function (props: WebFHybridRouterProps) {\n const [isRender, enableRender] = useState(false);\n\n const handleOnScreen = (event: HybridRouterChangeEvent) => {\n enableRender(true);\n \n if (props.onScreen) {\n props.onScreen(event);\n }\n };\n\n return (\n <RawWebFRouterLink title={props.title} path={props.path} onScreen={handleOnScreen} offScreen={props.offScreen}>\n {isRender ? props.children : null}\n </RawWebFRouterLink>\n );\n}","/**\n * Route Component\n *\n * This component is a core part of the application routing system, responsible for:\n * 1. Managing page rendering and lifecycle\n * 2. Providing route context (RouteContext)\n * 3. Handling page navigation bar (AppBar)\n * 4. Providing page lifecycle hooks\n */\n\nimport React, { useState } from 'react'\n// import { Router, RouterEvents$ } from './router'\nimport { useMemoizedFn } from 'ahooks';\nimport { WebFRouterLink } from '../utils/RouterLink';\n\n/**\n * Route component props interface\n */\nexport interface RouteProps {\n /**\n * Page title\n * Displayed in the center of the navigation bar\n */\n title?: string\n /**\n * Page path\n * Must be a member of the RoutePath enum\n */\n path: string\n /**\n * Whether to pre-render\n * If true, the page will be rendered when the app starts, rather than waiting for route navigation\n * Can be used to improve page switching performance or preload data\n *\n * @default false\n */\n prerender?: boolean\n /**\n * Page content\n * The actual page component to render\n */\n element: React.ReactNode\n}\n\n/**\n * Route Component\n *\n * Responsible for managing page rendering, lifecycle and navigation bar\n */\nexport function Route({path, prerender = false, element, title }: RouteProps) {\n // Mark whether the page has been rendered\n const [hasRendered, updateRender] = useState(false)\n\n /**\n * Rendering control logic\n */\n const shouldPrerender = prerender;\n const shouldRenderChildren = shouldPrerender || hasRendered\n\n /**\n * Handle page display event\n */\n const handleOnScreen = useMemoizedFn(() => {\n updateRender(true);\n })\n\n /**\n * Handle page hide event\n */\n const handleOffScreen = useMemoizedFn(() => {\n })\n\n return (\n <WebFRouterLink path={path} title={title} onScreen={handleOnScreen} offScreen={handleOffScreen}>\n {shouldRenderChildren ? element : null}\n </WebFRouterLink>\n )\n}\n","import React, { createContext, useContext, useMemo, Children, isValidElement, useState, useEffect } from 'react';\nimport { Route } from './Route';\nimport { WebFRouter, RouteParams, matchPath } from './utils';\nimport { HybridRouterChangeEvent } from '../utils/RouterLink';\n\n/**\n * Route context interface\n *\n * Provides page route related state and methods, accessed through the useRouteContext hook\n *\n * @template S - Page state type, defaults to undefined\n */\ninterface RouteContext<S = any> {\n /**\n * Page path\n * Current route path, corresponds to RoutePath enum\n */\n path: string | undefined\n /**\n * Page state\n * State data passed during route navigation\n */\n params: S | undefined\n /**\n * Route parameters extracted from dynamic routes (e.g., :userId in /user/:userId)\n */\n routeParams: RouteParams | undefined\n /**\n * Current active path from router\n */\n activePath: string | undefined\n /**\n * Route event kind\n */\n routeEventKind?: 'didPushNext' | 'didPush' | 'didPop' | 'didPopNext'\n}\n\n/**\n * Route context default value\n */\nconst RouteContext = createContext<RouteContext>({\n path: undefined,\n params: undefined,\n routeParams: undefined,\n activePath: undefined,\n routeEventKind: undefined\n});\n\n/**\n * Hook to get route context\n *\n * Use generic parameters to specify the route path and automatically infer the corresponding state type\n *\n * @template T - Route path type, must be a member of the RoutePath enum\n * @returns Type-safe route context object\n *\n * @example\n * ```tsx\n * const { params, path, isActive } = useRouteContext();\n * ```\n */\nexport function useRouteContext() {\n const context = useContext<RouteContext>(RouteContext);\n\n // isActive is true only for push events with matching path\n const isActive = (context.routeEventKind === 'didPush' || context.routeEventKind === 'didPushNext')\n && context.path === context.activePath;\n\n return {\n ...context,\n isActive\n };\n}\n\n/**\n * Location object interface\n */\nexport interface Location {\n /**\n * The path of the current location\n */\n pathname: string;\n /**\n * The state object associated with this location\n */\n state: any;\n /**\n * A unique key for this location\n */\n key?: string;\n}\n\n/**\n * Hook to get the current location\n * \n * @returns Current location object with pathname and state\n * \n * @example\n * ```tsx\n * function MyComponent() {\n * const location = useLocation();\n * \n * console.log('Current path:', location.pathname);\n\n * console.log('Location state:', location.state);\n * console.log('Is active:', location.isActive);\n * \n * return <div>Current path: {location.pathname}</div>;\n * }\n * ```\n */\nexport function useLocation(): Location & { isActive: boolean } {\n const context = useRouteContext();\n\n // Create location object from context\n const location = useMemo(() => {\n const currentPath = context.path || context.activePath || WebFRouter.path;\n let pathname = currentPath;\n\n \n // Check if the current component's route matches the active path\n const isCurrentRoute = context.path === context.activePath;\n \n // Get state - prioritize context params, fallback to WebFRouter.state\n const state = (context.isActive || isCurrentRoute) \n ? (context.params || WebFRouter.state)\n : WebFRouter.state;\n \n return {\n pathname,\n state,\n isActive: context.isActive,\n key: `${pathname}-${Date.now()}`\n };\n }, [context.isActive, context.path, context.activePath, context.params]);\n\n return location;\n}\n\n/**\n * Hook to get route parameters from dynamic routes\n * \n * @returns Route parameters object with parameter names as keys and values as strings\n * \n * @example\n * ```tsx\n * // For route pattern \"/user/:userId\" and actual path \"/user/123\"\n * function UserPage() {\n * const params = useParams();\n * \n * console.log(params.userId); // \"123\"\n * \n * return <div>User ID: {params.userId}</div>;\n * }\n * ```\n */\nexport function useParams(): RouteParams {\n const context = useRouteContext();\n \n return useMemo(() => {\n return context.routeParams || {};\n }, [context.routeParams]);\n}\n\n/**\n * Route configuration object\n */\nexport interface RouteObject {\n /**\n * Path for the route\n */\n path: string;\n /**\n * Element to render for this route\n */\n element: React.ReactNode;\n /**\n * Whether to pre-render this route\n */\n prerender?: boolean;\n /**\n * Child routes (not supported yet)\n */\n children?: RouteObject[];\n}\n\n/**\n * Props for the Routes component\n */\nexport interface RoutesProps {\n /**\n * Route components as children\n */\n children: React.ReactNode;\n}\n\n/**\n * Routes component that wraps multiple Route components and provides shared context\n * \n * @example\n * ```tsx\n * <Routes sharedData={{ user: currentUser, theme: 'dark' }}>\n * <Route path=\"/\" element={<Home />} />\n * <Route path=\"/about\" element={<About />} />\n * <Route path=\"/profile\" element={<Profile />} />\n * </Routes>\n * ```\n */\n/**\n * Route-specific context provider that only updates when the route is active\n */\nfunction RouteContextProvider({ path, children }: { path: string, children: React.ReactNode }) {\n const globalContext = useContext(RouteContext);\n\n // Create a route-specific context that only updates when this route is active\n const routeSpecificContext = useMemo(() => {\n // Check if this route pattern matches the active path\n const match = globalContext.activePath ? matchPath(path, globalContext.activePath) : null;\n \n if (match) {\n // Use route params from Flutter event if available, otherwise from local matching\n const effectiveRouteParams = globalContext.routeParams || match.params;\n \n // For matching routes, always try to get state from WebFRouter if params is undefined\n const effectiveParams = globalContext.params !== undefined ? globalContext.params : WebFRouter.state;\n \n return {\n path,\n params: effectiveParams,\n routeParams: effectiveRouteParams,\n activePath: globalContext.activePath,\n routeEventKind: globalContext.routeEventKind\n };\n }\n // Return previous values if not active\n return {\n path,\n params: undefined,\n routeParams: undefined,\n activePath: globalContext.activePath,\n routeEventKind: undefined\n };\n }, [path, globalContext.activePath, globalContext.params, globalContext.routeParams, globalContext.routeEventKind]);\n\n return (\n <RouteContext.Provider value={routeSpecificContext}>\n {children}\n </RouteContext.Provider>\n );\n}\n\nexport function Routes({ children }: RoutesProps) {\n // State to track current route information\n const [routeState, setRouteState] = useState<RouteContext>({\n path: undefined,\n activePath: WebFRouter.path, // Initialize with current path\n params: undefined,\n routeParams: undefined,\n routeEventKind: undefined\n });\n \n // Listen to hybridrouterchange event\n useEffect(() => {\n const handleRouteChange = (event: Event) => {\n const timestamp = Date.now();\n const routeEvent = event as unknown as HybridRouterChangeEvent;\n \n // Check for new event detail structure with params\n const eventDetail = (event as any).detail;\n \n // Only update activePath for push events\n const newActivePath = (routeEvent.kind === 'didPushNext' || routeEvent.kind === 'didPush')\n ? routeEvent.path\n : routeState.activePath;\n\n // For dynamic routes, extract parameters from the path using registered route patterns\n let routeParams = eventDetail?.params || undefined;\n if (!routeParams && newActivePath) {\n // Try to extract parameters from registered route patterns\n const registeredRoutes = Array.from(document.querySelectorAll('webf-router-link'));\n for (const routeElement of registeredRoutes) {\n const routePath = routeElement.getAttribute('path');\n if (routePath && routePath.includes(':')) {\n const match = matchPath(routePath, newActivePath);\n if (match) {\n routeParams = match.params;\n break;\n }\n }\n }\n }\n \n const eventState = eventDetail?.state || routeEvent.state;\n\n // Update state based on event kind\n setRouteState({\n path: routeEvent.path,\n activePath: newActivePath,\n params: eventState,\n routeParams: routeParams, // Use params from Flutter if available\n routeEventKind: routeEvent.kind\n });\n };\n\n // Add event listener\n document.addEventListener('hybridrouterchange', handleRouteChange);\n\n // Cleanup on unmount\n return () => {\n document.removeEventListener('hybridrouterchange', handleRouteChange);\n };\n }, [routeState.activePath]);\n\n // Global context value\n const globalContextValue = useMemo(() => ({\n path: undefined,\n params: routeState.params,\n routeParams: routeState.routeParams, // Pass through route params from Flutter\n activePath: routeState.activePath,\n routeEventKind: routeState.routeEventKind\n }), [routeState.activePath, routeState.params, routeState.routeParams, routeState.routeEventKind]);\n\n // Wrap each Route component with its own context provider\n const wrappedChildren = useMemo(() => {\n return Children.map(children, (child: React.ReactNode) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n // Ensure only Route components are direct children\n if (child.type !== Route) {\n console.warn('Routes component should only contain Route components as direct children');\n return child;\n }\n\n // Wrap each Route with its own context provider\n const routePath = child.props.path;\n return (\n <RouteContextProvider key={routePath} path={routePath}>\n {child}\n </RouteContextProvider>\n );\n });\n }, [children]);\n\n return (\n <RouteContext.Provider value={globalContextValue}>\n {wrappedChildren}\n </RouteContext.Provider>\n );\n}\n\n/**\n * Hook to create routes from a configuration object\n * \n * @param routes Array of route configuration objects\n * @returns React element tree of Routes and Route components\n * \n * @example\n * ```tsx\n * function App() {\n * const routes = useRoutes([\n * { path: '/', element: <Home /> },\n * { path: '/about', element: <About /> },\n * { path: '/users', element: <Users /> },\n * { path: '/contact', element: <Contact /> }\n * ]);\n * \n * return routes;\n * }\n * ```\n */\nexport function useRoutes(routes: RouteObject[]): React.ReactElement | null {\n // Convert route objects to Route components\n const routeElements = useMemo(() => {\n return routes.map((route) => {\n if (route.children && route.children.length > 0) {\n console.warn('Nested routes are not supported yet');\n }\n\n return (\n <Route\n key={route.path}\n path={route.path}\n element={route.element}\n prerender={route.prerender}\n />\n );\n });\n }, [routes]);\n\n // Return Routes component with Route children\n return <Routes>{routeElements}</Routes>;\n}\n\n\n/**\n * Navigation function type\n */\nexport interface NavigateFunction {\n (to: string, options?: NavigateOptions): void;\n (delta: number): void;\n}\n\n/**\n * Navigation options\n */\nexport interface NavigateOptions {\n replace?: boolean;\n state?: any;\n}\n\n/**\n * Extended navigation object with additional methods\n */\nexport interface NavigationMethods {\n /**\n * Navigate to a route or go back\n */\n navigate: NavigateFunction;\n\n /**\n * Close the current screen and return to the previous one\n */\n pop: (result?: any) => void;\n\n /**\n * Pop routes until reaching a specific route\n */\n popUntil: (path: string) => void;\n\n /**\n * Pop the current route and push a new route\n */\n popAndPush: (path: string, state?: any) => Promise<void>;\n\n /**\n * Push a new route and remove all routes until a specific route\n */\n pushAndRemoveUntil: (newPath: string, untilPath: string, state?: any) => Promise<void>;\n\n /**\n * Check if the navigator can go back\n */\n canPop: () => boolean;\n\n /**\n * Pop the current route if possible\n */\n maybePop: (result?: any) => boolean;\n}\n\n/**\n * Hook to navigate between routes programmatically\n * \n * @example\n * ```tsx\n * function LoginPage() {\n * const { navigate, pop, canPop } = useNavigate();\n * \n * const handleLogin = async () => {\n * await login();\n * navigate('/dashboard');\n * };\n * \n * const handleReplace = () => {\n * navigate('/home', { replace: true });\n * };\n * \n * const handleWithState = () => {\n * navigate('/profile', { state: { from: 'login' } });\n * };\n * \n * const goBack = () => {\n * if (canPop()) {\n * pop();\n * } else {\n * navigate('/');\n * }\n * };\n * }\n * ```\n */\nexport function useNavigate(): NavigationMethods {\n return useMemo(() => {\n function navigate(to: string | number, options?: NavigateOptions): void {\n if (typeof to === 'number') {\n // Handle relative navigation (e.g., -1 for back)\n if (to === -1) {\n WebFRouter.back();\n } else {\n console.warn('Relative navigation other than -1 is not supported yet');\n }\n return;\n }\n\n // Handle absolute navigation\n if (options?.replace) {\n WebFRouter.replace(to, options.state);\n } else {\n WebFRouter.push(to, options?.state);\n }\n }\n\n return {\n navigate: navigate as NavigateFunction,\n pop: WebFRouter.pop,\n popUntil: WebFRouter.popUntil,\n popAndPush: WebFRouter.popAndPushNamed,\n pushAndRemoveUntil: WebFRouter.pushNamedAndRemoveUntilRoute,\n canPop: WebFRouter.canPop,\n maybePop: WebFRouter.maybePop\n };\n }, []);\n}"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAkGA;AACO,SAAS,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,SAAS,EAAE;AAC7D,IAAI,SAAS,KAAK,CAAC,KAAK,EAAE,EAAE,OAAO,KAAK,YAAY,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,UAAU,OAAO,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;AAChH,IAAI,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,EAAE,UAAU,OAAO,EAAE,MAAM,EAAE;AAC/D,QAAQ,SAAS,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAA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