demoo / assets /MarkdownSlides-BMRDMVTS.js
admin08077's picture
Upload 85 files
edfe4af verified
import{r as a,j as e}from"./react-D_B_5QVd.js";import{m as u}from"./marked-CesSW9Du.js";import{P as h}from"./index-QBya0NjG.js";import"./jszip-C9ownNzX.js";import"./react-dom-EAO2-NBm.js";import"./scheduler-DYLXRpC5.js";import"./@google-4tyssLU_.js";import"./idb-Dob3nYDb.js";const f=`# Slide 1: Welcome
This is a slide deck generated from Markdown.
- Use standard markdown syntax
- Like lists, headers, and **bold** text.
---
# Slide 2: Features
Navigate using the buttons below.
\`\`\`javascript
console.log("Code blocks work too!");
\`\`\`
---
# Slide 3: The End
Easy to create and present.
`,S=()=>{const[o,i]=a.useState(f),[t,r]=a.useState(0),[c,n]=a.useState(""),l=a.useMemo(()=>o.split(/^-{3,}\s*$/m),[o]);a.useEffect(()=>{(async()=>{const d=l[t]||"";if(d){const p=await u.parse(d);n(p)}else n("")})()},[l,t]);const m=()=>r(s=>Math.min(s+1,l.length-1)),x=()=>r(s=>Math.max(s-1,0));return e.jsxs("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[e.jsxs("header",{className:"mb-6",children:[e.jsxs("h1",{className:"text-3xl font-bold text-slate-100 flex items-center",children:[e.jsx(h,{}),e.jsx("span",{className:"ml-3",children:"Markdown to Slides"})]}),e.jsx("p",{className:"text-slate-400 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-slate-400 mb-2",children:"Markdown Editor"}),e.jsx("textarea",{id:"md-input",value:o,onChange:s=>i(s.target.value),className:"flex-grow p-4 bg-slate-900 border border-slate-700 rounded-md resize-none font-mono text-sm text-cyan-300 focus:ring-2 focus:ring-cyan-500 focus:outline-none"})]}),e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx("label",{className:"text-sm font-medium text-slate-400 mb-2",children:"Presentation View"}),e.jsxs("div",{className:"relative flex-grow flex flex-col justify-center items-center p-8 bg-slate-800/50 border border-slate-700/50 rounded-md overflow-y-auto",children:[e.jsx("div",{className:"prose prose-lg prose-invert max-w-none w-full",dangerouslySetInnerHTML:{__html:c}}),e.jsxs("div",{className:"absolute bottom-4 left-4 right-4 flex justify-between items-center",children:[e.jsx("button",{onClick:x,disabled:t===0,className:"px-4 py-2 bg-slate-700 rounded-md disabled:opacity-50",children:"Prev"}),e.jsxs("span",{className:"text-sm text-slate-400",children:[t+1," / ",l.length]}),e.jsx("button",{onClick:m,disabled:t===l.length-1,className:"px-4 py-2 bg-slate-700 rounded-md disabled:opacity-50",children:"Next"})]})]})]})]})]})};export{S as MarkdownSlides};
//# sourceMappingURL=MarkdownSlides-BMRDMVTS.js.map