uniweb 0.6.23 → 0.7.0

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.6.23",
3
+ "version": "0.7.0",
4
4
  "description": "Create structured Vite + React sites with content/code separation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -40,9 +40,9 @@
40
40
  "js-yaml": "^4.1.0",
41
41
  "prompts": "^2.4.2",
42
42
  "tar": "^7.0.0",
43
- "@uniweb/build": "0.6.20",
44
- "@uniweb/core": "0.4.7",
45
- "@uniweb/runtime": "0.5.22",
46
- "@uniweb/kit": "0.5.11"
43
+ "@uniweb/build": "0.7.0",
44
+ "@uniweb/core": "0.5.0",
45
+ "@uniweb/kit": "0.6.0",
46
+ "@uniweb/runtime": "0.6.0"
47
47
  }
48
48
  }
@@ -146,7 +146,7 @@ Components that render their own background declare `background: 'self'` in `met
146
146
  site/layout/
147
147
  ├── header.md # type: Header — rendered on every page
148
148
  ├── footer.md # type: Footer — rendered on every page
149
- └── left.md # type: LeftPanel — optional sidebar
149
+ └── left.md # type: Sidebar — optional sidebar
150
150
 
151
151
  site/pages/
152
152
  └── home/
@@ -334,14 +334,41 @@ const firstBody = block.page.getFirstBodyBlockInfo()
334
334
 
335
335
  ### Custom Layouts
336
336
 
337
- Export a Layout from `foundation/src/foundation.js`. Kit provides `SidebarLayout` for sidebar-based sites (docs, dashboards):
337
+ Layouts live in `foundation/src/layouts/` and are auto-discovered. Set the default in `foundation.js`:
338
+
339
+ ```js
340
+ // foundation/src/foundation.js
341
+ export default {
342
+ name: 'My Template', // Display name (falls back to package.json name)
343
+ description: 'A brief description', // Falls back to package.json description
344
+ defaultLayout: 'DocsLayout',
345
+ }
346
+ ```
338
347
 
339
348
  ```jsx
340
- import { SidebarLayout } from '@uniweb/kit/styled'
341
- export default { Layout: SidebarLayout }
349
+ // foundation/src/layouts/DocsLayout/index.jsx
350
+ export default function DocsLayout({ header, body, footer, left, right, params }) {
351
+ return (
352
+ <div className="min-h-screen flex flex-col">
353
+ {header && <header>{header}</header>}
354
+ <div className="flex-1 flex">
355
+ {left && <aside className="w-64">{left}</aside>}
356
+ <main className="flex-1">{body}</main>
357
+ {right && <aside className="w-64">{right}</aside>}
358
+ </div>
359
+ {footer && <footer>{footer}</footer>}
360
+ </div>
361
+ )
362
+ }
342
363
  ```
343
364
 
344
- Layout receives pre-rendered areas: `header`, `body`, `footer`, `left`/`leftPanel`, `right`/`rightPanel`.
365
+ Layout receives pre-rendered areas as props: `header`, `body`, `footer`, `left`, `right` (or any custom area names declared in `meta.js`), plus `params`, `page`, and `website`. Pages select layouts and hide areas in `page.yml`:
366
+
367
+ ```yaml
368
+ layout:
369
+ name: MarketingLayout
370
+ hide: [left, right]
371
+ ```
345
372
 
346
373
  ## Converting Existing Designs
347
374
 
@@ -121,11 +121,13 @@ ${colors.bright}Navigation Visibility:${colors.reset}
121
121
  ${colors.cyan}hideInHeader${colors.reset} Hide from header nav only
122
122
  ${colors.cyan}hideInFooter${colors.reset} Hide from footer nav only
123
123
 
124
- ${colors.bright}Layout Overrides:${colors.reset}
125
- ${colors.cyan}layout.header${colors.reset} Show header on this page (default: true)
126
- ${colors.cyan}layout.footer${colors.reset} Show footer on this page (default: true)
127
- ${colors.cyan}layout.leftPanel${colors.reset} Show left sidebar (default: true)
128
- ${colors.cyan}layout.rightPanel${colors.reset} Show right sidebar (default: true)
124
+ ${colors.bright}Layout Options:${colors.reset}
125
+ ${colors.cyan}layout${colors.reset} Layout name or object with name, hide, params
126
+ String: layout name (e.g., MarketingLayout)
127
+ Object: { name, hide: [areas], params: {...} }
128
+ ${colors.cyan}layout.hide${colors.reset} Array of area names to suppress on this page
129
+ Example: [header, footer] or [left, right]
130
+ ${colors.cyan}layout.params${colors.reset} Layout-specific parameters (merged with meta.js defaults)
129
131
 
130
132
  ${colors.bright}Section Control:${colors.reset}
131
133
  ${colors.cyan}sections${colors.reset} "*" for auto-discover, or explicit array
@@ -147,7 +149,7 @@ ${colors.bright}Example:${colors.reset}
147
149
  order: 2
148
150
  hideInFooter: true
149
151
  layout:
150
- rightPanel: false
152
+ hide: [right]
151
153
  seo:
152
154
  image: /about-og.png${colors.reset}
153
155
 
@@ -9,7 +9,7 @@
9
9
  * Identity (name, version, description) comes from package.json.
10
10
  */
11
11
 
12
- // import Layout from './sections/Layout'
12
+ // Create a layout at src/layouts/MyLayout/index.jsx
13
13
 
14
14
  /**
15
15
  * CSS custom properties that sites can override in theme.yml
@@ -33,8 +33,8 @@ export const vars = {
33
33
  * Runtime exports (Layout and props)
34
34
  */
35
35
  export default {
36
- // Uncomment to use a custom page layout:
37
- // Layout,
36
+ // Optional: Create custom layouts in src/layouts/
37
+ // Then set defaultLayout: 'MyLayout' below
38
38
 
39
39
  // Foundation-wide props (accessible via website.foundationProps):
40
40
  props: {},
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * This file defines foundation-level configuration:
5
5
  * - vars: CSS custom properties that sites can override in theme.yml
6
- * - Layout: Custom page layout component (optional)
6
+ * - defaultLayout: Name of the default layout from src/layouts/ (optional)
7
7
  * - props: Foundation-wide props accessible via website.foundationProps
8
8
  *
9
9
  * Identity (name, version, description) comes from package.json.
10
10
  */
11
11
 
12
- // import Layout from './sections/Layout'
12
+ // Create a layout at src/layouts/MyLayout/index.jsx
13
13
 
14
14
  /**
15
15
  * CSS custom properties that sites can override in theme.yml
@@ -30,18 +30,19 @@ export const vars = {
30
30
  }
31
31
 
32
32
  /**
33
- * Runtime exports (Layout and props)
33
+ * Runtime exports
34
34
  *
35
- * The Layout component receives pre-rendered page areas as props:
36
- * - page, website: Runtime context
35
+ * Layout components live in src/layouts/ and are auto-discovered.
36
+ * Each layout receives pre-rendered page areas as props:
37
+ * - page, website, params: Runtime context
37
38
  * - header, body, footer: Core page regions (pre-rendered React elements)
38
- * - left/leftPanel, right/rightPanel: Sidebar panels
39
+ * - Plus any custom areas declared in the layout's meta.js
39
40
  *
40
- * If no Layout is provided, the runtime uses a default layout.
41
+ * If no layouts exist, the runtime uses a default layout.
41
42
  */
42
43
  export default {
43
- // Uncomment to use a custom page layout:
44
- // Layout,
44
+ // Optional: Create custom layouts in src/layouts/
45
+ // Then set defaultLayout: 'MyLayout' below
45
46
 
46
47
  // Foundation-wide props (accessible via website.foundationProps):
47
48
  props: {},