@uniweb/kit 0.2.0 → 0.2.2
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 +2 -2
- package/src/hooks/useVersion.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Standard component library for Uniweb foundations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"tailwind-merge": "^2.6.0",
|
|
40
|
-
"@uniweb/core": "0.2.
|
|
40
|
+
"@uniweb/core": "0.2.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": "^18.0.0 || ^19.0.0",
|
package/src/hooks/useVersion.js
CHANGED
|
@@ -43,8 +43,9 @@ export function useVersion(options = {}) {
|
|
|
43
43
|
const { website } = useWebsite()
|
|
44
44
|
const location = useLocation()
|
|
45
45
|
|
|
46
|
-
const currentRoute = location?.pathname || '/'
|
|
47
46
|
const page = options.page || website.activePage
|
|
47
|
+
// Prefer page route for SSG accuracy, fallback to location pathname
|
|
48
|
+
const currentRoute = page?.route || location?.pathname || '/'
|
|
48
49
|
|
|
49
50
|
// Check if the current page/route is within a versioned section
|
|
50
51
|
const isVersioned = page?.isVersioned() || website.isVersionedRoute(currentRoute)
|