@uniweb/runtime 0.6.23 → 0.6.24
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/runtime",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"description": "Minimal runtime for loading Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"node": ">=20.19"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@uniweb/
|
|
39
|
-
"@uniweb/
|
|
38
|
+
"@uniweb/core": "0.5.18",
|
|
39
|
+
"@uniweb/theming": "0.1.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@vitejs/plugin-react": "^4.5.2",
|
|
43
43
|
"vite": "^7.3.1",
|
|
44
|
-
"@uniweb/build": "0.8.
|
|
44
|
+
"@uniweb/build": "0.8.27"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -135,6 +135,21 @@ export default function PageRenderer() {
|
|
|
135
135
|
|
|
136
136
|
if (redirectTarget) return null
|
|
137
137
|
|
|
138
|
+
// Auto-redirect for content-less pages (structural containers).
|
|
139
|
+
// Folders with page.yml but no markdown keep their route in the hierarchy;
|
|
140
|
+
// when visited directly, redirect to the first descendant with content.
|
|
141
|
+
const autoRedirectRoute = page && !page.redirect && !page.hasContent()
|
|
142
|
+
? page.getNavigableRoute()
|
|
143
|
+
: null
|
|
144
|
+
const shouldAutoRedirect = autoRedirectRoute && autoRedirectRoute !== page?.route
|
|
145
|
+
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
if (!shouldAutoRedirect) return
|
|
148
|
+
navigate(autoRedirectRoute, { replace: true })
|
|
149
|
+
}, [shouldAutoRedirect, autoRedirectRoute, navigate])
|
|
150
|
+
|
|
151
|
+
if (shouldAutoRedirect) return null
|
|
152
|
+
|
|
138
153
|
// Rewrite pages are served by an external site — the host handles routing.
|
|
139
154
|
// In SPA mode this shouldn't be reached (host proxies before JS loads),
|
|
140
155
|
// but if it is (e.g., dev mode), do a full page reload to let the host handle it.
|