@uniweb/runtime 0.2.7 → 0.2.8

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/runtime",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "Minimal runtime for loading Uniweb foundations",
5
5
  "type": "module",
6
6
  "exports": {
@@ -29,7 +29,7 @@
29
29
  "node": ">=20.19"
30
30
  },
31
31
  "dependencies": {
32
- "@uniweb/core": "0.1.6"
32
+ "@uniweb/core": "0.1.7"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "react": "^18.0.0 || ^19.0.0",
@@ -12,24 +12,26 @@
12
12
  * - right: Right sidebar/panel (from @right page)
13
13
  *
14
14
  * Custom Layouts:
15
- * Foundations can export a Layout component that receives pre-rendered areas as props:
15
+ * Foundations can provide a custom Layout via src/runtime.js:
16
16
  *
17
17
  * ```jsx
18
- * export const site = {
19
- * Layout: ({ page, website, header, body, footer, left, right }) => (
20
- * <div className="my-layout">
21
- * <header>{header}</header>
22
- * <aside>{left}</aside>
23
- * <main>{body}</main>
24
- * <aside>{right}</aside>
25
- * <footer>{footer}</footer>
26
- * </div>
27
- * )
18
+ * // src/runtime.js
19
+ * import Layout from './components/Layout'
20
+ *
21
+ * export default {
22
+ * Layout,
23
+ * props: {
24
+ * themeToggleEnabled: true,
25
+ * }
28
26
  * }
29
27
  * ```
28
+ *
29
+ * The Layout component receives pre-rendered areas as props:
30
+ * - page, website: Runtime context
31
+ * - header, body, footer: Pre-rendered React elements
32
+ * - left, right (or leftPanel, rightPanel): Sidebar panels
30
33
  */
31
34
 
32
- import React from 'react'
33
35
  import Blocks from './Blocks.jsx'
34
36
 
35
37
  /**
package/src/index.jsx CHANGED
@@ -230,9 +230,9 @@ async function initRuntime(foundationSource, options = {}) {
230
230
  // Set the foundation on the runtime
231
231
  uniwebInstance.setFoundation(foundation)
232
232
 
233
- // Set foundation config if provided
234
- if (foundation.config || foundation.site) {
235
- uniwebInstance.setFoundationConfig(foundation.config || foundation.site)
233
+ // Set foundation config if provided (runtime is the new name, config/site are legacy)
234
+ if (foundation.runtime || foundation.config || foundation.site) {
235
+ uniwebInstance.setFoundationConfig(foundation.runtime || foundation.config || foundation.site)
236
236
  }
237
237
 
238
238
  // Render the app