uniweb 0.8.30 → 0.8.32
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 +4 -4
- package/partials/agents.md +29 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uniweb",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.32",
|
|
4
4
|
"description": "Create structured Vite + React sites with content/code separation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"prompts": "^2.4.2",
|
|
43
43
|
"tar": "^7.0.0",
|
|
44
44
|
"@uniweb/core": "0.5.18",
|
|
45
|
-
"@uniweb/
|
|
46
|
-
"@uniweb/
|
|
45
|
+
"@uniweb/kit": "0.7.21",
|
|
46
|
+
"@uniweb/runtime": "0.6.27"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@uniweb/build": "0.8.
|
|
49
|
+
"@uniweb/build": "0.8.31",
|
|
50
50
|
"@uniweb/content-reader": "1.1.4",
|
|
51
51
|
"@uniweb/semantic-parser": "1.1.8"
|
|
52
52
|
},
|
package/partials/agents.md
CHANGED
|
@@ -398,7 +398,7 @@ function Hello() {
|
|
|
398
398
|
|
|
399
399
|
Access: `content.snippets[0]` → `{ language: 'jsx', code: 'function Hello() {...}' }`. The `language` attribute is a display hint for syntax highlighting, not a parsing format. Filter by language: `content.snippets.filter(s => s.language === 'css')`.
|
|
400
400
|
|
|
401
|
-
Both appear in `content.sequence` for document-order rendering. The difference: tagged data blocks are parsed and extracted to `content.data`; code snippets are preserved and collected in `content.snippets`.
|
|
401
|
+
Both appear in `content.sequence` for document-order rendering. The difference: tagged data blocks are parsed and extracted to `content.data`; code snippets are preserved and collected in `content.snippets`. `<Prose>` handles this automatically — it renders code snippets with syntax highlighting and skips tagged data blocks, which components access separately via `content.data`.
|
|
402
402
|
|
|
403
403
|
### Composition: Nesting and Embedding
|
|
404
404
|
|
|
@@ -502,6 +502,14 @@ export default function Grid({ block, params }) {
|
|
|
502
502
|
}
|
|
503
503
|
```
|
|
504
504
|
|
|
505
|
+
`ChildBlocks` renders each child as a bare component by default — no wrapper element, no context classes, no background. This is the right behavior for grid cells, tab panels, carousel slides, and inline children where the parent controls the container.
|
|
506
|
+
|
|
507
|
+
For the rare case where children should be independent sections with their own theming and backgrounds, pass `wrapAs`:
|
|
508
|
+
|
|
509
|
+
```jsx
|
|
510
|
+
<ChildBlocks from={block} wrapAs="div" />
|
|
511
|
+
```
|
|
512
|
+
|
|
505
513
|
**Data and child blocks:** Page-level `data:` is available to all blocks on the page, including children. Each child block resolves data independently through the same page → site hierarchy. If a child component needs data, declare it in the child's `meta.js` or in the child section's frontmatter (`data: articles`).
|
|
506
514
|
|
|
507
515
|
### Section Backgrounds
|
|
@@ -867,12 +875,29 @@ Kit provides `H1` through `H6` — use the appropriate level for semantic hierar
|
|
|
867
875
|
**Full content rendering** (article/docs sections where the author controls the flow):
|
|
868
876
|
|
|
869
877
|
```jsx
|
|
870
|
-
import { Section,
|
|
878
|
+
import { Section, Prose } from '@uniweb/kit'
|
|
871
879
|
|
|
872
880
|
<Section block={block} width="lg" padding="md" />
|
|
873
|
-
<
|
|
881
|
+
<Prose content={content} block={block} />
|
|
874
882
|
```
|
|
875
883
|
|
|
884
|
+
`Prose` renders from the parsed content sequence — headings, paragraphs, images, code snippets, lists, etc. — with prose typography. Tagged data blocks are **skipped** (they're structured data, not prose). Access them via `content.data` for custom rendering:
|
|
885
|
+
|
|
886
|
+
```jsx
|
|
887
|
+
function Lesson({ content, block }) {
|
|
888
|
+
return (
|
|
889
|
+
<div>
|
|
890
|
+
<Prose content={content} block={block} />
|
|
891
|
+
{content.data.quiz && <Quiz data={content.data.quiz} />}
|
|
892
|
+
</div>
|
|
893
|
+
)
|
|
894
|
+
}
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
Pass `content` (the parsed content object — has `.sequence`). Pass `block` too if the content uses insets. Also works as a pure typography wrapper: `<Prose>{children}</Prose>`.
|
|
898
|
+
|
|
899
|
+
`Article` is an older alternative that renders from `block.rawContent` (raw ProseMirror nodes) — it renders everything including data blocks. Prefer `Prose` for new components.
|
|
900
|
+
|
|
876
901
|
**Visuals:**
|
|
877
902
|
|
|
878
903
|
```jsx
|
|
@@ -885,7 +910,7 @@ import { Visual } from '@uniweb/kit'
|
|
|
885
910
|
|
|
886
911
|
**Rendering text:** `H1`–`H6`, `P`, `Span`, `Div`, `Text` (with `as` prop)
|
|
887
912
|
|
|
888
|
-
**Rendering content:** `Section` (full section with prose + layout), `
|
|
913
|
+
**Rendering content:** `Section` (full section with prose + layout), `Prose` (prose from parsed content sequence, skips data blocks), `Article` (raw ProseMirror rendering), `Render` (ProseMirror nodes → React), `ChildBlocks` (render child sections)
|
|
889
914
|
|
|
890
915
|
**Rendering media:** `Visual` (first non-empty: inset/video/image), `Image`, `Media`, `Icon`
|
|
891
916
|
|