mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 00:27:49 -04:00
11 lines
7.6 KiB
JavaScript
11 lines
7.6 KiB
JavaScript
import{a as x}from"./index-C1xmmKTZ-XKFVqjxi.chunk.mjs";import{t as y}from"./translation-DoG5ZELJ-8aobdbPK.chunk.mjs";import{v as M}from"./NcAvatar-ruClKRzS-B7xYQpkD.chunk.mjs";import{N}from"./ArrowRight-YxbwZNEK.chunk.mjs";import{N as S}from"./NcEmptyContent-CDgWCt_m-SjrDEqRZ.chunk.mjs";import{_ as f}from"./public-CvthP4YJ.chunk.mjs";import{f as r,g as I,t as p,h as d,m as h,o as s,K as z,k as c,H as C,c as _,w as g,I as O,F,ae as L,r as m,j as $,b as B,D as q}from"./preload-helper-D9xEqq8S.chunk.mjs";import{C as P,a as b}from"./CommentView-i-vD_4je.chunk.mjs";import{l as v}from"./activity-DdSAHrqw.chunk.mjs";import{c as j,g as U,D as w}from"./GetComments-CLT9798q.chunk.mjs";const E={name:"AlertCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Z=["aria-hidden","aria-label"],K=["fill","width","height"],G={d:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z"},J={key:0};function Q(t,o,e,a,i,n){return s(),r("span",h(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon alert-circle-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>t.$emit("click",l))}),[(s(),r("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[I("path",G,[e.title?(s(),r("title",J,p(e.title),1)):d("",!0)])],8,K))],16,Z)}const W=f(E,[["render",Q]]),X={name:"MessageReplyTextOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},Y=["aria-hidden","aria-label"],ee=["fill","width","height"],te={d:"M9 11H18V13H9V11M18 7H6V9H18V7M22 4V22L18 18H4C2.9 18 2 17.11 2 16V4C2 2.9 2.9 2 4 2H20C21.1 2 22 2.89 22 4M20 4H4V16H18.83L20 17.17V4Z"},oe={key:0};function se(t,o,e,a,i,n){return s(),r("span",h(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon message-reply-text-outline-icon",role:"img",onClick:o[0]||(o[0]=l=>t.$emit("click",l))}),[(s(),r("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[I("path",te,[e.title?(s(),r("title",oe,p(e.title),1)):d("",!0)])],8,ee))],16,Y)}const re=f(X,[["render",se]]),ie={name:"RefreshIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ne=["aria-hidden","aria-label"],ae=["fill","width","height"],le={d:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z"},ce={key:0};function me(t,o,e,a,i,n){return s(),r("span",h(t.$attrs,{"aria-hidden":e.title?null:"true","aria-label":e.title,class:"material-design-icon refresh-icon",role:"img",onClick:o[0]||(o[0]=l=>t.$emit("click",l))}),[(s(),r("svg",{fill:e.fillColor,class:"material-design-icon__svg",width:e.size,height:e.size,viewBox:"0 0 24 24"},[I("path",le,[e.title?(s(),r("title",ce,p(e.title),1)):d("",!0)])],8,ae))],16,ne)}const de=f(ie,[["render",me]]);function ue(t,o,e){const a=["",t,o].join("/"),i=e.toUTCString();return j.customRequest(a,{method:"PROPPATCH",data:`<?xml version="1.0"?>
|
|
<d:propertyupdate
|
|
xmlns:d="DAV:"
|
|
xmlns:oc="http://owncloud.org/ns">
|
|
<d:set>
|
|
<d:prop>
|
|
<oc:readMarker>${i}</oc:readMarker>
|
|
</d:prop>
|
|
</d:set>
|
|
</d:propertyupdate>`})}function pe(t){const o=new AbortController,e=o.signal;return{request:async function(a,i){return await t(a,{signal:e,...i})},abort:()=>o.abort()}}const he={name:"CommentsApp",components:{Comment:b,NcEmptyContent:S,NcButton:N,IconRefresh:de,IconMessageReplyTextOutline:re,IconAlertCircleOutline:W},directives:{elementVisibility:M},mixins:[P],expose:["update"],data(){return{error:"",loading:!1,done:!1,offset:0,comments:[],cancelRequest:()=>{},Comment:b,userData:{}}},computed:{hasComments(){return this.comments.length>0},isFirstLoading(){return this.loading&&this.offset===0}},watch:{resourceId(){this.currentResourceId=this.resourceId}},methods:{t:y,async onVisibilityChange(t){if(t)try{await ue(this.resourceType,this.currentResourceId,new Date)}catch(o){x(o.message||y("comments","Failed to mark comments as read"))}},async update(t){this.currentResourceId=t,this.resetState(),await this.getComments()},onScrollBottomReached(){this.error||this.done||this.loading||this.getComments()},async getComments(){this.cancelRequest("cancel");try{this.loading=!0,this.error="";const{request:t,abort:o}=pe(U);this.cancelRequest=o;const{data:e}=await t({resourceType:this.resourceType,resourceId:this.currentResourceId},{offset:this.offset})||{data:[]};this.logger.debug(`Processed ${e.length} comments`,{comments:e}),e.length<w&&(this.done=!0);for(const a of e)a.props.actorId=a.props.actorId.toString();this.comments=[...this.comments,...e],this.offset+=w}catch(t){if(t.message==="cancel")return;this.error=y("comments","Unable to load the comments list"),v.error("Error loading the comments list",{error:t})}finally{this.loading=!1}},onNewComment(t){this.comments.unshift(t)},onDelete(t){const o=this.comments.findIndex(e=>e.props.id===t);o>-1?this.comments.splice(o,1):v.error("Could not find the deleted comment in the list",{id:t})},resetState(){this.error="",this.loading=!1,this.done=!1,this.offset=0,this.comments=[]}}},ge={key:1},fe={key:2,class:"comments__info icon-loading"},ye={key:3,class:"comments__info"};function Ce(t,o,e,a,i,n){const l=m("Comment"),V=m("IconMessageReplyTextOutline"),k=m("NcEmptyContent"),R=m("IconAlertCircleOutline"),A=m("IconRefresh"),T=m("NcButton"),D=L("element-visibility");return z((s(),r("div",{class:F(["comments",{"icon-loading":n.isFirstLoading}])},[c(l,h(t.editorData,{editor:"",autoComplete:t.autoComplete,resourceType:t.resourceType,userData:i.userData,resourceId:t.currentResourceId,class:"comments__writer",onNew:n.onNewComment}),null,16,["autoComplete","resourceType","userData","resourceId","onNew"]),n.isFirstLoading?d("",!0):(s(),r(C,{key:0},[!n.hasComments&&i.done?(s(),_(k,{key:0,class:"comments__empty",name:n.t("comments","No comments yet, start the conversation!")},{icon:g(()=>[c(V)]),_:1},8,["name"])):(s(),r("ul",ge,[(s(!0),r(C,null,O(i.comments,u=>(s(),_(l,h({key:u.props.id,modelValue:u.props.message,"onUpdate:modelValue":H=>u.props.message=H,tag:"li"},{ref_for:!0},u.props,{autoComplete:t.autoComplete,resourceType:t.resourceType,resourceId:t.currentResourceId,userData:t.genMentionsData(u.props.mentions),class:"comments__list",onDelete:n.onDelete}),null,16,["modelValue","onUpdate:modelValue","autoComplete","resourceType","resourceId","userData","onDelete"]))),128))])),i.loading&&!n.isFirstLoading?(s(),r("div",fe)):n.hasComments&&i.done?(s(),r("div",ye,p(n.t("comments","No more messages")),1)):i.error?(s(),r(C,{key:4},[c(k,{class:"comments__error",name:i.error},{icon:g(()=>[c(R)]),_:1},8,["name"]),c(T,{class:"comments__retry",onClick:n.getComments},{icon:g(()=>[c(A)]),default:g(()=>[$(" "+p(n.t("comments","Retry")),1)]),_:1},8,["onClick"])],64)):d("",!0)],64))],2)),[[D,n.onVisibilityChange]])}const _e=f(he,[["render",Ce],["__scopeId","data-v-2295a278"]]),Ie=B({__name:"FilesSidebarTab",props:{node:{},active:{type:Boolean},folder:{},view:{}},setup(t){const o=t,e=q(()=>o.node?.fileid);return(a,i)=>e.value!==void 0?(s(),_(_e,{key:e.value,resourceId:e.value,resourceType:"files"},null,8,["resourceId"])):d("",!0)}}),xe=Object.freeze(Object.defineProperty({__proto__:null,default:Ie},Symbol.toStringTag,{value:"Module"}));export{_e as C,xe as F};
|
|
//# sourceMappingURL=FilesSidebarTab-Ba3R5IDp.chunk.mjs.map
|