rikiki-deck 0.4.0 → 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.
- package/LICENSE +1 -1
- package/README.md +22 -1
- package/dist/click-stages.js +1 -1
- package/dist/color.js +1 -0
- package/dist/deck-code.js +2 -2
- package/dist/deck-overview.js +6 -6
- package/dist/deck-presenter.js +5 -5
- package/dist/deck-root.js +5 -5
- package/dist/deck-transition.js +2 -2
- package/dist/index.js +24 -24
- package/dist/livereload.js +1 -1
- package/dist/runtime/color.d.ts +8 -0
- package/dist/runtime/deck-root.d.ts +45 -11
- package/dist/shiki.js +1 -1
- package/dist/standalone.js +43 -43
- package/docs/llms/rikiki-reference.md +11 -1
- package/llms.txt +1 -1
- package/package.json +11 -3
- package/themes/rikiki.css +6 -9
- package/themes/siliceum.css +4 -8
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var Be=Object.defineProperty;var
|
|
1
|
+
var Be=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var t=(n,s,e,r)=>{for(var i=r>1?void 0:r?Ue(s,e):s,a=n.length-1,l;a>=0;a--)(l=n[a])&&(i=(r?l(s,e,i):l(i))||i);return r&&i&&Be(s,e,i),i};import{LitElement as Re,html as N,css as Ye}from"./vendor/lit.js";import{customElement as We,property as h,state as ie}from"./vendor/lit.js";function ge(n){if(!n||n==="transparent")return!1;let s=n.match(/^(?:rgb|hsl)a?\(([^)]*)\)$/i);if(s){let r=s[1].split(",");return r.length<4||parseFloat(r[3])>=1}let e=n.match(/\/\s*([\d.]+%?)\s*\)$/);if(e){let r=e[1];return(r.endsWith("%")?parseFloat(r)/100:parseFloat(r))>=1}return!0}var d=class extends Re{constructor(){super(...arguments);this.current=0;this.step=0;this.blank=null;this.overview=!1;this.fluid=!1;this.width=1920;this.height=1080;this.noHint=!1;this.noArrows=!1;this.transition=null;this.autoplay=0;this.loop=!1;this.swipe=!1;this.mouseNav=null;this.nav=null;this.slides=[];this.chapters=[];this._overviewTeardown=null;this._transitionLoaded=!1;this._autoplayTimer=null;this._autoplayPaused=!1;this._swipeStartX=0;this._swipeStartY=0;this._swipePointerId=null;this._navDownX=0;this._navDownY=0;this._wheelAccum=0;this._wheelLockUntil=0;this._applyScale=()=>{if(this.fluid){this.style.removeProperty("--deck-scale");return}let e=Math.min(this.clientWidth/this.width,this.clientHeight/this.height);e>0&&this.style.setProperty("--deck-scale",String(e))};this._resizeObserver=null;this._onHoverEnter=()=>{this._autoplayPaused=!0,this._stopAutoplay()};this._onHoverLeave=()=>{this._autoplayPaused=!1,this.autoplay>0&&this._startAutoplay()};this._onPointerDown=e=>{!this.swipe||e.pointerType==="mouse"&&e.button!==0||e.target?.closest("a, button, input, textarea, [contenteditable]")||(this._swipePointerId=e.pointerId,this._swipeStartX=e.clientX,this._swipeStartY=e.clientY)};this._onPointerUp=e=>{if(this._swipePointerId===null||e.pointerId!==this._swipePointerId)return;let r=e.clientX-this._swipeStartX,i=e.clientY-this._swipeStartY;this._swipePointerId=null,!(Math.abs(r)<60||Math.abs(r)<Math.abs(i)*2)&&(this._stopAutoplay(),r<0?this._advance():this._back(),this._restartAutoplay())};this._onNavPointerDown=e=>{this._navDownX=e.clientX,this._navDownY=e.clientY};this._onClickNav=e=>{if(!this._mouseEnabled("click")||this.overview||this.blank||this.shadowRoot?.querySelector("#kb-overlay.open")||Math.hypot(e.clientX-this._navDownX,e.clientY-this._navDownY)>5)return;let r=window.getSelection();r&&!r.isCollapsed||e.composedPath().some(a=>a instanceof HTMLElement?a.matches?.("a, button, input, textarea, select, [contenteditable], [data-no-advance]")?!0:a.id==="blank"||a.id==="kb-overlay"||a.id==="overview-grid"||a.id==="nav-arrows"||a.id==="kb-hint":!1)||(this._restartAutoplay(),e.shiftKey?this._back():this._advance())};this._onWheel=e=>{if(!this._mouseEnabled("wheel")||this.overview||this.blank||this._wheelTargetScrolls(e))return;e.preventDefault();let r=performance.now();if(r<this._wheelLockUntil||(this._wheelAccum+=e.deltaY,Math.abs(this._wheelAccum)<50))return;let i=this._wheelAccum>0;this._wheelAccum=0,this._wheelLockUntil=r+400,this._restartAutoplay(),i?this._advance():this._back()};this._onAuxUp=e=>{this._mouseEnabled("aux")&&(e.button!==3&&e.button!==4||(e.preventDefault(),this._restartAutoplay(),e.button===3?this._back():this._advance()))};this._onAuxClick=e=>{this._mouseEnabled("aux")&&(e.button===3||e.button===4)&&e.preventDefault()};this._onHash=()=>{this._readHash(!1)};this._onKey=e=>{if(!(e.target&&e.target.matches?.("input,textarea,[contenteditable]"))){if(this._restartAutoplay(),this.overview){(e.key==="Escape"||e.key==="o"||e.key==="O"||e.key==="Enter")&&(e.preventDefault(),this.overview=!1);return}if(this.blank){e.preventDefault(),this.blank=null;return}if(e.key==="."||e.key==="b"||e.key==="B"){e.preventDefault(),this.blank="black";return}if(e.key===","||e.key==="w"||e.key==="W"){e.preventDefault(),this.blank="white";return}if(e.key==="?"||e.key==="h"||e.key==="H"){this._toggleHelp();return}if(e.key==="Escape"){this._closeHelp();return}if(e.key==="o"||e.key==="O"){e.preventDefault(),this.overview=!0;return}if(e.key==="p"||e.key==="P"){e.preventDefault(),this._togglePresenter();return}if(e.key==="Home"){this._goTo(0);return}if(e.key==="End"){this._goTo(this.slides.length-1);return}if(e.key===" "||e.key==="PageDown"){e.preventDefault(),this._advance();return}if(e.key==="PageUp"){e.preventDefault(),this._back();return}if(this._has2DNav()){let{c:r,i}=this._coords(this.current);if(e.key==="ArrowRight"){e.preventDefault(),r+1<this.chapters.length?this._goToCoords(r+1,0):this._advance();return}if(e.key==="ArrowLeft"){e.preventDefault(),r-1>=0?this._goToCoords(r-1,0):this._back();return}if(e.key==="ArrowDown"){e.preventDefault();let a=this.chapters[r];a&&i+1<a.slides.length?this._goToCoords(r,i+1):this._advance();return}if(e.key==="ArrowUp"){e.preventDefault(),i-1>=0?this._goToCoords(r,i-1):this._back();return}}else{if(e.key==="ArrowRight"||e.key==="ArrowDown"){e.preventDefault(),this._advance();return}if(e.key==="ArrowLeft"||e.key==="ArrowUp"){e.preventDefault(),this._back();return}}}}}firstUpdated(){this._installRuntime(),this._scopeSlideStyles(),this.slides=Array.from(this.querySelectorAll(":scope > *")).filter(e=>e.tagName?.toLowerCase().startsWith("deck-")&&e.tagName?.toLowerCase()!=="deck-root"),this._buildChapters(),this._readHash(!0),this._applyActive(),this._applyStep(),this._updateUI(),this.requestUpdate()}_installRuntime(){this._applyCanvasVars(),this._applyScale(),this._resizeObserver=new ResizeObserver(this._applyScale),this._resizeObserver.observe(this),window.addEventListener("keydown",this._onKey),window.addEventListener("hashchange",this._onHash),this.addEventListener("pointerdown",this._onNavPointerDown),this.addEventListener("click",this._onClickNav),this.addEventListener("wheel",this._onWheel,{passive:!1}),window.addEventListener("mouseup",this._onAuxUp),window.addEventListener("auxclick",this._onAuxClick),this.autoplay>0&&this._startAutoplay(),this.swipe?(this.addEventListener("pointerdown",this._onPointerDown),this.addEventListener("pointerup",this._onPointerUp),this.addEventListener("pointercancel",this._onPointerUp),this.addEventListener("mouseenter",this._onHoverEnter),this.addEventListener("mouseleave",this._onHoverLeave)):this.autoplay>0&&(this.addEventListener("mouseenter",this._onHoverEnter),this.addEventListener("mouseleave",this._onHoverLeave))}_scopeSlideStyles(){this.querySelectorAll("style[scoped]").forEach(e=>{e.dataset.rikScoped||(e.dataset.rikScoped="1",e.textContent=`@scope {
|
|
2
2
|
${e.textContent??""}
|
|
3
|
-
}`)})}_applyCanvasVars(){let e=document.documentElement;e.style.setProperty("--deck-canvas-w",String(this.width)),e.style.setProperty("--deck-canvas-h",String(this.height))}
|
|
3
|
+
}`)})}_applyCanvasVars(){let e=document.documentElement;if(this.fluid){e.style.removeProperty("--deck-canvas-w"),e.style.removeProperty("--deck-canvas-h");return}e.style.setProperty("--deck-canvas-w",String(this.width)),e.style.setProperty("--deck-canvas-h",String(this.height))}_applyLetterbox(e){if(this.fluid){this.style.removeProperty("--deck-letterbox-bg");return}let r=e?getComputedStyle(e).backgroundColor:"";r&&ge(r)?this.style.setProperty("--deck-letterbox-bg",r):this.style.removeProperty("--deck-letterbox-bg")}static _injectGlobals(){if(typeof document>"u"||document.getElementById("rik-deck-globals"))return;let e=document.createElement("style");e.id="rik-deck-globals",e.textContent="html:has(> body > deck-root){overflow:hidden;height:100%}html:has(> body > deck-root) body{margin:0;overflow:hidden;height:100%}html:has(> body > deck-root:not([fluid])){font-size:calc(var(--deck-canvas-h,1080)*0.0235px)}html:has(> body > deck-root[fluid]){font-size:clamp(14px,2.35vh,42px)}",document.head.appendChild(e)}connectedCallback(){super.connectedCallback(),d._injectGlobals(),this.hasUpdated&&this._installRuntime()}disconnectedCallback(){super.disconnectedCallback(),document.documentElement.style.removeProperty("--deck-canvas-w"),document.documentElement.style.removeProperty("--deck-canvas-h"),document.querySelector("deck-root")||document.getElementById("rik-deck-globals")?.remove(),this._resizeObserver?.disconnect(),this._resizeObserver=null,window.removeEventListener("keydown",this._onKey),window.removeEventListener("hashchange",this._onHash),this.removeEventListener("pointerdown",this._onNavPointerDown),this.removeEventListener("click",this._onClickNav),this.removeEventListener("wheel",this._onWheel),window.removeEventListener("mouseup",this._onAuxUp),window.removeEventListener("auxclick",this._onAuxClick),this._stopAutoplay(),this.removeEventListener("pointerdown",this._onPointerDown),this.removeEventListener("pointerup",this._onPointerUp),this.removeEventListener("pointercancel",this._onPointerUp),this.removeEventListener("mouseenter",this._onHoverEnter),this.removeEventListener("mouseleave",this._onHoverLeave)}_startAutoplay(){this._stopAutoplay(),!(this.autoplay<=0||this._autoplayPaused)&&(this._autoplayTimer=window.setInterval(()=>this._autoTick(),this.autoplay))}_stopAutoplay(){this._autoplayTimer!==null&&(window.clearInterval(this._autoplayTimer),this._autoplayTimer=null)}_autoTick(){if(this.overview)return;this.current>=this.slides.length-1&&this.step>=this._maxSteps()&&this.loop?this._goTo(0):this._advance()}_restartAutoplay(){this.autoplay>0&&!this._autoplayPaused&&this._startAutoplay()}_wheelTargetScrolls(e){let r=e.deltaY>0,i=e.deltaX>0;for(let a of e.composedPath()){if(a===this)return!1;if(!(a instanceof Element))continue;let l=a.scrollHeight>a.clientHeight,o=a.scrollWidth>a.clientWidth;if(!l&&!o)continue;let p=getComputedStyle(a);if(l&&/auto|scroll/.test(p.overflowY)&&(r?a.scrollTop+a.clientHeight<a.scrollHeight-1:a.scrollTop>0)||o&&/auto|scroll/.test(p.overflowX)&&(i?a.scrollLeft+a.clientWidth<a.scrollWidth-1:a.scrollLeft>0))return!0}return!1}_buildChapters(){this.chapters=[];let e=null;this.slides.forEach((r,i)=>{r.tagName?.toLowerCase()==="deck-section"||!e?(e={startIdx:i,slides:[r]},this.chapters.push(e)):e.slides.push(r)})}_has2DNav(){return this.nav==="2d"&&this.chapters.length>1&&this.chapters.some(e=>e.slides.length>1)}_mouseEnabled(e){let r=(this.mouseNav??"all").trim();return r==="none"?!1:r===""||r==="all"?!0:r.split(/\s+/).includes(e)}_coords(e){for(let r=0;r<this.chapters.length;r++){let i=this.chapters[r],a=e-i.startIdx;if(a>=0&&a<i.slides.length)return{c:r,i:a}}return{c:0,i:0}}_flatFromCoords(e,r){let i=this.chapters[Math.max(0,Math.min(this.chapters.length-1,e))];return i?i.startIdx+Math.max(0,Math.min(i.slides.length-1,r)):0}_readHash(e){let r=location.hash,i=r.match(/^#(\d+)\.(\d+)(?:s(\d+))?$/),a=r.match(/^#(\d+)(?:\.(\d+))?$/),l=this.current,o=this.step;if(this._has2DNav()&&i){let y=parseInt(i[1],10)-1,je=parseInt(i[2],10)-1;l=this._flatFromCoords(Math.max(0,y),Math.max(0,je)),o=i[3]?parseInt(i[3],10):0}else if(a)l=parseInt(a[1],10)-1,o=a[2]?parseInt(a[2],10):0;else return;if(l===this.current&&o===this.step&&!e)return;this.current=Math.max(0,Math.min(this.slides.length-1,l));let p=this._maxSteps();this.step=p>0?Math.max(0,Math.min(p,o)):Math.max(0,o),e||(this._applyActive(),this._applyStep(),this._updateUI())}_writeHash(){let e=`#${this.current+1}${this.step>0?`.${this.step}`:""}`;if(location.hash!==e)try{history.replaceState(null,"",e)}catch{}}async _toggleHelp(){(await import("./deck-help.js")).toggleHelp(this)}async _togglePresenter(){(await import("./deck-presenter.js")).installPresenter(this)}async _closeHelp(){(await import("./deck-help.js")).closeHelp(this)}async _renderOverviewIfActive(){if(!this.overview){this._overviewTeardown?.(),this._overviewTeardown=null;return}let{mountOverview:e}=await import("./deck-overview.js");this._overviewTeardown=e(this,{slides:this.slides,chapters:this.chapters,currentIdx:this.current,onPick:r=>{this.overview=!1,this._goTo(r)}})}_maxSteps(){let e=this.slides[this.current];if(!e)return 0;let r=parseInt(e.getAttribute("steps")||e.dataset?.steps||"0",10);if(r>0)return r;let i=e.querySelector("deck-code[step-groups]");if(i)try{return JSON.parse(i.getAttribute("step-groups")).length}catch{}return 0}_advance(){let e=this._maxSteps();this.step<e?(this.step++,this._applyStep(),this._updateUI(),this._writeHash()):this.current<this.slides.length-1?this._goTo(this.current+1):this.loop&&this._goTo(0)}_back(){this.step>0?(this.step--,this._applyStep(),this._updateUI(),this._writeHash()):this.current>0?(this._goTo(this.current-1),this.step=this._maxSteps(),this._applyStep(),this._updateUI(),this._writeHash()):this.loop&&(this._goTo(this.slides.length-1),this.step=this._maxSteps(),this._applyStep(),this._updateUI(),this._writeHash())}_goTo(e){this.current=Math.max(0,Math.min(this.slides.length-1,e)),this.step=0,this._applyActive(),this._applyStep(),this._updateUI(),this._writeHash()}_goToCoords(e,r){let i=Math.max(0,Math.min(this.chapters.length-1,e)),a=this.chapters[i];if(!a)return;let l=Math.max(0,Math.min(a.slides.length-1,r));this._goTo(this._flatFromCoords(i,l))}_applyActive(){let e=this.slides.find(i=>i.hasAttribute("active"))??null,r=this.slides[this.current]??null;this.slides.forEach((i,a)=>{let l=a===this.current;i.toggleAttribute("active",l),l&&i.querySelectorAll("deck-mermaid").forEach(o=>{o.render?.()})}),this._applyLetterbox(r),this.transition&&!this._transitionLoaded&&(this._transitionLoaded=!0,import("./deck-transition.js").then(i=>i.installTransitions(this))),e!==r&&this.dispatchEvent(new CustomEvent("slide-change",{detail:{current:r,previous:e},bubbles:!1}))}_applyStep(){let e=this.slides[this.current];e&&(e.applyStep?.(this.step),e.querySelectorAll("*").forEach(r=>{r.applyStep?.(this.step)}),e.querySelectorAll("[data-step-block]").forEach(r=>{let i=parseInt(r.dataset.stepBlock,10);r.style.transition="opacity 0.25s ease",r.style.opacity=this.step===0||i<=this.step?"1":"0.15"}))}_updateUI(){let e=this.slides.length,r=this.current+1,i=this.renderRoot.querySelector("#progress"),a=this.renderRoot.querySelector("#counter"),l=this.renderRoot.querySelector("#step-dots");i&&(i.style.width=`${r/e*100}%`),a&&(a.textContent=`${r} / ${e}`);let o=this._maxSteps();l&&(l.innerHTML=o===0?"":Array.from({length:o},(p,y)=>`<div class="dot${y<this.step?" active":""}"></div>`).join(""))}updated(e){(e.has("width")||e.has("height")||e.has("fluid"))&&(this._applyCanvasVars(),this._applyScale()),e.has("fluid")&&this._applyLetterbox(this.slides[this.current]??null),this._updateUI(),this._renderOverviewIfActive()}_navArrows(){if(this.noArrows||!this._mouseEnabled("arrows")||this.overview)return"";let e=this.slides.length;if(e===0)return"";let r=this.current===0&&this.step===0,i=this.current>=e-1&&this.step>=this._maxSteps();if(this._has2DNav()){let{c:a,i:l}=this._coords(this.current),o=this.chapters[a];return N`<div id="nav-arrows"> <button class="nav-btn" title="Previous chapter" ?disabled=${!this.loop&&this.current===0} @click=${()=>a>0?this._goToCoords(a-1,0):this._back()}>‹</button> <button class="nav-btn" title="Up" ?disabled=${l===0} @click=${()=>this._goToCoords(a,l-1)}>↑</button> <button class="nav-btn" title="Down" ?disabled=${!o||l+1>=o.slides.length} @click=${()=>this._goToCoords(a,l+1)}>↓</button> <button class="nav-btn" title="Next chapter" ?disabled=${!this.loop&&i} @click=${()=>a+1<this.chapters.length?this._goToCoords(a+1,0):this._advance()}>›</button> </div>`}return N`<div id="nav-arrows"> <button class="nav-btn" title="Previous" ?disabled=${!this.loop&&r} @click=${()=>this._back()}>‹</button> <button class="nav-btn" title="Next" ?disabled=${!this.loop&&i} @click=${()=>this._advance()}>›</button> </div>`}render(){return N`<div id="progress"></div> <div id="counter"></div> <div id="step-dots"></div> ${this.noHint?"":N`
|
|
4
4
|
<div id="kb-hint">
|
|
5
5
|
<kbd title="Previous" @click=${()=>this._back()}>←</kbd
|
|
6
6
|
><kbd title="Next" @click=${()=>this._advance()}>→</kbd>
|
|
7
|
-
${this._has2DNav()?
|
|
7
|
+
${this._has2DNav()?N`<kbd title="Previous" @click=${()=>this._back()}>↑</kbd ><kbd title="Next" @click=${()=>this._advance()}>↓</kbd>`:""}
|
|
8
8
|
<span>·</span>
|
|
9
9
|
<kbd title="Overview" @click=${()=>{this.overview=!this.overview}}>O</kbd>
|
|
10
10
|
<span>·</span>
|
|
@@ -14,8 +14,8 @@ ${e.textContent??""}
|
|
|
14
14
|
</div>`}
|
|
15
15
|
${this._navArrows()}
|
|
16
16
|
<div id="stage"><slot></slot></div>
|
|
17
|
-
${this.blank?
|
|
18
|
-
`}};d.styles=
|
|
17
|
+
${this.blank?N`<div id="blank" data-tone="${this.blank}" @click=${()=>{this.blank=null}}></div>`:""}
|
|
18
|
+
`}};d.styles=Ye`:host{display:flex;align-items:center;justify-content:center;width:100%;height:100%;overflow:hidden;background:var(--deck-letterbox-bg,var(--deck-root-bg,var(--rik-surface-page)))}#stage{flex:none;width:calc(var(--deck-canvas-w,1920) * 1px);height:calc(var(--deck-canvas-h,1080) * 1px);transform:scale(var(--deck-scale,1));transform-origin:center center;container-type:size}:host([fluid]) #stage{width:100%;height:100%;transform:none}#progress{position:fixed;bottom:0;left:0;height:var(--deck-root-progress-height,3px);background:var(--deck-root-progress-color,linear-gradient(90deg,var(--rik-accent),var(--rik-accent--soft)));transition:width 0.25s ease;z-index:100}#counter{position:fixed;bottom:1rem;right:1.5rem;font-size:var(--rik-font-size-xs);color:var(--deck-root-counter-color,var(--rik-text-default--faint));font-family:var(--rik-font-mono);z-index:100}#step-dots{position:fixed;bottom:1rem;left:50%;transform:translateX(-50%);display:flex;gap:6px;z-index:100}.dot{width:6px;height:6px;border-radius:50%;background:var(--deck-root-dot-bg,#d4d4d0);transition:background 0.2s}.dot.active{background:var(--deck-root-dot-active-bg,var(--rik-accent))}#kb-hint{position:fixed;bottom:1rem;left:1.5rem;display:inline-flex;align-items:center;gap:6px;font:600 0.62rem/1 var(--rik-font-mono);color:var(--deck-root-kb-hint-color,var(--rik-text-default--faint));z-index:100;opacity:0.5;transition:opacity 0.2s ease;cursor:help}#kb-hint:hover{opacity:1}#kb-hint kbd{background:var(--rik-surface-raised);border:1px solid var(--rik-border-default);border-bottom:2px solid var(--rik-border-default);border-radius:4px;padding:2px 6px;color:var(--rik-text-default);font:inherit;min-width:16px;text-align:center;cursor:pointer}#kb-hint kbd:hover{border-color:var(--rik-accent)}#kb-hint .sep{opacity:0.4}#nav-arrows{position:fixed;bottom:2.4rem;right:1.5rem;display:flex;gap:4px;z-index:100;opacity:var(--deck-root-nav-opacity,0.35);transition:opacity 0.2s ease}#nav-arrows:hover{opacity:1}.nav-btn{appearance:none;cursor:pointer;width:30px;height:30px;display:grid;place-items:center;font:700 1rem/1 var(--rik-font-mono);color:var(--deck-root-nav-color,var(--rik-text-default));background:var(--deck-root-nav-bg,var(--rik-surface-raised));border:1px solid var(--rik-border-default);border-radius:6px;padding:0}.nav-btn:hover:not(:disabled){border-color:var(--rik-accent)}.nav-btn:disabled{opacity:0.3;cursor:default}#blank{position:fixed;inset:0;z-index:9999;cursor:pointer}#blank[data-tone="black"]{background:#000}#blank[data-tone="white"]{background:#fff}`,t([ie()],d.prototype,"current",2),t([ie()],d.prototype,"step",2),t([ie()],d.prototype,"blank",2),t([h({type:Boolean,reflect:!0})],d.prototype,"overview",2),t([h({type:Boolean,reflect:!0})],d.prototype,"fluid",2),t([h({type:Number})],d.prototype,"width",2),t([h({type:Number})],d.prototype,"height",2),t([h({type:Boolean,reflect:!0,attribute:"no-hint"})],d.prototype,"noHint",2),t([h({type:Boolean,reflect:!0,attribute:"no-arrows"})],d.prototype,"noArrows",2),t([h({type:String,reflect:!0})],d.prototype,"transition",2),t([h({type:Number,reflect:!0})],d.prototype,"autoplay",2),t([h({type:Boolean,reflect:!0})],d.prototype,"loop",2),t([h({type:Boolean,reflect:!0})],d.prototype,"swipe",2),t([h({type:String,reflect:!0,attribute:"mouse-nav"})],d.prototype,"mouseNav",2),t([h({type:String,reflect:!0})],d.prototype,"nav",2),d=t([We("deck-root")],d);var v={slide:560,"slide-up":520,"slide-down":520,"slide-right":560,fade:480,zoom:520,flip:560},m="var(--rik-motion__ease-out, cubic-bezier(0.16, 1, 0.3, 1))",Xe="var(--rik-motion__ease-spring, cubic-bezier(0.5, 1.8, 0.3, 1))",Ar=`
|
|
19
19
|
/* Incoming \xB7 from right (forward) */
|
|
20
20
|
@keyframes rk-slide-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
21
21
|
/* Outgoing \xB7 pushed off to the left (forward) */
|
|
@@ -56,7 +56,7 @@ ${e.textContent??""}
|
|
|
56
56
|
::slotted(.rk-leaving.rk-exit-slide-down) { animation: rk-slide-down-out ${v["slide-down"]}ms ${m} both; }
|
|
57
57
|
::slotted([active].rk-enter-fade) { animation: rk-fade-in ${v.fade}ms ${m} both; }
|
|
58
58
|
::slotted(.rk-leaving.rk-exit-fade) { animation: rk-fade-out ${v.fade}ms ${m} both; }
|
|
59
|
-
::slotted([active].rk-enter-zoom) { animation: rk-zoom-in ${v.zoom}ms ${
|
|
59
|
+
::slotted([active].rk-enter-zoom) { animation: rk-zoom-in ${v.zoom}ms ${Xe} both; }
|
|
60
60
|
::slotted(.rk-leaving.rk-exit-zoom) { animation: rk-zoom-out ${v.zoom}ms ${m} both; }
|
|
61
61
|
::slotted([active].rk-enter-flip) { animation: rk-flip-in ${v.flip}ms ${m} both; }
|
|
62
62
|
::slotted(.rk-leaving.rk-exit-flip) { animation: rk-flip-out ${v.flip}ms ${m} both; }
|
|
@@ -65,28 +65,28 @@ ${e.textContent??""}
|
|
|
65
65
|
::slotted([active][class*='rk-enter-']),
|
|
66
66
|
::slotted(.rk-leaving) { animation: none; }
|
|
67
67
|
}
|
|
68
|
-
`;var
|
|
69
|
-
${e?
|
|
70
|
-
${r?
|
|
68
|
+
`;var Ir=new URL("./index.js",import.meta.url).href;import{LitElement as Ge,css as Fe,html as Ve}from"./vendor/lit.js";import{customElement as Je}from"./vendor/lit.js";var W=class extends Ge{get notes(){return(this.textContent??"").trim()}render(){return Ve`<slot></slot>`}};W.styles=Fe`:host{display:none}`,W=t([Je("deck-notes")],W);import{LitElement as Qe,html as P,css as De}from"./vendor/lit.js";import{customElement as et,property as f}from"./vendor/lit.js";import{css as ae}from"./vendor/lit.js";var se=ae`: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}`,Ke=ae`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)}`,Ze=ae`.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)}`,u=[se,Ke,Ze];var c=class extends Qe{render(){let s=(this.brand??"").split("\xB7").map(l=>l.trim()).filter(Boolean),e=s[0]??"",r=s.slice(1).join(" \xB7 "),i=[this.speaker&&{l:this.speakerLabel??"Pr\xE9sent\xE9 par",v:this.speaker},this.company&&{l:this.companyLabel??"Entreprise",v:this.company},this.duration&&{l:this.durationLabel??"Dur\xE9e",v:this.duration},this.audience&&{l:this.audienceLabel??"Audience",v:this.audience},this.runtime&&{l:this.runtimeLabel??"Runtime",v:this.runtime}].filter(l=>!!l),a=!!this.brandSrc;return P`<div class="brand" part="brand"> ${a?P`<span class="brand-tile"><img src="${this.brandSrc}" alt="${e}"></span>`:""}
|
|
69
|
+
${e?P`<span class="brand-name">${e}</span>`:""}
|
|
70
|
+
${r?P`<span class="brand-context">${r}</span>`:""}
|
|
71
71
|
</div>
|
|
72
72
|
<slot></slot>
|
|
73
|
-
${i.length?
|
|
74
|
-
<div class="meta-item"><strong>${
|
|
73
|
+
${i.length?P`<div class="meta" part="meta"> ${i.map(l=>P`
|
|
74
|
+
<div class="meta-item"><strong>${l.l}</strong><span>${l.v}</span></div>
|
|
75
75
|
`)}
|
|
76
76
|
</div>`:""}
|
|
77
|
-
`}};c.styles=[...u,
|
|
77
|
+
`}};c.styles=[...u,De`:host{background:var(--deck-cover-bg,var(--rik-surface-inverse));justify-content:center;color:var(--deck-cover-text,var(--rik-text-inverse))}.brand{display:inline-flex;align-items:center;gap:var(--rik-space-3);margin-bottom:var(--rik-space-5);align-self:flex-start}.brand-tile{width:2.5rem;height:2.5rem;display:inline-flex;align-items:center;justify-content:center}.brand-tile img{width:100%;height:100%;display:block}.brand-name{font-family:var(--rik-font-display,inherit);font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.2em;text-transform:uppercase;color:var(--deck-cover-soft,var(--rik-text-inverse--muted))}.brand-context{font-size:var(--rik-font-size-xs);font-weight:700;color:var(--deck-cover-muted,var(--rik-text-inverse--faint));letter-spacing:0.2em;text-transform:uppercase;padding-left:var(--rik-space-3);border-left:1px solid var(--deck-cover-border,var(--rik-border-inverse))}::slotted(h1){font-size:clamp(3.6rem,9cqw,8.5rem);font-weight:900;color:var(--deck-cover-text,var(--rik-text-inverse));line-height:1.02;letter-spacing:-0.035em;margin-bottom:var(--rik-space-4);border:none;padding:0}::slotted(.sub){font-size:var(--rik-font-size-h2);color:var(--deck-cover-muted,var(--rik-text-inverse--faint));margin-bottom:var(--rik-space-6);max-width:60ch;line-height:1.45;display:block}.meta{display:flex;gap:var(--rik-space-6);border-top:1px solid var(--deck-cover-border,var(--rik-border-inverse));padding-top:var(--rik-space-4)}.meta-item strong{display:block;font-size:var(--rik-font-size-xs);letter-spacing:0.12em;text-transform:uppercase;color:var(--deck-cover-faint,var(--rik-text-inverse--ghost));margin-bottom:6px;font-weight:700}.meta-item span{color:var(--deck-cover-text,var(--rik-text-inverse));font-size:var(--rik-font-size-body);font-weight:600}`],t([f({type:String})],c.prototype,"brand",2),t([f({type:String,attribute:"brand-src"})],c.prototype,"brandSrc",2),t([f({type:String})],c.prototype,"speaker",2),t([f({type:String})],c.prototype,"company",2),t([f({type:String})],c.prototype,"duration",2),t([f({type:String})],c.prototype,"audience",2),t([f({type:String})],c.prototype,"runtime",2),t([f({type:String,attribute:"speaker-label"})],c.prototype,"speakerLabel",2),t([f({type:String,attribute:"company-label"})],c.prototype,"companyLabel",2),t([f({type:String,attribute:"duration-label"})],c.prototype,"durationLabel",2),t([f({type:String,attribute:"audience-label"})],c.prototype,"audienceLabel",2),t([f({type:String,attribute:"runtime-label"})],c.prototype,"runtimeLabel",2),c=t([et("deck-cover")],c);import{LitElement as tt,html as ke,css as rt}from"./vendor/lit.js";import{customElement as it,property as at}from"./vendor/lit.js";var I=class extends tt{render(){return ke`${this.num?ke`<div class="sec-num" part="num">${this.num}</div>`:""}
|
|
78
78
|
<slot></slot>
|
|
79
|
-
`}};
|
|
79
|
+
`}};I.styles=[...u,rt`:host{background:var(--deck-section-bg,var(--rik-surface-inverse));color:var(--rik-text-inverse);justify-content:center;align-items:center;text-align:center}.sec-num{font-size:var(--rik-font-size-xs);font-weight:700;letter-spacing:0.16em;text-transform:uppercase;color:var(--deck-section-num-color,var(--rik-text-inverse--ghost));margin-bottom:var(--rik-space-3);display:inline-flex;align-items:center;gap:0.8rem;font-family:var(--rik-font-mono)}.sec-num::before,.sec-num::after{content:'';width:1.25rem;height:1px;background:var(--deck-section-rule-color,var(--rik-border-inverse))}::slotted(h1){font-size:var(--rik-font-size-section);font-weight:900;color:var(--deck-section-title-color,var(--rik-accent));line-height:1.02;letter-spacing:-0.03em;max-width:18ch;border:none;padding:0;margin:0;text-align:center;align-self:center}::slotted(h1 em){color:var(--deck-section-em-color,var(--rik-text-inverse--muted));font-style:normal;font-weight:700}`],t([at({type:String})],I.prototype,"num",2),I=t([it("deck-section")],I);import{LitElement as st,html as be,css as ot}from"./vendor/lit.js";import{customElement as nt,property as lt}from"./vendor/lit.js";var q=class extends st{render(){return be`${this.eyebrow?be`<span class="lbl">${this.eyebrow}</span>`:""}
|
|
80
80
|
<slot name="title"></slot>
|
|
81
81
|
<slot name="lead"></slot>
|
|
82
82
|
<div class="body" part="body"><slot></slot></div>
|
|
83
|
-
`}};q.styles=[...u,
|
|
83
|
+
`}};q.styles=[...u,ot`:host{justify-content:flex-start}.body{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:flex-start;gap:var(--rik-space-3);overflow:hidden}::slotted(deck-code:not([nested])),::slotted(deck-mermaid),::slotted(table),::slotted(pre),::slotted(svg),::slotted(.hero-main){max-height:100%;flex:0 1 auto}`],t([lt({type:String})],q.prototype,"eyebrow",2),q=t([nt("deck-feature")],q);import{LitElement as dt,html as Z,css as ct}from"./vendor/lit.js";import{customElement as pt,property as Q}from"./vendor/lit.js";var x=class extends dt{_resolveSp(s){let e=parseInt(s,10);return!Number.isNaN(e)&&e>=1&&e<=6?`var(--rik-space-${e})`:s}updated(){this.gap&&this.style.setProperty("--_gap",this._resolveSp(this.gap)),this.colGap&&this.style.setProperty("--_col-gap",this._resolveSp(this.colGap))}render(){let s=this.querySelector('[slot="a"]'),e=this.cols==="3"||!!s;return Z`${this.eyebrow?Z`<span class="lbl">${this.eyebrow}</span>`:""}
|
|
84
84
|
<slot name="title"></slot>
|
|
85
85
|
<slot name="lead"></slot>
|
|
86
86
|
<div class="body" part="body">
|
|
87
87
|
${e?Z`<div class="col" part="col"><slot name="a"></slot></div> <div class="col" part="col"><slot name="b"></slot></div> <div class="col" part="col"><slot name="c"></slot></div>`:Z`<div class="col" part="col"><slot name="left"></slot></div> <div class="col" part="col"><slot name="right"></slot></div>`}
|
|
88
88
|
</div>
|
|
89
|
-
`}};x.styles=[...u,
|
|
89
|
+
`}};x.styles=[...u,ct`:host{justify-content:flex-start}.body{flex:1;min-height:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr);gap:var(--_gap,var(--deck-split-gap,var(--rik-space-5)))}:host([cols="1-2"]) .body{grid-template-columns:1fr 2fr}:host([cols="2-1"]) .body{grid-template-columns:2fr 1fr}:host([cols="3"]) .body{grid-template-columns:1fr 1fr 1fr;gap:var(--_gap,var(--deck-split-gap,var(--rik-space-4)))}.col{display:flex;flex-direction:column;min-height:0;min-width:0;gap:var(--_col-gap,var(--deck-split-col-gap,var(--rik-space-3)));overflow:hidden}.col.center{justify-content:center}`],t([Q({type:String})],x.prototype,"eyebrow",2),t([Q({type:String})],x.prototype,"cols",2),t([Q({type:String})],x.prototype,"gap",2),t([Q({type:String,attribute:"col-gap"})],x.prototype,"colGap",2),x=t([pt("deck-split")],x);import{LitElement as vt,html as ye,css as mt}from"./vendor/lit.js";import{customElement as ht,property as ut}from"./vendor/lit.js";var O=class extends vt{render(){return ye`${this.eyebrow?ye`<span class="lbl">${this.eyebrow}</span>`:""}
|
|
90
90
|
<slot name="title"></slot>
|
|
91
91
|
<slot name="lead"></slot>
|
|
92
92
|
<div class="hero" part="hero"><slot></slot></div>
|
|
@@ -94,22 +94,22 @@ ${e.textContent??""}
|
|
|
94
94
|
<div class="col"><slot name="left"></slot></div>
|
|
95
95
|
<div class="col"><slot name="right"></slot></div>
|
|
96
96
|
</div>
|
|
97
|
-
`}};
|
|
97
|
+
`}};O.styles=[...u,mt`:host{justify-content:flex-start}.hero{flex:var(--deck-feature-cards-hero-flex,1 1 50%);min-height:0;display:flex;flex-direction:column;overflow:hidden}::slotted(deck-code),::slotted(deck-mermaid),::slotted(pre),::slotted(table),::slotted(svg){max-height:100%;flex:1 1 auto}.detail{flex:var(--deck-feature-cards-detail-flex,0 1 40%);min-height:0;margin-top:var(--deck-feature-cards-gap,var(--rik-space-3));display:grid;grid-template-columns:1fr 1fr;gap:var(--deck-feature-cards-col-gap,var(--rik-space-4));overflow:hidden}.col{display:flex;flex-direction:column;gap:var(--rik-space-2);min-width:0;min-height:0;overflow:hidden}`],t([ut({type:String})],O.prototype,"eyebrow",2),O=t([ht("deck-feature-cards")],O);import{LitElement as ft,html as gt,css as kt}from"./vendor/lit.js";import{customElement as bt,property as X}from"./vendor/lit.js";var g=class extends ft{updated(){this.position&&this.style.setProperty("--_pos",this.position),typeof this.darken=="number"&&this.style.setProperty("--_dim",String(this.darken));let s=this.align==="top"?"flex-start":this.align==="bottom"?"flex-end":"center";if(this.style.setProperty("--_align",s),this.textAlign){this.style.setProperty("--_text-align",this.textAlign);let e=this.textAlign==="center"?"center":this.textAlign==="right"?"flex-end":"flex-start";this.style.setProperty("--_text-align-items",e)}}render(){let s=this.src?`background-image: url("${this.src.replace(/"/g,"%22")}")`:"";return gt`<div class="bg" part="bg" style=${s}></div> <div class="overlay" part="overlay"></div> <div class="content" part="content"><slot></slot></div>`}};g.styles=[se,kt`:host{padding:0;color:var(--deck-photo-text-color,var(--rik-text-inverse));overflow:hidden}.bg{position:absolute;inset:0;background-size:cover;background-position:var(--_pos,center);background-repeat:no-repeat}.overlay{position:absolute;inset:0;background:var(--deck-photo-overlay-color,rgba(0,0,0,var(--_dim,0.35)))}.content{position:relative;z-index:1;display:flex;flex-direction:column;gap:var(--rik-space-3);padding:var(--deck-photo-padding-y,var(--rik-slide-padding-y)) var(--deck-photo-padding-x,var(--rik-slide-padding-x));width:100%;height:100%;max-width:100%;box-sizing:border-box;justify-content:var(--_align,center);text-align:var(--_text-align,left);align-items:var(--_text-align-items,flex-start)}.content > *{max-width:var(--deck-photo-content-max-width,36ch)}::slotted(h1){font-family:var(--rik-font-display,var(--rik-font-sans));font-size:clamp(2.5rem,6cqw,5.5rem);font-weight:900;letter-spacing:-0.035em;line-height:1.02;color:var(--deck-photo-text-color,var(--rik-text-inverse));margin:0;text-shadow:0 2px 16px rgba(0,0,0,0.35)}::slotted(h2){font-family:var(--rik-font-display,var(--rik-font-sans));font-size:clamp(1.6rem,3cqw,2.6rem);font-weight:800;letter-spacing:-0.025em;line-height:1.1;color:var(--deck-photo-text-color,var(--rik-text-inverse));margin:0;text-shadow:0 2px 12px rgba(0,0,0,0.35)}::slotted(p),::slotted(.sub){font-size:var(--rik-font-size-lead);color:var(--deck-photo-text-muted,var(--rik-text-inverse--muted));line-height:1.5;margin:0;text-shadow:0 1px 8px rgba(0,0,0,0.35)}::slotted(.kicker){font:700 var(--rik-font-size-xs)/1 var(--rik-font-mono);letter-spacing:0.18em;text-transform:uppercase;color:var(--deck-photo-text-muted,var(--rik-text-inverse--muted));margin:0}`],t([X({type:String})],g.prototype,"src",2),t([X({type:String})],g.prototype,"position",2),t([X({type:Number})],g.prototype,"darken",2),t([X({type:String})],g.prototype,"align",2),t([X({type:String,attribute:"text-align"})],g.prototype,"textAlign",2),g=t([bt("deck-photo")],g);import{LitElement as yt,html as xe,css as xt}from"./vendor/lit.js";import{customElement as wt,property as _t}from"./vendor/lit.js";var j=class extends yt{render(){return xe`<div class="body" part="body"> ${this.kicker?xe`<span class="kicker on-dark">${this.kicker}</span>`:""}
|
|
98
98
|
<slot></slot>
|
|
99
99
|
</div>
|
|
100
|
-
`}};
|
|
101
|
-
`),i=r.filter(
|
|
102
|
-
`);this._html=
|
|
100
|
+
`}};j.styles=[...u,xt`:host{background:var(--deck-takeaway-bg,var(--rik-surface-inverse));color:var(--rik-text-inverse);justify-content:center;align-items:center;text-align:center}.body{display:flex;flex-direction:column;align-items:center;gap:var(--deck-takeaway-gap,var(--rik-space-4));max-width:75cqw}::slotted(.display){font-family:var(--rik-font-display,var(--rik-font-sans));font-size:clamp(3rem,7cqw,5.5rem);font-weight:900;color:var(--deck-takeaway-display-color,var(--rik-accent));letter-spacing:-0.03em;line-height:1.05;margin:0}::slotted(.display.danger){color:var(--rik-status-danger)}::slotted(.caption){font-size:var(--rik-font-size-lead);color:var(--deck-takeaway-caption-color,var(--rik-text-inverse--faint))}`],t([_t({type:String})],j.prototype,"kicker",2),j=t([wt("deck-takeaway")],j);import{LitElement as Et,html as St,css as Lt}from"./vendor/lit.js";import{customElement as Tt,property as zt}from"./vendor/lit.js";var we={info:'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',warn:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/>',danger:'<circle cx="12" cy="12" r="10"/><path d="M12 8v4"/><path d="M12 16h.01"/>',ok:'<path d="M20 6 9 17l-5-5"/>'},B=class extends Et{render(){let s=this.type??"info",e=we[s]??we.info;return St`<div class="icon-box"> <svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" .innerHTML="${e}"></svg> </div> <div class="content"><slot></slot></div>`}};B.styles=Lt`:host{display:flex;gap:var(--rik-space-3);padding:var(--deck-callout-padding-y,var(--rik-space-3)) var(--deck-callout-padding-x,var(--rik-space-4));border-radius:var(--deck-callout-radius,var(--rik-radius-md));background:var(--deck-callout-bg,var(--rik-status-info__bg--mid));border:1px solid var(--deck-callout-border,var(--rik-status-info__border));box-shadow:var(--rik-elevation-2);align-items:center;color:var(--rik-text-default--muted);font-family:var(--rik-font-sans);font-size:var(--rik-font-size-body);line-height:1.55}:host([type="info"]){--deck-callout-bg:var(--rik-status-info__bg--mid);--deck-callout-border:var(--rik-status-info__border);--deck-callout-stroke:var(--rik-accent)}:host([type="warn"]){--deck-callout-bg:var(--rik-status-warn__bg);--deck-callout-border:var(--rik-status-warn__border);--deck-callout-stroke:var(--rik-status-warn)}:host([type="danger"]){--deck-callout-bg:var(--rik-status-danger__bg);--deck-callout-border:var(--rik-status-danger__border);--deck-callout-stroke:var(--rik-status-danger)}:host([type="ok"]){--deck-callout-bg:var(--rik-status-success__bg);--deck-callout-border:var(--rik-status-success__border);--deck-callout-stroke:var(--rik-status-success)}.icon-box{flex-shrink:0;width:var(--rik-icon-2xl);height:var(--rik-icon-2xl);display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--rik-surface-tint)}.icon-box svg{width:var(--rik-icon-lg);height:var(--rik-icon-lg);stroke:var(--deck-callout-stroke,var(--rik-accent));stroke-width:2.2}.content{flex:1}::slotted(p){margin:0}::slotted(strong){color:var(--rik-text-default);font-weight:700}::slotted(code){font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono-sm);background:var(--rik-surface-tint);padding:2px 6px;border-radius:var(--rik-radius-sm);color:var(--rik-text-default)}`,t([zt({type:String})],B.prototype,"type",2),B=t([Tt("deck-callout")],B);import{LitElement as Mt,html as $t,css as Ht}from"./vendor/lit.js";import{customElement as At,property as oe}from"./vendor/lit.js";var L=class extends Mt{constructor(){super(...arguments);this.center=!1;this.compact=!1}render(){return $t`<slot></slot>`}};L.styles=Ht`:host{display:flex;flex-direction:column;gap:var(--deck-card-gap,var(--rik-space-2));background:var(--deck-card-bg,var(--rik-surface-raised--strong));border:1px solid var(--deck-card-border,var(--rik-border-default));border-radius:var(--deck-card-radius,var(--rik-radius-lg));padding:var(--deck-card-padding-y,var(--rik-space-3)) var(--deck-card-padding-x,var(--rik-space-4));box-shadow:var(--deck-card-shadow,var(--rik-elevation-2));min-height:0;font-family:var(--rik-font-sans);color:var(--deck-card-text,var(--rik-text-default--muted))}:host([color="yellow"]){background:var(--deck-card-bg,var(--rik-status-info__bg));border:4px solid var(--deck-card-border,var(--rik-status-info__border))}:host([color="orange"]){background:var(--deck-card-bg,var(--rik-status-warn__bg));border:4px solid var(--deck-card-border,var(--rik-status-warn__border))}:host([color="green"]){background:var(--deck-card-bg,var(--rik-status-success__bg));border:4px solid var(--deck-card-border,var(--rik-status-success__border))}:host([color="red"]){background:var(--deck-card-bg,var(--rik-status-danger__bg));border:4px solid var(--deck-card-border,var(--rik-status-danger__border))}::slotted(h3){font-family:var(--rik-font-display,var(--rik-font-sans));font-size:var(--rik-font-size-h2);font-weight:700;color:var(--deck-card-title-color,var(--rik-text-default));letter-spacing:-0.01em;line-height:1.25;margin:0}::slotted(p){font-size:var(--rik-font-size-body);line-height:1.55;margin:0}::slotted(strong){color:var(--rik-text-default);font-weight:700}:host([center]){text-align:center;align-items:center}:host([compact]){padding:var(--rik-space-2) var(--rik-space-3)}`,t([oe({type:String})],L.prototype,"color",2),t([oe({type:Boolean})],L.prototype,"center",2),t([oe({type:Boolean})],L.prototype,"compact",2),L=t([At("deck-card")],L);import{LitElement as Ct,html as Nt,css as Pt}from"./vendor/lit.js";import{customElement as It,state as qt}from"./vendor/lit.js";import{marked as _e}from"./vendor/marked.js";_e.setOptions({gfm:!0,breaks:!1});var U=class extends Ct{constructor(){super(...arguments);this._html=""}connectedCallback(){super.connectedCallback(),this._parse()}_parse(){let e=this.textContent??"",r=e.split(`
|
|
101
|
+
`),i=r.filter(l=>l.trim().length>0).reduce((l,o)=>Math.min(l,o.match(/^ */)?.[0].length??0),1/0),a=i===1/0?e:r.map(l=>l.slice(i)).join(`
|
|
102
|
+
`);this._html=_e.parse(a.trim()),this.textContent=""}render(){return Nt`<div class="content" .innerHTML="${this._html}"></div>`}};U.styles=Pt`:host{display:block;color:var(--rik-text-default--muted);font-family:var(--rik-font-sans)}h1,h2,h3,h4{color:var(--rik-text-default);font-weight:700;letter-spacing:-0.01em}h2{font-size:var(--rik-font-size-h2);margin-bottom:var(--rik-space-2)}h3{font-size:var(--rik-font-size-lead);margin-bottom:var(--rik-space-2);margin-top:var(--rik-space-3)}h4{font-size:var(--rik-font-size-body);margin-bottom:var(--rik-space-1);margin-top:var(--rik-space-3)}p{font-size:var(--rik-font-size-body);line-height:1.65;margin:0 0 var(--rik-space-3)}p:last-child{margin-bottom:0}strong{color:var(--rik-text-default);font-weight:700}em{font-style:italic}code{font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono-sm);background:var(--rik-surface-tint);padding:2px 6px;border-radius:var(--rik-radius-sm);color:var(--rik-text-default)}pre{background:var(--deck-md-pre-bg,var(--rik-code__bg));border:1px solid var(--deck-md-pre-border,var(--rik-code__border));border-radius:var(--rik-radius-md);padding:var(--rik-space-3) var(--rik-space-4);overflow:auto;font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono);line-height:1.75;color:var(--deck-md-pre-text,var(--rik-code__text));margin:0 0 var(--rik-space-3);box-shadow:var(--rik-elevation-2)}pre code{background:none;padding:0;color:inherit;border-radius:0}ul,ol{padding-left:1.4rem;margin:0 0 var(--rik-space-3)}li{margin-bottom:var(--rik-space-1);font-size:var(--rik-font-size-body);line-height:1.55}li::marker{color:var(--rik-accent)}a{color:var(--rik-accent);text-decoration:underline;text-decoration-thickness:1px}blockquote{border-left:3px solid var(--rik-accent);padding:var(--rik-space-1) var(--rik-space-3);color:var(--rik-text-default--faint);font-style:italic;margin:0 0 var(--rik-space-3)}hr{border:none;border-top:1px solid var(--rik-border-default);margin:var(--rik-space-4) 0}.content{display:contents}`,t([qt()],U.prototype,"_html",2),U=t([It("deck-md")],U);import{LitElement as Ot,html as jt,css as Bt}from"./vendor/lit.js";import{customElement as Ut,property as Rt,state as Yt}from"./vendor/lit.js";var Ee=!1;async function Wt(){Ee||(window.mermaid||await new Promise((n,s)=>{let e=document.createElement("script");e.src=new URL("./vendor/mermaid.min.js",import.meta.url).href,e.onload=()=>n(),e.onerror=()=>s(new Error("mermaid failed to load")),document.head.appendChild(e)}),window.mermaid.initialize({startOnLoad:!1,theme:"dark",themeVariables:{background:"#0f0f10",mainBkg:"#2a2a2a",nodeBorder:"#555",lineColor:"#777",textColor:"#e5e5e5",fontSize:"13px",edgeLabelBackground:"#111"},flowchart:{curve:"basis",htmlLabels:!0,padding:12},securityLevel:"loose"}),Ee=!0)}var Xt=0,z=class extends Ot{constructor(){super(...arguments);this.rendered=!1;this._svg="";this._source="";this._renderPromise=null}get renderedSvg(){return this._svg}get whenRendered(){return this._renderPromise??Promise.resolve()}connectedCallback(){super.connectedCallback(),this._source=(this.textContent??"").trim();let e=this._source.split(`
|
|
103
103
|
`),r=e.filter(i=>i.trim()).reduce((i,a)=>Math.min(i,a.match(/^ */)?.[0].length??0),1/0);r<1/0&&(this._source=e.map(i=>i.slice(r)).join(`
|
|
104
|
-
`)),this._renderPromise=this._render()}async _render(){if(!this._source)return;await
|
|
104
|
+
`)),this._renderPromise=this._render()}async _render(){if(!this._source)return;await Wt();let e=`mmd-${++Xt}`;try{let{svg:r}=await window.mermaid.render(e,this._source);this._svg=r,this.rendered=!0}catch(r){console.error("Mermaid render error",r);let i=r instanceof Error?r.message:String(r);this._svg=`<pre style="color:#f87171">${i}</pre>`}}render(){return jt`<div class="canvas" .innerHTML="${this._svg}"></div>`}};z.styles=Bt`:host{display:flex;align-items:center;justify-content:center;background:var(--deck-mermaid-bg,var(--rik-code__bg));border:1px solid var(--deck-mermaid-border,var(--rik-code__border));border-radius:var(--deck-mermaid-radius,var(--rik-radius-md));padding:var(--deck-mermaid-padding,var(--rik-space-4));box-shadow:var(--rik-elevation-2);overflow:hidden;min-width:0}:host([compact]){padding:var(--rik-space-2)}.canvas{width:100%;max-width:100%;text-align:center;overflow:hidden}.canvas svg{width:100% !important;height:auto !important;max-width:100% !important;max-height:60cqh}:host([compact]) .canvas{max-width:60%}:host([compact]) .canvas svg{max-height:22cqh}`,t([Rt({type:Boolean,reflect:!0})],z.prototype,"rendered",2),t([Yt()],z.prototype,"_svg",2),z=t([Ut("deck-mermaid")],z);import{LitElement as Gt,html as Se,css as Ft}from"./vendor/lit.js";import{customElement as Vt,property as Le}from"./vendor/lit.js";var Jt={yellow:"var(--rik-accent)",orange:"var(--rik-status-warn)",green:"var(--rik-status-success)",red:"var(--rik-status-danger)",purple:"var(--rik-decor-orchid)",lime:"var(--rik-decor-lime)",cyan:"var(--rik-decor-canary)"},M=class extends Gt{updated(){this.tone?this.style.setProperty("--_c",Jt[this.tone]??this.tone):this.style.removeProperty("--_c")}render(){return Se`${this.num?Se`<div class="num" part="num">${this.num}</div>`:""}
|
|
105
105
|
<slot name="claim"></slot>
|
|
106
106
|
<div class="body" part="body"><slot></slot></div>
|
|
107
|
-
`}};M.styles=
|
|
108
|
-
`}}
|
|
107
|
+
`}};M.styles=Ft`:host{display:flex;flex-direction:column;gap:var(--deck-stat-gap,var(--rik-space-2));padding:var(--deck-stat-padding-y,var(--rik-space-4)) var(--deck-stat-padding-x,var(--rik-space-3));border-left:var(--deck-stat-border-width,4px) solid var(--_c,var(--deck-stat-color,var(--rik-accent)));min-width:0;font-family:var(--rik-font-sans)}.num{font-family:var(--rik-font-display,var(--rik-font-sans));font-size:var(--deck-stat-num-size,clamp(3.5rem,7cqw,6rem));font-weight:var(--deck-stat-num-weight,900);line-height:0.9;color:var(--_c,var(--deck-stat-color,var(--rik-accent)));letter-spacing:-0.04em}::slotted([slot="claim"]){font-family:var(--rik-font-display,var(--rik-font-sans));font-size:var(--rik-font-size-strong);font-weight:800;color:var(--deck-stat-claim-color,var(--rik-text-default));line-height:1.1;letter-spacing:-0.02em;margin:0}.body{font-size:var(--rik-font-size-body);color:var(--deck-stat-body-color,var(--rik-text-default--faint));line-height:1.45;margin-top:var(--rik-space-2)}::slotted(strong){color:var(--rik-text-default);font-weight:700}::slotted(code){font-family:var(--rik-font-mono);font-size:var(--rik-font-size-mono-sm);background:var(--rik-surface-tint);color:var(--rik-text-default);padding:2px 6px;border-radius:var(--rik-radius-sm)}`,t([Le({type:String})],M.prototype,"num",2),t([Le({type:String})],M.prototype,"tone",2),M=t([Vt("deck-stat")],M);import{LitElement as Te,html as ze,css as Me}from"./vendor/lit.js";import{customElement as $e,property as ne}from"./vendor/lit.js";var G=class extends Te{render(){return ze`<slot></slot>`}};G.styles=Me`:host{display:flex;flex-direction:column;gap:var(--rik-space-2)}`,G=t([$e("deck-metric-list")],G);var T=class extends Te{constructor(){super(...arguments);this.mono=!1}render(){return ze`<span class="label ${this.mono?"mono":""}"><slot></slot></span> <span class="value" data-severity="${this.severity??""}">${this.value}</span>`}};T.styles=Me`:host{display:flex;justify-content:space-between;align-items:center;background:var(--deck-metric-bg,var(--rik-surface-raised--strong));border:1px solid var(--deck-metric-border,var(--rik-border-default));border-radius:var(--deck-metric-radius,var(--rik-radius-md));padding:var(--deck-metric-padding-y,var(--rik-space-2)) var(--deck-metric-padding-x,var(--rik-space-4));font-family:var(--rik-font-sans);font-size:var(--rik-font-size-body);color:var(--deck-metric-text,var(--rik-text-default--muted));box-shadow:var(--deck-metric-shadow,var(--rik-elevation-2))}.label{font-family:inherit}.label.mono{font-family:var(--rik-font-mono);font-size:var(--rik-font-size-sm);color:var(--deck-metric-label-color,var(--rik-text-default--faint))}.value{font-weight:700}.value[data-severity="bad"]{color:var(--deck-metric-value-bad,var(--rik-status-danger))}.value[data-severity="warn"]{color:var(--deck-metric-value-warn,var(--rik-status-warn))}.value[data-severity="ok"]{color:var(--deck-metric-value-ok,var(--rik-status-success))}.value[data-severity="info"]{color:var(--deck-metric-value-info,var(--rik-status-info__text))}`,t([ne({type:String})],T.prototype,"value",2),t([ne({type:String})],T.prototype,"severity",2),t([ne({type:Boolean})],T.prototype,"mono",2),T=t([$e("deck-metric")],T);import{LitElement as le,html as de,css as ce}from"./vendor/lit.js";import{customElement as pe,property as D}from"./vendor/lit.js";var F=class extends le{render(){return de`<slot></slot>`}};F.styles=ce`:host{display:flex;flex-direction:column;gap:var(--rik-space-2xs)}`,F=t([pe("deck-tier-list")],F);var w=class extends le{constructor(){super(...arguments);this.hot=!1}render(){return de`<div class="head"> <span class="name">${this.name}</span> <span class="speed" data-severity="${this.severity??(this.hot?"hot":"")}">${this.speed}</span> </div> <div class="desc"><slot></slot></div>`}};w.styles=ce`:host{display:flex;flex-direction:column;gap:var(--rik-space-hair);background:var(--deck-tier-bg,var(--rik-surface-raised--strong));border:1px solid var(--deck-tier-border,var(--rik-border-default));border-radius:var(--deck-tier-radius,var(--rik-radius-md));padding:var(--deck-tier-padding-y,var(--rik-space-2)) var(--deck-tier-padding-x,var(--rik-space-4));box-shadow:var(--deck-tier-shadow,var(--rik-elevation-2));font-family:var(--rik-font-sans)}:host([hot]){border-color:var(--deck-tier-hot-border,var(--rik-status-info__border));background:var(--deck-tier-hot-bg,var(--rik-status-info__bg))}.head{display:flex;justify-content:space-between;align-items:baseline}.name{font:700 var(--rik-font-size-body)/1 var(--rik-font-mono);color:var(--deck-tier-name-color,var(--rik-text-default))}:host([hot]) .name{color:var(--deck-tier-hot-color,var(--rik-accent))}.speed{font:700 var(--rik-font-size-body)/1 var(--rik-font-mono)}.speed[data-severity="muted"]{color:var(--deck-tier-speed-muted,var(--rik-text-default--faint))}.speed[data-severity="warn"]{color:var(--deck-tier-speed-warn,var(--rik-status-warn))}.speed[data-severity="ok"]{color:var(--deck-tier-speed-ok,var(--rik-status-success))}:host([hot]) .speed{color:var(--deck-tier-hot-color,var(--rik-accent))}.desc{font-size:var(--rik-font-size-sm);color:var(--deck-tier-desc-color,var(--rik-text-default--faint));line-height:1.4}`,t([D({type:String})],w.prototype,"name",2),t([D({type:String})],w.prototype,"speed",2),t([D({type:String})],w.prototype,"severity",2),t([D({type:Boolean,reflect:!0})],w.prototype,"hot",2),w=t([pe("deck-tier")],w);var V=class extends le{render(){return de`<slot></slot>`}};V.styles=ce`:host{display:block;text-align:center;color:var(--rik-text-default--faint);opacity:var(--rik-opacity-soft);font-size:var(--rik-font-size-xs);padding:2px 0}`,V=t([pe("deck-tier-arrow")],V);import{LitElement as Ae,html as ve,css as Ce}from"./vendor/lit.js";import{customElement as Ne,property as He}from"./vendor/lit.js";var J=class extends Ae{render(){return ve`<slot></slot>`}};J.styles=Ce`:host{display:flex;flex-direction:column;gap:var(--rik-space-2xs)}`,J=t([Ne("deck-step-list")],J);var $=class extends Ae{render(){return ve`<span class="step-num">${this.n}</span> <span class="label"><slot></slot></span> ${this.note?ve`<span class="chip">${this.note}</span>`:""}
|
|
108
|
+
`}};$.styles=Ce`:host{display:flex;align-items:center;gap:var(--rik-space-3);background:var(--deck-step-bg,var(--rik-surface-raised--strong));border:1px solid var(--deck-step-border,var(--rik-border-default));border-radius:var(--deck-step-radius,var(--rik-radius-md));padding:var(--deck-step-padding-y,var(--rik-space-2xs)) var(--deck-step-padding-x,var(--rik-space-3));box-shadow:var(--deck-step-shadow,var(--rik-elevation-2));font-family:var(--rik-font-sans);font-size:var(--rik-font-size-body)}.step-num{flex:0 0 auto;width:var(--deck-step-num-size,var(--rik-icon-sm));height:var(--deck-step-num-size,var(--rik-icon-sm));display:inline-flex;align-items:center;justify-content:center;background:var(--deck-step-num-bg,var(--rik-accent));color:var(--deck-step-num-color,var(--rik-accent__on,var(--rik-surface-inverse)));border-radius:50%;font:700 var(--rik-font-size-xs)/1 var(--rik-font-sans)}.label{flex:1;font-family:var(--rik-font-mono);font-weight:600;color:var(--deck-step-label-color,var(--rik-text-default))}.chip{flex:0 0 auto;display:inline-block;padding:2px var(--rik-space-2);background:var(--deck-step-chip-bg,var(--rik-surface-tint));color:var(--deck-step-chip-color,var(--rik-text-default--faint));border-radius:var(--rik-radius-pill);font:600 var(--rik-font-size-sm)/1.4 var(--rik-font-sans)}`,t([He({type:String})],$.prototype,"n",2),t([He({type:String})],$.prototype,"note",2),$=t([Ne("deck-step")],$);import{LitElement as me,html as A,css as he}from"./vendor/lit.js";import{customElement as ue,property as C}from"./vendor/lit.js";var R=class extends me{render(){return A`<slot></slot>`}};R.styles=he`:host{display:inline-flex;align-items:center;justify-content:center;background:var(--deck-kbd-bg,var(--rik-surface-raised--strong));border:1px solid var(--deck-kbd-border,var(--rik-border-default));border-bottom:3px solid var(--rik-surface-tint--strong,rgba(0,0,0,0.10));border-radius:var(--deck-kbd-radius,5px);padding:var(--deck-kbd-padding-y,3px) var(--deck-kbd-padding-x,8px);font:700 0.92rem/1 var(--rik-font-mono);color:var(--deck-kbd-color,var(--rik-text-default));min-width:22px;text-align:center;box-shadow:0 1px 0 rgba(255,255,255,0.5) inset}:host([tone="accent"]){background:var(--deck-kbd-accent-bg,var(--rik-accent));color:var(--deck-kbd-color,var(--rik-accent__on,var(--rik-surface-inverse)));border-color:rgba(0,0,0,0.15)}:host([tone="ok"]){background:var(--deck-kbd-ok-bg,var(--rik-status-success));color:var(--deck-kbd-color,var(--rik-surface-inverse));border-color:rgba(0,0,0,0.15)}`,t([C({type:String})],R.prototype,"tone",2),R=t([ue("deck-kbd")],R);var _=class extends me{render(){let s=(this.keys??"").trim().split(/\s+/).filter(Boolean);return A`<span class="keys" part="keys"> ${s.map(e=>A`<span class="k">${e}</span>`)}
|
|
109
109
|
</span>
|
|
110
110
|
<div class="body" part="body">
|
|
111
111
|
${this.label?A`<div class="label">${this.label}</div>`:""}
|
|
112
112
|
${this.note?A`<div class="note">${this.note}</div>`:A`<div class="note"><slot></slot></div>`}
|
|
113
113
|
</div>
|
|
114
|
-
`}};_.styles=he`:host{display:flex;align-items:center;gap:var(--rik-space-3);padding:var(--rik-space-2) 0;font-family:var(--rik-font-sans)}.keys{display:inline-flex;gap:4px;flex-shrink:0}.keys deck-kbd,.keys .k{display:inline-flex;align-items:center;justify-content:center;background:var(--rik-surface-raised--strong);border:1px solid var(--rik-border-default);border-bottom:3px solid rgba(0,0,0,0.10);border-radius:5px;padding:3px 8px;font:700 0.92rem/1 var(--rik-font-mono);color:var(--rik-text-default);min-width:22px;text-align:center}.body{flex:1;min-width:0}.label{font:700 var(--rik-font-size-body)/1.2 var(--rik-font-sans);color:var(--rik-text-default)}.note{font:400 var(--rik-font-size-sm)/1.4 var(--rik-font-sans);color:var(--rik-text-default--faint);margin-top:2px}:host([tone="accent"]) .keys .k{background:var(--rik-accent);color:var(--rik-surface-inverse);border-color:rgba(0,0,0,0.15)}:host([tone="ok"]) .keys .k{background:var(--rik-status-success);color:var(--rik-surface-inverse);border-color:rgba(0,0,0,0.15)}`,t([
|
|
115
|
-
`);for(;r.length&&!r[0].trim();)r.shift();for(;r.length&&!r[r.length-1].trim();)r.pop();let i=r.filter(
|
|
114
|
+
`}};_.styles=he`:host{display:flex;align-items:center;gap:var(--rik-space-3);padding:var(--rik-space-2) 0;font-family:var(--rik-font-sans)}.keys{display:inline-flex;gap:4px;flex-shrink:0}.keys deck-kbd,.keys .k{display:inline-flex;align-items:center;justify-content:center;background:var(--rik-surface-raised--strong);border:1px solid var(--rik-border-default);border-bottom:3px solid rgba(0,0,0,0.10);border-radius:5px;padding:3px 8px;font:700 0.92rem/1 var(--rik-font-mono);color:var(--rik-text-default);min-width:22px;text-align:center}.body{flex:1;min-width:0}.label{font:700 var(--rik-font-size-body)/1.2 var(--rik-font-sans);color:var(--rik-text-default)}.note{font:400 var(--rik-font-size-sm)/1.4 var(--rik-font-sans);color:var(--rik-text-default--faint);margin-top:2px}:host([tone="accent"]) .keys .k{background:var(--rik-accent);color:var(--rik-surface-inverse);border-color:rgba(0,0,0,0.15)}:host([tone="ok"]) .keys .k{background:var(--rik-status-success);color:var(--rik-surface-inverse);border-color:rgba(0,0,0,0.15)}`,t([C({type:String})],_.prototype,"keys",2),t([C({type:String})],_.prototype,"label",2),t([C({type:String})],_.prototype,"note",2),t([C({type:String})],_.prototype,"tone",2),_=t([ue("deck-shortcut")],_);var H=class extends me{updated(){if(this.colGap){let s=parseInt(this.colGap,10),e=!Number.isNaN(s)&&s>=1&&s<=6?`var(--sp-${s})`:this.colGap;this.style.setProperty("--_col-gap",e)}}render(){return A`<slot></slot>`}};H.styles=he`:host{display:grid;grid-template-columns:1fr 1fr;gap:0 var(--_col-gap,var(--rik-space-5));font-family:var(--rik-font-sans)}:host([cols="1"]){grid-template-columns:1fr}::slotted(deck-shortcut){border-bottom:1px solid var(--rik-border-default)}`,t([C({type:String})],H.prototype,"cols",2),t([C({type:String,attribute:"col-gap"})],H.prototype,"colGap",2),H=t([ue("deck-shortcut-list")],H);import{LitElement as Kt,html as Zt,css as Qt}from"./vendor/lit.js";import{customElement as Dt,property as ee}from"./vendor/lit.js";var er={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around"},tr={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"},E=class extends Kt{updated(){if(this.gap){let s=parseInt(this.gap,10);!Number.isNaN(s)&&s>=1&&s<=6?this.style.setProperty("--_gap",`var(--rik-space-${s})`):this.style.setProperty("--_gap",this.gap)}else this.style.removeProperty("--_gap");this.style.setProperty("--_dir",this.direction==="row"?"row":"column"),this.align&&this.style.setProperty("--_align",tr[this.align]??this.align),this.justify&&this.style.setProperty("--_justify",er[this.justify]??this.justify)}render(){return Zt`<slot></slot>`}};E.styles=Qt`:host{display:flex;flex-direction:var(--_dir,column);gap:var(--_gap,var(--deck-stack-gap,var(--rik-space-3)));align-items:var(--_align,stretch);justify-content:var(--_justify,flex-start);min-width:0;min-height:0}:host([fill]){flex:1 1 auto}`,t([ee({type:String})],E.prototype,"gap",2),t([ee({type:String})],E.prototype,"direction",2),t([ee({type:String})],E.prototype,"align",2),t([ee({type:String})],E.prototype,"justify",2),E=t([Dt("deck-stack")],E);import{LitElement as rr,html as ir,css as ar}from"./vendor/lit.js";import{customElement as sr,property as K}from"./vendor/lit.js";var Pe={start:"start",center:"center",end:"end",stretch:"stretch"};function Ie(n){if(!n)return null;let s=parseInt(n,10);return!Number.isNaN(s)&&String(s)===n.trim()&&s>=1&&s<=12?`repeat(${s}, minmax(0, 1fr))`:n}function or(n){if(!n)return null;let s=parseInt(n,10);return!Number.isNaN(s)&&s>=1&&s<=6?`var(--rik-space-${s})`:n}var k=class extends rr{updated(){let s=Ie(this.cols),e=Ie(this.rows),r=or(this.gap);s&&this.style.setProperty("--_cols",s),e&&this.style.setProperty("--_rows",e),r&&this.style.setProperty("--_gap",r),this.align&&this.style.setProperty("--_align",Pe[this.align]??this.align),this.justify&&this.style.setProperty("--_justify",Pe[this.justify]??this.justify)}render(){return ir`<slot></slot>`}};k.styles=ar`:host{display:grid;grid-template-columns:var(--_cols,1fr);grid-template-rows:var(--_rows,auto);gap:var(--_gap,var(--deck-grid-gap,var(--rik-space-3)));align-items:var(--_align,stretch);justify-items:var(--_justify,stretch);min-width:0;min-height:0}:host([fill]){flex:1 1 auto;height:100%}`,t([K({type:String})],k.prototype,"cols",2),t([K({type:String})],k.prototype,"rows",2),t([K({type:String})],k.prototype,"gap",2),t([K({type:String})],k.prototype,"align",2),t([K({type:String})],k.prototype,"justify",2),k=t([sr("deck-grid")],k);import{LitElement as nr,html as lr,css as dr}from"./vendor/lit.js";import{customElement as cr,property as pr}from"./vendor/lit.js";var Y=class extends nr{render(){return lr`<slot></slot>`}};Y.styles=dr`:host{display:inline-block;padding:var(--deck-badge-padding-y,var(--rik-space-1)) var(--deck-badge-padding-x,var(--rik-space-3));margin-bottom:var(--rik-space-2);font:700 var(--rik-font-size-xs)/1.2 var(--rik-font-sans);letter-spacing:0.1em;text-transform:uppercase;border-radius:var(--deck-badge-radius,var(--rik-radius-pill));background:var(--deck-badge-bg,var(--rik-surface-tint));color:var(--deck-badge-fg,var(--rik-text-default--faint));border:1px solid var(--deck-badge-border,var(--rik-border-default))}:host([type="bad"]){--deck-badge-bg:var(--rik-status-danger__bg);--deck-badge-fg:var(--rik-status-danger);--deck-badge-border:var(--rik-status-danger__border)}:host([type="ok"]){--deck-badge-bg:var(--rik-status-success__bg);--deck-badge-fg:var(--rik-status-success);--deck-badge-border:var(--rik-status-success__border)}:host([type="info"]){--deck-badge-bg:var(--rik-status-info__bg--strong);--deck-badge-fg:var(--rik-status-info__text);--deck-badge-border:var(--rik-status-info__border)}:host([type="warn"]){--deck-badge-bg:var(--rik-status-warn__bg);--deck-badge-fg:var(--rik-status-warn);--deck-badge-border:var(--rik-status-warn__border)}`,t([pr({type:String})],Y.prototype,"type",2),Y=t([cr("deck-badge")],Y);import{LitElement as vr,html as mr,css as hr}from"./vendor/lit.js";var fe=class extends vr{static{this.styles=hr`:host{display:block;font:700 var(--deck-kicker-font-size,var(--rik-font-size-xs))/1.2 var(--rik-font-sans);letter-spacing:var(--deck-kicker-tracking,0.14em);text-transform:uppercase;color:var(--deck-kicker-color,var(--rik-text-default--faint));margin-bottom:var(--deck-kicker-margin,var(--rik-space-2))}:host([on-dark]){color:var(--deck-kicker-on-dark-color,var(--rik-text-inverse--faint))}`}render(){return mr`<slot></slot>`}};customElements.define("deck-kicker",fe);import{LitElement as ur,html as fr,css as gr}from"./vendor/lit.js";import{customElement as kr,property as te}from"./vendor/lit.js";var qe={warn:"var(--rik-status-warn)",danger:"var(--rik-status-danger)",ok:"var(--rik-status-success)",info:"var(--rik-accent)",muted:"var(--rik-text-default--faint)",accent:"var(--rik-accent)"},Oe={lead:"var(--rik-font-size-lead)",big:"var(--rik-font-size-big)",mega:"var(--rik-font-size-mega)",stat:"var(--rik-font-size-stat)",display:"clamp(2.6rem, 6cqw, 5rem)"},S=class extends ur{updated(){this.tone&&qe[this.tone]?this.style.setProperty("--_color",qe[this.tone]):this.style.removeProperty("--_color"),this.size&&Oe[this.size]?this.style.setProperty("--_size",Oe[this.size]):this.style.removeProperty("--_size")}render(){return fr`<slot></slot>`}};S.styles=gr`:host{display:block;margin:0;font-family:var(--rik-font-display,var(--rik-font-sans));font-weight:900;line-height:1.1;letter-spacing:-0.02em;font-size:var(--deck-punch-size,var(--_size,var(--rik-font-size-lead)));color:var(--deck-punch-color,var(--_color,inherit))}:host([weight="700"]){font-weight:700}:host([weight="800"]){font-weight:800}:host([align="center"]){text-align:center}:host([align="right"]){text-align:right}`,t([te({type:String})],S.prototype,"tone",2),t([te({type:String})],S.prototype,"size",2),t([te({type:String,reflect:!0})],S.prototype,"weight",2),t([te({type:String,reflect:!0})],S.prototype,"align",2),S=t([kr("deck-punch")],S);import{LitElement as br,html as yr,css as xr}from"./vendor/lit.js";import{customElement as wr,property as re,state as _r}from"./vendor/lit.js";function Er(n,s){let e=n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),r=[],i=(o,p)=>{let y=`P${r.length}E`;return r.push(`<span class="${o}">${p}</span>`),y};return s==="html"||s==="xml"||s==="svg"?(e=e.replace(/(<!--[\s\S]*?-->)/g,o=>i("cmt",o)),e=e.replace(/(<!doctype[^&]*>)/gi,o=>i("cmt",o)),e=e.replace(/("[^"]*"|'[^']*')/g,o=>i("str",o)),e=e.replace(/(<\/?)([a-zA-Z][a-zA-Z0-9:-]*)/g,(o,p,y)=>p+i("kw",y)),e=e.replace(/\b([a-zA-Z][a-zA-Z0-9-]*)(?==)/g,o=>i("prop",o))):s==="css"||s==="scss"||s==="less"?(e=e.replace(/(\/\*[\s\S]*?\*\/)/g,o=>i("cmt",o)),e=e.replace(/("[^"]*"|'[^']*')/g,o=>i("str",o)),e=e.replace(/([a-zA-Z-]+)(?=\s*:)/g,o=>i("prop",o)),e=e.replace(/(#[0-9a-fA-F]{3,8})\b/g,o=>i("num",o)),e=e.replace(/\b(\d+(?:\.\d+)?)(px|rem|em|%|vh|vw|vmin|vmax|s|ms|deg)?/g,(o,p,y)=>i("num",p+(y??"")))):(e=e.replace(/(\/\/[^\n]*)/g,o=>i("cmt",o)),e=e.replace(/(['"`])((?:\\.|(?!\1)[^\\])*)\1/g,o=>i("str",o)),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,o=>i("kw",o)),e=e.replace(/\b(\d+(?:\.\d+)?)\b/g,o=>i("num",o))),e=e.replace(/P(\d+)E/g,(o,p)=>r[+p]??""),e}var b=class extends br{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 r=(this.textContent??"").split(`
|
|
115
|
+
`);for(;r.length&&!r[0].trim();)r.shift();for(;r.length&&!r[r.length-1].trim();)r.pop();let i=r.filter(l=>l.trim().length>0).reduce((l,o)=>Math.min(l,o.match(/^ */)?.[0].length??0),1/0),a=i===1/0?r:r.map(l=>l.slice(i));this._html=a.map((l,o)=>'<span class="line" data-line="'+(o+1)+'">'+Er(l||" ",this.lang)+"</span>").join("")}applyStep(e){if(!this._groups)return;let r=this.shadowRoot?.querySelectorAll(".line");if(r)if(e===0)r.forEach(i=>{i.classList.remove("dim","lit")});else{let i=this._groups[Math.min(e-1,this._groups.length-1)]??[];r.forEach(a=>{let l=parseInt(a.dataset.line??"0",10);a.classList.toggle("lit",i.includes(l)),a.classList.toggle("dim",!i.includes(l))})}}render(){return yr`<pre><code .innerHTML="${this._html}"></code></pre>`}};b.styles=xr`: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))}`,t([re({type:String})],b.prototype,"lang",2),t([re({type:Boolean,reflect:!0})],b.prototype,"hero",2),t([re({type:Boolean,reflect:!0})],b.prototype,"nested",2),t([re({type:String,attribute:"step-groups"})],b.prototype,"stepGroups",2),t([_r()],b.prototype,"_html",2),b=t([wr("deck-code")],b);new URLSearchParams(location.search).has("live")&&import("./livereload.js");
|
package/dist/livereload.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=t=>new URL(t,import.meta.url).href,l=t=>{try{return new URL(t,location.href).origin===location.origin}catch{return!1}},p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(t=>t.href).filter(l),r=[...p,e("./index.js"),e("./deck-root.js"),e("./deck-cover.js"),e("./deck-section.js"),e("./deck-feature.js"),e("./deck-split.js"),e("./deck-feature-cards.js"),e("./deck-takeaway.js"),e("./deck-md.js"),e("./deck-code.js"),e("./deck-callout.js"),e("./deck-card.js"),e("./deck-mermaid.js"),e("./shared-styles.js"),e("./deck-stack.js"),e("./deck-grid.js"),e("./deck-punch.js"),location.pathname],a=new Map,o;function c(t,s="#0a0a0a"){o||(o=document.createElement("div"),o.style.cssText=`position:fixed;bottom:12px;left:12px;z-index:9999;padding:6px 12px;background:${s};color:#F7CB44;font:600 11px/1.4 monospace;border-radius:6px;letter-spacing:.08em;text-transform:uppercase;opacity:0;transition:opacity .2s;pointer-events:none;border:1px solid #F7CB44`,document.body.appendChild(o)),o.textContent=t,o.style.opacity="1",o._t&&clearTimeout(o._t),o._t=setTimeout(()=>{o&&(o.style.opacity="0")},1500)}async function d(t){try{let s=await fetch(t
|
|
1
|
+
var e=t=>new URL(t,import.meta.url).href,l=t=>{try{return new URL(t,location.href).origin===location.origin}catch{return!1}},p=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map(t=>t.href).filter(l),r=[...p,e("./index.js"),e("./deck-root.js"),e("./deck-cover.js"),e("./deck-section.js"),e("./deck-feature.js"),e("./deck-split.js"),e("./deck-feature-cards.js"),e("./deck-takeaway.js"),e("./deck-md.js"),e("./deck-code.js"),e("./deck-callout.js"),e("./deck-card.js"),e("./deck-mermaid.js"),e("./shared-styles.js"),e("./deck-stack.js"),e("./deck-grid.js"),e("./deck-punch.js"),location.pathname],a=new Map,o;function c(t,s="#0a0a0a"){o||(o=document.createElement("div"),o.style.cssText=`position:fixed;bottom:12px;left:12px;z-index:9999;padding:6px 12px;background:${s};color:#F7CB44;font:600 11px/1.4 monospace;border-radius:6px;letter-spacing:.08em;text-transform:uppercase;opacity:0;transition:opacity .2s;pointer-events:none;border:1px solid #F7CB44`,document.body.appendChild(o)),o.textContent=t,o.style.opacity="1",o._t&&clearTimeout(o._t),o._t=setTimeout(()=>{o&&(o.style.opacity="0")},1500)}async function d(t){try{let s=await fetch(`${t}?_lr=${Date.now()}`,{method:"HEAD",cache:"no-store"}),n=s.headers.get("last-modified")??s.headers.get("etag")??s.headers.get("content-length");if(!n)return!1;let i=a.get(t);return a.set(t,n),i!==void 0&&i!==n}catch{return!1}}async function m(){for(;;){for(let t of r)if(await d(t)){c(`reload \xB7 ${t.split("/").pop()}`),await new Promise(s=>setTimeout(s,150)),location.reload();return}await new Promise(t=>setTimeout(t,800))}}(async()=>(await Promise.all(r.map(d)),c("livereload on"),m()))();
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** True when a computed CSS color is fully opaque.
|
|
2
|
+
*
|
|
3
|
+
* `getComputedStyle().backgroundColor` serializes opaque colors as
|
|
4
|
+
* `rgb(r, g, b)` and anything with alpha < 1 as `rgba(r, g, b, a)` ·
|
|
5
|
+
* so the alpha is the 4th comma component when present, never the 3rd.
|
|
6
|
+
* Modern color functions (`oklch(…)`, `color(…)`) carry their alpha
|
|
7
|
+
* after a slash instead. */
|
|
8
|
+
export declare function isOpaqueColor(color: string): boolean;
|
|
@@ -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,13 +7,14 @@ 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
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
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). */
|
|
17
18
|
width: number;
|
|
18
19
|
height: number;
|
|
19
20
|
/** Hide the bottom-left keyboard-hint chip (the ←/→ · O · P · ? row). */
|
|
@@ -55,6 +56,11 @@ export declare class DeckRoot extends LitElement {
|
|
|
55
56
|
private _wheelAccum;
|
|
56
57
|
private _wheelLockUntil;
|
|
57
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;
|
|
58
64
|
/** Confine author `<style scoped>` blocks to their own slide. A light-DOM
|
|
59
65
|
* <style> is a global stylesheet by default, so a per-slide tweak would
|
|
60
66
|
* bleed across the whole deck. Wrapping its body in a native @scope rule
|
|
@@ -62,9 +68,37 @@ export declare class DeckRoot extends LitElement {
|
|
|
62
68
|
* with no selector rewriting · plain CSS inside keeps working unchanged. */
|
|
63
69
|
private _scopeSlideStyles;
|
|
64
70
|
/** Publish the logical canvas size on the document root so both the
|
|
65
|
-
* `html:has(deck-root
|
|
66
|
-
*
|
|
71
|
+
* `html:has(deck-root)` rem-baseline rule and the shadow `#stage` (via
|
|
72
|
+
* custom-property inheritance) size against the same numbers. */
|
|
67
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;
|
|
68
102
|
disconnectedCallback(): void;
|
|
69
103
|
private _startAutoplay;
|
|
70
104
|
private _stopAutoplay;
|
|
@@ -118,7 +152,7 @@ export declare class DeckRoot extends LitElement {
|
|
|
118
152
|
private _applyActive;
|
|
119
153
|
private _applyStep;
|
|
120
154
|
private _updateUI;
|
|
121
|
-
updated(): void;
|
|
155
|
+
updated(changed: PropertyValues<this>): void;
|
|
122
156
|
private _navArrows;
|
|
123
157
|
render(): unknown;
|
|
124
158
|
}
|
package/dist/shiki.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var i=null,
|
|
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};
|