@lwrjs/router 0.24.3 → 0.24.4
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/cjs/modules/lwr/contextProvider/contextProvider.cjs +0 -1
- package/build/cjs/modules/lwr/contextUtils/contextInfo.cjs +5 -2
- package/build/cjs/modules/lwr/contextUtils/contextUtils.cjs +2 -4
- package/build/cjs/modules/lwr/contextUtils/navigationApiStore.cjs +0 -1
- package/build/cjs/modules/lwr/currentPageReference/currentPageReference.cjs +0 -1
- package/build/cjs/modules/lwr/currentView/currentView.cjs +0 -1
- package/build/cjs/modules/lwr/domRouter/domRouter.cjs +54 -48
- package/build/cjs/modules/lwr/domRouterUtils/domRouterUtils.cjs +0 -1
- package/build/cjs/modules/lwr/domRouterUtils/historyUtils.cjs +0 -1
- package/build/cjs/modules/lwr/domRouterUtils/types.cjs +0 -1
- package/build/cjs/modules/lwr/domRouterUtils/uriUtils.cjs +0 -1
- package/build/cjs/modules/lwr/historyRouter/historyRouter.cjs +2 -6
- package/build/cjs/modules/lwr/navigation/constants.cjs +0 -1
- package/build/cjs/modules/lwr/navigation/navigation.cjs +0 -1
- package/build/cjs/modules/lwr/navigation/navigationApi.cjs +0 -1
- package/build/cjs/modules/lwr/navigation/navigationMixin.cjs +0 -1
- package/build/cjs/modules/lwr/navigationContext/navigationContext.cjs +0 -1
- package/build/cjs/modules/lwr/navigationMixinHacks/navigationMixinHacks.cjs +0 -1
- package/build/cjs/modules/lwr/observable/observable.cjs +0 -1
- package/build/cjs/modules/lwr/outlet/outlet.cjs +8 -32
- package/build/cjs/modules/lwr/router/router.cjs +9 -3
- package/build/cjs/modules/lwr/routerBridge/routerBridge.cjs +18 -16
- package/build/cjs/modules/lwr/routerContainer/routerContainer.cjs +6 -19
- package/build/cjs/modules/lwr/routerContainer/utils.cjs +0 -1
- package/build/cjs/modules/lwr/routerErrors/routerErrors.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/domUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/filterUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/parseUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/pathToRegexp.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/routeDefUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/routeUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/routerUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/typeUtils.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/types.cjs +0 -1
- package/build/cjs/modules/lwr/routerUtils/uriUtils.cjs +0 -1
- package/build/cjs/modules/lwr/serverRouter/serverRouter.cjs +7 -2
- package/build/cjs/services/index.cjs +4 -5
- package/build/cjs/services/module-provider/index.cjs +11 -6
- package/build/cjs/services/module-provider/utils.cjs +0 -1
- package/package.json +6 -6
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -29,8 +28,12 @@ function validateProvider(obj) {
|
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
var ContextInfo = class {
|
|
31
|
+
infoMap = /* @__PURE__ */ new WeakMap();
|
|
32
|
+
/**
|
|
33
|
+
* The default value to be returned in the absence of a defined context
|
|
34
|
+
*/
|
|
35
|
+
defaultValue;
|
|
32
36
|
constructor(defaultValue) {
|
|
33
|
-
this.infoMap = /* @__PURE__ */ new WeakMap();
|
|
34
37
|
this.defaultValue = defaultValue;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -37,6 +36,7 @@ function generateContextualWireAdapter(contextInstance) {
|
|
|
37
36
|
}
|
|
38
37
|
disconnect() {
|
|
39
38
|
}
|
|
39
|
+
_callback;
|
|
40
40
|
// The default update method services wires that emit context as TEmit when their value changes.
|
|
41
41
|
// Wires that need more complex logic or use another emit type should override this method.
|
|
42
42
|
update(config, context) {
|
|
@@ -93,9 +93,7 @@ function generateContextualWireAdapter(contextInstance) {
|
|
|
93
93
|
static unsubscribeContext(targetProvider, consumer) {
|
|
94
94
|
contextInstance.unsubscribeContext(targetProvider, consumer);
|
|
95
95
|
}
|
|
96
|
-
static {
|
|
97
|
-
this.contextSchema = { value: "required" };
|
|
98
|
-
}
|
|
96
|
+
static contextSchema = { value: "required" };
|
|
99
97
|
};
|
|
100
98
|
return Adapter;
|
|
101
99
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -37,6 +36,20 @@ var import_navigationMixinHacks = require("lwr/navigationMixinHacks");
|
|
|
37
36
|
var NAV_EVENT = `universalcontainernavigationevent${(0, import_routerUtils.guid)()}`;
|
|
38
37
|
var PARENT_EVENT = `universalcontainerparentevent${(0, import_routerUtils.guid)()}`;
|
|
39
38
|
var DomRouterImpl = class {
|
|
39
|
+
config;
|
|
40
|
+
target;
|
|
41
|
+
router;
|
|
42
|
+
pendingRoute = null;
|
|
43
|
+
committedRoute = null;
|
|
44
|
+
routeObservable;
|
|
45
|
+
eventId;
|
|
46
|
+
// used for instrumentation
|
|
47
|
+
contextId = Object.freeze(() => void 0);
|
|
48
|
+
connected = false;
|
|
49
|
+
parent;
|
|
50
|
+
child;
|
|
51
|
+
preNavFilters = (0, import_routerUtils.createFilterChain)();
|
|
52
|
+
errorNavFilters = (0, import_routerUtils.createFilterChain)();
|
|
40
53
|
/**
|
|
41
54
|
* Create and configure the Router.
|
|
42
55
|
*
|
|
@@ -45,53 +58,6 @@ var DomRouterImpl = class {
|
|
|
45
58
|
* @param {HTMLElement} target - DOM node to attach to
|
|
46
59
|
*/
|
|
47
60
|
constructor(config, router, target) {
|
|
48
|
-
this.pendingRoute = null;
|
|
49
|
-
this.committedRoute = null;
|
|
50
|
-
// used for instrumentation
|
|
51
|
-
this.contextId = Object.freeze(() => void 0);
|
|
52
|
-
this.connected = false;
|
|
53
|
-
this.preNavFilters = (0, import_routerUtils.createFilterChain)();
|
|
54
|
-
this.errorNavFilters = (0, import_routerUtils.createFilterChain)();
|
|
55
|
-
/**
|
|
56
|
-
* Inspect a navigation event bubbling up from a descendent component.
|
|
57
|
-
* This node can choose to stop the event by returning false.
|
|
58
|
-
* If propagation is not stopped, and this node is the root (no parent),
|
|
59
|
-
* then begin the root -> leaf processing of this new route.
|
|
60
|
-
* This will update the navigation event subscribers in each DomRouter, top down.
|
|
61
|
-
*
|
|
62
|
-
* @param {Event} event - With detail: { url, options }
|
|
63
|
-
*/
|
|
64
|
-
this._handleNavigationEvent = (event) => {
|
|
65
|
-
const navigationEvent = event;
|
|
66
|
-
if (navigationEvent.detail && typeof navigationEvent.detail === "object") {
|
|
67
|
-
const { url, replace, address } = navigationEvent.detail;
|
|
68
|
-
const continueNavigation = this.config.handleNavigation(address, replace);
|
|
69
|
-
if (!continueNavigation) {
|
|
70
|
-
navigationEvent.stopPropagation();
|
|
71
|
-
} else {
|
|
72
|
-
if (this.root && !url) {
|
|
73
|
-
this.root.processError(
|
|
74
|
-
(0, import_routerErrors.generateMessageObject)(import_routerErrors.messages.MISSING_URL, [JSON.stringify(address)])
|
|
75
|
-
);
|
|
76
|
-
} else if (!this.parent) {
|
|
77
|
-
this.process(url, replace);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Be discovered as a parent for descendent components.
|
|
84
|
-
* Stop immediate propagation because we only want 1 parent to be found.
|
|
85
|
-
*
|
|
86
|
-
* @param {Event} event - With detail: callback
|
|
87
|
-
*/
|
|
88
|
-
this._handleParentEvent = (event) => {
|
|
89
|
-
event.stopImmediatePropagation();
|
|
90
|
-
const parentRouterEvent = event;
|
|
91
|
-
if (parentRouterEvent && parentRouterEvent.detail && typeof parentRouterEvent.detail === "function") {
|
|
92
|
-
parentRouterEvent.detail(this);
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
61
|
this.config = {
|
|
96
62
|
handleNavigation: config.handleNavigation || (() => true)
|
|
97
63
|
};
|
|
@@ -393,6 +359,46 @@ var DomRouterImpl = class {
|
|
|
393
359
|
Boolean(replay)
|
|
394
360
|
);
|
|
395
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* Inspect a navigation event bubbling up from a descendent component.
|
|
364
|
+
* This node can choose to stop the event by returning false.
|
|
365
|
+
* If propagation is not stopped, and this node is the root (no parent),
|
|
366
|
+
* then begin the root -> leaf processing of this new route.
|
|
367
|
+
* This will update the navigation event subscribers in each DomRouter, top down.
|
|
368
|
+
*
|
|
369
|
+
* @param {Event} event - With detail: { url, options }
|
|
370
|
+
*/
|
|
371
|
+
_handleNavigationEvent = (event) => {
|
|
372
|
+
const navigationEvent = event;
|
|
373
|
+
if (navigationEvent.detail && typeof navigationEvent.detail === "object") {
|
|
374
|
+
const { url, replace, address } = navigationEvent.detail;
|
|
375
|
+
const continueNavigation = this.config.handleNavigation(address, replace);
|
|
376
|
+
if (!continueNavigation) {
|
|
377
|
+
navigationEvent.stopPropagation();
|
|
378
|
+
} else {
|
|
379
|
+
if (this.root && !url) {
|
|
380
|
+
this.root.processError(
|
|
381
|
+
(0, import_routerErrors.generateMessageObject)(import_routerErrors.messages.MISSING_URL, [JSON.stringify(address)])
|
|
382
|
+
);
|
|
383
|
+
} else if (!this.parent) {
|
|
384
|
+
this.process(url, replace);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
/**
|
|
390
|
+
* Be discovered as a parent for descendent components.
|
|
391
|
+
* Stop immediate propagation because we only want 1 parent to be found.
|
|
392
|
+
*
|
|
393
|
+
* @param {Event} event - With detail: callback
|
|
394
|
+
*/
|
|
395
|
+
_handleParentEvent = (event) => {
|
|
396
|
+
event.stopImmediatePropagation();
|
|
397
|
+
const parentRouterEvent = event;
|
|
398
|
+
if (parentRouterEvent && parentRouterEvent.detail && typeof parentRouterEvent.detail === "function") {
|
|
399
|
+
parentRouterEvent.detail(this);
|
|
400
|
+
}
|
|
401
|
+
};
|
|
396
402
|
_sendEvent(name, payload) {
|
|
397
403
|
import_routerUtils.hasDocument && this.target.dispatchEvent(
|
|
398
404
|
new CustomEvent(name, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -28,11 +27,8 @@ var import_domRouter = require("lwr/domRouter");
|
|
|
28
27
|
var import_domRouterUtils = require("lwr/domRouterUtils");
|
|
29
28
|
var import_routerUtils = require("lwr/routerUtils");
|
|
30
29
|
var HistoryRouter = class extends import_domRouter.DomRouterImpl {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
this.historyDisabled = false;
|
|
34
|
-
this.currentUrl = "";
|
|
35
|
-
}
|
|
30
|
+
historyDisabled = false;
|
|
31
|
+
currentUrl = "";
|
|
36
32
|
/**
|
|
37
33
|
* Override.
|
|
38
34
|
* Initialize with the current route and listen to the popstate event for future changes.
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -16,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
15
|
return to;
|
|
17
16
|
};
|
|
18
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
18
|
|
|
28
19
|
// packages/@lwrjs/router/src/modules/lwr/outlet/outlet.ts
|
|
29
20
|
var outlet_exports = {};
|
|
@@ -34,17 +25,14 @@ module.exports = __toCommonJS(outlet_exports);
|
|
|
34
25
|
var import_lwc = require("lwc");
|
|
35
26
|
var import_navigation = require("lwr/navigation");
|
|
36
27
|
var Outlet = class extends import_lwc.LightningElement {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
static {
|
|
46
|
-
this.renderMode = "light";
|
|
47
|
-
}
|
|
28
|
+
static renderMode = "light";
|
|
29
|
+
@import_lwc.api refocusOff = false;
|
|
30
|
+
@import_lwc.api outletErrorCallback;
|
|
31
|
+
@import_lwc.api viewName = "default";
|
|
32
|
+
viewCtor = void 0;
|
|
33
|
+
previousViewCtor = void 0;
|
|
34
|
+
hasError = false;
|
|
35
|
+
@((0, import_lwc.wire)(import_navigation.CurrentView, { viewName: "$viewName" }))
|
|
48
36
|
setView(currentView) {
|
|
49
37
|
this.hasError = false;
|
|
50
38
|
this.viewCtor = currentView;
|
|
@@ -74,15 +62,3 @@ var Outlet = class extends import_lwc.LightningElement {
|
|
|
74
62
|
}
|
|
75
63
|
}
|
|
76
64
|
};
|
|
77
|
-
__decorateClass([
|
|
78
|
-
import_lwc.api
|
|
79
|
-
], Outlet.prototype, "refocusOff", 2);
|
|
80
|
-
__decorateClass([
|
|
81
|
-
import_lwc.api
|
|
82
|
-
], Outlet.prototype, "outletErrorCallback", 2);
|
|
83
|
-
__decorateClass([
|
|
84
|
-
import_lwc.api
|
|
85
|
-
], Outlet.prototype, "viewName", 2);
|
|
86
|
-
__decorateClass([
|
|
87
|
-
(0, import_lwc.wire)(import_navigation.CurrentView, { viewName: "$viewName" })
|
|
88
|
-
], Outlet.prototype, "setView", 1);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -27,14 +26,21 @@ var import_routerUtils = require("lwr/routerUtils");
|
|
|
27
26
|
var import_routerErrors = require("lwr/routerErrors");
|
|
28
27
|
var import_observable = require("lwr/observable");
|
|
29
28
|
var RouterImpl = class {
|
|
29
|
+
config;
|
|
30
|
+
basePath;
|
|
31
|
+
deprecatedConfig = {};
|
|
32
|
+
compiledRoutes;
|
|
33
|
+
// The in-flight route state to be committed once the view mapping is handled
|
|
34
|
+
pendingRoute;
|
|
35
|
+
routeObservable;
|
|
36
|
+
routeHandler;
|
|
37
|
+
routeHandlerId = 0;
|
|
30
38
|
/**
|
|
31
39
|
* Create and configure the Router.
|
|
32
40
|
*
|
|
33
41
|
* @param {object} config - The router config object, all properties are optional
|
|
34
42
|
*/
|
|
35
43
|
constructor(config) {
|
|
36
|
-
this.deprecatedConfig = {};
|
|
37
|
-
this.routeHandlerId = 0;
|
|
38
44
|
this.compiledRoutes = [];
|
|
39
45
|
this.routeObservable = (0, import_observable.createObservable)();
|
|
40
46
|
this.basePath = config.basePath || "";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -25,22 +24,10 @@ __export(routerBridge_exports, {
|
|
|
25
24
|
module.exports = __toCommonJS(routerBridge_exports);
|
|
26
25
|
var import_domRouter = require("lwr/domRouter");
|
|
27
26
|
var DomRouterBridge = class {
|
|
27
|
+
config;
|
|
28
|
+
target;
|
|
29
|
+
bridgedRouter;
|
|
28
30
|
constructor(config = {}, target = window) {
|
|
29
|
-
// Routers send out the PARENT_EVENT to build a router hierarchy
|
|
30
|
-
// Listen for this event to find the topmost router located beneath the bridge in the DOM
|
|
31
|
-
// NOTE: because of the restrictions on "lwr/router" hierachy, this is only called 0 or 1 time(s)
|
|
32
|
-
// - only ONE root router is allowed in a document
|
|
33
|
-
// - sibling routers are NOT allowed
|
|
34
|
-
this.handleParentEvent = (event) => {
|
|
35
|
-
const parentEvent = event;
|
|
36
|
-
if (parentEvent && parentEvent.detail && typeof parentEvent.detail === "function") {
|
|
37
|
-
parentEvent.detail(this);
|
|
38
|
-
if (this.bridgedRouter) {
|
|
39
|
-
this.bridgedRouter.parent = void 0;
|
|
40
|
-
this.target.removeEventListener(import_domRouter.PARENT_EVENT, this.handleParentEvent);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
31
|
this.config = {
|
|
45
32
|
historyDisabled: !!config.historyDisabled,
|
|
46
33
|
onReady: config.onReady || (() => {
|
|
@@ -54,6 +41,21 @@ var DomRouterBridge = class {
|
|
|
54
41
|
this.target = target;
|
|
55
42
|
this.target.addEventListener(import_domRouter.PARENT_EVENT, this.handleParentEvent);
|
|
56
43
|
}
|
|
44
|
+
// Routers send out the PARENT_EVENT to build a router hierarchy
|
|
45
|
+
// Listen for this event to find the topmost router located beneath the bridge in the DOM
|
|
46
|
+
// NOTE: because of the restrictions on "lwr/router" hierachy, this is only called 0 or 1 time(s)
|
|
47
|
+
// - only ONE root router is allowed in a document
|
|
48
|
+
// - sibling routers are NOT allowed
|
|
49
|
+
handleParentEvent = (event) => {
|
|
50
|
+
const parentEvent = event;
|
|
51
|
+
if (parentEvent && parentEvent.detail && typeof parentEvent.detail === "function") {
|
|
52
|
+
parentEvent.detail(this);
|
|
53
|
+
if (this.bridgedRouter) {
|
|
54
|
+
this.bridgedRouter.parent = void 0;
|
|
55
|
+
this.target.removeEventListener(import_domRouter.PARENT_EVENT, this.handleParentEvent);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
57
59
|
// Save an observed router and subscribe to its navigation and error updates
|
|
58
60
|
async addChild(child) {
|
|
59
61
|
this.bridgedRouter = child;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -16,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
15
|
return to;
|
|
17
16
|
};
|
|
18
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
20
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
21
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
|
-
if (decorator = decorators[i])
|
|
23
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result) __defProp(target, key, result);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
18
|
|
|
28
19
|
// packages/@lwrjs/router/src/modules/lwr/routerContainer/routerContainer.ts
|
|
29
20
|
var routerContainer_exports = {};
|
|
@@ -35,14 +26,16 @@ var import_lwc = require("lwc");
|
|
|
35
26
|
var import_utils = require("./utils.cjs");
|
|
36
27
|
var import_routerUtils = require("lwr/routerUtils");
|
|
37
28
|
var RouterContainer = class extends import_lwc.LightningElement {
|
|
29
|
+
static renderMode = "light";
|
|
30
|
+
// Instance of the Router class for this LWC.
|
|
31
|
+
routerApi;
|
|
32
|
+
@import_lwc.api router;
|
|
33
|
+
@import_lwc.api historyDisabled = false;
|
|
34
|
+
currentTitle;
|
|
38
35
|
constructor() {
|
|
39
36
|
super();
|
|
40
|
-
this.historyDisabled = false;
|
|
41
37
|
this.currentTitle = import_routerUtils.hasDocument ? document.title : "";
|
|
42
38
|
}
|
|
43
|
-
static {
|
|
44
|
-
this.renderMode = "light";
|
|
45
|
-
}
|
|
46
39
|
/**
|
|
47
40
|
* Create a router attached to this component.
|
|
48
41
|
*/
|
|
@@ -134,9 +127,3 @@ var RouterContainer = class extends import_lwc.LightningElement {
|
|
|
134
127
|
});
|
|
135
128
|
}
|
|
136
129
|
};
|
|
137
|
-
__decorateClass([
|
|
138
|
-
import_lwc.api
|
|
139
|
-
], RouterContainer.prototype, "router", 2);
|
|
140
|
-
__decorateClass([
|
|
141
|
-
import_lwc.api
|
|
142
|
-
], RouterContainer.prototype, "historyDisabled", 2);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -33,8 +32,14 @@ var import_router = require("lwr/router");
|
|
|
33
32
|
var import_routerErrors = require("lwr/routerErrors");
|
|
34
33
|
var import_routerUtils = require("lwr/routerUtils");
|
|
35
34
|
var ServerRouter = class {
|
|
35
|
+
router;
|
|
36
|
+
target;
|
|
37
|
+
contextId = Object.freeze(() => void 0);
|
|
38
|
+
handleNavHook;
|
|
39
|
+
preNavHook;
|
|
40
|
+
errorNavHook;
|
|
41
|
+
currentRoute;
|
|
36
42
|
constructor(config, router, target) {
|
|
37
|
-
this.contextId = Object.freeze(() => void 0);
|
|
38
43
|
this.router = router;
|
|
39
44
|
this.target = target;
|
|
40
45
|
this.handleNavHook = config.handleNavigation;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -28,14 +27,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
28
|
|
|
30
29
|
// packages/@lwrjs/router/src/services/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
30
|
+
var services_exports = {};
|
|
31
|
+
__export(services_exports, {
|
|
33
32
|
DEFAULT_SCHEMA: () => DEFAULT_SCHEMA,
|
|
34
33
|
deleteRouterConfigJsonCacheEntry: () => deleteRouterConfigJsonCacheEntry,
|
|
35
34
|
getClientRoutes: () => getClientRoutes
|
|
36
35
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
38
|
-
var import_ajv = __toESM(require("ajv")
|
|
36
|
+
module.exports = __toCommonJS(services_exports);
|
|
37
|
+
var import_ajv = __toESM(require("ajv"));
|
|
39
38
|
var import_fs = require("fs");
|
|
40
39
|
var import_shared_utils = require("@lwrjs/shared-utils");
|
|
41
40
|
var import_diagnostics = require("@lwrjs/diagnostics");
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -18,20 +17,26 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
18
|
|
|
20
19
|
// packages/@lwrjs/router/src/services/module-provider/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
20
|
+
var module_provider_exports = {};
|
|
21
|
+
__export(module_provider_exports, {
|
|
23
22
|
default: () => RouterModuleProvider
|
|
24
23
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(module_provider_exports);
|
|
26
25
|
var import_shared_utils = require("@lwrjs/shared-utils");
|
|
27
26
|
var import_utils = require("./utils.cjs");
|
|
28
27
|
var import__ = require("../index.cjs");
|
|
29
28
|
var DEFAULT_DIR = "$rootDir/src/routes";
|
|
30
29
|
var RouterModuleProvider = class {
|
|
30
|
+
name = "router-module-provider";
|
|
31
|
+
version;
|
|
32
|
+
routesDir;
|
|
33
|
+
appBasePath;
|
|
34
|
+
i18n;
|
|
35
|
+
// Watch the Router Config files and recompile the modules on change
|
|
36
|
+
routerWatcher;
|
|
37
|
+
watchedFileSet = /* @__PURE__ */ new Set();
|
|
31
38
|
// <config path, module id>
|
|
32
39
|
constructor({ routesDir = DEFAULT_DIR }, context) {
|
|
33
|
-
this.name = "router-module-provider";
|
|
34
|
-
this.watchedFileSet = /* @__PURE__ */ new Set();
|
|
35
40
|
const {
|
|
36
41
|
config: { rootDir, contentDir, i18n, layoutsDir },
|
|
37
42
|
runtimeEnvironment: { lwrVersion, watchFiles },
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.24.
|
|
8
|
+
"version": "0.24.4",
|
|
9
9
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"test:server": "jest --config ./jest.server.config.cjs"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@lwrjs/client-modules": "0.24.
|
|
57
|
-
"@lwrjs/diagnostics": "0.24.
|
|
58
|
-
"@lwrjs/shared-utils": "0.24.
|
|
56
|
+
"@lwrjs/client-modules": "0.24.4",
|
|
57
|
+
"@lwrjs/diagnostics": "0.24.4",
|
|
58
|
+
"@lwrjs/shared-utils": "0.24.4",
|
|
59
59
|
"ajv": "8.18.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@lwc/jest-preset": "^19.6.1",
|
|
63
|
-
"@lwrjs/fs-watch": "0.24.
|
|
63
|
+
"@lwrjs/fs-watch": "0.24.4",
|
|
64
64
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
65
65
|
"jest": "29.7.0",
|
|
66
66
|
"memfs": "^4.13.0",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"volta": {
|
|
101
101
|
"extends": "../../../package.json"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "63feabb6eea1340e80a82146cc1c24bfc4f2d518"
|
|
104
104
|
}
|