@uniweb/build 1.16.1 → 1.16.2
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 +3 -3
- package/src/runtime-schema.js +16 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"js-yaml": "^4.3.2",
|
|
57
57
|
"sharp": "^0.35.5",
|
|
58
58
|
"yaml": "^2.5.0",
|
|
59
|
-
"@uniweb/content-reader": "~1.5.9",
|
|
60
|
-
"@uniweb/semantic-parser": "~1.13.2",
|
|
61
59
|
"@uniweb/schemas": "~1.6.10",
|
|
60
|
+
"@uniweb/content-reader": "~1.5.9",
|
|
62
61
|
"@uniweb/theming": "~1.2.1",
|
|
63
62
|
"@uniweb/content-writer": "~1.3.1",
|
|
63
|
+
"@uniweb/semantic-parser": "~1.13.2",
|
|
64
64
|
"@uniweb/projections": "~1.2.11"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
package/src/runtime-schema.js
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* - defaults: param default values
|
|
14
14
|
* - context: static capabilities for cross-block coordination
|
|
15
15
|
* - initialState: initial values for mutable block state
|
|
16
|
+
* - header: true when the component draws the parser's pretitle, title and subtitle as its own
|
|
17
|
+
* header, false when it draws the section as written; absent when it declares no content
|
|
16
18
|
*
|
|
17
19
|
* ⭐ `data:` IS THE DELIVERY — ruled 2026-09-14 [Diego]: a section's `content.data` holds
|
|
18
20
|
* the keys its component declares and nothing else, and which fetch fills each is worked
|
|
@@ -35,7 +37,7 @@
|
|
|
35
37
|
* for the visual editor.
|
|
36
38
|
*/
|
|
37
39
|
|
|
38
|
-
import { lowerData } from '@uniweb/schemas/content'
|
|
40
|
+
import { describeContent, lowerData } from '@uniweb/schemas/content'
|
|
39
41
|
import { schemaDeclarationOf } from '@uniweb/schemas/foundation'
|
|
40
42
|
import { stickyDeclaration } from '@uniweb/schemas/section'
|
|
41
43
|
|
|
@@ -211,9 +213,22 @@ export function extractRuntimeSchema(fullMeta) {
|
|
|
211
213
|
runtime.initialState = fullMeta.initialState
|
|
212
214
|
}
|
|
213
215
|
|
|
216
|
+
// ⭐ WHETHER THE COMPONENT DRAWS THE PARSER'S HEADER ITSELF. A type whose `content:` declares a
|
|
217
|
+
// pretitle, a title or a subtitle draws them as its header, not as headings of the page (`true`).
|
|
218
|
+
// One that declares a `sequence` and none of them draws the section as written (`false`). kit's
|
|
219
|
+
// contents rail reads it (`useHeadings`): a site's default section type can be either, and a rail
|
|
220
|
+
// entry for a header line would name an anchor the page doesn't have. Absent otherwise, since
|
|
221
|
+
// nothing is known: no content declared, or only what says nothing of either.
|
|
222
|
+
const declared = new Set(describeContent(fullMeta).elements.map((e) => e.element))
|
|
223
|
+
if ([...HEADER_ELEMENTS].some((element) => declared.has(element))) runtime.header = true
|
|
224
|
+
else if (declared.has('sequence')) runtime.header = false
|
|
225
|
+
|
|
214
226
|
return Object.keys(runtime).length > 0 ? runtime : null
|
|
215
227
|
}
|
|
216
228
|
|
|
229
|
+
/** The parser's fields a component draws as its header when its `content:` declares them. */
|
|
230
|
+
const HEADER_ELEMENTS = new Set(['pretitle', 'title', 'subtitle'])
|
|
231
|
+
|
|
217
232
|
/**
|
|
218
233
|
* Extract runtime schemas for all components
|
|
219
234
|
*
|