@uniweb/core 0.1.12 → 0.1.13

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/block.js +17 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/core",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Core classes for the Uniweb platform - Uniweb, Website, Page, Block",
5
5
  "type": "module",
6
6
  "exports": {
@@ -27,6 +27,6 @@
27
27
  "node": ">=20.19"
28
28
  },
29
29
  "dependencies": {
30
- "@uniweb/semantic-parser": "1.0.9"
30
+ "@uniweb/semantic-parser": "1.0.12"
31
31
  }
32
32
  }
package/src/block.js CHANGED
@@ -26,6 +26,15 @@ export default class Block {
26
26
  this.rawContent = blockData.content || {}
27
27
  this.parsedContent = this.parseContent(blockData.content)
28
28
 
29
+ // Merge fetched data from prerender (if present)
30
+ // Prerender stores fetched data in blockData.parsedContent.data
31
+ if (blockData.parsedContent?.data) {
32
+ this.parsedContent.data = {
33
+ ...(this.parsedContent.data || {}),
34
+ ...blockData.parsedContent.data,
35
+ }
36
+ }
37
+
29
38
  // Flat content structure - no more nested main/items
30
39
  // parsedContent now has: title, pretitle, paragraphs, links, imgs, items, etc.
31
40
  this.items = this.parsedContent.items || []
@@ -45,6 +54,14 @@ export default class Block {
45
54
  // Input data
46
55
  this.input = blockData.input || null
47
56
 
57
+ // Fetch configuration (from section frontmatter)
58
+ // Supports local files (path) or remote URLs (url)
59
+ this.fetch = blockData.fetch || null
60
+
61
+ // Cascaded data from page/site level fetches
62
+ // Populated during render for components with inheritData
63
+ this.cascadedData = blockData.cascadedData || {}
64
+
48
65
  // State management (dynamic, can change at runtime)
49
66
  this.startState = null
50
67
  this.state = null