spinning-router 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SpinningRouter.js +2 -1
- package/dist/link.js +1 -3
- package/package.json +1 -1
package/dist/SpinningRouter.js
CHANGED
@@ -74,6 +74,7 @@ const SpinningRouter = ({ routes, errorPage = DefaultErrorPage_1.DefaultErrorPag
|
|
74
74
|
window.removeEventListener("softRefresh", doSoftRefresh);
|
75
75
|
};
|
76
76
|
}, []);
|
77
|
-
|
77
|
+
window.SpinningRouterLocation = { path, match, parameters };
|
78
|
+
return ((0, jsx_runtime_1.jsxs)(Location_1.Location.Provider, { value: Object.assign({}, window.SpinningRouterLocation), children: [element, overlay] }));
|
78
79
|
};
|
79
80
|
exports.SpinningRouter = SpinningRouter;
|
package/dist/link.js
CHANGED
@@ -1,14 +1,12 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.link = exports.unsafeLink = void 0;
|
4
|
-
const Location_1 = require("./Location");
|
5
|
-
const react_1 = require("react");
|
6
4
|
const unsafeLink = (path, values) => {
|
7
5
|
let result = [];
|
8
6
|
for (let part of path.split("/")) {
|
9
7
|
if (part.startsWith(":")) {
|
10
8
|
const key = part.substring(1);
|
11
|
-
let value = values && values[key] !== undefined ? values[key] :
|
9
|
+
let value = values && values[key] !== undefined ? values[key] : window.SpinningRouterLocation.parameters[key];
|
12
10
|
result.push(encodeURIComponent(value));
|
13
11
|
}
|
14
12
|
else {
|