@uniweb/build 1.11.3 → 1.12.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 +6 -6
- package/src/i18n/records.js +15 -2
- package/src/uwx/data-schema.js +15 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniweb/build",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "Build tooling for the Uniweb Component Web Platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -57,14 +57,14 @@
|
|
|
57
57
|
"sharp": "^0.35.5",
|
|
58
58
|
"yaml": "^2.5.0",
|
|
59
59
|
"@uniweb/content-reader": "~1.5.7",
|
|
60
|
-
"@uniweb/schemas": "~1.6.
|
|
60
|
+
"@uniweb/schemas": "~1.6.7",
|
|
61
61
|
"@uniweb/theming": "~1.2.1",
|
|
62
62
|
"@uniweb/semantic-parser": "~1.13.0",
|
|
63
63
|
"@uniweb/content-writer": "~1.3.1",
|
|
64
|
-
"@uniweb/projections": "~1.2.
|
|
64
|
+
"@uniweb/projections": "~1.2.8"
|
|
65
65
|
},
|
|
66
66
|
"optionalDependencies": {
|
|
67
|
-
"@uniweb/runtime": "~1.2.
|
|
67
|
+
"@uniweb/runtime": "~1.2.14"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
70
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"@tailwindcss/vite": "^4.0.0",
|
|
74
74
|
"@vitejs/plugin-react": "^4.0.0 || ^5.0.0",
|
|
75
75
|
"vite-plugin-svgr": "^4.0.0",
|
|
76
|
-
"@uniweb/
|
|
77
|
-
"@uniweb/
|
|
76
|
+
"@uniweb/core": "~1.5.0",
|
|
77
|
+
"@uniweb/runtime": "~1.2.14"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"vite": {
|
package/src/i18n/records.js
CHANGED
|
@@ -206,10 +206,23 @@ function referencedModels(model) {
|
|
|
206
206
|
return out
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* The fields of a model's brief — what a reference to one of its records is delivered as: the
|
|
211
|
+
* section the declaration marks `brief: true`, at any depth (inside a group, say), else the one
|
|
212
|
+
* section of a model that has a single one.
|
|
213
|
+
*/
|
|
210
214
|
function briefFields(model) {
|
|
215
|
+
const marked = (sections) => {
|
|
216
|
+
for (const section of Object.values(sections || {})) {
|
|
217
|
+
if (section?.brief) return section
|
|
218
|
+
const nested = Object.fromEntries(Object.entries(section?.fields || {}).filter(([, f]) => f?.type === 'section'))
|
|
219
|
+
const found = marked(nested)
|
|
220
|
+
if (found) return found
|
|
221
|
+
}
|
|
222
|
+
return null
|
|
223
|
+
}
|
|
211
224
|
const sections = Object.values(model?.sections || {})
|
|
212
|
-
const brief =
|
|
225
|
+
const brief = marked(model?.sections) ?? (sections.length === 1 && !sections[0]?.multiple ? sections[0] : null)
|
|
213
226
|
return brief?.fields ?? null
|
|
214
227
|
}
|
|
215
228
|
|
package/src/uwx/data-schema.js
CHANGED
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
import { parseOptionsRef, FIELD_RULES } from '@uniweb/schemas/format'
|
|
25
|
+
import { markedBriefPath } from '@uniweb/schemas/conform'
|
|
25
26
|
import { qualifyRef } from '@uniweb/schemas/refs'
|
|
26
27
|
|
|
27
28
|
// Text kinds carry per-locale values when localized.
|
|
@@ -159,7 +160,7 @@ export function toDataSchemaDeclaration(normalized, { name, resolveName, resolve
|
|
|
159
160
|
// The model-level sort axis is inline: `sort_date: true` on the brief's named
|
|
160
161
|
// date field (replaces the old schema-level `sort_date_field` back-reference).
|
|
161
162
|
if (normalized.sortDate && brief) {
|
|
162
|
-
const f = sections
|
|
163
|
+
const f = sectionAt(sections, brief)?.fields?.[normalized.sortDate]
|
|
163
164
|
if (f) f.sort_date = true
|
|
164
165
|
}
|
|
165
166
|
|
|
@@ -291,24 +292,25 @@ function lowerFieldsForm(fields, resolve, optResolve, constraints) {
|
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
|
|
294
|
-
// The explicit `sections:` map → a map of lowered section bodies. The brief is the
|
|
295
|
-
//
|
|
295
|
+
// The explicit `sections:` map → a map of lowered section bodies. The brief is the section
|
|
296
|
+
// marked `brief: true` at any depth (`markedBriefPath`, `@uniweb/schemas/conform`), else the
|
|
297
|
+
// first top-level `single` not marked `brief: false` (the framework's inference).
|
|
296
298
|
function lowerSectionsForm(sectionsMap, resolve, optResolve) {
|
|
297
299
|
const sections = {}
|
|
298
|
-
let explicit = null
|
|
299
300
|
let firstSingle = null
|
|
300
301
|
for (const [secName, def] of Object.entries(sectionsMap)) {
|
|
301
302
|
sections[secName] = lowerSection(def, resolve, optResolve, secName)
|
|
302
|
-
if (def.
|
|
303
|
-
if (!firstSingle && (def.kind || 'single') === 'single') firstSingle = secName
|
|
303
|
+
if (!firstSingle && (def.kind || 'single') === 'single' && def.brief !== false) firstSingle = secName
|
|
304
304
|
}
|
|
305
|
-
//
|
|
306
|
-
//
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
return { sections, brief }
|
|
305
|
+
// A marked brief is lowered where it sits, marked; only with none is the inferred one stamped,
|
|
306
|
+
// inline, so the wire and the producer's own consumers (entity-shaping, back-fill render) find
|
|
307
|
+
// it the same way — the sections-tree has no schema-level `brief:` back-reference. ⛔ Until
|
|
308
|
+
// 2026-10-29 only a top-level mark was seen here, so a brief marked inside a group went out
|
|
309
|
+
// beside the first top-level single, stamped too, and a register refused the two.
|
|
310
|
+
const marked = markedBriefPath({ sections: sectionsMap })
|
|
311
|
+
if (marked) return { sections, brief: marked }
|
|
312
|
+
if (firstSingle) sections[firstSingle].brief = true
|
|
313
|
+
return { sections, brief: firstSingle }
|
|
312
314
|
}
|
|
313
315
|
|
|
314
316
|
// Lower one section to its declaration body (the caller keys it by name; a nested
|