uniweb 0.8.35 → 0.8.37

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.35",
3
+ "version": "0.8.37",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,10 +43,10 @@
43
43
  "tar": "^7.0.0",
44
44
  "@uniweb/core": "0.5.20",
45
45
  "@uniweb/kit": "0.7.23",
46
- "@uniweb/runtime": "0.6.30"
46
+ "@uniweb/runtime": "0.6.32"
47
47
  },
48
48
  "peerDependencies": {
49
- "@uniweb/build": "0.8.34",
49
+ "@uniweb/build": "0.8.36",
50
50
  "@uniweb/content-reader": "1.1.4",
51
51
  "@uniweb/semantic-parser": "1.1.9"
52
52
  },
@@ -841,6 +841,8 @@ All non-reserved frontmatter fields become `params`. Reserved: `type`, `preset`,
841
841
  | `block.rawContent` | object | ProseMirror document — passed internally when using `<Article block={block} />` |
842
842
  | `block.themeName` | string | `"light"`, `"medium"`, `"dark"` |
843
843
  | `block.stableId` | string | Stable ID from filename or `id:` |
844
+ | `block.key` | string | Unique key across pages (path + id) — use as React key |
845
+ | `block.path` | string | Page route this block belongs to |
844
846
 
845
847
  ### Section Wrapper
846
848
 
@@ -1195,6 +1197,18 @@ foundation/src/
1195
1197
 
1196
1198
  **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.
1197
1199
 
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:
1201
+
1202
+ ```jsx
1203
+ // ✅ Clean — use the alias
1204
+ import LessonHeader from '#components/LessonHeader'
1205
+
1206
+ // ❌ Fragile — breaks if you reorganize sections/
1207
+ import LessonHeader from '../../components/LessonHeader'
1208
+ ```
1209
+
1210
+ Within `src/components/` itself, use normal relative imports (`./AIFeedbackCard`) since files are siblings.
1211
+
1198
1212
  ### Website and Page APIs
1199
1213
 
1200
1214
  ```jsx
@@ -6,7 +6,7 @@
6
6
  export const BUILTIN_TEMPLATES = ['blank', 'starter', 'none']
7
7
 
8
8
  // Official templates from @uniweb/templates package (downloaded from GitHub releases)
9
- export const OFFICIAL_TEMPLATES = ['marketing', 'academic', 'docs', 'international', 'dynamic', 'store', 'extensions']
9
+ export const OFFICIAL_TEMPLATES = ['marketing', 'academic', 'docs', 'international', 'dynamic', 'store', 'learning', 'extensions']
10
10
 
11
11
  /**
12
12
  * Parse a template identifier and determine its source type
@@ -10,6 +10,9 @@
10
10
  "./dist": "./dist/foundation.js",
11
11
  "./dist/styles": "./dist/assets/style.css"
12
12
  },
13
+ "imports": {
14
+ "#components/*": "./src/components/*"
15
+ },
13
16
  "files": ["dist", "src"],
14
17
  "scripts": {
15
18
  "dev": "vite",
File without changes