mirror of
https://github.com/nextcloud/server.git
synced 2026-06-24 12:24:39 +02:00
230b14978e
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
27 lines
20 KiB
JavaScript
27 lines
20 KiB
JavaScript
import{d as j,a as Y}from"./index-DL1yHC1K-orb-zzee.chunk.mjs";import{a as B,m as te,g as se,b as G,h as oe,j as ne,n as re,f as T}from"./index-C6ey-Mhx.chunk.mjs";import{t as c,b as O}from"./translation-DoG5ZELJ-C5oC8Tcn.chunk.mjs";import{c as ae}from"./NcModal-DUWLRm_F-C0gD58QY.chunk.mjs";import{D as le,N as ce}from"./TrashCanOutline-CW4_EEhq.chunk.mjs";import{f as de}from"./index-Cza7fYcZ.chunk.mjs";import{_ as E,l as ue}from"./public-C1mLBHT3.chunk.mjs";import{N as I,P as ve}from"./PencilOutline-DJX4SP_q.chunk.mjs";import{N as me,_ as pe}from"./NcDateTime.vue_vue_type_script_setup_true_lang-BJuPH7S7-BRczm9CK.chunk.mjs";import{N as fe}from"./NcAvatar-M3-CbKbq-DbNpmr-b.chunk.mjs";import{D as he,N as ge,s as be}from"./TrayArrowDown-BRoulKIv.chunk.mjs";import{o as a,f as m,g as C,t as _,h as y,m as Q,b as P,l as $,c as H,w as h,u as d,j as D,k as S,v as g,G as J,p as ye,H as X,i as M,Q as ee,z as we,F as _e,B as Ce}from"./Web-ByHSuvRG.chunk.mjs";import{P as Z}from"./externalStorageUtils-CpkXDsx2.chunk.mjs";import{N as ke}from"./index-BRuD4Qrz.chunk.mjs";import{_ as Ve}from"./NcTextField.vue_vue_type_script_setup_true_lang-BQHjkK8r-Dv0_ThWG.chunk.mjs";import{c as Se}from"./index-D-iKxf2E.chunk.mjs";import{g as He}from"./dav-sq7XGhQT.chunk.mjs";import{w as ze}from"./index-Bm5HdBcE.chunk.mjs";import"./createElementId-DhjFt1I9-CZ2eH1SD.chunk.mjs";import"./mdi-Ci0zJ0QG.chunk.mjs";import"./logger-D3RVzcfQ-B261d025.chunk.mjs";import"./util-djQ-4xJ5.chunk.mjs";import"./ArrowRight-BgQTbtKu.chunk.mjs";import"./colors-BDeMBgfq-D1xNHBAd.chunk.mjs";import"./NcUserStatusIcon-DsviB2Cr-CJ45dJff.chunk.mjs";import"./NcInputField-B1bGxYHt-DVZQKody.chunk.mjs";import"./index-CI-5vlTq.chunk.mjs";const Le={name:"BackupRestoreIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ae=["aria-hidden","aria-label"],$e=["fill","width","height"],xe={d:"M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z"},Ee={key:0};function De(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon backup-restore-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",xe,[i.title?(a(),m("title",Ee,_(i.title),1)):y("",!0)])],8,$e))],16,Ae)}const Ne=E(Le,[["render",De]]),Te={name:"FileCompareIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ie=["aria-hidden","aria-label"],Me=["fill","width","height"],Be={d:"M10,18H6V16H10V18M10,14H6V12H10V14M10,1V2H6C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H10V23H12V1H10M20,8V20C20,21.11 19.11,22 18,22H14V20H18V11H14V9H18.5L14,4.5V2L20,8M16,14H14V12H16V14M16,18H14V16H16V18Z"},Oe={key:0};function Pe(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon file-compare-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Be,[i.title?(a(),m("title",Oe,_(i.title),1)):y("",!0)])],8,Me))],16,Ie)}const Re=E(Te,[["render",Pe]]),Fe={name:"ImageOffOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Ue=["aria-hidden","aria-label"],qe=["fill","width","height"],Ke={d:"M22 20.7L3.3 2L2 3.3L3 4.3V19C3 20.1 3.9 21 5 21H19.7L20.7 22L22 20.7M5 19V6.3L12.6 13.9L11.1 15.8L9 13.1L6 17H15.7L17.7 19H5M8.8 5L6.8 3H19C20.1 3 21 3.9 21 5V17.2L19 15.2V5H8.8"},We={key:0};function je(e,t,i,n,v,r){return a(),m("span",Q(e.$attrs,{"aria-hidden":i.title?null:"true","aria-label":i.title,class:"material-design-icon image-off-outline-icon",role:"img",onClick:t[0]||(t[0]=l=>e.$emit("click",l))}),[(a(),m("svg",{fill:i.fillColor,class:"material-design-icon__svg",width:i.size,height:i.size,viewBox:"0 0 24 24"},[C("path",Ke,[i.title?(a(),m("title",We,_(i.title),1)):y("",!0)])],8,qe))],16,Ue)}const Ye=E(Fe,[["render",je]]),Ze={key:0,class:"version__image"},Ge=["src"],Je={key:2,class:"version__image"},Qe={class:"version__info"},Xe=["title"],ei={key:1,class:"version__info","data-cy-files-version-author-name":""},ii={key:0},ti=["title"],si={class:"version__info version__info__subline"},oi=P({__name:"VersionEntry",props:{version:{},node:{},isCurrent:{type:Boolean},isFirstVersion:{type:Boolean},loadPreview:{type:Boolean},canView:{type:Boolean},canCompare:{type:Boolean}},emits:["click","compare","restore","delete","labelUpdateRequest"],setup(e,{emit:t}){const i=e,n=t,v=$(!1),r=$(!1),l=$(ue("core","capabilities",{files:{version_labeling:!1,version_deletion:!1}})),k=g(()=>de(i.version.size)),f=g(()=>{const p=i.version.label??"";return i.isCurrent?p===""?c("files_versions","Current version"):`${p} (${c("files_versions","Current version")})`:i.isFirstVersion&&p===""?c("files_versions","Initial version"):p}),w=g(()=>!i.version.author||!i.version.authorName?"":i.version.author===B()?.uid?c("files_versions","You"):i.version.authorName??i.version.author),o=g(()=>new Date(i.version.mtime).toLocaleString([O(),O().split("-")[0]],{timeStyle:"long",dateStyle:"long"})),V=g(()=>i.isCurrent?i.node.source:te()+i.version.url),A=g(()=>l.value.files.version_labeling===!0),z=g(()=>l.value.files.version_deletion===!0),F=g(()=>b(i.node,Z.DELETE)),N=g(()=>b(i.node,Z.UPDATE)),U=g(()=>!((i.node.permissions&Z.READ)===0||i.node.attributes["mount-type"]==="shared"&&i.node.attributes["share-attributes"]&&(JSON.parse(i.node.attributes["share-attributes"]).find(p=>p.scope==="permissions"&&p.key==="download")||{})?.value===!1));function q(){n("labelUpdateRequest")}function K(){n("restore",i.version)}async function W(){await J(),await J(),n("delete",i.version)}function s(p){i.canView&&p.preventDefault(),n("click",i.version)}function u(){if(!i.canView)throw new Error("Cannot compare version of this file");n("compare",i.version)}function b(p,L){return(p.permissions&L)!==0}return(p,L)=>(a(),H(d(ge),{class:"version",forceDisplayActions:!0,"actions-aria-label":d(c)("files_versions","Actions for version from {versionHumanExplicitDate}",{versionHumanExplicitDate:o.value}),"data-files-versions-version":e.version.fileVersion,href:V.value,onClick:s},{icon:h(()=>[e.loadPreview||v.value?e.version.previewUrl&&!r.value?(a(),m("img",{key:1,src:e.version.previewUrl,alt:"",decoding:"async",fetchpriority:"low",loading:"lazy",class:"version__image",onLoad:L[0]||(L[0]=ie=>v.value=!0),onError:L[1]||(L[1]=ie=>r.value=!0)},null,40,Ge)):(a(),m("div",Je,[S(Ye,{size:20})])):(a(),m("div",Ze))]),name:h(()=>[C("div",Qe,[f.value?(a(),m("div",{key:0,class:"version__info__label","data-cy-files-version-label":"",title:f.value},_(f.value),9,Xe)):y("",!0),w.value?(a(),m("div",ei,[f.value?(a(),m("span",ii,"•")):y("",!0),S(d(fe),{class:"avatar",user:e.version.author??void 0,size:20,disableMenu:"",disableTooltip:"",hideStatus:""},null,8,["user"]),C("div",{class:"version__info__author_name",title:w.value},_(w.value),9,ti)])):y("",!0)])]),subname:h(()=>[C("div",si,[S(d(pe),{class:"version__info__date",relativeTime:"short",timestamp:e.version.mtime},null,8,["timestamp"]),L[2]||(L[2]=C("span",null,"•",-1)),C("span",null,_(k.value),1)])]),actions:h(()=>[A.value&&N.value?(a(),H(d(I),{key:0,"data-cy-files-versions-version-action":"label",closeAfterClick:!0,onClick:q},{icon:h(()=>[S(ve,{size:22})]),default:h(()=>[D(" "+_(e.version.label===""?d(c)("files_versions","Name this version"):d(c)("files_versions","Edit version name")),1)]),_:1})):y("",!0),!e.isCurrent&&e.canView&&e.canCompare?(a(),H(d(I),{key:1,"data-cy-files-versions-version-action":"compare",closeAfterClick:!0,onClick:u},{icon:h(()=>[S(Re,{size:22})]),default:h(()=>[D(" "+_(d(c)("files_versions","Compare to current version")),1)]),_:1})):y("",!0),!e.isCurrent&&N.value?(a(),H(d(I),{key:2,"data-cy-files-versions-version-action":"restore",closeAfterClick:!0,onClick:K},{icon:h(()=>[S(Ne,{size:22})]),default:h(()=>[D(" "+_(d(c)("files_versions","Restore version")),1)]),_:1})):y("",!0),U.value?(a(),H(d(me),{key:3,"data-cy-files-versions-version-action":"download",href:V.value,closeAfterClick:!0,download:V.value},{icon:h(()=>[S(he,{size:22})]),default:h(()=>[D(" "+_(d(c)("files_versions","Download version")),1)]),_:1},8,["href","download"])):y("",!0),!e.isCurrent&&z.value&&F.value?(a(),H(d(I),{key:4,"data-cy-files-versions-version-action":"delete",closeAfterClick:!0,onClick:W},{icon:h(()=>[S(le,{size:22})]),default:h(()=>[D(" "+_(d(c)("files_versions","Delete version")),1)]),_:1})):y("",!0)]),_:1},8,["actions-aria-label","data-files-versions-version","href"]))}}),ni=E(oi,[["__scopeId","data-v-037e7d96"]]),ri={class:"version-label-modal__info"},ai=P({__name:"VersionLabelDialog",props:{open:{type:Boolean,default:!1},label:{type:String,default:""}},emits:["update:open","update:label"],setup(e,{emit:t}){const i=e,n=t,v=ye("labelInput"),r=$(""),l=g(()=>{const f=[];return i.label.trim()===""?f.push({label:c("files_versions","Cancel")}):f.push({label:c("files_versions","Remove version name"),type:"reset",variant:"error",callback:()=>{k("")}}),[...f,{label:c("files_versions","Save version name"),icon:be,type:"submit",variant:"primary"}]});X(()=>{r.value=i.label??""}),X(()=>{i.open&&J(()=>v.value?.focus()),r.value=i.label});function k(f){n("update:label",f)}return(f,w)=>(a(),H(d(ke),{buttons:l.value,contentClasses:"version-label-modal",isForm:"",open:e.open,size:"normal",name:d(c)("files_versions","Name this version"),"onUpdate:open":w[1]||(w[1]=o=>f.$emit("update:open",o)),onSubmit:w[2]||(w[2]=o=>k(r.value))},{default:h(()=>[S(d(Ve),{ref_key:"labelInput",ref:v,modelValue:r.value,"onUpdate:modelValue":w[0]||(w[0]=o=>r.value=o),class:"version-label-modal__input",label:d(c)("files_versions","Version name"),placeholder:d(c)("files_versions","Version name")},null,8,["modelValue","label","placeholder"]),C("p",ri,_(d(c)("files_versions","Named versions are persisted, and excluded from automatic cleanups when your storage quota is full.")),1)]),_:1},8,["buttons","open","name"]))}}),li=E(ai,[["__scopeId","data-v-0955585b"]]),x=se().setApp("files_version").detectUser().build(),ci=P({name:"VirtualScrolling",props:{sections:{type:Array,required:!0},containerElement:{type:HTMLElement,default:null},useWindow:{type:Boolean,default:!1},headerHeight:{type:Number,default:75},renderDistance:{type:Number,default:.5},bottomBufferRatio:{type:Number,default:2},scrollToKey:{type:String,default:""}},emits:["needContent"],data(){return{scrollPosition:0,containerHeight:0,rowsContainerHeight:0,resizeObserver:null}},computed:{visibleSections(){x.debug("[VirtualScrolling] Computing visible section",{sections:this.sections});const e=this.containerHeight,t=this.scrollPosition,i=t+e;let n=0,v=0;const r=this.sections.map(o=>(v+=this.headerHeight,{...o,rows:o.rows.reduce((V,A)=>{n=v,v+=A.height;let z=0;return v<t?z=(t-v)/e:n>i&&(z=(n-i)/e),z>this.renderDistance?V:[...V,{...A,distance:z}]},[])})).filter(o=>o.rows.length>0),l=r.flatMap(({rows:o})=>o).flatMap(({items:o})=>o),k=this._rowIdToKeyMap;l.forEach(o=>o.key=k[o.id]);const f=l.map(({key:o})=>o).filter(o=>o!==void 0),w=Object.values(k).filter(o=>!f.includes(o));return l.filter(({key:o})=>o===void 0).forEach(o=>o.key=w.pop()??Math.random().toString(36).substr(2)),this._rowIdToKeyMap=l.reduce((o,{id:V,key:A})=>({...o,[`${V}`]:A}),{}),r},totalHeight(){return this.sections.map(e=>this.headerHeight+e.height).reduce((e,t)=>e+t,0)+0},paddingTop(){if(this.visibleSections.length===0)return 0;let e=0;for(const t of this.sections){if(t.key!==this.visibleSections[0].rows[0].sectionKey){e+=this.headerHeight+t.height;continue}for(const i of t.rows){if(i.key===this.visibleSections[0].rows[0].key)return e;e+=i.height}e+=this.headerHeight}return e},rowsContainerStyle(){return{height:`${this.totalHeight}px`,paddingTop:`${this.paddingTop}px`}},isNearBottom(){const e=this.containerHeight*this.bottomBufferRatio;return this.scrollPosition+this.containerHeight>=this.totalHeight-e},container(){return x.debug("[VirtualScrolling] Computing container"),this.containerElement!==null?this.containerElement:this.useWindow?window:this.$refs.container}},watch:{isNearBottom(e){x.debug("[VirtualScrolling] isNearBottom changed",{value:e}),e&&this.$emit("needContent")},visibleSections(){this.isNearBottom&&this.$emit("needContent")},scrollToKey(e){let t=0;for(const i of this.sections){if(i.key!==e){t+=this.headerHeight+i.height;continue}break}x.debug("[VirtualScrolling] Scrolling to",{currentRowTopDistanceFromTop:t}),this.container.scrollTo({top:t,behavior:"smooth"})}},beforeCreate(){this._rowIdToKeyMap={}},mounted(){this.resizeObserver=new ResizeObserver(e=>{for(const t of e){const i=t.contentRect;t.target===this.container&&(this.containerHeight=i.height),t.target.classList.contains("vs-rows-container")&&(this.rowsContainerHeight=i.height)}}),this.useWindow?(window.addEventListener("resize",this.updateContainerSize,{passive:!0}),this.containerHeight=window.innerHeight):this.resizeObserver.observe(this.container),this.resizeObserver.observe(this.$refs.rowsContainer),this.container.addEventListener("scroll",this.updateScrollPosition,{passive:!0})},beforeUnmount(){this.useWindow&&window.removeEventListener("resize",this.updateContainerSize),this.resizeObserver?.disconnect(),this.container.removeEventListener("scroll",this.updateScrollPosition)},methods:{updateScrollPosition(){this._onScrollHandle??=requestAnimationFrame(()=>{this._onScrollHandle=null,this.useWindow?this.scrollPosition=this.container.scrollY:this.scrollPosition=this.container.scrollTop})},updateContainerSize(){this.containerHeight=window.innerHeight}}}),di={key:0,ref:"container",class:"vs-container"};function ui(e,t,i,n,v,r){return!e.useWindow&&e.containerElement===null?(a(),m("div",di,[C("div",{ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[M(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),M(e.$slots,"loader",{},void 0,!0)],4)],512)):(a(),m("div",{key:1,ref:"rowsContainer",class:"vs-rows-container",style:ee(e.rowsContainerStyle)},[M(e.$slots,"default",{visibleSections:e.visibleSections},void 0,!0),M(e.$slots,"loader",{},void 0,!0)],4))}const vi=E(ci,[["render",ui],["__scopeId","data-v-0a27da21"]]),mi=`<?xml version="1.0"?>
|
|
<d:propfind xmlns:d="DAV:"
|
|
xmlns:oc="http://owncloud.org/ns"
|
|
xmlns:nc="http://nextcloud.org/ns"
|
|
xmlns:ocs="http://open-collaboration-services.org/ns">
|
|
<d:prop>
|
|
<d:getcontentlength />
|
|
<d:getcontenttype />
|
|
<d:getlastmodified />
|
|
<d:getetag />
|
|
<nc:version-label />
|
|
<nc:version-author />
|
|
<nc:has-preview />
|
|
</d:prop>
|
|
</d:propfind>`,R=He();async function pi(e){const t=`/versions/${B()?.uid}/versions/${e.fileid}`;try{const i=(await R.getDirectoryContents(t,{data:mi,details:!0})).data.filter(({mime:r})=>r!=="").map(r=>hi(r,e)),n=new Set(i.map(r=>String(r.author))),v=await Se.post(G("/displaynames"),{users:[...n]});for(const r of i){const l=v.data.users[r.author??""];l&&(r.authorName=l)}return i}catch(i){throw x.error("Could not fetch version",{exception:i}),i}}async function fi(e){try{x.debug("Restoring version",{url:e.url}),await R.moveFile(`/versions/${B()?.uid}/versions/${e.fileId}/${e.fileVersion}`,`/versions/${B()?.uid}/restore/target`)}catch(t){throw x.error("Could not restore version",{exception:t}),t}}function hi(e,t){const i=Date.parse(e.lastmod);let n;return i===t.mtime?.getTime()?n=G("/core/preview?fileId={fileId}&c={fileEtag}&x=250&y=250&forceIcon=0&a=0&forceIcon=1&mimeFallback=1",{fileId:t.id,fileEtag:t.attributes.etag}):n=G("/apps/files_versions/preview?file={file}&version={fileVersion}&mimeFallback=1",{file:t.path,fileVersion:e.basename}),{fileId:t.id,label:e.props["version-label"]?String(e.props["version-label"]):"",author:e.props["version-author"]?String(e.props["version-author"]):null,authorName:null,filename:e.filename,basename:new Date(i).toLocaleString([O(),O().split("-")[0]],{timeStyle:"long",dateStyle:"medium"}),mime:e.mime,etag:`${e.props.getetag}`,size:e.size,type:e.type,mtime:i,permissions:"R",previewUrl:n,url:re("/remote.php/dav",e.filename),source:oe("dav")+ne(e.filename),fileVersion:e.basename}}async function gi(e,t){return await R.customRequest(e.filename,{method:"PROPPATCH",data:`<?xml version="1.0"?>
|
|
<d:propertyupdate xmlns:d="DAV:"
|
|
xmlns:oc="http://owncloud.org/ns"
|
|
xmlns:nc="http://nextcloud.org/ns"
|
|
xmlns:ocs="http://open-collaboration-services.org/ns">
|
|
<d:set>
|
|
<d:prop>
|
|
<nc:version-label>${t}</nc:version-label>
|
|
</d:prop>
|
|
</d:set>
|
|
</d:propertyupdate>`})}async function bi(e){await R.deleteFile(e.filename)}const yi={key:0,class:"versions-tab__container"},wi=["aria-label"],Yi=P({__name:"FilesVersionsSidebarTab",props:{active:{type:Boolean},node:{},folder:{},view:{}},setup(e){const t=e,i=ae(),n=$([]),v=$(!1),r=$(!1),l=$(null),k=g(()=>t.node?.mtime?.getTime()??0),f=g(()=>[...n.value].sort((s,u)=>t.node?s.mtime===t.node.mtime?.getTime()?-1:u.mtime===t.node.mtime?.getTime()?1:u.mtime-s.mtime:0)),w=g(()=>[{key:"versions",rows:f.value.map(s=>({key:s.mtime.toString(),height:68,sectionKey:"versions",items:[{id:s.mtime.toString(),version:s}]})),height:68*f.value.length}]),o=g(()=>n.value.map(s=>s.mtime).reduce((s,u)=>Math.min(s,u))),V=g(()=>t.node?window.OCA.Viewer?.mimetypes?.includes(t.node?.mime):!1),A=g(()=>!i.value&&window.OCA.Viewer?.mimetypesCompare?.includes(t.node?.mime));we(()=>t.node.id,z,{immediate:!0}),ze(k,z,{debounce:600});async function z(){try{v.value=!0,n.value=await pi(t.node)}finally{v.value=!1}}async function F(s){if(!t.node)return;const u=t.node.clone();u.attributes.etag=s.etag,u.size=s.size,u.mtime=new Date(s.mtime);const b={preventDefault:!1,node:u,version:s};if(T("files_versions:restore:requested",b),!b.preventDefault)try{await fi(s),s.label?j(c("files_versions",`${s.label} restored`)):s.mtime===o.value?j(c("files_versions","Initial version restored")):j(c("files_versions","Version restored")),T("files:node:updated",u),T("files_versions:restore:restored",{node:u,version:s})}catch{Y(c("files_versions","Could not restore version")),T("files_versions:restore:failed",s)}}function N(s){r.value=!0,l.value=s}async function U(s){if(l.value===null)throw new Error("editedVersion should be set at that point");const u=l.value.label;l.value.label=s,r.value=!1;try{await gi(l.value,s),l.value=null}catch(b){l.value.label=u,Y(c("files_versions","Could not set version label")),x.error("Could not set version label",{exception:b})}}async function q(s){const u=n.value.indexOf(s);n.value.splice(u,1);try{await bi(s)}catch{n.value.push(s),Y(c("files_versions","Could not delete version"))}}function K(s){if(t.node!==null){if(s.mtime===t.node?.mtime?.getTime()){window.OCA.Viewer.open({path:t.node.path});return}window.OCA.Viewer.open({fileInfo:{...s,filename:s.filename,previewUrl:void 0},enableSidebar:!1})}}function W(s){const u=n.value.map(b=>({...b,previewUrl:void 0}));window.OCA.Viewer.compare({path:t.node.path},u.find(b=>b.source===s.source))}return(s,u)=>e.node?(a(),m("div",yi,[S(vi,{sections:w.value,headerHeight:0},{default:h(({visibleSections:b})=>[C("ul",{"aria-label":d(c)("files_versions","File versions"),"data-files-versions-versions-list":""},[b.length===1?(a(!0),m(_e,{key:0},Ce(b[0].rows,p=>(a(),H(ni,{key:p.items[0].version.mtime,canView:V.value,canCompare:A.value,loadPreview:e.active,version:p.items[0].version,node:e.node,isCurrent:p.items[0].version.mtime===k.value,isFirstVersion:p.items[0].version.mtime===o.value,onClick:K,onCompare:W,onRestore:F,onLabelUpdateRequest:L=>N(p.items[0].version),onDelete:q},null,8,["canView","canCompare","loadPreview","version","node","isCurrent","isFirstVersion","onLabelUpdateRequest"]))),128)):y("",!0)],8,wi)]),loader:h(()=>[v.value?(a(),H(d(ce),{key:0,class:"files-list-viewer__loader"})):y("",!0)]),_:1},8,["sections"]),l.value?(a(),H(li,{key:0,open:r.value,"onUpdate:open":u[0]||(u[0]=b=>r.value=b),label:l.value.label,"onUpdate:label":U},null,8,["open","label"])):y("",!0)])):y("",!0)}});export{Yi as default};
|
|
//# sourceMappingURL=FilesVersionsSidebarTab-bDqp5mDM.chunk.mjs.map
|