@uniweb/runtime 0.2.10 → 0.2.11
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 +1 -1
- package/src/index.jsx +19 -1
package/package.json
CHANGED
package/src/index.jsx
CHANGED
|
@@ -7,7 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react'
|
|
9
9
|
import { createRoot } from 'react-dom/client'
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
BrowserRouter,
|
|
12
|
+
Routes,
|
|
13
|
+
Route,
|
|
14
|
+
Link as RouterLink,
|
|
15
|
+
useNavigate,
|
|
16
|
+
useParams,
|
|
17
|
+
useLocation
|
|
18
|
+
} from 'react-router-dom'
|
|
11
19
|
|
|
12
20
|
// Components
|
|
13
21
|
import { ChildBlocks } from './components/PageRenderer.jsx'
|
|
@@ -131,6 +139,16 @@ function initUniweb(configData) {
|
|
|
131
139
|
// Set up child block renderer for nested blocks
|
|
132
140
|
uniwebInstance.childBlockRenderer = ChildBlocks
|
|
133
141
|
|
|
142
|
+
// Register routing components for kit and foundation components
|
|
143
|
+
// This enables the bridge pattern: components access routing via
|
|
144
|
+
// website.getRoutingComponents() instead of direct imports
|
|
145
|
+
uniwebInstance.routingComponents = {
|
|
146
|
+
Link: RouterLink,
|
|
147
|
+
useNavigate,
|
|
148
|
+
useParams,
|
|
149
|
+
useLocation
|
|
150
|
+
}
|
|
151
|
+
|
|
134
152
|
return uniwebInstance
|
|
135
153
|
}
|
|
136
154
|
|