@domql/router 2.30.2 → 2.31.0
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/cjs/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/index.js +5 -1
- package/package.json +4 -4
package/dist/cjs/index.js
CHANGED
|
@@ -68,7 +68,7 @@ const router = async function(path, el, state = {}, options = {}) {
|
|
|
68
68
|
const { pathname, search, hash } = urlObj;
|
|
69
69
|
const rootNode = element.node;
|
|
70
70
|
const route = getActiveRoute(opts.level, pathname);
|
|
71
|
-
const content = element.routes[route || "/"] || element.routes["/*"];
|
|
71
|
+
const content = element.routes[route] || element.routes[pathname] || element.routes["/"] || element.routes["/*"];
|
|
72
72
|
const scrollNode = opts.scrollToNode ? rootNode : opts.scrollNode;
|
|
73
73
|
const hashChanged = hash && hash !== win.location.hash.slice(1);
|
|
74
74
|
const pathChanged = pathname !== lastPathname;
|
package/dist/esm/index.js
CHANGED
|
@@ -56,7 +56,7 @@ const router = async function(path, el, state = {}, options = {}) {
|
|
|
56
56
|
const { pathname, search, hash } = urlObj;
|
|
57
57
|
const rootNode = element.node;
|
|
58
58
|
const route = getActiveRoute(opts.level, pathname);
|
|
59
|
-
const content = element.routes[route || "/"] || element.routes["/*"];
|
|
59
|
+
const content = element.routes[route] || element.routes[pathname] || element.routes["/"] || element.routes["/*"];
|
|
60
60
|
const scrollNode = opts.scrollToNode ? rootNode : opts.scrollNode;
|
|
61
61
|
const hashChanged = hash && hash !== win.location.hash.slice(1);
|
|
62
62
|
const pathChanged = pathname !== lastPathname;
|
package/index.js
CHANGED
|
@@ -54,7 +54,11 @@ export const router = async function (path, el, state = {}, options = {}) {
|
|
|
54
54
|
|
|
55
55
|
const rootNode = element.node
|
|
56
56
|
const route = getActiveRoute(opts.level, pathname)
|
|
57
|
-
const content =
|
|
57
|
+
const content =
|
|
58
|
+
element.routes[route] ||
|
|
59
|
+
element.routes[pathname] ||
|
|
60
|
+
element.routes['/'] ||
|
|
61
|
+
element.routes['/*']
|
|
58
62
|
const scrollNode = opts.scrollToNode ? rootNode : opts.scrollNode
|
|
59
63
|
const hashChanged = hash && hash !== win.location.hash.slice(1)
|
|
60
64
|
const pathChanged = pathname !== lastPathname
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/router",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.31.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
"prepublish": "npx rimraf -I dist && npm run build && npm run copy:package:cjs"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@domql/event": "^2.
|
|
26
|
-
"@domql/utils": "^2.
|
|
25
|
+
"@domql/event": "^2.31.0",
|
|
26
|
+
"@domql/utils": "^2.31.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "dd5c64895320d678f28ca585c9fd4e4550a483cd",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/core": "^7.27.1"
|
|
31
31
|
}
|