@uniweb/core 0.33.0 → 0.34.0
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/block.js +18 -14
- package/src/fetch-config.js +4 -1
- package/src/insets.js +2 -3
package/package.json
CHANGED
package/src/block.js
CHANGED
|
@@ -34,10 +34,11 @@ export default class Block {
|
|
|
34
34
|
// at build time is deliberate: what the author wrote is the canonical STORED
|
|
35
35
|
// shape, so the content that syncs and round-trips keeps carrying it.
|
|
36
36
|
// `blockData.content` is left untouched — the lift produces a new tree and only
|
|
37
|
-
// this Block's view of it changes.
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
// this Block's view of it changes. ⛔ A stored `insets[]` — what the build extracted
|
|
38
|
+
// before 2026-09-27 — is no longer read: no store serves one since the site-content
|
|
39
|
+
// Model dropped the field (2026-09-28), and a site pushed again carries its insets in
|
|
40
|
+
// its content.
|
|
41
|
+
const lifted = liftInsets(blockData.content)
|
|
41
42
|
this.rawContent = lifted.content || {}
|
|
42
43
|
this.parsedContent = this.parseContent(lifted.content)
|
|
43
44
|
|
|
@@ -68,11 +69,12 @@ export default class Block {
|
|
|
68
69
|
this.items = this.parsedContent.items || []
|
|
69
70
|
|
|
70
71
|
// Block configuration
|
|
72
|
+
// ⛔ No `block.preset`: a section's `preset:` was stored and never read, and neither the build
|
|
73
|
+
// nor a store keeps one any more (2026-09-28).
|
|
71
74
|
const blockConfig = blockData.params || blockData.config || {}
|
|
72
|
-
this.preset = blockData.preset
|
|
73
75
|
|
|
74
76
|
// ⭐ THE SECTION'S OWN SETTINGS — the names framework reserves in its params
|
|
75
|
-
// (`@uniweb/schemas/section`): `theme`, `background`, `grid`, `vars`. Framework applies
|
|
77
|
+
// (`@uniweb/schemas/section`): `theme`, `background`, `grid`, `vars`, `fetch`. Framework applies
|
|
76
78
|
// each — the runtime paints the background and the color context around the component,
|
|
77
79
|
// the page stylesheet applies the section's theme and its component's variables, kit's
|
|
78
80
|
// `ChildGrid` lays out the child sections — so each is lifted onto the block, normalized
|
|
@@ -86,9 +88,10 @@ export default class Block {
|
|
|
86
88
|
const rawBg = setting('background')
|
|
87
89
|
const gridParam = setting('grid')
|
|
88
90
|
const varsParam = setting('vars')
|
|
91
|
+
const fetchParam = setting('fetch')
|
|
89
92
|
const standardOptions = blockConfig.standardOptions
|
|
90
93
|
const {
|
|
91
|
-
theme: _theme, background: _background, grid: _grid, vars: _vars,
|
|
94
|
+
theme: _theme, background: _background, grid: _grid, vars: _vars, fetch: _fetch,
|
|
92
95
|
standardOptions: _standardOptions, properties: _properties,
|
|
93
96
|
...componentParams
|
|
94
97
|
} = own
|
|
@@ -134,11 +137,11 @@ export default class Block {
|
|
|
134
137
|
? blockData.subsections.map((block, i) => new Block(block, `${id}_${i}`, this.page))
|
|
135
138
|
: []
|
|
136
139
|
|
|
137
|
-
// Insets — inline @-referenced components positioned in content flow:
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
+
// Insets — inline @-referenced components positioned in content flow: the leaves
|
|
141
|
+
// lifted from the content, in document order. Each receives its `[…]` text as
|
|
142
|
+
// `content.title` and its `{…}` as params.
|
|
140
143
|
this.insets = []
|
|
141
|
-
const insetData =
|
|
144
|
+
const insetData = lifted.leaves
|
|
142
145
|
for (let i = 0; i < insetData.length; i++) {
|
|
143
146
|
const ref = insetData[i]
|
|
144
147
|
const title = ref.title || ''
|
|
@@ -180,9 +183,10 @@ export default class Block {
|
|
|
180
183
|
)
|
|
181
184
|
}
|
|
182
185
|
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
|
|
186
|
+
// The section's own data — what its `query:` / `fetch:` declares. A stored section carries it
|
|
187
|
+
// in `params.fetch` [Diego, 2026-09-28], which wins when present; the `fetch` beside the params
|
|
188
|
+
// is framework's own build output, and a store's older field.
|
|
189
|
+
this.fetch = fetchParam || blockData.fetch || null
|
|
186
190
|
|
|
187
191
|
// The layout the author chose for this section's child sections — the reserved
|
|
188
192
|
// `grid:` section key [Diego, 2026-09-27]: `3` (equal columns) or `'40/60'`
|
package/src/fetch-config.js
CHANGED
|
@@ -818,7 +818,10 @@ export function sectionFetches(sections) {
|
|
|
818
818
|
const walk = (list) => {
|
|
819
819
|
for (const s of list || []) {
|
|
820
820
|
if (!s || typeof s !== 'object') continue
|
|
821
|
-
|
|
821
|
+
// A stored section carries its fetch in `params.fetch` (2026-09-28); framework's own build
|
|
822
|
+
// output beside the params — the same order as the Block's.
|
|
823
|
+
const own = s.params?.fetch || s.fetch
|
|
824
|
+
if (own) out.push(own)
|
|
822
825
|
if (Array.isArray(s.subsections)) walk(s.subsections)
|
|
823
826
|
}
|
|
824
827
|
}
|
package/src/insets.js
CHANGED
|
@@ -26,9 +26,8 @@
|
|
|
26
26
|
* never went through a build — a record body, a free-form translation — resolves its
|
|
27
27
|
* insets the same way. ⛔ *Until 2026-09-27 only containers were lifted here; leaf
|
|
28
28
|
* insets were extracted by the site build into the section's `insets[]`, so any
|
|
29
|
-
* document the build did not extract rendered none of them.*
|
|
30
|
-
*
|
|
31
|
-
* it so their refIds cannot collide.
|
|
29
|
+
* document the build did not extract rendered none of them.* `leafStart` offsets the
|
|
30
|
+
* leaves' refIds for a caller that numbers other insets first.
|
|
32
31
|
*
|
|
33
32
|
* PURE with respect to the input: nodes on the path to an inset are cloned; everything
|
|
34
33
|
* else is passed through by reference, so a document with no insets costs one walk and
|