%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/
Upload File :
Create Path :
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/text/js/Wrapper-BICRxhf1.chunk.mjs

/*! third party licenses: js/vendor.LICENSE.txt */
var q=e=>{throw TypeError(e)};var T=(e,i,n)=>i.has(e)||q("Cannot "+n);var g=(e,i,n)=>(T(e,i,"read from private field"),n?n.call(e):i.get(e)),x=(e,i,n)=>i.has(e)?q("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,n),k=(e,i,n,s)=>(T(e,i,"write to private field"),s?s.call(e,n):i.set(e,n),n),b=(e,i,n)=>(T(e,i,"access private method"),n);import{c as K,r as P,w as Z,o as dt,b as ht,d as B}from"./vue.runtime.esm-fZsuJKoo.chunk.mjs";import{ad as z,a7 as G,ae as X,af as tt,ag as ut,ah as pt,ai as vt,aj as _t,ak as mt,al as ft,am as bt,an as yt,ao as gt,ap as xt,aq as kt,ar as Ct,as as wt,at as At}from"./RichText-CcSEp-9N.chunk.mjs";import{n as f,a as V,g as Et,f as J,h as $t}from"./_plugin-vue2_normalizer-CBD_Jxxq.chunk.mjs";import{a as Mt,U as St,_ as Ot}from"./index-Br6XaFoY.chunk.mjs";import{g as It}from"./emoji-picker-SoWZqoso.chunk.mjs";import{s as et,m as Nt}from"./index-COlIf7vj.chunk.mjs";import{a as Pt,N as Bt}from"./NcNoteCard-CImn6F9p-7OG_jBLc.chunk.mjs";import{e as it,g as Ft}from"./modulepreload-polyfill-DMTabKmO.chunk.mjs";import{l as Ut}from"./index-Ubm2itxG.chunk.mjs";import{t as Tt,a as Ht,b as Rt,i as Lt}from"./index-BpvrP2W2.chunk.mjs";import{u as F,e as Dt,c as nt,g as st,h as Wt,d as jt,A as Kt,m as zt,n as Vt,o as qt}from"./MediaHandler.provider-CSBQhvYP.chunk.mjs";import{s as N}from"./public-BnJZpQLY.chunk.mjs";import{l as H}from"./logger-B4T8Bva5.chunk.mjs";function C(e){var i;const n=Ht(e);return(i=n==null?void 0:n.$el)!=null?i:n}const ot=Lt?window:void 0;function Jt(){const e=P(!1);return ht()&&dt(()=>{e.value=!0},void 0),e}function Qt(e){const i=Jt();return K(()=>(i.value,!!e()))}function Yt(e,i,n={}){const{window:s=ot,...l}=n;let r;const d=Qt(()=>s&&"ResizeObserver"in s),h=()=>{r&&(r.disconnect(),r=void 0)},y=K(()=>Array.isArray(e)?e.map(o=>C(o)):[C(e)]),E=Z(y,o=>{if(h(),d.value&&s){r=new ResizeObserver(i);for(const a of o)a&&r.observe(a,l)}},{immediate:!0,flush:"post"}),c=()=>{h(),E()};return Rt(c),{isSupported:d,stop:c}}function Zt(e,i={width:0,height:0},n={}){const{window:s=ot,box:l="content-box"}=n,r=K(()=>{var o,a;return(a=(o=C(e))==null?void 0:o.namespaceURI)==null?void 0:a.includes("svg")}),d=P(i.width),h=P(i.height),{stop:y}=Yt(e,([o])=>{const a=l==="border-box"?o.borderBoxSize:l==="content-box"?o.contentBoxSize:o.devicePixelContentBoxSize;if(s&&r.value){const v=C(e);if(v){const p=v.getBoundingClientRect();d.value=p.width,h.value=p.height}}else if(a){const v=Array.isArray(a)?a:[a];d.value=v.reduce((p,{inlineSize:_})=>p+_,0),h.value=v.reduce((p,{blockSize:_})=>p+_,0)}else d.value=o.contentRect.width,h.value=o.contentRect.height},n);Tt(()=>{const o=C(e);o&&(d.value="offsetWidth"in o?o.offsetWidth:i.width,h.value="offsetHeight"in o?o.offsetHeight:i.height)});const E=Z(()=>C(e),o=>{d.value=o?i.width:0,h.value=o?i.height:0});function c(){y(),E()}return{width:d,height:h,stop:c}}const Gt={name:"NcActionButton",components:{NextcloudVueNcActionButton:V},extends:z,mounted(){this.$editor.on("transaction",()=>this.updateState())},methods:{runAction(){var i;const{actionEntry:e}=this;e.click?e.click(this):(i=e.action(this.$editor.chain().focus(),this.$editor))==null||i.run(),this.$nextTick(()=>{this.$emit("trigged",{...e})})}}};var Xt=function(){var e=this,i=e._self._c;return i("NextcloudVueNcActionButton",e._g({staticClass:"entry-single-action entry-action entry-action-item",class:e.state.class,attrs:{title:e.listItemTooltip||void 0,disabled:e.state.disabled,"aria-keyshortcuts":e.keyshortcuts||void 0,"data-text-action-entry":e.actionEntry.key,type:e.state.type,"model-value":e.state.type!=="button"?e.state.active:void 0,"close-after-click":""},on:{click:e.runAction},scopedSlots:e._u([{key:"icon",fn:function(){return[i(e.icon,{tag:"component"})]},proxy:!0}])},e.$listeners),[e._v(" "+e._s(e.label)+" ")])},te=[],ee=f(Gt,Xt,te,!1,null,null);const ie=ee.exports,ne={name:"ActionList",components:{NcActions:Pt,NcActionSeparator:G,ActionListItem:ie},extends:z,mixins:[X,tt,ut],props:{forceEnabled:{type:Boolean,default:!1}},data:()=>({visible:!1,hasEnabledChild:!0}),computed:{currentChild(){const{state:e,$editor:i,actionEntry:{children:n}}=this;return e.active?n.find(s=>pt(s,i)):null},icon(){return this.currentChild?this.currentChild.icon:this.actionEntry.icon},iconKey(){return"".concat(this.actionEntry.key,"/").concat(this.activeKey)},activeKey(){var e;return(e=this.currentChild)==null?void 0:e.key},children(){return this.actionEntry.children.filter(({visible:e})=>e===void 0?!0:typeof e=="function"?e(this):e)},labelWithSelected(){return this.currentChild?t("text",'{menuItemName}, "{selectedSubMenuItemName}" is selected',{menuItemName:this.actionEntry.label,selectedSubMenuItemName:this.currentChild.label}):this.actionEntry.label},isEnabled(){return this.forceEnabled||this.hasEnabledChild}},mounted(){this.$_updateState=Mt(this.checkStateOfChildren.bind(this),50),this.$editor.on("update",this.$_updateState),this.$editor.on("selectionUpdate",this.$_updateState)},beforeDestroy(){this.$editor.off("update",this.$_updateState),this.$editor.off("selectionUpdate",this.$_updateState)},methods:{onOpenChange(e){this.visible=e},runAction(){},onTrigger(e){e!=null&&e.click||(this.$editor.chain().focus().run(),this.$emit("trigged",e))},checkStateOfChildren(){this.hasEnabledChild=this.children.some(e=>this.isChildEnabled(e))},isChildEnabled(e){return!e.isSeparator&&!vt(e,this.$editor).disabled}}};var se=function(){var e=this,i=e._self._c;return i("NcActions",e._b({staticClass:"entry-list-action entry-action",attrs:{title:e.tooltip,container:e.menuIDSelector,"aria-label":e.labelWithSelected,type:e.state.active?"primary":"tertiary","force-menu":!0,"data-text-action-entry":e.actionEntry.key,"data-text-action-active":e.activeKey,disabled:!e.isEnabled},on:{"update:open":e.onOpenChange},scopedSlots:e._u([{key:"icon",fn:function(){return[i(e.icon,{key:e.iconKey,tag:"component"})]},proxy:!0}])},"NcActions",e.state,!1),[e._l(e.children,function(n){var s;return[n.isSeparator?i("NcActionSeparator",{key:"child-".concat(n.key)}):i("ActionListItem",e._g({key:"child-".concat(n.key),attrs:{active:((s=e.currentChild)==null?void 0:s.key)===n.key,"is-item":"","action-entry":n},on:{trigged:e.onTrigger}},e.$listeners))]}),e._t("lastAction",null,null,{visible:e.visible})],2)},oe=[],ae=f(ne,se,oe,!1,null,null);const at=ae.exports,re={name:"ActionSingle",components:{NcButton:Bt},extends:z,props:{isItem:{type:Boolean,default:!1}},mounted(){this.$editor.on("transaction",()=>this.updateState())},methods:{runAction(){var i;const{actionEntry:e}=this;e.click?e.click(this):(i=e.action(this.$editor.chain().focus(),this.$editor))==null||i.run(),this.$nextTick(()=>{this.$emit("trigged",{...e})})}}};var le=function(){var e=this,i=e._self._c;return i("NcButton",e._g({staticClass:"entry-single-action entry-action",class:e.state.class,attrs:{disabled:e.state.disabled,"aria-keyshortcuts":e.keyshortcuts||void 0,"data-text-action-entry":e.actionEntry.key,"aria-label":e.label,title:e.tooltip,type:"tertiary",pressed:e.state.type!=="button"?e.state.active:void 0},on:{click:e.runAction},scopedSlots:e._u([{key:"icon",fn:function(){return[i(e.icon,{tag:"component"})]},proxy:!0},e.actionEntry.forceLabel?{key:"default",fn:function(){return[e._v(" "+e._s(e.label)+" ")]},proxy:!0}:null],null,!0)},e.$listeners))},ce=[],de=f(re,le,ce,!1,null,null);const rt=de.exports,lt=B({data(){return{activeMenuEntry:0,entries:[]}},computed:{visibleEntries(){return this.entries}},watch:{visibleEntries(){this.$nextTick(()=>{var e;(this.activeMenuEntry>this.visibleEntries.length||(e=this.visibleEntries[this.activeMenuEntry])!=null&&e.disabled)&&this.setNextMenuEntry()})}},methods:{disableMenuEntry(e,i){const n=this.visibleEntries.findIndex(({key:s})=>s===e);this.visibleEntries[n].disabled=i,i===!1&&this.activeMenuEntry===n&&this.$nextTick(()=>this.setNextMenuEntry())},setNextMenuEntry(){const e=this.visibleEntries.length+(this.$refs.remainingEntries?1:0);do this.activeMenuEntry=(this.activeMenuEntry+1)%e;while(this.activeMenuEntry<this.visibleEntries.length&&this.visibleEntries[this.activeMenuEntry].disabled)},setPreviousMenuEntry(){const e=this.visibleEntries.length+(this.$refs.remainingEntries?1:0);do{const i=this.activeMenuEntry-1;this.activeMenuEntry=(i%e+e)%e}while(this.activeMenuEntry<this.visibleEntries.length&&this.visibleEntries[this.activeMenuEntry].disabled)},handleToolbarNavigation(e){var i,n;e.key==="ArrowRight"?this.setNextMenuEntry():e.key==="ArrowLeft"&&this.setPreviousMenuEntry(),this.activeMenuEntry===this.visibleEntries.length?(n=(i=this.$refs.remainingEntries)==null?void 0:i.focusButton)==null||n.call(i):[...this.$refs.menuEntries].sort((s,l)=>this.visibleEntries.findIndex(({key:r})=>r===s.$vnode.data.key)-this.visibleEntries.findIndex(({key:r})=>r===l.$vnode.data.key))[this.activeMenuEntry].focusButton()}}}),he=B({name:"ReadonlyBar",components:{ActionList:at,ActionSingle:rt},extends:lt,data(){return{entries:_t}}});var ue=function(){var e=this,i=e._self._c;return e._self._setupProxy,i("div",{staticClass:"text-readonly-bar",attrs:{"data-text-el":"readonly-bar"}},[i("div",{ref:"menubar",staticClass:"text-readonly-bar__entries",attrs:{role:"toolbar","aria-label":e.t("text","Editor actions")}},e._l(e.visibleEntries,function(n,s){return i(n.component?n.component:n.children?"ActionList":"ActionSingle",{key:n.key,ref:"menuEntries",refInFor:!0,tag:"component",attrs:{"action-entry":n,"can-be-focussed":e.activeMenuEntry===s},on:{disabled:function(l){return e.disableMenuEntry(n.key,l)}}})}),1),i("div",{staticClass:"text-menubar__slot"},[e._t("default")],2)])},pe=[],ve=f(he,ue,pe,!1,null,"89c84877");const mi=ve.exports;var R={exports:{}};(function(e,i){Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;function n(c){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},n(c)}var s=47,l=46,r=function(c){var o=n(c);if(o!=="string")throw new TypeError("Expected a string, got a ".concat(o))},d=function(c,o){for(var a="",v=0,p=-1,_=0,$,m=0;m<=c.length;++m){if(m<c.length)$=c.charCodeAt(m);else{if($===s)break;$=s}if($===s){if(!(p===m-1||_===1))if(p!==m-1&&_===2){if(a.length<2||v!==2||a.charCodeAt(a.length-1)!==l||a.charCodeAt(a.length-2)!==l){if(a.length>2){var U=a.lastIndexOf("/");if(U!==a.length-1){U===-1?(a="",v=0):(a=a.slice(0,U),v=a.length-1-a.lastIndexOf("/")),p=m,_=0;continue}}else if(a.length===2||a.length===1){a="",v=0,p=m,_=0;continue}}o&&(a.length>0?a+="/..":a="..",v=2)}else a.length>0?a+="/"+c.slice(p+1,m):a=c.slice(p+1,m),v=m-p-1;p=m,_=0}else $===l&&_!==-1?++_:_=-1}return a},h=function(c){try{return decodeURIComponent(c)}catch{return c}},y=function(c){r(c);var o=c;if(o.length===0)return".";var a=o.charCodeAt(0)===s,v=o.charCodeAt(o.length-1)===s;return o=h(o),o=d(o,!a),o.length===0&&!a&&(o="."),o.length>0&&v&&(o+="/"),a?"/"+o:o},E=y;i.default=E,e.exports=i.default})(R,R.exports);var _e=R.exports;const me=It(_e),fe=e=>et.dispatch("text/setAttachmentList",e),Q=et.getters["text/findAttachment"];var M,w,A,S,O,I,u,L,D,W,ct,j;class fi{constructor({session:i,user:n,shareToken:s,currentDirectory:l,fileId:r}){x(this,u);x(this,M);x(this,w);x(this,A);x(this,S);x(this,O);x(this,I);k(this,M,i),k(this,w,n),k(this,A,s),k(this,S,l),k(this,O,r!=null?r:i.documentId),k(this,I,b(this,u,L).call(this))}async resolve(i,n=!0){let s;const l=/^\.attachments\.\d+\//;if(i.match(l)){const r=decodeURIComponent(i.replace(l,"").split("?")[0]);if(await g(this,I),s=Q(r),n&&!s&&(await b(this,u,L).call(this),s=Q(r)),s)return s}return be(i)?{isImage:!0,name:b(this,u,D).call(this,i),previewUrl:i,fullUrl:i}:{isImage:!0,name:b(this,u,D).call(this,i),previewUrl:b(this,u,W).call(this,i),fullUrl:b(this,u,W).call(this,i)}}}M=new WeakMap,w=new WeakMap,A=new WeakMap,S=new WeakMap,O=new WeakMap,I=new WeakMap,u=new WeakSet,L=async function(){return fe({documentId:g(this,O),session:g(this,M),shareToken:g(this,A)})},D=function(i){return i.split("/").pop()},W=function(i){if(g(this,w)){const r=g(this,w).uid,d=b(this,u,j).call(this,i).split("/").map(encodeURIComponent).join("/");return St("dav/files/".concat(r).concat(d))}const n=b(this,u,j).call(this,i).split("/"),s=n.pop(),l=n.join("/");return Ot("/s/{token}/download?path={dirname}&files={basename}",{token:g(this,A),basename:s,dirname:l})},ct=function(i){return decodeURI(i.split("?")[0])},j=function(i){const n=[g(this,S),b(this,u,ct).call(this,i)].join("/");return me(n)};function be(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")}const ye=B({name:"NcActionButton",components:{NextcloudVueNcActionButton:V,Help:mt}});var ge=function(){var e=this,i=e._self._c;return e._self._setupProxy,i("NextcloudVueNcActionButton",e._g({attrs:{"close-after-click":"","data-text-action-entry":"formatting-help"},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Help")]},proxy:!0}])},e.$listeners),[e._v(" "+e._s(e.t("text","Formatting help"))+" ")])},xe=[],ke=f(ye,ge,xe,!1,null,null);const Ce=ke.exports,we=B({name:"CharacterCount",components:{AlphabeticalVariant:ft,NcActionText:Et},mixins:[F],props:{visible:Boolean},data:()=>({wordCount:0,charCount:0}),computed:{countString(){return"".concat(J("text","%n word","%n words",this.wordCount),", ").concat(J("text","%n char","%n chars",this.charCount))}},watch:{visible:"refresh"},created(){this.refresh()},methods:{refresh(){this.wordCount=this.$editor.storage.characterCount.words(),this.charCount=this.$editor.storage.characterCount.characters()}}});var Ae=function(){var e=this,i=e._self._c;return e._self._setupProxy,i("NcActionText",{attrs:{"data-text-action-entry":"character-count"},scopedSlots:e._u([{key:"icon",fn:function(){return[i("AlphabeticalVariant")]},proxy:!0},{key:"default",fn:function(){return[e._v(" "+e._s(e.countString)+" ")]},proxy:!0}])})},Ee=[],$e=f(we,Ae,Ee,!1,null,null);const Me=$e.exports;function Se(){var e;return((e=navigator==null?void 0:navigator.userAgentData)==null?void 0:e.mobile)!==void 0?navigator.userAgentData.mobile:[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/playbook/i,/silk/i,/BlackBerry/i,/Windows Phone/i].some(i=>navigator.userAgent.match(i))}const Oe={name:"HelpModal",components:{NcDialog:$t},data(){return{formatted:{bold:!0,italic:!0,strikethrough:!0,heading1:!0,heading6:!0,unorderdList:!0,orderedList:!0,checkList:!0,blockQuote:!0,codeBlock:!0}}},computed:{isFormatted(){return e=>this.formatted[e]},isMobileCached(){return this.isMobilePlatform()}},methods:{toggleFormatted(e){this.formatted[e]=!this.formatted[e]},isMobilePlatform:Se}};var Ie=function(){var e=this,i=e._self._c;return i("NcDialog",{attrs:{size:"normal","data-text-el":"formatting-help",name:e.t("text","Formatting and shortcuts"),"close-on-click-outside":!0},on:{closing:function(n){return e.$emit("close")}}},[i("h2",[e._v(e._s(e.t("text","Formatting and shortcuts")))]),i("p",[e._v(e._s(e.t("text","Speed up your writing with simple shortcuts.")))]),e.isMobileCached?i("p",[e._v(" "+e._s(e.t("text","Just type the Markdown syntax from below."))+" ")]):i("p",[e._v(" "+e._s(e.t("text","Just type the Markdown syntax or use keyboard shortcuts from below."))+" ")]),i("table",[i("thead",[i("tr",[i("th",[e._v(e._s(e.t("text","Style")))]),i("th",[e._v(e._s(e.t("text","Syntax")))]),e.isMobileCached?e._e():i("th",[e._v(" "+e._s(e.t("text","Keyboard shortcuts"))+" ")])])]),i("tbody",[i("tr",[i("td",[e._v(e._s(e.t("text","New paragraph")))]),i("td",[i("kbd",[e._v(e._s(e.t("text","Enter")))])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Hard line break")))]),i("td",[i("kbd",[e._v(e._s(e.t("text","Enter")))]),e._v(" "+e._s(e.t("text","followed by"))+" "),i("kbd",[e._v(e._s(e.t("text","Backspace")))])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Enter")))])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Bold")))]),i("td",[i("code",[e._v("**"+e._s(e.t("text","Bold text"))+"**")])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v("B")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Italic")))]),i("td",[i("code",[e._v("*"+e._s(e.t("text","Italicized text"))+"*")])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v("I")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Strikethrough")))]),i("td",[i("code",[e._v("~~"+e._s(e.t("text","Mistaken text"))+"~~")])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v("S")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Underline")))]),i("td",[i("code",[e._v("__"+e._s(e.t("text","Underlined text"))+"__")])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v("U")])])]),i("tr",[i("td",{staticClass:"ellipsis_top"},[e._v(" "+e._s(e.t("text","Heading 1"))+" ")]),i("td",{staticClass:"ellipsis_top"},[i("code",[e._v("# "+e._s(e.t("text","Heading level 1")))])]),e.isMobileCached?e._e():i("td",{staticClass:"ellipsis_top"},[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v("1")])])]),i("tr",[i("td",{staticClass:"noborder ellipsis"},[e._v(" … ")]),i("td",{staticClass:"noborder ellipsis"},[e._v(" … ")]),e.isMobileCached?e._e():i("td",{staticClass:"ellipsis noborder"},[e._v(" … ")])]),i("tr",[i("td",{staticClass:"noborder ellipsis_bottom"},[e._v(" "+e._s(e.t("text","Heading 6"))+" ")]),i("td",{staticClass:"noborder ellipsis_bottom"},[i("code",[e._v("###### "+e._s(e.t("text","Heading level 6")))])]),e.isMobileCached?e._e():i("td",{staticClass:"noborder ellipsis_bottom"},[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v("6")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Unordered list")))]),i("td",[i("code",[e._v("* "+e._s(e.t("text","An item")))])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v("8")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Ordered list")))]),i("td",[i("code",[e._v("1. "+e._s(e.t("text","First item")))])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Shift")))]),e._v(" + "),i("kbd",[e._v("7")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Checklist")))]),i("td",[i("code",[e._v("* [] "+e._s(e.t("text","To-Do item")))])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Blockquote")))]),i("td",[i("code",[e._v("> "+e._s(e.t("text","Quoted text")))])]),e.isMobileCached?e._e():i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(">")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Code block")))]),i("td",[i("code",[e._v("``` "+e._s(e.t("text","Some code")))])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Link")))]),i("td",[i("code",[e._v("[Title](https://example.org)")])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Insert emoji")))]),i("td",[i("code",[e._v(":"+e._s(e.t("text","emoji")))])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Mention someone")))]),i("td",[i("code",[e._v("@"+e._s(e.t("text","name")))])]),e.isMobileCached?e._e():i("td")]),i("tr",[i("td",[e._v(e._s(e.t("text","Smart picker")))]),i("td",[i("code",[e._v("/"+e._s(e.t("text","something")))])]),e.isMobileCached?e._e():i("td")])])]),i("table",{attrs:{vif:"!isMobileCached"}},[i("thead",[i("tr",[i("th",[e._v(e._s(e.t("text","Action")))]),i("th",[e._v(e._s(e.t("text","Keyboard shortcuts")))])])]),i("tbody",[i("tr",[i("td",[e._v(e._s(e.t("text","Undo")))]),i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v("Z")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Redo")))]),i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v("Y")])])]),i("tr",[i("td",[e._v(e._s(e.t("text","Toggle outline")))]),i("td",[i("kbd",[e._v(e._s(e.t("text","Ctrl")))]),e._v(" + "),i("kbd",[e._v(e._s(e.t("text","Alt")))]),e._v(" + "),i("kbd",[e._v("H")])])])])])])},Ne=[],Pe=f(Oe,Ie,Ne,!1,null,"bdf077d8");const Be=Pe.exports,Fe={name:"MenuBar",components:{ActionFormattingHelp:Ce,ActionList:at,ActionSingle:rt,HelpModal:Be,NcActionSeparator:G,NcActionButton:V,CharacterCount:Me,TranslateVariant:bt},extends:lt,mixins:[F,Dt,nt,st],provide(){const e={};return Object.defineProperties(e,{[xt]:{get:()=>this.randomID}}),e},props:{isHidden:{type:Boolean,default:!1}},setup(){const e=P(),{width:i}=Zt(e);return{menubar:e,width:i}},data(){return{entries:[...yt],randomID:"menu-bar-".concat(Math.ceil(Math.random()*1e4+500).toString(16)),displayHelp:!1,isReady:!1,canTranslate:Ut("text","translation_languages",[]).length>0,resize:null}},computed:{visibleEntries(){return this.entries.filter(({priority:e})=>e===void 0||e<=this.iconsLimit)},hiddenEntries(){const e=this.entries.filter(({priority:n})=>n!==void 0&&n>this.iconsLimit),i=e.reduce((n,s,l)=>{var d;const r=(d=s.children)!=null?d:[s];if(r.length>1){const h=n.length&&!n.at(-1).isSeparator?[{key:"separator-before-".concat(s.id),isSeparator:!0}]:[],y=l!==e.length-1?[{key:"separator-after-".concat(s.id),isSeparator:!0}]:[];return[...n,...h,...r,...y]}return[...n,...r]},[]);return{key:"remain",label:this.t("text","Remaining actions"),icon:gt,children:i}},iconWidth(){var i;const e=(i=this.menubar&&getComputedStyle(this.menubar))==null?void 0:i.getPropertyValue("--default-clickable-area");return parseInt(e)||34},iconsLimit(){const e=this.width-4,i=this.$isMobile?this.iconWidth:this.iconWidth+2;return Math.floor(e/i)-1}},mounted(){this.$nextTick(()=>{this.isReady=!0,this.$emit("update:loaded",!0)})},methods:{showHelp(){this.displayHelp=!0},hideHelp(){this.displayHelp=!1},showTranslate(){const{from:e,to:i}=this.$editor.view.state.selection;let n=this.$editor.view.state.doc.textBetween(e,i," ");n.trim().length||(this.$editor.commands.selectAll(),n=this.$editor.view.state.doc.textContent),console.debug("translation click",this.$editor.view.state.selection,n),it("text:translate-modal:show",{content:n})}}};var Ue=function(){var e=this,i=e._self._c;return i("div",{staticClass:"text-menubar",class:{"text-menubar--ready":e.isReady,"text-menubar--hide":e.isHidden,"text-menubar--is-workspace":e.$isRichWorkspace},attrs:{id:e.randomID,"data-text-el":"menubar",role:"region","aria-label":e.t("text","Editor actions")}},[e.displayHelp?i("HelpModal",{on:{close:e.hideHelp}}):e._e(),e.$isRichEditor?i("div",{ref:"menubar",staticClass:"text-menubar__entries",attrs:{role:"toolbar","aria-label":e.t("text","Formatting menu bar")},on:{keydown:[function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"left",37,n.key,["Left","ArrowLeft"])||"button"in n&&n.button!==0?null:(n.stopPropagation(),e.handleToolbarNavigation.apply(null,arguments))},function(n){return!n.type.indexOf("key")&&e._k(n.keyCode,"right",39,n.key,["Right","ArrowRight"])||"button"in n&&n.button!==2?null:(n.stopPropagation(),e.handleToolbarNavigation.apply(null,arguments))}]}},[e._l(e.visibleEntries,function(n,s){return i(n.component?n.component:n.children?"ActionList":"ActionSingle",{key:n.key,ref:"menuEntries",refInFor:!0,tag:"component",attrs:{"action-entry":n,"can-be-focussed":e.activeMenuEntry===s},on:{disabled:function(l){return e.disableMenuEntry(n.key,l)},click:function(l){e.activeMenuEntry=s}}})}),i("ActionList",{ref:"remainingEntries",attrs:{"action-entry":e.hiddenEntries,"can-be-focussed":e.activeMenuEntry===e.visibleEntries.length,"force-enabled":!0},on:{click:function(n){e.activeMenuEntry="remain"}},scopedSlots:e._u([{key:"lastAction",fn:function({visible:n}){return[e.canTranslate?i("NcActionButton",{attrs:{"close-after-click":""},on:{click:e.showTranslate},scopedSlots:e._u([{key:"icon",fn:function(){return[i("TranslateVariant")]},proxy:!0}],null,!0)},[e._v(" "+e._s(e.t("text","Translate"))+" ")]):e._e(),i("ActionFormattingHelp",{on:{click:e.showHelp}}),i("NcActionSeparator"),i("CharacterCount",e._b({},"CharacterCount",{visible:n},!1))]}}],null,!1,2316723924)})],2):e._e(),i("div",{staticClass:"text-menubar__slot"},[e._t("default")],2)],1)},Te=[],He=f(Fe,Ue,Te,!1,null,"3ec3c36a");const bi=He.exports,Re={name:"ContentContainer",components:{EditorContent:kt,EditorOutline:Ct},mixins:[F,tt],computed:{showOutline(){return this.$outlineState.visible}}};var Le=function(){var e=this,i=e._self._c;return i("div",{staticClass:"content-wrapper text-editor__content-wrapper",class:{"--show-outline":e.showOutline},attrs:{"data-text-el":"editor-content-wrapper"}},[e.showOutline?i("div",{staticClass:"text-editor__content-wrapper__left"},[i("EditorOutline")],1):e._e(),e._t("default"),i("EditorContent",{staticClass:"editor__content text-editor__content",attrs:{role:"document",editor:e.$editor}}),i("div",{staticClass:"text-editor__content-wrapper__right"})],2)},De=[],We=f(Re,Le,De,!1,null,"a3b97a85");const yi=We.exports,Y=e=>e.split("/").slice(0,-1).join("/"),je={name:"MediaHandler",mixins:[F,Wt,jt],provide(){const e={};return Object.defineProperties(e,{[Kt]:{get:()=>this.showAttachmentPrompt},[zt]:{get:()=>this.chooseLocalFile},[Vt]:{get:()=>this.state}}),e},data(){return{lastFilePath:null,draggedOver:!1,state:{isUploadingAttachments:!1}}},computed:{initialFilePath(){var e,i,n;return(n=this.lastFilePath)!=null?n:Y((i=(e=this.$file)==null?void 0:e.relativePath)!=null?i:"/")}},methods:{setDraggedOver(e){this.draggedOver=e},onPaste(e){this.uploadAttachmentFiles(e.detail.files)},onEditorDrop(e){this.uploadAttachmentFiles(e.detail.files,e.detail.position),this.draggedOver=!1},onAttachmentUploadFilePicked(e){this.uploadAttachmentFiles(e.target.files),e.target.value=""},chooseLocalFile(){this.$refs.attachmentFileInput.click()},async uploadAttachmentFiles(e,i=null){if(!e)return;this.state.isUploadingAttachments=!0;const n=[...e].map(s=>this.uploadAttachmentFile(s,i));return Promise.all(n).catch(s=>{H.error("Uploading multiple attachments failed",{error:s}),N(t("text","Uploading multiple attachments failed."))}).then(()=>{this.state.isUploadingAttachments=!1})},async uploadAttachmentFile(e,i=null){return this.state.isUploadingAttachments=!0,this.$syncService.uploadAttachment(e).then(n=>{var s,l,r;this.insertAttachment((s=n.data)==null?void 0:s.name,(l=n.data)==null?void 0:l.id,e.type,i,(r=n.data)==null?void 0:r.dirname)}).catch(n=>{var s;H.error("Uploading attachment failed",{error:n}),(s=n.response)!=null&&s.data.error?N(t("text","Uploading attachment failed: {error}",{error:n.response.data.error})):N(t("text","Uploading attachment failed."))}).then(()=>{this.state.isUploadingAttachments=!1})},showAttachmentPrompt(){Ft()&&OC.dialogs.filepicker(t("text","Insert an attachment"),e=>{this.insertFromPath(e)},!1,[],!0,void 0,this.initialFilePath)},insertFromPath(e){return this.lastFilePath=Y(e),this.state.isUploadingAttachments=!0,this.$syncService.insertAttachmentFile(e).then(i=>{var n,s,l,r;this.insertAttachment((n=i.data)==null?void 0:n.name,(s=i.data)==null?void 0:s.id,(l=i.data)==null?void 0:l.mimetype,null,(r=i.data)==null?void 0:r.dirname)}).catch(i=>{H.error("Failed to insert from Files",{error:i}),N(t("text","Failed to insert from Files"))}).then(()=>{this.state.isUploadingAttachments=!1})},insertAttachment(e,i,n,s=null,l=""){const r=l+"/"+encodeURIComponent(e).replace(/[!'()*]/g,y=>"%"+y.charCodeAt(0).toString(16).toUpperCase()),d=e.replaceAll(/[[\]]/g,"");(s?this.$editor.chain().focus(s):this.$editor.chain()).setImage({src:r,alt:d}).run();const h=this.$editor.view.state.selection;h.empty||this.$editor.commands.focus(h.to),this.$editor.commands.scrollIntoView(),it("text:image-node:add",null)}}};var Ke=function(){var e=this,i=e._self._c;return i("div",{staticClass:"editor editor-media-handler",class:{draggedOver:e.draggedOver},attrs:{"data-text-el":"editor-media-handler"},on:{"image-paste":e.onPaste,dragover:function(n){return n.preventDefault(),n.stopPropagation(),e.setDraggedOver(!0)},dragleave:function(n){return n.preventDefault(),n.stopPropagation(),e.setDraggedOver(!1)},"file-drop":e.onEditorDrop}},[i("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"}],ref:"attachmentFileInput",attrs:{"data-text-el":"attachment-file-input",type:"file",accept:"*/*",multiple:""},on:{change:e.onAttachmentUploadFilePicked}}),e._t("default")],2)},ze=[],Ve=f(je,Ke,ze,!1,null,null);const qe=Ve.exports,Je={name:"MainContainer",components:{MediaHandler:qe},mixins:[qt]};var Qe=function(){var e=this,i=e._self._c;return i("div",{staticClass:"editor"},[e.$editorUpload?i("MediaHandler",{staticClass:"text-editor__main"},[e._t("default")],2):e._t("default")],2)},Ye=[],Ze=f(Je,Qe,Ye,!1,null,"f2d30048");const gi=Ze.exports,Ge={name:"Wrapper",mixins:[X,nt,st],provide(){const e={};return Object.defineProperties(e,{[wt]:{get:()=>this.outline},[At]:{get:()=>({toggle:this.outlineToggle})}}),e},props:{isResolvingConflict:{type:Boolean,require:!0},hasConnectionIssue:{type:Boolean,default:!1},contentLoaded:{type:Boolean,default:!0},showOutlineOutside:{type:Boolean,default:!1}},data:()=>({outline:{visible:!1,enable:!1}}),computed:{...Nt({viewWidth:e=>e.text.viewWidth}),showOutline(){return this.isAbleToShowOutline?this.outline.visible:!1},isAbleToShowOutline(){return this.$isRichWorkspace?!1:this.viewWidth>1265}},watch:{showOutlineOutside(){this.outline.visible=this.showOutlineOutside}},mounted(){this.outline.enable=this.isAbleToShowOutline,this.$watch(()=>this.isAbleToShowOutline,e=>{Object.assign(this.outline,{enable:e})}),document.addEventListener("keydown",this.handleKeyDown)},beforeDestroy(){document.removeEventListener("keydown",this.handleKeyDown)},methods:{outlineToggle(){this.outline.visible=!this.outline.visible,this.$emit("outline-toggled",this.outline.visible)},handleKeyDown(e){e.ctrlKey&&e.altKey&&e.key==="h"&&this.outlineToggle()}}};var Xe=function(){var e=this,i=e._self._c;return i("div",{staticClass:"text-editor__wrapper",class:{"has-conflicts":e.isResolvingConflict,"is-rich-workspace":e.$isRichWorkspace,"is-rich-editor":e.$isRichEditor}},[e._t("default")],2)},ti=[],ei=f(Ge,Xe,ti,!1,null,"43824340");const xi=ei.exports;export{fi as A,yi as C,gi as M,mi as R,xi as W,bi as a,Zt as u};

Zerion Mini Shell 1.0