4 lines
5.2 KiB
JavaScript
4 lines
5.2 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/PublicFilesEditor-BaJBDLUk.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CRQM6PVi.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-MDCGxHB0.chunk.mjs'),window.OC.filePath('text', '', 'js/NcNoteCard-Dz5-u2BY-S2qe9Sjm.chunk.mjs'),window.OC.filePath('text', '', 'js/index-Dl858C8_.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-CLeelJur.chunk.mjs'),window.OC.filePath('text', '', 'js/NcLoadingIcon-ZJnsd-es.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DxwFe63_.chunk.mjs'),window.OC.filePath('text', '', 'css/NcLoadingIcon-CAC0K4sG.chunk.css'),window.OC.filePath('text', '', 'css/NcNoteCard-Dz5-u2BY-DSc672TB.chunk.css'),window.OC.filePath('text', '', 'js/_plugin-vue2_normalizer-wd1ZAbRr.chunk.mjs'),window.OC.filePath('text', '', 'js/RichWorkspace-DJbyRXWV.chunk.mjs'),window.OC.filePath('text', '', 'js/Editor.singleton-BX-M5W3F.chunk.mjs'),window.OC.filePath('text', '', 'js/RichTextReader-CRQfFvOS.chunk.mjs'),window.OC.filePath('text', '', 'js/EditorOutline-DrybdBHq.chunk.mjs'),window.OC.filePath('text', '', 'js/logger-CoS2pszN.chunk.mjs'),window.OC.filePath('text', '', 'js/NcCheckboxRadioSwitch-DAPHFb0L-BMVa4UgQ.chunk.mjs'),window.OC.filePath('text', '', 'css/NcCheckboxRadioSwitch-DAPHFb0L-35V8jJy1.chunk.css'),window.OC.filePath('text', '', 'js/MediaHandler.provider-CTjO6aKX.chunk.mjs'),window.OC.filePath('text', '', 'css/EditorOutline-CpwrhjT9.chunk.css'),window.OC.filePath('text', '', 'js/BaseReader-CEyXn00Z.chunk.mjs'),window.OC.filePath('text', '', 'css/BaseReader-DLKIg9lj.chunk.css'),window.OC.filePath('text', '', 'css/RichTextReader-CMPQ_96l.chunk.css'),window.OC.filePath('text', '', 'css/RichWorkspace-DF75DIQU.chunk.css')])))=>i.map(i=>d[i]);
|
|
import{_ as u,a as f,e as h}from"./index-CRQM6PVi.chunk.mjs";import{t as l,c as v}from"./NcLoadingIcon-ZJnsd-es.chunk.mjs";import{g as R,s as A,a as F}from"./NcNoteCard-Dz5-u2BY-S2qe9Sjm.chunk.mjs";import{V as g}from"./vue.runtime.esm-CLeelJur.chunk.mjs";import{H as y,a as O,N as C}from"./index-BsHmGXxZ.chunk.mjs";import{l as D}from"./index-Dl858C8_.chunk.mjs";import{i as H}from"./index-DxwFe63_.chunk.mjs";import{b as p}from"./mime-DDg3sTIz.chunk.mjs";import{F as T,P as w}from"./dav-CQDyL7M_-DQpu_A9F.chunk.mjs";import"./emoji-picker-MDCGxHB0.chunk.mjs";const P='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-text" viewBox="0 0 24 24"><path d="M21,6V8H3V6H21M3,18H12V16H3V18M3,13H21V11H3V13Z" /></svg>',_="Edit with text app",B=()=>{const e=R(),t=document.querySelector("#preview table.files-filestable");if(!e||!t){const i=document.createElement("div");i.id="text-viewer-fallback",document.body.appendChild(i);const s=r=>OCA.Files.fileActions.register(r,_,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,H("core","actions/rename"),n=>{const c=window.FileList.findFile(n);Promise.all([u(()=>import("./vue.runtime.esm-CLeelJur.chunk.mjs").then(a=>a.z),[],import.meta.url),u(()=>import("./PublicFilesEditor-BaJBDLUk.chunk.mjs"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url)]).then(a=>{const b=window.FileList.getCurrentDirectory()+"/"+n,x=a[0].default,E=a[1].default;new x({render:I=>I(E,{props:{fileId:c?c.id:null,active:!0,shareToken:e,relativePath:b,mimeType:c.mimetype},on:{close:()=>{(void 0).$destroy()}}})}).$mount(i)})},l("text","Edit"));for(let r=0;r<p.length;r++)s(p[r]),OCA.Files.fileActions.setDefault(p[r],_)}},Z=()=>{const e=l("text","Readme")+"."+D("text","default_file_extension");O({id:"rich-workspace-init",displayName:l("text","Add folder description"),category:C.Other,enabled(t){return!window?.OCA?.Text?.RichWorkspaceEnabled||Number(t.attributes["rich-workspace-file"])?!1:(t.permissions&w.CREATE)!==0},iconSvgInline:P,async handler(t,i){if(i.map(a=>a.basename).includes(e)){A(l("text",'"{name}" already exist!',{name:e}));return}const s=t.encodedSource+"/"+encodeURIComponent(e),r=await v({method:"PUT",url:s,headers:{Overwrite:"F"}}),n=parseInt(r.headers["oc-fileid"]),c=new T({source:t.source+"/"+e,id:n,mtime:new Date,mime:"text/markdown",owner:f()?.uid||null,permissions:w.ALL,root:t?.root||"/files/"+f()?.uid});F(l("text",'Created "{name}"',{name:e})),t.attributes["rich-workspace-file"]=n,t.attributes["rich-workspace"]="",h("files:node:created",c),h("files:node:updated",t)}})};let m,o,d;const k=(e,t)=>["files","favorites","public-share"].includes(t.id),j=new y({id:"workspace",order:10,enabled:k,render:async(e,t)=>{d=t,m||(m=(await u(()=>import("./RichWorkspace-DJbyRXWV.chunk.mjs"),__vite__mapDeps([11,6,2,1,5,7,8,4,3,9,12,13,14,15,16,17,10,18,19,20,21,22,23]),import.meta.url)).default),o&&(o.$destroy(),console.debug("Destroying existing FilesHeaderRichWorkspaceInstance"));const i=!!d.attributes["rich-workspace-file"],s=d.attributes["rich-workspace"]||"",r=d.path||"";o=new g({extends:m,propsData:{content:s,hasRichWorkspace:i,path:r}}).$mount(e),window.FilesHeaderRichWorkspaceInstance=o},updated(e,t){if(d=e,!o){console.error("No vue instance found for FilesWorkspaceHeader");return}const i=!!e.attributes["rich-workspace-file"]&&k(e,t);o.hasRichWorkspace=i,o.content=e.attributes["rich-workspace"]||"",o.path=e.path||""}});export{_ as FILE_ACTION_IDENTIFIER,j as FilesWorkspaceHeader,Z as addMenuRichWorkspace,B as registerFileActionFallback};
|
|
//# sourceMappingURL=files--k339mQ3.chunk.mjs.map
|