md-editor-v3 6.3.1 → 6.3.2-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/types/index.d.ts +3341 -8
- package/package.json +2 -1
- package/lib/types/DropdownToolbar/DropdownToolbar.d.ts +0 -137
- package/lib/types/DropdownToolbar/index.d.ts +0 -6
- package/lib/types/MdCatalog/CatalogLink.d.ts +0 -53
- package/lib/types/MdCatalog/MdCatalog.d.ts +0 -186
- package/lib/types/MdCatalog/index.d.ts +0 -6
- package/lib/types/MdEditor/Editor.d.ts +0 -590
- package/lib/types/MdEditor/components/Checkbox/index.d.ts +0 -33
- package/lib/types/MdEditor/components/CustomScrollbar/index.d.ts +0 -72
- package/lib/types/MdEditor/components/Divider/index.d.ts +0 -2
- package/lib/types/MdEditor/components/Dropdown/index.d.ts +0 -55
- package/lib/types/MdEditor/components/Icon/Github.d.ts +0 -2
- package/lib/types/MdEditor/components/Icon/Icon.d.ts +0 -18
- package/lib/types/MdEditor/components/Icon/Str.d.ts +0 -3
- package/lib/types/MdEditor/components/Icon/index.d.ts +0 -16
- package/lib/types/MdEditor/components/Modal/Modal.d.ts +0 -108
- package/lib/types/MdEditor/components/Modal/index.d.ts +0 -6
- package/lib/types/MdEditor/composition.d.ts +0 -92
- package/lib/types/MdEditor/config.d.ts +0 -33
- package/lib/types/MdEditor/index.d.ts +0 -6
- package/lib/types/MdEditor/layouts/Content/ContentPreview.d.ts +0 -153
- package/lib/types/MdEditor/layouts/Content/UpdateOnDemand.d.ts +0 -28
- package/lib/types/MdEditor/layouts/Content/codemirror/autocompletion.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Content/codemirror/commands.d.ts +0 -4
- package/lib/types/MdEditor/layouts/Content/codemirror/floatingToolbar.d.ts +0 -6
- package/lib/types/MdEditor/layouts/Content/codemirror/index.d.ts +0 -53
- package/lib/types/MdEditor/layouts/Content/codemirror/textShortener.d.ts +0 -20
- package/lib/types/MdEditor/layouts/Content/codemirror/themeLight.d.ts +0 -26
- package/lib/types/MdEditor/layouts/Content/codemirror/themeOneDark.d.ts +0 -26
- package/lib/types/MdEditor/layouts/Content/composition/index.d.ts +0 -10
- package/lib/types/MdEditor/layouts/Content/composition/useAttach.d.ts +0 -9
- package/lib/types/MdEditor/layouts/Content/composition/useAutoScroll.d.ts +0 -5
- package/lib/types/MdEditor/layouts/Content/composition/useCodeMirror.d.ts +0 -15
- package/lib/types/MdEditor/layouts/Content/composition/useCopyCode.d.ts +0 -4
- package/lib/types/MdEditor/layouts/Content/composition/useEcharts.d.ts +0 -10
- package/lib/types/MdEditor/layouts/Content/composition/useFollowCatalog.d.ts +0 -5
- package/lib/types/MdEditor/layouts/Content/composition/useHighlight.d.ts +0 -8
- package/lib/types/MdEditor/layouts/Content/composition/useKatex.d.ts +0 -8
- package/lib/types/MdEditor/layouts/Content/composition/useMarkdownIt.d.ts +0 -6
- package/lib/types/MdEditor/layouts/Content/composition/useMermaid.d.ts +0 -10
- package/lib/types/MdEditor/layouts/Content/composition/usePasteUpload.d.ts +0 -8
- package/lib/types/MdEditor/layouts/Content/composition/useRemount.d.ts +0 -3
- package/lib/types/MdEditor/layouts/Content/composition/useResize.d.ts +0 -12
- package/lib/types/MdEditor/layouts/Content/composition/useTaskState.d.ts +0 -3
- package/lib/types/MdEditor/layouts/Content/composition/useToolbarEffect.d.ts +0 -3
- package/lib/types/MdEditor/layouts/Content/composition/userZoom.d.ts +0 -10
- package/lib/types/MdEditor/layouts/Content/index.d.ts +0 -93
- package/lib/types/MdEditor/layouts/Content/markdownIt/admonition/index.d.ts +0 -11
- package/lib/types/MdEditor/layouts/Content/markdownIt/code/index.d.ts +0 -23
- package/lib/types/MdEditor/layouts/Content/markdownIt/echarts/index.d.ts +0 -7
- package/lib/types/MdEditor/layouts/Content/markdownIt/heading/index.d.ts +0 -9
- package/lib/types/MdEditor/layouts/Content/markdownIt/katex/index.d.ts +0 -20
- package/lib/types/MdEditor/layouts/Content/markdownIt/mermaid/index.d.ts +0 -7
- package/lib/types/MdEditor/layouts/Content/markdownIt/task/index.d.ts +0 -15
- package/lib/types/MdEditor/layouts/Content/markdownIt/xss/index.d.ts +0 -13
- package/lib/types/MdEditor/layouts/Content/props.d.ts +0 -204
- package/lib/types/MdEditor/layouts/Content/type.d.ts +0 -19
- package/lib/types/MdEditor/layouts/FloatingToolbar/index.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Footer/MarkdownTotal.d.ts +0 -15
- package/lib/types/MdEditor/layouts/Footer/ScrollAuto.d.ts +0 -21
- package/lib/types/MdEditor/layouts/Footer/index.d.ts +0 -52
- package/lib/types/MdEditor/layouts/Modals/Clip.d.ts +0 -33
- package/lib/types/MdEditor/layouts/Modals/index.d.ts +0 -33
- package/lib/types/MdEditor/layouts/Toolbar/TableShape.d.ts +0 -28
- package/lib/types/MdEditor/layouts/Toolbar/composition.d.ts +0 -7
- package/lib/types/MdEditor/layouts/Toolbar/index.d.ts +0 -23
- package/lib/types/MdEditor/layouts/Toolbar/props.d.ts +0 -14
- package/lib/types/MdEditor/layouts/Toolbar/tools/Bold.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Catalog.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Code.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/CodeRow.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Fullscreen.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Github.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/HtmlPreview.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Image.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/ImageDropdown.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Italic.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Katex.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Link.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Mermaid.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Next.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/OrderedList.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/PageFullscreen.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Prettier.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Preview.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/PreviewOnly.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Quote.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Revoke.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Save.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/StrikeThrough.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Sub.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Sup.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Table.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Task.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Title.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/Underline.d.ts +0 -2
- package/lib/types/MdEditor/layouts/Toolbar/tools/UnorderedList.d.ts +0 -2
- package/lib/types/MdEditor/props.d.ts +0 -784
- package/lib/types/MdEditor/static/env.d.ts +0 -1
- package/lib/types/MdEditor/static/event-name.d.ts +0 -23
- package/lib/types/MdEditor/static/index.d.ts +0 -14
- package/lib/types/MdEditor/type.d.ts +0 -534
- package/lib/types/MdEditor/utils/cache.d.ts +0 -2
- package/lib/types/MdEditor/utils/content-help.d.ts +0 -44
- package/lib/types/MdEditor/utils/dom.d.ts +0 -43
- package/lib/types/MdEditor/utils/event-bus.d.ts +0 -17
- package/lib/types/MdEditor/utils/index.d.ts +0 -38
- package/lib/types/MdEditor/utils/md-it.d.ts +0 -2
- package/lib/types/MdEditor/utils/scroll-auto.d.ts +0 -19
- package/lib/types/MdEditor/utils/vue-tsx.d.ts +0 -18
- package/lib/types/MdPreview/MdPreview.d.ts +0 -516
- package/lib/types/MdPreview/composition/useExpose.d.ts +0 -5
- package/lib/types/MdPreview/index.d.ts +0 -6
- package/lib/types/ModalToolbar/ModalToolbar.d.ts +0 -216
- package/lib/types/ModalToolbar/index.d.ts +0 -6
- package/lib/types/NormalFooterToolbar/NormalFooterToolbar.d.ts +0 -51
- package/lib/types/NormalFooterToolbar/index.d.ts +0 -6
- package/lib/types/NormalToolbar/NormalToolbar.d.ts +0 -117
- package/lib/types/NormalToolbar/index.d.ts +0 -6
- package/lib/types/config.d.ts +0 -3
- package/lib/types/preview.d.ts +0 -6
- package/lib/types/util.d.ts +0 -5
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isServer: boolean;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export declare const ON_SAVE = "onSave";
|
|
2
|
-
export declare const CHANGE_CATALOG_VISIBLE = "changeCatalogVisible";
|
|
3
|
-
export declare const CHANGE_FULL_SCREEN = "changeFullscreen";
|
|
4
|
-
export declare const PAGE_FULL_SCREEN_CHANGED = "pageFullscreenChanged";
|
|
5
|
-
export declare const FULL_SCREEN_CHANGED = "fullscreenChanged";
|
|
6
|
-
export declare const PREVIEW_CHANGED = "previewChanged";
|
|
7
|
-
export declare const PREVIEW_ONLY_CHANGED = "previewOnlyChanged";
|
|
8
|
-
export declare const HTML_PREVIEW_CHANGED = "htmlPreviewChanged";
|
|
9
|
-
export declare const CATALOG_VISIBLE_CHANGED = "catalogVisibleChanged";
|
|
10
|
-
export declare const TEXTAREA_FOCUS = "textareaFocus";
|
|
11
|
-
export declare const BUILD_FINISHED = "buildFinished";
|
|
12
|
-
export declare const ERROR_CATCHER = "errorCatcher";
|
|
13
|
-
export declare const REPLACE = "replace";
|
|
14
|
-
export declare const UPLOAD_IMAGE = "uploadImage";
|
|
15
|
-
export declare const CTRL_Z = "ctrlZ";
|
|
16
|
-
export declare const CTRL_SHIFT_Z = "ctrlShiftZ";
|
|
17
|
-
export declare const CATALOG_CHANGED = "catalogChanged";
|
|
18
|
-
export declare const PUSH_CATALOG = "pushCatalog";
|
|
19
|
-
export declare const RERENDER = "rerender";
|
|
20
|
-
export declare const EVENT_LISTENER = "eventListener";
|
|
21
|
-
export declare const TASK_STATE_CHANGED = "taskStateChanged";
|
|
22
|
-
export declare const SEND_EDITOR_VIEW = "sendEditorView";
|
|
23
|
-
export declare const GET_EDITOR_VIEW = "getEditorView";
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const CDN_IDS: {
|
|
2
|
-
hljs: string;
|
|
3
|
-
hlcss: string;
|
|
4
|
-
prettier: string;
|
|
5
|
-
prettierMD: string;
|
|
6
|
-
cropperjs: string;
|
|
7
|
-
croppercss: string;
|
|
8
|
-
screenfull: string;
|
|
9
|
-
mermaidM: string;
|
|
10
|
-
mermaid: string;
|
|
11
|
-
katexjs: string;
|
|
12
|
-
katexcss: string;
|
|
13
|
-
echarts: string;
|
|
14
|
-
};
|
|
@@ -1,534 +0,0 @@
|
|
|
1
|
-
import { Compartment, Extension } from '@codemirror/state';
|
|
2
|
-
import { KeyBinding, EditorView } from '@codemirror/view';
|
|
3
|
-
import { LooseRequired } from '@vue/shared';
|
|
4
|
-
import markdownit, { Token } from 'markdown-it';
|
|
5
|
-
import { Component, SetupContext, ExtractPropTypes, VNode } from 'vue';
|
|
6
|
-
import { IconName } from './components/Icon/Icon';
|
|
7
|
-
import { editorProps, mdPreviewProps } from './props';
|
|
8
|
-
import { ToolDirective } from './utils/content-help';
|
|
9
|
-
declare global {
|
|
10
|
-
interface Window {
|
|
11
|
-
hljs: any;
|
|
12
|
-
prettier: any;
|
|
13
|
-
prettierPlugins: any;
|
|
14
|
-
Cropper: any;
|
|
15
|
-
screenfull: any;
|
|
16
|
-
mermaid: any;
|
|
17
|
-
katex: any;
|
|
18
|
-
echarts: any;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
export interface ToolbarTips {
|
|
22
|
-
bold?: string;
|
|
23
|
-
underline?: string;
|
|
24
|
-
italic?: string;
|
|
25
|
-
strikeThrough?: string;
|
|
26
|
-
title?: string;
|
|
27
|
-
sub?: string;
|
|
28
|
-
sup?: string;
|
|
29
|
-
quote?: string;
|
|
30
|
-
unorderedList?: string;
|
|
31
|
-
orderedList?: string;
|
|
32
|
-
task?: string;
|
|
33
|
-
codeRow?: string;
|
|
34
|
-
code?: string;
|
|
35
|
-
link?: string;
|
|
36
|
-
image?: string;
|
|
37
|
-
table?: string;
|
|
38
|
-
mermaid?: string;
|
|
39
|
-
katex?: string;
|
|
40
|
-
revoke?: string;
|
|
41
|
-
next?: string;
|
|
42
|
-
save?: string;
|
|
43
|
-
prettier?: string;
|
|
44
|
-
pageFullscreen?: string;
|
|
45
|
-
fullscreen?: string;
|
|
46
|
-
preview?: string;
|
|
47
|
-
previewOnly?: string;
|
|
48
|
-
htmlPreview?: string;
|
|
49
|
-
catalog?: string;
|
|
50
|
-
github?: string;
|
|
51
|
-
'-'?: string;
|
|
52
|
-
'='?: string;
|
|
53
|
-
}
|
|
54
|
-
export interface StaticTextDefaultValue {
|
|
55
|
-
toolbarTips?: ToolbarTips;
|
|
56
|
-
titleItem?: {
|
|
57
|
-
h1?: string;
|
|
58
|
-
h2?: string;
|
|
59
|
-
h3?: string;
|
|
60
|
-
h4?: string;
|
|
61
|
-
h5?: string;
|
|
62
|
-
h6?: string;
|
|
63
|
-
};
|
|
64
|
-
imgTitleItem?: {
|
|
65
|
-
link: string;
|
|
66
|
-
upload: string;
|
|
67
|
-
clip2upload: string;
|
|
68
|
-
};
|
|
69
|
-
linkModalTips?: {
|
|
70
|
-
linkTitle?: string;
|
|
71
|
-
imageTitle?: string;
|
|
72
|
-
descLabel?: string;
|
|
73
|
-
descLabelPlaceHolder?: string;
|
|
74
|
-
urlLabel?: string;
|
|
75
|
-
urlLabelPlaceHolder?: string;
|
|
76
|
-
buttonOK?: string;
|
|
77
|
-
};
|
|
78
|
-
clipModalTips?: {
|
|
79
|
-
title?: string;
|
|
80
|
-
buttonUpload?: string;
|
|
81
|
-
};
|
|
82
|
-
copyCode?: {
|
|
83
|
-
text?: string;
|
|
84
|
-
successTips?: string;
|
|
85
|
-
failTips?: string;
|
|
86
|
-
};
|
|
87
|
-
mermaid?: {
|
|
88
|
-
flow?: string;
|
|
89
|
-
sequence?: string;
|
|
90
|
-
gantt?: string;
|
|
91
|
-
class?: string;
|
|
92
|
-
state?: string;
|
|
93
|
-
pie?: string;
|
|
94
|
-
relationship?: string;
|
|
95
|
-
journey?: string;
|
|
96
|
-
};
|
|
97
|
-
katex?: {
|
|
98
|
-
inline: string;
|
|
99
|
-
block: string;
|
|
100
|
-
};
|
|
101
|
-
footer?: {
|
|
102
|
-
markdownTotal: string;
|
|
103
|
-
scrollAuto: string;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export interface StaticTextDefault {
|
|
107
|
-
'zh-CN': StaticTextDefaultValue;
|
|
108
|
-
'en-US': StaticTextDefaultValue;
|
|
109
|
-
}
|
|
110
|
-
export type StaticTextDefaultKey = keyof StaticTextDefault;
|
|
111
|
-
export type ToolbarNames = keyof ToolbarTips | number;
|
|
112
|
-
export type Footers = '=' | 'markdownTotal' | 'scrollSwitch' | number;
|
|
113
|
-
export interface SettingType {
|
|
114
|
-
pageFullscreen: boolean;
|
|
115
|
-
fullscreen: boolean;
|
|
116
|
-
preview: boolean;
|
|
117
|
-
htmlPreview: boolean;
|
|
118
|
-
previewOnly: boolean;
|
|
119
|
-
}
|
|
120
|
-
export type Themes = 'light' | 'dark';
|
|
121
|
-
/**
|
|
122
|
-
* 预览主题
|
|
123
|
-
*
|
|
124
|
-
* @list ['default', 'github', 'vuepress', 'mk-cute', 'smart-blue', 'cyanosis']
|
|
125
|
-
*/
|
|
126
|
-
export type PreviewThemes = string;
|
|
127
|
-
export interface HeadList {
|
|
128
|
-
text: string;
|
|
129
|
-
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
130
|
-
active?: boolean;
|
|
131
|
-
line: number;
|
|
132
|
-
currentToken?: Token;
|
|
133
|
-
nextToken?: Token;
|
|
134
|
-
}
|
|
135
|
-
export type MdHeadingId = (options: {
|
|
136
|
-
text: string;
|
|
137
|
-
level: number;
|
|
138
|
-
index: number;
|
|
139
|
-
currentToken?: Token;
|
|
140
|
-
nextToken?: Token;
|
|
141
|
-
}) => string;
|
|
142
|
-
export interface MermaidTemplate {
|
|
143
|
-
/**
|
|
144
|
-
* 流程图
|
|
145
|
-
*/
|
|
146
|
-
flow?: string;
|
|
147
|
-
/**
|
|
148
|
-
* 时序图
|
|
149
|
-
*/
|
|
150
|
-
sequence?: string;
|
|
151
|
-
/**
|
|
152
|
-
* 甘特图
|
|
153
|
-
*/
|
|
154
|
-
gantt?: string;
|
|
155
|
-
/**
|
|
156
|
-
* 类图
|
|
157
|
-
*/
|
|
158
|
-
class?: string;
|
|
159
|
-
/**
|
|
160
|
-
* 状态图
|
|
161
|
-
*/
|
|
162
|
-
state?: string;
|
|
163
|
-
/**
|
|
164
|
-
* 饼图
|
|
165
|
-
*/
|
|
166
|
-
pie?: string;
|
|
167
|
-
/**
|
|
168
|
-
* 关系图
|
|
169
|
-
*/
|
|
170
|
-
relationship?: string;
|
|
171
|
-
/**
|
|
172
|
-
* 旅程图
|
|
173
|
-
*/
|
|
174
|
-
journey?: string;
|
|
175
|
-
}
|
|
176
|
-
export interface MarkdownItConfigPlugin {
|
|
177
|
-
type: string;
|
|
178
|
-
plugin: markdownit.PluginWithParams;
|
|
179
|
-
options: any;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* CodeMirror扩展类型
|
|
183
|
-
*
|
|
184
|
-
* ^6.0.0
|
|
185
|
-
*/
|
|
186
|
-
export interface CodeMirrorExtension {
|
|
187
|
-
/**
|
|
188
|
-
* 仅用来提供开发者分别不同扩展的依据
|
|
189
|
-
*/
|
|
190
|
-
type: string;
|
|
191
|
-
/**
|
|
192
|
-
* CodeMirror的扩展
|
|
193
|
-
*/
|
|
194
|
-
extension: Extension | ((options: any) => Extension);
|
|
195
|
-
/**
|
|
196
|
-
* 包裹扩展的Compartment,只有部分扩展有,提供扩展更新的能力
|
|
197
|
-
*/
|
|
198
|
-
compartment?: Compartment;
|
|
199
|
-
options?: any;
|
|
200
|
-
}
|
|
201
|
-
export interface GlobalConfig {
|
|
202
|
-
/**
|
|
203
|
-
* 编辑器内部依赖库
|
|
204
|
-
*/
|
|
205
|
-
editorExtensions: {
|
|
206
|
-
highlight?: {
|
|
207
|
-
instance?: any;
|
|
208
|
-
js?: string;
|
|
209
|
-
css?: CodeCss;
|
|
210
|
-
};
|
|
211
|
-
prettier?: {
|
|
212
|
-
prettierInstance?: any;
|
|
213
|
-
parserMarkdownInstance?: any;
|
|
214
|
-
standaloneJs?: string;
|
|
215
|
-
parserMarkdownJs?: string;
|
|
216
|
-
};
|
|
217
|
-
cropper?: {
|
|
218
|
-
instance?: any;
|
|
219
|
-
js?: string;
|
|
220
|
-
css?: string;
|
|
221
|
-
};
|
|
222
|
-
screenfull?: {
|
|
223
|
-
instance?: any;
|
|
224
|
-
js?: string;
|
|
225
|
-
};
|
|
226
|
-
mermaid?: {
|
|
227
|
-
instance?: any;
|
|
228
|
-
js?: string;
|
|
229
|
-
/**
|
|
230
|
-
* 是否启用缩放功能
|
|
231
|
-
*
|
|
232
|
-
* @default true
|
|
233
|
-
*/
|
|
234
|
-
enableZoom?: boolean;
|
|
235
|
-
};
|
|
236
|
-
katex?: {
|
|
237
|
-
instance?: any;
|
|
238
|
-
js?: string;
|
|
239
|
-
css?: string;
|
|
240
|
-
};
|
|
241
|
-
echarts?: {
|
|
242
|
-
instance?: any;
|
|
243
|
-
js?: string;
|
|
244
|
-
};
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* 对应editorExtensions中的cdn链接标签属性
|
|
248
|
-
*
|
|
249
|
-
* 不要尝试在editorExtensionsAttrs定义script的src\onload\id,link的rel\href\id
|
|
250
|
-
* 它们会被默认值覆盖
|
|
251
|
-
*/
|
|
252
|
-
editorExtensionsAttrs: {
|
|
253
|
-
highlight?: {
|
|
254
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
255
|
-
css?: CodeCssAttrs;
|
|
256
|
-
};
|
|
257
|
-
prettier?: {
|
|
258
|
-
standaloneJs?: Partial<HTMLElementTagNameMap['script']>;
|
|
259
|
-
parserMarkdownJs?: Partial<HTMLElementTagNameMap['script']>;
|
|
260
|
-
};
|
|
261
|
-
cropper?: {
|
|
262
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
263
|
-
css?: Partial<HTMLElementTagNameMap['link']>;
|
|
264
|
-
};
|
|
265
|
-
screenfull?: {
|
|
266
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
267
|
-
};
|
|
268
|
-
mermaid?: {
|
|
269
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
270
|
-
};
|
|
271
|
-
katex?: {
|
|
272
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
273
|
-
css?: Partial<HTMLElementTagNameMap['link']>;
|
|
274
|
-
};
|
|
275
|
-
echarts?: {
|
|
276
|
-
js?: Partial<HTMLElementTagNameMap['script']>;
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
editorConfig: {
|
|
280
|
-
/**
|
|
281
|
-
* 自定义提示语言
|
|
282
|
-
*/
|
|
283
|
-
languageUserDefined?: {
|
|
284
|
-
[key: string]: StaticTextDefaultValue;
|
|
285
|
-
};
|
|
286
|
-
/**
|
|
287
|
-
* 自定义内部mermaid模块
|
|
288
|
-
*/
|
|
289
|
-
mermaidTemplate?: MermaidTemplate;
|
|
290
|
-
/**
|
|
291
|
-
* 输入渲染延迟(ms)
|
|
292
|
-
*/
|
|
293
|
-
renderDelay?: number;
|
|
294
|
-
/**
|
|
295
|
-
* 内部的弹窗、下拉框等内联zIndex
|
|
296
|
-
* @default 20000
|
|
297
|
-
*/
|
|
298
|
-
zIndex?: number;
|
|
299
|
-
};
|
|
300
|
-
/**
|
|
301
|
-
* 根据主题和内部默认的codeMirror扩展自定义新的扩展
|
|
302
|
-
*
|
|
303
|
-
* @params theme 当前主题
|
|
304
|
-
* @params innerExtensions 当前主题下的扩展列表
|
|
305
|
-
* [keymap, minimalSetup, markdown, EditorView.lineWrapping, EditorView.updateListener, EditorView.domEventHandlers, oneDark??oneLight]
|
|
306
|
-
* [快捷键, 最低配置, markdown识别, 横向自动换行, 更新事件, dom监听事件, oneDark主题(暗夜模式下), oneLight(默认模式下)]
|
|
307
|
-
*
|
|
308
|
-
* @params keyBindings md-editor-v3内置的快捷键
|
|
309
|
-
*/
|
|
310
|
-
codeMirrorExtensions: (extensions: Array<CodeMirrorExtension>, options: {
|
|
311
|
-
editorId: string;
|
|
312
|
-
theme: Themes;
|
|
313
|
-
keyBindings: Array<KeyBinding>;
|
|
314
|
-
}) => Array<CodeMirrorExtension>;
|
|
315
|
-
/**
|
|
316
|
-
* 自定义markdown-it核心库扩展、属性等
|
|
317
|
-
*/
|
|
318
|
-
markdownItConfig: (md: markdownit, options: {
|
|
319
|
-
editorId: string;
|
|
320
|
-
}) => void;
|
|
321
|
-
/**
|
|
322
|
-
* 挑选编辑器已预设的markdownIt的扩展
|
|
323
|
-
*
|
|
324
|
-
* @param plugins markdownIt的扩展,带编辑器已设定的属性
|
|
325
|
-
* @returns plugins
|
|
326
|
-
*/
|
|
327
|
-
markdownItPlugins: (plugins: Array<MarkdownItConfigPlugin>, options: {
|
|
328
|
-
editorId: string;
|
|
329
|
-
}) => Array<MarkdownItConfigPlugin>;
|
|
330
|
-
/**
|
|
331
|
-
* mermaid配置项
|
|
332
|
-
*
|
|
333
|
-
* @param base
|
|
334
|
-
* @returns
|
|
335
|
-
*/
|
|
336
|
-
mermaidConfig: (base: any) => any;
|
|
337
|
-
/**
|
|
338
|
-
* katex配置
|
|
339
|
-
*
|
|
340
|
-
* @param baseConfig
|
|
341
|
-
* @returns
|
|
342
|
-
*/
|
|
343
|
-
katexConfig: (baseConfig: any) => any;
|
|
344
|
-
/**
|
|
345
|
-
* echarts配置
|
|
346
|
-
*
|
|
347
|
-
* @returns
|
|
348
|
-
*/
|
|
349
|
-
echartsConfig: (base: any) => any;
|
|
350
|
-
}
|
|
351
|
-
/**
|
|
352
|
-
* 扩展编辑器内部功能,包括marked和一些内部依赖实例,如highlight、cropper等
|
|
353
|
-
*/
|
|
354
|
-
export type Config = (options: Partial<GlobalConfig>) => void;
|
|
355
|
-
/**
|
|
356
|
-
* 编辑器操作潜在的错误
|
|
357
|
-
*/
|
|
358
|
-
export interface InnerError {
|
|
359
|
-
name: 'Cropper' | 'fullscreen' | 'prettier' | 'overlength' | 'mermaid';
|
|
360
|
-
message: string;
|
|
361
|
-
data?: any;
|
|
362
|
-
error?: Error;
|
|
363
|
-
}
|
|
364
|
-
export interface CodeCss {
|
|
365
|
-
[key: string]: {
|
|
366
|
-
light: string;
|
|
367
|
-
dark: string;
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
export interface CodeCssAttrs {
|
|
371
|
-
[key: string]: {
|
|
372
|
-
light: Partial<HTMLElementTagNameMap['link']>;
|
|
373
|
-
dark: Partial<HTMLElementTagNameMap['link']>;
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
export type UpdateSetting = (k: keyof SettingType, v?: boolean) => void;
|
|
377
|
-
export type ChangeEvent = (v: string) => void;
|
|
378
|
-
export type SaveEvent = (v: string, h: Promise<string>) => void;
|
|
379
|
-
export type UploadImgCallBackParam = string[] | Array<{
|
|
380
|
-
url: string;
|
|
381
|
-
alt: string;
|
|
382
|
-
title: string;
|
|
383
|
-
}>;
|
|
384
|
-
export type UploadImgCallBack = (urls: UploadImgCallBackParam) => void;
|
|
385
|
-
export type UploadImgEvent = (files: Array<File>, callBack: UploadImgCallBack) => void;
|
|
386
|
-
export type HtmlChangedEvent = (h: string) => void;
|
|
387
|
-
export type GetCatalogEvent = (list: HeadList[]) => void;
|
|
388
|
-
export type ErrorEvent = (err: InnerError) => void;
|
|
389
|
-
export interface ExposeEvent {
|
|
390
|
-
pageFullscreen(status: boolean): void;
|
|
391
|
-
fullscreen(status: boolean): void;
|
|
392
|
-
preview(status: boolean): void;
|
|
393
|
-
previewOnly(status: boolean): void;
|
|
394
|
-
htmlPreview(status: boolean): void;
|
|
395
|
-
catalog(status: boolean): void;
|
|
396
|
-
}
|
|
397
|
-
export type DOMEventHandlers = {
|
|
398
|
-
[e in keyof HTMLElementEventMap]?: (event: HTMLElementEventMap[e], view: EditorView) => boolean | void;
|
|
399
|
-
};
|
|
400
|
-
export interface InsertParam {
|
|
401
|
-
targetValue: string;
|
|
402
|
-
select?: boolean;
|
|
403
|
-
deviationStart?: number;
|
|
404
|
-
deviationEnd?: number;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* 插入的内容的构造函数
|
|
408
|
-
*/
|
|
409
|
-
export type InsertContentGenerator = (selectedText: string) => InsertParam;
|
|
410
|
-
/**
|
|
411
|
-
* 插入内容的通用函数类型
|
|
412
|
-
*/
|
|
413
|
-
export type Insert = (generate: InsertContentGenerator) => void;
|
|
414
|
-
export type FocusOption = 'start' | 'end' | {
|
|
415
|
-
rangeAnchor?: number;
|
|
416
|
-
rangeHead?: number;
|
|
417
|
-
cursorPos: number;
|
|
418
|
-
};
|
|
419
|
-
export interface ExposeParam {
|
|
420
|
-
/**
|
|
421
|
-
* 添加事件监听
|
|
422
|
-
*
|
|
423
|
-
* @param eventName 事件名称
|
|
424
|
-
* @param callBack 事件回调函数
|
|
425
|
-
*/
|
|
426
|
-
on<E extends keyof ExposeEvent, C extends ExposeEvent[E]>(eventName: E, callBack: C): void;
|
|
427
|
-
/**
|
|
428
|
-
* 切换页面内全屏
|
|
429
|
-
*
|
|
430
|
-
* @param status 是否页面全屏
|
|
431
|
-
*/
|
|
432
|
-
togglePageFullscreen(status?: boolean): void;
|
|
433
|
-
/**
|
|
434
|
-
* 切换屏幕全屏
|
|
435
|
-
*
|
|
436
|
-
* @param status 是否屏幕全屏
|
|
437
|
-
*/
|
|
438
|
-
toggleFullscreen(status?: boolean): void;
|
|
439
|
-
/**
|
|
440
|
-
* 切换是否显示预览
|
|
441
|
-
*
|
|
442
|
-
* @param status 是否显示预览
|
|
443
|
-
*/
|
|
444
|
-
togglePreview(status?: boolean): void;
|
|
445
|
-
togglePreviewOnly(status?: boolean): void;
|
|
446
|
-
/**
|
|
447
|
-
* 切换是否显示html预览
|
|
448
|
-
*
|
|
449
|
-
* @param status html预览状态
|
|
450
|
-
*/
|
|
451
|
-
toggleHtmlPreview(status?: boolean): void;
|
|
452
|
-
/**
|
|
453
|
-
* 切换是否显示目录
|
|
454
|
-
*
|
|
455
|
-
* @param status 是否显示目录,不设置默认相反
|
|
456
|
-
*/
|
|
457
|
-
toggleCatalog(status?: boolean): void;
|
|
458
|
-
/**
|
|
459
|
-
* 触发保存
|
|
460
|
-
*/
|
|
461
|
-
triggerSave(): void;
|
|
462
|
-
/**
|
|
463
|
-
* 手动向文本框插入内容
|
|
464
|
-
*
|
|
465
|
-
* @param {Function} generate 构造插入内容方法
|
|
466
|
-
* 构造方法提供「当前选中」的内容为入参
|
|
467
|
-
* 返回「待插入内容」和插入的属性
|
|
468
|
-
* 入参 selectedText 当前选中的内容
|
|
469
|
-
*
|
|
470
|
-
* targetValue 待插入内容
|
|
471
|
-
* select 插入后是否自动选中内容
|
|
472
|
-
* deviationStart 插入后选中位置的开始偏移量
|
|
473
|
-
* deviationEnd 插入后选中位置的结束偏移量
|
|
474
|
-
*
|
|
475
|
-
*/
|
|
476
|
-
insert: Insert;
|
|
477
|
-
/**
|
|
478
|
-
* 手动聚焦
|
|
479
|
-
*
|
|
480
|
-
* @param options 聚焦时光标的位置,不提供默认上次失焦时的位置
|
|
481
|
-
*/
|
|
482
|
-
focus(options?: FocusOption): void;
|
|
483
|
-
/**
|
|
484
|
-
* 手动重新渲染
|
|
485
|
-
*/
|
|
486
|
-
rerender(): void;
|
|
487
|
-
/**
|
|
488
|
-
* 获取当前选中的文本
|
|
489
|
-
*/
|
|
490
|
-
getSelectedText(): string | undefined;
|
|
491
|
-
/**
|
|
492
|
-
* 重置已经存在的历史记录
|
|
493
|
-
*/
|
|
494
|
-
resetHistory(): void;
|
|
495
|
-
/**
|
|
496
|
-
* codemirror事件
|
|
497
|
-
*
|
|
498
|
-
* @param handlers
|
|
499
|
-
*/
|
|
500
|
-
domEventHandlers(handlers: DOMEventHandlers): void;
|
|
501
|
-
/**
|
|
502
|
-
* 执行内部插入命令
|
|
503
|
-
*
|
|
504
|
-
* @param direct
|
|
505
|
-
*/
|
|
506
|
-
execCommand(direct: ToolDirective): void;
|
|
507
|
-
/**
|
|
508
|
-
* 获取编辑器实例
|
|
509
|
-
*/
|
|
510
|
-
getEditorView(): EditorView | undefined;
|
|
511
|
-
}
|
|
512
|
-
export type ExposePreviewParam = Pick<ExposeParam, 'rerender'>;
|
|
513
|
-
export type EditorProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof editorProps>>>>;
|
|
514
|
-
export type MdPreviewProps = Readonly<LooseRequired<Readonly<ExtractPropTypes<typeof mdPreviewProps>>>>;
|
|
515
|
-
export type EditorEmits = Array<'onChange' | 'onSave' | 'onUploadImg' | 'onHtmlChanged' | 'onGetCatalog' | 'onError' | 'update:modelValue' | 'onBlur' | 'onFocus' | 'onInput' | 'onDrop' | 'oninputBoxWidthChange' | 'onRemount'>;
|
|
516
|
-
export type EditorContext = SetupContext<EditorEmits>;
|
|
517
|
-
export type CustomStrIcon = {
|
|
518
|
-
copy?: string;
|
|
519
|
-
'collapse-tips'?: string;
|
|
520
|
-
pin?: string;
|
|
521
|
-
'pin-off'?: string;
|
|
522
|
-
check?: string;
|
|
523
|
-
};
|
|
524
|
-
/**
|
|
525
|
-
* 自定义图标的数据类型
|
|
526
|
-
*/
|
|
527
|
-
export type CustomIcon = {
|
|
528
|
-
[key in IconName]?: {
|
|
529
|
-
component: Component | VNode | string;
|
|
530
|
-
props?: {
|
|
531
|
-
[key: string | number | symbol]: any;
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
} & CustomStrIcon;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import CodeMirrorUt from '../layouts/Content/codemirror';
|
|
2
|
-
export type ToolDirective = 'bold' | 'underline' | 'italic' | 'strikeThrough' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'quote' | 'unorderedList' | 'orderedList' | 'task' | 'codeRow' | 'code' | 'link' | 'image' | 'table' | 'sub' | 'sup' | 'prettier' | 'flow' | 'sequence' | 'gantt' | 'class' | 'state' | 'pie' | 'relationship' | 'journey' | 'katexInline' | 'katexBlock' | 'universal';
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
* @param direct 操作指令
|
|
6
|
-
* @param codeMirrorUt 编辑区辅助实例
|
|
7
|
-
* @param params 自定义参数
|
|
8
|
-
*
|
|
9
|
-
* @returns string
|
|
10
|
-
*/
|
|
11
|
-
export declare const directive2flag: (direct: ToolDirective, codeMirrorUt: CodeMirrorUt, params?: any) => Promise<{
|
|
12
|
-
text: string;
|
|
13
|
-
options: {
|
|
14
|
-
deviationStart: number;
|
|
15
|
-
replaceStart: number;
|
|
16
|
-
replaceEnd: number;
|
|
17
|
-
};
|
|
18
|
-
} | {
|
|
19
|
-
text: any;
|
|
20
|
-
options: {
|
|
21
|
-
select: boolean;
|
|
22
|
-
replaceAll: boolean;
|
|
23
|
-
};
|
|
24
|
-
} | {
|
|
25
|
-
text: string;
|
|
26
|
-
options: {
|
|
27
|
-
deviationStart: number;
|
|
28
|
-
deviationEnd: number;
|
|
29
|
-
};
|
|
30
|
-
} | {
|
|
31
|
-
text: string;
|
|
32
|
-
options: {
|
|
33
|
-
select: boolean;
|
|
34
|
-
deviationStart: number;
|
|
35
|
-
deviationEnd: number;
|
|
36
|
-
};
|
|
37
|
-
} | {
|
|
38
|
-
text: string;
|
|
39
|
-
options: {
|
|
40
|
-
select?: undefined;
|
|
41
|
-
deviationStart?: undefined;
|
|
42
|
-
deviationEnd?: undefined;
|
|
43
|
-
};
|
|
44
|
-
}>;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CustomIcon } from '../type';
|
|
2
|
-
/**
|
|
3
|
-
* 设置页面元素可移动
|
|
4
|
-
*
|
|
5
|
-
* @param trigger 触发器,通过该元素移动父级元素
|
|
6
|
-
* @param moveHandler
|
|
7
|
-
*/
|
|
8
|
-
export declare const keyMove: (trigger: HTMLElement, moveHandler?: (left: number, top: number) => void) => (() => void);
|
|
9
|
-
/**
|
|
10
|
-
* 向页面插入外链标签
|
|
11
|
-
*
|
|
12
|
-
* @param ele
|
|
13
|
-
* @param checkKey 全局名称
|
|
14
|
-
*/
|
|
15
|
-
export declare const appendHandler: <K extends keyof HTMLElementTagNameMap>(tagName: K, attributes: Partial<HTMLElementTagNameMap[K]>, checkKey?: string) => void;
|
|
16
|
-
/**
|
|
17
|
-
* 更新插入的元素属性
|
|
18
|
-
*
|
|
19
|
-
* @param id id选择器
|
|
20
|
-
* @param attr 属性名
|
|
21
|
-
* @param value 属性值
|
|
22
|
-
*/
|
|
23
|
-
export declare const updateHandler: <K extends keyof HTMLElementTagNameMap>(tagName: K, attributes: Partial<HTMLElementTagNameMap[K]>) => void;
|
|
24
|
-
/**
|
|
25
|
-
* 创建带属性的原始标签
|
|
26
|
-
*
|
|
27
|
-
* @param tagName
|
|
28
|
-
* @param attributes
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
export declare const createHTMLElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, attributes: Partial<HTMLElementTagNameMap[K]>) => HTMLElementTagNameMap[K];
|
|
32
|
-
/**
|
|
33
|
-
* mermaid复制代码事件绑定
|
|
34
|
-
*/
|
|
35
|
-
export declare const copyMermaid: (containers: NodeListOf<HTMLElement> | undefined, options: {
|
|
36
|
-
customIcon: CustomIcon;
|
|
37
|
-
}) => () => void;
|
|
38
|
-
/**
|
|
39
|
-
* 缩放、拖拽mermaid模块
|
|
40
|
-
*/
|
|
41
|
-
export declare const zoomMermaid: (containers: NodeListOf<HTMLElement>, options: {
|
|
42
|
-
customIcon: CustomIcon;
|
|
43
|
-
}) => () => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface BusEvent {
|
|
2
|
-
name: string;
|
|
3
|
-
callback: (p?: any, p2?: any) => any;
|
|
4
|
-
}
|
|
5
|
-
declare class Bus {
|
|
6
|
-
pools: {
|
|
7
|
-
[race: string]: {
|
|
8
|
-
[eventName: string]: Array<(p?: any) => any>;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
remove(race: string, name: string, func: (p?: any) => any): void;
|
|
12
|
-
clear(race: string): void;
|
|
13
|
-
on(race: string, event: BusEvent): boolean;
|
|
14
|
-
emit(race: string, name: string, ...params: unknown[]): void;
|
|
15
|
-
}
|
|
16
|
-
declare const _default: Bus;
|
|
17
|
-
export default _default;
|