uniweb 0.72.1 → 0.73.1
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/partials/agents.md +3 -1
- package/src/commands/inspect.js +22 -43
- package/src/commands/publish.js +10 -7
- package/src/framework-index.json +10 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.1",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
44
|
"@uniweb/content-writer": "^0.3.4",
|
|
45
|
-
"@uniweb/core": "^0.32.
|
|
46
|
-
"@uniweb/
|
|
47
|
-
"@uniweb/kit": "^0.19.
|
|
48
|
-
"@uniweb/
|
|
45
|
+
"@uniweb/core": "^0.32.2",
|
|
46
|
+
"@uniweb/runtime": "^0.27.10",
|
|
47
|
+
"@uniweb/kit": "^0.19.8",
|
|
48
|
+
"@uniweb/schemas": "^0.8.1",
|
|
49
49
|
"@uniweb/semantic-parser": "^1.4.1"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@uniweb/build": "^0.
|
|
52
|
+
"@uniweb/build": "^0.67.1",
|
|
53
53
|
"@uniweb/content-reader": "^1.2.5",
|
|
54
54
|
"@uniweb/semantic-parser": "^1.4.1"
|
|
55
55
|
},
|
package/partials/agents.md
CHANGED
|
@@ -1563,6 +1563,8 @@ Pages are sequences of sections — the obvious layer. The framework also suppor
|
|
|
1563
1563
|
|
|
1564
1564
|
Does the author write content *inside* the nested element? **Yes** → child sections, or a block inset when the wrapper is presentational and lives mid-page. **No** (self-contained, param-driven) → inset. Repeating same-structure groups → items. These compose: a child section can contain insets; items work inside children; a block inset can contain both.
|
|
1565
1565
|
|
|
1566
|
+
**Child sections in columns.** A section type that lays its children out in a grid offers layouts in `meta.js` — `children: { grid: [3, 2, '40/60'] }`, the first being its default — and renders them with kit's `<ChildGrid from={block} fallback={3} />`. The author picks one with `grid:` in the parent's frontmatter (`grid: 3`, `grid: '40/60'`), a section key like `type`, not a param. Don't declare a param named `grid`.
|
|
1567
|
+
|
|
1566
1568
|
### Concept blocks — naming *what* content is
|
|
1567
1569
|
|
|
1568
1570
|
A ` ```md:<tag> ` fence marks a run of prose as a named kind of thing. The author writes ordinary markdown; the tag says what it is:
|
|
@@ -1626,7 +1628,7 @@ The developer builds `NetworkDiagram` as an ordinary React component with `inset
|
|
|
1626
1628
|
|
|
1627
1629
|
**Insets are full section types** — they receive `{ content, params, block }`. The alt text becomes `content.title` and attributes become `params`: `{note="Ready to go"}` → `content.title = "npm create uniweb"`, `params.note = "Ready to go"`.
|
|
1628
1630
|
|
|
1629
|
-
**Don't use `hidden: true` on insets.** `hidden` means "don't export this component at all" (internal helpers); `inset: true` means "available for `@Component` references in markdown.
|
|
1631
|
+
**Don't use `hidden: true` on insets.** `hidden` means "don't export this component at all" (internal helpers); `inset: true` means "available for `@Component` references in markdown" — and a visual editor then offers it as an inset only. For a component placed both as a section and as an inset, add `section: true`.
|
|
1630
1632
|
|
|
1631
1633
|
**Block insets — a component that wraps content.** The image form is a leaf: it takes params but no body. When the component should surround authored prose — a callout, a disclosure, an admonition — use the fenced form instead. Same `@Component{params}` reference, written as a code fence's info string:
|
|
1632
1634
|
|
package/src/commands/inspect.js
CHANGED
|
@@ -54,9 +54,13 @@ async function loadDependencies() {
|
|
|
54
54
|
import('@uniweb/content-reader'),
|
|
55
55
|
import('@uniweb/semantic-parser')
|
|
56
56
|
])
|
|
57
|
+
// Optional: the inset lift a Block runs (`@uniweb/core/insets`). An older
|
|
58
|
+
// install without it shows the insets unlifted, as `inset_ref` nodes.
|
|
59
|
+
const coreInsets = await import('@uniweb/core/insets').catch(() => null)
|
|
57
60
|
return {
|
|
58
61
|
markdownToProseMirror: contentReader.markdownToProseMirror,
|
|
59
62
|
parseContent: semanticParser.parseContent,
|
|
63
|
+
liftInsets: coreInsets?.liftInsets,
|
|
60
64
|
// Optional: present from @uniweb/semantic-parser >= the staircase
|
|
61
65
|
// release; older installs simply show no findings.
|
|
62
66
|
lintContent: semanticParser.lintContent
|
|
@@ -124,41 +128,6 @@ function splitParams(frontMatter) {
|
|
|
124
128
|
}
|
|
125
129
|
}
|
|
126
130
|
|
|
127
|
-
/**
|
|
128
|
-
* Extract inset references from a ProseMirror document.
|
|
129
|
-
* Exact match of content-collector lines 192-218.
|
|
130
|
-
*
|
|
131
|
-
* @param {object} doc - ProseMirror document (mutated in place)
|
|
132
|
-
* @returns {Array} Array of { refId, type, params, description }
|
|
133
|
-
*/
|
|
134
|
-
function extractInsets(doc) {
|
|
135
|
-
if (!doc?.content || !Array.isArray(doc.content)) return []
|
|
136
|
-
|
|
137
|
-
const insets = []
|
|
138
|
-
let refIndex = 0
|
|
139
|
-
|
|
140
|
-
for (let i = 0; i < doc.content.length; i++) {
|
|
141
|
-
const node = doc.content[i]
|
|
142
|
-
if (node.type === 'inset_ref') {
|
|
143
|
-
const { component, alt, ...params } = node.attrs || {}
|
|
144
|
-
const refId = `inset_${refIndex++}`
|
|
145
|
-
insets.push({
|
|
146
|
-
refId,
|
|
147
|
-
type: component,
|
|
148
|
-
params: Object.keys(params).length > 0 ? params : {},
|
|
149
|
-
description: alt || null
|
|
150
|
-
})
|
|
151
|
-
// Replace in-place with placeholder
|
|
152
|
-
doc.content[i] = {
|
|
153
|
-
type: 'inset_placeholder',
|
|
154
|
-
attrs: { refId }
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return insets
|
|
160
|
-
}
|
|
161
|
-
|
|
162
131
|
/**
|
|
163
132
|
* Guarantee item has flat content structure.
|
|
164
133
|
* Keep in sync with @uniweb/runtime/src/prepare-props.js
|
|
@@ -253,11 +222,22 @@ function processFile(fileContent, fileName, deps, options) {
|
|
|
253
222
|
const { frontMatter, markdown } = extractFrontmatter(fileContent)
|
|
254
223
|
const { type, preset, reserved, params } = splitParams(frontMatter)
|
|
255
224
|
|
|
256
|
-
// Parse markdown to ProseMirror
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
//
|
|
260
|
-
|
|
225
|
+
// Parse markdown to ProseMirror — the document as stored, insets as written.
|
|
226
|
+
const stored = markdownToProseMirror(markdown)
|
|
227
|
+
|
|
228
|
+
// What the component receives: the insets lifted the way a Block lifts them —
|
|
229
|
+
// a placeholder in the content, the inset itself listed beside it. ⛔ This
|
|
230
|
+
// file carried its own copy of the site build's extractor until 2026-09-27,
|
|
231
|
+
// and it had drifted (top-level only, no inline insets, `description` for
|
|
232
|
+
// `title`); insets are lifted by core now, so this asks core.
|
|
233
|
+
const lifted = deps.liftInsets
|
|
234
|
+
? deps.liftInsets(stored)
|
|
235
|
+
: { content: stored, leaves: [], containers: [] }
|
|
236
|
+
const doc = lifted.content
|
|
237
|
+
const insets = [
|
|
238
|
+
...lifted.leaves,
|
|
239
|
+
...lifted.containers.map(({ refId, type, params }) => ({ refId, type, params, container: true }))
|
|
240
|
+
]
|
|
261
241
|
|
|
262
242
|
// Build result
|
|
263
243
|
const result = {}
|
|
@@ -279,9 +259,8 @@ function processFile(fileContent, fileName, deps, options) {
|
|
|
279
259
|
}
|
|
280
260
|
|
|
281
261
|
if (raw) {
|
|
282
|
-
// Raw mode:
|
|
283
|
-
result.prosemirror =
|
|
284
|
-
if (insets.length > 0) result.insets = insets
|
|
262
|
+
// Raw mode: the ProseMirror AST as stored — insets in it as the author wrote them.
|
|
263
|
+
result.prosemirror = stored
|
|
285
264
|
return result
|
|
286
265
|
}
|
|
287
266
|
|
package/src/commands/publish.js
CHANGED
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
* 2. BRINGS THE FOUNDATION ALONG — if the site's local foundation changed
|
|
12
12
|
* since its last release, releases the new version first (or asks); a
|
|
13
13
|
* published registry ref needs nothing (§4, foundation-bring-along.js);
|
|
14
|
-
* 3. SYNCS — builds the site data (link mode), uploads media
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* 3. SYNCS — builds the site data (link mode), uploads media and the
|
|
15
|
+
* schema-less data files, and pushes content (the same two-lane sync
|
|
16
|
+
* `uniweb push` uses);
|
|
17
|
+
* 4. GOES LIVE — POST /dev/site/publish/{uuid}. When the backend answers 402
|
|
18
|
+
* (the site must be paid for first), it opens the settlement URL the
|
|
19
|
+
* backend hands over, verbatim, and stops; the content is already synced,
|
|
20
|
+
* so the author settles and runs publish again (payment-handoff.js).
|
|
19
21
|
*
|
|
20
22
|
* Distinct from `uniweb deploy` (third-party hosts) and `uniweb register`
|
|
21
23
|
* (foundation code → catalog). For a self-contained artifact, see `uniweb export`.
|
|
@@ -644,8 +646,9 @@ export async function publish(args = []) {
|
|
|
644
646
|
return { exitCode: 1 }
|
|
645
647
|
}
|
|
646
648
|
|
|
647
|
-
// 4.
|
|
648
|
-
//
|
|
649
|
+
// 4. Gather the schema-less data files BEFORE uploading media, since their
|
|
650
|
+
// records can carry local media too. (No search index rides here since
|
|
651
|
+
// 2026-08-01, and nothing is bundled — `build/src/site/schemaless-data.js`.)
|
|
649
652
|
let ball = await collectSchemalessData(distDir, schemalessNames)
|
|
650
653
|
const ballAssets = collectSchemalessDataAssets(ball)
|
|
651
654
|
|
package/src/framework-index.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-09-
|
|
3
|
+
"generatedAt": "2026-09-28T00:03:37.248Z",
|
|
4
4
|
"packages": {
|
|
5
5
|
"@uniweb/api": {
|
|
6
6
|
"version": "0.6.5",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
12
|
"@uniweb/build": {
|
|
13
|
-
"version": "0.
|
|
13
|
+
"version": "0.67.1",
|
|
14
14
|
"path": "framework/build",
|
|
15
15
|
"deps": [
|
|
16
16
|
"@uniweb/content-reader",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"deps": []
|
|
36
36
|
},
|
|
37
37
|
"@uniweb/core": {
|
|
38
|
-
"version": "0.32.
|
|
38
|
+
"version": "0.32.2",
|
|
39
39
|
"path": "framework/core",
|
|
40
40
|
"deps": [
|
|
41
41
|
"@uniweb/semantic-parser",
|
|
@@ -55,12 +55,13 @@
|
|
|
55
55
|
]
|
|
56
56
|
},
|
|
57
57
|
"@uniweb/kit": {
|
|
58
|
-
"version": "0.19.
|
|
58
|
+
"version": "0.19.8",
|
|
59
59
|
"path": "framework/kit",
|
|
60
60
|
"deps": [
|
|
61
61
|
"@uniweb/core",
|
|
62
62
|
"@uniweb/projections",
|
|
63
63
|
"@uniweb/scene",
|
|
64
|
+
"@uniweb/schemas",
|
|
64
65
|
"@uniweb/semantic-parser"
|
|
65
66
|
]
|
|
66
67
|
},
|
|
@@ -75,7 +76,7 @@
|
|
|
75
76
|
"deps": []
|
|
76
77
|
},
|
|
77
78
|
"@uniweb/projections": {
|
|
78
|
-
"version": "0.7.
|
|
79
|
+
"version": "0.7.7",
|
|
79
80
|
"path": "framework/projections",
|
|
80
81
|
"deps": [
|
|
81
82
|
"@uniweb/content-writer",
|
|
@@ -83,7 +84,7 @@
|
|
|
83
84
|
]
|
|
84
85
|
},
|
|
85
86
|
"@uniweb/runtime": {
|
|
86
|
-
"version": "0.27.
|
|
87
|
+
"version": "0.27.10",
|
|
87
88
|
"path": "framework/runtime",
|
|
88
89
|
"deps": [
|
|
89
90
|
"@uniweb/core",
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
"deps": []
|
|
97
98
|
},
|
|
98
99
|
"@uniweb/schemas": {
|
|
99
|
-
"version": "0.8.
|
|
100
|
+
"version": "0.8.1",
|
|
100
101
|
"path": "framework/schemas",
|
|
101
102
|
"deps": []
|
|
102
103
|
},
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
"deps": []
|
|
117
118
|
},
|
|
118
119
|
"@uniweb/templates": {
|
|
119
|
-
"version": "0.17.
|
|
120
|
+
"version": "0.17.6",
|
|
120
121
|
"path": "framework/templates",
|
|
121
122
|
"deps": []
|
|
122
123
|
},
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"deps": []
|
|
127
128
|
},
|
|
128
129
|
"@uniweb/unipress": {
|
|
129
|
-
"version": "0.10.
|
|
130
|
+
"version": "0.10.10",
|
|
130
131
|
"path": "framework/unipress",
|
|
131
132
|
"deps": [
|
|
132
133
|
"@uniweb/build",
|