uniweb 0.8.31 → 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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/partials/agents.md +21 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.8.31",
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/kit": "0.7.20",
46
- "@uniweb/runtime": "0.6.26"
45
+ "@uniweb/kit": "0.7.21",
46
+ "@uniweb/runtime": "0.6.27"
47
47
  },
48
48
  "peerDependencies": {
49
- "@uniweb/build": "0.8.30",
49
+ "@uniweb/build": "0.8.31",
50
50
  "@uniweb/content-reader": "1.1.4",
51
51
  "@uniweb/semantic-parser": "1.1.8"
52
52
  },
@@ -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
 
@@ -875,12 +875,29 @@ Kit provides `H1` through `H6` — use the appropriate level for semantic hierar
875
875
  **Full content rendering** (article/docs sections where the author controls the flow):
876
876
 
877
877
  ```jsx
878
- import { Section, Article } from '@uniweb/kit'
878
+ import { Section, Prose } from '@uniweb/kit'
879
879
 
880
880
  <Section block={block} width="lg" padding="md" />
881
- <Article block={block} />
881
+ <Prose content={content} block={block} />
882
882
  ```
883
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
+
884
901
  **Visuals:**
885
902
 
886
903
  ```jsx
@@ -893,7 +910,7 @@ import { Visual } from '@uniweb/kit'
893
910
 
894
911
  **Rendering text:** `H1`–`H6`, `P`, `Span`, `Div`, `Text` (with `as` prop)
895
912
 
896
- **Rendering content:** `Section` (full section with prose + layout), `Article` (prose content from `block.rawContent`), `Render` (ProseMirror nodes → React), `ChildBlocks` (render child sections)
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)
897
914
 
898
915
  **Rendering media:** `Visual` (first non-empty: inset/video/image), `Image`, `Media`, `Icon`
899
916