3 lines
5.3 KiB
JavaScript
3 lines
5.3 KiB
JavaScript
/*! For license information please see src_helpers_files_js.js.LICENSE.txt */
|
|
"use strict";(self.webpackChunk_nextcloud_text=self.webpackChunk_nextcloud_text||[]).push([["src_helpers_files_js"],{94091:(e,n,o)=>{o.d(n,{Lz:()=>p,registerFileActionFallback:()=>u});o(69183);var s=o(5656),i=o(79753),a=o(42397),c=o(74411),r=o(25030),l=(o(77958),o(64024),o(47845),o(43935));o(19611);const d="Edit with text app",p=function(t,e){const n=t.split("/"),o=e.split("/");for(n.pop();n[0]===o[0];)if(n.shift(),o.shift(),0===n.length&&0===o.length)return".";const s=n.fill("..").concat(o),i=e.split("/");return s.length<i.length?s.join("/"):e},u=()=>{const e=(0,a.a)(),n=document.querySelector("#preview table.files-filestable");if(!e||!n){const n=document.createElement("div");n.id="text-viewer-fallback",document.body.appendChild(n);const s=s=>OCA.Files.fileActions.register(s,d,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,(0,i.hp)("core","actions/rename"),(t=>{const s=window.FileList.findFile(t);Promise.all([Promise.resolve().then(o.bind(o,20144)),Promise.all([o.e("vendors-node_modules_nextcloud_vue_dist_index_mjs"),o.e("files-modal")]).then(o.bind(o,21698))]).then((o=>{const i=window.FileList.getCurrentDirectory()+"/"+t,a=o[0].default;a.prototype.t=window.t,a.prototype.n=window.n,a.prototype.OCA=window.OCA;const c=o[1].default;new a({render:function(t){const n=this;return t(c,{props:{fileId:s?s.id:null,active:!0,shareToken:e,relativePath:i,mimeType:s.mimetype},on:{close:function(){n.$destroy()}}})}}).$mount(n)}))}),t("text","Edit"));for(let t=0;t<c.SP.length;t++)s(c.SP[t]),OCA.Files.fileActions.setDefault(c.SP[t],d)}};let m=!1;let h=null;new s.h4({id:"workspace",order:10,enabled:(t,e)=>"files"===e.id,async render(t,e,n){h&&(h.$destroy(),h=null);const s=!!e.attributes["rich-workspace-file"]||!!m,i=m?(0,l.dirname)(m.path):e.path,a=m?"":e.attributes["rich-workspace"];m=!1;const{default:c}=await Promise.all([o.e("mermaid"),o.e("vendors-node_modules_nextcloud_vue_dist_index_mjs"),o.e("vendors-node_modules_braintree_sanitize-url_dist_index_js-node_modules_quartzy_markdown-it-me-01b328"),o.e("src_extensions_index_js-src_components_Editor_EditorOutline_vue-data_image_svg_xml_3csvg_20xm-1ac8cb"),o.e("src_views_RichWorkspace_vue-node_modules_nextcloud_vue_dist_chunks_emoji-tllD0Rvt_mjs-node_mo-23061b")]).then(o.bind(o,7444));Promise.resolve().then(o.bind(o,20144)).then((e=>{t.id="files-workspace-wrapper";const n=e.default;n.prototype.t=window.t,n.prototype.n=window.n,n.prototype.OCA=window.OCA;const o=n.extend(c);h=new o({propsData:{path:i,hasRichWorkspace:s,content:a},store:r.default}).$mount(t)}))},updated(t,e){m=!1;const n=!!t.attributes["rich-workspace-file"];h.path=t.path,h.hasRichWorkspace=n,h.content=t.attributes["rich-workspace"]}})},74411:(t,e,n)=>{var o,s;n.d(e,{SP:()=>a});const i=["text/plain","application/cmd","application/x-empty","application/x-msdos-program","application/javascript","application/json","application/x-perl","application/x-php","application/x-tex","application/xml","application/yaml","text/asciidoc","text/css","text/html","text/org","text/x-c","text/x-c++src","text/x-h","text/x-java-source","text/x-ldif","text/x-python","text/x-shellscript"];null!==(o=OC.appswebroots)&&void 0!==o&&o.richdocuments||null!==(s=OC.appswebroots)&&void 0!==s&&s.onlyoffice||i.push("text/csv");const a=["text/markdown",...i]},42397:(t,e,n)=>{n.d(e,{a:()=>o});const o=()=>document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null},25030:(t,e,n)=>{n.d(e,{default:()=>v,D:()=>f});var o=n(20144),s=n(20629),i=n(62556),a=n(79753),c=n(47845);const r="SET_VIEW_WIDTH",l="SET_SHOW_AUTHOR_ANNOTATIONS",d="SET_CURRENT_SESSION",p="SET_HEADINGS",u="SET_ATTACHMENT_LIST";var m=n(20296),h=n.n(m);const _=()=>document.documentElement.clientWidth,x=t=>{let{commit:e}=t;const n=h()((()=>{e("text/".concat(r),_())}),100);window.addEventListener("resize",n)},w=(0,i.Kc)("text").persist().build();o.default.use(s.ZP);const f={state:{showAuthorAnnotations:"true"===w.getItem("showAuthorAnnotations"),currentSession:w.getItem("currentSession"),viewWidth:_(),headings:Object.freeze([]),attachmentList:[]},getters:{imageAttachments:t=>t.attachmentList.filter((t=>t.isImage)),findAttachment:t=>e=>t.attachmentList.find((t=>t.name===e))},mutations:{[r](t,e){t.viewWidth=e},[l](t,e){t.showAuthorAnnotations=e,w.setItem("showAuthorAnnotations",""+e)},[d](t,e){t.currentSession=e,w.setItem("currentSession",e)},[p](t,e){if(t.headings.length!==e.length)return void(t.headings=Object.freeze(e));const n=t.headings,o=e.map(((t,e)=>{const o=n[e].level;return Object.freeze({...t,previous:o})}));t.headings=Object.freeze(o)},[u](t,e){t.attachmentList=e}},actions:{setShowAuthorAnnotations(t,e){let{commit:n}=t;n(l,e)},setCurrentSession(t,e){let{commit:n}=t;n(d,e)},setHeadings(t,e){let{commit:n}=t;n(p,e)},async setAttachmentList(t,e){var n,o,s,i;let{commit:r,state:l}=t,{documentId:d,shareToken:p}=e;const m=await c.Z.post((0,a.nu)("/apps/text/attachments"),{documentId:null!==(n=null===(o=l.currentSession)||void 0===o?void 0:o.documentId)&&void 0!==n?n:d,sessionId:null===(s=l.currentSession)||void 0===s?void 0:s.id,sessionToken:null===(i=l.currentSession)||void 0===i?void 0:i.token,shareToken:p});r(u,m.data)}}},v=new s.yh({plugins:[x],modules:{text:{namespaced:!0,...f}}})}}]);
|
|
//# sourceMappingURL=src_helpers_files_js.js.map?v=bfcc7e525096a70dce72
|