@uniweb/runtime 0.2.17 → 0.2.19
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.2.
|
|
3
|
+
"version": "0.2.19",
|
|
4
4
|
"description": "Minimal runtime for loading Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"node": ">=20.19"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@uniweb/core": "0.1.
|
|
34
|
+
"@uniweb/core": "0.1.15"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@vitejs/plugin-react": "^4.5.2",
|
|
@@ -43,11 +43,17 @@ export default function PageRenderer() {
|
|
|
43
43
|
|
|
44
44
|
// Get page from current URL path (not the potentially stale website.activePage)
|
|
45
45
|
// This ensures correct page renders immediately on client-side navigation
|
|
46
|
-
|
|
46
|
+
let page = website?.getPage(location.pathname)
|
|
47
|
+
|
|
48
|
+
// If no page found, try the 404 page
|
|
49
|
+
const isNotFound = !page
|
|
50
|
+
if (isNotFound) {
|
|
51
|
+
page = website?.getNotFoundPage?.() || website?.activePage
|
|
52
|
+
}
|
|
47
53
|
|
|
48
54
|
// Get head metadata from page (uses Page.getHeadMeta() if available)
|
|
49
55
|
const headMeta = page?.getHeadMeta?.() || {
|
|
50
|
-
title: page?.title || 'Website',
|
|
56
|
+
title: isNotFound ? 'Page Not Found' : (page?.title || 'Website'),
|
|
51
57
|
description: page?.description || ''
|
|
52
58
|
}
|
|
53
59
|
|
|
@@ -55,9 +61,12 @@ export default function PageRenderer() {
|
|
|
55
61
|
useHeadMeta(headMeta, { siteName })
|
|
56
62
|
|
|
57
63
|
if (!page) {
|
|
64
|
+
// No page and no 404 page defined - show minimal fallback
|
|
58
65
|
return (
|
|
59
|
-
<div className="page-
|
|
60
|
-
|
|
66
|
+
<div className="page-not-found" style={{ padding: '4rem 2rem', textAlign: 'center' }}>
|
|
67
|
+
<h1 style={{ fontSize: '3rem', fontWeight: 'bold', color: '#1f2937', marginBottom: '1rem' }}>404</h1>
|
|
68
|
+
<p style={{ color: '#64748b', marginBottom: '2rem' }}>Page not found</p>
|
|
69
|
+
<a href="/" style={{ color: '#3b82f6', textDecoration: 'underline' }}>Go to homepage</a>
|
|
61
70
|
</div>
|
|
62
71
|
)
|
|
63
72
|
}
|