@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
package/src/uniweb.js CHANGED
@@ -40,13 +40,8 @@ export default class Uniweb {
40
40
  return undefined
41
41
  }
42
42
 
43
- // Use foundation's getComponent interface
44
- if (typeof this.foundation.getComponent === 'function') {
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
- if (typeof this.foundation.listComponents === 'function') {
60
- return this.foundation.listComponents()
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 === '/' ? '' : page.route,
478
+ route: page.route,
479
479
  title: page.title,
480
480
  label: page.getLabel(),
481
481
  description: page.description,