rikiki-deck 0.3.1 → 0.5.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 (51) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +23 -0
  3. package/bin/lib/inline.mjs +231 -0
  4. package/bin/lib/starter.mjs +83 -0
  5. package/bin/rikiki.mjs +150 -0
  6. package/dist/click-stages.js +1 -1
  7. package/dist/color.js +1 -0
  8. package/dist/deck-badge.js +1 -1
  9. package/dist/deck-callout.js +1 -1
  10. package/dist/deck-card.js +1 -1
  11. package/dist/deck-code.js +2 -2
  12. package/dist/deck-cover.js +2 -2
  13. package/dist/deck-feature-cards.js +1 -1
  14. package/dist/deck-feature.js +1 -1
  15. package/dist/deck-grid.js +1 -1
  16. package/dist/deck-kicker.js +1 -1
  17. package/dist/deck-md.js +1 -1
  18. package/dist/deck-mermaid.js +3 -3
  19. package/dist/deck-metric.js +1 -1
  20. package/dist/deck-notes.js +1 -1
  21. package/dist/deck-overview.js +7 -3
  22. package/dist/deck-photo.js +1 -1
  23. package/dist/deck-presenter.js +25 -17
  24. package/dist/deck-punch.js +1 -1
  25. package/dist/deck-root.js +10 -5
  26. package/dist/deck-section.js +2 -2
  27. package/dist/deck-shortcut.js +1 -1
  28. package/dist/deck-split.js +1 -1
  29. package/dist/deck-stack.js +1 -1
  30. package/dist/deck-stat.js +2 -2
  31. package/dist/deck-step-list.js +1 -1
  32. package/dist/deck-takeaway.js +2 -2
  33. package/dist/deck-tier-list.js +1 -1
  34. package/dist/deck-transition.js +2 -2
  35. package/dist/index.js +31 -26
  36. package/dist/livereload.js +1 -1
  37. package/dist/plugins/shiki.d.ts +0 -2
  38. package/dist/runtime/color.d.ts +8 -0
  39. package/dist/runtime/deck-root.d.ts +59 -2
  40. package/dist/shared-styles.js +1 -1
  41. package/dist/shiki.js +1 -1
  42. package/dist/standalone.js +130 -68
  43. package/dist/vendor/lit.js +3 -0
  44. package/dist/vendor/marked.js +46 -0
  45. package/dist/vendor/mermaid.min.js +2024 -0
  46. package/dist/vendor/shiki.js +57 -0
  47. package/docs/llms/rikiki-reference.md +728 -0
  48. package/llms.txt +50 -0
  49. package/package.json +29 -7
  50. package/themes/rikiki.css +10 -7
  51. package/themes/siliceum.css +8 -6
@@ -1,4 +1,4 @@
1
- import { LitElement } from 'lit';
1
+ import { LitElement, type PropertyValues } from 'lit';
2
2
  export declare class DeckRoot extends LitElement {
3
3
  static styles: import("lit").CSSResult;
4
4
  current: number;
@@ -7,6 +7,20 @@ export declare class DeckRoot extends LitElement {
7
7
  * keys). Pressing any key dismisses it · same convention as PowerPoint. */
8
8
  blank: 'black' | 'white' | null;
9
9
  overview: boolean;
10
+ /** Fluid rendering · the deck fills its box and reflows like a web page
11
+ * (no logical canvas, no zoom-to-fit scale, no letterbox). Opt-in · the
12
+ * default stays the uniform zoom-to-fit canvas. Toggleable at runtime ·
13
+ * flipping it re-applies the canvas vars, scale and letterbox both ways. */
14
+ fluid: boolean;
15
+ /** Logical canvas size · defaults to 1920 × 1080 (16:9). Only the ratio and
16
+ * the rem baseline depend on these · the canvas is then scaled uniformly to
17
+ * fill the window (see _applyScale). */
18
+ width: number;
19
+ height: number;
20
+ /** Hide the bottom-left keyboard-hint chip (the ←/→ · O · P · ? row). */
21
+ noHint: boolean;
22
+ /** Hide the bottom-right on-screen previous/next navigation arrows. */
23
+ noArrows: boolean;
10
24
  /** Optional slide transition · "slide" | "fade" | "zoom". When set, the
11
25
  * deck-transition.js plugin is fetched on first navigation. Per-slide
12
26
  * override available via `data-transition` on the slide host. */
@@ -42,6 +56,49 @@ export declare class DeckRoot extends LitElement {
42
56
  private _wheelAccum;
43
57
  private _wheelLockUntil;
44
58
  firstUpdated(): void;
59
+ /** Canvas vars, scale and every listener the deck needs while connected.
60
+ * Mirror of the disconnectedCallback teardown · runs from firstUpdated on
61
+ * the initial connect, and again from connectedCallback on a re-attach
62
+ * (firstUpdated only ever runs once per element). */
63
+ private _installRuntime;
64
+ /** Confine author `<style scoped>` blocks to their own slide. A light-DOM
65
+ * <style> is a global stylesheet by default, so a per-slide tweak would
66
+ * bleed across the whole deck. Wrapping its body in a native @scope rule
67
+ * (whose implicit root is the style's parent slide) limits it to that slide
68
+ * with no selector rewriting · plain CSS inside keeps working unchanged. */
69
+ private _scopeSlideStyles;
70
+ /** Publish the logical canvas size on the document root so both the
71
+ * `html:has(deck-root)` rem-baseline rule and the shadow `#stage` (via
72
+ * custom-property inheritance) size against the same numbers. */
73
+ private _applyCanvasVars;
74
+ /** Uniform zoom-to-fit · scale the fixed logical canvas to the largest size
75
+ * that still fits the host's own box (the viewport for a full-window deck,
76
+ * the container for an embedded one). Driven by a ResizeObserver. */
77
+ private _applyScale;
78
+ private _resizeObserver;
79
+ /** Make the letterbox bands match the active slide's background, so a scaled
80
+ * deck blends seamlessly into the bands instead of sitting on a contrasting
81
+ * frame. A slide with no background of its own (transparent) shows the page
82
+ * surface · removing the override lets the bands fall back to that same
83
+ * surface, which stays seamless too. */
84
+ private _applyLetterbox;
85
+ /** The scaling baseline is a framework concern, not a theme one: inject it
86
+ * globally so any theme (or none) gets it. The rem unit tracks the logical
87
+ * canvas height · the #stage transform does the responsive scaling · and the
88
+ * page never scrolls (so the letterbox is the only thing outside a slide).
89
+ * Guarded by the element id (not a static) so separately-bundled copies of
90
+ * this class on one page share the same once-per-document semantics.
91
+ *
92
+ * Every rule is scoped with `:has(> body > deck-root)`, so it is inert
93
+ * unless a deck is a direct <body> child · i.e. a full-page deck. An
94
+ * embedded deck (sitting in some container) never matches, so it leaves the
95
+ * host page's scroll and rem baseline alone.
96
+ *
97
+ * The `:not([fluid])` rule carries the zoom-to-fit canvas baseline; the
98
+ * `[fluid]` rule gives a fluid deck the viewport-relative rem baseline
99
+ * instead. The `height:100%` pair backs the 100% `:host` sizing. */
100
+ private static _injectGlobals;
101
+ connectedCallback(): void;
45
102
  disconnectedCallback(): void;
46
103
  private _startAutoplay;
47
104
  private _stopAutoplay;
@@ -95,7 +152,7 @@ export declare class DeckRoot extends LitElement {
95
152
  private _applyActive;
96
153
  private _applyStep;
97
154
  private _updateUI;
98
- updated(): void;
155
+ updated(changed: PropertyValues<this>): void;
99
156
  private _navArrows;
100
157
  render(): unknown;
101
158
  }
@@ -1 +1 @@
1
- import{css as r}from"https://cdn.jsdelivr.net/npm/lit@3/+esm";var e=r`:host{display:none;position:absolute;inset:0;padding:var(--rik-slide-padding-y) var(--rik-slide-padding-x);flex-direction:column;overflow:hidden;background:var(--rik-surface-page);font-family:var(--rik-font-sans);color:var(--rik-text-default)}:host([active]){display:flex}`,t=r`h1{font-size:var(--rik-font-size-h1);font-weight:700;color:var(--rik-text-default);letter-spacing:-0.022em;line-height:1.15;margin-bottom:var(--rik-space-4);padding-bottom:var(--rik-space-2);border-bottom:3px solid var(--rik-accent);display:inline-block;align-self:flex-start;flex:0 0 auto}h1 .accent{color:var(--rik-accent)}::slotted(p),p{font-size:var(--rik-font-size-body);line-height:1.65;color:var(--rik-text-default--muted);margin:0}::slotted(strong),strong{color:var(--rik-text-default);font-weight:700}::slotted(code),code{font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono-sm);background:rgba(0,0,0,0.06);padding:2px 6px;border-radius:var(--rik-radius-sm);color:var(--rik-text-default)}`,a=r`.lbl{display:inline-block;padding:var(--deck-eyebrow-padding-y,4px) var(--deck-eyebrow-padding-x,12px);background:var(--deck-eyebrow-bg,var(--rik-accent));color:var(--deck-eyebrow-color,var(--rik-accent__on,var(--rik-surface-inverse)));border-radius:var(--deck-eyebrow-radius,var(--rik-radius-pill));font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.1em;text-transform:uppercase;margin-bottom:var(--rik-space-1);align-self:flex-start}.lead{font-size:var(--rik-font-size-lead);color:var(--rik-text-default--faint);line-height:1.5;margin-bottom:var(--rik-space-4);max-width:75ch;flex:0 0 auto}.kicker{font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.14em;text-transform:uppercase;color:var(--rik-text-default--faint);margin-bottom:var(--rik-space-3);display:block}.kicker.on-dark{color:rgba(255,255,255,0.35)}.caption{font-size:var(--rik-font-size-sm);color:var(--rik-text-default--faint);line-height:1.55}.caption.on-dark{color:rgba(255,255,255,0.5)}.col-label{font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--rik-text-default--faint);margin-bottom:var(--rik-space-2)}`,i=[e,t,a];export{a as helpers,i as slideBase,e as slideShell,t as typo};
1
+ import{css as r}from"./vendor/lit.js";var e=r`:host{display:none;position:absolute;inset:0;padding:var(--rik-slide-padding-y) var(--rik-slide-padding-x);flex-direction:column;overflow:hidden;background:var(--rik-surface-page);font-family:var(--rik-font-sans);color:var(--rik-text-default)}:host([active]){display:flex}`,t=r`h1{font-size:var(--rik-font-size-h1);font-weight:700;color:var(--rik-text-default);letter-spacing:-0.022em;line-height:1.15;margin-bottom:var(--rik-space-4);padding-bottom:var(--rik-space-2);border-bottom:3px solid var(--rik-accent);display:inline-block;align-self:flex-start;flex:0 0 auto}h1 .accent{color:var(--rik-accent)}::slotted(p),p{font-size:var(--rik-font-size-body);line-height:1.65;color:var(--rik-text-default--muted);margin:0}::slotted(strong),strong{color:var(--rik-text-default);font-weight:700}::slotted(code),code{font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono-sm);background:rgba(0,0,0,0.06);padding:2px 6px;border-radius:var(--rik-radius-sm);color:var(--rik-text-default)}`,a=r`.lbl{display:inline-block;padding:var(--deck-eyebrow-padding-y,4px) var(--deck-eyebrow-padding-x,12px);background:var(--deck-eyebrow-bg,var(--rik-accent));color:var(--deck-eyebrow-color,var(--rik-accent__on,var(--rik-surface-inverse)));border-radius:var(--deck-eyebrow-radius,var(--rik-radius-pill));font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.1em;text-transform:uppercase;margin-bottom:var(--rik-space-1);align-self:flex-start}.lead{font-size:var(--rik-font-size-lead);color:var(--rik-text-default--faint);line-height:1.5;margin-bottom:var(--rik-space-4);max-width:75ch;flex:0 0 auto}.kicker{font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.14em;text-transform:uppercase;color:var(--rik-text-default--faint);margin-bottom:var(--rik-space-3);display:block}.kicker.on-dark{color:rgba(255,255,255,0.35)}.caption{font-size:var(--rik-font-size-sm);color:var(--rik-text-default--faint);line-height:1.55}.caption.on-dark{color:rgba(255,255,255,0.5)}.col-label{font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.08em;text-transform:uppercase;color:var(--rik-text-default--faint);margin-bottom:var(--rik-space-2)}`,i=[e,t,a];export{a as helpers,i as slideBase,e as slideShell,t as typo};
package/dist/shiki.js CHANGED
@@ -1 +1 @@
1
- var i=null,l="one-dark-pro";async function c(t){if(i)return i;let{createHighlighter:n}=await import(`${t.cdn}shiki@1.24.0`);return i=await n({themes:[t.theme],langs:t.langs}),i}function d(t){return t.replace(/ style="[^"]*"/g,"")}async function u(t={}){let n={theme:t.theme??"one-dark-pro",langs:t.langs??["ts","js","html","css","json"],cdn:t.cdn??"https://esm.sh/"};l=n.theme;let o=await c(n),r=customElements.get("deck-code");if(!r){console.warn("[rikiki/shiki] <deck-code> is not defined yet \xB7 import rikiki first");return}let s=r.prototype,h=s._highlight;s._highlight=function(){let e=this,g=e.textContent??"";try{let a=o.codeToHtml(g,{lang:e.lang||"txt",theme:l}).replace(/^<pre[^>]*><code[^>]*>/,"").replace(/<\/code><\/pre>$/,"");e._html=d(a)}catch{h.call(this)}},document.querySelectorAll("deck-code").forEach(e=>{e._highlight?.(),e.requestUpdate?.()})}export{u as installShiki};
1
+ var i=null,s="one-dark-pro";async function c(t){return i||(i=await(globalThis.__rikikiShiki??(await import(new URL("./vendor/shiki.js",import.meta.url).href)).createHighlighter)({themes:[t.theme],langs:t.langs}),i)}function d(t){return t.replace(/ style="[^"]*"/g,"")}async function u(t={}){let n={theme:t.theme??"one-dark-pro",langs:t.langs??["ts","js","html","css","json"]};s=n.theme;let r=await c(n),o=customElements.get("deck-code");if(!o){console.warn("[rikiki/shiki] <deck-code> is not defined yet \xB7 import rikiki first");return}let l=o.prototype,h=l._highlight;l._highlight=function(){let e=this,g=e.textContent??"";try{let a=r.codeToHtml(g,{lang:e.lang||"txt",theme:s}).replace(/^<pre[^>]*><code[^>]*>/,"").replace(/<\/code><\/pre>$/,"");e._html=d(a)}catch{h.call(this)}},document.querySelectorAll("deck-code").forEach(e=>{e._highlight?.(),e.requestUpdate?.()})}export{u as installShiki};