admin08077/Githubgemini
0
1import{r as t,j as e}from"./react-DKy9e2uO.js";import{m as p}from"./marked-CesSW9Du.js";import{P as g}from"./index-Ykf-MVva.js";import"./bottleneck-Cpj98o6Y.js";import"./react-dom-CpxHE_eW.js";import"./scheduler-DYLXRpC5.js";import"./idb-Dob3nYDb.js";import"./@google-D80DdW2m.js";import"./jszip-s56H2EZ-.js";const b=`# Slide 1: Welcome2 3This is a slide deck generated from Markdown.4 5- Use standard markdown syntax6- Like lists, headers, and **bold** text.7 8---9 10# Slide 2: Features11 12Navigate using the buttons below.13 14\`\`\`javascript15console.log("Code blocks work too!");16\`\`\`17 18---19 20# Slide 3: The End21 22Easy to create and present.23`,C=()=>{const[n,m]=t.useState(b),[l,c]=t.useState(0),[u,x]=t.useState(""),a=t.useRef(null),r=t.useMemo(()=>n.split(/^-{3,}\s*$/m),[n]);t.useEffect(()=>{(async()=>{const o=r[l]||"",h=await p.parse(o);x(h)})()},[r,l]);const d=t.useCallback(()=>c(s=>Math.min(s+1,r.length-1)),[r.length]),i=t.useCallback(()=>c(s=>Math.max(s-1,0)),[]),f=()=>{var s;(s=a.current)==null||s.requestFullscreen()};return t.useEffect(()=>{const s=o=>{document.fullscreenElement===a.current&&((o.key==="ArrowRight"||o.key===" ")&&d(),o.key==="ArrowLeft"&&i())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[d,i]),e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8 text-text-primary",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[e.jsx(g,{}),e.jsx("span",{className:"ml-3",children:"Markdown to Slides"})]}),e.jsx("p",{className:"text-text-secondary mt-1",children:"Write markdown, present it as a slideshow. Use '---' to separate slides."})]}),e.jsxs("div",{className:"flex-grow grid grid-cols-1 lg:grid-cols-2 gap-6 h-full overflow-hidden",children:[e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{htmlFor:"md-input",className:"text-sm font-medium text-text-secondary mb-2",children:"Markdown Editor"}),e.jsx("textarea",{id:"md-input",value:n,onChange:s=>m(s.target.value),className:"flex-grow p-4 bg-surface border border-border rounded-md resize-none font-mono text-sm focus:ring-2 focus:ring-primary focus:outline-none"})]}),e.jsxs("div",{ref:a,className:"flex flex-col h-full bg-surface fullscreen:bg-background border border-border rounded-md",children:[e.jsx("div",{className:"flex-shrink-0 flex justify-end items-center p-2 border-b border-border",children:e.jsx("button",{onClick:f,className:"px-3 py-1 bg-gray-100 rounded-md text-xs hover:bg-gray-200",children:"Fullscreen"})}),e.jsxs("div",{className:"relative flex-grow flex flex-col justify-center items-center p-8 overflow-y-auto",children:[e.jsx("div",{className:"prose prose-lg max-w-none w-full",dangerouslySetInnerHTML:{__html:u}}),e.jsx("button",{onClick:i,disabled:l===0,className:"absolute left-4 top-1/2 -translate-y-1/2 p-2 bg-gray-200/50 rounded-full disabled:opacity-30 hover:bg-gray-300/50",children:"◀"}),e.jsx("button",{onClick:d,disabled:l===r.length-1,className:"absolute right-4 top-1/2 -translate-y-1/2 p-2 bg-gray-200/50 rounded-full disabled:opacity-30 hover:bg-gray-300/50",children:"▶"}),e.jsxs("div",{className:"absolute bottom-4 right-4 text-xs bg-black/50 px-2 py-1 rounded-md text-white",children:[l+1," / ",r.length]})]})]})]})]})};export{C as MarkdownSlides};24//# sourceMappingURL=MarkdownSlides-CXwKSw4Z.js.map25 