/*! For license information please see editor-rich.js.LICENSE.txt */ (self.webpackChunktext=self.webpackChunktext||[]).push([["editor-rich"],{29642:function(n,e,i){"use strict";Object.defineProperty(e,"X",{value:!0}),e.Z=void 0;var o=i(44429),r=h(i(15168)),a=h(i(78120)),c=i(94091),l=h(i(79440)),s=h(i(56286)),u=h(i(26533)),A=h(i(64056)),d=h(i(2649)),p=i(22200);function h(n){return n&&n.__esModule?n:{default:n}}function f(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)||b(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 C(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)||b(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 b(n,t){if(n){if("string"==typeof n)return m(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)?m(n,t):void 0}}function m(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e=0}},getIconClasses:function(){return function(n,t){var e={"is-active":"function"==typeof t.isActive&&t.isActive(n)};return e[t.class]=!0,e}},disabled:function(){return function(n,t){return!1}},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(C(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 r=[],a=function(a){r.push({text:i[a].label,icon:i[a].class,action:function(){i[a].action(e),n.hideChildMenu(o)},active:i[a].isActive(t)})};for(var c in i)a(c);return r}},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-1},imagePath:function(){return this.lastImagePath||this.filePath.split("/").slice(0,-1).join("/")}},mounted:function(){var n=this;window.addEventListener("resize",this.getWindowWidth),this.checkInterval=setInterval((function(){var t=n.$refs.menubar&&n.$refs.menubar.clientWidth>0;n.isRichEditor&&t&&n.redrawMenuBar(),n.isRichEditor&&!t||clearInterval(n.checkInterval)}),100)},beforeDestroy:function(){window.removeEventListener("resize",this.getWindowWidth)},methods:{redrawMenuBar:function(){var n=this;this.$nextTick((function(){n.getWindowWidth(),n.forceRecompute++}))},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((0,p.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},r=(0,c.optimalPath)(e.filePath,"".concat(t.path,"/").concat(t.name)).split("/").map(encodeURIComponent).join("/"),a=Object.entries(o).map((function(n){var t=f(n,2),e=t[0],i=t[1];return"".concat(e,"=").concat(encodeURIComponent(i))})).join("&"),l="".concat(r,"?fileId=").concat(t.id,"#").concat(a);i({src:l,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("/"),r="".concat(o,"?fileId=").concat(i.id);e({href:r})}))}),!1,[],!0,void 0,this.linkPath)}},optimalPathTo:function(n){var t=n.split("/"),e=this.relativePathTo(n).split("/");return e.lengthdiv:nth-child(2){min-height:44px;overflow-x:hidden;overflow-y:auto;flex-shrink:1}',"",{version:3,sources:["webpack://src/views/RichWorkspace.vue"],names:[],mappings:"AA0KA,iCACC,cAAA,CAEA,mBAAA,CACA,eAAA,CACA,YAAA,CACA,kDAAA,CACA,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,0BAAA,CACA,eAAA,CACA,iBAAA,CAGD,8DACC,WAAA,CACA,QAAA,CAGD,0CACC,UAAA,CAEA,mBAAA,CAGD,yDACC,aAAA,CAGD,kDACC,QAAA,CAGD,uCACC,eAAA,CAGD,6CACC,eAAA,CACA,iBAAA,CACA,eAAA,CAGD,sEACC,UAAA,CACA,iBAAA,CACA,SAAA,CACA,QAAA,CACA,MAAA,CACA,mBAAA,CACA,iGAAA,CACA,UAAA,CACA,UAAA,CAGD,2EACC,2FAAA,CAGD,2CACC,6CACC,eAAA,CAAA,CAMA,2DACC,gBAAA,CAGD,yDACC,4BAAA,CACA,mBAAA,CAGD,iDACC,YAAA,CACA,qBAAA,CACA,0BAAA,CAGD,kDACC,iBAAA,CACA,eAAA,CACA,aAAA,CACA,WAAA,CACA,QAAA,CAGD,kEACC,eAAA,CACA,iBAAA,CACA,eAAA,CACA,aAAA",sourcesContent:["\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n#rich-workspace {\n\tpadding: 0 50px;\n\t/* Slightly reduce vertical space */\n\tmargin-bottom: -24px;\n\ttext-align: left;\n\tmax-height: 0;\n\ttransition: max-height 0.5s cubic-bezier(0, 1, 0, 1);\n\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.Z=o},44276:function(n,t,e){"use strict";e.r(t),e.d(t,{__esModule:function(){return i.X},default:function(){return s}});var i=e(29642),o=i.Z,r=e(93379),a=e.n(r),c=e(29692),l={insert:"head",singleton:!1},s=(a()(c.Z,l),c.Z.locals,(0,e(51900).Z)(o,(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,r=t.focused;return[e("div",{staticClass:"menubar",class:{"is-focused":r,autohide:n.autohide}},[n.isRichEditor?e("div",{ref:"menubar",staticClass:"menubar-icons"},[n._l(n.allIcons,(function(t,r){return["icon-emoji"===t.class?e("EmojiPicker",{key:t.label,staticClass:"menuitem-emoji",on:{select:function(t){return n.addEmoji(i,n.allIcons.find((function(n){return"icon-emoji"===n.class})),t)}}},[e("button",{staticClass:"icon-emoji",attrs:{title:n.t("text","Insert emoji"),"aria-label":n.t("text","Insert emoji"),"aria-haspopup":!0}})]):t.class?e("button",{directives:[{name:"show",rawName:"v-show",value:r 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)&&"icon-emoji"!==t.class?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",(function(){return[n._v("\n\t\t\tLeft side\n\t\t")]}))],2)]}}],null,!0)})}),[],!1,null,"60ebf139",null).exports)},64311:function(n,t,e){"use strict";e.r(t),e.d(t,{__esModule:function(){return i.X},default:function(){return s}});var i=e(89662),o=i.Z,r=e(93379),a=e.n(r),c=e(10857),l={insert:"head",singleton:!1},s=(a()(c.Z,l),c.Z.locals,(0,e(51900).Z)(o,(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,r=t.getMarkAttrs,a=t.menu;return[e("div",{staticClass:"menububble",class:{"is-active":a.isActive},style:"left: "+a.left+"px; bottom: "+a.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.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(i.link,n.linkUrl)}}})]):[e("button",{staticClass:"menububble__button",class:{"is-active":o.link()},on:{click:function(t){n.showLinkMenu(r("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).exports)},25530:function(n,t,e){"use strict";e.r(t),e.d(t,{__esModule:function(){return i.X},default:function(){return s}});var i=e(65183),o=i.Z,r=e(93379),a=e.n(r),c=e(70328),l={insert:"head",singleton:!1},s=(a()(c.Z,l),c.Z.locals,(0,e(51900).Z)(o,(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)}}]); //# sourceMappingURL=editor-rich.js.map?v=bc6217617c37ba77a8c9