|
1 | 1 | const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('text', '', 'js/MarkdownContentEditor-BuYIomSD.chunk.mjs'),window.OC.filePath('text', '', 'js/TocContainer-DIUwMMIm.chunk.mjs'),window.OC.filePath('text', '', 'js/NcLoadingIcon-SwZTpIP3.chunk.mjs'),window.OC.filePath('text', '', 'js/emoji-picker-hi3Hwbeu.chunk.mjs'),window.OC.filePath('text', '', 'js/index-CdM8BgQf.chunk.mjs'),window.OC.filePath('text', '', 'js/vue.runtime.esm-DtYIo4vn.chunk.mjs'),window.OC.filePath('text', '', 'js/index-DCzdQJ7L.chunk.mjs'),window.OC.filePath('text', '', 'css/NcLoadingIcon-CAC0K4sG.chunk.css'),window.OC.filePath('text', '', 'js/logger-DS8A9d_w.chunk.mjs'),window.OC.filePath('text', '', 'js/index-Bnw2WuIx.chunk.mjs'),window.OC.filePath('text', '', 'js/index-D3wiQe9-.chunk.mjs'),window.OC.filePath('text', '', 'js/NcNoteCard-CwNXZ4vV-Bnva1u_k.chunk.mjs'),window.OC.filePath('text', '', 'css/NcNoteCard-CwNXZ4vV-GaPUWc2b.chunk.css'),window.OC.filePath('text', '', 'js/preload-helper-BorfeO-5.chunk.mjs'),window.OC.filePath('text', '', 'js/NcCheckboxRadioSwitch-CX3HXCEk-DsKhS70h.chunk.mjs'),window.OC.filePath('text', '', 'css/NcCheckboxRadioSwitch-CX3HXCEk-35V8jJy1.chunk.css'),window.OC.filePath('text', '', 'js/MediaHandler.provider-bE4nrOxZ.chunk.mjs'),window.OC.filePath('text', '', 'css/TocContainer-C05aodYb.chunk.css'),window.OC.filePath('text', '', 'js/MenuBar-B7dTEdAe.chunk.mjs'),window.OC.filePath('text', '', 'js/Wrapper-DaUPb35g.chunk.mjs'),window.OC.filePath('text', '', 'css/Wrapper-DCnCsJN8.chunk.css'),window.OC.filePath('text', '', 'css/MenuBar-nIM-GMTV.chunk.css'),window.OC.filePath('text', '', 'css/RichTextReader-Cxcjv1d6.chunk.css'),window.OC.filePath('text', '', 'js/Editor-DpwjbxRf.chunk.mjs'),window.OC.filePath('text', '', 'js/index-D804-9WX.chunk.mjs'),window.OC.filePath('text', '', 'js/dav-Rt1kTtvI-DEv3Nwu1.chunk.mjs'),window.OC.filePath('text', '', 'css/Editor-CbnckWmL.chunk.css'),window.OC.filePath('text', '', 'js/PlainTableContentEditor-Hbs2_2XN.chunk.mjs')])))=>i.map(i=>d[i]); |
2 | | -import{_ as y}from"./preload-helper-BorfeO-5.chunk.mjs";import{s as T,e as E}from"./index-CdM8BgQf.chunk.mjs";import{V as w}from"./vue.runtime.esm-DtYIo4vn.chunk.mjs";import{o as I,A as $,O as j,H as B,a as M,E as R,b as V}from"./MediaHandler.provider-bE4nrOxZ.chunk.mjs";import"./emoji-picker-hi3Hwbeu.chunk.mjs";import"./index-D3wiQe9-.chunk.mjs";import"./index-DCzdQJ7L.chunk.mjs";import"./logger-DS8A9d_w.chunk.mjs";import"./index-Bnw2WuIx.chunk.mjs";const D="1.3";window.OCA.Text={...window.OCA.Text};class v{#e;#o;constructor(e,t){return this.#e=e,this.#o=t,this.#n(),this}#t(){return this.#e.$children[0]}onCreate(e=()=>{}){return this.#e.$on("create:content",t=>{e(t)}),this}onLoaded(e=()=>{}){return this.#e.$on("ready",()=>{e()}),this}onUpdate(e=()=>{}){return this.#e.$on("update:content",t=>{e(t)}),this}onSearch(e=()=>{}){return T("text:editor:search-results",e),this}onTocToggle(e=()=>{}){return T("text:toc:toggled",e),this}onTocPin(e=()=>{}){return T("text:toc:pin",e),this}render(e){e.innerHTML="";const t=document.createElement("div");return e.appendChild(t),this.#e.$mount(t),this}destroy(){this.#e.$destroy(),this.#e.$el.innerHTML=""}setContent(e){return this.#e.$set(this.#o,"content",e),this.#t()?.setContent?.(e),this}setSearchQuery(e,t){this.#t()?.editor?.commands.setSearchQuery(e,t)}searchNext(){this.#t()?.editor?.commands.nextMatch()}searchPrevious(){this.#t()?.editor?.commands.previousMatch()}async save(){return this.#t().save?.()}setShowOutline(e){return E("text:toc:toggle",{visible:e}),this}setReadOnly(e){return this.#e.$set(this.#o,"readOnly",e),this}updateReadonlyBarProps(e){return this.#e.$set(this.#o,"readonlyBarProps",e),this}insertAtCursor(e){this.#t().editor?.chain().insertContent(e).focus().run()}focus(){this.#t().editor?.commands.focus()}debugYjs(){const e=this.#t().debugYjsData();console.warn(JSON.stringify(e,null," ")),console.warn(`%c%s |
| 2 | +import{_ as y}from"./preload-helper-BorfeO-5.chunk.mjs";import{s as T,e as E}from"./index-CdM8BgQf.chunk.mjs";import{V as w}from"./vue.runtime.esm-DtYIo4vn.chunk.mjs";import{o as I,A as $,O as M,H as j,a as B,E as H,b as R}from"./MediaHandler.provider-bE4nrOxZ.chunk.mjs";import"./emoji-picker-hi3Hwbeu.chunk.mjs";import"./index-D3wiQe9-.chunk.mjs";import"./index-DCzdQJ7L.chunk.mjs";import"./logger-DS8A9d_w.chunk.mjs";import"./index-Bnw2WuIx.chunk.mjs";const V="1.3";window.OCA.Text={...window.OCA.Text};class v{#e;#o;constructor(e,t){return this.#e=e,this.#o=t,this.#n(),this}#t(){return this.#e.$children[0]}onCreate(e=()=>{}){return this.#e.$on("create:content",t=>{e(t)}),this}onLoaded(e=()=>{}){return this.#e.$on("ready",()=>{e()}),this}onUpdate(e=()=>{}){return this.#e.$on("update:content",t=>{e(t)}),this}onSearch(e=()=>{}){return T("text:editor:search-results",e),this}onTocToggle(e=()=>{}){return T("text:toc:toggled",e),this}onTocPin(e=()=>{}){return T("text:toc:pin",e),this}render(e){e.innerHTML="";const t=document.createElement("div");return e.appendChild(t),this.#e.$mount(t),this}destroy(){this.#e.$destroy(),this.#e.$el.innerHTML=""}setContent(e){return this.#e.$set(this.#o,"content",e),this.#t()?.setContent?.(e),this}getHTML(){return this.#t()?.editor?.getHTML()}setSearchQuery(e,t){this.#t()?.editor?.commands.setSearchQuery(e,t)}searchNext(){this.#t()?.editor?.commands.nextMatch()}searchPrevious(){this.#t()?.editor?.commands.previousMatch()}async save(){return this.#t().save?.()}setShowOutline(e){return E("text:toc:toggle",{visible:e}),this}setReadOnly(e){return this.#e.$set(this.#o,"readOnly",e),this}updateReadonlyBarProps(e){return this.#e.$set(this.#o,"readonlyBarProps",e),this}insertAtCursor(e){this.#t().editor?.chain().insertContent(e).focus().run()}focus(){this.#t().editor?.commands.focus()}debugYjs(){const e=this.#t().debugYjsData();console.warn(JSON.stringify(e,null," ")),console.warn(`%c%s |
3 | 3 | %c%s |
4 | | -%s`,"font-weight: bold;",'Editor Yjs debug data. Copy the object below that starts with "clientId".',"font-weight: normal; font-style: italic;",'- In Chrome, select "Copy" at the end of the line.','- In Firefox, right-click on the object and select "Copy object".')}#n(){window?._oc_debug&&(this.vm=this.#e,window.OCA.Text._debug=[...window.OCA.Text._debug??[],this])}}window.OCA.Text.apiVersion=D,window.OCA.Text.createEditor=async function({el:l,fileId:e=void 0,useSession:t=!0,filePath:u=void 0,shareToken:a=null,content:h="",readOnly:p=!1,autofocus:s=!0,readonlyBar:n={component:null,props:null},onCreate:f=({markdown:r})=>{},onLoaded:i=()=>{},onUpdate:O=({markdown:r})=>{},onTocToggle:C=r=>{},onOutlineToggle:_=r=>{},onTocPin:b=(r,g)=>{},onFileInsert:x=void 0,onMentionSearch:P=void 0,onMentionInsert:L=void 0,openLinkHandler:k=void 0,onSearch:A=void 0}){const{default:r}=await y(async()=>{const{default:o}=await import("./MarkdownContentEditor-BuYIomSD.chunk.mjs");return{default:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),{default:g}=await y(async()=>{const{default:o}=await import("./Editor-DpwjbxRf.chunk.mjs").then(c=>c.a);return{default:o}},__vite__mapDeps([23,13,4,3,24,2,5,6,7,25,11,10,9,12,19,1,8,14,15,16,17,20,18,21,26]),import.meta.url),d=w.observable({readonlyBarProps:n.props,readOnly:p,content:h}),m=e&&t,S=new w({provide(){return{[V]:x,[R]:!!m,[M]:m?!0:P,[B]:m?!0:L,[j]:{openLink:k||I},[$]:{resolve(o,c){return[{type:"image",url:o}]}}}},data(){return d},render:o=>{const c=n?.component?{readonlyBar:()=>o(n.component,{props:d.readonlyBarProps})}:{};return m?o(g,{props:{fileId:e,relativePath:u,shareToken:a,mime:"text/markdown",active:!0,autofocus:s},scopedSlots:c}):o(r,{props:{fileId:e,content:d.content,relativePath:u,shareToken:a,readOnly:d.readOnly},scopedSlots:c})}});return new v(S,d).onCreate(f).onLoaded(i).onUpdate(O).onSearch(A).onTocToggle(_).onTocToggle(C).onTocPin(b).render(l)},window.OCA.Text.createTable=async function({el:l,content:e="",readOnly:t=!1,autofocus:u=!0,onCreate:a=({markdown:s})=>{},onLoaded:h=()=>{},onUpdate:p=({markdown:s})=>{}}){const{default:s}=await y(async()=>{const{default:i}=await import("./PlainTableContentEditor-Hbs2_2XN.chunk.mjs");return{default:i}},__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,22]),import.meta.url),n=w.observable({readOnly:t,content:e}),f=new w({data(){return n},render:i=>i(s,{props:{content:n.content,readOnly:n.readOnly}})});return new v(f,n).onCreate(a).onLoaded(h).onUpdate(p).render(l)}; |
| 4 | +%s`,"font-weight: bold;",'Editor Yjs debug data. Copy the object below that starts with "clientId".',"font-weight: normal; font-style: italic;",'- In Chrome, select "Copy" at the end of the line.','- In Firefox, right-click on the object and select "Copy object".')}#n(){window?._oc_debug&&(this.vm=this.#e,window.OCA.Text._debug=[...window.OCA.Text._debug??[],this])}}window.OCA.Text.apiVersion=V,window.OCA.Text.createEditor=async function({el:l,fileId:e=void 0,useSession:t=!0,filePath:u=void 0,shareToken:s=null,content:h="",readOnly:p=!1,autofocus:a=!0,readonlyBar:n={component:null,props:null},onCreate:f=({markdown:r})=>{},onLoaded:i=()=>{},onUpdate:O=({markdown:r})=>{},onTocToggle:C=r=>{},onOutlineToggle:_=r=>{},onTocPin:b=(r,g)=>{},onFileInsert:x=void 0,onMentionSearch:L=void 0,onMentionInsert:P=void 0,openLinkHandler:k=void 0,onSearch:A=void 0}){const{default:r}=await y(async()=>{const{default:o}=await import("./MarkdownContentEditor-BuYIomSD.chunk.mjs");return{default:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]),import.meta.url),{default:g}=await y(async()=>{const{default:o}=await import("./Editor-DpwjbxRf.chunk.mjs").then(c=>c.a);return{default:o}},__vite__mapDeps([23,13,4,3,24,2,5,6,7,25,11,10,9,12,19,1,8,14,15,16,17,20,18,21,26]),import.meta.url),d=w.observable({readonlyBarProps:n.props,readOnly:p,content:h}),m=e&&t,S=new w({provide(){return{[R]:x,[H]:!!m,[B]:m?!0:L,[j]:m?!0:P,[M]:{openLink:k||I},[$]:{resolve(o,c){return[{type:"image",url:o}]}}}},data(){return d},render:o=>{const c=n?.component?{readonlyBar:()=>o(n.component,{props:d.readonlyBarProps})}:{};return m?o(g,{props:{fileId:e,relativePath:u,shareToken:s,mime:"text/markdown",active:!0,autofocus:a},scopedSlots:c}):o(r,{props:{fileId:e,content:d.content,relativePath:u,shareToken:s,readOnly:d.readOnly},scopedSlots:c})}});return new v(S,d).onCreate(f).onLoaded(i).onUpdate(O).onSearch(A).onTocToggle(_).onTocToggle(C).onTocPin(b).render(l)},window.OCA.Text.createTable=async function({el:l,content:e="",readOnly:t=!1,autofocus:u=!0,onCreate:s=({markdown:a})=>{},onLoaded:h=()=>{},onUpdate:p=({markdown:a})=>{}}){const{default:a}=await y(async()=>{const{default:i}=await import("./PlainTableContentEditor-Hbs2_2XN.chunk.mjs");return{default:i}},__vite__mapDeps([27,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,22]),import.meta.url),n=w.observable({readOnly:t,content:e}),f=new w({data(){return n},render:i=>i(a,{props:{content:n.content,readOnly:n.readOnly}})});return new v(f,n).onCreate(s).onLoaded(h).onUpdate(p).render(l)}; |
5 | 5 | //# sourceMappingURL=text-editor.mjs.map |
0 commit comments