2 lines
19 KiB
JavaScript
2 lines
19 KiB
JavaScript
import{d as se,n as ie,p as pe,o as s,c as a,F as ee,m as te,a as e,q as X,t as b,f,T as fe,g as p,s as ce,b as R,r as u,j as de,h as w,l as C,k as ve,x as he,y as _e,e as ne,v as le,w as ae,z as me,i as we}from"./index-Bwmlaq-e.js";import{u as ue}from"./projects-DaKKWK6n.js";import{u as ge,H as ye}from"./Header-D3hVVxoP.js";import{_ as re,B as j}from"./Button-BCQM6xXJ.js";import{M as Q}from"./Modal-DyPCz1pc.js";const ke={class:"tree"},xe=["onClick"],je=["onClick"],Ce={key:1,class:"tree__icon"},$e={class:"tree__label"},be=se({__name:"TreeView",props:{nodes:{}},emits:["node-click"],setup(Y,{emit:I}){const N=Y,o=I,i=u(new Set);ie(()=>N.nodes,h=>{h.forEach(n=>{n.type==="folder"&&i.value.add(n.id)})},{immediate:!0});function P(h,n){n.stopPropagation(),i.value.has(h.id)?i.value.delete(h.id):i.value.add(h.id)}function $(h){o("node-click",h)}return(h,n)=>{const k=pe("TreeView",!0);return s(),a("ul",ke,[(s(!0),a(ee,null,te(Y.nodes,c=>(s(),a("li",{key:c.id,class:"tree__item"},[e("div",{class:X(["tree__node",{"tree__node--folder":c.type==="folder"}]),onClick:M=>$(c)},[c.type==="folder"?(s(),a("button",{key:0,class:"tree__toggle",onClick:M=>P(c,M)},[(s(),a("svg",{class:X(["tree__arrow",{"tree__arrow--expanded":i.value.has(c.id)}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...n[1]||(n[1]=[e("path",{d:"m9 18 6-6-6-6"},null,-1)])],2))],8,je)):(s(),a("span",Ce,[...n[2]||(n[2]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"})],-1)])])),e("span",$e,b(c.name),1)],10,xe),f(fe,{name:"expand"},{default:p(()=>{var M;return[c.type==="folder"&&i.value.has(c.id)&&((M=c.children)!=null&&M.length)?(s(),ce(k,{key:0,nodes:c.children,class:"tree__children",onNodeClick:n[0]||(n[0]=g=>o("node-click",g))},null,8,["nodes"])):R("",!0)]}),_:2},1024)]))),128))])}}}),Pe=re(be,[["__scopeId","data-v-e9acf25c"]]),Me={class:"sidebar"},Fe={key:0,class:"sidebar__content"},Ve={class:"sidebar__project"},ze={class:"sidebar__project-name"},Se={key:0,class:"sidebar__project-desc"},Ne={class:"sidebar__actions"},Be={class:"sidebar__tree"},De={key:1,class:"sidebar__empty"},Ee=se({__name:"Sidebar",emits:["create-folder","create-document"],setup(Y,{emit:I}){const N=de(),o=ue(),i=I;function P(h){h.type==="document"&&N.push(`/documents/${h.id}`)}function $(){N.push("/dashboard")}return(h,n)=>(s(),a("aside",Me,[e("div",{class:"sidebar__header"},[e("button",{class:"sidebar__back",onClick:$},[...n[2]||(n[2]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"m15 18-6-6 6-6"})],-1),w(" All Projects ",-1)])])]),C(o).currentProject?(s(),a("div",Fe,[e("div",Ve,[e("h2",ze,b(C(o).currentProject.name),1),C(o).currentProject.description?(s(),a("p",Se,b(C(o).currentProject.description),1)):R("",!0)]),e("div",Ne,[f(j,{size:"sm",variant:"ghost",onClick:n[0]||(n[0]=k=>i("create-folder"))},{default:p(()=>[...n[3]||(n[3]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),e("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),e("line",{x1:"9",y1:"14",x2:"15",y2:"14"})],-1),w(" New Folder ",-1)])]),_:1}),f(j,{size:"sm",variant:"ghost",onClick:n[1]||(n[1]=k=>i("create-document"))},{default:p(()=>[...n[4]||(n[4]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"}),e("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),e("line",{x1:"9",y1:"14",x2:"15",y2:"14"})],-1),w(" New Doc ",-1)])]),_:1})]),e("div",Be,[f(Pe,{nodes:C(o).treeNodes,onNodeClick:P},null,8,["nodes"])])])):(s(),a("div",De,[...n[5]||(n[5]=[e("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[e("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})],-1),e("p",null,"Select a project to view its contents",-1)])]))]))}}),He=re(Ee,[["__scopeId","data-v-f979c4be"]]),Re={class:"graph-view"},Ie={class:"graph-view__header"},Le={class:"graph-view__controls"},Te={class:"graph-view__depth"},Ue={key:0,class:"graph-view__stats"},Ge={key:0,class:"graph-view__stat--warning"},Ae={key:0,class:"graph-view__loading"},Oe={key:1,class:"graph-view__error"},qe=["width","height"],We={class:"graph-view__edges"},Xe=["d"],Ye={class:"graph-view__nodes"},Je=["transform","onClick"],Ze={key:3,class:"graph-view__empty"},Ke=se({__name:"GraphView",props:{projectId:{}},emits:["close"],setup(Y){const I=Y,N=de(),o=ue(),i=u(null),P=u(!1),$=u(null),h=u(2),n=u(new Map),k=u(800),c=u(600),M=u(null),g=u(null);async function L(){P.value=!0,$.value=null;try{i.value=await o.fetchProjectGraph(I.projectId,h.value),J(),G()}catch(m){$.value=m instanceof Error?m.message:"Failed to load graph"}finally{P.value=!1}}function J(){if(!i.value)return;const m=k.value/2,v=c.value/2,_=Math.min(k.value,c.value)*.35,x=new Map;i.value.nodes.forEach((z,O)=>{const Z=2*Math.PI*O/i.value.nodes.length;x.set(z.id,{id:z.id,title:z.title,x:m+_*Math.cos(Z),y:v+_*Math.sin(Z),vx:0,vy:0})}),n.value=x}function G(m=150){if(i.value)for(let v=0;v<m;v++)A()}function A(){if(!i.value)return;const m=Array.from(n.value.values()),v=i.value.edges,_=3e3,x=.05,z=.01,O=.85;for(let d=0;d<m.length;d++)for(let F=d+1;F<m.length;F++){const V=m[d],S=m[F],D=S.x-V.x,E=S.y-V.y,H=Math.sqrt(D*D+E*E)||1,q=_/(H*H),W=D/H*q,r=E/H*q;V.vx-=W,V.vy-=r,S.vx+=W,S.vy+=r}for(const d of v){const F=n.value.get(d.source),V=n.value.get(d.target);if(!F||!V)continue;const S=V.x-F.x,D=V.y-F.y,E=Math.sqrt(S*S+D*D)||1,H=(E-80)*x,q=S/E*H,W=D/E*H;F.vx+=q,F.vy+=W,V.vx-=q,V.vy-=W}const Z=k.value/2,oe=c.value/2;for(const d of m)d.vx+=(Z-d.x)*z,d.vy+=(oe-d.y)*z;for(const d of m)d.vx*=O,d.vy*=O,d.x+=d.vx,d.y+=d.vy,d.x=Math.max(40,Math.min(k.value-40,d.x)),d.y=Math.max(40,Math.min(c.value-40,d.y)),n.value.set(d.id,d)}function T(m,v){const _=n.value.get(m),x=n.value.get(v);return!_||!x?"":`M ${_.x} ${_.y} L ${x.x} ${x.y}`}function K(m){N.push(`/documents/${m}`)}function B(){g.value&&(k.value=g.value.clientWidth,c.value=g.value.clientHeight,i.value&&(J(),G(100)))}let y=null;return ve(async()=>{g.value&&(k.value=g.value.clientWidth,c.value=g.value.clientHeight,y=new ResizeObserver(B),y.observe(g.value)),await L()}),he(()=>{y==null||y.disconnect()}),ie(h,()=>{L()}),(m,v)=>(s(),a("div",Re,[e("div",Ie,[v[2]||(v[2]=e("h2",{class:"graph-view__title"},"Project Graph",-1)),e("div",Le,[e("div",Te,[v[0]||(v[0]=e("span",{class:"graph-view__depth-label"},"Depth:",-1)),(s(),a(ee,null,te([1,2,3],_=>f(j,{key:_,variant:h.value===_?"primary":"ghost",size:"sm",onClick:x=>h.value=_},{default:p(()=>[w(b(_),1)]),_:2},1032,["variant","onClick"])),64))]),f(j,{variant:"ghost",size:"sm",onClick:L},{default:p(()=>[...v[1]||(v[1]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M23 4v6h-6"}),e("path",{d:"M1 20v-6h6"}),e("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})],-1),w(" Refresh ",-1)])]),_:1})])]),i.value?(s(),a("div",Ue,[e("span",null,b(i.value.stats.total_documents)+" documents",1),e("span",null,b(i.value.stats.total_references)+" references",1),i.value.stats.orphaned_documents>0?(s(),a("span",Ge,b(i.value.stats.orphaned_documents)+" orphaned ",1)):R("",!0)])):R("",!0),e("div",{ref_key:"containerRef",ref:g,class:"graph-view__canvas"},[P.value?(s(),a("div",Ae,[...v[3]||(v[3]=[e("div",{class:"graph-view__spinner"},null,-1),w(" Loading graph... ",-1)])])):$.value?(s(),a("div",Oe,b($.value),1)):i.value&&n.value.size>0?(s(),a("svg",{key:2,ref_key:"svgRef",ref:M,width:k.value,height:c.value,class:"graph-view__svg"},[e("g",We,[(s(!0),a(ee,null,te(i.value.edges,_=>(s(),a("path",{key:`${_.source}-${_.target}`,d:T(_.source,_.target),class:"graph-view__edge"},null,8,Xe))),128))]),e("g",Ye,[(s(!0),a(ee,null,te(n.value,([_,x])=>(s(),a("g",{key:_,class:"graph-view__node",transform:`translate(${x.x}, ${x.y})`,onClick:z=>K(_)},[v[4]||(v[4]=e("circle",{r:"24",class:"graph-view__node-circle"},null,-1)),v[5]||(v[5]=e("text",{class:"graph-view__node-icon","text-anchor":"middle","dominant-baseline":"central",dy:"0.05em"},"📄",-1)),e("title",null,b(x.title),1)],8,Je))),128))])],8,qe)):i.value&&i.value.nodes.length===0?(s(),a("div",Ze," No documents in this project yet. ")):R("",!0)],512),v[6]||(v[6]=e("div",{class:"graph-view__legend"},[e("span",null,"Click a node to open the document")],-1))]))}}),Qe=re(Ke,[["__scopeId","data-v-fc6c0833"]]),et={class:"layout"},tt={class:"layout__body"},ot={class:"layout__content"},nt={key:0,class:"loading"},lt={key:1,class:"error"},st={key:2,class:"project"},rt={class:"project__welcome"},at={class:"project__title-row"},it={class:"project__title"},dt={key:0,class:"project__desc"},ut={class:"project__actions"},ct={class:"form__field"},vt={class:"form__field"},pt={class:"form__field"},ft={class:"folder-picker"},ht={key:0,class:"folder-picker__dropdown"},_t=["onClick"],mt={class:"form__field"},wt={class:"form__field"},gt={class:"form__field"},yt={class:"export-formats"},kt=se({__name:"ProjectView",setup(Y){const I=_e(),N=de(),o=ue(),i=ge(),P=u(!1),$=u(!1),h=u(""),n=u(""),k=u(null),c=u(!1),M=u(!1),g=u(""),L=u(""),J=u(!1),G=u(!1),A=u(!1),T=u("zip"),K=u(!1),B=u(!1),y=u(null),m=u(new Set);ve(async()=>{const r=I.params.id;await o.fetchProject(r)}),ie(()=>I.params.id,async r=>{r&&await o.fetchProject(r)});function v(r){N.push(`/documents/${r}`)}function _(){k.value=null,P.value=!0}function x(){k.value=null,$.value=!0,y.value=null,B.value=!1}async function z(){if(!(!h.value.trim()||!o.currentProject)){c.value=!0;try{await o.createFolder(o.currentProject.id,h.value.trim(),k.value),P.value=!1,h.value=""}catch(r){console.error("Failed to create folder:",r)}finally{c.value=!1}}}async function O(){if(!(!n.value.trim()||!o.currentProject)){c.value=!0;try{const r=await i.createDocument(o.currentProject.id,n.value.trim(),"",y.value);$.value=!1,n.value="",y.value=null,B.value=!1,await o.fetchProjectTree(o.currentProject.id),v(r.id)}catch(r){console.error("Failed to create document:",r)}finally{c.value=!1}}}function Z(){o.currentProject&&(g.value=o.currentProject.name,L.value=o.currentProject.description||"",M.value=!0)}async function oe(){if(!(!o.currentProject||!g.value.trim())){J.value=!0;try{await o.patchProject(o.currentProject.id,{name:g.value.trim(),description:L.value.trim()||void 0}),M.value=!1}catch(r){console.error("Failed to update project:",r)}finally{J.value=!1}}}const d=we(()=>F(o.treeNodes));function F(r,t=0){const l=[];for(const U of r)U.type==="folder"&&(l.push({id:U.id,name:U.name,depth:t}),U.children&&l.push(...F(U.children,t+1)));return l}function V(){if(B.value=!B.value,B.value){const r=o.folders.map(t=>t.id);m.value=new Set(r)}}function S(r){y.value=y.value===r?null:r}function D(){y.value=null}function E(){if(!y.value)return"Root (no folder)";const r=o.folders.find(t=>t.id===y.value);return r?r.name:"Root (no folder)"}function H(){G.value=!0}function q(){A.value=!0}async function W(){if(o.currentProject){K.value=!0;try{const r=await o.exportProject(o.currentProject.id,T.value),t=URL.createObjectURL(r),l=document.createElement("a"),U=o.currentProject.name.replace(/[^a-z0-9]/gi,"_");l.href=t,l.download=`${U}.${T.value}`,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(t),A.value=!1}catch(r){console.error("Export failed:",r)}finally{K.value=!1}}}return(r,t)=>(s(),a("div",et,[f(ye),e("div",tt,[f(He,{onCreateFolder:_,onCreateDocument:x}),e("main",ot,[C(o).loading?(s(),a("div",nt,[...t[17]||(t[17]=[e("div",{class:"loading__spinner"},null,-1),e("p",null,"Loading project...",-1)])])):C(o).error?(s(),a("div",lt,[e("p",null,b(C(o).error),1),f(j,{variant:"secondary",onClick:t[0]||(t[0]=l=>C(N).push("/dashboard"))},{default:p(()=>[...t[18]||(t[18]=[w(" Back to Dashboard ",-1)])]),_:1})])):C(o).currentProject?(s(),a("div",st,[e("div",rt,[e("div",at,[e("h1",it,b(C(o).currentProject.name),1),e("button",{class:"edit-icon-btn",title:"Edit project",onClick:Z},[...t[19]||(t[19]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])])]),C(o).currentProject.description?(s(),a("p",dt,b(C(o).currentProject.description),1)):R("",!0),t[22]||(t[22]=e("p",{class:"project__hint"}," Select a document from the sidebar or create a new one to get started. ",-1)),e("div",ut,[f(j,{variant:"secondary",onClick:H},{default:p(()=>[...t[20]||(t[20]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("circle",{cx:"18",cy:"5",r:"3"}),e("circle",{cx:"6",cy:"12",r:"3"}),e("circle",{cx:"18",cy:"19",r:"3"}),e("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),e("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})],-1),w(" View Graph ",-1)])]),_:1}),f(j,{variant:"secondary",onClick:q},{default:p(()=>[...t[21]||(t[21]=[e("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),e("polyline",{points:"7 10 12 15 17 10"}),e("line",{x1:"12",y1:"15",x2:"12",y2:"3"})],-1),w(" Export ",-1)])]),_:1})])])])):R("",!0)])]),f(Q,{show:P.value,title:"Create New Folder",onClose:t[3]||(t[3]=l=>P.value=!1)},{footer:p(()=>[f(j,{variant:"secondary",onClick:t[2]||(t[2]=l=>P.value=!1)},{default:p(()=>[...t[24]||(t[24]=[w("Cancel",-1)])]),_:1}),f(j,{variant:"primary",loading:c.value,onClick:z},{default:p(()=>[...t[25]||(t[25]=[w("Create Folder",-1)])]),_:1},8,["loading"])]),default:p(()=>[e("form",{onSubmit:ae(z,["prevent"])},[e("div",ct,[t[23]||(t[23]=e("label",{for:"folder-name",class:"form__label"},"Folder Name",-1)),ne(e("input",{id:"folder-name","onUpdate:modelValue":t[1]||(t[1]=l=>h.value=l),type:"text",class:"form__input",placeholder:"My Folder",autofocus:""},null,512),[[le,h.value]])])],32)]),_:1},8,["show"]),f(Q,{show:$.value,title:"Create New Document",onClose:t[6]||(t[6]=l=>$.value=!1)},{footer:p(()=>[f(j,{variant:"secondary",onClick:t[5]||(t[5]=l=>$.value=!1)},{default:p(()=>[...t[32]||(t[32]=[w("Cancel",-1)])]),_:1}),f(j,{variant:"primary",loading:c.value,onClick:O},{default:p(()=>[...t[33]||(t[33]=[w("Create Document",-1)])]),_:1},8,["loading"])]),default:p(()=>[e("form",{onSubmit:ae(O,["prevent"])},[e("div",vt,[t[26]||(t[26]=e("label",{for:"doc-name",class:"form__label"},"Document Title",-1)),ne(e("input",{id:"doc-name","onUpdate:modelValue":t[4]||(t[4]=l=>n.value=l),type:"text",class:"form__input",placeholder:"Untitled Document",autofocus:""},null,512),[[le,n.value]])]),e("div",pt,[t[31]||(t[31]=e("label",{class:"form__label"},"Folder (optional)",-1)),e("div",ft,[e("button",{type:"button",class:"folder-picker__trigger",onClick:V},[t[28]||(t[28]=e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})],-1)),e("span",null,b(E()),1),(s(),a("svg",{class:X(["folder-picker__chevron",{"folder-picker__chevron--open":B.value}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...t[27]||(t[27]=[e("path",{d:"m6 9 6 6 6-6"},null,-1)])],2))]),B.value?(s(),a("div",ht,[e("button",{type:"button",class:X(["folder-picker__option",{"folder-picker__option--selected":!y.value}]),onClick:D},[...t[29]||(t[29]=[e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"})],-1),w(" Root (no folder) ",-1)])],2),(s(!0),a(ee,null,te(d.value,l=>(s(),a("button",{key:l.id,type:"button",class:X(["folder-picker__option",{"folder-picker__option--selected":y.value===l.id}]),style:me({paddingLeft:`${.75+l.depth*1}rem`}),onClick:U=>S(l.id)},[t[30]||(t[30]=e("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})],-1)),w(" "+b(l.name),1)],14,_t))),128))])):R("",!0)])])],32)]),_:1},8,["show"]),f(Q,{show:M.value,title:"Edit Project",onClose:t[10]||(t[10]=l=>M.value=!1)},{footer:p(()=>[f(j,{variant:"secondary",onClick:t[9]||(t[9]=l=>M.value=!1)},{default:p(()=>[...t[36]||(t[36]=[w("Cancel",-1)])]),_:1}),f(j,{variant:"primary",loading:J.value,onClick:oe},{default:p(()=>[...t[37]||(t[37]=[w("Save",-1)])]),_:1},8,["loading"])]),default:p(()=>[e("form",{onSubmit:ae(oe,["prevent"])},[e("div",mt,[t[34]||(t[34]=e("label",{for:"edit-proj-name",class:"form__label"},"Project Name",-1)),ne(e("input",{id:"edit-proj-name","onUpdate:modelValue":t[7]||(t[7]=l=>g.value=l),type:"text",class:"form__input",placeholder:"Project name",autofocus:""},null,512),[[le,g.value]])]),e("div",wt,[t[35]||(t[35]=e("label",{for:"edit-proj-desc",class:"form__label"},"Description",-1)),ne(e("textarea",{id:"edit-proj-desc","onUpdate:modelValue":t[8]||(t[8]=l=>L.value=l),class:"form__input form__textarea",placeholder:"Add a description...",rows:"3"},null,512),[[le,L.value]])])],32)]),_:1},8,["show"]),f(Q,{show:G.value,title:"",size:"lg",onClose:t[12]||(t[12]=l=>G.value=!1)},{default:p(()=>[C(o).currentProject?(s(),ce(Qe,{key:0,"project-id":C(o).currentProject.id,onClose:t[11]||(t[11]=l=>G.value=!1)},null,8,["project-id"])):R("",!0)]),_:1},8,["show"]),f(Q,{show:A.value,title:"Export Project",onClose:t[16]||(t[16]=l=>A.value=!1)},{footer:p(()=>[f(j,{variant:"secondary",onClick:t[15]||(t[15]=l=>A.value=!1)},{default:p(()=>[...t[41]||(t[41]=[w("Cancel",-1)])]),_:1}),f(j,{variant:"primary",loading:K.value,onClick:W},{default:p(()=>[...t[42]||(t[42]=[w("Download",-1)])]),_:1},8,["loading"])]),default:p(()=>[e("div",gt,[t[40]||(t[40]=e("label",{class:"form__label"},"Format",-1)),e("div",yt,[e("button",{class:X(["export-format",{"export-format--selected":T.value==="zip"}]),onClick:t[13]||(t[13]=l=>T.value="zip")},[...t[38]||(t[38]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})],-1),e("span",null,"ZIP Archive",-1),e("small",null,"Documents as .md files",-1)])],2),e("button",{class:X(["export-format",{"export-format--selected":T.value==="json"}]),onClick:t[14]||(t[14]=l=>T.value="json")},[...t[39]||(t[39]=[e("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e("polyline",{points:"14 2 14 8 20 8"}),e("path",{d:"M8 13h2"}),e("path",{d:"M8 17h2"}),e("path",{d:"M14 13h2"}),e("path",{d:"M14 17h2"})],-1),e("span",null,"JSON",-1),e("small",null,"Full project with metadata",-1)])],2)])])]),_:1},8,["show"])]))}}),Pt=re(kt,[["__scopeId","data-v-2a45f457"]]);export{Pt as default};
|