@uniweb/core 0.1.7 → 0.1.9
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/uniweb.js +5 -43
- package/src/website.js +1 -1
package/package.json
CHANGED
package/src/uniweb.js
CHANGED
|
@@ -40,13 +40,8 @@ export default class Uniweb {
|
|
|
40
40
|
return undefined
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
return this.foundation.getComponent(name)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Fallback: direct component access
|
|
49
|
-
return this.foundation[name]
|
|
43
|
+
// Look in components object first, then direct access (named export)
|
|
44
|
+
return this.foundation.components?.[name] || this.foundation[name]
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
/**
|
|
@@ -56,28 +51,14 @@ export default class Uniweb {
|
|
|
56
51
|
listComponents() {
|
|
57
52
|
if (!this.foundation) return []
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
// Use components object if available
|
|
55
|
+
if (this.foundation.components) {
|
|
56
|
+
return Object.keys(this.foundation.components)
|
|
61
57
|
}
|
|
62
58
|
|
|
63
59
|
return []
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
/**
|
|
67
|
-
* Get component schema
|
|
68
|
-
* @param {string} name - Component name
|
|
69
|
-
* @returns {Object|undefined}
|
|
70
|
-
*/
|
|
71
|
-
getSchema(name) {
|
|
72
|
-
if (!this.foundation) return undefined
|
|
73
|
-
|
|
74
|
-
if (typeof this.foundation.getSchema === 'function') {
|
|
75
|
-
return this.foundation.getSchema(name)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return undefined
|
|
79
|
-
}
|
|
80
|
-
|
|
81
62
|
/**
|
|
82
63
|
* Set foundation configuration
|
|
83
64
|
* @param {Object} config
|
|
@@ -85,23 +66,4 @@ export default class Uniweb {
|
|
|
85
66
|
setFoundationConfig(config) {
|
|
86
67
|
this.foundationConfig = config
|
|
87
68
|
}
|
|
88
|
-
|
|
89
|
-
// Legacy compatibility - maps to new method names
|
|
90
|
-
getRemoteComponent(name) {
|
|
91
|
-
return this.getComponent(name)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
setRemoteComponents(components) {
|
|
95
|
-
// Legacy: components was an object map
|
|
96
|
-
// Convert to foundation-like interface
|
|
97
|
-
this.foundation = {
|
|
98
|
-
getComponent: (name) => components[name],
|
|
99
|
-
listComponents: () => Object.keys(components),
|
|
100
|
-
components
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
setRemoteConfig(config) {
|
|
105
|
-
this.setFoundationConfig(config)
|
|
106
|
-
}
|
|
107
69
|
}
|
package/src/website.js
CHANGED
|
@@ -475,7 +475,7 @@ export default class Website {
|
|
|
475
475
|
// Build page info objects
|
|
476
476
|
const buildPageInfo = (page) => ({
|
|
477
477
|
id: page.id,
|
|
478
|
-
route: page.route
|
|
478
|
+
route: page.route,
|
|
479
479
|
title: page.title,
|
|
480
480
|
label: page.getLabel(),
|
|
481
481
|
description: page.description,
|