@uniweb/core 0.7.3 → 0.7.5
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/uniweb.js +13 -0
- package/src/website.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/core",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"jest": "^29.7.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@uniweb/semantic-parser": "1.1.
|
|
33
|
+
"@uniweb/semantic-parser": "1.1.13",
|
|
34
34
|
"@uniweb/theming": "0.1.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
package/src/uniweb.js
CHANGED
|
@@ -57,6 +57,13 @@ export default class Uniweb {
|
|
|
57
57
|
this.routingComponents = {}
|
|
58
58
|
this.language = 'en'
|
|
59
59
|
|
|
60
|
+
// Framework-level inset components — every foundation gets these
|
|
61
|
+
// for free. Currently `<Ref>` for cross-references; future
|
|
62
|
+
// additions land here too. The runtime's setup wires the actual
|
|
63
|
+
// component instance after createUniweb returns; the slot is
|
|
64
|
+
// declared here so Object.seal lets us assign to it.
|
|
65
|
+
this.defaultInsets = null
|
|
66
|
+
|
|
60
67
|
// Icon resolver: (library, name) => Promise<string|null>
|
|
61
68
|
// Set by the runtime from site config.
|
|
62
69
|
this.iconResolver = null
|
|
@@ -132,6 +139,12 @@ export default class Uniweb {
|
|
|
132
139
|
const component = ext.foundation[name]
|
|
133
140
|
if (component) return component
|
|
134
141
|
}
|
|
142
|
+
// Final fallback: framework-level default insets (e.g. <Ref> for
|
|
143
|
+
// cross-references). Foundations don't need to register these
|
|
144
|
+
// explicitly; the framework provides them.
|
|
145
|
+
if (this.defaultInsets && this.defaultInsets[name]) {
|
|
146
|
+
return this.defaultInsets[name]
|
|
147
|
+
}
|
|
135
148
|
return undefined
|
|
136
149
|
}
|
|
137
150
|
|
package/src/website.js
CHANGED
|
@@ -74,6 +74,7 @@ export default class Website {
|
|
|
74
74
|
this.pageRoutes = []
|
|
75
75
|
this.themeData = {}
|
|
76
76
|
this.config = {}
|
|
77
|
+
this.xref = null
|
|
77
78
|
this.siteDefaultLocale = 'en'
|
|
78
79
|
this.defaultLocale = 'en'
|
|
79
80
|
this.activeLocale = 'en'
|
|
@@ -107,6 +108,7 @@ export default class Website {
|
|
|
107
108
|
notFound,
|
|
108
109
|
versionedScopes = {},
|
|
109
110
|
assets = {},
|
|
111
|
+
xref = null,
|
|
110
112
|
} = content || {}
|
|
111
113
|
|
|
112
114
|
this.name = config.name || ''
|
|
@@ -165,6 +167,10 @@ export default class Website {
|
|
|
165
167
|
this._routeTranslations = this._buildRouteTranslations(config)
|
|
166
168
|
this.versionedScopes = versionedScopes
|
|
167
169
|
this.assets = assets
|
|
170
|
+
// Cross-reference registry — populated by content-loader from {#id}
|
|
171
|
+
// attributes on labeled block elements. Read by kit's <Ref>
|
|
172
|
+
// component to resolve `[#id]` cross-reference insets.
|
|
173
|
+
this.xref = xref || null
|
|
168
174
|
}
|
|
169
175
|
|
|
170
176
|
/**
|