uniweb 0.2.45 → 0.2.46

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/README.md CHANGED
@@ -100,8 +100,7 @@ Components receive validated, localized data. Natural content stays in markdown;
100
100
 
101
101
  ```jsx
102
102
  export function Hero({ content, params }) {
103
- const { title } = content.main.header
104
- const { paragraphs, links } = content.main.body
103
+ const { title, paragraphs, links } = content
105
104
  const { theme = 'light' } = params
106
105
 
107
106
  return (
@@ -163,12 +162,13 @@ Open `foundation/src/components/Hero/index.jsx`. The component receives parsed c
163
162
 
164
163
  ```jsx
165
164
  export function Hero({ content, params }) {
166
- const { title } = content.main.header // "Your New Headline Here"
167
- const { paragraphs } = content.main.body // ["Updated description text."]
165
+ const { title, paragraphs, links, imgs, items } = content
168
166
  // Edit the JSX below...
169
167
  }
170
168
  ```
171
169
 
170
+ The parser extracts semantic elements from markdown—`title` from H1, `paragraphs` from body text, `links` from `[text](url)`, and so on. The `items` array contains child groups created from H3 headings (useful for features, pricing tiers, team members, etc.). See [Content Structure](./docs/content-structure.md) for details.
171
+
172
172
  Change the JSX, save, and the dev server hot-reloads your changes.
173
173
 
174
174
  ## Foundations Are Portable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.2.45",
3
+ "version": "0.2.46",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,9 +37,9 @@
37
37
  "js-yaml": "^4.1.0",
38
38
  "prompts": "^2.4.2",
39
39
  "tar": "^7.0.0",
40
- "@uniweb/build": "0.1.25",
41
- "@uniweb/runtime": "0.2.12",
42
- "@uniweb/core": "0.1.11",
43
- "@uniweb/kit": "0.1.7"
40
+ "@uniweb/build": "0.1.26",
41
+ "@uniweb/core": "0.1.12",
42
+ "@uniweb/kit": "0.1.7",
43
+ "@uniweb/runtime": "0.2.13"
44
44
  }
45
45
  }
@@ -8,8 +8,8 @@ import { H1, H2, P, Link, cn } from '@uniweb/kit'
8
8
  * This is the default component for rendering markdown content.
9
9
  */
10
10
  export function Section({ content, params }) {
11
- const { title, pretitle, subtitle } = content.main?.header || {}
12
- const { paragraphs = [], links = [], imgs = [] } = content.main?.body || {}
11
+ // Content fields: title, pretitle, subtitle, paragraphs, links, imgs, items
12
+ const { title, pretitle, subtitle, paragraphs = [], links = [], imgs = [] } = content || {}
13
13
 
14
14
  const {
15
15
  theme = 'light',
@@ -8,8 +8,8 @@ import { H1, H2, P, Link, cn } from '@uniweb/kit'
8
8
  * This is the default component for rendering markdown content.
9
9
  */
10
10
  export function Section({ content, params }) {
11
- const { title, pretitle, subtitle } = content.main?.header || {}
12
- const { paragraphs = [], links = [], imgs = [] } = content.main?.body || {}
11
+ // Content fields: title, pretitle, subtitle, paragraphs, links, imgs, items
12
+ const { title, pretitle, subtitle, paragraphs = [], links = [], imgs = [] } = content || {}
13
13
 
14
14
  const {
15
15
  theme = 'light',
@@ -8,8 +8,7 @@ import { H2, H3, P, cn } from '@uniweb/kit'
8
8
  * from the markdown content.
9
9
  */
10
10
  export function Features({ content, params }) {
11
- const { title, subtitle } = content.main?.header || {}
12
- const items = content.items || []
11
+ const { title, subtitle, items = [] } = content || {}
13
12
 
14
13
  const {
15
14
  columns = 3,
@@ -50,15 +49,15 @@ export function Features({ content, params }) {
50
49
  <div className={cn('grid gap-8', gridCols[columns] || 'md:grid-cols-3')}>
51
50
  {items.map((item, index) => (
52
51
  <div key={index} className="text-center">
53
- {item.header?.title && (
52
+ {item.title && (
54
53
  <H3
55
- text={item.header.title}
54
+ text={item.title}
56
55
  className="text-xl font-semibold mb-3"
57
56
  />
58
57
  )}
59
- {item.body?.paragraphs?.[0] && (
58
+ {item.paragraphs?.[0] && (
60
59
  <P
61
- text={item.body.paragraphs[0]}
60
+ text={item.paragraphs[0]}
62
61
  className={cn(
63
62
  theme === 'light' || theme === 'gray' ? 'text-gray-600' : 'text-gray-300'
64
63
  )}
@@ -8,8 +8,7 @@ import { H1, P, Link, cn } from '@uniweb/kit'
8
8
  * for your template's needs.
9
9
  */
10
10
  export function Hero({ content, params }) {
11
- const { title, pretitle, subtitle } = content.main?.header || {}
12
- const { paragraphs = [], links = [], imgs = [] } = content.main?.body || {}
11
+ const { title, pretitle, subtitle, paragraphs = [], links = [], imgs = [] } = content || {}
13
12
 
14
13
  const {
15
14
  theme = 'light',