UNPKG

md-editor-rt

Version:

Markdown editor for react, developed in jsx and typescript, dark theme、beautify content by prettier、render articles directly、paste or clip the picture and upload it...

2 lines (1 loc) 1.51 kB
"use strict";const n="onSave",A="changeCatalogVisible",c="changeFullscreen",l="pageFullscreenChanged",R="fullscreenChanged",L="previewChanged",i="previewOnlyChanged",N="htmlPreviewChanged",a="catalogVisibleChanged",I="buildFinished",G="errorCatcher",T="replace",h="uploadImage",D="ctrlZ",H="ctrlShiftZ",r="catalogChanged",S="pushCatalog",p="rerender",V="eventListener",g="taskStateChanged",O="sendEditorView",d="getEditorView";class P{pools={};remove(E,s,t){const o=this.pools[E]&&this.pools[E][s];o&&(this.pools[E][s]=o.filter(_=>_!==t))}clear(E){this.pools[E]={}}on(E,s){return this.pools[E]||(this.pools[E]={}),this.pools[E][s.name]||(this.pools[E][s.name]=[]),this.pools[E][s.name].push(s.callback),this.pools[E][s.name].includes(s.callback)}emit(E,s,...t){this.pools[E]||(this.pools[E]={});const o=this.pools[E][s];o&&o.forEach(_=>{try{_(...t)}catch(C){console.error(`${s} monitor event exception!`,C)}})}}const u=new P;exports.BUILD_FINISHED=I;exports.CATALOG_CHANGED=r;exports.CATALOG_VISIBLE_CHANGED=a;exports.CHANGE_CATALOG_VISIBLE=A;exports.CHANGE_FULL_SCREEN=c;exports.CTRL_SHIFT_Z=H;exports.CTRL_Z=D;exports.ERROR_CATCHER=G;exports.EVENT_LISTENER=V;exports.FULL_SCREEN_CHANGED=R;exports.GET_EDITOR_VIEW=d;exports.HTML_PREVIEW_CHANGED=N;exports.ON_SAVE=n;exports.PAGE_FULL_SCREEN_CHANGED=l;exports.PREVIEW_CHANGED=L;exports.PREVIEW_ONLY_CHANGED=i;exports.PUSH_CATALOG=S;exports.REPLACE=T;exports.RERENDER=p;exports.SEND_EDITOR_VIEW=O;exports.TASK_STATE_CHANGED=g;exports.UPLOAD_IMAGE=h;exports.bus=u;