@lwrjs/router 0.10.0-alpha.15 → 0.10.0-alpha.17

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.
Files changed (129) hide show
  1. package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentView/currentView.d.ts +2 -3
  2. package/build/bundle/prod/lwr/navigation/navigation.js +1 -1
  3. package/build/bundle/prod/lwr/router/es/modules/lwr/currentView/currentView.d.ts +2 -3
  4. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentView/currentView.d.ts +2 -3
  5. package/build/cjs/modules/lwr/navigation/navigationMixin.cjs +11 -4
  6. package/build/es/modules/lwr/currentPageReference/currentPageReference.d.ts +1 -1
  7. package/build/es/modules/lwr/currentView/currentView.d.ts +2 -2
  8. package/build/es/modules/lwr/domRouter/domRouter.d.ts +2 -2
  9. package/build/es/modules/lwr/domRouterUtils/historyUtils.d.ts +1 -1
  10. package/build/es/modules/lwr/domRouterUtils/types.d.ts +1 -1
  11. package/build/es/modules/lwr/navigation/navigationMixin.js +13 -4
  12. package/build/es/modules/lwr/navigationContext/navigationContext.d.ts +2 -2
  13. package/build/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +2 -2
  14. package/build/es/modules/lwr/routerUtils/filterUtils.d.ts +1 -1
  15. package/build/es/modules/lwr/routerUtils/pathToRegexp.d.ts +5 -5
  16. package/build/es/modules/lwr/routerUtils/types.d.ts +24 -24
  17. package/build/modules/lwr/navigation/navigationMixin.js +12 -4
  18. package/build/modules/lwr/outlet/outlet.html +1 -1
  19. package/package.json +18 -7
  20. package/pageObjects/outlet.cjs +2 -2
  21. package/pageObjects/outlet.js +2 -2
  22. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  23. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  24. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  25. package/build/bundle/prod/lwr/navigation/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  26. package/build/bundle/prod/lwr/navigation/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  27. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  28. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  29. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  30. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  31. package/build/bundle/prod/lwr/navigation/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  32. package/build/bundle/prod/lwr/navigation/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  33. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigation.d.ts +0 -16
  34. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  35. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  36. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  37. package/build/bundle/prod/lwr/navigation/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  38. package/build/bundle/prod/lwr/navigation/es/modules/lwr/observable/observable.d.ts +0 -14
  39. package/build/bundle/prod/lwr/navigation/es/modules/lwr/outlet/outlet.d.ts +0 -19
  40. package/build/bundle/prod/lwr/navigation/es/modules/lwr/router/router.d.ts +0 -11
  41. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  42. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  43. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  44. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  45. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  46. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  47. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  48. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  49. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  50. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  51. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  52. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  53. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/types.d.ts +0 -133
  54. package/build/bundle/prod/lwr/navigation/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  55. package/build/bundle/prod/lwr/navigation/es/services/index.d.ts +0 -28
  56. package/build/bundle/prod/lwr/navigation/es/services/module-provider/index.d.ts +0 -22
  57. package/build/bundle/prod/lwr/navigation/es/services/module-provider/utils.d.ts +0 -27
  58. package/build/bundle/prod/lwr/router/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  59. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  60. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  61. package/build/bundle/prod/lwr/router/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  62. package/build/bundle/prod/lwr/router/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  63. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  64. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  65. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  66. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  67. package/build/bundle/prod/lwr/router/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  68. package/build/bundle/prod/lwr/router/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  69. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigation.d.ts +0 -16
  70. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  71. package/build/bundle/prod/lwr/router/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  72. package/build/bundle/prod/lwr/router/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  73. package/build/bundle/prod/lwr/router/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  74. package/build/bundle/prod/lwr/router/es/modules/lwr/observable/observable.d.ts +0 -14
  75. package/build/bundle/prod/lwr/router/es/modules/lwr/outlet/outlet.d.ts +0 -19
  76. package/build/bundle/prod/lwr/router/es/modules/lwr/router/router.d.ts +0 -11
  77. package/build/bundle/prod/lwr/router/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  78. package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  79. package/build/bundle/prod/lwr/router/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  80. package/build/bundle/prod/lwr/router/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  81. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  82. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  83. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  84. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  85. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  86. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  87. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  88. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  89. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/types.d.ts +0 -133
  90. package/build/bundle/prod/lwr/router/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  91. package/build/bundle/prod/lwr/router/es/services/index.d.ts +0 -28
  92. package/build/bundle/prod/lwr/router/es/services/module-provider/index.d.ts +0 -22
  93. package/build/bundle/prod/lwr/router/es/services/module-provider/utils.d.ts +0 -27
  94. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextProvider/contextProvider.d.ts +0 -14
  95. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextInfo.d.ts +0 -60
  96. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/contextUtils.d.ts +0 -24
  97. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/contextUtils/navigationApiStore.d.ts +0 -45
  98. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/currentPageReference/currentPageReference.d.ts +0 -9
  99. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouter/domRouter.d.ts +0 -192
  100. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/domRouterUtils.d.ts +0 -4
  101. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/historyUtils.d.ts +0 -21
  102. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/types.d.ts +0 -16
  103. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/domRouterUtils/uriUtils.d.ts +0 -30
  104. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/historyRouter/historyRouter.d.ts +0 -48
  105. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigation.d.ts +0 -16
  106. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationApi.d.ts +0 -22
  107. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigation/navigationMixin.d.ts +0 -15
  108. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationContext/navigationContext.d.ts +0 -5
  109. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/navigationMixinHacks/navigationMixinHacks.d.ts +0 -7
  110. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/observable/observable.d.ts +0 -14
  111. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/outlet/outlet.d.ts +0 -19
  112. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/router/router.d.ts +0 -11
  113. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerBridge/routerBridge.d.ts +0 -13
  114. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/routerContainer.d.ts +0 -51
  115. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerContainer/utils.d.ts +0 -32
  116. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerErrors/routerErrors.d.ts +0 -13
  117. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/domUtils.d.ts +0 -2
  118. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/filterUtils.d.ts +0 -19
  119. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/parseUtils.d.ts +0 -42
  120. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/pathToRegexp.d.ts +0 -128
  121. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeDefUtils.d.ts +0 -43
  122. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routeUtils.d.ts +0 -39
  123. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/routerUtils.d.ts +0 -22
  124. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/typeUtils.d.ts +0 -38
  125. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/types.d.ts +0 -133
  126. package/build/bundle/prod/lwr/routerContainer/es/modules/lwr/routerUtils/uriUtils.d.ts +0 -66
  127. package/build/bundle/prod/lwr/routerContainer/es/services/index.d.ts +0 -28
  128. package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/index.d.ts +0 -22
  129. package/build/bundle/prod/lwr/routerContainer/es/services/module-provider/utils.d.ts +0 -27
@@ -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
@@ -1,192 +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 { RouteChange, DomRouterConfig } from 'lwr/domRouterUtils';
8
- import type { ContextId } from 'lwr/navigationContext';
9
- import type { Filter, MessageObject } from 'lwr/routerUtils';
10
- import type { PageReference, Router, RouteCallback, RoutingMatch, RoutingResult } from 'lwr/router';
11
- import type { Observable, Unsubscriber } from 'lwr/observable';
12
- export declare const NAV_EVENT: string;
13
- export declare const PARENT_EVENT: string;
14
- interface RouterParent {
15
- addChild(child: DomRouter): Promise<void>;
16
- }
17
- export declare type ParentRouterEvent = CustomEvent<(router: RouterParent) => void>;
18
- declare type DomRoutingMatch = RoutingMatch & {
19
- url: string;
20
- };
21
- interface DomRouterNode extends RouterParent {
22
- root: DomRouter;
23
- parent?: DomRouter;
24
- child?: DomRouter;
25
- connected: boolean;
26
- process(url: string, replace?: boolean): Promise<boolean>;
27
- processError(messageObject: MessageObject): void;
28
- preProcess(url: string): Promise<boolean>;
29
- }
30
- export interface DomRouter extends DomRouterNode {
31
- router: Router<PageReference>;
32
- pendingRoute: DomRoutingMatch | null;
33
- committedRoute: DomRoutingMatch | null;
34
- contextId: ContextId;
35
- historyDisabled?: boolean;
36
- connect(): void;
37
- disconnect(): void;
38
- addPreNavigate(filters: Filter<RouteChange> | Filter<RouteChange>[]): void;
39
- addErrorNavigate(filters: Filter<MessageObject> | Filter<MessageObject>[]): void;
40
- navigate(address: PageReference, replace?: boolean): void;
41
- generateUrl(address: PageReference): string | null;
42
- subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
43
- }
44
- export declare class DomRouterImpl implements DomRouter {
45
- config: Required<DomRouterConfig>;
46
- target: EventTarget;
47
- router: Router<PageReference>;
48
- pendingRoute: DomRoutingMatch | null;
49
- committedRoute: DomRoutingMatch | null;
50
- routeObservable: Observable<RoutingResult>;
51
- eventId?: string;
52
- contextId: ContextId;
53
- connected: boolean;
54
- parent?: DomRouter;
55
- child?: DomRouter;
56
- preNavFilters: import("lwr/routerUtils").FilterChain<RouteChange>;
57
- errorNavFilters: import("lwr/routerUtils").FilterChain<MessageObject>;
58
- /**
59
- * Create and configure the Router.
60
- *
61
- * @param {object} config - The domRouter config object, all properties are optional
62
- * @param {object} router - an optional Router
63
- * @param {HTMLElement} target - DOM node to attach to
64
- */
65
- constructor(config: DomRouterConfig, router: Router<PageReference>, target?: EventTarget);
66
- /**
67
- * Search up the node chain until the root node is hit
68
- */
69
- get root(): DomRouter;
70
- /**
71
- * Informs an wire listeners of routing changes/errors
72
- *
73
- * @param {RoutingResult} result - result object from navigation event
74
- * @param {string} url - url from the page reference that triggered the navigation event
75
- * @param {MessageObject} error - if an error occurred during the navigation
76
- */
77
- updateWires(result: RoutingResult, url: string, error?: MessageObject): void;
78
- /**
79
- * Override to provide this router as a navigation context
80
- */
81
- connect(): void;
82
- disconnect(): void;
83
- /**
84
- * Add listeners to this router hook which run BEFORE a new URL is processed (root -> leaf).
85
- *
86
- * @param {object | object[]} filters
87
- */
88
- addPreNavigate(filters: Filter<RouteChange> | Filter<RouteChange>[]): void;
89
- /**
90
- * Add listeners to this router hook which run when there is an error navigating.
91
- *
92
- * @param {object | object[]} filters
93
- */
94
- addErrorNavigate(filters: Filter<MessageObject> | Filter<MessageObject>[]): void;
95
- /**
96
- * Override parent implementation.
97
- * Pass the current state down to a new child.
98
- *
99
- * @param {child} child - Child router
100
- */
101
- addChild(child: DomRouter): Promise<void>;
102
- /**
103
- * Process the current URL passed down by the parent router.
104
- * Stop propagation of the navigation event if a preNavigate filter returns false.
105
- *
106
- * Update the current path and route matches.
107
- * Update the observable to hold the new route.
108
- *
109
- * After processing, delegate to a child router, if it exists.
110
- *
111
- * @param {string} url - Relative URL string to process
112
- * @returns {boolean} - True if the processing was NOT blocked by a preNavigate listener
113
- */
114
- process(url: string, replace?: boolean): Promise<boolean>;
115
- /**
116
- * Run the preNavigate filters for this router.
117
- * After processing, delegate to a child router, if it exists.
118
- *
119
- * @param {string} url - Relative URL string to process,
120
- * cannot use a route since the processing is done in context
121
- *
122
- * @returns {Promise<boolean>} - Resolves to true if successful
123
- */
124
- preProcess(url: string): Promise<boolean>;
125
- /**
126
- * Run the errorNavigate filters for this router.
127
- * After processing, delegate to a child router, if it exists.
128
- *
129
- * @param {object} e - An error object to pass into the error hook listeners.
130
- */
131
- processError(messageObject: MessageObject): void;
132
- /**
133
- * lightning/navigation
134
- * Fire an event to send the navigation event up the DOM.
135
- * The root router will be the last to catch the event if it is not stopped.
136
- *
137
- * @param {object} address - Address to navigate to
138
- * @param {*} options - Usually a boolean; when true the previous browser history
139
- * entry should be replaced by this one
140
- */
141
- navigate(address: PageReference, replace?: boolean): void;
142
- /**
143
- * lightning/navigation
144
- * Generate a URL based on the given route.
145
- * Return a Promise containing the URL string.
146
- *
147
- * @param {object} route - Route to generate a url for
148
- *
149
- * @returns {Promise<string>}
150
- */
151
- generateUrl(address: PageReference): string | null;
152
- /**
153
- * lightning/navigation
154
- * Subscribe a callback to the Observable on the current route of this router.
155
- *
156
- * @param {function} callback - A callback function invoked when the navigation state changes
157
- * callback(route, routeDef)
158
- * @param {boolean} replay - Flag to determine if callback should be called with current route and data immediately
159
- */
160
- subscribe(callback: RouteCallback, replay?: boolean): Unsubscriber;
161
- /**
162
- * Inspect a navigation event bubbling up from a descendent component.
163
- * This node can choose to stop the event by returning false.
164
- * If propagation is not stopped, and this node is the root (no parent),
165
- * then begin the root -> leaf processing of this new route.
166
- * This will update the navigation event subscribers in each DomRouter, top down.
167
- *
168
- * @param {Event} event - With detail: { url, options }
169
- */
170
- private _handleNavigationEvent;
171
- /**
172
- * Be discovered as a parent for descendent components.
173
- * Stop immediate propagation because we only want 1 parent to be found.
174
- *
175
- * @param {Event} event - With detail: callback
176
- */
177
- private _handleParentEvent;
178
- private _sendEvent;
179
- private _stripUrlForChild;
180
- }
181
- /**
182
- * Create a new root Router, attach to the Window.
183
- * This is the public, programmatic API for root router creation.
184
- * An application can only have ONE root router.
185
- *
186
- * @param {object} config - The router config object
187
- *
188
- * @returns {object} - { addPreNavigate, addErrorNavigate, connect, disconnect }
189
- */
190
- export declare function createDomRouter(config: DomRouterConfig, router: Router<PageReference>, target?: EventTarget): DomRouter;
191
- export {};
192
- //# sourceMappingURL=domRouter.d.ts.map
@@ -1,4 +0,0 @@
1
- export { getRelativeUrl } from './uriUtils';
2
- export { set, replace } from './historyUtils';
3
- export type { DomRouterConfig, NavigationHandler, RouteChange } from './types';
4
- //# sourceMappingURL=domRouterUtils.d.ts.map
@@ -1,21 +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 { RouteInstance } from '../routerUtils/types';
8
- /**
9
- * Sets a history state.
10
-
11
- * @param {string} path - query to set
12
- * @param {object} route - history state object
13
- */
14
- export declare function set(path: string, route?: RouteInstance): void;
15
- /**
16
- * Replaces the current history state.
17
- * @param {string} path - query to use as a replacement
18
- * @param {object} route - history state object
19
- */
20
- export declare function replace(path: string, route?: RouteInstance): void;
21
- //# sourceMappingURL=historyUtils.d.ts.map
@@ -1,16 +0,0 @@
1
- import type { RoutingMatch, PageReference, StringAttributes } from 'lwr/router';
2
- export interface RouteChange {
3
- current?: RoutingMatch;
4
- next: RoutingMatch;
5
- }
6
- export declare type NavigationHandler = (address: PageReference, replace?: boolean) => boolean;
7
- export interface DomRouterConfig {
8
- handleNavigation?: NavigationHandler;
9
- }
10
- export interface UrlObject {
11
- href: string;
12
- origin: string;
13
- pathname: string;
14
- searchParams: StringAttributes;
15
- }
16
- //# sourceMappingURL=types.d.ts.map
@@ -1,30 +0,0 @@
1
- import type { UrlObject } from './types';
2
- /**
3
- * helper: f(url) -> new URL
4
- * Query parameter values are URI decoded.
5
-
6
- * @param {string} url - URL string to turn into a URL object
7
-
8
- * @returns {object} { href, pathname, searchParams }
9
-
10
- * @example
11
- * {
12
- * href: 'http://localhost:3001/products?lwr.mode=prod&lwr.locale=es#section',
13
- * origin: 'http://localhost:3001',
14
- * pathname: '/products',
15
- * searchParams: {
16
- * 'lwr.mode': 'prod',
17
- * 'lwr.locale': 'es'
18
- * }
19
- * }
20
- */
21
- export declare function getUrlObject(url?: string): UrlObject;
22
- /**
23
- * f(url) -> "/some/relative/path?param1=one&param2=two&param3"
24
-
25
- * @param {string} url - URL string to make relative, may be a no-op
26
-
27
- * @return {string}
28
- */
29
- export declare function getRelativeUrl(url: string): string;
30
- //# sourceMappingURL=uriUtils.d.ts.map
@@ -1,48 +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 { DomRouterImpl } from 'lwr/domRouter';
8
- import type { Router, PageReference } from 'lwr/router';
9
- import type { DomRouterConfig } from 'lwr/domRouterUtils';
10
- export declare class HistoryRouter extends DomRouterImpl {
11
- historyDisabled: boolean;
12
- /**
13
- * Override.
14
- * Initialize with the current route and listen to the popstate event for future changes.
15
- */
16
- connect(): void;
17
- onpopstate(): void;
18
- disconnect(): void;
19
- /**
20
- * Override.
21
- * Update the browser history if the preNavigate hooks.
22
- *
23
- * @param {string} url - The URL to go to
24
- * @param {boolean} shouldReplace - True if the current history state should be replaced
25
- * @param {boolean} updateHistory - True if the browser history should be updated with the new URL
26
- *
27
- * @returns {boolean} - True if the processing was NOT blocked by a preNavigate listener
28
- */
29
- process(url: string, shouldReplace: boolean, updateHistory?: boolean): Promise<boolean>;
30
- /**
31
- * Update the root route, and trickle down the router tree.
32
- * Redirect to use the base path, if it is missing.
33
- *
34
- * @param {string} url - The URL to go to
35
- */
36
- catchBrowserUpdate(url: string): void;
37
- }
38
- /**
39
- * Create a new root Router, attach to the Window.
40
- * This is the public, programmitic API for root router creation.
41
- * An application can only have ONE root router.
42
- *
43
- * @param {object} config - The router config object
44
- *
45
- * @returns {object} - { addPreNavigate, addPostNavigate, addErrorNavigate, connect, disconnect }
46
- */
47
- export declare function createHistoryRouter(config: DomRouterConfig, router: Router<PageReference>, target?: EventTarget): HistoryRouter;
48
- //# sourceMappingURL=historyRouter.d.ts.map
@@ -1,16 +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
- export { NavigationContext } from 'lwr/navigationContext';
8
- export { CurrentPageReference } from 'lwr/currentPageReference';
9
- export { CurrentView } from 'lwr/currentView';
10
- export type { ContextId } from 'lwr/navigationContext';
11
- export type { PageReference, RouteInstance } from 'lwr/router';
12
- export type { Constructable } from 'lwr/routerUtils';
13
- export { ContextInfo, getNavigationHelm, registerNavigationHelm, generateContextualWireAdapter, } from 'lwr/contextUtils';
14
- export { navigate, generateUrl } from './navigationApi';
15
- export { NavigationMixin } from './navigationMixin';
16
- //# sourceMappingURL=navigation.d.ts.map
@@ -1,22 +0,0 @@
1
- import type { ContextId } from 'lwr/navigationContext';
2
- import type { PageReference } from 'lwr/router';
3
- /**
4
- * Navigate programmatically.
5
- * The Promise used within is deliberately not returned.
6
- *
7
- * @param {HTMLElement} context - The navigation context
8
- * @param {object | string} loc - A route or URL for navigating
9
- * @param {*} options - Usually a boolean; when true the previous browser history
10
- * entry should be replaced by this one
11
- */
12
- export declare function navigate(context: ContextId, pageReference: PageReference, replace?: boolean): void;
13
- /**
14
- * Generate a URL for the given route.
15
- *
16
- * @param {HTMLElement} context - The navigation context
17
- * @param {object} route - A route
18
- *
19
- * @returns {Promise<string>}
20
- */
21
- export declare function generateUrl(context: ContextId, pageReference: PageReference): string | null;
22
- //# sourceMappingURL=navigationApi.d.ts.map
@@ -1,15 +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 { Constructor } from 'lwr/routerUtils';
8
- declare function NavigationMixin<TBase extends Constructor>(Base: TBase): TBase;
9
- declare namespace NavigationMixin {
10
- var Navigate: unique symbol;
11
- var GenerateUrl: unique symbol;
12
- var NavContext: unique symbol;
13
- }
14
- export { NavigationMixin };
15
- //# sourceMappingURL=navigationMixin.d.ts.map
@@ -1,5 +0,0 @@
1
- export declare type ContextId = () => void;
2
- declare type NavigationContextType = ContextId | undefined;
3
- export declare const NavigationContext: import("lwr/contextUtils").ContextualWireAdapter<NavigationContextType, unknown, NavigationContextType>;
4
- export {};
5
- //# sourceMappingURL=navigationContext.d.ts.map
@@ -1,7 +0,0 @@
1
- export declare const CONTEXT_ID_BACKDOOR: string;
2
- export declare type NavigationContextBackdoorEvent = globalThis.CustomEvent<NavigationContextBackdoorEventPayload>;
3
- import type { ContextId } from 'lwr/navigation';
4
- export declare type NavigationContextBackdoorEventPayload = {
5
- callback: (contextId: ContextId) => void;
6
- };
7
- //# sourceMappingURL=navigationMixinHacks.d.ts.map
@@ -1,14 +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 { Observer, Observable, Unsubscriber } from '@lwrjs/types';
8
- /**
9
- * Creates a simple observable object, which can have any number of observers.
10
- * @returns {object}
11
- */
12
- export declare function createObservable<V>(): Observable<V>;
13
- export type { Observer, Observable, Unsubscriber };
14
- //# sourceMappingURL=observable.d.ts.map
@@ -1,19 +0,0 @@
1
- import { LightningElement } from 'lwc';
2
- import type { Constructable } from 'lwr/routerUtils';
3
- export interface OutletErrorCallback {
4
- (error: Error, stack: string): void;
5
- }
6
- export default class Outlet extends LightningElement {
7
- static renderMode: string;
8
- refocusOff: boolean;
9
- outletErrorCallback?: OutletErrorCallback;
10
- viewName: string;
11
- viewCtor?: Constructable;
12
- previousViewCtor?: Constructable;
13
- hasError: boolean;
14
- setView(currentView: Constructable): void;
15
- renderedCallback(): void;
16
- errorCallback(e: Error, stack: string): void;
17
- refocus(): void;
18
- }
19
- //# sourceMappingURL=outlet.d.ts.map
@@ -1,11 +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 { PageReference, RouteCallback, RouteDefinition, RouteHandler, RouteHandlerClass, Router, RouterConfig, RouteDestination, RoutingMatch, RoutingResult, ViewSet, ViewInfo } from 'lwr/routerUtils';
8
- export declare function createRouter(config?: RouterConfig): Router<PageReference>;
9
- export type { PageReference, Router, RouterConfig, RouteCallback, RouteDefinition, RouteDestination, RouteHandler, RouteHandlerClass, RoutingMatch, RoutingResult, ViewSet, ViewInfo, };
10
- export type { Module, RouteHandlerCallback, RouteHandlerModule, RouteInstance, StringAttributes, } from 'lwr/routerUtils';
11
- //# sourceMappingURL=router.d.ts.map
@@ -1,13 +0,0 @@
1
- import type { PageReference } from 'lwr/router';
2
- import type { MessageObject } from 'lwr/routerUtils';
3
- export interface RouterBridgeApi {
4
- navigate: (pageRef: PageReference) => boolean;
5
- }
6
- export interface RouterBridgeConfig {
7
- historyDisabled?: boolean;
8
- onReady?: () => void;
9
- onPostNavigate?: (pageRef: PageReference | undefined) => void;
10
- onError?: (error: MessageObject) => boolean;
11
- }
12
- export declare function createBridge(config?: RouterBridgeConfig, target?: globalThis.EventTarget): RouterBridgeApi;
13
- //# sourceMappingURL=routerBridge.d.ts.map
@@ -1,51 +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 { LightningElement } from 'lwc';
8
- import type { RouterApi } from './utils';
9
- import type { MessageObject } from 'lwr/routerUtils';
10
- import type { PageReference, Router, RoutingResult } from 'lwr/router';
11
- import type { RouteChange } from 'lwr/domRouterUtils';
12
- export default class RouterContainer extends LightningElement {
13
- static renderMode: string;
14
- routerApi?: RouterApi;
15
- router?: Router<PageReference>;
16
- historyDisabled: boolean;
17
- currentTitle: string;
18
- constructor();
19
- /**
20
- * Create a router attached to this component.
21
- */
22
- connectedCallback(): void;
23
- /**
24
- * The preNavigate hook surfaced as a cancelable CustomEvent.
25
- * @param {RouteChange} - the current and proposed route information
26
- */
27
- preNavigate(routeChange: RouteChange): boolean;
28
- /**
29
- * The postNavigate hook surfaced as a CustomEvent.
30
- * @param {RoutingResult} - the resulting navigation information
31
- */
32
- postNavigate(routingResult: RoutingResult): void;
33
- /**
34
- * The errorNavigate hook surfaced as a CustomEvent.
35
- * @param {MessageObject} - error, the error encountered while navigating (if applicable)
36
- */
37
- errorNavigate(error: MessageObject): boolean;
38
- /**
39
- * The preNavigate hook surfaced as a cancelable CustomEvent.
40
- * @param {object} - address: The address being navigated to
41
- * @param {boolean} - shouldReplace
42
- */
43
- handleNavigation(address: PageReference, replace?: boolean): boolean;
44
- /**
45
- * Disconnect the router after DOM removal.
46
- */
47
- disconnectedCallback(): void;
48
- private _createEvent;
49
- }
50
- export type { RouteChange } from 'lwr/domRouterUtils';
51
- //# sourceMappingURL=routerContainer.d.ts.map
@@ -1,32 +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 { Filter, MessageObject } from 'lwr/routerUtils';
8
- import type { PageReference, RouteCallback, Router } from 'lwr/router';
9
- import type { DomRouterConfig, RouteChange } from 'lwr/domRouterUtils';
10
- import type { ContextId } from 'lwr/navigationContext';
11
- export interface RouterApi {
12
- addPreNavigate: (filter: Filter<RouteChange>) => RouterApi;
13
- addPostNavigate: (listener: RouteCallback) => RouterApi;
14
- addErrorNavigate: (listener: Filter<MessageObject>) => RouterApi;
15
- connect: () => void;
16
- disconnect: () => void;
17
- id?: ContextId;
18
- }
19
- export interface RouterConfigApi extends DomRouterConfig {
20
- historyDisabled?: boolean;
21
- }
22
- /**
23
- * Create a new navigation context, attach to the given node.
24
- * An application can only have ONE root router.
25
- *
26
- * @param {HTMLElement} - The DOM node where the navigation context should be established
27
- * @param {object} config - The router config object, all properties are optional
28
- *
29
- * @returns {object} - { addPreNavigate, addPostNavigate, addErrorNavigate, connect, disconnect }
30
- */
31
- export declare function createNavigationContext(node: EventTarget, config: RouterConfigApi | undefined, portableRouter: Router<PageReference>): RouterApi;
32
- //# sourceMappingURL=utils.d.ts.map
@@ -1,13 +0,0 @@
1
- /** @hidden */
2
- /**
3
- * Copyright (c) 2019, salesforce.com, inc.
4
- * All rights reserved.
5
- * SPDX-License-Identifier: MIT
6
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
7
- */
8
- import type { MessageObject } from '../routerUtils/types';
9
- export declare function generateMessage(info: MessageObject, args?: string[]): string;
10
- export declare function generateMessageObject(info: MessageObject, args?: string[]): MessageObject;
11
- export declare function invariant(condition: boolean, errorInfo: MessageObject, args?: string[]): void;
12
- export declare const messages: Record<string, MessageObject>;
13
- //# sourceMappingURL=routerErrors.d.ts.map
@@ -1,2 +0,0 @@
1
- export declare const hasDocument: boolean;
2
- //# sourceMappingURL=domUtils.d.ts.map
@@ -1,19 +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
- export declare type Filter<V> = (v: V) => Promise<boolean> | boolean;
8
- export interface FilterChain<V> {
9
- add: (f: Filter<V>[] | Filter<V>) => void;
10
- compile: (arg: V) => Promise<boolean>;
11
- empty: () => boolean;
12
- }
13
- /**
14
- * Creates a filter chain as an array. Filters can return true, false or a Promise resulting in true or false.
15
- *
16
- * @returns {object}
17
- */
18
- export declare function createFilterChain<V>(): FilterChain<V>;
19
- //# sourceMappingURL=filterUtils.d.ts.map