uniweb 0.8.40 → 0.8.42

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uniweb",
3
- "version": "0.8.40",
3
+ "version": "0.8.42",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,14 +41,14 @@
41
41
  "js-yaml": "^4.1.0",
42
42
  "prompts": "^2.4.2",
43
43
  "tar": "^7.0.0",
44
- "@uniweb/core": "0.5.20",
45
- "@uniweb/runtime": "0.6.35",
46
- "@uniweb/kit": "0.7.23"
44
+ "@uniweb/core": "0.5.22",
45
+ "@uniweb/kit": "0.7.24",
46
+ "@uniweb/runtime": "0.6.38"
47
47
  },
48
48
  "peerDependencies": {
49
+ "@uniweb/build": "0.8.41",
49
50
  "@uniweb/content-reader": "1.1.4",
50
- "@uniweb/semantic-parser": "1.1.9",
51
- "@uniweb/build": "0.8.39"
51
+ "@uniweb/semantic-parser": "1.1.9"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "@uniweb/build": {
@@ -1150,26 +1150,26 @@ This is the system-building pattern at its clearest: **section types are the pub
1150
1150
 
1151
1151
  ### Section components are composites
1152
1152
 
1153
- A section component is rarely a single flat render. It imports helper components from `src/components/` to build a complex UI while presenting a single `type:` to the content author. The `src/components/` directory is the developer's workbench — ordinary React components with ordinary props, not selectable by authors, not auto-discovered.
1153
+ A section component is rarely a single flat render. It imports helper components from `src/components/` and utilities from `src/utils/` to build a complex UI while presenting a single `type:` to the content author. These directories are the developer's workbench — ordinary React and JS, not selectable by authors, not auto-discovered.
1154
1154
 
1155
1155
  ```jsx
1156
- // src/sections/Lesson/index.jsx
1157
- import LessonHeader from '../../components/LessonHeader'
1158
- import LessonContent from '../../components/LessonContent'
1159
- import LessonNav from '../../components/LessonNav'
1156
+ // src/sections/Pricing/index.jsx
1157
+ import PricingCard from '#components/PricingCard'
1158
+ import formatPrice from '#utils/formatPrice'
1160
1159
 
1161
- export default function Lesson({ content, params, block }) {
1160
+ export default function Pricing({ content, params }) {
1161
+ const currency = params.currency || 'USD'
1162
1162
  return (
1163
- <>
1164
- <LessonHeader block={block} />
1165
- <LessonContent content={content} params={params} />
1166
- <LessonNav block={block} />
1167
- </>
1163
+ <div className="grid grid-cols-1 md:grid-cols-3 gap-8 max-w-6xl mx-auto">
1164
+ {content.items.map((tier, i) => (
1165
+ <PricingCard key={i} tier={tier} price={formatPrice(tier.data, currency)} />
1166
+ ))}
1167
+ </div>
1168
1168
  )
1169
1169
  }
1170
1170
  ```
1171
1171
 
1172
- The content author writes `type: Lesson` in one markdown file. The section component handles the structural chrome a header derived from the page hierarchy, the rendered content, a prev/next footer. The three helpers live in `src/components/` and receive whatever props make sense for their job.
1172
+ The content author writes `type: Pricing` and defines tiers as content items. The section component maps items to cards using a helper component from `src/components/` and a formatting utility from `src/utils/`. Neither is selectable by authors they're implementation details behind the section type boundary.
1173
1173
 
1174
1174
  **When to reach for this pattern:** When a page type has consistent structural elements (header bars, navigation footers, contextual sidebars) that the content author shouldn't need to add as separate sections. If the author would have to add the same boilerplate sections to every page of a certain type, the section component should compose them internally.
1175
1175
 
@@ -1188,26 +1188,38 @@ foundation/src/
1188
1188
  │ └── Diagram/
1189
1189
  │ ├── index.jsx
1190
1190
  │ └── meta.js
1191
+ ├── layouts/ # Custom layouts (optional, auto-discovered)
1192
+ │ └── DocsLayout/
1193
+ │ ├── index.jsx
1194
+ │ └── meta.js
1191
1195
  ├── components/ # Your React components (no meta.js, not selectable)
1192
1196
  │ ├── ui/
1193
1197
  │ │ └── button.jsx
1194
1198
  │ └── Card.jsx
1199
+ ├── utils/ # Helper functions, non-React logic
1200
+ │ └── splitContent.js
1195
1201
  └── styles.css
1196
1202
  ```
1197
1203
 
1198
1204
  **Discovery:** PascalCase files/folders at root of `sections/` are auto-discovered. Nested levels require `meta.js`. Lowercase directories are organizational only. `hidden: true` excludes a component entirely. Everything outside `sections/` is ordinary React.
1199
1205
 
1200
- **`#components` alias:** Foundations include a `#components/*` subpath import in `package.json` that maps to `src/components/`. Use it in section types instead of brittle relative paths:
1206
+ **Import aliases:** Foundations include subpath imports in `package.json` that map to `src/` subdirectories. Use them instead of brittle relative paths:
1207
+
1208
+ | Alias | Maps to | Use for |
1209
+ |-------|---------|---------|
1210
+ | `#components/*` | `./src/components/*` | Shared React components |
1211
+ | `#utils/*` | `./src/utils/*` | Helper functions, non-React logic |
1201
1212
 
1202
1213
  ```jsx
1203
- // ✅ Clean — use the alias
1214
+ // ✅ Clean — use aliases
1204
1215
  import LessonHeader from '#components/LessonHeader'
1216
+ import splitContent from '#utils/splitContent'
1205
1217
 
1206
1218
  // ❌ Fragile — breaks if you reorganize sections/
1207
1219
  import LessonHeader from '../../components/LessonHeader'
1208
1220
  ```
1209
1221
 
1210
- Within `src/components/` itself, use normal relative imports (`./AIFeedbackCard`) since files are siblings.
1222
+ Within the same directory (e.g., one component importing a sibling), use normal relative imports (`./AIFeedbackCard`).
1211
1223
 
1212
1224
  ### Website and Page APIs
1213
1225
 
@@ -11,7 +11,8 @@
11
11
  "./dist/styles": "./dist/assets/style.css"
12
12
  },
13
13
  "imports": {
14
- "#components/*": "./src/components/*"
14
+ "#components/*": "./src/components/*",
15
+ "#utils/*": "./src/utils/*"
15
16
  },
16
17
  "files": ["dist", "src"],
17
18
  "scripts": {