diff options
Diffstat (limited to 'js/editor-rich.js')
-rw-r--r-- | js/editor-rich.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/js/editor-rich.js b/js/editor-rich.js index c54140857..5cd20db6f 100644 --- a/js/editor-rich.js +++ b/js/editor-rich.js @@ -1,3 +1,3 @@ /*! For license information please see editor-rich.js.LICENSE.txt */ -"use strict";(self.webpackChunktext=self.webpackChunktext||[]).push([["editor-rich"],{24144:(n,e,i)=>{i.d(e,{h0:()=>L,Lz:()=>E,YZ:()=>P,tH:()=>D});var o=i(74411),a=i(4820),r=i(79753),c=i(27594);function l(n,t,e,i,o,a,r){try{var c=n[a](r),l=c.value}catch(n){return void e(n)}c.done?t(l):Promise.resolve(l).then(i,o)}var s=!!document.getElementById("isPublic"),u=(0,r.generateOcsUrl)("apps/text"+(s?"/public":"")+"/workspace",2);const d={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e("vendors"),i.e("editor")]).then(i.bind(i,36199))}},props:{path:{type:String,required:!0}},data:function(){return{focus:!1,folder:null,file:null,loaded:!1,ready:!1,autofocus:!1,darkTheme:OCA.Accessibility&&"dark"===OCA.Accessibility.theme,enabled:OCA.Text.RichWorkspaceEnabled}},computed:{shareToken:function(){return document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null},canCreate:function(){return!!(this.folder&&this.folder.permissions&OC.PERMISSION_CREATE)},showEmptyWorkspace:function(){return(!this.file||this.autofocus&&!this.ready)&&this.canCreate}},watch:{path:function(){this.getFileInfo()},focus:function(n){n||document.querySelector("#editor").scrollTo(0,0)}},mounted:function(){var n,t=this;return(n=regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.enabled&&t.getFileInfo(),(0,c.subscribe)("Text::showRichWorkspace",(function(){t.enabled=!0,t.getFileInfo()})),(0,c.subscribe)("Text::hideRichWorkspace",(function(){t.enabled=!1}));case 3:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(i,o){var a=n.apply(t,e);function r(n){l(a,i,o,r,c,"next",n)}function c(n){l(a,i,o,r,c,"throw",n)}r(void 0)}))})()},methods:{unfocus:function(){},reset:function(){var n=this;this.file=null,this.focus=!1,this.$nextTick((function(){n.creating=!1,n.getFileInfo()}))},getFileInfo:function(){var n=this;this.loaded=!1,this.autofocus=!1,this.ready=!1;var t={path:this.path};return s&&(t.shareToken=this.shareToken),a.default.get(u,{params:t}).then((function(t){var e=t.data.ocs.data;return n.folder=e.folder||null,n.file=e.file,n.editing=!0,n.loaded=!0,!0})).catch((function(t){return t.response.data.ocs&&t.response.data.ocs.data.folder?n.folder=t.response.data.ocs.data.folder:n.folder=null,n.file=null,n.loaded=!0,n.ready=!0,n.creating=!1,!1}))},createNew:function(){var n=this;this.creating||(this.creating=!0,this.getFileInfo().then((function(t){n.autofocus=!0,t||window.FileList.createFile("Readme.md",{scrollTo:!1,animate:!1}).then((function(t,e){n.getFileInfo()}))})))}}};var A=i(93379),p=i.n(A),h=i(7795),m=i.n(h),f=i(90569),C=i.n(f),v=i(3565),b=i.n(v),g=i(19216),k=i.n(g),x=i(44589),y=i.n(x),w=i(99706),I={};I.styleTagTransform=y(),I.setAttributes=b(),I.insert=C().bind(null,"head"),I.domAPI=m(),I.insertStyleElement=k();p()(w.Z,I);w.Z&&w.Z.locals&&w.Z.locals;const _=(0,i(51900).Z)(d,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return n.enabled?e("div",{class:{"icon-loading":!n.loaded||!n.ready,focus:n.focus,dark:n.darkTheme,creatable:n.canCreate},attrs:{id:"rich-workspace"}},[n.showEmptyWorkspace?e("div",{staticClass:"empty-workspace",on:{click:n.createNew}},[e("p",{staticClass:"placeholder"},[n._v("\n\t\t\t"+n._s(n.t("text","Add notes, lists or links …"))+"\n\t\t")])]):n._e(),n._v(" "),n.file?e("EditorWrapper",{directives:[{name:"show",rawName:"v-show",value:n.ready,expression:"ready"}],key:n.file.path,attrs:{"file-id":n.file.id,"relative-path":n.file.path,"share-token":n.shareToken,active:!0,autohide:!0,mime:n.file.mimetype,autofocus:n.autofocus},on:{ready:function(t){n.ready=!0},focus:function(t){n.focus=!0},blur:n.unfocus,error:n.reset}}):n._e()],1):n._e()}),[],!1,null,"42d14835",null).exports;var B=i(23895),M="Edit with text app",E=function(n,t){var e=n.split("/"),i=t.split("/");for(e.pop();e[0]===i[0];)e.shift(),i.shift();var o=e.fill("..").concat(i),a=t.split("/");return o.length<a.length?o.join("/"):t},D=function(){var n={attach:function(n){var e=n.fileList;"files"!==e.id&&"files.public"!==e.id||n.addMenuEntry({id:"file",displayName:t("text","New text document"),templateName:t("text","New text document")+".md",iconClass:"icon-filetype-text",fileType:"file",actionHandler:function(n){e.createFile(n).then((function(n,t){var i=new OCA.Files.FileInfoModel(t);void 0!==OCA.Viewer?OCA.Files.fileActions.triggerAction("view",i,e):void 0===OCA.Viewer&&OCA.Files.fileActions.triggerAction(M,i,e)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)},P=function(){var n=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,e=document.getElementById("dir").value;if(!n||""!==e){var a=document.createElement("div");a.id="text-viewer-fallback",document.body.appendChild(a);for(var c=function(e){return OCA.Files.fileActions.register(e,M,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,(0,r.imagePath)("core","actions/rename"),(function(t){var e=window.FileList.findFile(t);Promise.all([Promise.resolve().then(i.bind(i,20144)),Promise.all([i.e("vendors"),i.e("files-modal")]).then(i.bind(i,19886))]).then((function(i){var o=window.FileList.getCurrentDirectory()+"/"+t,r=i[0].default;r.prototype.t=window.t,r.prototype.n=window.n,r.prototype.OCA=window.OCA;var c=i[1].default;new r({render:function(t){var i=this;return t(c,{props:{fileId:e?e.id:null,active:!0,shareToken:n,relativePath:o,mimeType:e.mimetype},on:{close:function(){i.$destroy()}}})}}).$mount(a)}))}),t("text","Edit"))},l=0;l<o.SP.length;l++)c(o.SP[l]),OCA.Files.fileActions.setDefault(o.SP[l],M)}},L={el:null,attach:function(n){"files"!==n.id&&"files.public"!==n.id||(this.el=document.createElement("div"),n.registerHeader({id:"workspace",el:this.el,render:this.render.bind(this),priority:10}))},render:function(n){var t=this;"files"!==n.id&&"files.public"!==n.id||Promise.resolve().then(i.bind(i,20144)).then((function(e){var i=e.default;t.el.id="files-workspace-wrapper",i.prototype.t=window.t,i.prototype.n=window.n,i.prototype.OCA=window.OCA;var o=new(i.extend(_))({propsData:{path:n.getCurrentDirectory()},store:B.Z}).$mount(t.el);n.$el.on("urlChanged",(function(n){o.path=n.dir.toString()})),n.$el.on("changeDirectory",(function(n){o.path=n.dir.toString()}))}))}}},74411:(n,t,e)=>{e.d(t,{SP:()=>a,lF:()=>i,w_:()=>o});var i=["text/markdown"],o=["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/css","text/csv","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"],a=[].concat(i,o)},9709:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,'.menubar[data-v-4f26a2a5]{--background-blur: blur(10px);position:fixed;position:-webkit-sticky;position:sticky;top:0;display:flex;justify-content:flex-end;z-index:10021;background-color:var(--color-main-background-translucent);-webkit-backdrop-filter:var(--background-blur);backdrop-filter:var(--background-blur);max-height:44px;padding-top:3px;padding-bottom:3px}.menubar.autohide[data-v-4f26a2a5]{visibility:hidden;opacity:0;transition:visibility .2s .4s,opacity .2s .4s}.menubar.autohide.show[data-v-4f26a2a5]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-4f26a2a5]{flex-grow:1;margin-left:calc((100% - 660px)/2)}@media(max-width: 660px){.menubar .menubar-icons[data-v-4f26a2a5]{margin-left:0}}.menubar[data-v-4f26a2a5] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-4f26a2a5]{position:relative;width:44px;height:44px;margin:0;background-size:16px;border:0;background-color:transparent;opacity:.5;color:var(--color-main-text);background-position:center center;vertical-align:top}.menubar button[data-v-4f26a2a5]:hover,.menubar button[data-v-4f26a2a5]:focus,.menubar button[data-v-4f26a2a5]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-4f26a2a5]::before{transform:translateX(-50%);border-radius:100%;position:absolute;background:var(--color-primary-element);bottom:3px;height:6px;width:6px;content:"";left:50%}.menubar button.is-active[data-v-4f26a2a5],.menubar button[data-v-4f26a2a5]:hover,.menubar button[data-v-4f26a2a5]:focus{opacity:1}.menubar button.icon-undo[data-v-4f26a2a5],.menubar button.icon-redo[data-v-4f26a2a5]{opacity:.8}.menubar button.icon-undo[data-v-4f26a2a5]:disabled,.menubar button.icon-redo[data-v-4f26a2a5]:disabled{opacity:.4}.menubar .submenu[data-v-4f26a2a5],.menubar .menuitem-emoji[data-v-4f26a2a5]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}',"",{version:3,sources:["webpack://./src/components/MenuBar.vue"],names:[],mappings:"AAoeA,0BACC,6BAAA,CACA,cAAA,CACA,uBAAA,CACA,eAAA,CACA,KAAA,CACA,YAAA,CACA,wBAAA,CACA,aAAA,CACA,yDAAA,CACA,8CAAA,CACA,sCAAA,CACA,eAAA,CACA,eAAA,CACA,kBAAA,CAEA,mCACC,iBAAA,CACA,SAAA,CACA,6CAAA,CACA,wCACC,kBAAA,CACA,SAAA,CAGF,yCACC,WAAA,CACA,kCAAA,CAED,yBACC,yCACC,aAAA,CAAA,CAGF,gDACC,6BAAA,CACA,eAAA,CAIF,iCACC,iBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,oBAAA,CACA,QAAA,CACA,4BAAA,CACA,UAAA,CACA,4BAAA,CACA,iCAAA,CACA,kBAAA,CACA,sHACC,6CAAA,CAGD,mDACC,0BAAA,CACA,kBAAA,CACA,iBAAA,CACA,uCAAA,CACA,UAAA,CACA,UAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CAGD,yHAGC,SAAA,CAGD,sFAEC,UAAA,CAEA,wGACC,UAAA,CAKH,6EACC,oBAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.menubar {\n\t--background-blur: blur(10px);\n\tposition: fixed;\n\tposition: -webkit-sticky;\n\tposition: sticky;\n\ttop: 0;\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tz-index: 10021; // above modal-header and menububble so menubar is always on top\n\tbackground-color: var(--color-main-background-translucent);\n\t-webkit-backdrop-filter: var(--background-blur);\n\tbackdrop-filter: var(--background-blur);\n\tmax-height: 44px; // important for mobile so that the buttons are always inside the container\n\tpadding-top:3px;\n\tpadding-bottom: 3px;\n\n\t&.autohide {\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\ttransition: visibility 0.2s 0.4s, opacity 0.2s 0.4s;\n\t\t&.show {\n\t\t\tvisibility: visible;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t.menubar-icons {\n\t\tflex-grow: 1;\n\t\tmargin-left: calc((100% - 660px) / 2);\n\t}\n\t@media (max-width: 660px) {\n\t\t.menubar-icons {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n\t&::v-deep .action-item__menu ul {\n\t\tmax-height: calc(100vh - 88px);\n\t\toverflow: scroll;\n\t}\n}\n\n.menubar button {\n\tposition: relative;\n\twidth: 44px;\n\theight: 44px;\n\tmargin: 0;\n\tbackground-size: 16px;\n\tborder: 0;\n\tbackground-color: transparent;\n\topacity: .5;\n\tcolor: var(--color-main-text);\n\tbackground-position: center center;\n\tvertical-align: top;\n\t&:hover, &:focus, &:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n\n\t&.is-active::before {\n\t\ttransform: translateX(-50%);\n\t\tborder-radius: 100%;\n\t\tposition: absolute;\n\t\tbackground: var(--color-primary-element);\n\t\tbottom: 3px;\n\t\theight: 6px;\n\t\twidth: 6px;\n\t\tcontent: '';\n\t\tleft: 50%;\n\n\t}\n\t&.is-active,\n\t&:hover,\n\t&:focus {\n\t\topacity: 1;\n\t}\n\n\t&.icon-undo,\n\t&.icon-redo {\n\t\topacity: .8;\n\n\t\t&:disabled {\n\t\t\topacity: .4;\n\t\t}\n\t}\n}\n\n.menubar .submenu, .menubar .menuitem-emoji {\n\tdisplay: inline-block;\n\twidth: 44px;\n\theight: 44px;\n\tposition: relative;\n\tvertical-align: top;\n}\n"],sourceRoot:""}]);const c=r},4308:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,".menububble[data-v-1df378e6]{display:flex;z-index:10020;background:var(--color-main-background-translucent);box-shadow:0 1px 5px var(--color-box-shadow);border-radius:var(--border-radius-large);overflow:hidden;padding:0;margin-left:10px;height:44px}.menububble__button[data-v-1df378e6]{display:block;flex-grow:1;border:0;padding:.9rem .7rem;margin:0;border-radius:0;cursor:pointer;background-color:var(--color-main-background);border-right:1px solid var(--color-border)}.menububble__button[data-v-1df378e6]:focus,.menububble__button[data-v-1df378e6]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-1df378e6]:last-child{border:0 !important}.menububble__buttontext[data-v-1df378e6]{padding:.4rem;padding-right:0}.menububble__form[data-v-1df378e6]{display:flex;align-items:center}.menububble__input[data-v-1df378e6]{font:inherit;border:none;background:transparent;min-width:250px}","",{version:3,sources:["webpack://./src/components/MenuBubble.vue"],names:[],mappings:"AA4KA,6BACC,YAAA,CACA,aAAA,CACA,mDAAA,CACA,4CAAA,CACA,wCAAA,CACA,eAAA,CACA,SAAA,CACA,gBAAA,CACA,WAAA,CAEA,qCACC,aAAA,CACA,WAAA,CACA,QAAA,CACA,mBAAA,CACA,QAAA,CACA,eAAA,CACA,cAAA,CACA,6CAAA,CACA,0CAAA,CAEA,sFAEC,8CAAA,CACA,QAAA,CACA,qDAAA,CAGD,gDACC,mBAAA,CAIF,yCACC,aAAA,CACA,eAAA,CAGD,mCACC,YAAA,CACA,kBAAA,CAGD,oCACC,YAAA,CACA,WAAA,CACA,sBAAA,CACA,eAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.menububble {\n\tdisplay: flex;\n\tz-index: 10020;\n\tbackground: var(--color-main-background-translucent);\n\tbox-shadow: 0 1px 5px var(--color-box-shadow);\n\tborder-radius: var(--border-radius-large);\n\toverflow: hidden;\n\tpadding: 0;\n\tmargin-left: 10px;\n\theight: 44px;\n\n\t&__button {\n\t\tdisplay: block;\n\t\tflex-grow: 1;\n\t\tborder: 0;\n\t\tpadding: 0.9rem 0.7rem;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tcursor: pointer;\n\t\tbackground-color: var(--color-main-background);\n\t\tborder-right: 1px solid var(--color-border);\n\n\t\t&:focus,\n\t\t&:hover {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t\tborder: 0;\n\t\t\tborder-right: 1px solid var(--color-border) !important;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder: 0 !important;\n\t\t}\n\t}\n\n\t&__buttontext {\n\t\tpadding: 0.4rem;\n\t\tpadding-right: 0;\n\t}\n\n\t&__form {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t&__input {\n\t\tfont: inherit;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tmin-width: 250px;\n\t}\n}\n"],sourceRoot:""}]);const c=r},99706:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,'#rich-workspace[data-v-42d14835]{padding:0 50px;margin-bottom:-24px;text-align:left;max-height:0;transition:max-height .5s cubic-bezier(0, 1, 0, 1);z-index:61;position:relative}#rich-workspace.creatable[data-v-42d14835]{min-height:90px}#rich-workspace[data-v-42d14835]:only-child{margin-bottom:0}.empty-workspace[data-v-42d14835]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-42d14835] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-42d14835] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-42d14835] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-42d14835] #editor{overflow:visible !important}#rich-workspace[data-v-42d14835] .content-wrapper{overflow:scroll !important;max-height:calc(40vh - 50px);padding-left:10px;padding-bottom:60px}#rich-workspace[data-v-42d14835] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-42d14835] .menubar{z-index:61;margin-bottom:-10px}#rich-workspace[data-v-42d14835] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-42d14835] .editor__content{margin:0}#rich-workspace.focus[data-v-42d14835]{max-height:50vh}#rich-workspace[data-v-42d14835]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-42d14835]:not(.focus):not(.icon-loading):after{content:"";position:absolute;z-index:1;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));width:100%;height:4em}#rich-workspace.dark[data-v-42d14835]:not(.focus):not(.icon-loading):after{background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background))}@media only screen and (max-width: 1024px){#rich-workspace[data-v-42d14835]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-42d14835] #editor-container{position:initial}html.ie #rich-workspace[data-v-42d14835] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-42d14835] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-42d14835] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-42d14835] #editor>div:nth-child(2){min-height:44px;overflow-x:hidden;overflow-y:auto;flex-shrink:1}',"",{version:3,sources:["webpack://./src/views/RichWorkspace.vue"],names:[],mappings:"AA0KA,iCACC,cAAA,CAEA,mBAAA,CACA,eAAA,CACA,YAAA,CACA,kDAAA,CACA,UAAA,CACA,iBAAA,CACA,2CACC,eAAA,CAKF,4CACC,eAAA,CAGD,kCACC,gBAAA,CACA,mCAAA,CACA,QAAA,CAGD,4DACC,UAAA,CACA,WAAA,CACA,6CAAA,CACA,SAAA,CACA,WAAA,CAGD,mDACC,WAAA,CACA,yBAAA,CACA,mBAAA,CAGD,iDACC,yBAAA,CACA,gBAAA,CAGD,yCACC,2BAAA,CAGD,kDACC,0BAAA,CACA,4BAAA,CACA,iBAAA,CACA,mBAAA,CAGD,8DACC,WAAA,CACA,QAAA,CAGD,0CACC,UAAA,CAEA,mBAAA,CAGD,yDACC,aAAA,CAGD,kDACC,QAAA,CAGD,uCACC,eAAA,CAGD,6CACC,eAAA,CACA,iBAAA,CACA,eAAA,CAGD,sEACC,UAAA,CACA,iBAAA,CACA,SAAA,CACA,QAAA,CACA,MAAA,CACA,mBAAA,CACA,iGAAA,CACA,UAAA,CACA,UAAA,CAGD,2EACC,2FAAA,CAGD,2CACC,6CACC,eAAA,CAAA,CAMA,2DACC,gBAAA,CAGD,yDACC,4BAAA,CACA,mBAAA,CAGD,iDACC,YAAA,CACA,qBAAA,CACA,0BAAA,CAGD,kDACC,iBAAA,CACA,eAAA,CACA,aAAA,CACA,WAAA,CACA,QAAA,CAGD,kEACC,eAAA,CACA,iBAAA,CACA,eAAA,CACA,aAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#rich-workspace {\n\tpadding: 0 50px;\n\t/* Slightly reduce vertical space */\n\tmargin-bottom: -24px;\n\ttext-align: left;\n\tmax-height: 0;\n\ttransition: max-height 0.5s cubic-bezier(0, 1, 0, 1);\n\tz-index: 61;\n\tposition: relative;\n\t&.creatable {\n\t\tmin-height: 90px;\n\t}\n}\n\n/* For subfolders, where there are no Recommendations */\n#rich-workspace:only-child {\n\tmargin-bottom: 0;\n}\n\n.empty-workspace {\n\tpadding-top: 43px;\n\tcolor: var(--color-text-maxcontrast);\n\theight: 0;\n}\n\n#rich-workspace::v-deep div[contenteditable=false] {\n\twidth: 100%;\n\tpadding: 0px;\n\tbackground-color: var(--color-main-background);\n\topacity: 1;\n\tborder: none;\n}\n\n#rich-workspace::v-deep #editor-container {\n\theight: 100%;\n\tposition: unset !important;\n\ttop: auto !important;\n}\n\n#rich-workspace::v-deep #editor-wrapper {\n\tposition: unset !important;\n\toverflow: visible;\n}\n\n#rich-workspace::v-deep #editor {\n\toverflow: visible !important;\n}\n\n#rich-workspace::v-deep .content-wrapper {\n\toverflow: scroll !important;\n\tmax-height: calc(40vh - 50px);\n\tpadding-left: 10px;\n\tpadding-bottom: 60px; /* ensure menububble fits below */\n}\n\n#rich-workspace::v-deep #editor-wrapper .ProseMirror {\n\tpadding: 0px;\n\tmargin: 0;\n}\n\n#rich-workspace::v-deep .menubar {\n\tz-index: 61;\n\t/* Slightly reduce vertical space */\n\tmargin-bottom: -10px;\n}\n\n#rich-workspace::v-deep .menubar .menubar-icons {\n\tmargin-left: 0;\n}\n\n#rich-workspace::v-deep .editor__content {\n\tmargin: 0;\n}\n\n#rich-workspace.focus {\n\tmax-height: 50vh;\n}\n\n#rich-workspace:not(.focus) {\n\tmax-height: 30vh;\n\tposition: relative;\n\toverflow: hidden;\n}\n\n#rich-workspace:not(.focus):not(.icon-loading):after {\n\tcontent: '';\n\tposition: absolute;\n\tz-index: 1;\n\tbottom: 0;\n\tleft: 0;\n\tpointer-events: none;\n\tbackground-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));\n\twidth: 100%;\n\theight: 4em;\n}\n\n#rich-workspace.dark:not(.focus):not(.icon-loading):after {\n\tbackground-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background));\n}\n\n@media only screen and (max-width: 1024px) {\n\t#rich-workspace:not(.focus) {\n\t\tmax-height: 30vh;\n\t}\n}\n\nhtml.ie {\n\t#rich-workspace::v-deep {\n\t\t#editor-container {\n\t\t\tposition: initial;\n\t\t}\n\n\t\t#editor-wrapper {\n\t\t\tposition: relative !important;\n\t\t\ttop: auto !important;\n\t\t}\n\n\t\t#editor {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden !important;\n\t\t}\n\n\t\t.menubar {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t\tflex-shrink: 0;\n\t\t\theight: 44px;\n\t\t\ttop: auto;\n\t\t}\n\n\t\t#editor > div:nth-child(2) {\n\t\t\tmin-height: 44px;\n\t\t\toverflow-x: hidden;\n\t\t\toverflow-y: auto;\n\t\t\tflex-shrink: 1;\n\t\t}\n\t}\n}\n\n"],sourceRoot:""}]);const c=r},82885:(n,e,i)=>{i.r(e),i.d(e,{default:()=>$});var o=i(15168),a=i.n(o);const r=[{label:t("text","Undo"),keyChar:"z",keyModifiers:["ctrl"],class:"icon-undo",action:function(n){return n.undo()}},{label:t("text","Redo"),keyChar:"y",keyModifiers:["ctrl"],class:"icon-redo",action:function(n){return n.redo()}},{label:t("text","Bold"),keyChar:"b",keyModifiers:["ctrl"],class:"icon-bold",isActive:"strong",action:function(n){return n.toggleBold()}},{label:t("text","Italic"),keyChar:"i",keyModifiers:["ctrl"],class:"icon-italic",isActive:"em",action:function(n){return n.toggleItalic()}},{label:t("text","Underline"),keyChar:"u",keyModifiers:["ctrl"],class:"icon-underline",isActive:"underline",action:function(n){return n.toggleUnderline()}},{label:t("text","Strikethrough"),keyChar:"d",keyModifiers:["ctrl"],class:"icon-strike",isActive:"strike",action:function(n){return n.toggleStrike()}},{label:t("text","Headings"),keyChar:"1…6",keyModifiers:["ctrl","shift"],visible:!1,children:[{label:t("text","Heading 1"),class:"icon-h1",isActive:["heading",{level:1}],action:function(n){return n.toggleHeading({level:1})}},{label:t("text","Heading 2"),class:"icon-h2",isActive:["heading",{level:2}],action:function(n){return n.toggleHeading({level:2})}},{label:t("text","Heading 3"),class:"icon-h3",isActive:["heading",{level:3}],action:function(n){return n.toggleHeading({level:3})}},{label:t("text","Heading 4"),class:"icon-h4",isActive:["heading",{level:4}],action:function(n){return n.toggleHeading({level:4})}},{label:t("text","Heading 5"),class:"icon-h5",isActive:["heading",{level:5}],action:function(n){return n.toggleHeading({level:5})}},{label:t("text","Heading 6"),class:"icon-h6",isActive:["heading",{level:6}],action:function(n){return n.toggleHeading({level:6})}}]},{label:t("text","Unordered list"),keyChar:"8",keyModifiers:["ctrl","shift"],class:"icon-ul",isActive:"bulletList",action:function(n){return n.bulletListItem()}},{label:t("text","Ordered list"),keyChar:"9",keyModifiers:["ctrl","shift"],class:"icon-ol",isActive:"orderedList",action:function(n){return n.toggleOrderedList()}},{label:t("text","ToDo list"),class:"icon-checkmark",action:function(n){return n.todo_item()}},{label:t("text","Blockquote"),keyChar:">",keyModifiers:["ctrl"],class:"icon-quote",isActive:"blockquote",action:function(n){return n.toggleBlockquote()}},{label:t("text","Code block"),class:"icon-code",isActive:"codeBlock",action:function(n){return n.toggleCodeBlock()}},{label:t("text","Emoji picker"),class:"icon-emoji",action:function(n,t){return n.emoji(t)}}];var c=i(88052),l=i(79440),s=i.n(l),u=i(56286),d=i.n(u),A=i(88408),p=i.n(A),h=i(26533),m=i.n(h),f=i(64056),C=i.n(f),v=i(2649),b=i.n(v),g=i(22200),k=i(82880),x=i(25108);function y(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null==e)return;var i,o,a=[],r=!0,c=!1;try{for(e=e.call(n);!(r=(i=e.next()).done)&&(a.push(i.value),!t||a.length!==t);r=!0);}catch(n){c=!0,o=n}finally{try{r||null==e.return||e.return()}finally{if(c)throw o}}return a}(n,t)||I(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(n){return function(n){if(Array.isArray(n))return _(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||I(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(n,t){if(n){if("string"==typeof n)return _(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_(n,t):void 0}}function _(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}var B=["image/png","image/jpeg","image/jpg","image/gif","image/x-xbitmap","image/x-ms-bmp","image/bmp","image/svg+xml","image/webp"];const M={name:"MenuBar",components:{ActionButton:d(),ActionInput:p(),PopoverMenu:m(),Actions:s(),EmojiPicker:C()},directives:{Tooltip:a(),ClickOutside:b()},mixins:[c.Z],props:{editor:{type:Object,required:!0},syncService:{type:Object,required:!1,default:null},isRichEditor:{type:Boolean,default:!0},autohide:{type:Boolean,default:!1},isPublic:{type:Boolean,default:!1},filePath:{type:String,required:!1,default:""},fileId:{type:Number,required:!1,default:0}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,showImageLinkPrompt:!1,uploadingImage:!1,imageLink:"",icons:w(r)}},computed:{isHiddenInMenu:function(){var n=this;return function(t){return t-n.iconCount>=0}},getIconClasses:function(){var n=this;return function(t){var e={};return e[t.class]=!0,e["is-active"]=n.isActive(t),e}},isActive:function(){var n=this;return function(t){var e,i=t.isActive;if(!i)return!1;var o=Array.isArray(i)?i:[i];return(e=n.editor).isActive.apply(e,w(o))}},isVisible:function(){return this.editor.isFocused||Object.values(this.submenuVisibility).find((function(n){return n}))},disabled:function(){var n=this;return function(t){return t.action&&!t.action(n.editor.can())}},isChildMenuVisible:function(){var n=this;return function(t){return!!Object.prototype.hasOwnProperty.call(n.submenuVisibility,t.label)&&n.submenuVisibility[t.label]}},allIcons:function(){var n=this;return[].concat(w(this.icons),[{label:t("text","Insert image"),class:"icon-image"},{label:t("text","Formatting help"),class:"icon-info",click:function(){n.$emit("show-help")}}])},childPopoverMenu:function(){var n=this;return function(t,e){return t.map((function(t){return{text:t.label,icon:t.class,active:n.isActive(t),action:function(){n.clickIcon(t),n.hideChildMenu(e)}}}))}},childIconClasses:function(){var n=this;return function(t){var e=n.childIcon(t);return n.getIconClasses(e)}},childIcon:function(){var n=this;return function(t){return t.find((function(t){return n.isActive(t)}))||t[0]}},iconCount:function(){this.forceRecompute,this.windowWidth;var n=this.$refs.menubar&&this.$refs.menubar.clientWidth>200?this.$refs.menubar.clientWidth:200,t=Math.max(Math.floor(n/44)-2,0);return t-1},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var n=this;window.addEventListener("resize",this.getWindowWidth),this.checkInterval=setInterval((function(){var t=n.$refs.menubar&&n.$refs.menubar.clientWidth>0;n.isRichEditor&&t&&n.redrawMenuBar(),n.isRichEditor&&!t||clearInterval(n.checkInterval)}),100)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth)},methods:{redrawMenuBar:function(){var n=this;this.$nextTick((function(){n.getWindowWidth(),n.forceRecompute++}))},refocus:function(){this.editor.chain().focus().run()},clickIcon:function(n){if(n.click)return n.click();var t=n.action(this.editor.chain().focus());t&&t.run()},getWindowWidth:function(n){this.windowWidth=document.documentElement.clientWidth},getWindowHeight:function(n){this.windowHeight=document.documentElement.clientHeight},hideChildMenu:function(n){var t=n.label;this.$set(this.submenuVisibility,t,!1)},toggleChildMenu:function(n){var t=n.label,e=!!Object.prototype.hasOwnProperty.call(this.submenuVisibility,t)&&this.submenuVisibility[t];this.$set(this.submenuVisibility,t,!e),e&&this.refocus()},onImageActionClose:function(){this.showImageLinkPrompt=!1},onUploadImage:function(){this.$refs.imageFileInput.click()},onImageUploadFilePicked:function(n){var e=this;this.uploadingImage=!0;var i=n.target.files[0];if(!B.includes(i.type))return(0,k.x2)(t("text","Image format not supported")),void(this.uploadingImage=!1);n.target.value="",this.syncService.uploadImage(i).then((function(n){var t,i;e.insertAttachmentImage(null===(t=n.data)||void 0===t?void 0:t.name,null===(i=n.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){e.uploadingImage=!1}))},onImageLinkUpdateValue:function(n){this.imageLink=n},onImageLinkSubmit:function(){var n=this;this.imageLink&&(this.uploadingImage=!0,this.showImageLinkPrompt=!1,this.$refs.imageActions[0].closeMenu(),this.syncService.insertImageLink(this.imageLink).then((function(t){var e,i;n.insertAttachmentImage(null===(e=t.data)||void 0===e?void 0:e.name,null===(i=t.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){n.uploadingImage=!1,n.imageLink=""})))},onImagePathSubmit:function(n){var t=this;this.uploadingImage=!0,this.$refs.imageActions[0].closeMenu(),this.syncService.insertImageFile(n).then((function(n){var e,i;t.insertAttachmentImage(null===(e=n.data)||void 0===e?void 0:e.name,null===(i=n.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){t.uploadingImage=!1}))},showImagePrompt:function(){var n=this;(0,g.getCurrentUser)()&&OC.dialogs.filepicker(t("text","Insert an image"),(function(t){n.onImagePathSubmit(t)}),!1,[],!0,void 0,this.imagePath)},insertAttachmentImage:function(n,t){var e="text://image?imageFileName="+encodeURIComponent(n),i=n.replaceAll(/[[\]]/g,"");this.editor.chain().setImage({src:e,alt:i}).focus().run()},optimalPathTo:function(n){var t=n.split("/"),e=this.relativePathTo(n).split("/");return e.length<t.length?e.join("/"):n},relativePathTo:function(n){var t=this.filePath.split("/"),e=n.split("/");for(t.pop();t[0]===e[0];)t.shift(),e.shift();return t.fill("..").concat(e).join("/")},addEmoji:function(n,t){return n.action(this.editor.chain(),{id:t.id,native:t.native}).focus().run()},keysString:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i={ctrl:t("text","Ctrl"),alt:t("text","Alt"),shift:t("text","Shift")};return Object.entries(i).filter((function(n){var t=y(n,2),i=t[0];t[1];return e.includes(i)})).map((function(n){var t=y(n,2);t[0];return t[1]})).concat(n.toUpperCase()).join("+")},getKeys:function(n){return n.keyChar&&!this.isMobile?"(".concat(this.keysString(n.keyChar,n.keyModifiers),")"):""},getLabelAndKeys:function(n){return[n.label,this.getKeys(n)].join(" ")}}};var E=i(93379),D=i.n(E),P=i(7795),L=i.n(P),S=i(90569),U=i.n(S),F=i(3565),j=i.n(F),O=i(19216),T=i.n(O),W=i(44589),G=i.n(W),R=i(9709),H={};H.styleTagTransform=G(),H.setAttributes=j(),H.insert=U().bind(null,"head"),H.domAPI=L(),H.insertStyleElement=T();D()(R.Z,H);R.Z&&R.Z.locals&&R.Z.locals;const $=(0,i(51900).Z)(M,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"menubar",class:{show:n.isVisible,autohide:n.autohide}},[e("input",{ref:"imageFileInput",staticClass:"hidden-visually",attrs:{type:"file",accept:"image/*","aria-hidden":"true"},on:{change:n.onImageUploadFilePicked}}),n._v(" "),n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.allIcons,(function(t,i){return["icon-emoji"===t.class?e("EmojiPicker",{key:t.label,staticClass:"menuitem-emoji",on:{selectData:function(e){return n.addEmoji(t,e)}}},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.t("text","Insert emoji"),expression:"t('text', 'Insert emoji')"}],staticClass:"icon-emoji",attrs:{"aria-label":n.t("text","Insert emoji"),"aria-haspopup":!0},on:{click:function(e){return n.toggleChildMenu(t)}}})]):"icon-image"===t.class?e("Actions",{key:t.label,ref:"imageActions",refInFor:!0,staticClass:"submenu",attrs:{"default-icon":"icon-image"},on:{open:function(e){return n.toggleChildMenu(t)},close:function(e){n.onImageActionClose,n.toggleChildMenu(t)}}},[e("button",{class:{"icon-image":!0,"loading-small":n.uploadingImage},attrs:{slot:"icon",title:t.label,"aria-label":t.label,"aria-haspopup":!0},slot:"icon"}),n._v(" "),e("ActionButton",{attrs:{icon:"icon-upload","close-after-click":!0,disabled:n.uploadingImage},on:{click:function(t){return n.onUploadImage()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Upload from computer"))+"\n\t\t\t\t")]),n._v(" "),n.isPublic?n._e():e("ActionButton",{attrs:{icon:"icon-folder","close-after-click":!0,disabled:n.uploadingImage},on:{click:function(t){return n.showImagePrompt()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Insert from Files"))+"\n\t\t\t\t")]),n._v(" "),n.showImageLinkPrompt?e("ActionInput",{attrs:{icon:"icon-link",value:n.imageLink},on:{"update:value":n.onImageLinkUpdateValue,submit:function(t){return n.onImageLinkSubmit()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Image link to insert"))+"\n\t\t\t\t")]):e("ActionButton",{attrs:{icon:"icon-link","close-after-click":!1,disabled:n.uploadingImage},on:{click:function(t){n.showImageLinkPrompt=!0}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Insert from link"))+"\n\t\t\t\t")])],1):t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:i<n.iconCount,expression:"$index < iconCount"},{name:"tooltip",rawName:"v-tooltip",value:n.getLabelAndKeys(t),expression:"getLabelAndKeys(icon)"}],key:t.label,class:n.getIconClasses(t),attrs:{disabled:n.disabled(t)},on:{click:function(e){return n.clickIcon(t)}}}):[e("div",{directives:[{name:"show",rawName:"v-show",value:i<n.iconCount||!t.class,expression:"$index < iconCount || !icon.class"},{name:"click-outside",rawName:"v-click-outside",value:function(){return n.hideChildMenu(t)},expression:"() => hideChildMenu(icon)"}],key:t.label,staticClass:"submenu"},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.getLabelAndKeys(t),expression:"getLabelAndKeys(icon)"}],class:n.childIconClasses(t.children),on:{click:function(e){return e.preventDefault(),n.toggleChildMenu(t)}}}),n._v(" "),e("div",{staticClass:"popovermenu menu-center",class:{open:n.isChildMenuVisible(t)}},[e("PopoverMenu",{attrs:{menu:n.childPopoverMenu(t.children,t)}})],1)])]]})),n._v(" "),e("Actions",{on:{open:function(t){return n.toggleChildMenu({label:"Remaining Actions"})},close:function(t){return n.toggleChildMenu({label:"Remaining Actions"})}}},[n._l(n.allIcons,(function(t,i){return[t.class&&n.isHiddenInMenu(i)&&"icon-emoji"!==t.class?e("ActionButton",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.getKeys(t),expression:"getKeys(icon)"}],key:t.class,attrs:{icon:t.class,"close-after-click":!0},on:{click:function(e){return n.clickIcon(t)}}},[n._v("\n\t\t\t\t\t"+n._s(t.label)+"\n\t\t\t\t")]):n._e()]}))],2)],2):n._e(),n._v(" "),n._t("default",(function(){return[n._v("\n\t\tLeft side\n\t")]}))],2)}),[],!1,null,"4f26a2a5",null).exports},31634:(n,e,i)=>{i.r(e),i.d(e,{default:()=>_});var o=i(7049),a=i(52260),r=i(15168),c=i.n(r),l=i(22200),s=i(24144),u=i(16453);const d={name:"MenuBubble",components:{BubbleMenu:o.NM},directives:{tooltip:c()},props:{editor:{type:Object,required:!0},contentWrapper:{type:HTMLDivElement,required:!1,default:null},filePath:{type:String,required:!1,default:""}},data:function(){return{linkUrl:null,linkMenuIsActive:!1,isUsingDirectEditing:null!==(0,u.loadState)("text","directEditingToken",null)}},methods:{showLinkMenu:function(){var n=this,t=(0,a.Jo)(this.editor.state,"link");this.linkUrl=t.href,this.linkMenuIsActive=!0,this.$nextTick((function(){n.$refs.linkInput.focus()}))},hideLinkMenu:function(){this.linkUrl=null,this.linkMenuIsActive=!1},selectFile:function(){var n=this;if((0,l.getCurrentUser)()){var e=this.filePath.split("/").slice(0,-1).join("/");OC.dialogs.filepicker(t("text","Select file to link to"),(function(t){OC.Files.getClient().getFileInfo(t).then((function(t,e){var i=(0,s.Lz)(n.filePath,"".concat(e.path,"/").concat(e.name)).split("/").map(encodeURIComponent).join("/"),o="".concat(i,"?fileId=").concat(e.id);n.editor.chain().setLink({href:o}).focus().run(),n.hideLinkMenu()}))}),!1,[],!0,void 0,e)}},setLinkUrl:function(){var n=this.linkUrl;n&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((function(t){return n.match(t)}))&&(n="https://"+n);var t=n.replaceAll(" ","%20");this.editor.chain().setLink({href:t}).focus().run(),this.hideLinkMenu()},removeLinkUrl:function(){this.editor.chain().unsetLink().focus().run()},isActive:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.editor.isActive(n,t)}}};var A=i(93379),p=i.n(A),h=i(7795),m=i.n(h),f=i(90569),C=i.n(f),v=i(3565),b=i.n(v),g=i(19216),k=i.n(g),x=i(44589),y=i.n(x),w=i(4308),I={};I.styleTagTransform=y(),I.setAttributes=b(),I.insert=C().bind(null,"head"),I.domAPI=m(),I.insertStyleElement=k();p()(w.Z,I);w.Z&&w.Z.locals&&w.Z.locals;const _=(0,i(51900).Z)(d,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("BubbleMenu",{staticClass:"menububble",attrs:{editor:n.editor,"tippy-options":{onHide:n.hideLinkMenu,duration:200,placement:"bottom"}}},[n.linkMenuIsActive?e("form",{staticClass:"menububble__form",on:{submit:function(t){return t.preventDefault(),n.setLinkUrl()}}},[e("input",{directives:[{name:"model",rawName:"v-model",value:n.linkUrl,expression:"linkUrl"}],ref:"linkInput",staticClass:"menububble__input",attrs:{type:"text",placeholder:"https://"},domProps:{value:n.linkUrl},on:{keydown:function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:n.hideLinkMenu.apply(null,arguments)},input:function(t){t.target.composing||(n.linkUrl=t.target.value)}}}),n._v(" "),e("button",{staticClass:"menububble__button icon-confirm",attrs:{type:"button",tabindex:"0"},on:{click:function(t){return n.setLinkUrl()}}})]):[e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.showLinkMenu()}}},[e("span",{staticClass:"icon-link"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v("\n\t\t\t\t"+n._s(n.isActive("link")?n.t("text","Update Link"):n.t("text","Add Link"))+"\n\t\t\t")])]),n._v(" "),n.isUsingDirectEditing?n._e():e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.selectFile()}}},[e("span",{staticClass:"icon-file"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v(n._s(n.t("text","Link file")))])]),n._v(" "),n.isActive("link")?e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.removeLinkUrl()}}},[e("span",{staticClass:"icon-delete"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v("\n\t\t\t\t"+n._s(n.t("text","Remove Link"))+"\n\t\t\t")])]):n._e()]],2)}),[],!1,null,"1df378e6",null).exports}}]); -//# sourceMappingURL=editor-rich.js.map?v=ceb3fc6d33e50e5cf840
\ No newline at end of file +"use strict";(self.webpackChunktext=self.webpackChunktext||[]).push([["editor-rich"],{24144:(n,e,i)=>{i.d(e,{h0:()=>L,Lz:()=>E,YZ:()=>P,tH:()=>D});var o=i(74411),a=i(4820),r=i(79753),c=i(27594);function l(n,t,e,i,o,a,r){try{var c=n[a](r),l=c.value}catch(n){return void e(n)}c.done?t(l):Promise.resolve(l).then(i,o)}var s=!!document.getElementById("isPublic"),u=(0,r.generateOcsUrl)("apps/text"+(s?"/public":"")+"/workspace",2);const d={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e("vendors"),i.e("editor")]).then(i.bind(i,36199))}},props:{path:{type:String,required:!0}},data:function(){return{focus:!1,folder:null,file:null,loaded:!1,ready:!1,autofocus:!1,darkTheme:OCA.Accessibility&&"dark"===OCA.Accessibility.theme,enabled:OCA.Text.RichWorkspaceEnabled}},computed:{shareToken:function(){return document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null},canCreate:function(){return!!(this.folder&&this.folder.permissions&OC.PERMISSION_CREATE)},showEmptyWorkspace:function(){return(!this.file||this.autofocus&&!this.ready)&&this.canCreate}},watch:{path:function(){this.getFileInfo()},focus:function(n){n||document.querySelector("#editor").scrollTo(0,0)}},mounted:function(){var n,t=this;return(n=regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t.enabled&&t.getFileInfo(),(0,c.subscribe)("Text::showRichWorkspace",(function(){t.enabled=!0,t.getFileInfo()})),(0,c.subscribe)("Text::hideRichWorkspace",(function(){t.enabled=!1}));case 3:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(i,o){var a=n.apply(t,e);function r(n){l(a,i,o,r,c,"next",n)}function c(n){l(a,i,o,r,c,"throw",n)}r(void 0)}))})()},methods:{unfocus:function(){},reset:function(){var n=this;this.file=null,this.focus=!1,this.$nextTick((function(){n.creating=!1,n.getFileInfo()}))},getFileInfo:function(){var n=this;this.loaded=!1,this.autofocus=!1,this.ready=!1;var t={path:this.path};return s&&(t.shareToken=this.shareToken),a.default.get(u,{params:t}).then((function(t){var e=t.data.ocs.data;return n.folder=e.folder||null,n.file=e.file,n.editing=!0,n.loaded=!0,!0})).catch((function(t){return t.response.data.ocs&&t.response.data.ocs.data.folder?n.folder=t.response.data.ocs.data.folder:n.folder=null,n.file=null,n.loaded=!0,n.ready=!0,n.creating=!1,!1}))},createNew:function(){var n=this;this.creating||(this.creating=!0,this.getFileInfo().then((function(t){n.autofocus=!0,t||window.FileList.createFile("Readme.md",{scrollTo:!1,animate:!1}).then((function(t,e){n.getFileInfo()}))})))}}};var A=i(93379),p=i.n(A),h=i(7795),m=i.n(h),f=i(90569),C=i.n(f),v=i(3565),b=i.n(v),g=i(19216),k=i.n(g),x=i(44589),y=i.n(x),w=i(99706),I={};I.styleTagTransform=y(),I.setAttributes=b(),I.insert=C().bind(null,"head"),I.domAPI=m(),I.insertStyleElement=k();p()(w.Z,I);w.Z&&w.Z.locals&&w.Z.locals;const _=(0,i(51900).Z)(d,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return n.enabled?e("div",{class:{"icon-loading":!n.loaded||!n.ready,focus:n.focus,dark:n.darkTheme,creatable:n.canCreate},attrs:{id:"rich-workspace"}},[n.showEmptyWorkspace?e("div",{staticClass:"empty-workspace",on:{click:n.createNew}},[e("p",{staticClass:"placeholder"},[n._v("\n\t\t\t"+n._s(n.t("text","Add notes, lists or links …"))+"\n\t\t")])]):n._e(),n._v(" "),n.file?e("EditorWrapper",{directives:[{name:"show",rawName:"v-show",value:n.ready,expression:"ready"}],key:n.file.path,attrs:{"file-id":n.file.id,"relative-path":n.file.path,"share-token":n.shareToken,active:!0,autohide:!0,mime:n.file.mimetype,autofocus:n.autofocus},on:{ready:function(t){n.ready=!0},focus:function(t){n.focus=!0},blur:n.unfocus,error:n.reset}}):n._e()],1):n._e()}),[],!1,null,"42d14835",null).exports;var B=i(23895),M="Edit with text app",E=function(n,t){var e=n.split("/"),i=t.split("/");for(e.pop();e[0]===i[0];)e.shift(),i.shift();var o=e.fill("..").concat(i),a=t.split("/");return o.length<a.length?o.join("/"):t},D=function(){var n={attach:function(n){var e=n.fileList;"files"!==e.id&&"files.public"!==e.id||n.addMenuEntry({id:"file",displayName:t("text","New text document"),templateName:t("text","New text document")+".md",iconClass:"icon-filetype-text",fileType:"file",actionHandler:function(n){e.createFile(n).then((function(n,t){var i=new OCA.Files.FileInfoModel(t);void 0!==OCA.Viewer?OCA.Files.fileActions.triggerAction("view",i,e):void 0===OCA.Viewer&&OCA.Files.fileActions.triggerAction(M,i,e)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)},P=function(){var n=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,e=document.getElementById("dir").value;if(!n||""!==e){var a=document.createElement("div");a.id="text-viewer-fallback",document.body.appendChild(a);for(var c=function(e){return OCA.Files.fileActions.register(e,M,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,(0,r.imagePath)("core","actions/rename"),(function(t){var e=window.FileList.findFile(t);Promise.all([Promise.resolve().then(i.bind(i,20144)),Promise.all([i.e("vendors"),i.e("files-modal")]).then(i.bind(i,19886))]).then((function(i){var o=window.FileList.getCurrentDirectory()+"/"+t,r=i[0].default;r.prototype.t=window.t,r.prototype.n=window.n,r.prototype.OCA=window.OCA;var c=i[1].default;new r({render:function(t){var i=this;return t(c,{props:{fileId:e?e.id:null,active:!0,shareToken:n,relativePath:o,mimeType:e.mimetype},on:{close:function(){i.$destroy()}}})}}).$mount(a)}))}),t("text","Edit"))},l=0;l<o.SP.length;l++)c(o.SP[l]),OCA.Files.fileActions.setDefault(o.SP[l],M)}},L={el:null,attach:function(n){"files"!==n.id&&"files.public"!==n.id||(this.el=document.createElement("div"),n.registerHeader({id:"workspace",el:this.el,render:this.render.bind(this),priority:10}))},render:function(n){var t=this;"files"!==n.id&&"files.public"!==n.id||Promise.resolve().then(i.bind(i,20144)).then((function(e){var i=e.default;t.el.id="files-workspace-wrapper",i.prototype.t=window.t,i.prototype.n=window.n,i.prototype.OCA=window.OCA;var o=new(i.extend(_))({propsData:{path:n.getCurrentDirectory()},store:B.Z}).$mount(t.el);n.$el.on("urlChanged",(function(n){o.path=n.dir.toString()})),n.$el.on("changeDirectory",(function(n){o.path=n.dir.toString()}))}))}}},74411:(n,t,e)=>{e.d(t,{SP:()=>a,lF:()=>i,w_:()=>o});var i=["text/markdown"],o=["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/css","text/csv","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"],a=[].concat(i,o)},48885:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,'.menubar[data-v-1ea2897c]{--background-blur: blur(10px);position:fixed;position:-webkit-sticky;position:sticky;top:0;display:flex;justify-content:flex-end;z-index:10021;background-color:var(--color-main-background-translucent);-webkit-backdrop-filter:var(--background-blur);backdrop-filter:var(--background-blur);max-height:44px;padding-top:3px;padding-bottom:3px}.menubar.autohide[data-v-1ea2897c]{visibility:hidden;opacity:0;transition:visibility .2s .4s,opacity .2s .4s}.menubar.autohide.show[data-v-1ea2897c]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-1ea2897c]{flex-grow:1;margin-left:calc((100% - 660px)/2)}@media(max-width: 660px){.menubar .menubar-icons[data-v-1ea2897c]{margin-left:0}}.menubar[data-v-1ea2897c] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-1ea2897c]{position:relative;width:44px;height:44px;margin:0;background-size:16px;border:0;background-color:transparent;opacity:.5;color:var(--color-main-text);background-position:center center;vertical-align:top}.menubar button[data-v-1ea2897c]:hover,.menubar button[data-v-1ea2897c]:focus,.menubar button[data-v-1ea2897c]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-1ea2897c]::before{transform:translateX(-50%);border-radius:100%;position:absolute;background:var(--color-primary-element);bottom:3px;height:6px;width:6px;content:"";left:50%}.menubar button.is-active[data-v-1ea2897c],.menubar button[data-v-1ea2897c]:hover,.menubar button[data-v-1ea2897c]:focus{opacity:1}.menubar button.icon-undo[data-v-1ea2897c],.menubar button.icon-redo[data-v-1ea2897c]{opacity:.8}.menubar button.icon-undo[data-v-1ea2897c]:disabled,.menubar button.icon-redo[data-v-1ea2897c]:disabled{opacity:.4}.menubar .submenu[data-v-1ea2897c],.menubar .menuitem-emoji[data-v-1ea2897c]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}',"",{version:3,sources:["webpack://./src/components/MenuBar.vue"],names:[],mappings:"AAieA,0BACC,6BAAA,CACA,cAAA,CACA,uBAAA,CACA,eAAA,CACA,KAAA,CACA,YAAA,CACA,wBAAA,CACA,aAAA,CACA,yDAAA,CACA,8CAAA,CACA,sCAAA,CACA,eAAA,CACA,eAAA,CACA,kBAAA,CAEA,mCACC,iBAAA,CACA,SAAA,CACA,6CAAA,CACA,wCACC,kBAAA,CACA,SAAA,CAGF,yCACC,WAAA,CACA,kCAAA,CAED,yBACC,yCACC,aAAA,CAAA,CAGF,gDACC,6BAAA,CACA,eAAA,CAIF,iCACC,iBAAA,CACA,UAAA,CACA,WAAA,CACA,QAAA,CACA,oBAAA,CACA,QAAA,CACA,4BAAA,CACA,UAAA,CACA,4BAAA,CACA,iCAAA,CACA,kBAAA,CACA,sHACC,6CAAA,CAGD,mDACC,0BAAA,CACA,kBAAA,CACA,iBAAA,CACA,uCAAA,CACA,UAAA,CACA,UAAA,CACA,SAAA,CACA,UAAA,CACA,QAAA,CAGD,yHAGC,SAAA,CAGD,sFAEC,UAAA,CAEA,wGACC,UAAA,CAKH,6EACC,oBAAA,CACA,UAAA,CACA,WAAA,CACA,iBAAA,CACA,kBAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.menubar {\n\t--background-blur: blur(10px);\n\tposition: fixed;\n\tposition: -webkit-sticky;\n\tposition: sticky;\n\ttop: 0;\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tz-index: 10021; // above modal-header and menububble so menubar is always on top\n\tbackground-color: var(--color-main-background-translucent);\n\t-webkit-backdrop-filter: var(--background-blur);\n\tbackdrop-filter: var(--background-blur);\n\tmax-height: 44px; // important for mobile so that the buttons are always inside the container\n\tpadding-top:3px;\n\tpadding-bottom: 3px;\n\n\t&.autohide {\n\t\tvisibility: hidden;\n\t\topacity: 0;\n\t\ttransition: visibility 0.2s 0.4s, opacity 0.2s 0.4s;\n\t\t&.show {\n\t\t\tvisibility: visible;\n\t\t\topacity: 1;\n\t\t}\n\t}\n\t.menubar-icons {\n\t\tflex-grow: 1;\n\t\tmargin-left: calc((100% - 660px) / 2);\n\t}\n\t@media (max-width: 660px) {\n\t\t.menubar-icons {\n\t\t\tmargin-left: 0;\n\t\t}\n\t}\n\t&::v-deep .action-item__menu ul {\n\t\tmax-height: calc(100vh - 88px);\n\t\toverflow: scroll;\n\t}\n}\n\n.menubar button {\n\tposition: relative;\n\twidth: 44px;\n\theight: 44px;\n\tmargin: 0;\n\tbackground-size: 16px;\n\tborder: 0;\n\tbackground-color: transparent;\n\topacity: .5;\n\tcolor: var(--color-main-text);\n\tbackground-position: center center;\n\tvertical-align: top;\n\t&:hover, &:focus, &:active {\n\t\tbackground-color: var(--color-background-dark);\n\t}\n\n\t&.is-active::before {\n\t\ttransform: translateX(-50%);\n\t\tborder-radius: 100%;\n\t\tposition: absolute;\n\t\tbackground: var(--color-primary-element);\n\t\tbottom: 3px;\n\t\theight: 6px;\n\t\twidth: 6px;\n\t\tcontent: '';\n\t\tleft: 50%;\n\n\t}\n\t&.is-active,\n\t&:hover,\n\t&:focus {\n\t\topacity: 1;\n\t}\n\n\t&.icon-undo,\n\t&.icon-redo {\n\t\topacity: .8;\n\n\t\t&:disabled {\n\t\t\topacity: .4;\n\t\t}\n\t}\n}\n\n.menubar .submenu, .menubar .menuitem-emoji {\n\tdisplay: inline-block;\n\twidth: 44px;\n\theight: 44px;\n\tposition: relative;\n\tvertical-align: top;\n}\n"],sourceRoot:""}]);const c=r},48375:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,".menububble[data-v-23aa9303]{display:flex;z-index:10020;background:var(--color-main-background-translucent);box-shadow:0 1px 5px var(--color-box-shadow);border-radius:var(--border-radius-large);overflow:hidden;padding:0;margin-left:10px;height:44px}.menububble__button[data-v-23aa9303]{display:block;flex-grow:1;border:0;padding:.9rem .7rem;margin:0;border-radius:0;cursor:pointer;background-color:var(--color-main-background);border-right:1px solid var(--color-border)}.menububble__button[data-v-23aa9303]:focus,.menububble__button[data-v-23aa9303]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-23aa9303]:last-child{border:0 !important}.menububble__buttontext[data-v-23aa9303]{padding:.4rem;padding-right:0}.menububble__form[data-v-23aa9303]{display:flex;align-items:center}.menububble__input[data-v-23aa9303]{font:inherit;border:none;background:transparent;min-width:250px}","",{version:3,sources:["webpack://./src/components/MenuBubble.vue"],names:[],mappings:"AAyKA,6BACC,YAAA,CACA,aAAA,CACA,mDAAA,CACA,4CAAA,CACA,wCAAA,CACA,eAAA,CACA,SAAA,CACA,gBAAA,CACA,WAAA,CAEA,qCACC,aAAA,CACA,WAAA,CACA,QAAA,CACA,mBAAA,CACA,QAAA,CACA,eAAA,CACA,cAAA,CACA,6CAAA,CACA,0CAAA,CAEA,sFAEC,8CAAA,CACA,QAAA,CACA,qDAAA,CAGD,gDACC,mBAAA,CAIF,yCACC,aAAA,CACA,eAAA,CAGD,mCACC,YAAA,CACA,kBAAA,CAGD,oCACC,YAAA,CACA,WAAA,CACA,sBAAA,CACA,eAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.menububble {\n\tdisplay: flex;\n\tz-index: 10020;\n\tbackground: var(--color-main-background-translucent);\n\tbox-shadow: 0 1px 5px var(--color-box-shadow);\n\tborder-radius: var(--border-radius-large);\n\toverflow: hidden;\n\tpadding: 0;\n\tmargin-left: 10px;\n\theight: 44px;\n\n\t&__button {\n\t\tdisplay: block;\n\t\tflex-grow: 1;\n\t\tborder: 0;\n\t\tpadding: 0.9rem 0.7rem;\n\t\tmargin: 0;\n\t\tborder-radius: 0;\n\t\tcursor: pointer;\n\t\tbackground-color: var(--color-main-background);\n\t\tborder-right: 1px solid var(--color-border);\n\n\t\t&:focus,\n\t\t&:hover {\n\t\t\tbackground-color: var(--color-background-hover);\n\t\t\tborder: 0;\n\t\t\tborder-right: 1px solid var(--color-border) !important;\n\t\t}\n\n\t\t&:last-child {\n\t\t\tborder: 0 !important;\n\t\t}\n\t}\n\n\t&__buttontext {\n\t\tpadding: 0.4rem;\n\t\tpadding-right: 0;\n\t}\n\n\t&__form {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t}\n\n\t&__input {\n\t\tfont: inherit;\n\t\tborder: none;\n\t\tbackground: transparent;\n\t\tmin-width: 250px;\n\t}\n}\n"],sourceRoot:""}]);const c=r},99706:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),a=e(23645),r=e.n(a)()(o());r.push([n.id,'#rich-workspace[data-v-42d14835]{padding:0 50px;margin-bottom:-24px;text-align:left;max-height:0;transition:max-height .5s cubic-bezier(0, 1, 0, 1);z-index:61;position:relative}#rich-workspace.creatable[data-v-42d14835]{min-height:90px}#rich-workspace[data-v-42d14835]:only-child{margin-bottom:0}.empty-workspace[data-v-42d14835]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-42d14835] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-42d14835] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-42d14835] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-42d14835] #editor{overflow:visible !important}#rich-workspace[data-v-42d14835] .content-wrapper{overflow:scroll !important;max-height:calc(40vh - 50px);padding-left:10px;padding-bottom:60px}#rich-workspace[data-v-42d14835] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-42d14835] .menubar{z-index:61;margin-bottom:-10px}#rich-workspace[data-v-42d14835] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-42d14835] .editor__content{margin:0}#rich-workspace.focus[data-v-42d14835]{max-height:50vh}#rich-workspace[data-v-42d14835]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-42d14835]:not(.focus):not(.icon-loading):after{content:"";position:absolute;z-index:1;bottom:0;left:0;pointer-events:none;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));width:100%;height:4em}#rich-workspace.dark[data-v-42d14835]:not(.focus):not(.icon-loading):after{background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background))}@media only screen and (max-width: 1024px){#rich-workspace[data-v-42d14835]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-42d14835] #editor-container{position:initial}html.ie #rich-workspace[data-v-42d14835] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-42d14835] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-42d14835] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-42d14835] #editor>div:nth-child(2){min-height:44px;overflow-x:hidden;overflow-y:auto;flex-shrink:1}',"",{version:3,sources:["webpack://./src/views/RichWorkspace.vue"],names:[],mappings:"AA0KA,iCACC,cAAA,CAEA,mBAAA,CACA,eAAA,CACA,YAAA,CACA,kDAAA,CACA,UAAA,CACA,iBAAA,CACA,2CACC,eAAA,CAKF,4CACC,eAAA,CAGD,kCACC,gBAAA,CACA,mCAAA,CACA,QAAA,CAGD,4DACC,UAAA,CACA,WAAA,CACA,6CAAA,CACA,SAAA,CACA,WAAA,CAGD,mDACC,WAAA,CACA,yBAAA,CACA,mBAAA,CAGD,iDACC,yBAAA,CACA,gBAAA,CAGD,yCACC,2BAAA,CAGD,kDACC,0BAAA,CACA,4BAAA,CACA,iBAAA,CACA,mBAAA,CAGD,8DACC,WAAA,CACA,QAAA,CAGD,0CACC,UAAA,CAEA,mBAAA,CAGD,yDACC,aAAA,CAGD,kDACC,QAAA,CAGD,uCACC,eAAA,CAGD,6CACC,eAAA,CACA,iBAAA,CACA,eAAA,CAGD,sEACC,UAAA,CACA,iBAAA,CACA,SAAA,CACA,QAAA,CACA,MAAA,CACA,mBAAA,CACA,iGAAA,CACA,UAAA,CACA,UAAA,CAGD,2EACC,2FAAA,CAGD,2CACC,6CACC,eAAA,CAAA,CAMA,2DACC,gBAAA,CAGD,yDACC,4BAAA,CACA,mBAAA,CAGD,iDACC,YAAA,CACA,qBAAA,CACA,0BAAA,CAGD,kDACC,iBAAA,CACA,eAAA,CACA,aAAA,CACA,WAAA,CACA,QAAA,CAGD,kEACC,eAAA,CACA,iBAAA,CACA,eAAA,CACA,aAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#rich-workspace {\n\tpadding: 0 50px;\n\t/* Slightly reduce vertical space */\n\tmargin-bottom: -24px;\n\ttext-align: left;\n\tmax-height: 0;\n\ttransition: max-height 0.5s cubic-bezier(0, 1, 0, 1);\n\tz-index: 61;\n\tposition: relative;\n\t&.creatable {\n\t\tmin-height: 90px;\n\t}\n}\n\n/* For subfolders, where there are no Recommendations */\n#rich-workspace:only-child {\n\tmargin-bottom: 0;\n}\n\n.empty-workspace {\n\tpadding-top: 43px;\n\tcolor: var(--color-text-maxcontrast);\n\theight: 0;\n}\n\n#rich-workspace::v-deep div[contenteditable=false] {\n\twidth: 100%;\n\tpadding: 0px;\n\tbackground-color: var(--color-main-background);\n\topacity: 1;\n\tborder: none;\n}\n\n#rich-workspace::v-deep #editor-container {\n\theight: 100%;\n\tposition: unset !important;\n\ttop: auto !important;\n}\n\n#rich-workspace::v-deep #editor-wrapper {\n\tposition: unset !important;\n\toverflow: visible;\n}\n\n#rich-workspace::v-deep #editor {\n\toverflow: visible !important;\n}\n\n#rich-workspace::v-deep .content-wrapper {\n\toverflow: scroll !important;\n\tmax-height: calc(40vh - 50px);\n\tpadding-left: 10px;\n\tpadding-bottom: 60px; /* ensure menububble fits below */\n}\n\n#rich-workspace::v-deep #editor-wrapper .ProseMirror {\n\tpadding: 0px;\n\tmargin: 0;\n}\n\n#rich-workspace::v-deep .menubar {\n\tz-index: 61;\n\t/* Slightly reduce vertical space */\n\tmargin-bottom: -10px;\n}\n\n#rich-workspace::v-deep .menubar .menubar-icons {\n\tmargin-left: 0;\n}\n\n#rich-workspace::v-deep .editor__content {\n\tmargin: 0;\n}\n\n#rich-workspace.focus {\n\tmax-height: 50vh;\n}\n\n#rich-workspace:not(.focus) {\n\tmax-height: 30vh;\n\tposition: relative;\n\toverflow: hidden;\n}\n\n#rich-workspace:not(.focus):not(.icon-loading):after {\n\tcontent: '';\n\tposition: absolute;\n\tz-index: 1;\n\tbottom: 0;\n\tleft: 0;\n\tpointer-events: none;\n\tbackground-image: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background));\n\twidth: 100%;\n\theight: 4em;\n}\n\n#rich-workspace.dark:not(.focus):not(.icon-loading):after {\n\tbackground-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--color-main-background));\n}\n\n@media only screen and (max-width: 1024px) {\n\t#rich-workspace:not(.focus) {\n\t\tmax-height: 30vh;\n\t}\n}\n\nhtml.ie {\n\t#rich-workspace::v-deep {\n\t\t#editor-container {\n\t\t\tposition: initial;\n\t\t}\n\n\t\t#editor-wrapper {\n\t\t\tposition: relative !important;\n\t\t\ttop: auto !important;\n\t\t}\n\n\t\t#editor {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\toverflow: hidden !important;\n\t\t}\n\n\t\t.menubar {\n\t\t\tposition: relative;\n\t\t\toverflow: hidden;\n\t\t\tflex-shrink: 0;\n\t\t\theight: 44px;\n\t\t\ttop: auto;\n\t\t}\n\n\t\t#editor > div:nth-child(2) {\n\t\t\tmin-height: 44px;\n\t\t\toverflow-x: hidden;\n\t\t\toverflow-y: auto;\n\t\t\tflex-shrink: 1;\n\t\t}\n\t}\n}\n\n"],sourceRoot:""}]);const c=r},40049:(n,e,i)=>{i.r(e),i.d(e,{default:()=>$});var o=i(15168),a=i.n(o);const r=[{label:t("text","Undo"),keyChar:"z",keyModifiers:["ctrl"],class:"icon-undo",action:function(n){return n.undo()}},{label:t("text","Redo"),keyChar:"y",keyModifiers:["ctrl"],class:"icon-redo",action:function(n){return n.redo()}},{label:t("text","Bold"),keyChar:"b",keyModifiers:["ctrl"],class:"icon-bold",isActive:"strong",action:function(n){return n.toggleBold()}},{label:t("text","Italic"),keyChar:"i",keyModifiers:["ctrl"],class:"icon-italic",isActive:"em",action:function(n){return n.toggleItalic()}},{label:t("text","Underline"),keyChar:"u",keyModifiers:["ctrl"],class:"icon-underline",isActive:"underline",action:function(n){return n.toggleUnderline()}},{label:t("text","Strikethrough"),keyChar:"d",keyModifiers:["ctrl"],class:"icon-strike",isActive:"strike",action:function(n){return n.toggleStrike()}},{label:t("text","Headings"),keyChar:"1…6",keyModifiers:["ctrl","shift"],visible:!1,children:[{label:t("text","Heading 1"),class:"icon-h1",isActive:["heading",{level:1}],action:function(n){return n.toggleHeading({level:1})}},{label:t("text","Heading 2"),class:"icon-h2",isActive:["heading",{level:2}],action:function(n){return n.toggleHeading({level:2})}},{label:t("text","Heading 3"),class:"icon-h3",isActive:["heading",{level:3}],action:function(n){return n.toggleHeading({level:3})}},{label:t("text","Heading 4"),class:"icon-h4",isActive:["heading",{level:4}],action:function(n){return n.toggleHeading({level:4})}},{label:t("text","Heading 5"),class:"icon-h5",isActive:["heading",{level:5}],action:function(n){return n.toggleHeading({level:5})}},{label:t("text","Heading 6"),class:"icon-h6",isActive:["heading",{level:6}],action:function(n){return n.toggleHeading({level:6})}}]},{label:t("text","Unordered list"),keyChar:"8",keyModifiers:["ctrl","shift"],class:"icon-ul",isActive:"bulletList",action:function(n){return n.bulletListItem()}},{label:t("text","Ordered list"),keyChar:"9",keyModifiers:["ctrl","shift"],class:"icon-ol",isActive:"orderedList",action:function(n){return n.toggleOrderedList()}},{label:t("text","ToDo list"),class:"icon-checkmark",action:function(n){return n.todo_item()}},{label:t("text","Blockquote"),keyChar:">",keyModifiers:["ctrl"],class:"icon-quote",isActive:"blockquote",action:function(n){return n.toggleBlockquote()}},{label:t("text","Code block"),class:"icon-code",isActive:"codeBlock",action:function(n){return n.toggleCodeBlock()}},{label:t("text","Emoji picker"),class:"icon-emoji",action:function(n,t){return n.emoji(t)}}];var c=i(88052),l=i(79440),s=i.n(l),u=i(56286),d=i.n(u),A=i(88408),p=i.n(A),h=i(26533),m=i.n(h),f=i(64056),C=i.n(f),v=i(2649),b=i.n(v),g=i(22200),k=i(82880),x=i(25108);function y(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null==e)return;var i,o,a=[],r=!0,c=!1;try{for(e=e.call(n);!(r=(i=e.next()).done)&&(a.push(i.value),!t||a.length!==t);r=!0);}catch(n){c=!0,o=n}finally{try{r||null==e.return||e.return()}finally{if(c)throw o}}return a}(n,t)||I(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(n){return function(n){if(Array.isArray(n))return _(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||I(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(n,t){if(n){if("string"==typeof n)return _(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);return"Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e?Array.from(n):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_(n,t):void 0}}function _(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}var B=["image/png","image/jpeg","image/jpg","image/gif","image/x-xbitmap","image/x-ms-bmp","image/bmp","image/svg+xml","image/webp"];const M={name:"MenuBar",components:{ActionButton:d(),ActionInput:p(),PopoverMenu:m(),Actions:s(),EmojiPicker:C()},directives:{Tooltip:a(),ClickOutside:b()},mixins:[c.Z],props:{editor:{type:Object,required:!0},syncService:{type:Object,required:!1,default:null},isRichEditor:{type:Boolean,default:!0},autohide:{type:Boolean,default:!1},isPublic:{type:Boolean,default:!1},filePath:{type:String,required:!1,default:""},fileId:{type:Number,required:!1,default:0}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,showImageLinkPrompt:!1,uploadingImage:!1,imageLink:"",icons:w(r)}},computed:{isHiddenInMenu:function(){var n=this;return function(t){return t-n.iconCount>=0}},getIconClasses:function(){var n=this;return function(t){var e={};return e[t.class]=!0,e["is-active"]=n.isActive(t),e}},isActive:function(){var n=this;return function(t){var e,i=t.isActive;if(!i)return!1;var o=Array.isArray(i)?i:[i];return(e=n.editor).isActive.apply(e,w(o))}},isVisible:function(){return this.editor.isFocused||Object.values(this.submenuVisibility).find((function(n){return n}))},disabled:function(){var n=this;return function(t){return t.action&&!t.action(n.editor.can())}},isChildMenuVisible:function(){var n=this;return function(t){return!!Object.prototype.hasOwnProperty.call(n.submenuVisibility,t.label)&&n.submenuVisibility[t.label]}},allIcons:function(){var n=this;return[].concat(w(this.icons),[{label:t("text","Insert image"),class:"icon-image"},{label:t("text","Formatting help"),class:"icon-info",click:function(){n.$emit("show-help")}}])},childPopoverMenu:function(){var n=this;return function(t,e){return t.map((function(t){return{text:t.label,icon:t.class,active:n.isActive(t),action:function(){n.clickIcon(t),n.hideChildMenu(e)}}}))}},childIconClasses:function(){var n=this;return function(t){var e=n.childIcon(t);return n.getIconClasses(e)}},childIcon:function(){var n=this;return function(t){return t.find((function(t){return n.isActive(t)}))||t[0]}},iconCount:function(){this.forceRecompute,this.windowWidth;var n=this.$refs.menubar&&this.$refs.menubar.clientWidth>200?this.$refs.menubar.clientWidth:200,t=Math.max(Math.floor(n/44)-2,0);return t-1},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var n=this;window.addEventListener("resize",this.getWindowWidth),this.checkInterval=setInterval((function(){var t=n.$refs.menubar&&n.$refs.menubar.clientWidth>0;n.isRichEditor&&t&&n.redrawMenuBar(),n.isRichEditor&&!t||clearInterval(n.checkInterval)}),100)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth)},methods:{redrawMenuBar:function(){var n=this;this.$nextTick((function(){n.getWindowWidth(),n.forceRecompute++}))},refocus:function(){this.editor.chain().focus().run()},clickIcon:function(n){if(n.click)return n.click();var t=n.action(this.editor.chain().focus());t&&t.run()},getWindowWidth:function(n){this.windowWidth=document.documentElement.clientWidth},getWindowHeight:function(n){this.windowHeight=document.documentElement.clientHeight},hideChildMenu:function(n){var t=n.label;this.$set(this.submenuVisibility,t,!1)},toggleChildMenu:function(n){var t=n.label,e=!!Object.prototype.hasOwnProperty.call(this.submenuVisibility,t)&&this.submenuVisibility[t];this.$set(this.submenuVisibility,t,!e),e&&this.refocus()},onImageActionClose:function(){this.showImageLinkPrompt=!1},onUploadImage:function(){this.$refs.imageFileInput.click()},onImageUploadFilePicked:function(n){var e=this;this.uploadingImage=!0;var i=n.target.files[0];if(!B.includes(i.type))return(0,k.x2)(t("text","Image format not supported")),void(this.uploadingImage=!1);n.target.value="",this.syncService.uploadImage(i).then((function(n){var t,i;e.insertAttachmentImage(null===(t=n.data)||void 0===t?void 0:t.name,null===(i=n.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){e.uploadingImage=!1}))},onImageLinkUpdateValue:function(n){this.imageLink=n},onImageLinkSubmit:function(){var n=this;this.imageLink&&(this.uploadingImage=!0,this.showImageLinkPrompt=!1,this.$refs.imageActions[0].closeMenu(),this.syncService.insertImageLink(this.imageLink).then((function(t){var e,i;n.insertAttachmentImage(null===(e=t.data)||void 0===e?void 0:e.name,null===(i=t.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){n.uploadingImage=!1,n.imageLink=""})))},onImagePathSubmit:function(n){var t=this;this.uploadingImage=!0,this.$refs.imageActions[0].closeMenu(),this.syncService.insertImageFile(n).then((function(n){var e,i;t.insertAttachmentImage(null===(e=n.data)||void 0===e?void 0:e.name,null===(i=n.data)||void 0===i?void 0:i.id)})).catch((function(n){var t,e;x.error(n),(0,k.x2)(null==n||null===(t=n.response)||void 0===t||null===(e=t.data)||void 0===e?void 0:e.error)})).then((function(){t.uploadingImage=!1}))},showImagePrompt:function(){var n=this;(0,g.getCurrentUser)()&&OC.dialogs.filepicker(t("text","Insert an image"),(function(t){n.onImagePathSubmit(t)}),!1,[],!0,void 0,this.imagePath)},insertAttachmentImage:function(n,t){var e="text://image?imageFileName="+encodeURIComponent(n),i=n.replaceAll(/[[\]]/g,"");this.editor.chain().setImage({src:e,alt:i}).focus().run()},optimalPathTo:function(n){var t=n.split("/"),e=this.relativePathTo(n).split("/");return e.length<t.length?e.join("/"):n},relativePathTo:function(n){var t=this.filePath.split("/"),e=n.split("/");for(t.pop();t[0]===e[0];)t.shift(),e.shift();return t.fill("..").concat(e).join("/")},addEmoji:function(n,t){return n.action(this.editor.chain(),{id:t.id,native:t.native}).focus().run()},keysString:function(n){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i={ctrl:t("text","Ctrl"),alt:t("text","Alt"),shift:t("text","Shift")};return Object.entries(i).filter((function(n){var t=y(n,2),i=t[0];t[1];return e.includes(i)})).map((function(n){var t=y(n,2);t[0];return t[1]})).concat(n.toUpperCase()).join("+")},getKeys:function(n){return n.keyChar&&!this.isMobile?"(".concat(this.keysString(n.keyChar,n.keyModifiers),")"):""},getLabelAndKeys:function(n){return[n.label,this.getKeys(n)].join(" ")}}};var E=i(93379),D=i.n(E),P=i(7795),L=i.n(P),S=i(90569),U=i.n(S),F=i(3565),j=i.n(F),O=i(19216),T=i.n(O),W=i(44589),G=i.n(W),R=i(48885),H={};H.styleTagTransform=G(),H.setAttributes=j(),H.insert=U().bind(null,"head"),H.domAPI=L(),H.insertStyleElement=T();D()(R.Z,H);R.Z&&R.Z.locals&&R.Z.locals;const $=(0,i(51900).Z)(M,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("div",{staticClass:"menubar",class:{show:n.isVisible,autohide:n.autohide}},[e("input",{ref:"imageFileInput",staticClass:"hidden-visually",attrs:{type:"file",accept:"image/*","aria-hidden":"true"},on:{change:n.onImageUploadFilePicked}}),n._v(" "),n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.allIcons,(function(t,i){return["icon-emoji"===t.class?e("EmojiPicker",{key:t.label,staticClass:"menuitem-emoji",on:{selectData:function(e){return n.addEmoji(t,e)}}},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.t("text","Insert emoji"),expression:"t('text', 'Insert emoji')"}],staticClass:"icon-emoji",attrs:{"aria-label":n.t("text","Insert emoji"),"aria-haspopup":!0},on:{click:function(e){return n.toggleChildMenu(t)}}})]):"icon-image"===t.class?e("Actions",{key:t.label,ref:"imageActions",refInFor:!0,staticClass:"submenu",attrs:{"default-icon":"icon-image"},on:{open:function(e){return n.toggleChildMenu(t)},close:function(e){n.onImageActionClose,n.toggleChildMenu(t)}}},[e("button",{class:{"icon-image":!0,"loading-small":n.uploadingImage},attrs:{slot:"icon",title:t.label,"aria-label":t.label,"aria-haspopup":!0},slot:"icon"}),n._v(" "),e("ActionButton",{attrs:{icon:"icon-upload","close-after-click":!0,disabled:n.uploadingImage},on:{click:function(t){return n.onUploadImage()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Upload from computer"))+"\n\t\t\t\t")]),n._v(" "),n.isPublic?n._e():e("ActionButton",{attrs:{icon:"icon-folder","close-after-click":!0,disabled:n.uploadingImage},on:{click:function(t){return n.showImagePrompt()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Insert from Files"))+"\n\t\t\t\t")]),n._v(" "),n.showImageLinkPrompt?e("ActionInput",{attrs:{icon:"icon-link",value:n.imageLink},on:{"update:value":n.onImageLinkUpdateValue,submit:function(t){return n.onImageLinkSubmit()}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Image link to insert"))+"\n\t\t\t\t")]):e("ActionButton",{attrs:{icon:"icon-link","close-after-click":!1,disabled:n.uploadingImage},on:{click:function(t){n.showImageLinkPrompt=!0}}},[n._v("\n\t\t\t\t\t"+n._s(n.t("text","Insert from link"))+"\n\t\t\t\t")])],1):t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:i<n.iconCount,expression:"$index < iconCount"},{name:"tooltip",rawName:"v-tooltip",value:n.getLabelAndKeys(t),expression:"getLabelAndKeys(icon)"}],key:t.label,class:n.getIconClasses(t),attrs:{disabled:n.disabled(t)},on:{click:function(e){return n.clickIcon(t)}}}):[e("div",{directives:[{name:"show",rawName:"v-show",value:i<n.iconCount||!t.class,expression:"$index < iconCount || !icon.class"},{name:"click-outside",rawName:"v-click-outside",value:function(){return n.hideChildMenu(t)},expression:"() => hideChildMenu(icon)"}],key:t.label,staticClass:"submenu"},[e("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.getLabelAndKeys(t),expression:"getLabelAndKeys(icon)"}],class:n.childIconClasses(t.children),on:{click:function(e){return e.preventDefault(),n.toggleChildMenu(t)}}}),n._v(" "),e("div",{staticClass:"popovermenu menu-center",class:{open:n.isChildMenuVisible(t)}},[e("PopoverMenu",{attrs:{menu:n.childPopoverMenu(t.children,t)}})],1)])]]})),n._v(" "),e("Actions",{on:{open:function(t){return n.toggleChildMenu({label:"Remaining Actions"})},close:function(t){return n.toggleChildMenu({label:"Remaining Actions"})}}},[n._l(n.allIcons,(function(t,i){return[t.class&&n.isHiddenInMenu(i)&&"icon-emoji"!==t.class?e("ActionButton",{directives:[{name:"tooltip",rawName:"v-tooltip",value:n.getKeys(t),expression:"getKeys(icon)"}],key:t.class,attrs:{icon:t.class,"close-after-click":!0},on:{click:function(e){return n.clickIcon(t)}}},[n._v("\n\t\t\t\t\t"+n._s(t.label)+"\n\t\t\t\t")]):n._e()]}))],2)],2):n._e(),n._v(" "),n._t("default",(function(){return[n._v("\n\t\tLeft side\n\t")]}))],2)}),[],!1,null,"1ea2897c",null).exports},19078:(n,e,i)=>{i.r(e),i.d(e,{default:()=>_});var o=i(7049),a=i(52260),r=i(15168),c=i.n(r),l=i(22200),s=i(24144),u=i(16453);const d={name:"MenuBubble",components:{BubbleMenu:o.NM},directives:{tooltip:c()},props:{editor:{type:Object,required:!0},contentWrapper:{type:HTMLDivElement,required:!1,default:null},filePath:{type:String,required:!1,default:""}},data:function(){return{linkUrl:null,linkMenuIsActive:!1,isUsingDirectEditing:null!==(0,u.loadState)("text","directEditingToken",null)}},methods:{showLinkMenu:function(){var n=this,t=(0,a.Jo)(this.editor.state,"link");this.linkUrl=t.href,this.linkMenuIsActive=!0,this.$nextTick((function(){n.$refs.linkInput.focus()}))},hideLinkMenu:function(){this.linkUrl=null,this.linkMenuIsActive=!1},selectFile:function(){var n=this;if((0,l.getCurrentUser)()){var e=this.filePath.split("/").slice(0,-1).join("/");OC.dialogs.filepicker(t("text","Select file to link to"),(function(t){OC.Files.getClient().getFileInfo(t).then((function(t,e){var i=(0,s.Lz)(n.filePath,"".concat(e.path,"/").concat(e.name)).split("/").map(encodeURIComponent).join("/"),o="".concat(i,"?fileId=").concat(e.id);n.editor.chain().setLink({href:o}).focus().run(),n.hideLinkMenu()}))}),!1,[],!0,void 0,e)}},setLinkUrl:function(){var n=this.linkUrl;n&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((function(t){return n.match(t)}))&&(n="https://"+n);var t=n.replaceAll(" ","%20");this.editor.chain().setLink({href:t}).focus().run(),this.hideLinkMenu()},removeLinkUrl:function(){this.editor.chain().unsetLink().focus().run()},isActive:function(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.editor.isActive(n,t)}}};var A=i(93379),p=i.n(A),h=i(7795),m=i.n(h),f=i(90569),C=i.n(f),v=i(3565),b=i.n(v),g=i(19216),k=i.n(g),x=i(44589),y=i.n(x),w=i(48375),I={};I.styleTagTransform=y(),I.setAttributes=b(),I.insert=C().bind(null,"head"),I.domAPI=m(),I.insertStyleElement=k();p()(w.Z,I);w.Z&&w.Z.locals&&w.Z.locals;const _=(0,i(51900).Z)(d,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("BubbleMenu",{staticClass:"menububble",attrs:{editor:n.editor,"tippy-options":{onHide:n.hideLinkMenu,duration:200,placement:"bottom"}}},[n.linkMenuIsActive?e("form",{staticClass:"menububble__form",on:{submit:function(t){return t.preventDefault(),n.setLinkUrl()}}},[e("input",{directives:[{name:"model",rawName:"v-model",value:n.linkUrl,expression:"linkUrl"}],ref:"linkInput",staticClass:"menububble__input",attrs:{type:"text",placeholder:"https://"},domProps:{value:n.linkUrl},on:{keydown:function(t){return!t.type.indexOf("key")&&n._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:n.hideLinkMenu.apply(null,arguments)},input:function(t){t.target.composing||(n.linkUrl=t.target.value)}}}),n._v(" "),e("button",{staticClass:"menububble__button icon-confirm",attrs:{type:"button",tabindex:"0"},on:{click:function(t){return n.setLinkUrl()}}})]):[e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.showLinkMenu()}}},[e("span",{staticClass:"icon-link"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v("\n\t\t\t\t"+n._s(n.isActive("link")?n.t("text","Update Link"):n.t("text","Add Link"))+"\n\t\t\t")])]),n._v(" "),n.isUsingDirectEditing?n._e():e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.selectFile()}}},[e("span",{staticClass:"icon-file"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v(n._s(n.t("text","Link file")))])]),n._v(" "),n.isActive("link")?e("button",{staticClass:"menububble__button",class:{"is-active":n.isActive("link")},on:{click:function(t){return n.removeLinkUrl()}}},[e("span",{staticClass:"icon-delete"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v("\n\t\t\t\t"+n._s(n.t("text","Remove Link"))+"\n\t\t\t")])]):n._e()]],2)}),[],!1,null,"23aa9303",null).exports}}]); +//# sourceMappingURL=editor-rich.js.map?v=48b7f4b4ab1498e4a49d
\ No newline at end of file |