rikiki-deck 0.1.0 → 0.1.1

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 (95) hide show
  1. package/README.md +18 -17
  2. package/dist/atoms/deck-badge.d.ts.map +1 -0
  3. package/dist/atoms/deck-code.d.ts.map +1 -0
  4. package/dist/atoms/deck-kicker.d.ts.map +1 -0
  5. package/dist/atoms/deck-punch.d.ts.map +1 -0
  6. package/dist/deck-code.js +2 -2
  7. package/dist/index.d.ts +28 -24
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +71 -21
  10. package/dist/layouts/deck-cover.d.ts.map +1 -0
  11. package/dist/layouts/deck-feature-cards.d.ts.map +1 -0
  12. package/dist/layouts/deck-feature.d.ts.map +1 -0
  13. package/dist/layouts/deck-photo.d.ts.map +1 -0
  14. package/dist/layouts/deck-section.d.ts.map +1 -0
  15. package/dist/layouts/deck-split.d.ts.map +1 -0
  16. package/dist/layouts/deck-takeaway.d.ts.map +1 -0
  17. package/dist/molecules/deck-callout.d.ts.map +1 -0
  18. package/dist/molecules/deck-card.d.ts.map +1 -0
  19. package/dist/molecules/deck-grid.d.ts.map +1 -0
  20. package/dist/molecules/deck-md.d.ts.map +1 -0
  21. package/dist/molecules/deck-mermaid.d.ts.map +1 -0
  22. package/dist/molecules/deck-metric.d.ts.map +1 -0
  23. package/dist/molecules/deck-shortcut.d.ts.map +1 -0
  24. package/dist/molecules/deck-stack.d.ts.map +1 -0
  25. package/dist/molecules/deck-stat.d.ts.map +1 -0
  26. package/dist/molecules/deck-step-list.d.ts.map +1 -0
  27. package/dist/molecules/deck-tier-list.d.ts.map +1 -0
  28. package/dist/{shiki-plugin.d.ts → plugins/shiki.d.ts} +1 -1
  29. package/dist/plugins/shiki.d.ts.map +1 -0
  30. package/dist/runtime/deck-help.d.ts.map +1 -0
  31. package/dist/runtime/deck-notes.d.ts.map +1 -0
  32. package/dist/runtime/deck-overview.d.ts.map +1 -0
  33. package/dist/runtime/deck-presenter.d.ts.map +1 -0
  34. package/dist/runtime/deck-root.d.ts.map +1 -0
  35. package/dist/runtime/deck-transition.d.ts.map +1 -0
  36. package/dist/standalone.js +17 -17
  37. package/package.json +1 -1
  38. package/dist/deck-badge.d.ts.map +0 -1
  39. package/dist/deck-callout.d.ts.map +0 -1
  40. package/dist/deck-card.d.ts.map +0 -1
  41. package/dist/deck-code.d.ts.map +0 -1
  42. package/dist/deck-cover.d.ts.map +0 -1
  43. package/dist/deck-feature-cards.d.ts.map +0 -1
  44. package/dist/deck-feature.d.ts.map +0 -1
  45. package/dist/deck-grid.d.ts.map +0 -1
  46. package/dist/deck-help.d.ts.map +0 -1
  47. package/dist/deck-kicker.d.ts.map +0 -1
  48. package/dist/deck-md.d.ts.map +0 -1
  49. package/dist/deck-mermaid.d.ts.map +0 -1
  50. package/dist/deck-metric.d.ts.map +0 -1
  51. package/dist/deck-notes.d.ts.map +0 -1
  52. package/dist/deck-overview.d.ts.map +0 -1
  53. package/dist/deck-photo.d.ts.map +0 -1
  54. package/dist/deck-presenter.d.ts.map +0 -1
  55. package/dist/deck-punch.d.ts.map +0 -1
  56. package/dist/deck-root.d.ts.map +0 -1
  57. package/dist/deck-section.d.ts.map +0 -1
  58. package/dist/deck-shortcut.d.ts.map +0 -1
  59. package/dist/deck-split.d.ts.map +0 -1
  60. package/dist/deck-stack.d.ts.map +0 -1
  61. package/dist/deck-stat.d.ts.map +0 -1
  62. package/dist/deck-step-list.d.ts.map +0 -1
  63. package/dist/deck-takeaway.d.ts.map +0 -1
  64. package/dist/deck-tier-list.d.ts.map +0 -1
  65. package/dist/deck-transition.d.ts.map +0 -1
  66. package/dist/shiki-plugin.d.ts.map +0 -1
  67. /package/dist/{deck-badge.d.ts → atoms/deck-badge.d.ts} +0 -0
  68. /package/dist/{deck-code.d.ts → atoms/deck-code.d.ts} +0 -0
  69. /package/dist/{deck-kicker.d.ts → atoms/deck-kicker.d.ts} +0 -0
  70. /package/dist/{deck-punch.d.ts → atoms/deck-punch.d.ts} +0 -0
  71. /package/dist/{deck-cover.d.ts → layouts/deck-cover.d.ts} +0 -0
  72. /package/dist/{deck-feature-cards.d.ts → layouts/deck-feature-cards.d.ts} +0 -0
  73. /package/dist/{deck-feature.d.ts → layouts/deck-feature.d.ts} +0 -0
  74. /package/dist/{deck-photo.d.ts → layouts/deck-photo.d.ts} +0 -0
  75. /package/dist/{deck-section.d.ts → layouts/deck-section.d.ts} +0 -0
  76. /package/dist/{deck-split.d.ts → layouts/deck-split.d.ts} +0 -0
  77. /package/dist/{deck-takeaway.d.ts → layouts/deck-takeaway.d.ts} +0 -0
  78. /package/dist/{deck-callout.d.ts → molecules/deck-callout.d.ts} +0 -0
  79. /package/dist/{deck-card.d.ts → molecules/deck-card.d.ts} +0 -0
  80. /package/dist/{deck-grid.d.ts → molecules/deck-grid.d.ts} +0 -0
  81. /package/dist/{deck-md.d.ts → molecules/deck-md.d.ts} +0 -0
  82. /package/dist/{deck-mermaid.d.ts → molecules/deck-mermaid.d.ts} +0 -0
  83. /package/dist/{deck-metric.d.ts → molecules/deck-metric.d.ts} +0 -0
  84. /package/dist/{deck-shortcut.d.ts → molecules/deck-shortcut.d.ts} +0 -0
  85. /package/dist/{deck-stack.d.ts → molecules/deck-stack.d.ts} +0 -0
  86. /package/dist/{deck-stat.d.ts → molecules/deck-stat.d.ts} +0 -0
  87. /package/dist/{deck-step-list.d.ts → molecules/deck-step-list.d.ts} +0 -0
  88. /package/dist/{deck-tier-list.d.ts → molecules/deck-tier-list.d.ts} +0 -0
  89. /package/dist/{deck-help.d.ts → runtime/deck-help.d.ts} +0 -0
  90. /package/dist/{deck-notes.d.ts → runtime/deck-notes.d.ts} +0 -0
  91. /package/dist/{deck-overview.d.ts → runtime/deck-overview.d.ts} +0 -0
  92. /package/dist/{deck-presenter.d.ts → runtime/deck-presenter.d.ts} +0 -0
  93. /package/dist/{deck-root.d.ts → runtime/deck-root.d.ts} +0 -0
  94. /package/dist/{deck-transition.d.ts → runtime/deck-transition.d.ts} +0 -0
  95. /package/dist/{shiki-plugin.js → shiki.js} +0 -0
package/README.md CHANGED
@@ -20,22 +20,23 @@ rikiki/
20
20
  │ ├── siliceum.css ← alternative theme (warm paper + yellow)
21
21
  │ └── siliceum-fonts.css ← self-hosted Source Sans Pro + JetBrains Mono
22
22
  ├── fonts/ ← woff2 files used by the Siliceum theme
23
- ├── src/ ← TypeScript sources · contributors edit these
24
- │ ├── deck-root.ts deck wrapper · navigation, overview, hash, kb hints
25
- │ ├── deck-cover.ts ← layouts
26
- │ ├── deck-section.ts
27
- │ ├── deck-feature.ts
28
- │ ├── deck-split.ts
29
- │ ├── deck-feature-cards.ts
30
- │ ├── deck-takeaway.ts
31
- │ ├── deck-md.ts ← atoms
32
- │ ├── deck-code.ts
33
- │ ├── deck-callout.ts
34
- │ ├── deck-card.ts
35
- │ ├── … ← deck-badge, deck-metric, deck-tier-list, etc.
23
+ ├── src/ ← TypeScript sources · organised by DS bucket
24
+ │ ├── index.ts registers every component
36
25
  │ ├── shared-styles.ts
37
- └── index.ts ← registers every component
38
- ├── dist/ built output · consumers import from here
26
+ ├── livereload.ts
27
+ ├── runtime/ deck-root, deck-help, deck-overview,
28
+ │ │ deck-presenter, deck-transition, deck-notes
29
+ │ ├── layouts/ ← deck-cover, deck-section, deck-feature,
30
+ │ │ deck-split, deck-feature-cards, deck-takeaway,
31
+ │ │ deck-photo
32
+ │ ├── molecules/ ← deck-callout, deck-card, deck-md, deck-mermaid,
33
+ │ │ deck-stat, deck-metric, deck-tier-list,
34
+ │ │ deck-step-list, deck-shortcut, deck-stack,
35
+ │ │ deck-grid
36
+ │ ├── atoms/ ← deck-badge, deck-kicker, deck-punch, deck-code
37
+ │ └── plugins/ ← opt-in (shiki for advanced syntax highlighting)
38
+ ├── dist/ ← built output · FLAT regardless of src bucket
39
+ │ (deck-root's dynamic imports rely on it)
39
40
  ├── build.mjs ← esbuild script
40
41
  ├── tsconfig.json
41
42
  └── starter.html ← blank template, one slide per layout type
@@ -44,7 +45,7 @@ rikiki/
44
45
  ## Three-layer styling
45
46
 
46
47
  1. **Theme tokens** (`themes/<name>.css`) at `:root` · custom properties cross the Shadow DOM, so they reach every component.
47
- 2. **Shared styles** (`src/shared-styles.ts`) · base typography, helpers, imported by every component via `static styles`.
48
+ 2. **Shared styles** (`src/shared-styles.ts`) · base typography, helpers, imported by every layout via `static styles`.
48
49
  3. **Layout-specific CSS** · each component's own Shadow DOM.
49
50
 
50
51
  To re-theme: copy a theme file, change the values, that's it. All components follow.
@@ -163,7 +164,7 @@ deck-cover::part(brand) { font-family: 'Comic Sans'; }
163
164
 
164
165
  ### Add a layout
165
166
 
166
- Create `src/deck-my-layout.ts`, import `slideBase` from `shared-styles.js`, extend `LitElement`, register in `src/index.ts`. Rebuild.
167
+ Create `src/layouts/deck-my-layout.ts`, `import { slideBase } from '../shared-styles.js'`, extend `LitElement`, register in `src/index.ts`. Rebuild.
167
168
 
168
169
  ## Build
169
170
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deck-badge.d.ts","sourceRoot":"","sources":["../../src/atoms/deck-badge.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAEvE,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,0BAgBpB;IAE0B,IAAI,CAAC,EAAE,aAAa,CAAC;IAExC,MAAM;CAGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deck-code.d.ts","sourceRoot":"","sources":["../../src/atoms/deck-code.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,YAAY,GACpB,IAAI,GAAG,IAAI,GAAG,MAAM,GACpB,MAAM,GAAG,KAAK,GAAG,KAAK,GACtB,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAiD5B,qBACa,QAAS,SAAQ,UAAU;IAMtC,OAAgB,MAAM,0BAqCpB;IAEmC,IAAI,EAAE,MAAM,CAAM;IACX,IAAI,UAAS;IACb,MAAM,UAAS;IACL,UAAU,CAAC,EAAE,MAAM,CAAC;IACjE,OAAO,CAAC,KAAK,CAAM;IAC5B,OAAO,CAAC,OAAO,CAA2B;IAEjC,iBAAiB;IAQ1B,OAAO,CAAC,UAAU;IAkBlB,0EAA0E;IAC1E,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAgBjB,MAAM;CAGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deck-kicker.d.ts","sourceRoot":"","sources":["../../src/atoms/deck-kicker.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAE5C,qBAAa,UAAW,SAAQ,UAAU;IAIxC,OAAgB,MAAM,0BAUpB;IACO,MAAM;CAChB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deck-punch.d.ts","sourceRoot":"","sources":["../../src/atoms/deck-punch.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AACnF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;AAmBzE,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,0BAiBpB;IAE0B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACN,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEjD,OAAO;IAaP,MAAM;CAGhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
package/dist/deck-code.js CHANGED
@@ -1,2 +1,2 @@
1
- var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=(d,n,e,s)=>{for(var r=s>1?void 0:s?h(n,e):n,a=d.length-1,i;a>=0;a--)(i=d[a])&&(r=(s?i(n,e,r):i(r))||r);return s&&r&&m(n,e,r),r};import{LitElement as u,html as v,css as f}from"https://cdn.jsdelivr.net/npm/lit@3/+esm";import{customElement as y,property as g,state as k}from"https://cdn.jsdelivr.net/npm/lit@3/decorators.js/+esm";function _(d,n){let e=d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),s=[],r=(t,c)=>{let p="P"+s.length+"E";return s.push('<span class="'+t+'">'+c+"</span>"),p};return n==="html"||n==="xml"||n==="svg"?(e=e.replace(/(&lt;!--[\s\S]*?--&gt;)/g,t=>r("cmt",t)),e=e.replace(/(&lt;!doctype[^&]*&gt;)/gi,t=>r("cmt",t)),e=e.replace(/("[^"]*"|'[^']*')/g,t=>r("str",t)),e=e.replace(/(&lt;\/?)([a-zA-Z][a-zA-Z0-9:-]*)/g,(t,c,p)=>c+r("kw",p)),e=e.replace(/\b([a-zA-Z][a-zA-Z0-9-]*)(?==)/g,t=>r("prop",t))):n==="css"||n==="scss"||n==="less"?(e=e.replace(/(\/\*[\s\S]*?\*\/)/g,t=>r("cmt",t)),e=e.replace(/("[^"]*"|'[^']*')/g,t=>r("str",t)),e=e.replace(/([a-zA-Z-]+)(?=\s*:)/g,t=>r("prop",t)),e=e.replace(/(#[0-9a-fA-F]{3,8})\b/g,t=>r("num",t)),e=e.replace(/\b(\d+(?:\.\d+)?)(px|rem|em|%|vh|vw|vmin|vmax|s|ms|deg)?/g,(t,c,p)=>r("num",c+(p??"")))):(e=e.replace(/(\/\/[^\n]*)/g,t=>r("cmt",t)),e=e.replace(/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,t=>r("str",t)),e=e.replace(/\b(const|let|var|function|return|if|else|for|while|class|extends|new|export|import|from|as|await|async|of|in|typeof|instanceof|true|false|null|undefined)\b/g,t=>r("kw",t)),e=e.replace(/\b(\d+(?:\.\d+)?)\b/g,t=>r("num",t))),e=e.replace(/P(\d+)E/g,(t,c)=>s[+c]??""),e}var o=class extends u{constructor(){super(...arguments);this.lang="";this.hero=!1;this.nested=!1;this._html="";this._groups=null}connectedCallback(){super.connectedCallback(),this._highlight();try{this._groups=JSON.parse(this.getAttribute("step-groups")??"null")}catch{this._groups=null}}_highlight(){let s=(this.textContent??"").split(`
2
- `);for(;s.length&&!s[0].trim();)s.shift();for(;s.length&&!s[s.length-1].trim();)s.pop();let r=s.filter(i=>i.trim().length>0).reduce((i,t)=>Math.min(i,t.match(/^ */)?.[0].length??0),1/0),a=r===1/0?s:s.map(i=>i.slice(r));this._html=a.map((i,t)=>'<span class="line" data-line="'+(t+1)+'">'+_(i||" ",this.lang)+"</span>").join("")}applyStep(e){if(!this._groups)return;let s=this.shadowRoot?.querySelectorAll(".line");if(s)if(e===0)s.forEach(r=>r.classList.remove("dim","lit"));else{let r=this._groups[Math.min(e-1,this._groups.length-1)]??[];s.forEach(a=>{let i=parseInt(a.dataset.line??"0",10);a.classList.toggle("lit",r.includes(i)),a.classList.toggle("dim",!r.includes(i))})}}render(){return v`<pre><code .innerHTML="${this._html}"></code></pre>`}};o.styles=f`:host{display:block;background:var(--deck-code-bg,var(--rik-code__bg));border:1px solid var(--deck-code-border,var(--rik-code__border));border-radius:var(--deck-code-radius,var(--rik-radius-md));padding:var(--deck-code-padding-y,var(--rik-space-3)) var(--deck-code-padding-x,var(--rik-space-4));font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono);line-height:1.7;color:var(--deck-code-text,var(--rik-code__text));box-shadow:var(--rik-elevation-2);overflow:auto;white-space:pre}:host([hero]){display:flex;align-items:safe center;padding:var(--rik-space-4) var(--rik-space-5)}:host([nested]){box-shadow:none;border-radius:var(--rik-radius-sm);padding:var(--rik-space-2) var(--rik-space-3)}pre{margin:0;font:inherit;color:inherit}code{display:block;width:100%;font:inherit;color:inherit}.line{transition:opacity 0.25s ease;display:block}.line.dim{opacity:0.25}.line.lit{opacity:1}.kw{color:var(--deck-code-syntax-kw,var(--rik-code__syntax-keyword))}.fn{color:var(--deck-code-syntax-fn,var(--rik-code__syntax-function))}.str{color:var(--deck-code-syntax-str,var(--rik-code__syntax-string))}.num{color:var(--deck-code-syntax-num,var(--rik-code__syntax-number))}.cmt{color:var(--deck-code-syntax-cmt,var(--rik-code__syntax-comment));font-style:italic}.ty{color:var(--deck-code-syntax-ty,var(--rik-code__syntax-type))}.prop{color:var(--deck-code-syntax-prop,var(--rik-code__syntax-property))}`,l([g({type:String})],o.prototype,"lang",2),l([g({type:Boolean,reflect:!0})],o.prototype,"hero",2),l([g({type:Boolean,reflect:!0})],o.prototype,"nested",2),l([g({type:String,attribute:"step-groups"})],o.prototype,"stepGroups",2),l([k()],o.prototype,"_html",2),o=l([y("deck-code")],o);export{o as DeckCode};
1
+ var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var l=(d,n,e,s)=>{for(var r=s>1?void 0:s?h(n,e):n,a=d.length-1,i;a>=0;a--)(i=d[a])&&(r=(s?i(n,e,r):i(r))||r);return s&&r&&m(n,e,r),r};import{LitElement as v,html as u,css as y}from"https://cdn.jsdelivr.net/npm/lit@3/+esm";import{customElement as f,property as g,state as k}from"https://cdn.jsdelivr.net/npm/lit@3/decorators.js/+esm";function _(d,n){let e=d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),s=[],r=(t,c)=>{let p="P"+s.length+"E";return s.push('<span class="'+t+'">'+c+"</span>"),p};return n==="html"||n==="xml"||n==="svg"?(e=e.replace(/(&lt;!--[\s\S]*?--&gt;)/g,t=>r("cmt",t)),e=e.replace(/(&lt;!doctype[^&]*&gt;)/gi,t=>r("cmt",t)),e=e.replace(/("[^"]*"|'[^']*')/g,t=>r("str",t)),e=e.replace(/(&lt;\/?)([a-zA-Z][a-zA-Z0-9:-]*)/g,(t,c,p)=>c+r("kw",p)),e=e.replace(/\b([a-zA-Z][a-zA-Z0-9-]*)(?==)/g,t=>r("prop",t))):n==="css"||n==="scss"||n==="less"?(e=e.replace(/(\/\*[\s\S]*?\*\/)/g,t=>r("cmt",t)),e=e.replace(/("[^"]*"|'[^']*')/g,t=>r("str",t)),e=e.replace(/([a-zA-Z-]+)(?=\s*:)/g,t=>r("prop",t)),e=e.replace(/(#[0-9a-fA-F]{3,8})\b/g,t=>r("num",t)),e=e.replace(/\b(\d+(?:\.\d+)?)(px|rem|em|%|vh|vw|vmin|vmax|s|ms|deg)?/g,(t,c,p)=>r("num",c+(p??"")))):(e=e.replace(/(\/\/[^\n]*)/g,t=>r("cmt",t)),e=e.replace(/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,t=>r("str",t)),e=e.replace(/\b(const|let|var|function|return|if|else|for|while|class|extends|new|export|import|from|as|await|async|of|in|typeof|instanceof|true|false|null|undefined)\b/g,t=>r("kw",t)),e=e.replace(/\b(\d+(?:\.\d+)?)\b/g,t=>r("num",t))),e=e.replace(/P(\d+)E/g,(t,c)=>s[+c]??""),e}var o=class extends v{constructor(){super(...arguments);this.lang="";this.hero=!1;this.nested=!1;this._html="";this._groups=null}connectedCallback(){super.connectedCallback(),this._highlight();try{this._groups=JSON.parse(this.getAttribute("step-groups")??"null")}catch{this._groups=null}}_highlight(){let s=(this.textContent??"").split(`
2
+ `);for(;s.length&&!s[0].trim();)s.shift();for(;s.length&&!s[s.length-1].trim();)s.pop();let r=s.filter(i=>i.trim().length>0).reduce((i,t)=>Math.min(i,t.match(/^ */)?.[0].length??0),1/0),a=r===1/0?s:s.map(i=>i.slice(r));this._html=a.map((i,t)=>'<span class="line" data-line="'+(t+1)+'">'+_(i||" ",this.lang)+"</span>").join("")}applyStep(e){if(!this._groups)return;let s=this.shadowRoot?.querySelectorAll(".line");if(s)if(e===0)s.forEach(r=>r.classList.remove("dim","lit"));else{let r=this._groups[Math.min(e-1,this._groups.length-1)]??[];s.forEach(a=>{let i=parseInt(a.dataset.line??"0",10);a.classList.toggle("lit",r.includes(i)),a.classList.toggle("dim",!r.includes(i))})}}render(){return u`<pre><code .innerHTML="${this._html}"></code></pre>`}};o.styles=y`:host{display:block;background:var(--deck-code-bg,var(--rik-code__bg));border:1px solid var(--deck-code-border,var(--rik-code__border));border-radius:var(--deck-code-radius,var(--rik-radius-md));padding:var(--deck-code-padding-y,var(--rik-space-3)) var(--deck-code-padding-x,var(--rik-space-4));font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono);line-height:1.7;color:var(--deck-code-text,var(--rik-code__text));box-shadow:var(--rik-elevation-2);overflow:auto;white-space:pre}:host([hero]){display:flex;align-items:safe center;padding:var(--deck-code-padding-y,var(--rik-space-4)) var(--deck-code-padding-x,var(--rik-space-5))}:host([nested]){box-shadow:none;border-radius:var(--rik-radius-sm);padding:var(--deck-code-padding-y,var(--rik-space-2)) var(--deck-code-padding-x,var(--rik-space-3))}pre{margin:0;font:inherit;color:inherit}code{display:block;width:100%;font:inherit;color:inherit}.line{transition:opacity 0.25s ease;display:block}.line.dim{opacity:0.25}.line.lit{opacity:1}.kw{color:var(--deck-code-syntax-kw,var(--rik-code__syntax-keyword))}.fn{color:var(--deck-code-syntax-fn,var(--rik-code__syntax-function))}.str{color:var(--deck-code-syntax-str,var(--rik-code__syntax-string))}.num{color:var(--deck-code-syntax-num,var(--rik-code__syntax-number))}.cmt{color:var(--deck-code-syntax-cmt,var(--rik-code__syntax-comment));font-style:italic}.ty{color:var(--deck-code-syntax-ty,var(--rik-code__syntax-type))}.prop{color:var(--deck-code-syntax-prop,var(--rik-code__syntax-property))}`,l([g({type:String})],o.prototype,"lang",2),l([g({type:Boolean,reflect:!0})],o.prototype,"hero",2),l([g({type:Boolean,reflect:!0})],o.prototype,"nested",2),l([g({type:String,attribute:"step-groups"})],o.prototype,"stepGroups",2),l([k()],o.prototype,"_html",2),o=l([f("deck-code")],o);export{o as DeckCode};
package/dist/index.d.ts CHANGED
@@ -1,25 +1,29 @@
1
- import './deck-root.js';
2
- import './deck-cover.js';
3
- import './deck-section.js';
4
- import './deck-feature.js';
5
- import './deck-split.js';
6
- import './deck-feature-cards.js';
7
- import './deck-photo.js';
8
- import './deck-takeaway.js';
9
- import './deck-md.js';
10
- import './deck-code.js';
11
- import './deck-callout.js';
12
- import './deck-card.js';
13
- import './deck-mermaid.js';
14
- import './deck-step-list.js';
15
- import './deck-metric.js';
16
- import './deck-tier-list.js';
17
- import './deck-badge.js';
18
- import './deck-kicker.js';
19
- import './deck-stack.js';
20
- import './deck-grid.js';
21
- import './deck-punch.js';
22
- import './deck-stat.js';
23
- import './deck-shortcut.js';
24
- import './deck-notes.js';
1
+ import './runtime/deck-root.js';
2
+ import './runtime/deck-transition.js';
3
+ import './runtime/deck-help.js';
4
+ import './runtime/deck-overview.js';
5
+ import './runtime/deck-presenter.js';
6
+ import './runtime/deck-notes.js';
7
+ import './layouts/deck-cover.js';
8
+ import './layouts/deck-section.js';
9
+ import './layouts/deck-feature.js';
10
+ import './layouts/deck-split.js';
11
+ import './layouts/deck-feature-cards.js';
12
+ import './layouts/deck-photo.js';
13
+ import './layouts/deck-takeaway.js';
14
+ import './molecules/deck-callout.js';
15
+ import './molecules/deck-card.js';
16
+ import './molecules/deck-md.js';
17
+ import './molecules/deck-mermaid.js';
18
+ import './molecules/deck-stat.js';
19
+ import './molecules/deck-metric.js';
20
+ import './molecules/deck-tier-list.js';
21
+ import './molecules/deck-step-list.js';
22
+ import './molecules/deck-shortcut.js';
23
+ import './molecules/deck-stack.js';
24
+ import './molecules/deck-grid.js';
25
+ import './atoms/deck-badge.js';
26
+ import './atoms/deck-kicker.js';
27
+ import './atoms/deck-punch.js';
28
+ import './atoms/deck-code.js';
25
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,iBAAiB,CAAC;AACzB,OAAO,yBAAyB,CAAC;AACjC,OAAO,iBAAiB,CAAC;AACzB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,cAAc,CAAC;AACtB,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,gBAAgB,CAAC;AACxB,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAAO,kBAAkB,CAAC;AAC1B,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,wBAAwB,CAAC;AAChC,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAChC,OAAO,4BAA4B,CAAC;AACpC,OAAO,6BAA6B,CAAC;AACrC,OAAO,yBAAyB,CAAC;AAGjC,OAAO,yBAAyB,CAAC;AACjC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,yBAAyB,CAAC;AACjC,OAAO,iCAAiC,CAAC;AACzC,OAAO,yBAAyB,CAAC;AACjC,OAAO,4BAA4B,CAAC;AAGpC,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,4BAA4B,CAAC;AACpC,OAAO,+BAA+B,CAAC;AACvC,OAAO,+BAA+B,CAAC;AACvC,OAAO,8BAA8B,CAAC;AACtC,OAAO,2BAA2B,CAAC;AACnC,OAAO,0BAA0B,CAAC;AAGlC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,sBAAsB,CAAC"}