@honeydeck/honeydeck 0.1.1 → 0.2.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/AGENTS.md +1 -2
- package/DEVELOPMENT.md +0 -2
- package/Readme.md +2 -3
- package/SPEC.md +3 -3
- package/docs/customization.md +413 -0
- package/docs/{next-steps.md → deeper-dive.md} +11 -9
- package/docs/getting-started.md +15 -7
- package/docs/slidev-migration.md +1 -1
- package/package.json +1 -2
- package/skills/SPEC.md +2 -2
- package/skills/honeydeck/SKILL.md +3 -3
- package/skills/slidev-migration/SKILL.md +2 -2
- package/src/cli/SPEC.md +1 -0
- package/src/cli/dev.ts +26 -6
- package/src/cli/index.ts +1 -1
- package/src/cli/init.ts +26 -6
- package/src/layouts/SPEC.md +46 -117
- package/src/runtime/SPEC.md +1 -0
- package/src/runtime/views/SPEC.md +1 -1
- package/docs/kit-authoring.md +0 -207
- package/docs/kits.md +0 -387
|
@@ -16,7 +16,7 @@ Before changing files, read the available project/package docs:
|
|
|
16
16
|
- `Readme.md`, `docs/getting-started.md`, root `SPEC.md`, linked colocated `SPEC.md` files, and `docs/slides.md` for Honeydeck deck structure
|
|
17
17
|
- `docs/configuration.md` for Honeydeck frontmatter
|
|
18
18
|
- `docs/steps-and-reveals.md` for Reveal/RevealGroup/code steps
|
|
19
|
-
- `docs/
|
|
19
|
+
- `docs/customization.md` for layouts, themes, components, layout maps, and design tokens
|
|
20
20
|
- Existing Slidev files: `slides.md`, `pages/**/*.md`, `components/**/*.vue`, `layouts/**/*.vue`, `styles/**`, `public/**`, `package.json`, `vite.config.*`, and local theme/addon packages
|
|
21
21
|
|
|
22
22
|
If Honeydeck docs are not nearby, package docs may be in `node_modules/@honeydeck/honeydeck`, or the user can use the public docs site. A migrated deck's runtime reference pages cover active theme tokens, layouts, and built-in components.
|
|
@@ -51,7 +51,7 @@ Create a working Honeydeck presentation that preserves the talk's structure, con
|
|
|
51
51
|
| `public/**` | `public/**` copied unchanged; root-relative `/assets/...` paths usually keep working |
|
|
52
52
|
| `components/*.vue` | `components/*.tsx` React components |
|
|
53
53
|
| `layouts/*.vue` | React layouts plus a layout map selected with deck frontmatter `layouts: "./layouts"` |
|
|
54
|
-
| Slidev theme package | Honeydeck
|
|
54
|
+
| Slidev theme package | Honeydeck theme CSS, layout map, or local React layouts + CSS |
|
|
55
55
|
| `styles/style.css` or `styles/index.*` | `styles.css` imported from `deck.mdx` |
|
|
56
56
|
| `slidev`, `slidev build`, `slidev export` scripts | `honeydeck dev`, `honeydeck build`, `honeydeck pdf` scripts |
|
|
57
57
|
|
package/src/cli/SPEC.md
CHANGED
|
@@ -43,6 +43,7 @@ Behavior:
|
|
|
43
43
|
- Generates starter files, including `deck.mdx`, `styles.css`, `.gitignore`, `package.json`, `public/`, and `components/SparkleButton.tsx`
|
|
44
44
|
- Renders `deck.mdx` and `styles.css` from real template files that can also run as a development demo
|
|
45
45
|
- Installs dependencies with npm unless `--skip-install` is used
|
|
46
|
+
- Shows a live process indicator for non-interactive work such as starter file generation and dependency installation; long-running installs keep updating so users know work is still active
|
|
46
47
|
- Asks whether to open the Honeydeck agent skills installer unless `--skip-skill` or `--install-skill` is used, and makes clear that accepting runs `npx skills add`
|
|
47
48
|
- Cancelling any `honeydeck init` prompt or interrupting the spawned skills installer aborts the init flow instead of continuing
|
|
48
49
|
- If cancellation or interruption happens after `honeydeck init` created a new project directory, Honeydeck cleans up that generated project directory before exiting; it never deletes a directory that existed before init started
|
package/src/cli/dev.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
import { readFileSync } from "node:fs";
|
|
25
25
|
import { dirname, resolve } from "node:path";
|
|
26
26
|
import { fileURLToPath } from "node:url";
|
|
27
|
-
import { createServer, type Plugin } from "vite";
|
|
27
|
+
import { createServer, type Plugin, searchForWorkspaceRoot } from "vite";
|
|
28
28
|
import { honeydeckPlugin } from "#vite-plugin/index.ts";
|
|
29
29
|
import { hasHelpFlag } from "./args.ts";
|
|
30
30
|
import { formatCommandBanner } from "./banner.ts";
|
|
@@ -58,6 +58,20 @@ const INDEX_HTML_PATH = resolve(APP_SHELL_DIR, "index.html");
|
|
|
58
58
|
*/
|
|
59
59
|
const PACKAGE_ROOT = resolve(__dirname, "../..");
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Bare dependencies imported by the Honeydeck app shell/runtime before any
|
|
63
|
+
* user-authored HTML entry exists. Vite cannot discover these reliably from
|
|
64
|
+
* its normal HTML scan because `honeydeck dev` serves a custom app shell from
|
|
65
|
+
* /@fs/, so keep the CommonJS/large ESM deps pre-bundled explicitly.
|
|
66
|
+
*/
|
|
67
|
+
const DEV_OPTIMIZE_DEPS = [
|
|
68
|
+
"react",
|
|
69
|
+
"react/jsx-runtime",
|
|
70
|
+
"react/jsx-dev-runtime",
|
|
71
|
+
"react-dom/client",
|
|
72
|
+
"lucide-react",
|
|
73
|
+
] as const;
|
|
74
|
+
|
|
61
75
|
// ---------------------------------------------------------------------------
|
|
62
76
|
// Arg parsing
|
|
63
77
|
// ---------------------------------------------------------------------------
|
|
@@ -156,7 +170,7 @@ export function parseDevArgs(args: string[]): DevOptions {
|
|
|
156
170
|
* /@fs/ script src, and lets Vite's `transformIndexHtml` pipeline apply
|
|
157
171
|
* any further HTML transforms (e.g. inject the HMR client).
|
|
158
172
|
*/
|
|
159
|
-
function appShellPlugin(): Plugin {
|
|
173
|
+
function appShellPlugin(projectRoot: string): Plugin {
|
|
160
174
|
return {
|
|
161
175
|
name: "honeydeck:app-shell",
|
|
162
176
|
|
|
@@ -164,9 +178,11 @@ function appShellPlugin(): Plugin {
|
|
|
164
178
|
return {
|
|
165
179
|
server: {
|
|
166
180
|
fs: {
|
|
167
|
-
//
|
|
168
|
-
//
|
|
169
|
-
|
|
181
|
+
// Setting server.fs.allow replaces Vite's default allow list.
|
|
182
|
+
// Keep the user's workspace root allowed for normal node_modules
|
|
183
|
+
// serving, then add the Honeydeck package root so /@fs/ can reach
|
|
184
|
+
// src/runtime/app-shell/main.tsx when it lives outside that root.
|
|
185
|
+
allow: [searchForWorkspaceRoot(projectRoot), PACKAGE_ROOT],
|
|
170
186
|
},
|
|
171
187
|
},
|
|
172
188
|
};
|
|
@@ -232,9 +248,13 @@ export async function runDev(args: string[]): Promise<void> {
|
|
|
232
248
|
|
|
233
249
|
server: createDevServerConfig(port, open),
|
|
234
250
|
|
|
251
|
+
optimizeDeps: {
|
|
252
|
+
include: [...DEV_OPTIMIZE_DEPS],
|
|
253
|
+
},
|
|
254
|
+
|
|
235
255
|
plugins: [
|
|
236
256
|
// 1. App shell: serve our index.html + configure fs.allow
|
|
237
|
-
appShellPlugin(),
|
|
257
|
+
appShellPlugin(root),
|
|
238
258
|
// 2. Virtual modules + MDX compilation + Tailwind
|
|
239
259
|
...honeydeckPlugin({ root, entry }),
|
|
240
260
|
],
|
package/src/cli/index.ts
CHANGED
package/src/cli/init.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* 8. outro() — success message with next steps.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import {
|
|
16
|
+
import { spawn } from "node:child_process";
|
|
17
17
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
18
18
|
import { dirname, join, resolve } from "node:path";
|
|
19
19
|
import * as p from "@clack/prompts";
|
|
@@ -101,6 +101,29 @@ export function parseInitArgs(args: string[]): InitOptions {
|
|
|
101
101
|
|
|
102
102
|
const INSTALL_COMMAND = "npm install";
|
|
103
103
|
|
|
104
|
+
function runCommand(command: string, cwd: string): Promise<void> {
|
|
105
|
+
return new Promise((resolveCommand, rejectCommand) => {
|
|
106
|
+
const child = spawn(command, {
|
|
107
|
+
cwd,
|
|
108
|
+
shell: true,
|
|
109
|
+
stdio: "ignore",
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
child.once("error", rejectCommand);
|
|
113
|
+
child.once("exit", (code, signal) => {
|
|
114
|
+
if (code === 0) {
|
|
115
|
+
resolveCommand();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const reason = signal
|
|
120
|
+
? `signal ${signal}`
|
|
121
|
+
: `exit code ${code ?? "unknown"}`;
|
|
122
|
+
rejectCommand(new Error(`${command} failed with ${reason}`));
|
|
123
|
+
});
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
104
127
|
// ---------------------------------------------------------------------------
|
|
105
128
|
// Validation
|
|
106
129
|
// ---------------------------------------------------------------------------
|
|
@@ -285,10 +308,7 @@ export async function runInit(args: string[]): Promise<void> {
|
|
|
285
308
|
installSpinner.start("Installing dependencies with npm…");
|
|
286
309
|
|
|
287
310
|
try {
|
|
288
|
-
|
|
289
|
-
cwd: projectDir,
|
|
290
|
-
stdio: "pipe",
|
|
291
|
-
});
|
|
311
|
+
await runCommand(INSTALL_COMMAND, projectDir);
|
|
292
312
|
installSpinner.stop("Dependencies installed ✅");
|
|
293
313
|
} catch (_err) {
|
|
294
314
|
installSpinner.stop("Dependency installation failed ⚠️");
|
|
@@ -352,7 +372,7 @@ export async function runInit(args: string[]): Promise<void> {
|
|
|
352
372
|
` cd ${projectName}`,
|
|
353
373
|
" npm run dev",
|
|
354
374
|
"",
|
|
355
|
-
" Happy presenting!
|
|
375
|
+
" Happy presenting! 🐝",
|
|
356
376
|
"",
|
|
357
377
|
].join("\n"),
|
|
358
378
|
);
|
package/src/layouts/SPEC.md
CHANGED
|
@@ -1,170 +1,99 @@
|
|
|
1
|
-
# Honeydeck Layouts and
|
|
1
|
+
# Honeydeck Layouts and Customization Specification
|
|
2
2
|
|
|
3
|
-
> Observable behavior for
|
|
3
|
+
> Observable behavior for theme CSS, layout maps, built-in layouts, layout props, and layout demos.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Customization — Theme CSS, Layout Maps, Components
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Honeydeck customization is explicit composition. Themes are CSS imports, layouts come from a default-exported layout map, and components are normal React/MDX imports:
|
|
8
8
|
|
|
9
9
|
| Concern | What it is | How it's used |
|
|
10
10
|
|---------|-----------|---------------|
|
|
11
|
-
| Theme | CSS file
|
|
12
|
-
| Layouts |
|
|
13
|
-
| Components |
|
|
11
|
+
| Theme | CSS file with tokens, colors, and typography | explicit CSS import from MDX or another CSS file |
|
|
12
|
+
| Layouts | layout component map | `layouts:` in frontmatter |
|
|
13
|
+
| Components | reusable React components | explicit `import` in MDX |
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
These references may point to local project files or normal installed packages. Honeydeck does not provide special publishing or registry behavior.
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
@company/honeydeck-kit-brand/
|
|
19
|
-
package.json
|
|
20
|
-
theme.css ← CSS tokens/variables
|
|
21
|
-
layouts/
|
|
22
|
-
index.ts ← exports LayoutMap
|
|
23
|
-
Blank.tsx
|
|
24
|
-
Default.tsx
|
|
25
|
-
Cover.tsx
|
|
26
|
-
Section.tsx
|
|
27
|
-
TwoCol.tsx
|
|
28
|
-
Image.tsx
|
|
29
|
-
ImageLeft.tsx
|
|
30
|
-
ImageRight.tsx
|
|
31
|
-
components/
|
|
32
|
-
Callout.tsx
|
|
33
|
-
Badge.tsx
|
|
34
|
-
```
|
|
17
|
+
### Zero Config
|
|
35
18
|
|
|
36
|
-
|
|
19
|
+
A plain `deck.mdx` file with no frontmatter still works with built-in layouts:
|
|
37
20
|
|
|
38
21
|
```mdx
|
|
39
|
-
|
|
40
|
-
title: My Talk
|
|
41
|
-
layouts: "@company/honeydeck-kit-brand/layouts"
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
import '@company/honeydeck-kit-brand/theme.css'
|
|
45
|
-
import './my-overrides.css'
|
|
46
|
-
|
|
47
|
-
import { Callout } from '@company/honeydeck-kit-brand/components'
|
|
48
|
-
|
|
49
|
-
# First slide
|
|
22
|
+
# Hello world
|
|
50
23
|
|
|
51
|
-
|
|
24
|
+
This renders with the built-in default layout.
|
|
52
25
|
```
|
|
53
26
|
|
|
54
|
-
|
|
27
|
+
Styling is provided only by explicit CSS imports. Honeydeck does not auto-inject Tailwind, `@honeydeck/honeydeck/theme.css`, or custom theme CSS. The starter project imports `./styles.css` from `deck.mdx`; `styles.css` imports Tailwind and `@honeydeck/honeydeck/theme.css`. Without that import, slides still render with built-in layouts, but mostly with browser/default styling. User imports override via cascade.
|
|
55
28
|
|
|
56
|
-
Theme
|
|
29
|
+
### Theme Layering
|
|
57
30
|
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
layouts: "@company/honeydeck-kit-brand/layouts"
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
import '@other/honeydeck-kit-minimal/theme.css'
|
|
64
|
-
import { Badge } from '@third/honeydeck-kit-fancy/components'
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Local Kits
|
|
68
|
-
|
|
69
|
-
Create a kit in your project folder:
|
|
31
|
+
Honeydeck ships optional theme layers that are imported after the base theme. Theme layers are token overrides and are not standalone replacements for the base theme:
|
|
70
32
|
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
index.ts
|
|
76
|
-
MyCustom.tsx
|
|
33
|
+
```css
|
|
34
|
+
@import "tailwindcss";
|
|
35
|
+
@import "@honeydeck/honeydeck/theme.css";
|
|
36
|
+
@import "@honeydeck/honeydeck/themes/clean.css";
|
|
77
37
|
```
|
|
78
38
|
|
|
79
|
-
|
|
39
|
+
Honeydeck includes:
|
|
80
40
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
41
|
+
| Theme import | Purpose |
|
|
42
|
+
|--------------|---------|
|
|
43
|
+
| `@honeydeck/honeydeck/theme.css` | Preferred base theme import; clean black/white/grey defaults |
|
|
44
|
+
| `@honeydeck/honeydeck/themes/base.css` | Package export alias for the base theme |
|
|
45
|
+
| `@honeydeck/honeydeck/themes/clean.css` | Optional clean visual style layer |
|
|
46
|
+
| `@honeydeck/honeydeck/themes/bee.css` | Bee theme layer for the original playful palette |
|
|
86
47
|
|
|
87
|
-
|
|
88
|
-
import './theme.css'
|
|
89
|
-
```
|
|
48
|
+
Use `@honeydeck/honeydeck/layouts` for clean default layouts. Use `@honeydeck/honeydeck/layouts/bee` together with `@honeydeck/honeydeck/themes/bee.css` for the Bee visual style.
|
|
90
49
|
|
|
91
|
-
###
|
|
50
|
+
### CSS Overrides
|
|
92
51
|
|
|
93
|
-
Use standard CSS `@import`
|
|
52
|
+
Use standard CSS cascade and `@import` to layer overrides:
|
|
94
53
|
|
|
95
54
|
```css
|
|
96
|
-
|
|
97
|
-
@import
|
|
55
|
+
@import "tailwindcss";
|
|
56
|
+
@import "@honeydeck/honeydeck/theme.css";
|
|
98
57
|
|
|
99
58
|
:root {
|
|
100
59
|
--honeydeck-primary: oklch(55% 0.25 145);
|
|
101
60
|
}
|
|
102
61
|
```
|
|
103
62
|
|
|
104
|
-
### Layout
|
|
63
|
+
### Layout Maps
|
|
105
64
|
|
|
106
|
-
|
|
65
|
+
Create a layout map in the project and reference it relative to the deck entry file:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
---
|
|
69
|
+
layouts: "./layouts"
|
|
70
|
+
---
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Layout maps may compose entries with JavaScript spread:
|
|
107
74
|
|
|
108
75
|
```ts
|
|
109
76
|
// layouts/index.ts
|
|
110
|
-
import
|
|
111
|
-
import fancyLayouts from '@fancy/honeydeck-kit/layouts'
|
|
77
|
+
import defaultLayouts from '@honeydeck/honeydeck/layouts'
|
|
112
78
|
import { MyCustomCover } from './Cover'
|
|
113
79
|
|
|
114
80
|
export default {
|
|
115
|
-
...
|
|
116
|
-
Section: fancyLayouts.Section,
|
|
81
|
+
...defaultLayouts,
|
|
117
82
|
Cover: MyCustomCover,
|
|
118
83
|
} satisfies LayoutMap
|
|
119
84
|
```
|
|
120
85
|
|
|
121
|
-
### Zero Config
|
|
122
|
-
|
|
123
|
-
A plain `deck.mdx` file with no frontmatter still works with built-in layouts:
|
|
124
|
-
|
|
125
|
-
```mdx
|
|
126
|
-
# Hello world
|
|
127
|
-
|
|
128
|
-
This renders with the built-in default layout.
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Styling is provided only by explicit CSS imports. Honeydeck does not auto-inject Tailwind, `@honeydeck/honeydeck/theme.css`, or kit theme CSS. The starter project imports `./styles.css` from `deck.mdx`; `styles.css` imports Tailwind and `@honeydeck/honeydeck/theme.css`. Without that import, slides still render with built-in layouts, but mostly with browser/default styling. User imports override via cascade.
|
|
132
|
-
|
|
133
|
-
### Bundled Theme Layers
|
|
134
|
-
|
|
135
|
-
Honeydeck ships optional theme layers that are imported after the base theme. Theme layers are token overrides and are not standalone replacements for the base theme:
|
|
136
|
-
|
|
137
|
-
```css
|
|
138
|
-
@import "tailwindcss";
|
|
139
|
-
@import "@honeydeck/honeydeck/theme.css";
|
|
140
|
-
@import "@honeydeck/honeydeck/themes/clean.css";
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
Honeydeck includes:
|
|
144
|
-
|
|
145
|
-
| Theme import | Purpose |
|
|
146
|
-
|--------------|---------|
|
|
147
|
-
| `@honeydeck/honeydeck/theme.css` | Preferred base theme import; clean black/white/grey defaults |
|
|
148
|
-
| `@honeydeck/honeydeck/themes/base.css` | Package export alias for the base theme |
|
|
149
|
-
| `@honeydeck/honeydeck/themes/clean.css` | Optional clean visual style layer |
|
|
150
|
-
| `@honeydeck/honeydeck/themes/bee.css` | Bee theme layer for the original playful palette |
|
|
151
|
-
|
|
152
|
-
Use `@honeydeck/honeydeck/layouts` for clean default layouts. Use `@honeydeck/honeydeck/layouts/bee` together with `@honeydeck/honeydeck/themes/bee.css` for the Bee visual style.
|
|
153
|
-
|
|
154
86
|
### Progressive Customization
|
|
155
87
|
|
|
156
88
|
```txt
|
|
157
89
|
Level 0: plain `deck.mdx` → built-in layouts, browser/default styling
|
|
158
|
-
Level 1: import CSS
|
|
159
|
-
Level 2:
|
|
160
|
-
Level 3:
|
|
161
|
-
Level 4: publish npm kit → share across projects
|
|
90
|
+
Level 1: import CSS → Tailwind, base styling, and token overrides
|
|
91
|
+
Level 2: import components → reusable React pieces in MDX
|
|
92
|
+
Level 3: set layouts: → custom layout map
|
|
162
93
|
```
|
|
163
94
|
|
|
164
95
|
---
|
|
165
96
|
|
|
166
|
-
---
|
|
167
|
-
|
|
168
97
|
## Layouts
|
|
169
98
|
|
|
170
99
|
### Default Layouts
|
package/src/runtime/SPEC.md
CHANGED
|
@@ -199,6 +199,7 @@ Observable build/dev behavior:
|
|
|
199
199
|
- `honeydeck build` produces a static single-page application.
|
|
200
200
|
- Project `public/` assets are served/copied at the web root.
|
|
201
201
|
- Project-local CSS, React components, layout maps, and static image imports work from the selected deck root.
|
|
202
|
+
- In dev, Honeydeck's package app shell may be served from outside the selected deck root, but Vite still allows the user's workspace root for normal dependency serving and pre-bundles Honeydeck runtime browser dependencies such as React, React DOM, and runtime icons.
|
|
202
203
|
- Built decks use hash-based routes and can be deployed to static hosts without server-side routing.
|
|
203
204
|
- The app shell applies the initial effective `data-honeydeck-color-mode` to `<html>` before mounting React so first-render browser defaults and generated assets match the deck mode.
|
|
204
205
|
|
|
@@ -100,7 +100,7 @@ Toggled via `o` or the overview button. Overview is also directly addressable as
|
|
|
100
100
|
|
|
101
101
|
Built-in reference pages start at `/#/theme`. Included in both dev and production builds.
|
|
102
102
|
|
|
103
|
-
User-facing product copy should call this area "reference pages".
|
|
103
|
+
User-facing product copy should call this area "reference pages". Theme, layout, and component customization is described in [Customization — Theme CSS, Layout Maps, Components](../../layouts/SPEC.md#customization--theme-css-layout-maps-components).
|
|
104
104
|
|
|
105
105
|
### Routes
|
|
106
106
|
|
package/docs/kit-authoring.md
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
# Kit Authoring
|
|
2
|
-
|
|
3
|
-
Guide for building reusable Honeydeck kits (themes, layouts, components).
|
|
4
|
-
|
|
5
|
-
## Type Exports
|
|
6
|
-
|
|
7
|
-
All types for kit authors come from the `'honeydeck'` package:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
import type { LayoutProps, LayoutMap, LayoutDemo } from '@honeydeck/honeydeck'
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
| Type | Purpose |
|
|
14
|
-
|------|---------|
|
|
15
|
-
| `LayoutProps<F>` | Props passed to layout components (generic for frontmatter) |
|
|
16
|
-
| `LayoutMap` | `Record<string, ComponentType<LayoutProps<any>>>` |
|
|
17
|
-
| `LayoutDemo<F>` | Demo data for the docs reference page |
|
|
18
|
-
|
|
19
|
-
## Layout Map
|
|
20
|
-
|
|
21
|
-
The `layouts:` frontmatter resolves to a module that default-exports a `LayoutMap`:
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import type { LayoutMap } from '@honeydeck/honeydeck'
|
|
25
|
-
import { BlankLayout } from './Blank'
|
|
26
|
-
import { DefaultLayout } from './Default'
|
|
27
|
-
import { CoverLayout } from './Cover'
|
|
28
|
-
import { SectionLayout } from './Section'
|
|
29
|
-
import { TwoColLayout } from './TwoCol'
|
|
30
|
-
import { ImageLayout } from './Image'
|
|
31
|
-
import { ImageLeftLayout } from './ImageLeft'
|
|
32
|
-
import { ImageRightLayout } from './ImageRight'
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
Blank: BlankLayout,
|
|
36
|
-
Default: DefaultLayout,
|
|
37
|
-
Cover: CoverLayout,
|
|
38
|
-
Section: SectionLayout,
|
|
39
|
-
TwoCol: TwoColLayout,
|
|
40
|
-
Image: ImageLayout,
|
|
41
|
-
ImageLeft: ImageLeftLayout,
|
|
42
|
-
ImageRight: ImageRightLayout,
|
|
43
|
-
} satisfies LayoutMap
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Layout Props
|
|
47
|
-
|
|
48
|
-
`LayoutProps` is generic so layouts can type their accepted frontmatter:
|
|
49
|
-
|
|
50
|
-
```ts
|
|
51
|
-
type LayoutProps<F extends Record<string, unknown> = Record<string, unknown>> = {
|
|
52
|
-
title: ReactNode | null // extracted first h1 content
|
|
53
|
-
children: ReactNode // remaining content (h1 removed)
|
|
54
|
-
rawChildren: ReactNode // full unmodified content (h1 included)
|
|
55
|
-
frontmatter: F
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Example typed layout:
|
|
60
|
-
|
|
61
|
-
```tsx
|
|
62
|
-
import type { LayoutProps } from '@honeydeck/honeydeck'
|
|
63
|
-
|
|
64
|
-
type CoverFrontmatter = {
|
|
65
|
-
author?: string
|
|
66
|
-
date?: string
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function CoverLayout({ title, children, frontmatter }: LayoutProps<CoverFrontmatter>) {
|
|
70
|
-
const { author, date } = frontmatter
|
|
71
|
-
return (/* ... */)
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
This enables a future language server to extract frontmatter types for autocomplete.
|
|
76
|
-
|
|
77
|
-
## Image Helpers
|
|
78
|
-
|
|
79
|
-
Custom layouts can import `ColorModeImage` from `honeydeck` to render optional light/dark image variants with Honeydeck's Tailwind color-mode utilities:
|
|
80
|
-
|
|
81
|
-
```tsx
|
|
82
|
-
import { ColorModeImage } from '@honeydeck/honeydeck'
|
|
83
|
-
|
|
84
|
-
<ColorModeImage src={image} darkSrc={darkImage} alt={alt} />
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Layout Demos
|
|
88
|
-
|
|
89
|
-
Layouts optionally export a `demo` constant for the docs reference page:
|
|
90
|
-
|
|
91
|
-
```tsx
|
|
92
|
-
import type { LayoutProps, LayoutDemo } from '@honeydeck/honeydeck'
|
|
93
|
-
|
|
94
|
-
type CoverFrontmatter = {
|
|
95
|
-
/** Speaker or organization shown below the title. */
|
|
96
|
-
author?: string
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export function CoverLayout({ title, children, frontmatter }: LayoutProps<CoverFrontmatter>) {
|
|
100
|
-
const { author } = frontmatter
|
|
101
|
-
return (/* ... */)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export const demo: LayoutDemo<CoverFrontmatter> = {
|
|
105
|
-
mdx: `---
|
|
106
|
-
layout: Cover
|
|
107
|
-
author: Hendrik
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
# Welcome to My Talk
|
|
111
|
-
|
|
112
|
-
Building the future of presentations.`,
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
`mdx` is the single source for both the live visual preview and the copyable usage snippet. Honeydeck compiles it with the slide MDX pipeline, extracts frontmatter/title/steps, and renders it through the active layout map.
|
|
117
|
-
|
|
118
|
-
If no static `demo.mdx` is exported, the layout still appears in `/#/layouts` with a “No demo MDX provided” hint.
|
|
119
|
-
|
|
120
|
-
## Slot Components
|
|
121
|
-
|
|
122
|
-
Layouts that need content slots (like `TwoCol`) export slot components alongside the layout:
|
|
123
|
-
|
|
124
|
-
```tsx
|
|
125
|
-
// layouts/TwoCol.tsx
|
|
126
|
-
import type { LayoutProps } from '@honeydeck/honeydeck'
|
|
127
|
-
import type { ReactNode } from 'react'
|
|
128
|
-
|
|
129
|
-
export function Left({ children }: { children: ReactNode }) { /* ... */ }
|
|
130
|
-
export function Right({ children }: { children: ReactNode }) { /* ... */ }
|
|
131
|
-
|
|
132
|
-
export default function TwoColLayout({ title, children }: LayoutProps) {
|
|
133
|
-
return (/* ... */)
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Users import slots from the layout path:
|
|
138
|
-
|
|
139
|
-
```mdx
|
|
140
|
-
import { Left, Right } from '@honeydeck/honeydeck/layouts/TwoCol'
|
|
141
|
-
import { Left, Right } from '@company/honeydeck-kit-brand/layouts/TwoCol'
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
## Runtime Reference
|
|
145
|
-
|
|
146
|
-
Honeydeck includes built-in runtime reference pages in dev and production builds:
|
|
147
|
-
|
|
148
|
-
- **Theme tab (`/#/theme`):** All `--honeydeck-*` CSS tokens with computed values and descriptions.
|
|
149
|
-
- **Layouts tab (`/#/layouts`):** All layouts currently available in the active deck layout map, live visual previews rendered from `demo.mdx`, copyable usage snippets from the same MDX source, and prop docs extracted from `LayoutProps<Frontmatter>` field comments.
|
|
150
|
-
- **Components tab (`/#/components`):** Public built-in components exported from `@honeydeck/honeydeck/components`, generated documentation from exported component JSDoc comments interpreted as Markdown/MDX, side navigation, and params tables extracted from exported props types.
|
|
151
|
-
|
|
152
|
-
Package Markdown guides are published through the Honeydeck docs site rather than rendered as in-deck pages.
|
|
153
|
-
|
|
154
|
-
Token descriptions are extracted from CSS comments preceding `--honeydeck-*` declarations at build time.
|
|
155
|
-
|
|
156
|
-
## Dependency Policy
|
|
157
|
-
|
|
158
|
-
- `honeydeck` and kits declare `react` and `react-dom` as `peerDependencies`.
|
|
159
|
-
- Kits may declare compatible `honeydeck` versions via `peerDependencies`.
|
|
160
|
-
- Kits using Tailwind declare compatible Tailwind versions as peer dependencies.
|
|
161
|
-
- Generated slide projects install concrete dependency versions.
|
|
162
|
-
|
|
163
|
-
## Design Tokens
|
|
164
|
-
|
|
165
|
-
Themes provide CSS custom properties. Colors derive from a primary using `oklch` relative color syntax, with separate values for light and dark modes:
|
|
166
|
-
|
|
167
|
-
```css
|
|
168
|
-
[data-honeydeck-color-mode="light"] {
|
|
169
|
-
--honeydeck-primary: oklch(50% 0.2 250);
|
|
170
|
-
--honeydeck-background: oklch(from var(--honeydeck-primary) 98% 0.01 h);
|
|
171
|
-
--honeydeck-foreground: oklch(from var(--honeydeck-primary) 15% 0.02 h);
|
|
172
|
-
--honeydeck-surface: oklch(from var(--honeydeck-primary) 94% 0.02 h);
|
|
173
|
-
/* ... */
|
|
174
|
-
}
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
Full token list:
|
|
178
|
-
|
|
179
|
-
| Token | Purpose |
|
|
180
|
-
|-------|---------|
|
|
181
|
-
| `--honeydeck-primary` | Brand color for this mode |
|
|
182
|
-
| `--honeydeck-primary-foreground` | Text on primary backgrounds |
|
|
183
|
-
| `--honeydeck-background` | Main slide background |
|
|
184
|
-
| `--honeydeck-foreground` | Main text color |
|
|
185
|
-
| `--honeydeck-surface` | Cards, code blocks, callouts |
|
|
186
|
-
| `--honeydeck-surface-foreground` | Text on surfaces |
|
|
187
|
-
| `--honeydeck-border` | Border/divider color |
|
|
188
|
-
| `--honeydeck-accent` | Accent, computed as complementary by default |
|
|
189
|
-
| `--honeydeck-accent-foreground` | Text on accent backgrounds |
|
|
190
|
-
| `--honeydeck-link-color` | Link color (default: inherit) |
|
|
191
|
-
| `--honeydeck-border-radius` | Default border radius |
|
|
192
|
-
| `--honeydeck-font-heading` | Heading font family |
|
|
193
|
-
| `--honeydeck-font-body` | Body font family |
|
|
194
|
-
| `--honeydeck-font-mono` | Monospace font family |
|
|
195
|
-
| `--honeydeck-font-base` | Base font size (default: 16px) |
|
|
196
|
-
| `--honeydeck-font-scale` | Heading scale factor (default: 1.25) |
|
|
197
|
-
| `--honeydeck-code-line-dim-opacity` | Dim opacity for non-highlighted code lines |
|
|
198
|
-
|
|
199
|
-
## Tailwind Mapping
|
|
200
|
-
|
|
201
|
-
All tokens are mapped to Tailwind utilities:
|
|
202
|
-
|
|
203
|
-
```mdx
|
|
204
|
-
<div className="bg-surface text-surface-foreground border border-border rounded-honeydeck">
|
|
205
|
-
Card content
|
|
206
|
-
</div>
|
|
207
|
-
```
|