rikiki-deck 0.3.1 → 0.4.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.
Files changed (45) hide show
  1. package/README.md +2 -0
  2. package/bin/lib/inline.mjs +231 -0
  3. package/bin/lib/starter.mjs +83 -0
  4. package/bin/rikiki.mjs +150 -0
  5. package/dist/deck-badge.js +1 -1
  6. package/dist/deck-callout.js +1 -1
  7. package/dist/deck-card.js +1 -1
  8. package/dist/deck-code.js +1 -1
  9. package/dist/deck-cover.js +2 -2
  10. package/dist/deck-feature-cards.js +1 -1
  11. package/dist/deck-feature.js +1 -1
  12. package/dist/deck-grid.js +1 -1
  13. package/dist/deck-kicker.js +1 -1
  14. package/dist/deck-md.js +1 -1
  15. package/dist/deck-mermaid.js +3 -3
  16. package/dist/deck-metric.js +1 -1
  17. package/dist/deck-notes.js +1 -1
  18. package/dist/deck-overview.js +7 -3
  19. package/dist/deck-photo.js +1 -1
  20. package/dist/deck-presenter.js +25 -17
  21. package/dist/deck-punch.js +1 -1
  22. package/dist/deck-root.js +11 -6
  23. package/dist/deck-section.js +2 -2
  24. package/dist/deck-shortcut.js +1 -1
  25. package/dist/deck-split.js +1 -1
  26. package/dist/deck-stack.js +1 -1
  27. package/dist/deck-stat.js +2 -2
  28. package/dist/deck-step-list.js +1 -1
  29. package/dist/deck-takeaway.js +2 -2
  30. package/dist/deck-tier-list.js +1 -1
  31. package/dist/index.js +28 -23
  32. package/dist/plugins/shiki.d.ts +0 -2
  33. package/dist/runtime/deck-root.d.ts +23 -0
  34. package/dist/shared-styles.js +1 -1
  35. package/dist/shiki.js +1 -1
  36. package/dist/standalone.js +130 -68
  37. package/dist/vendor/lit.js +3 -0
  38. package/dist/vendor/marked.js +46 -0
  39. package/dist/vendor/mermaid.min.js +2024 -0
  40. package/dist/vendor/shiki.js +57 -0
  41. package/docs/llms/rikiki-reference.md +718 -0
  42. package/llms.txt +50 -0
  43. package/package.json +21 -7
  44. package/themes/rikiki.css +10 -4
  45. package/themes/siliceum.css +10 -4
package/llms.txt ADDED
@@ -0,0 +1,50 @@
1
+ # Rikiki
2
+
3
+ > Rikiki is a tiny (~12 KB gzip) Lit Web Components framework for technical
4
+ > presentations and product carousels. A deck is plain HTML: load a theme
5
+ > stylesheet, then the component bundle, then write a `<deck-root>` wrapping
6
+ > `deck-*` slide elements. No build step to author or run a deck.
7
+
8
+ This reference documents rikiki v0.4.0.
9
+
10
+ The framework is opinionated:
11
+
12
+ - Web standards only (Custom Elements, Shadow DOM, ES Modules, CSS Custom Properties).
13
+ - Zero-build for deck authors. Consumers never touch a bundler.
14
+ - Three-layer design tokens (`--rik-palette-*` private, `--rik-*` semantic, `--deck-<tag>-*` per-component).
15
+ - Plugins are opt-in and lazy-loaded (transitions, presenter window, Shiki, click-stages).
16
+ - The same `<deck-root>` engine drives slides AND swipe-able carousels via `autoplay` / `loop` / `swipe`.
17
+
18
+ ## Reference
19
+
20
+ - [Full LLM reference](docs/llms/rikiki-reference.md): the single source of truth · every tag, attribute, slot, design token, plugin, and recipe in one file. Read this first.
21
+ - [README](README.md): human overview, common patterns, build/theming notes.
22
+ - [starter.html](starter.html): the minimal copy-paste deck skeleton.
23
+
24
+ ## Components
25
+
26
+ Authoring tags fall into four buckets (see the reference for the exhaustive attribute/slot tables):
27
+
28
+ - **Layouts (slide-level, direct children of `<deck-root>`)**: `<deck-cover>` · `<deck-section>` · `<deck-feature>` · `<deck-split>` · `<deck-feature-cards>` · `<deck-photo>` · `<deck-takeaway>`
29
+ - **Molecules (composed containers)**: `<deck-callout>` · `<deck-card>` · `<deck-md>` · `<deck-mermaid>` · `<deck-stat>` · `<deck-metric-list>` / `<deck-metric>` · `<deck-tier-list>` / `<deck-tier>` / `<deck-tier-arrow>` · `<deck-step-list>` / `<deck-step>` · `<deck-shortcut-list>` / `<deck-shortcut>` / `<deck-kbd>` · `<deck-stack>` · `<deck-grid>`
30
+ - **Atoms (primitives)**: `<deck-badge>` · `<deck-kicker>` · `<deck-punch>` · `<deck-code>`
31
+ - **Runtime (authoring touchpoints)**: `<deck-root>` (navigation host) · `<deck-notes>` (speaker notes, read by the presenter window)
32
+
33
+ ## Plugins (opt-in, lazy)
34
+
35
+ - **Transitions**: `transition="slide|slide-up|slide-down|slide-right|fade|zoom|flip"` on `<deck-root>` (per-slide `data-transition`).
36
+ - **Presenter window**: press `P` · mirrors current + next slide, timer, and `<deck-notes>`.
37
+ - **Shiki highlighting**: `import { installShiki } from './dist/shiki.js'` then `await installShiki({ theme, langs })`.
38
+ - **Click-stages**: `import { installClickStages } from './dist/click-stages.js'` then `installClickStages()` · per-element `data-click` / `data-anim` / `data-morph` reveals.
39
+ - **Livereload (authoring only)**: append `?live` to the deck URL.
40
+
41
+ ## Build & assembly
42
+
43
+ - [Multi-deck assembler](docs/llms/rikiki-reference.md): split a talk into `parts/*.html` / `*.md`, list them in `deck.config.js`, run `npm run deck <config>`.
44
+ - [Example multi-file deck](decks/example/deck.config.js): a runnable assembly config.
45
+ - [Single-file bundler](bundle.mjs): `node bundle.mjs <deck>.html` inlines theme + bundle + Lit into one self-contained HTML file.
46
+
47
+ ## Optional
48
+
49
+ - [Themes](themes/rikiki.css): the default theme and its token layers (`themes/siliceum.css` is an alternative).
50
+ - [Project homepage](https://rikiki.tordu-jardin.fr): rendered docs site (also serves `/llms.txt`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rikiki-deck",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "A tiny Lit Web Components framework for technical presentations · zero-build for consumers, TypeScript for contributors.",
5
5
  "homepage": "https://rikiki.tordu-jardin.fr",
6
6
  "repository": {
@@ -11,6 +11,9 @@
11
11
  "url": "https://gitlab.com/tordu-jardin/rikiki/-/issues"
12
12
  },
13
13
  "type": "module",
14
+ "bin": {
15
+ "rikiki": "./bin/rikiki.mjs"
16
+ },
14
17
  "main": "./dist/index.js",
15
18
  "module": "./dist/index.js",
16
19
  "types": "./dist/index.d.ts",
@@ -27,26 +30,34 @@
27
30
  },
28
31
  "files": [
29
32
  "dist",
33
+ "bin",
30
34
  "tokens.css",
31
35
  "themes",
32
36
  "fonts",
33
- "README.md"
37
+ "README.md",
38
+ "llms.txt",
39
+ "docs/llms"
34
40
  ],
35
41
  "scripts": {
36
- "build": "node build.mjs && node build-standalone.mjs && tsc --emitDeclarationOnly",
42
+ "build": "node build-vendor.mjs && node build.mjs && node build-standalone.mjs && tsc --emitDeclarationOnly",
43
+ "vendor": "node build-vendor.mjs",
37
44
  "watch": "node build.mjs --watch",
38
45
  "typecheck": "tsc --noEmit",
39
46
  "clean": "rm -rf dist",
40
47
  "bundle": "node bundle.mjs",
41
48
  "deck": "node build/vite-deck.mjs",
42
- "deck:example": "node build/vite-deck.mjs decks/example/deck.config.js"
49
+ "deck:example": "node build/vite-deck.mjs decks/example/deck.config.js",
50
+ "test": "vitest run",
51
+ "bump": "node scripts/bump-version.mjs"
43
52
  },
44
53
  "devDependencies": {
45
54
  "esbuild": "^0.24.0",
46
55
  "lit": "^3.3.3",
56
+ "marked": "^12.0.2",
57
+ "mermaid": "^10.9.6",
58
+ "shiki": "^1.24.0",
47
59
  "typescript": "^5.6.0",
48
- "vite": "^6.4.2",
49
- "vite-plugin-singlefile": "^2.3.3"
60
+ "vitest": "^2.1.0"
50
61
  },
51
62
  "peerDependencies": {
52
63
  "lit": "^3.3.3"
@@ -59,5 +70,8 @@
59
70
  "deck",
60
71
  "rikiki"
61
72
  ],
62
- "license": "MIT"
73
+ "license": "MIT",
74
+ "dependencies": {
75
+ "rolldown": "^1.1.1"
76
+ }
63
77
  }
package/themes/rikiki.css CHANGED
@@ -209,8 +209,8 @@
209
209
  --rik-font-size-strong: var(--rik-text-base); /* 1.25rem */
210
210
  --rik-font-size-big: var(--rik-text-lg); /* 1.953rem */
211
211
  --rik-font-size-mega: var(--rik-text-2xl); /* 3.052rem · now > big */
212
- --rik-font-size-hook: clamp(2.2rem, 4.5vw, 3.8rem);
213
- --rik-font-size-stat: clamp(3.5rem, 7vw, 5.5rem);
212
+ --rik-font-size-hook: clamp(2.2rem, 4.5cqw, 3.8rem);
213
+ --rik-font-size-stat: clamp(3.5rem, 7cqw, 5.5rem);
214
214
 
215
215
  /* Spacing */
216
216
  --rik-space-hair: 4px;
@@ -278,6 +278,12 @@
278
278
  body, h1, h2, h3, h4, p, ul, ol, li, blockquote, pre, table, td, th,
279
279
  figure, dl, dd { margin: 0; padding: 0; }
280
280
  html { font-size: clamp(14px, 2.35vh, 42px); }
281
+ /* Fixed-viewport decks (<deck-root fixed>) anchor the root font-size to the
282
+ logical canvas height instead of the window, so every rem-based size scales
283
+ with the letterboxed stage rather than the screen · no reflow off-ratio. */
284
+ html:has(deck-root[fixed]) {
285
+ font-size: calc(min(100vh, 100vw * var(--deck-canvas-h, 1080) / var(--deck-canvas-w, 1920)) * 0.0235);
286
+ }
281
287
  html, body { width: 100%; height: 100%; overflow: hidden; background: var(--rik-surface-page); }
282
288
  body { font-family: var(--rik-font-sans); color: var(--rik-text-default); }
283
289
 
@@ -301,7 +307,7 @@ body { font-family: var(--rik-font-sans); color: var(--rik-text-default); }
301
307
  }
302
308
  .display {
303
309
  font-family: var(--rik-font-display);
304
- font-size: clamp(3rem, 7vw, 5.5rem);
310
+ font-size: clamp(3rem, 7cqw, 5.5rem);
305
311
  font-weight: 900;
306
312
  line-height: 1.05;
307
313
  letter-spacing: -0.03em;
@@ -333,7 +339,7 @@ deck-feature-cards > h1 {
333
339
  }
334
340
  deck-cover > h1 {
335
341
  font-family: var(--rik-font-display);
336
- font-size: clamp(3.6rem, 9vw, 8.5rem);
342
+ font-size: clamp(3.6rem, 9cqw, 8.5rem);
337
343
  font-weight: 900;
338
344
  color: var(--rik-text-inverse);
339
345
  line-height: 1.02;
@@ -176,8 +176,8 @@
176
176
  --rik-font-size-strong: var(--rik-text-base);
177
177
  --rik-font-size-big: var(--rik-text-lg);
178
178
  --rik-font-size-mega: var(--rik-text-2xl); /* fixed: now > big */
179
- --rik-font-size-hook: clamp(2.2rem, 4.5vw, 3.8rem);
180
- --rik-font-size-stat: clamp(3.5rem, 7vw, 5.5rem);
179
+ --rik-font-size-hook: clamp(2.2rem, 4.5cqw, 3.8rem);
180
+ --rik-font-size-stat: clamp(3.5rem, 7cqw, 5.5rem);
181
181
 
182
182
  --rik-space-hair: 4px;
183
183
  --rik-space-2xs: 6px;
@@ -237,6 +237,12 @@
237
237
  body, h1, h2, h3, h4, p, ul, ol, li, blockquote, pre, table, td, th,
238
238
  figure, dl, dd { margin: 0; padding: 0; }
239
239
  html { font-size: clamp(14px, 2.35vh, 42px); }
240
+ /* Fixed-viewport decks (<deck-root fixed>) anchor the root font-size to the
241
+ logical canvas height instead of the window, so every rem-based size scales
242
+ with the letterboxed stage rather than the screen · no reflow off-ratio. */
243
+ html:has(deck-root[fixed]) {
244
+ font-size: calc(min(100vh, 100vw * var(--deck-canvas-h, 1080) / var(--deck-canvas-w, 1920)) * 0.0235);
245
+ }
240
246
  html, body { width: 100%; height: 100%; overflow: hidden; background: var(--rik-surface-page); }
241
247
  body { font-family: var(--rik-font-sans); color: var(--rik-text-default); }
242
248
 
@@ -257,7 +263,7 @@ body { font-family: var(--rik-font-sans); color: var(--rik-text-default); }
257
263
  max-width: 60ch;
258
264
  }
259
265
  .display {
260
- font-size: clamp(3rem, 7vw, 5.5rem);
266
+ font-size: clamp(3rem, 7cqw, 5.5rem);
261
267
  font-weight: 900;
262
268
  line-height: 1.05;
263
269
  letter-spacing: -0.03em;
@@ -287,7 +293,7 @@ deck-feature-cards > h1 {
287
293
  align-self: flex-start;
288
294
  }
289
295
  deck-cover > h1 {
290
- font-size: clamp(3.6rem, 9vw, 8.5rem);
296
+ font-size: clamp(3.6rem, 9cqw, 8.5rem);
291
297
  font-weight: 900;
292
298
  color: var(--rik-text-inverse);
293
299
  line-height: 1.02;