| import{B as e,C as t,S as n,T as r,_ as i,b as a,dt as o,et as s,l as c,m as l,tt as u}from"../modules/shiki-CJZsCeMT.js";import{Z as d,t as f}from"../useNav-__VNesFJ.js";import{D as p}from"../modules/vue-ClnAKIA7.js";import{m,t as h}from"../index-y1O4_MBz.js";import{t as g}from"./IconButton-BwA4p7Ax.js";import{t as _}from"./Modal-cvUjgiyd.js";var v={class:`flex my-1`},y={class:`h-full`},b={class:`slidev-glass-effect fixed bottom-5 right-5 rounded-full border border-main`},x=r({__name:`notes-edit`,setup(r){let x=/^---\s*#(\d+)\s*$/;m({title:`Notes Edit - ${d}`});let{slides:S}=f(),C=o(!1),w=o(T(S.value));function T(e){let t=[];for(let n of e)n.meta.slide.note?.trim()&&(t.push(`--- #${n.no}`),t.push(``),t.push(n.meta.slide.note),t.push(``));return t.join(` |
| `)}function E(e,t){let n=e.split(/^(---\s*#\d+\s*)$/gm);n.forEach((e,r)=>{let i=e.match(x);if(i){let e=Number.parseInt(i[1]),a=n[r+1].trim(),o=t.find(t=>t.no===e);o&&(o.meta.slide.note=a,h(e).update({note:a}))}})}return p(w,e=>{E(e,S.value)},{debounce:300}),(r,o)=>(e(),a(l,null,[t(_,{modelValue:C.value,"onUpdate:modelValue":o[1]||=e=>C.value=e,class:`px-6 py-4 flex flex-col gap-2`},{default:s(()=>[o[4]||=i(`div`,{class:`flex gap-2 text-xl`},[i(`div`,{class:`i-carbon:information my-auto`}),n(` Help `)],-1),o[5]||=i(`div`,{class:`prose dark:prose-invert`},[i(`p`,null,`This is the batch notes editor. You can edit the notes for all the slides at once here.`),i(`p`,null,[n(`The note for each slide are separated by `),i(`code`,null,`--- #[no]`),n(` lines, you might want to keep them while editing.`)])],-1),i(`div`,v,[i(`button`,{class:`slidev-form-button`,onClick:o[0]||=e=>C.value=!1},` Close `)])]),_:1},8,[`modelValue`]),i(`div`,y,[i(`div`,b,[t(g,{title:`Help`,class:`rounded-full`,onClick:o[2]||=e=>C.value=!0},{default:s(()=>[...o[6]||=[i(`div`,{class:`i-carbon:help text-2xl`},null,-1)]]),_:1})]),u(i(`textarea`,{"onUpdate:modelValue":o[3]||=e=>w.value=e,class:`prose dark:prose-invert resize-none p5 outline-none bg-transparent block h-full w-full! max-w-full! max-h-full! min-h-full! min-w-full!`},null,512),[[c,w.value]])])],64))}});export{x as default}; |