Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/editor-rich.js')
-rw-r--r--js/editor-rich.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/editor-rich.js b/js/editor-rich.js
index 108f573e0..37a061b17 100644
--- a/js/editor-rich.js
+++ b/js/editor-rich.js
@@ -1,4 +1,4 @@
-(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[192],{13:function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o}));
+(window.textWebpackJsonp=window.textWebpackJsonp||[]).push([[192],{13:function(n,t,e){"use strict";e.d(t,"a",(function(){return a})),e.d(t,"b",(function(){return i})),e.d(t,"c",(function(){return o}));
/*
* @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>
*
@@ -20,5 +20,5 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-var i=["text/markdown"],o=["text/plain","application/cmd","application/x-empty","application/x-msdos-program","application/epub+zip","application/javascript","application/json","application/x-perl","application/x-php","application/x-tex","application/xml","application/yaml","text/css","text/csv","text/html","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)},165:function(t,e,n){"use strict";var i=n(27);n.n(i).a},166:function(t,e,n){(e=n(49)(!1)).push([t.i,"#rich-workspace[data-v-374052d2]{padding:0 50px;margin-bottom:-24px;text-align:left;max-height:0;transition:max-height 0.5s cubic-bezier(0, 1, 0, 1)}#rich-workspace.creatable[data-v-374052d2]{min-height:90px}#rich-workspace[data-v-374052d2]:only-child{margin-bottom:0}.empty-workspace[data-v-374052d2]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-374052d2] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-374052d2] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-374052d2] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-374052d2] #editor{overflow:scroll !important;max-height:50vh;padding-left:10px}#rich-workspace[data-v-374052d2] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-374052d2] .menubar{z-index:50;margin-bottom:-10px}#rich-workspace[data-v-374052d2] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-374052d2] .editor__content{margin:0}#rich-workspace.focus[data-v-374052d2]{max-height:50vh}#rich-workspace[data-v-374052d2]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-374052d2]: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-374052d2]: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-374052d2]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-374052d2] #editor-container{position:initial}html.ie #rich-workspace[data-v-374052d2] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-374052d2] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-374052d2] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-374052d2] #editor>div:nth-child(2){min-height:44px;overflow-x:hidden;overflow-y:auto;flex-shrink:1}\n",""]),t.exports=e},222:function(t,e,n){var i=n(652);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(50).default)("36b499c6",i,!0,{})},223:function(t,e,n){var i=n(654);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(50).default)("ce1e969a",i,!0,{})},27:function(t,e,n){var i=n(166);"string"==typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);(0,n(50).default)("3d326a91",i,!0,{})},28:function(e,n,i){"use strict";i.d(n,"b",(function(){return b})),i.d(n,"c",(function(){return m})),i.d(n,"d",(function(){return v})),i.d(n,"a",(function(){return g}));var o=i(13),a=i(29),r=i.n(a),c=i(11),l=i(14);function s(t,e,n,i,o,a,r){try{var c=t[a](r),l=c.value}catch(t){return void n(t)}c.done?e(l):Promise.resolve(l).then(i,o)}var u=!!document.getElementById("isPublic"),d=Object(c.generateOcsUrl)("apps/text"+(u?"/public":""),2)+"workspace",h={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e(0),i.e(188),i.e(197),i.e(189)]).then(i.bind(null,176))}},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(t){t||document.querySelector("#editor").scrollTo(0,0)}},mounted:function(){var t,e=this;return(t=regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.enabled&&e.getFileInfo(),Object(l.subscribe)("Text::showRichWorkspace",(function(){e.enabled=!0,e.getFileInfo()})),Object(l.subscribe)("Text::hideRichWorkspace",(function(){e.enabled=!1}));case 3:case"end":return t.stop()}}),t)})),function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function r(t){s(a,i,o,r,c,"next",t)}function c(t){s(a,i,o,r,c,"throw",t)}r(void 0)}))})()},methods:{unfocus:function(){},reset:function(){var t=this;this.file=null,this.focus=!1,this.$nextTick((function(){t.creating=!1,t.getFileInfo()}))},getFileInfo:function(){var t=this;this.loaded=!1,this.autofocus=!1,this.ready=!1;var e={path:this.path};return u&&(e.shareToken=this.shareToken),r.a.get(d,{params:e}).then((function(e){var n=e.data.ocs.data;return t.folder=n.folder||null,t.file=n.file,t.editing=!0,t.loaded=!0,!0})).catch((function(e){return e.response.data.ocs&&e.response.data.ocs.data.folder?t.folder=e.response.data.ocs.data.folder:t.folder=null,t.file=null,t.loaded=!0,t.ready=!0,t.creating=!1,!1}))},createNew:function(){var t=this;this.creating||(this.creating=!0,this.getFileInfo().then((function(e){t.autofocus=!0,e||window.FileList.createFile("Readme.md",{scrollTo:!1,animate:!1}).then((function(e,n){t.getFileInfo()}))})))}}},f=(i(165),i(18)),p=Object(f.a)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.enabled?n("div",{class:{"icon-loading":!t.loaded||!t.ready,focus:t.focus,dark:t.darkTheme,creatable:t.canCreate},attrs:{id:"rich-workspace"}},[t.showEmptyWorkspace?n("div",{staticClass:"empty-workspace",on:{click:t.createNew}},[n("p",{staticClass:"placeholder"},[t._v("\n\t\t\t"+t._s(t.t("text","Add notes, lists or links …"))+"\n\t\t")])]):t._e(),t._v(" "),t.file?n("EditorWrapper",{directives:[{name:"show",rawName:"v-show",value:t.ready,expression:"ready"}],key:t.file.id,attrs:{"file-id":t.file.id,"relative-path":t.file.path,"share-token":t.shareToken,active:!0,autohide:!0,mime:t.file.mimetype,autofocus:t.autofocus},on:{ready:function(e){t.ready=!0},focus:function(e){t.focus=!0},blur:t.unfocus,error:t.reset}}):t._e()],1):t._e()}),[],!1,null,"374052d2",null).exports,b=function(t,e){var n=t.split("/"),i=e.split("/");for(n.pop();n[0]===i[0];)n.shift(),i.shift();var o=n.fill("..").concat(i),a=e.split("/");return o.length<a.length?o.join("/"):e},v=function(){var e={attach:function(e){var n=e.fileList;"files"!==n.id&&"files.public"!==n.id||e.addMenuEntry({id:"file",displayName:t("text","New text document"),templateName:t("text","New text document")+".md",iconClass:"icon-filetype-text",fileType:"file",actionHandler:function(t){n.createFile(t).then((function(t,e){var i=new OCA.Files.FileInfoModel(e);void 0!==OCA.Viewer?OCA.Files.fileActions.triggerAction("view",i,n):void 0===OCA.Viewer&&OCA.Files.fileActions.triggerAction("Edit with text app",i,n)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",e)},m=function(){var e,n=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,a=document.getElementById("dir").value;if(!n||""!==a){var r=document.createElement("div");r.id="text-viewer-fallback",document.body.appendChild(r);for(var l=0;l<o.a.length;l++)e=o.a[l],OCA.Files.fileActions.register(e,"Edit with text app",OC.PERMISSION_UPDATE|OC.PERMISSION_READ,Object(c.imagePath)("core","actions/rename"),(function(t){var e=window.FileList.findFile(t);Promise.all([i.e(0).then(i.bind(null,45)),Promise.all([i.e(1),i.e(0),i.e(188),i.e(199),i.e(194)]).then(i.bind(null,682))]).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){return t(c,{props:{fileId:e?e.id:null,active:!0,shareToken:n,relativePath:o,mimeType:e.mimetype}})}}).$mount(r)}))}),t("text","Edit")),OCA.Files.fileActions.setDefault(o.a[l],"Edit with text app")}},g={el:null,attach:function(t){"files"!==t.id&&"files.public"!==t.id||(this.el=document.createElement("div"),t.registerHeader({id:"workspace",el:this.el,render:this.render.bind(this),priority:10}))},render:function(t){var e=this;"files"!==t.id&&"files.public"!==t.id||i.e(0).then(i.bind(null,45)).then((function(n){var i=n.default;e.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(p))({propsData:{path:t.getCurrentDirectory()}}).$mount(e.el);t.$el.on("changeDirectory",(function(t){o.path=t.dir.toString()}))}))}}},651:function(t,e,n){"use strict";var i=n(222);n.n(i).a},652:function(t,e,n){(e=n(49)(!1)).push([t.i,".menubar[data-v-0d0204aa]{position:fixed;position:-webkit-sticky;position:sticky;top:0;display:flex;z-index:10010;background-color:var(--color-main-background-translucent);height:44px}.menubar.autohide[data-v-0d0204aa]{visibility:hidden;opacity:0;transition:visibility 0.2s 0.4s, opacity 0.2s 0.4s}.menubar.autohide.is-focused[data-v-0d0204aa]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-0d0204aa]{flex-grow:1;margin-left:calc((100% - 660px) / 2)}@media (max-width: 660px){.menubar .menubar-icons[data-v-0d0204aa]{margin-left:0}}.menubar[data-v-0d0204aa] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-0d0204aa]{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-0d0204aa]:hover,.menubar button[data-v-0d0204aa]:focus,.menubar button[data-v-0d0204aa]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-0d0204aa],.menubar button[data-v-0d0204aa]:hover,.menubar button[data-v-0d0204aa]:focus{opacity:1}.menubar button.icon-undo[data-v-0d0204aa],.menubar button.icon-redo[data-v-0d0204aa]{opacity:.4}.menubar .submenu[data-v-0d0204aa]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}\n",""]),t.exports=e},653:function(t,e,n){"use strict";var i=n(223);n.n(i).a},654:function(t,e,n){(e=n(49)(!1)).push([t.i,".menububble[data-v-7a686b54]{position:absolute;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-bottom:-3px;margin-left:10px;visibility:hidden;opacity:0;transform:translateX(-50%);transition:opacity 0.2s, visibility 0.2s;height:44px}.menububble.is-active[data-v-7a686b54]{opacity:1;visibility:visible}.menububble__button[data-v-7a686b54]{display:block;flex-grow:1;border:0;padding:0.9rem 0.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-7a686b54]:focus,.menububble__button[data-v-7a686b54]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-7a686b54]:last-child{border:0 !important}.menububble__buttontext[data-v-7a686b54]{padding:0.4rem;padding-right:0}.menububble__form[data-v-7a686b54]{display:flex;align-items:center}.menububble__input[data-v-7a686b54]{font:inherit;border:none;background:transparent;min-width:150px}\n",""]),t.exports=e},681:function(e,n,i){"use strict";i.r(n);var o=i(184),a=i(187),r=i.n(a),c=[{label:t("text","Undo"),class:"icon-undo",isActive:function(t){},action:function(t){return t.undo()}},{label:t("text","Redo"),class:"icon-redo",isActive:function(t){},action:function(t){return t.redo()}},{label:t("text","Bold"),class:"icon-bold",isActive:function(t){return t.strong()},action:function(t){return t.strong()}},{label:t("text","Italic"),class:"icon-italic",isActive:function(t){return t.em()},action:function(t){return t.em()}},{label:t("text","Strikethrough"),class:"icon-strike",isActive:function(t){return t.strike()},action:function(t){return t.strike()}},{label:t("text","Headings"),visible:!1,children:[{label:t("text","Heading 1"),class:"icon-h1",isActive:function(t){return t.heading({level:1})},action:function(t){return t.heading({level:1})}},{label:t("text","Heading 2"),class:"icon-h2",isActive:function(t){return t.heading({level:2})},action:function(t){return t.heading({level:2})}},{label:t("text","Heading 3"),class:"icon-h3",isActive:function(t){return t.heading({level:3})},action:function(t){return t.heading({level:3})}},{label:t("text","Heading 4"),class:"icon-h4",isActive:function(t){return t.heading({level:4})},action:function(t){return t.heading({level:4})}},{label:t("text","Heading 5"),class:"icon-h5",isActive:function(t){return t.heading({level:5})},action:function(t){return t.heading({level:5})}},{label:t("text","Heading 6"),class:"icon-h6",isActive:function(t){return t.heading({level:6})},action:function(t){return t.heading({level:6})}}]},{label:t("text","Unordered list"),class:"icon-ul",isActive:function(t){return t.bullet_list()},action:function(t){return t.bullet_list_item()}},{label:t("text","Ordered list"),class:"icon-ol",isActive:function(t){return t.ordered_list()},action:function(t){return t.ordered_list()}},{label:t("text","ToDo list"),class:"icon-checkmark",isActive:function(t){return!1},action:function(t){return t.todo_item()}},{label:t("text","Blockquote"),class:"icon-quote",isActive:function(t){return t.blockquote()},action:function(t){return t.blockquote()}},{label:t("text","Code block"),class:"icon-code",isActive:function(t){return t.code_block()},action:function(t){return t.code_block()}}],l=i(28),s=i(648),u=i.n(s),d=i(649),h=i.n(d),f=i(221),p=i.n(f),b=i(650),v=i.n(b),m=i(109);function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],i=!0,o=!1,a=void 0;try{for(var r,c=t[Symbol.iterator]();!(i=(r=c.next()).done)&&(n.push(r.value),!e||n.length!==e);i=!0);}catch(t){o=!0,a=t}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return n}(t,e)||x(t,e)||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 k(t){return function(t){if(Array.isArray(t))return w(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||x(t)||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(t,e){if(t){if("string"==typeof t)return w(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(t,e):void 0}}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var y={name:"MenuBar",components:{EditorMenuBar:o.c,ActionButton:h.a,PopoverMenu:p.a,Actions:u.a},directives:{Tooltip:r.a,ClickOutside:v.a},props:{editor:{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:""}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,icons:k(c)}},computed:{isHiddenInMenu:function(){var t=this;return function(e){return e-t.iconCount>=0}},getIconClasses:function(){return function(t,e){var n={"is-active":e.isActive(t)};return n[e.class]=!0,n}},isChildMenuVisible:function(){var t=this;return function(e){return!!Object.prototype.hasOwnProperty.call(t.submenuVisibility,e.label)&&t.submenuVisibility[e.label]}},allIcons:function(){var e=this;return this.isPublic?this.icons:[].concat(k(this.icons),[{label:t("text","Insert image"),class:"icon-image",isActive:function(){},action:function(t){e.showImagePrompt(t.image)}}])},childPopoverMenu:function(){var t=this;return function(e,n,i,o){var a=[],r=function(r){a.push({text:i[r].label,icon:i[r].class,action:function(){i[r].action(n),t.hideChildMenu(o)},active:i[r].isActive(e)})};for(var c in i)r(c);return a}},childIconClasses:function(){var t=this;return function(e,n){var i=t.childIcon(e,n);return t.getIconClasses(e,i)}},childIcon:function(){return function(t,e){for(var n in e){var i=e[n];if(i.isActive(t))return i}return e[0]}},iconCount:function(){this.forceRecompute,this.windowWidth;var t=this.$refs.menubar&&this.$refs.menubar.clientWidth>200?this.$refs.menubar.clientWidth:200,e=Math.max(Math.floor(t/44)-2,0);return e},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var t=this;window.addEventListener("resize",this.getWindowWidth),this.checkInterval=setInterval((function(){var e=t.$refs.menubar&&t.$refs.menubar.clientWidth>0;t.isRichEditor&&e&&t.redrawMenuBar(),t.isRichEditor&&!e||clearInterval(t.checkInterval)}),100)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth)},methods:{redrawMenuBar:function(){var t=this;this.$nextTick((function(){t.getWindowWidth(),t.forceRecompute++}))},clickIcon:function(t,e){return e.action(t)},getWindowWidth:function(t){this.windowWidth=document.documentElement.clientWidth},getWindowHeight:function(t){this.windowHeight=document.documentElement.clientHeight},hideChildMenu:function(t){this.$set(this.submenuVisibility,t.label,!1)},toggleChildMenu:function(t){var e=!!Object.prototype.hasOwnProperty.call(this.submenuVisibility,t.label)&&this.submenuVisibility[t.label];this.$set(this.submenuVisibility,t.label,!e)},showImagePrompt:function(e){var n=this;if(Object(m.getCurrentUser)()){var i=e;OC.dialogs.filepicker(t("text","Insert an image"),(function(t){OC.Files.getClient().getFileInfo(t).then((function(t,e){n.lastImagePath=e.path;var o={mimetype:e.mimetype,hasPreview:e.hasPreview},a=Object(l.b)(n.filePath,"".concat(e.path,"/").concat(e.name)).split("/").map(encodeURIComponent).join("/"),r=Object.entries(o).map((function(t){var e=g(t,2),n=e[0],i=e[1];return"".concat(n,"=").concat(encodeURIComponent(i))})).join("&"),c="".concat(a,"?fileId=").concat(e.id,"#").concat(r);i({src:c,alt:e.name})}))}),!1,[],!0,void 0,this.imagePath)}},showLinkPrompt:function(t){var e=this;if(OC.getCurrentUser()){var n=t;OC.dialogs.filepicker("Insert a link",(function(t){OC.Files.getClient().getFileInfo(t).then((function(t,i){e.lastLinkPath=i.path;var o=e.optimalPathTo("".concat(i.path,"/").concat(i.name)).split("/").map(encodeURIComponent).join("/"),a="".concat(o,"?fileId=").concat(i.id);n({href:a})}))}),!1,[],!0,void 0,this.linkPath)}},optimalPathTo:function(t){var e=t.split("/"),n=this.relativePathTo(t).split("/");return n.length<e.length?n.join("/"):t},relativePathTo:function(t){var e=this.filePath.split("/"),n=t.split("/");for(e.pop();e[0]===n[0];)e.shift(),n.shift();return e.fill("..").concat(n).join("/")}}},C=(i(651),i(18)),_=Object(C.a)(y,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("EditorMenuBar",{attrs:{editor:t.editor},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.commands,o=e.isActive,a=e.focused;return[n("div",{staticClass:"menubar",class:{"is-focused":a,autohide:t.autohide}},[t.isRichEditor?n("div",{ref:"menubar",staticClass:"menubar-icons"},[t._l(t.allIcons,(function(e,a){return[e.class?n("button",{directives:[{name:"show",rawName:"v-show",value:a<t.iconCount,expression:"$index < iconCount"}],key:e.label,class:t.getIconClasses(o,e),attrs:{title:e.label},on:{click:function(n){return t.clickIcon(i,e)}}}):[n("div",{directives:[{name:"show",rawName:"v-show",value:a<t.iconCount||!e.class,expression:"$index < iconCount || !icon.class"},{name:"click-outside",rawName:"v-click-outside",value:function(){return t.hideChildMenu(e)},expression:"() => hideChildMenu(icon)"}],key:e.label,staticClass:"submenu"},[n("button",{class:t.childIconClasses(o,e.children),attrs:{title:e.label},on:{click:function(n){return n.preventDefault(),t.toggleChildMenu(e)}}}),t._v(" "),n("div",{staticClass:"popovermenu menu-center",class:{open:t.isChildMenuVisible(e)}},[n("PopoverMenu",{attrs:{menu:t.childPopoverMenu(o,i,e.children,e)}})],1)])]]})),t._v(" "),n("Actions",[t._l(t.allIcons,(function(e,o){return[e.class&&t.isHiddenInMenu(o)?n("ActionButton",{key:e.class,attrs:{icon:e.class},on:{click:function(n){return t.clickIcon(i,e)}}},[t._v("\n\t\t\t\t\t\t"+t._s(e.label)+"\n\t\t\t\t\t")]):t._e()]}))],2)],2):t._e(),t._v(" "),t._t("default",[t._v("\n\t\t\tLeft side\n\t\t")])],2)]}}],null,!0)})}),[],!1,null,"0d0204aa",null);n.default=_.exports},683:function(e,n,i){"use strict";i.r(n);var o=i(184),a=i(187),r=i.n(a),c=i(28),l={name:"MenuBubble",components:{EditorMenuBubble:o.d},directives:{tooltip:r.a},props:{editor:{type:Object,required:!1,default:null},filePath:{type:String,required:!1,default:""}},data:function(){return{linkUrl:null,linkMenuIsActive:!1}},methods:{showLinkMenu:function(t){var e=this;this.linkUrl=t.href,this.linkMenuIsActive=!0,this.$nextTick((function(){e.$refs.linkInput.focus()}))},hideLinkMenu:function(){this.linkUrl=null,this.linkMenuIsActive=!1},selectFile:function(e){var n=this;if(OC.getCurrentUser()){var i=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,i){var o=Object(c.b)(n.filePath,"".concat(i.path,"/").concat(i.name)).split("/").map(encodeURIComponent).join("/");e({href:"".concat(o,"?fileId=").concat(i.id)}),n.hideLinkMenu()}))}),!1,[],!0,void 0,i)}},setLinkUrl:function(t,e){e&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((function(t){return e.match(t)}))&&(e="https://"+e),t({href:e}),this.hideLinkMenu()}}},s=(i(653),i(18)),u=Object(s.a)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("EditorMenuBubble",{staticClass:"menububble",attrs:{editor:t.editor},on:{hide:t.hideLinkMenu},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.commands,o=e.isActive,a=e.getMarkAttrs,r=e.menu;return[n("div",{staticClass:"menububble",class:{"is-active":r.isActive},style:"left: "+r.left+"px; bottom: "+r.bottom+"px;"},[t.linkMenuIsActive?n("form",{staticClass:"menububble__form",on:{submit:function(e){return e.preventDefault(),t.setLinkUrl(i.link,t.linkUrl)}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.linkUrl,expression:"linkUrl"}],ref:"linkInput",staticClass:"menububble__input",attrs:{type:"text",placeholder:"https://"},domProps:{value:t.linkUrl},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.hideLinkMenu(e)},input:function(e){e.target.composing||(t.linkUrl=e.target.value)}}}),t._v(" "),n("button",{staticClass:"menububble__button icon-confirm",attrs:{type:"button",tabindex:"0"},on:{click:function(e){return t.setLinkUrl(i.link,t.linkUrl)}}})]):[n("button",{staticClass:"menububble__button",class:{"is-active":o.link()},on:{click:function(e){t.showLinkMenu(a("link"))}}},[n("span",{staticClass:"icon-link"}),t._v(" "),n("span",{staticClass:"menububble__buttontext"},[t._v("\n\t\t\t\t\t"+t._s(t.t("text",o.link()?"Update Link":"Add Link"))+"\n\t\t\t\t")])]),t._v(" "),n("button",{staticClass:"menububble__button",class:{"is-active":o.link()},on:{click:function(e){return t.selectFile(i.link)}}},[n("span",{staticClass:"icon-file"}),t._v(" "),n("span",{staticClass:"menububble__buttontext"},[t._v(t._s(t.t("text","Link file")))])])]],2)]}}])})}),[],!1,null,"7a686b54",null);n.default=u.exports}}]);
-//# sourceMappingURL=editor-rich.js.map?v=bc192e31e623132ec5dd \ No newline at end of file
+var i=["text/markdown"],o=["text/plain","application/cmd","application/x-empty","application/x-msdos-program","application/epub+zip","application/javascript","application/json","application/x-perl","application/x-php","application/x-tex","application/xml","application/yaml","text/css","text/csv","text/html","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)},27:function(n,e,i){"use strict";i.d(e,"b",(function(){return v})),i.d(e,"c",(function(){return k})),i.d(e,"d",(function(){return g})),i.d(e,"a",(function(){return x}));var o=i(13),a=i(31),r=i.n(a),c=i(11),l=i(14);function s(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 u=!!document.getElementById("isPublic"),d=Object(c.generateOcsUrl)("apps/text"+(u?"/public":""),2)+"workspace",A={name:"RichWorkspace",components:{EditorWrapper:function(){return Promise.all([i.e(0),i.e(188),i.e(197),i.e(189)]).then(i.bind(null,173))}},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(),Object(l.subscribe)("Text::showRichWorkspace",(function(){t.enabled=!0,t.getFileInfo()})),Object(l.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){s(a,i,o,r,c,"next",n)}function c(n){s(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 u&&(t.shareToken=this.shareToken),r.a.get(d,{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()}))})))}}},p=i(28),h=i.n(p),f=i(48),b={insert:"head",singleton:!1},m=(h()(f.a,b),f.a.locals,i(18)),C=Object(m.a)(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.id,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,"374052d2",null).exports,v=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},g=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("Edit with text app",i,e)}))}})}};OC.Plugins.register("OCA.Files.NewFileMenu",n)},k=function(){var n,e=document.getElementById("sharingToken")?document.getElementById("sharingToken").value:null,a=document.getElementById("dir").value;if(!e||""!==a){var r=document.createElement("div");r.id="text-viewer-fallback",document.body.appendChild(r);for(var l=0;l<o.a.length;l++)n=o.a[l],OCA.Files.fileActions.register(n,"Edit with text app",OC.PERMISSION_UPDATE|OC.PERMISSION_READ,Object(c.imagePath)("core","actions/rename"),(function(n){var t=window.FileList.findFile(n);Promise.all([i.e(0).then(i.bind(null,47)),Promise.all([i.e(1),i.e(0),i.e(188),i.e(199),i.e(194)]).then(i.bind(null,662))]).then((function(i){var o=window.FileList.getCurrentDirectory()+"/"+n,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(n){return n(c,{props:{fileId:t?t.id:null,active:!0,shareToken:e,relativePath:o,mimeType:t.mimetype}})}}).$mount(r)}))}),t("text","Edit")),OCA.Files.fileActions.setDefault(o.a[l],"Edit with text app")}},x={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||i.e(0).then(i.bind(null,47)).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(C))({propsData:{path:n.getCurrentDirectory()}}).$mount(t.el);n.$el.on("changeDirectory",(function(n){o.path=n.dir.toString()}))}))}}},48:function(n,t,e){"use strict";var i=e(29),o=e.n(i),a=e(30),r=e.n(a)()(o.a);r.push([n.i,"#rich-workspace[data-v-374052d2]{padding:0 50px;margin-bottom:-24px;text-align:left;max-height:0;transition:max-height 0.5s cubic-bezier(0, 1, 0, 1)}#rich-workspace.creatable[data-v-374052d2]{min-height:90px}#rich-workspace[data-v-374052d2]:only-child{margin-bottom:0}.empty-workspace[data-v-374052d2]{padding-top:43px;color:var(--color-text-maxcontrast);height:0}#rich-workspace[data-v-374052d2] div[contenteditable=false]{width:100%;padding:0px;background-color:var(--color-main-background);opacity:1;border:none}#rich-workspace[data-v-374052d2] #editor-container{height:100%;position:unset !important;top:auto !important}#rich-workspace[data-v-374052d2] #editor-wrapper{position:unset !important;overflow:visible}#rich-workspace[data-v-374052d2] #editor{overflow:scroll !important;max-height:50vh;padding-left:10px}#rich-workspace[data-v-374052d2] #editor-wrapper .ProseMirror{padding:0px;margin:0}#rich-workspace[data-v-374052d2] .menubar{z-index:50;margin-bottom:-10px}#rich-workspace[data-v-374052d2] .menubar .menubar-icons{margin-left:0}#rich-workspace[data-v-374052d2] .editor__content{margin:0}#rich-workspace.focus[data-v-374052d2]{max-height:50vh}#rich-workspace[data-v-374052d2]:not(.focus){max-height:30vh;position:relative;overflow:hidden}#rich-workspace[data-v-374052d2]: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-374052d2]: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-374052d2]:not(.focus){max-height:30vh}}html.ie #rich-workspace[data-v-374052d2] #editor-container{position:initial}html.ie #rich-workspace[data-v-374052d2] #editor-wrapper{position:relative !important;top:auto !important}html.ie #rich-workspace[data-v-374052d2] #editor{display:flex;flex-direction:column;overflow:hidden !important}html.ie #rich-workspace[data-v-374052d2] .menubar{position:relative;overflow:hidden;flex-shrink:0;height:44px;top:auto}html.ie #rich-workspace[data-v-374052d2] #editor>div:nth-child(2){min-height:44px;overflow-x:hidden;overflow-y:auto;flex-shrink:1}\n","",{version:3,sources:["webpack://./src/views/RichWorkspace.vue"],names:[],mappings:"AA0KA,iCACC,cAAe,CAEf,mBAAoB,CACpB,eAAgB,CAChB,YAAa,CACb,mDAAoD,CANrD,2CAQE,eAAgB,CAChB,4CAKD,eAAgB,CAChB,kCAGA,gBAAiB,CACjB,mCAAoC,CACpC,QAAS,CACT,4DAGA,UAAW,CACX,WAAY,CACZ,6CAA8C,CAC9C,SAAU,CACV,WAAY,CACZ,mDAGA,WAAY,CACZ,yBAA0B,CAC1B,mBAAoB,CACpB,iDAGA,yBAA0B,CAC1B,gBAAiB,CACjB,yCAGA,0BAA2B,CAC3B,eAAgB,CAChB,iBAAkB,CAClB,8DAGA,WAAY,CACZ,QAAS,CACT,0CAGA,UAAW,CAEX,mBAAoB,CACpB,yDAGA,aAAc,CACd,kDAGA,QAAS,CACT,uCAGA,eAAgB,CAChB,6CAGA,eAAgB,CAChB,iBAAkB,CAClB,eAAgB,CAChB,sEAGA,UAAW,CACX,iBAAkB,CAClB,SAAU,CACV,QAAS,CACT,MAAO,CACP,mBAAoB,CACpB,8FAAkG,CAClG,UAAW,CACX,UAAW,CACX,2EAGA,wFAA4F,CAC5F,2CAGA,6CACC,eAAgB,CAChB,CAGF,2DAGG,gBAAiB,CAHpB,yDAOG,4BAA6B,CAC7B,mBAAoB,CARvB,iDAYG,YAAa,CACb,qBAAsB,CACtB,0BAA2B,CAd9B,kDAkBG,iBAAkB,CAClB,eAAgB,CAChB,aAAc,CACd,WAAY,CACZ,QAAS,CAtBZ,kEA0BG,eAAgB,CAChB,iBAAkB,CAClB,eAAgB,CAChB,aAAc",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\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: scroll !important;\n\tmax-height: 50vh;\n\tpadding-left: 10px;\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: 50;\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:""}]),t.a=r},633:function(n,t,e){"use strict";var i=e(29),o=e.n(i),a=e(30),r=e.n(a)()(o.a);r.push([n.i,".menubar[data-v-0d0204aa]{position:fixed;position:-webkit-sticky;position:sticky;top:0;display:flex;z-index:10010;background-color:var(--color-main-background-translucent);height:44px}.menubar.autohide[data-v-0d0204aa]{visibility:hidden;opacity:0;transition:visibility 0.2s 0.4s, opacity 0.2s 0.4s}.menubar.autohide.is-focused[data-v-0d0204aa]{visibility:visible;opacity:1}.menubar .menubar-icons[data-v-0d0204aa]{flex-grow:1;margin-left:calc((100% - 660px) / 2)}@media (max-width: 660px){.menubar .menubar-icons[data-v-0d0204aa]{margin-left:0}}.menubar[data-v-0d0204aa] .action-item__menu ul{max-height:calc(100vh - 88px);overflow:scroll}.menubar button[data-v-0d0204aa]{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-0d0204aa]:hover,.menubar button[data-v-0d0204aa]:focus,.menubar button[data-v-0d0204aa]:active{background-color:var(--color-background-dark)}.menubar button.is-active[data-v-0d0204aa],.menubar button[data-v-0d0204aa]:hover,.menubar button[data-v-0d0204aa]:focus{opacity:1}.menubar button.icon-undo[data-v-0d0204aa],.menubar button.icon-redo[data-v-0d0204aa]{opacity:.4}.menubar .submenu[data-v-0d0204aa]{display:inline-block;width:44px;height:44px;position:relative;vertical-align:top}\n","",{version:3,sources:["webpack://./src/components/MenuBar.vue"],names:[],mappings:"AA6TA,0BACC,cAAe,CACf,uBAAwB,CACxB,eAAgB,CAChB,KAAM,CACN,YAAa,CACb,aAAc,CACd,yDAA0D,CAC1D,WAAY,CARb,mCAWE,iBAAkB,CAClB,SAAU,CACV,kDAAmD,CAbrD,8CAeG,kBAAmB,CACnB,SAAU,CAhBb,yCAoBE,WAAY,CACZ,oCAAqC,CACrC,0BAtBF,yCAyBG,aAAc,CACd,CA1BH,gDA6BE,6BAA8B,CAC9B,eAAgB,CAChB,iCAID,UAAW,CACX,WAAY,CACZ,QAAS,CACT,oBAAqB,CACrB,QAAS,CACT,4BAA6B,CAC7B,UAAW,CACX,4BAA6B,CAC7B,iCAAkC,CAClC,kBAAmB,CAVpB,sHAYE,6CAA8C,CAZhD,yHAiBE,SAAU,CAjBZ,sFAqBE,UAAW,CACX,mCAID,oBAAqB,CACrB,UAAW,CACX,WAAY,CACZ,iBAAkB,CAClB,kBAAmB",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.menubar {\n\tposition: fixed;\n\tposition: -webkit-sticky;\n\tposition: sticky;\n\ttop: 0;\n\tdisplay: flex;\n\tz-index: 10010; // above modal-header so buttons are clickable\n\tbackground-color: var(--color-main-background-translucent);\n\theight: 44px;\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&.is-focused {\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\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\t&.is-active,\n\t&:hover,\n\t&:focus {\n\t\topacity: 1;\n\t}\n\n\t&.icon-undo, &.icon-redo {\n\t\topacity: .4;\n\t}\n}\n\n.menubar .submenu {\n\tdisplay: inline-block;\n\twidth: 44px;\n\theight: 44px;\n\tposition: relative;\n\tvertical-align: top;\n}\n"],sourceRoot:""}]),t.a=r},634:function(n,t,e){"use strict";var i=e(29),o=e.n(i),a=e(30),r=e.n(a)()(o.a);r.push([n.i,".menububble[data-v-7a686b54]{position:absolute;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-bottom:-3px;margin-left:10px;visibility:hidden;opacity:0;transform:translateX(-50%);transition:opacity 0.2s, visibility 0.2s;height:44px}.menububble.is-active[data-v-7a686b54]{opacity:1;visibility:visible}.menububble__button[data-v-7a686b54]{display:block;flex-grow:1;border:0;padding:0.9rem 0.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-7a686b54]:focus,.menububble__button[data-v-7a686b54]:hover{background-color:var(--color-background-hover);border:0;border-right:1px solid var(--color-border) !important}.menububble__button[data-v-7a686b54]:last-child{border:0 !important}.menububble__buttontext[data-v-7a686b54]{padding:0.4rem;padding-right:0}.menububble__form[data-v-7a686b54]{display:flex;align-items:center}.menububble__input[data-v-7a686b54]{font:inherit;border:none;background:transparent;min-width:150px}\n","",{version:3,sources:["webpack://./src/components/MenuBubble.vue"],names:[],mappings:"AA+IA,6BACC,iBAAkB,CAClB,YAAa,CACb,aAAc,CACd,mDAAoD,CACpD,4CAA6C,CAC7C,wCAAyC,CACzC,eAAgB,CAChB,SAAU,CACV,kBAAmB,CACnB,gBAAiB,CACjB,iBAAkB,CAClB,SAAU,CACV,0BAA2B,CAC3B,wCAAyC,CACzC,WAAY,CAfb,uCAkBE,SAAU,CACV,kBAAmB,CACnB,qCAGA,aAAc,CACd,WAAY,CACZ,QAAS,CACT,qBAAsB,CACtB,QAAS,CACT,eAAgB,CAChB,cAAe,CACf,6CAA8C,CAC9C,0CAA2C,CAT3C,sFAaC,8CAA+C,CAC/C,QAAS,CACT,qDAAsD,CAfvD,gDAmBC,mBAAoB,CACpB,yCAID,cAAe,CACf,eAAgB,CAChB,mCAGA,YAAa,CACb,kBAAmB,CACnB,oCAGA,YAAa,CACb,WAAY,CACZ,sBAAuB,CACvB,eAAgB",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.menububble {\n\tposition: absolute;\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-bottom: -3px;\n\tmargin-left: 10px;\n\tvisibility: hidden;\n\topacity: 0;\n\ttransform: translateX(-50%);\n\ttransition: opacity 0.2s, visibility 0.2s;\n\theight: 44px;\n\n\t&.is-active {\n\t\topacity: 1;\n\t\tvisibility: visible;\n\t}\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: 150px;\n\t}\n}\n"],sourceRoot:""}]),t.a=r},657:function(n,e,i){"use strict";i.r(e);var o=i(181),a=i(184),r=i.n(a),c=[{label:t("text","Undo"),class:"icon-undo",isActive:function(n){},action:function(n){return n.undo()}},{label:t("text","Redo"),class:"icon-redo",isActive:function(n){},action:function(n){return n.redo()}},{label:t("text","Bold"),class:"icon-bold",isActive:function(n){return n.strong()},action:function(n){return n.strong()}},{label:t("text","Italic"),class:"icon-italic",isActive:function(n){return n.em()},action:function(n){return n.em()}},{label:t("text","Strikethrough"),class:"icon-strike",isActive:function(n){return n.strike()},action:function(n){return n.strike()}},{label:t("text","Headings"),visible:!1,children:[{label:t("text","Heading 1"),class:"icon-h1",isActive:function(n){return n.heading({level:1})},action:function(n){return n.heading({level:1})}},{label:t("text","Heading 2"),class:"icon-h2",isActive:function(n){return n.heading({level:2})},action:function(n){return n.heading({level:2})}},{label:t("text","Heading 3"),class:"icon-h3",isActive:function(n){return n.heading({level:3})},action:function(n){return n.heading({level:3})}},{label:t("text","Heading 4"),class:"icon-h4",isActive:function(n){return n.heading({level:4})},action:function(n){return n.heading({level:4})}},{label:t("text","Heading 5"),class:"icon-h5",isActive:function(n){return n.heading({level:5})},action:function(n){return n.heading({level:5})}},{label:t("text","Heading 6"),class:"icon-h6",isActive:function(n){return n.heading({level:6})},action:function(n){return n.heading({level:6})}}]},{label:t("text","Unordered list"),class:"icon-ul",isActive:function(n){return n.bullet_list()},action:function(n){return n.bullet_list_item()}},{label:t("text","Ordered list"),class:"icon-ol",isActive:function(n){return n.ordered_list()},action:function(n){return n.ordered_list()}},{label:t("text","ToDo list"),class:"icon-checkmark",isActive:function(n){return!1},action:function(n){return n.todo_item()}},{label:t("text","Blockquote"),class:"icon-quote",isActive:function(n){return n.blockquote()},action:function(n){return n.blockquote()}},{label:t("text","Code block"),class:"icon-code",isActive:function(n){return n.code_block()},action:function(n){return n.code_block()}}],l=i(27),s=i(630),u=i.n(s),d=i(631),A=i.n(d),p=i(214),h=i.n(p),f=i(632),b=i.n(f),m=i(109);function C(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(n)))return;var e=[],i=!0,o=!1,a=void 0;try{for(var r,c=n[Symbol.iterator]();!(i=(r=c.next()).done)&&(e.push(r.value),!t||e.length!==t);i=!0);}catch(n){o=!0,a=n}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return e}(n,t)||g(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 v(n){return function(n){if(Array.isArray(n))return k(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||g(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 g(n,t){if(n){if("string"==typeof n)return k(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)?k(n,t):void 0}}function k(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 x={name:"MenuBar",components:{EditorMenuBar:o.c,ActionButton:A.a,PopoverMenu:h.a,Actions:u.a},directives:{Tooltip:r.a,ClickOutside:b.a},props:{editor:{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:""}},data:function(){return{windowWidth:0,windowHeight:0,forceRecompute:0,submenuVisibility:{},lastImagePath:null,icons:v(c)}},computed:{isHiddenInMenu:function(){var n=this;return function(t){return t-n.iconCount>=0}},getIconClasses:function(){return function(n,t){var e={"is-active":t.isActive(n)};return e[t.class]=!0,e}},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 this.isPublic?this.icons:[].concat(v(this.icons),[{label:t("text","Insert image"),class:"icon-image",isActive:function(){},action:function(t){n.showImagePrompt(t.image)}}])},childPopoverMenu:function(){var n=this;return function(t,e,i,o){var a=[],r=function(r){a.push({text:i[r].label,icon:i[r].class,action:function(){i[r].action(e),n.hideChildMenu(o)},active:i[r].isActive(t)})};for(var c in i)r(c);return a}},childIconClasses:function(){var n=this;return function(t,e){var i=n.childIcon(t,e);return n.getIconClasses(t,i)}},childIcon:function(){return function(n,t){for(var e in t){var i=t[e];if(i.isActive(n))return i}return 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},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++}))},clickIcon:function(n,t){return t.action(n)},getWindowWidth:function(n){this.windowWidth=document.documentElement.clientWidth},getWindowHeight:function(n){this.windowHeight=document.documentElement.clientHeight},hideChildMenu:function(n){this.$set(this.submenuVisibility,n.label,!1)},toggleChildMenu:function(n){var t=!!Object.prototype.hasOwnProperty.call(this.submenuVisibility,n.label)&&this.submenuVisibility[n.label];this.$set(this.submenuVisibility,n.label,!t)},showImagePrompt:function(n){var e=this;if(Object(m.getCurrentUser)()){var i=n;OC.dialogs.filepicker(t("text","Insert an image"),(function(n){OC.Files.getClient().getFileInfo(n).then((function(n,t){e.lastImagePath=t.path;var o={mimetype:t.mimetype,hasPreview:t.hasPreview},a=Object(l.b)(e.filePath,"".concat(t.path,"/").concat(t.name)).split("/").map(encodeURIComponent).join("/"),r=Object.entries(o).map((function(n){var t=C(n,2),e=t[0],i=t[1];return"".concat(e,"=").concat(encodeURIComponent(i))})).join("&"),c="".concat(a,"?fileId=").concat(t.id,"#").concat(r);i({src:c,alt:t.name})}))}),!1,[],!0,void 0,this.imagePath)}},showLinkPrompt:function(n){var t=this;if(OC.getCurrentUser()){var e=n;OC.dialogs.filepicker("Insert a link",(function(n){OC.Files.getClient().getFileInfo(n).then((function(n,i){t.lastLinkPath=i.path;var o=t.optimalPathTo("".concat(i.path,"/").concat(i.name)).split("/").map(encodeURIComponent).join("/"),a="".concat(o,"?fileId=").concat(i.id);e({href:a})}))}),!1,[],!0,void 0,this.linkPath)}},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("/")}}},w=i(28),B=i.n(w),y=i(633),_={insert:"head",singleton:!1},I=(B()(y.a,_),y.a.locals,i(18)),E=Object(I.a)(x,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("EditorMenuBar",{attrs:{editor:n.editor},scopedSlots:n._u([{key:"default",fn:function(t){var i=t.commands,o=t.isActive,a=t.focused;return[e("div",{staticClass:"menubar",class:{"is-focused":a,autohide:n.autohide}},[n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.allIcons,(function(t,a){return[t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:a<n.iconCount,expression:"$index < iconCount"}],key:t.label,class:n.getIconClasses(o,t),attrs:{title:t.label},on:{click:function(e){return n.clickIcon(i,t)}}}):[e("div",{directives:[{name:"show",rawName:"v-show",value:a<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",{class:n.childIconClasses(o,t.children),attrs:{title:t.label},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(o,i,t.children,t)}})],1)])]]})),n._v(" "),e("Actions",[n._l(n.allIcons,(function(t,o){return[t.class&&n.isHiddenInMenu(o)?e("ActionButton",{key:t.class,attrs:{icon:t.class},on:{click:function(e){return n.clickIcon(i,t)}}},[n._v("\n\t\t\t\t\t\t"+n._s(t.label)+"\n\t\t\t\t\t")]):n._e()]}))],2)],2):n._e(),n._v(" "),n._t("default",[n._v("\n\t\t\tLeft side\n\t\t")])],2)]}}],null,!0)})}),[],!1,null,"0d0204aa",null);e.default=E.exports},658:function(n,e,i){"use strict";i.r(e);var o=i(181),a=i(184),r=i.n(a),c=i(27),l={name:"MenuBubble",components:{EditorMenuBubble:o.d},directives:{tooltip:r.a},props:{editor:{type:Object,required:!1,default:null},filePath:{type:String,required:!1,default:""}},data:function(){return{linkUrl:null,linkMenuIsActive:!1}},methods:{showLinkMenu:function(n){var t=this;this.linkUrl=n.href,this.linkMenuIsActive=!0,this.$nextTick((function(){t.$refs.linkInput.focus()}))},hideLinkMenu:function(){this.linkUrl=null,this.linkMenuIsActive=!1},selectFile:function(n){var e=this;if(OC.getCurrentUser()){var i=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,i){var o=Object(c.b)(e.filePath,"".concat(i.path,"/").concat(i.name)).split("/").map(encodeURIComponent).join("/");n({href:"".concat(o,"?fileId=").concat(i.id)}),e.hideLinkMenu()}))}),!1,[],!0,void 0,i)}},setLinkUrl:function(n,t){t&&![/^[a-zA-Z]+:/,/^\//,/\?fileId=/,/^\.\.?\//,/^[^.]*[/$]/,/^#/].find((function(n){return t.match(n)}))&&(t="https://"+t),n({href:t}),this.hideLinkMenu()}}},s=i(28),u=i.n(s),d=i(634),A={insert:"head",singleton:!1},p=(u()(d.a,A),d.a.locals,i(18)),h=Object(p.a)(l,(function(){var n=this,t=n.$createElement,e=n._self._c||t;return e("EditorMenuBubble",{staticClass:"menububble",attrs:{editor:n.editor},on:{hide:n.hideLinkMenu},scopedSlots:n._u([{key:"default",fn:function(t){var i=t.commands,o=t.isActive,a=t.getMarkAttrs,r=t.menu;return[e("div",{staticClass:"menububble",class:{"is-active":r.isActive},style:"left: "+r.left+"px; bottom: "+r.bottom+"px;"},[n.linkMenuIsActive?e("form",{staticClass:"menububble__form",on:{submit:function(t){return t.preventDefault(),n.setLinkUrl(i.link,n.linkUrl)}}},[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(t)},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(i.link,n.linkUrl)}}})]):[e("button",{staticClass:"menububble__button",class:{"is-active":o.link()},on:{click:function(t){n.showLinkMenu(a("link"))}}},[e("span",{staticClass:"icon-link"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v("\n\t\t\t\t\t"+n._s(n.t("text",o.link()?"Update Link":"Add Link"))+"\n\t\t\t\t")])]),n._v(" "),e("button",{staticClass:"menububble__button",class:{"is-active":o.link()},on:{click:function(t){return n.selectFile(i.link)}}},[e("span",{staticClass:"icon-file"}),n._v(" "),e("span",{staticClass:"menububble__buttontext"},[n._v(n._s(n.t("text","Link file")))])])]],2)]}}])})}),[],!1,null,"7a686b54",null);e.default=h.exports}}]);
+//# sourceMappingURL=editor-rich.js.map?v=f3d76a3ceaaa17d4e494 \ No newline at end of file