@lwrjs/router 0.10.0-alpha.16 → 0.10.0-alpha.18
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/build/bundle/prod/lwr/navigation/es/modules/lwr/currentView/currentView.d.ts +2 -3
- package/build/bundle/prod/lwr/router/es/modules/lwr/currentView/currentView.d.ts +2 -3
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentView/currentView.d.ts +2 -3
- package/build/es/modules/lwr/currentPageReference/currentPageReference.d.ts +1 -1
- package/build/es/modules/lwr/currentView/currentView.d.ts +2 -2
- package/build/es/modules/lwr/domRouter/domRouter.d.ts +2 -2
- package/build/es/modules/lwr/domRouterUtils/historyUtils.d.ts +1 -1
- package/build/es/modules/lwr/domRouterUtils/types.d.ts +1 -1
- package/build/es/modules/lwr/navigationContext/navigationContext.d.ts +2 -2
- package/build/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +2 -2
- package/build/es/modules/lwr/routerUtils/filterUtils.d.ts +1 -1
- package/build/es/modules/lwr/routerUtils/pathToRegexp.d.ts +5 -5
- package/build/es/modules/lwr/routerUtils/types.d.ts +24 -24
- package/build/modules/lwr/outlet/outlet.html +1 -1
- package/package.json +5 -6
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigation.d.ts +0 -16
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/observable/observable.d.ts +0 -14
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/outlet/outlet.d.ts +0 -19
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/router/router.d.ts +0 -11
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/utils.d.ts +0 -32
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/types.d.ts +0 -133
- package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
- package/build/bundle/prod/lwr/navigation/es/services/index.d.ts +0 -28
- package/build/bundle/prod/lwr/navigation/es/services/module-provider/index.d.ts +0 -22
- package/build/bundle/prod/lwr/navigation/es/services/module-provider/utils.d.ts +0 -27
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
- package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
- package/build/bundle/prod/lwr/router/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
- package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
- package/build/bundle/prod/lwr/router/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigation.d.ts +0 -16
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
- package/build/bundle/prod/lwr/router/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
- package/build/bundle/prod/lwr/router/es/modules/lwr/observable/observable.d.ts +0 -14
- package/build/bundle/prod/lwr/router/es/modules/lwr/outlet/outlet.d.ts +0 -19
- package/build/bundle/prod/lwr/router/es/modules/lwr/router/router.d.ts +0 -11
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/utils.d.ts +0 -32
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/types.d.ts +0 -133
- package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
- package/build/bundle/prod/lwr/router/es/services/index.d.ts +0 -28
- package/build/bundle/prod/lwr/router/es/services/module-provider/index.d.ts +0 -22
- package/build/bundle/prod/lwr/router/es/services/module-provider/utils.d.ts +0 -27
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigation.d.ts +0 -16
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/observable/observable.d.ts +0 -14
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/outlet/outlet.d.ts +0 -19
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/router/router.d.ts +0 -11
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/utils.d.ts +0 -32
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/types.d.ts +0 -133
- package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
- package/build/bundle/prod/lwr/routerContainer/es/services/index.d.ts +0 -28
- package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/index.d.ts +0 -22
- package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/utils.d.ts +0 -27
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="lwc" />
|
|
2
1
|
import type { ViewSet } from 'lwr/router';
|
|
3
2
|
import type { Constructable } from 'lwr/routerUtils';
|
|
4
|
-
|
|
3
|
+
type ViewContext = {
|
|
5
4
|
viewset: ViewSet;
|
|
6
5
|
onComplete?: Function;
|
|
7
6
|
} | undefined;
|
|
8
|
-
|
|
7
|
+
type CurrentViewConfig = {
|
|
9
8
|
viewName?: string;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="lwc" />
|
|
2
1
|
import type { ViewSet } from 'lwr/router';
|
|
3
2
|
import type { Constructable } from 'lwr/routerUtils';
|
|
4
|
-
|
|
3
|
+
type ViewContext = {
|
|
5
4
|
viewset: ViewSet;
|
|
6
5
|
onComplete?: Function;
|
|
7
6
|
} | undefined;
|
|
8
|
-
|
|
7
|
+
type CurrentViewConfig = {
|
|
9
8
|
viewName?: string;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/// <reference types="lwc" />
|
|
2
1
|
import type { ViewSet } from 'lwr/router';
|
|
3
2
|
import type { Constructable } from 'lwr/routerUtils';
|
|
4
|
-
|
|
3
|
+
type ViewContext = {
|
|
5
4
|
viewset: ViewSet;
|
|
6
5
|
onComplete?: Function;
|
|
7
6
|
} | undefined;
|
|
8
|
-
|
|
7
|
+
type CurrentViewConfig = {
|
|
9
8
|
viewName?: string;
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PageReference } from 'lwr/router';
|
|
2
|
-
|
|
2
|
+
type PageReferenceContext = PageReference | undefined;
|
|
3
3
|
/**
|
|
4
4
|
* Services @wire(CurrentPageReference) requests.
|
|
5
5
|
* Hooks up to an Observable from the current navigation context.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="lwc" />
|
|
2
2
|
import type { ViewSet } from 'lwr/router';
|
|
3
3
|
import type { Constructable } from 'lwr/routerUtils';
|
|
4
|
-
|
|
4
|
+
type ViewContext = {
|
|
5
5
|
viewset: ViewSet;
|
|
6
6
|
onComplete?: Function;
|
|
7
7
|
} | undefined;
|
|
8
|
-
|
|
8
|
+
type CurrentViewConfig = {
|
|
9
9
|
viewName?: string;
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
@@ -14,8 +14,8 @@ export declare const PARENT_EVENT: string;
|
|
|
14
14
|
interface RouterParent {
|
|
15
15
|
addChild(child: DomRouter): Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
export
|
|
18
|
-
|
|
17
|
+
export type ParentRouterEvent = CustomEvent<(router: RouterParent) => void>;
|
|
18
|
+
type DomRoutingMatch = RoutingMatch & {
|
|
19
19
|
url: string;
|
|
20
20
|
};
|
|
21
21
|
interface DomRouterNode extends RouterParent {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6
6
|
*/
|
|
7
|
-
import { RouteInstance } from '../routerUtils/types';
|
|
7
|
+
import type { RouteInstance } from '../routerUtils/types';
|
|
8
8
|
/**
|
|
9
9
|
* Sets a history state.
|
|
10
10
|
|
|
@@ -3,7 +3,7 @@ export interface RouteChange {
|
|
|
3
3
|
current?: RoutingMatch;
|
|
4
4
|
next: RoutingMatch;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type NavigationHandler = (address: PageReference, replace?: boolean) => boolean;
|
|
7
7
|
export interface DomRouterConfig {
|
|
8
8
|
handleNavigation?: NavigationHandler;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
1
|
+
export type ContextId = () => void;
|
|
2
|
+
type NavigationContextType = ContextId | undefined;
|
|
3
3
|
export declare const NavigationContext: import("lwr/contextUtils").ContextualWireAdapter<NavigationContextType, unknown, NavigationContextType>;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=navigationContext.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const CONTEXT_ID_BACKDOOR: string;
|
|
2
|
-
export
|
|
2
|
+
export type NavigationContextBackdoorEvent = globalThis.CustomEvent<NavigationContextBackdoorEventPayload>;
|
|
3
3
|
import type { ContextId } from 'lwr/navigation';
|
|
4
|
-
export
|
|
4
|
+
export type NavigationContextBackdoorEventPayload = {
|
|
5
5
|
callback: (contextId: ContextId) => void;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=navigationMixinHacks.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6
6
|
*/
|
|
7
|
-
export
|
|
7
|
+
export type Filter<V> = (v: V) => Promise<boolean> | boolean;
|
|
8
8
|
export interface FilterChain<V> {
|
|
9
9
|
add: (f: Filter<V>[] | Filter<V>) => void;
|
|
10
10
|
compile: (arg: V) => Promise<boolean>;
|
|
@@ -26,7 +26,7 @@ export interface TokensToFunctionOptions {
|
|
|
26
26
|
*/
|
|
27
27
|
validate?: boolean;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type PathFunction<P extends object = object> = (data?: P) => string;
|
|
30
30
|
/**
|
|
31
31
|
* Expose a method for transforming tokens into the path function.
|
|
32
32
|
*/
|
|
@@ -52,11 +52,11 @@ export interface MatchResult<P extends object = object> {
|
|
|
52
52
|
/**
|
|
53
53
|
* A match is either `false` (no match) or a match result.
|
|
54
54
|
*/
|
|
55
|
-
export
|
|
55
|
+
export type Match<P extends object = object> = false | MatchResult<P>;
|
|
56
56
|
/**
|
|
57
57
|
* The match function takes a string and returns whether it matched the path.
|
|
58
58
|
*/
|
|
59
|
-
export
|
|
59
|
+
export type MatchFunction<P extends object = object> = (path: string) => Match<P>;
|
|
60
60
|
/**
|
|
61
61
|
* Create a path match function from `path-to-regexp` output.
|
|
62
62
|
*/
|
|
@@ -74,7 +74,7 @@ export interface Key {
|
|
|
74
74
|
/**
|
|
75
75
|
* A token is a string (nothing special) or key metadata (capture group).
|
|
76
76
|
*/
|
|
77
|
-
export
|
|
77
|
+
export type Token = string | Key;
|
|
78
78
|
export interface TokensToRegexpOptions {
|
|
79
79
|
/**
|
|
80
80
|
* When `true` the regexp will be case sensitive. (default: `false`)
|
|
@@ -112,7 +112,7 @@ export declare function tokensToRegexp(tokens: Token[], keys?: Key[], options?:
|
|
|
112
112
|
/**
|
|
113
113
|
* Supported `path-to-regexp` input types.
|
|
114
114
|
*/
|
|
115
|
-
export
|
|
115
|
+
export type Path = string | RegExp | Array<string | RegExp>;
|
|
116
116
|
/**
|
|
117
117
|
* Normalize the given path string, returning a regular expression.
|
|
118
118
|
*
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import type { Key, PathFunction } from './pathToRegexp';
|
|
2
2
|
import type { ContextId } from 'lwr/navigationContext';
|
|
3
|
-
import { Unsubscriber } from 'lwr/observable';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
3
|
+
import type { Unsubscriber } from 'lwr/observable';
|
|
4
|
+
export type Module = Record<string | symbol | number, unknown>;
|
|
5
|
+
export type Constructor<T = object> = new (...args: any[]) => T;
|
|
6
6
|
export interface Constructable<T = object> {
|
|
7
7
|
constructor: Constructor<T>;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type UrlMapper<TAddress> = {
|
|
10
10
|
generateUrl(address: TAddress): string | null;
|
|
11
11
|
parseUrl(url: string): TAddress | null;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
13
|
+
export type RouteMatcher<TAddress> = {
|
|
14
14
|
matchRoute(address: TAddress): RoutingMatch | null;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type ViewMapper<TAddress> = {
|
|
17
17
|
navigate(address: TAddress): void;
|
|
18
18
|
subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
|
|
19
19
|
resolveView(address: TAddress): Promise<RouteDestination>;
|
|
20
20
|
contextId?: ContextId;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type Router<TAddress = string> = ViewMapper<TAddress> & UrlMapper<TAddress> & RouteMatcher<TAddress>;
|
|
23
23
|
export interface DEPRECATED_getRouteFromUrl {
|
|
24
24
|
<TAddress>(url: string, defaultImpl: Function): TAddress | null;
|
|
25
25
|
}
|
|
26
26
|
export interface DEPRECATED_getUrlFromRoute {
|
|
27
27
|
<TAddress>(route: TAddress, defaultImpl: Function): string | null;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export type RouterConfig = {
|
|
30
30
|
basePath?: string;
|
|
31
31
|
routes?: RouteDefinition[];
|
|
32
32
|
caseSensitive?: boolean;
|
|
33
33
|
DEPRECATED_getRouteFromUrl?: DEPRECATED_getRouteFromUrl;
|
|
34
34
|
DEPRECATED_getUrlFromRoute?: DEPRECATED_getUrlFromRoute;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
37
|
-
export
|
|
36
|
+
export type RouterSerializationConfig<TAddress> = Required<Omit<RouterConfig, 'DEPRECATED_getRouteFromUrl' | 'DEPRECATED_getUrlFromRoute'> & UrlMapper<TAddress>>;
|
|
37
|
+
export type RouteParameterPatterns = {
|
|
38
38
|
[paramName: string]: string;
|
|
39
39
|
};
|
|
40
40
|
export interface RouteDefinition<TMetadata = Record<string, any>> {
|
|
@@ -46,21 +46,21 @@ export interface RouteDefinition<TMetadata = Record<string, any>> {
|
|
|
46
46
|
handler: () => Promise<RouteHandlerModule>;
|
|
47
47
|
metadata?: TMetadata;
|
|
48
48
|
}
|
|
49
|
-
export
|
|
49
|
+
export type PageBindings = {
|
|
50
50
|
attributeBindings: NullableStringAttributes;
|
|
51
51
|
stateBindings: NullableStringAttributes;
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
type CompiledQueryResult = {
|
|
54
54
|
literalValue?: string | null;
|
|
55
55
|
routeParamName?: string;
|
|
56
56
|
};
|
|
57
|
-
export
|
|
58
|
-
|
|
57
|
+
export type CompiledQuery = Record<string, CompiledQueryResult>;
|
|
58
|
+
type MatchedQueryResult = {
|
|
59
59
|
value: string | null;
|
|
60
60
|
routeParamName?: string;
|
|
61
61
|
};
|
|
62
|
-
export
|
|
63
|
-
export
|
|
62
|
+
export type MatchedQuery = Record<string, MatchedQueryResult>;
|
|
63
|
+
export type QueryMatcher = (queryObject: QueryObject) => MatchedQuery | null;
|
|
64
64
|
export interface CompiledRouteDefinition {
|
|
65
65
|
original: RouteDefinition;
|
|
66
66
|
regex: RegExp;
|
|
@@ -69,11 +69,11 @@ export interface CompiledRouteDefinition {
|
|
|
69
69
|
compiledQuery: CompiledQuery;
|
|
70
70
|
queryMatcher: QueryMatcher;
|
|
71
71
|
}
|
|
72
|
-
export
|
|
73
|
-
export
|
|
72
|
+
export type RouteHandlerCallback = (routeDestination: RouteDestination) => void;
|
|
73
|
+
export type RouteHandlerClass = {
|
|
74
74
|
new (callback: RouteHandlerCallback): RouteHandler;
|
|
75
75
|
};
|
|
76
|
-
export
|
|
76
|
+
export type RouteHandlerModule = {
|
|
77
77
|
default: RouteHandlerClass;
|
|
78
78
|
};
|
|
79
79
|
export interface RouteInstance {
|
|
@@ -82,12 +82,12 @@ export interface RouteInstance {
|
|
|
82
82
|
state: NullableStringAttributes;
|
|
83
83
|
pageReference: PageReference;
|
|
84
84
|
}
|
|
85
|
-
export
|
|
85
|
+
export type RouteDestination = {
|
|
86
86
|
status?: 200 | 404 | 500;
|
|
87
87
|
viewset: ViewSet;
|
|
88
88
|
error?: Error;
|
|
89
89
|
};
|
|
90
|
-
export
|
|
90
|
+
export type RoutingMatch = {
|
|
91
91
|
pathMatch: string;
|
|
92
92
|
route: RouteInstance;
|
|
93
93
|
routeDefinition: RouteDefinition;
|
|
@@ -96,7 +96,7 @@ export interface CompiledRoutingMatch {
|
|
|
96
96
|
route: RouteInstance;
|
|
97
97
|
routeDefinition: CompiledRouteDefinition;
|
|
98
98
|
}
|
|
99
|
-
export
|
|
99
|
+
export type RoutingResult = RoutingMatch & RouteDestination;
|
|
100
100
|
export interface ViewSet {
|
|
101
101
|
[viewName: string]: (() => Promise<Module>) | ViewInfo;
|
|
102
102
|
}
|
|
@@ -104,7 +104,7 @@ export interface ViewInfo {
|
|
|
104
104
|
module: () => Promise<Module>;
|
|
105
105
|
specifier: string;
|
|
106
106
|
}
|
|
107
|
-
export
|
|
107
|
+
export type RouteCallback = (result: RoutingResult) => void;
|
|
108
108
|
export interface RouteHandler {
|
|
109
109
|
dispose(): void;
|
|
110
110
|
update(routeInfo: RouteInstance): void;
|
|
@@ -122,7 +122,7 @@ export interface MessageObject {
|
|
|
122
122
|
url?: string;
|
|
123
123
|
address?: string;
|
|
124
124
|
}
|
|
125
|
-
export
|
|
125
|
+
export type QueryObject = NullableStringAttributes;
|
|
126
126
|
export interface StringAttributes {
|
|
127
127
|
[key: string]: string;
|
|
128
128
|
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.10.0-alpha.
|
|
8
|
+
"version": "0.10.0-alpha.18",
|
|
9
9
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"test:server": "jest --config ./jest.server.config.cjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lwrjs/client-modules": "0.10.0-alpha.
|
|
57
|
-
"@lwrjs/diagnostics": "0.10.0-alpha.
|
|
58
|
-
"@lwrjs/shared-utils": "0.10.0-alpha.
|
|
56
|
+
"@lwrjs/client-modules": "0.10.0-alpha.18",
|
|
57
|
+
"@lwrjs/diagnostics": "0.10.0-alpha.18",
|
|
58
|
+
"@lwrjs/shared-utils": "0.10.0-alpha.18",
|
|
59
59
|
"ajv": "6.12.6"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
@@ -64,7 +64,6 @@
|
|
|
64
64
|
"jest": "^26.6.3",
|
|
65
65
|
"rollup": "^2.78.0",
|
|
66
66
|
"ts-jest": "^26.5.6",
|
|
67
|
-
"typescript": "~4.3.5",
|
|
68
67
|
"utam": "^2.0.2"
|
|
69
68
|
},
|
|
70
69
|
"peerDependencies": {
|
|
@@ -96,5 +95,5 @@
|
|
|
96
95
|
"volta": {
|
|
97
96
|
"extends": "../../../package.json"
|
|
98
97
|
},
|
|
99
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "15d09e9a17b6b070e162336234434d6800b2f32d"
|
|
100
99
|
}
|
package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextProvider/contextProvider.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Contextualizer } from 'lwc';
|
|
2
|
-
import type { ContextualWireAdapter } from 'lwr/contextUtils';
|
|
3
|
-
export declare const currentPageReferenceContextualizer: Contextualizer | undefined;
|
|
4
|
-
export declare const currentViewContextualizer: Contextualizer | undefined;
|
|
5
|
-
export declare const navigationContextContextualizer: Contextualizer | undefined;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param {TContext} contextValue - Context API object
|
|
9
|
-
* @param {EventTarget} providerNode - Context DOM element
|
|
10
|
-
* @param {Contextualizer} contextualizer - Function for providing this context to subtree nodes wired to a specific adapter
|
|
11
|
-
* @param {ContextualWireAdapter<TContext, TEmit, TConfig>} contextualAdapter - Contextual wire adapter capable of subscribing to context changes
|
|
12
|
-
*/
|
|
13
|
-
export declare function provideContext<TContext, TEmit, TConfig>(contextValue: TContext, providerNode: EventTarget, contextualizer?: Contextualizer, contextualAdapter?: ContextualWireAdapter<TContext, TEmit, TConfig>): void;
|
|
14
|
-
//# sourceMappingURL=contextProvider.d.ts.map
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { ContextConsumer } from 'lwc';
|
|
2
|
-
/**
|
|
3
|
-
* Manages context for various providers
|
|
4
|
-
*/
|
|
5
|
-
export declare class ContextInfo<TContext> {
|
|
6
|
-
private infoMap;
|
|
7
|
-
/**
|
|
8
|
-
* The default value to be returned in the absence of a defined context
|
|
9
|
-
*/
|
|
10
|
-
private defaultValue;
|
|
11
|
-
constructor(defaultValue: TContext);
|
|
12
|
-
/**
|
|
13
|
-
* Gets the stored info for a context provider
|
|
14
|
-
* @param targetProvider the context provider
|
|
15
|
-
*/
|
|
16
|
-
getInfo(targetProvider: object): {
|
|
17
|
-
consumers: Set<ContextConsumer>;
|
|
18
|
-
contextValue: TContext;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Set the context value directly associated with the target as a context provider.
|
|
22
|
-
*
|
|
23
|
-
* @param {Object} targetProvider
|
|
24
|
-
* @param {FeatureContext} contextValue
|
|
25
|
-
*/
|
|
26
|
-
setContext(targetProvider: object, contextValue: TContext): void;
|
|
27
|
-
/**
|
|
28
|
-
* Get the context value directly associated with the target as a context provider.
|
|
29
|
-
*
|
|
30
|
-
* @param {Object} targetProvider
|
|
31
|
-
*/
|
|
32
|
-
getContext(targetProvider: object): TContext;
|
|
33
|
-
/**
|
|
34
|
-
* Clear the context value and registered subscribers directly associated with the
|
|
35
|
-
* target as a context provider.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} targetProvider
|
|
38
|
-
*/
|
|
39
|
-
clearContext(targetProvider: object): void;
|
|
40
|
-
/**
|
|
41
|
-
* Subscribe a consumer to the context value directly associated with the target as
|
|
42
|
-
* a context provider. Calls to #set(targetProvider, contextValue) with the same
|
|
43
|
-
* target will invoke the consumer.provide(contextValue) function.
|
|
44
|
-
*
|
|
45
|
-
* NOTE: Mutations to the contextValue directly do not result in calls to
|
|
46
|
-
* consumer.provide(contextValue).
|
|
47
|
-
*
|
|
48
|
-
* @param {Object} targetProvider
|
|
49
|
-
* @param {ContextConsumer} consumer object with a provide(context) function property.
|
|
50
|
-
*/
|
|
51
|
-
subscribeContext(targetProvider: object, consumer: ContextConsumer): void;
|
|
52
|
-
/**
|
|
53
|
-
* Unsubscribe a previously subscribed consumer from listening to changes on the
|
|
54
|
-
* target
|
|
55
|
-
* @param {Object} targetProvider
|
|
56
|
-
* @param {ContextConsumer} consumer
|
|
57
|
-
*/
|
|
58
|
-
unsubscribeContext(targetProvider: object, consumer: ContextConsumer): void;
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=contextInfo.d.ts.map
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ContextConsumer } from 'lwc';
|
|
2
|
-
import { ContextInfo } from './contextInfo';
|
|
3
|
-
export { ContextInfo };
|
|
4
|
-
export type { NavigationHelm } from './navigationApiStore';
|
|
5
|
-
export { getNavigationHelm, registerNavigationHelm } from './navigationApiStore';
|
|
6
|
-
export interface WireAdapter<TContext, TConfig, TEmit> {
|
|
7
|
-
_callback(value: TEmit): void;
|
|
8
|
-
update(config: TConfig, context: TContext): void;
|
|
9
|
-
connect(): void;
|
|
10
|
-
disconnect(): void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Interface for contextual wire adapters to subscribe to context changes
|
|
14
|
-
*/
|
|
15
|
-
export interface ContextualWireAdapter<TContext, TConfig, TEmit> {
|
|
16
|
-
new (callback: (value: TEmit) => void): WireAdapter<TContext, TConfig, TEmit>;
|
|
17
|
-
setContext: (targetProvider: globalThis.EventTarget, contextValue: TContext) => void;
|
|
18
|
-
getContext: (targetProvider: globalThis.EventTarget) => TContext;
|
|
19
|
-
clearContext: (targetProvider: globalThis.EventTarget) => void;
|
|
20
|
-
subscribeContext: (targetProvider: globalThis.EventTarget, consumer: ContextConsumer) => void;
|
|
21
|
-
unsubscribeContext: (targetProvider: globalThis.EventTarget, consumer: ContextConsumer) => void;
|
|
22
|
-
}
|
|
23
|
-
export declare function generateContextualWireAdapter<TContext, TConfig = unknown, TEmit = TContext>(contextInstance: ContextInfo<TContext>): ContextualWireAdapter<TContext, TConfig, TEmit>;
|
|
24
|
-
//# sourceMappingURL=contextUtils.d.ts.map
|
package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/navigationApiStore.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019, salesforce.com, inc.
|
|
3
|
-
* All rights reserved.
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6
|
-
*/
|
|
7
|
-
import type { RouteCallback, PageReference } from 'lwr/router';
|
|
8
|
-
import type { Unsubscriber } from 'lwr/observable';
|
|
9
|
-
import type { ContextId } from 'lwr/navigationContext';
|
|
10
|
-
/**
|
|
11
|
-
* Provides the ability for a given context provider to find its NavigationHelm
|
|
12
|
-
* provider by just an ID. Having access to the NavigationHelm allows the consumer
|
|
13
|
-
* to direct navigation. Generally, the Helm is more powerful than the exposed APIs.
|
|
14
|
-
*/
|
|
15
|
-
export interface NavigationHelm {
|
|
16
|
-
navigate: (address: PageReference, replace?: boolean) => void;
|
|
17
|
-
generateUrl: (address: PageReference) => string | null;
|
|
18
|
-
subscribe: (callback: RouteCallback, replay?: boolean) => Unsubscriber;
|
|
19
|
-
}
|
|
20
|
-
interface NavigationContextData {
|
|
21
|
-
id: ContextId;
|
|
22
|
-
value: NavigationHelm;
|
|
23
|
-
update: (newValue: NavigationHelm) => void;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Return a navigation context by ID.
|
|
27
|
-
* Exported API.
|
|
28
|
-
*
|
|
29
|
-
* @param {*} id - The ID of a navigation context.
|
|
30
|
-
*
|
|
31
|
-
* @return {object} - { navigate(), generateUrl(), subscribe() }
|
|
32
|
-
*/
|
|
33
|
-
export declare function getNavigationHelm(id: ContextId): NavigationHelm;
|
|
34
|
-
/**
|
|
35
|
-
* Create and return the metadata for this context provider.
|
|
36
|
-
* Cache the metadata by ID.
|
|
37
|
-
*
|
|
38
|
-
* @param {object} contextValue - Context API object
|
|
39
|
-
* @param {RouteDefinition[]} data - Route data for this context
|
|
40
|
-
*
|
|
41
|
-
* @return {object} - The metadata object
|
|
42
|
-
*/
|
|
43
|
-
export declare function registerNavigationHelm(contextId: ContextId, contextValue: NavigationHelm): NavigationContextData;
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=navigationApiStore.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { PageReference } from 'lwr/router';
|
|
2
|
-
declare type PageReferenceContext = PageReference | undefined;
|
|
3
|
-
/**
|
|
4
|
-
* Services @wire(CurrentPageReference) requests.
|
|
5
|
-
* Hooks up to an Observable from the current navigation context.
|
|
6
|
-
*/
|
|
7
|
-
export declare const CurrentPageReference: import("lwr/contextUtils").ContextualWireAdapter<PageReferenceContext, unknown, PageReferenceContext>;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=currentPageReference.d.ts.map
|