%PDF- %PDF-
Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/ |
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/ViewerComponent-CvhNJemB.chunk.mjs |
/*! third party licenses: js/vendor.LICENSE.txt */ import{V as e}from"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import{c as d}from"./index-WINsn-uD.chunk.mjs";import{a6 as s}from"./RichText-CQWfHvOo.chunk.mjs";import{N as a}from"./public-CBtR8U5E.chunk.mjs";import{P as i}from"./PlainTextReader-DEY5W1h4.chunk.mjs";import n from"./MarkdownContentEditor-z5qaiFeF.chunk.mjs";import{t as r,g as m,n as l}from"./_plugin-vue2_normalizer-XF5BqDH-.chunk.mjs";import{g as u}from"./token-DpxtlN7K.chunk.mjs";import{g as c}from"./Editor.singleton-CFX94nUf.chunk.mjs";import"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import"./emoji-picker-SoWZqoso.chunk.mjs";import"./index-hXSjL27_.chunk.mjs";import"./MediaHandler.provider-CSBQhvYP.chunk.mjs";import"./logger-B4T8Bva5.chunk.mjs";import"./index-DkzhscpN.chunk.mjs";import"./_plugin-vue2_normalizer-CQ6iBklL-DSXPAugt.chunk.mjs";import"./index-Ubm2itxG.chunk.mjs";import"./BaseReader-DYXzFHm5.chunk.mjs";import"./Wrapper-CiFcSLGo.chunk.mjs";import"./index-CyNrdWBa.chunk.mjs";e.prototype.t=r,e.prototype.n=m;const p={name:"ViewerComponent",components:{NcButton:e.extend(a),PencilIcon:e.extend(s),PlainTextReader:e.extend(i),MarkdownContentEditor:e.extend(n),Editor:c},provide(){return{isEmbedded:this.isEmbedded}},props:{filename:{type:String,default:null},fileid:{type:Number,default:null},active:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!0},shareToken:{type:String,default:()=>u()},mime:{type:String,default:null},showOutlineOutside:{type:Boolean,default:!1},permissions:{type:String,default:""},source:{type:String,default:void 0},isEmbedded:{type:Boolean,default:!1}},data(){return{content:"",hasToggledInteractiveEmbedding:!1}},computed:{useSourceView(){return this.source&&(this.fileVersion||!this.fileid||this.isEmbedded)&&!this.hasToggledInteractiveEmbedding},readerComponent(){return this.mime==="text/markdown"?n:i}},watch:{source(){this.loadFileContent()}},mounted(){this.loadFileContent()},methods:{t:r,async loadFileContent(){if(this.useSourceView){const t=await d.get(this.source);this.content=t.data,this.contentLoaded=!0}this.$emit("update:loaded",!0)},toggleEdit(){this.hasToggledInteractiveEmbedding=!0}}};var f=function(){var t=this,o=t._self._c;return t.useSourceView?o("div",{staticClass:"text-editor source-viewer",attrs:{id:"editor-container","data-text-el":"editor-container"}},[o(t.readerComponent,{tag:"Component",attrs:{content:t.content,"file-id":t.fileid,"read-only":!0,"show-menu-bar":!1}}),t.isEmbedded?o("NcButton",{staticClass:"toggle-interactive",on:{click:t.toggleEdit},scopedSlots:t._u([{key:"icon",fn:function(){return[o("PencilIcon")]},proxy:!0}],null,!1,411976917)},[t._v(" "+t._s(t.t("text","Edit"))+" ")]):t._e()],1):o("Editor",{class:{"text-editor--embedding":t.isEmbedded},attrs:{"file-id":t.fileid,"relative-path":t.filename,active:t.active||t.isEmbedded,autofocus:t.autofocus,"share-token":t.shareToken,mime:t.mime,"show-outline-outside":t.showOutlineOutside}})},h=[],g=l(p,f,h,!1,null,"368f5325");const R=g.exports;export{R as default};