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 db4e12b12..5bc3e32a3 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"],{60435:(n,e,i)=>{i.d(e,{h0:()=>U,Lz:()=>O,YZ:()=>S,tH:()=>j});var o=i(74411),r=i(27594);function a(n,t,e,i,o,r,a){try{var c=n[r](a),l=c.value}catch(n){return void e(n)}c.done?t(l):Promise.resolve(l).then(i,o)}const c={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e("vendors"),i.e("editor")]).then(i.bind(i,93901))}},props:{file:{type:Object,default:null},folder:{type:Object,default:null}},data:function(){return{focus:!1,loaded:!1,ready:!1,autofocus:!1,darkTheme:OCA.Accessibility&&"dark"===OCA.Accessibility.theme,enabled:OCA.Text.RichWorkspaceEnabled}},computed:{shareToken:function(){var n;return null===(n=document.getElementById("sharingToken"))||void 0===n?void 0:n.value},canCreate:function(){return!!(this.folder&&this.folder.permissions&OC.PERMISSION_CREATE)},showEmptyWorkspace:function(){return(!this.file||this.autofocus&&!this.ready)&&this.canCreate},filepath:function(){var n=this.file,t=n.path,e=n.name;return t+(t.endsWith("/")?"":"/")+e}},watch:{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:(0,r.subscribe)("Text::showRichWorkspace",(function(){t.enabled=!0})),(0,r.subscribe)("Text::hideRichWorkspace",(function(){t.enabled=!1}));case 2:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(i,o){var r=n.apply(t,e);function c(n){a(r,i,o,c,l,"next",n)}function l(n){a(r,i,o,c,l,"throw",n)}c(void 0)}))})()},methods:{unfocus:function(){},reset:function(){var n=this;this.focus=!1,this.$nextTick((function(){n.creating=!1}))},createNew:function(){this.creating||(this.creating=!0,this.autofocus=!0,this.file||window.FileList.createFile("Readme.md",{scrollTo:!1,animate:!1}))}}};var l=i(93379),s=i.n(l),u=i(7795),A=i.n(u),d=i(90569),p=i.n(d),h=i(3565),f=i.n(h),m=i(19216),b=i.n(m),C=i(44589),v=i.n(C),g=i(50697),k={};k.styleTagTransform=v(),k.setAttributes=f(),k.insert=p().bind(null,"head"),k.domAPI=A(),k.insertStyleElement=b();s()(g.Z,k);g.Z&&g.Z.locals&&g.Z.locals;const y=(0,i(51900).Z)(c,(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.filepath,"share-token":n.shareToken,active:!0,autohide:!0,mime:n.file.mimetype,autofocus:n.autofocus},on:{ready:function(t){n.ready=!0,n.loaded=!0},focus:function(t){n.focus=!0},blur:n.unfocus,error:n.reset}}):n._e()],1):n._e()}),[],!1,null,"51516775",null).exports;var x=i(79753),w=i(23895),_=i(25108);function I(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),e.push.apply(e,i)}return e}function B(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?I(Object(e),!0).forEach((function(t){D(n,t,e[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):I(Object(e)).forEach((function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}))}return n}function D(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}function E(n){return function(n){if(Array.isArray(n))return M(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return M(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);"Object"===e&&n.constructor&&(e=n.constructor.name);if("Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return M(n,t)}(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 M(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 P="Edit with text app",O=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),r=t.split("/");return o.length<r.length?o.join("/"):t},j=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 file"),templateName:t("text","New text file")+".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(P,i,e)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)},S=function(){var n=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,e=document.getElementById("dir").value;if(!n||""!==e){var r=document.createElement("div");r.id="text-viewer-fallback",document.body.appendChild(r);for(var a=function(e){return OCA.Files.fileActions.register(e,P,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,(0,x.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,38002))]).then((function(i){var o=window.FileList.getCurrentDirectory()+"/"+t,a=i[0].default;a.prototype.t=window.t,a.prototype.n=window.n,a.prototype.OCA=window.OCA;var c=i[1].default;new a({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(r)}))}),t("text","Edit"))},c=0;c<o.SP.length;c++)a(o.SP[c]),OCA.Files.fileActions.setDefault(o.SP[c],P)}},U={el:null,vm:null,attach:function(n){var t=this;if("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});var e="{".concat(OC.Files.Client.NS_NEXTCLOUD,"}rich-workspace-file"),i=n._getWebdavProperties;n._getWebdavProperties=function(){return[].concat(E(i.apply(this,arguments)),[e])};var o=null;n.filesClient.addFileInfoParser((function(i,r){if("httpd/unix-directory"===r.mimetype){var a=i.propStat[0].properties;r.path+(r.path.endsWith("/")?"":"/")+r.name===n.getCurrentDirectory()&&(o=a[e],t.vm.folder={permissions:r.permissions},t.vm.loaded=!0,t.vm.ready=!0)}if(o&&r.id===o)return"text/markdown"!==r.mimetype&&_.warn("Expected workspace file to be markdown:",r),void t.open(r);"Readme.md"===r.name&&"text/markdown"===r.mimetype&&r.path===n.getCurrentDirectory()&&t.open(r)}))}},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=i.extend(y);t.vm=new o({propsData:{file:null,folder:null},store:w.Z}).$mount(t.el),n.$el.on("urlChanged",(function(n){t.vm.file=null,t.vm.folder=null})),n.$el.on("changeDirectory",(function(n){t.vm.file=null,t.vm.folder=null}))}))},open:function(n){var t=this.vm.file,e=parseInt(n.id);this.vm.file=B(B({},n),{},{id:e}),(null==t?void 0:t.id)!==e&&(this.vm.ready=!1)}}},74411:(n,t,e)=>{var i,o;e.d(t,{SP:()=>c,lF:()=>r,w_:()=>a});var r=["text/markdown"],a=["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/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!==(i=window.oc_appswebroots)&&void 0!==i&&i.richdocuments||null!==(o=window.oc_appswebroots)&&void 0!==o&&o.onlyoffice||a.push("text/csv");var c=[].concat(r,a)},79543:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,'.menubar[data-v-6469f3d2]{--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-6469f3d2]{visibility:hidden;opacity:0;transition:visibility .2s .4s,opacity .2s .4s}.menubar.autohide.show[data-v-6469f3d2]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-6469f3d2]{flex-grow:1;margin-left:calc((100% - 660px)/2)}@media(max-width: 660px){.menubar .menubar-icons[data-v-6469f3d2]{margin-left:0}}.menubar[data-v-6469f3d2] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-6469f3d2]{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-6469f3d2]:hover,.menubar button[data-v-6469f3d2]:focus,.menubar button[data-v-6469f3d2]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-6469f3d2]::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-6469f3d2],.menubar button[data-v-6469f3d2]:hover,.menubar button[data-v-6469f3d2]:focus{opacity:1}.menubar button.icon-undo[data-v-6469f3d2],.menubar button.icon-redo[data-v-6469f3d2]{opacity:.8}.menubar button.icon-undo[data-v-6469f3d2]:disabled,.menubar button.icon-redo[data-v-6469f3d2]:disabled{opacity:.4}.menubar .submenu[data-v-6469f3d2],.menubar .menuitem-emoji[data-v-6469f3d2]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}',"",{version:3,sources:["webpack://./src/components/MenuBar.vue"],names:[],mappings:"AA0YA,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.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=a},50141:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,".menububble[data-v-462c6fa4]{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-462c6fa4]{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-462c6fa4]:focus,.menububble__button[data-v-462c6fa4]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-462c6fa4]:last-child{border:0 !important}.menububble__buttontext[data-v-462c6fa4]{padding:.4rem;padding-right:0}.menububble__form[data-v-462c6fa4]{display:flex;align-items:center}.menububble__input[data-v-462c6fa4]{font:inherit;border:none;background:transparent;min-width:250px}","",{version:3,sources:["webpack://./src/components/MenuBubble.vue"],names:[],mappings:"AAwKA,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.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=a},50697:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,'#rich-workspace[data-v-51516775]{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-51516775]{min-height:90px}#rich-workspace[data-v-51516775]:only-child{margin-bottom:0}.empty-workspace[data-v-51516775]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-51516775] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-51516775] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-51516775] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-51516775] #editor{overflow:visible !important}#rich-workspace[data-v-51516775] .content-wrapper{overflow:scroll !important;max-height:calc(40vh - 50px);padding-left:10px;padding-bottom:60px}#rich-workspace[data-v-51516775] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-51516775] .menubar{z-index:61;margin-bottom:-10px}#rich-workspace[data-v-51516775] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-51516775] .editor__content{margin:0}#rich-workspace.focus[data-v-51516775]{max-height:50vh}#rich-workspace[data-v-51516775]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-51516775]: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-51516775]: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-51516775]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-51516775] #editor-container{position:initial}html.ie #rich-workspace[data-v-51516775] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-51516775] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-51516775] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-51516775] #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:"AAkIA,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#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=a},11960:(n,e,i)=>{i.r(e),i.d(e,{default:()=>F});var o=i(15168),r=i.n(o);const a=[{label:t("text","Undo"),keyChar:"z",keyModifiers:["ctrl"],class:"icon-undo",action:function(n){return n.undo()},priority:5},{label:t("text","Redo"),keyChar:"y",keyModifiers:["ctrl"],class:"icon-redo",action:function(n){return n.redo()},priority:11},{label:t("text","Bold"),keyChar:"b",keyModifiers:["ctrl"],class:"icon-bold",isActive:"strong",action:function(n){return n.toggleBold()},priority:6},{label:t("text","Italic"),keyChar:"i",keyModifiers:["ctrl"],class:"icon-italic",isActive:"em",action:function(n){return n.toggleItalic()},priority:7},{label:t("text","Underline"),keyChar:"u",keyModifiers:["ctrl"],class:"icon-underline",isActive:"underline",action:function(n){return n.toggleUnderline()},priority:14},{label:t("text","Strikethrough"),keyChar:"d",keyModifiers:["ctrl"],class:"icon-strike",isActive:"strike",action:function(n){return n.toggleStrike()},priority:15},{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})}}],priority:1},{label:t("text","Unordered list"),keyChar:"8",keyModifiers:["ctrl","shift"],class:"icon-ul",isActive:"bulletList",action:function(n){return n.toggleBulletList()},priority:8},{label:t("text","Ordered list"),keyChar:"9",keyModifiers:["ctrl","shift"],class:"icon-ol",isActive:"orderedList",action:function(n){return n.toggleOrderedList()},priority:9},{label:t("text","ToDo list"),class:"icon-tasklist",isActive:"taskList",action:function(n){return n.toggleTaskList()},priority:10},{label:t("text","Blockquote"),keyChar:">",keyModifiers:["ctrl"],class:"icon-quote",isActive:"blockquote",action:function(n){return n.toggleBlockquote()},priority:12},{label:t("text","Callouts"),visible:!1,children:[{label:t("text","Info"),class:"icon-info",isActive:["callout",{type:"info"}],action:function(n){return n.toggleCallout({type:"info"})}},{label:t("text","Success"),class:"icon-success",isActive:["callout",{type:"success"}],action:function(n){return n.toggleCallout({type:"success"})}},{label:t("text","Warning"),class:"icon-warn",isActive:["callout",{type:"warn"}],action:function(n){return n.toggleCallout({type:"warn"})}},{label:t("text","Danger"),class:"icon-error",isActive:["callout",{type:"error"}],action:function(n){return n.toggleCallout({type:"error"})}}],priority:3},{label:t("text","Code block"),class:"icon-code",isActive:"codeBlock",action:function(n){return n.toggleCodeBlock()},priority:13},{label:t("text","Table"),class:"icon-table",isActive:"table",action:function(n){return n.insertTable()},priority:16},{label:t("text","Emoji picker"),class:"icon-emoji",action:function(n,t){return n.emoji(t)},priority:4},{label:t("text","Insert image"),class:"icon-image",priority:2},{label:t("text","Formatting help"),class:"icon-help",click:function(n){return n.$emit("show-help")},priority:17}];var c=i(88052),l=i(13721),s=i(79440),u=i.n(s),A=i(56286),d=i.n(A),p=i(26533),h=i.n(p),f=i(64056),m=i.n(f),b=i(2649),C=i.n(b),v=i(22200),g=i(27594);function k(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,r=[],a=!0,c=!1;try{for(e=e.call(n);!(a=(i=e.next()).done)&&(r.push(i.value),!t||r.length!==t);a=!0);}catch(n){c=!0,o=n}finally{try{a||null==e.return||e.return()}finally{if(c)throw o}}return r}(n,t)||x(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 y(n){return function(n){if(Array.isArray(n))return w(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||x(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 x(n,t){if(n){if("string"==typeof n)return w(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)?w(n,t):void 0}}function w(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}const _={name:"MenuBar",components:{ActionButton:d(),PopoverMenu:h(),Actions:u(),EmojiPicker:m()},directives:{Tooltip:r(),ClickOutside:C()},mixins:[c.Z,l.Cy],props:{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},uploadingImages:{type:Boolean,default:!1}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,icons:y(a)}},computed:{isHiddenInMenu:function(){var n=this;return function(t){return t.priority>n.iconCount}},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,y(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]}},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)-4;return Math.floor(n/44)-1},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var n=this;window.addEventListener("resize",this.getWindowWidth),(0,g.subscribe)("files:sidebar:opened",this.redrawAfterTransition),(0,g.subscribe)("files:sidebar:closed",this.redrawAfterTransition),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),this.$emit("update:loaded",!0)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth),(0,g.unsubscribe)("files:sidebar:opened",this.redrawAfterTransition),(0,g.unsubscribe)("files:sidebar:closed",this.redrawAfterTransition)},methods:{redrawAfterTransition:function(){setTimeout(this.redrawMenuBar,110)},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(this);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)},hasSubmenu:function(n){return"icon-emoji"===n.class||n.children},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()},onUploadImage:function(){this.$refs.imageFileInput.click()},onImageUploadFilePicked:function(n){this.$emit("image-upload",n.target.files),n.target.value=""},showImagePrompt:function(){var n=this;(0,v.getCurrentUser)()&&OC.dialogs.filepicker(t("text","Insert an image"),(function(t){n.$emit("image-insert",t)}),!1,[],!0,void 0,this.imagePath)},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=k(n,2),i=t[0];t[1];return e.includes(i)})).map((function(n){var t=k(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 I=i(93379),B=i.n(I),D=i(7795),E=i.n(D),M=i(90569),P=i.n(M),O=i(3565),j=i.n(O),S=i(19216),U=i.n(S),T=i(44589),W=i.n(T),L=i(79543),$={};$.styleTagTransform=W(),$.setAttributes=j(),$.insert=P().bind(null,"head"),$.domAPI=E(),$.insertStyleElement=U();B()(L.Z,$);L.Z&&L.Z.locals&&L.Z.locals;const F=(0,i(51900).Z)(_,(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",multiple:!0},on:{change:n.onImageUploadFilePicked}}),n._v(" "),n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.icons,(function(t){return["icon-emoji"===t.class?e("EmojiPicker",{directives:[{name:"show",rawName:"v-show",value:t.priority<=n.iconCount,expression:"icon.priority <= iconCount"}],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){return n.toggleChildMenu(t)}}},[e("button",{class:{"icon-image":!0,"loading-small":n.uploadingImages},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.uploadingImages},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.uploadingImages},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")])],1):t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:t.priority<=n.iconCount,expression:"icon.priority <= 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:t.priority<=n.iconCount,expression:"icon.priority <= iconCount"},{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.icons,(function(t){return[t.class&&n.isHiddenInMenu(t)&&!n.hasSubmenu(t)?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,"6469f3d2",null).exports},71747:(n,e,i)=>{i.r(e),i.d(e,{default:()=>B});var o=i(7049),r=i(19958),a=i(15168),c=i.n(a),l=i(22200),s=i(60435),u=i(16453),A=i(13721);const d={name:"MenuBubble",components:{BubbleMenu:o.NM},directives:{tooltip:c()},mixins:[A.Cy],props:{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,r.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 p=i(93379),h=i.n(p),f=i(7795),m=i.n(f),b=i(90569),C=i.n(b),v=i(3565),g=i.n(v),k=i(19216),y=i.n(k),x=i(44589),w=i.n(x),_=i(50141),I={};I.styleTagTransform=w(),I.setAttributes=g(),I.insert=C().bind(null,"head"),I.domAPI=m(),I.insertStyleElement=y();h()(_.Z,I);_.Z&&_.Z.locals&&_.Z.locals;const B=(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,"462c6fa4",null).exports}}]); -//# sourceMappingURL=editor-rich.js.map?v=4aa5576ec4577f90d3d3
\ No newline at end of file +"use strict";(self.webpackChunktext=self.webpackChunktext||[]).push([["editor-rich"],{51156:(n,e,i)=>{i.d(e,{h0:()=>S,Lz:()=>E,YZ:()=>P,tH:()=>D});var o=i(74411),r=i(4820),a=i(79753),c=i(27594);function l(n,t,e,i,o,r,a){try{var c=n[r](a),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,a.generateOcsUrl)("apps/text"+(s?"/public":"")+"/workspace",2);const A={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e("vendors"),i.e("editor")]).then(i.bind(i,93901))}},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(){var n;return null===(n=document.getElementById("sharingToken"))||void 0===n?void 0:n.value},canCreate:function(){return!!(this.folder&&this.folder.permissions&OC.PERMISSION_CREATE)},showEmptyWorkspace:function(){return(!this.file||this.autofocus&&!this.ready)&&this.canCreate},filepath:function(){var n=this.file,t=n.path,e=n.name;return t+(t.endsWith("/")?"":"/")+e}},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 r=n.apply(t,e);function a(n){l(r,i,o,a,c,"next",n)}function c(n){l(r,i,o,a,c,"throw",n)}a(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),r.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 d=i(93379),p=i.n(d),h=i(7795),f=i.n(h),C=i(90569),b=i.n(C),m=i(3565),v=i.n(m),g=i(19216),k=i.n(g),y=i(44589),x=i.n(y),w=i(54581),_={};_.styleTagTransform=x(),_.setAttributes=v(),_.insert=b().bind(null,"head"),_.domAPI=f(),_.insertStyleElement=k();p()(w.Z,_);w.Z&&w.Z.locals&&w.Z.locals;const I=(0,i(51900).Z)(A,(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,n.loaded=!0},focus:function(t){n.focus=!0},blur:n.unfocus,error:n.reset}}):n._e()],1):n._e()}),[],!1,null,"23f5a23e",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),r=t.split("/");return o.length<r.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 file"),templateName:t("text","New text file")+".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 r=document.createElement("div");r.id="text-viewer-fallback",document.body.appendChild(r);for(var c=function(e){return OCA.Files.fileActions.register(e,M,OC.PERMISSION_UPDATE|OC.PERMISSION_READ,(0,a.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,38002))]).then((function(i){var o=window.FileList.getCurrentDirectory()+"/"+t,a=i[0].default;a.prototype.t=window.t,a.prototype.n=window.n,a.prototype.OCA=window.OCA;var c=i[1].default;new a({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(r)}))}),t("text","Edit"))},l=0;l<o.SP.length;l++)c(o.SP[l]),OCA.Files.fileActions.setDefault(o.SP[l],M)}},S={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(I))({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)=>{var i,o;e.d(t,{SP:()=>c,lF:()=>r,w_:()=>a});var r=["text/markdown"],a=["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/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!==(i=window.oc_appswebroots)&&void 0!==i&&i.richdocuments||null!==(o=window.oc_appswebroots)&&void 0!==o&&o.onlyoffice||a.push("text/csv");var c=[].concat(r,a)},79543:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,'.menubar[data-v-6469f3d2]{--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-6469f3d2]{visibility:hidden;opacity:0;transition:visibility .2s .4s,opacity .2s .4s}.menubar.autohide.show[data-v-6469f3d2]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-6469f3d2]{flex-grow:1;margin-left:calc((100% - 660px)/2)}@media(max-width: 660px){.menubar .menubar-icons[data-v-6469f3d2]{margin-left:0}}.menubar[data-v-6469f3d2] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-6469f3d2]{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-6469f3d2]:hover,.menubar button[data-v-6469f3d2]:focus,.menubar button[data-v-6469f3d2]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-6469f3d2]::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-6469f3d2],.menubar button[data-v-6469f3d2]:hover,.menubar button[data-v-6469f3d2]:focus{opacity:1}.menubar button.icon-undo[data-v-6469f3d2],.menubar button.icon-redo[data-v-6469f3d2]{opacity:.8}.menubar button.icon-undo[data-v-6469f3d2]:disabled,.menubar button.icon-redo[data-v-6469f3d2]:disabled{opacity:.4}.menubar .submenu[data-v-6469f3d2],.menubar .menuitem-emoji[data-v-6469f3d2]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}',"",{version:3,sources:["webpack://./src/components/MenuBar.vue"],names:[],mappings:"AA0YA,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.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=a},50141:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,".menububble[data-v-462c6fa4]{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-462c6fa4]{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-462c6fa4]:focus,.menububble__button[data-v-462c6fa4]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-462c6fa4]:last-child{border:0 !important}.menububble__buttontext[data-v-462c6fa4]{padding:.4rem;padding-right:0}.menububble__form[data-v-462c6fa4]{display:flex;align-items:center}.menububble__input[data-v-462c6fa4]{font:inherit;border:none;background:transparent;min-width:250px}","",{version:3,sources:["webpack://./src/components/MenuBubble.vue"],names:[],mappings:"AAwKA,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.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=a},54581:(n,t,e)=>{e.d(t,{Z:()=>c});var i=e(87537),o=e.n(i),r=e(23645),a=e.n(r)()(o());a.push([n.id,'#rich-workspace[data-v-23f5a23e]{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-23f5a23e]{min-height:90px}#rich-workspace[data-v-23f5a23e]:only-child{margin-bottom:0}.empty-workspace[data-v-23f5a23e]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-23f5a23e] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-23f5a23e] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-23f5a23e] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-23f5a23e] #editor{overflow:visible !important}#rich-workspace[data-v-23f5a23e] .content-wrapper{overflow:scroll !important;max-height:calc(40vh - 50px);padding-left:10px;padding-bottom:60px}#rich-workspace[data-v-23f5a23e] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-23f5a23e] .menubar{z-index:61;margin-bottom:-10px}#rich-workspace[data-v-23f5a23e] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-23f5a23e] .editor__content{margin:0}#rich-workspace.focus[data-v-23f5a23e]{max-height:50vh}#rich-workspace[data-v-23f5a23e]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-23f5a23e]: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-23f5a23e]: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-23f5a23e]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-23f5a23e] #editor-container{position:initial}html.ie #rich-workspace[data-v-23f5a23e] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-23f5a23e] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-23f5a23e] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-23f5a23e] #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:"AA8KA,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\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=a},11960:(n,e,i)=>{i.r(e),i.d(e,{default:()=>j});var o=i(15168),r=i.n(o);const a=[{label:t("text","Undo"),keyChar:"z",keyModifiers:["ctrl"],class:"icon-undo",action:function(n){return n.undo()},priority:5},{label:t("text","Redo"),keyChar:"y",keyModifiers:["ctrl"],class:"icon-redo",action:function(n){return n.redo()},priority:11},{label:t("text","Bold"),keyChar:"b",keyModifiers:["ctrl"],class:"icon-bold",isActive:"strong",action:function(n){return n.toggleBold()},priority:6},{label:t("text","Italic"),keyChar:"i",keyModifiers:["ctrl"],class:"icon-italic",isActive:"em",action:function(n){return n.toggleItalic()},priority:7},{label:t("text","Underline"),keyChar:"u",keyModifiers:["ctrl"],class:"icon-underline",isActive:"underline",action:function(n){return n.toggleUnderline()},priority:14},{label:t("text","Strikethrough"),keyChar:"d",keyModifiers:["ctrl"],class:"icon-strike",isActive:"strike",action:function(n){return n.toggleStrike()},priority:15},{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})}}],priority:1},{label:t("text","Unordered list"),keyChar:"8",keyModifiers:["ctrl","shift"],class:"icon-ul",isActive:"bulletList",action:function(n){return n.toggleBulletList()},priority:8},{label:t("text","Ordered list"),keyChar:"9",keyModifiers:["ctrl","shift"],class:"icon-ol",isActive:"orderedList",action:function(n){return n.toggleOrderedList()},priority:9},{label:t("text","ToDo list"),class:"icon-tasklist",isActive:"taskList",action:function(n){return n.toggleTaskList()},priority:10},{label:t("text","Blockquote"),keyChar:">",keyModifiers:["ctrl"],class:"icon-quote",isActive:"blockquote",action:function(n){return n.toggleBlockquote()},priority:12},{label:t("text","Callouts"),visible:!1,children:[{label:t("text","Info"),class:"icon-info",isActive:["callout",{type:"info"}],action:function(n){return n.toggleCallout({type:"info"})}},{label:t("text","Success"),class:"icon-success",isActive:["callout",{type:"success"}],action:function(n){return n.toggleCallout({type:"success"})}},{label:t("text","Warning"),class:"icon-warn",isActive:["callout",{type:"warn"}],action:function(n){return n.toggleCallout({type:"warn"})}},{label:t("text","Danger"),class:"icon-error",isActive:["callout",{type:"error"}],action:function(n){return n.toggleCallout({type:"error"})}}],priority:3},{label:t("text","Code block"),class:"icon-code",isActive:"codeBlock",action:function(n){return n.toggleCodeBlock()},priority:13},{label:t("text","Table"),class:"icon-table",isActive:"table",action:function(n){return n.insertTable()},priority:16},{label:t("text","Emoji picker"),class:"icon-emoji",action:function(n,t){return n.emoji(t)},priority:4},{label:t("text","Insert image"),class:"icon-image",priority:2},{label:t("text","Formatting help"),class:"icon-help",click:function(n){return n.$emit("show-help")},priority:17}];var c=i(88052),l=i(13721),s=i(79440),u=i.n(s),A=i(56286),d=i.n(A),p=i(26533),h=i.n(p),f=i(64056),C=i.n(f),b=i(2649),m=i.n(b),v=i(22200),g=i(27594);function k(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,r=[],a=!0,c=!1;try{for(e=e.call(n);!(a=(i=e.next()).done)&&(r.push(i.value),!t||r.length!==t);a=!0);}catch(n){c=!0,o=n}finally{try{a||null==e.return||e.return()}finally{if(c)throw o}}return r}(n,t)||x(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 y(n){return function(n){if(Array.isArray(n))return w(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||x(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 x(n,t){if(n){if("string"==typeof n)return w(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)?w(n,t):void 0}}function w(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}const _={name:"MenuBar",components:{ActionButton:d(),PopoverMenu:h(),Actions:u(),EmojiPicker:C()},directives:{Tooltip:r(),ClickOutside:m()},mixins:[c.Z,l.Cy],props:{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},uploadingImages:{type:Boolean,default:!1}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,icons:y(a)}},computed:{isHiddenInMenu:function(){var n=this;return function(t){return t.priority>n.iconCount}},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,y(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]}},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)-4;return Math.floor(n/44)-1},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var n=this;window.addEventListener("resize",this.getWindowWidth),(0,g.subscribe)("files:sidebar:opened",this.redrawAfterTransition),(0,g.subscribe)("files:sidebar:closed",this.redrawAfterTransition),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),this.$emit("update:loaded",!0)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth),(0,g.unsubscribe)("files:sidebar:opened",this.redrawAfterTransition),(0,g.unsubscribe)("files:sidebar:closed",this.redrawAfterTransition)},methods:{redrawAfterTransition:function(){setTimeout(this.redrawMenuBar,110)},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(this);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)},hasSubmenu:function(n){return"icon-emoji"===n.class||n.children},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()},onUploadImage:function(){this.$refs.imageFileInput.click()},onImageUploadFilePicked:function(n){this.$emit("image-upload",n.target.files),n.target.value=""},showImagePrompt:function(){var n=this;(0,v.getCurrentUser)()&&OC.dialogs.filepicker(t("text","Insert an image"),(function(t){n.$emit("image-insert",t)}),!1,[],!0,void 0,this.imagePath)},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=k(n,2),i=t[0];t[1];return e.includes(i)})).map((function(n){var t=k(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 I=i(93379),B=i.n(I),M=i(7795),E=i.n(M),D=i(90569),P=i.n(D),S=i(3565),T=i.n(S),U=i(19216),F=i.n(U),L=i(44589),W=i.n(L),O=i(79543),$={};$.styleTagTransform=W(),$.setAttributes=T(),$.insert=P().bind(null,"head"),$.domAPI=E(),$.insertStyleElement=F();B()(O.Z,$);O.Z&&O.Z.locals&&O.Z.locals;const j=(0,i(51900).Z)(_,(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",multiple:!0},on:{change:n.onImageUploadFilePicked}}),n._v(" "),n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.icons,(function(t){return["icon-emoji"===t.class?e("EmojiPicker",{directives:[{name:"show",rawName:"v-show",value:t.priority<=n.iconCount,expression:"icon.priority <= iconCount"}],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){return n.toggleChildMenu(t)}}},[e("button",{class:{"icon-image":!0,"loading-small":n.uploadingImages},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.uploadingImages},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.uploadingImages},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")])],1):t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:t.priority<=n.iconCount,expression:"icon.priority <= 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:t.priority<=n.iconCount,expression:"icon.priority <= iconCount"},{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.icons,(function(t){return[t.class&&n.isHiddenInMenu(t)&&!n.hasSubmenu(t)?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,"6469f3d2",null).exports},71747:(n,e,i)=>{i.r(e),i.d(e,{default:()=>B});var o=i(7049),r=i(19958),a=i(15168),c=i.n(a),l=i(22200),s=i(51156),u=i(16453),A=i(13721);const d={name:"MenuBubble",components:{BubbleMenu:o.NM},directives:{tooltip:c()},mixins:[A.Cy],props:{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,r.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 p=i(93379),h=i.n(p),f=i(7795),C=i.n(f),b=i(90569),m=i.n(b),v=i(3565),g=i.n(v),k=i(19216),y=i.n(k),x=i(44589),w=i.n(x),_=i(50141),I={};I.styleTagTransform=w(),I.setAttributes=g(),I.insert=m().bind(null,"head"),I.domAPI=C(),I.insertStyleElement=y();h()(_.Z,I);_.Z&&_.Z.locals&&_.Z.locals;const B=(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,"462c6fa4",null).exports}}]); +//# sourceMappingURL=editor-rich.js.map?v=5c1e8428711242379818
\ No newline at end of file |