md-editor-v3 1.4.2 → 1.6.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/README.md +120 -99
- package/lib/MdEditor/Editor.d.ts +62 -11
- package/lib/MdEditor/capi.d.ts +1 -0
- package/lib/MdEditor/components/Divider/index.d.ts +1 -1
- package/lib/MdEditor/components/Dropdown/index.d.ts +1 -8
- package/lib/MdEditor/components/Modal/index.d.ts +31 -10
- package/lib/MdEditor/config.d.ts +4 -1
- package/lib/MdEditor/layouts/Content/index.d.ts +10 -2
- package/lib/MdEditor/layouts/Modals/Clip.d.ts +1 -8
- package/lib/MdEditor/layouts/Modals/Link.d.ts +1 -8
- package/lib/MdEditor/layouts/Modals/index.d.ts +12 -12
- package/lib/MdEditor/layouts/Toolbar/composition.d.ts +4 -0
- package/lib/MdEditor/layouts/Toolbar/index.d.ts +15 -1
- package/lib/MdEditor/utils/index.d.ts +7 -0
- package/lib/md-editor-v3.es.js +4889 -7
- package/lib/md-editor-v3.umd.js +62 -7
- package/lib/style.css +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,66 +1,71 @@
|
|
|
1
1
|
# md-editor-v3
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
    
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
English \| [中文](https://github.com/imzbf/md-editor-v3/blob/master/README-CN.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Markdown editor for vue3, developed by `jsx` and `typescript`.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
- Documentation and demo:[Go](https://imzbf.github.io/md-editor-v3)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
2. 内置的白色主题和暗黑主题,支持绑定切换;
|
|
13
|
-
3. 支持快捷键插入内容;
|
|
14
|
-
4. 支持使用 prettier 格式化内容(使用 CDN 方式引入,只支持格式化 md 内容,可在代码内设置关闭);
|
|
15
|
-
5. 支持多语言,支持自行扩展语言;
|
|
16
|
-
6. 支持复制粘贴上传图片,图片裁剪上传;
|
|
17
|
-
7. 支持渲染模式(不显示编辑器,只显示 md 预览内容,无额外监听)
|
|
18
|
-
8. ...
|
|
11
|
+
- Use it online:[Go](https://stackblitz.com/edit/vue-aleajl)
|
|
19
12
|
|
|
20
|
-
|
|
13
|
+
- The same series editor for react:[md-editor-rt](https://github.com/imzbf/md-editor-rt)
|
|
21
14
|
|
|
22
|
-
##
|
|
15
|
+
## Features
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
- Toolbar, screenfull or screenfull in web pages and so on.
|
|
18
|
+
- Themes, Built-in default and dark themes.
|
|
19
|
+
- Shortcut key for editor.
|
|
20
|
+
- Beautify your content by `prettier`(only for markdown content, not the code and other text).
|
|
21
|
+
- Multi-language, build-in Chinese and English(default: Chinese).
|
|
22
|
+
- Upload picture, paste or clip the picture and upload it.
|
|
23
|
+
- Render article directly(no editor,no event listener, only preview content).
|
|
24
|
+
- Preview themes, support `defalut`、`vuepress`、`github` styles(not identical).
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
> More features are developing, if you have some ideas or find issues, please tell it to me~
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
## Preview
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
| Default theme | Dark theme | Preview only |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
|  |  |  |
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## Apis
|
|
33
35
|
|
|
34
|
-
###
|
|
36
|
+
### Props
|
|
35
37
|
|
|
36
|
-
|
|
|
38
|
+
| name | type | default | responsive | description |
|
|
37
39
|
| --- | --- | --- | --- | --- |
|
|
38
|
-
| modelValue | String | '' | √ |
|
|
39
|
-
| theme | 'light' \| 'dark' | 'light' | √ |
|
|
40
|
-
| editorClass | String | '' | √ |
|
|
41
|
-
| hljs | Object | null | x |
|
|
42
|
-
| highlightJs | String | [highlight.js](https://cdn.
|
|
43
|
-
| highlightCss | String | [atom-one-dark](https://cdn.
|
|
44
|
-
| historyLength | Number | 10 | x |
|
|
45
|
-
| pageFullScreen | Boolean | false | x |
|
|
46
|
-
| preview | Boolean | true | x |
|
|
47
|
-
| htmlPreview | Boolean | false | x | html
|
|
48
|
-
| previewOnly<sup>v1.3.0</sup> | Boolean | false | x |
|
|
49
|
-
| language | String | 'zh-CN' | √ |
|
|
50
|
-
| languageUserDefined |
|
|
51
|
-
| toolbars | Array | [
|
|
52
|
-
| toolbarsExclude<sup>v1.1.4</sup> | Array | [] | √ |
|
|
53
|
-
| prettier | Boolean | true | x |
|
|
54
|
-
| prettierCDN | String | [standalone](https://
|
|
55
|
-
| prettierMDCDN | String | [parser-markdown](https://
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
63
|
-
>
|
|
40
|
+
| modelValue | String | '' | √ | Markdown content,use `v-model` in vue template |
|
|
41
|
+
| theme | 'light' \| 'dark' | 'light' | √ | Change editor theme |
|
|
42
|
+
| editorClass | String | '' | √ | |
|
|
43
|
+
| hljs | Object | null | x | `Highlight` instance, editor will not insert script of it, but you need to import `highlight` code style by yourself |
|
|
44
|
+
| highlightJs | String | [highlight.js@11.2.0](https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.2.0/build/highlight.min.js) | x | HighlightJs url |
|
|
45
|
+
| highlightCss | String | [atom-one-dark@11.2.0](https://cdn.jsdelivr.net/npm/highlight.js@11.2.0/styles/atom-one-dark.css) | x | `Highlight` code style |
|
|
46
|
+
| historyLength | Number | 10 | x | The max length of history(if it is too big, editor will use more `RAM`) |
|
|
47
|
+
| pageFullScreen | Boolean | false | x | Screenfull in web page |
|
|
48
|
+
| preview | Boolean | true | x | Preview content in editor |
|
|
49
|
+
| htmlPreview | Boolean | false | x | Preview html in editor |
|
|
50
|
+
| previewOnly<sup>v1.3.0</sup> | Boolean | false | x | Only render article content, no toolbar, no edit area |
|
|
51
|
+
| language | String | 'zh-CN' | √ | Build-in language('zh-CN','en-US') |
|
|
52
|
+
| languageUserDefined<sup>v1.5.0 changed</sup> | Object | {key: StaticTextDefaultValue} | √ | Expand language,update `language` api to your key |
|
|
53
|
+
| toolbars | Array | [toolbars] | √ | Show some item of toolbars,all keys<sup>see `toolbars` below<sup> |
|
|
54
|
+
| toolbarsExclude<sup>v1.1.4</sup> | Array | [] | √ | Don't show some item of toolbars,all keys`toolbars` |
|
|
55
|
+
| prettier | Boolean | true | x | Use prettier to beautify content or not |
|
|
56
|
+
| prettierCDN | String | [standalone@2.4.0](https://cdn.jsdelivr.net/npm/prettier@2.4.0/standalone.js) | x | |
|
|
57
|
+
| prettierMDCDN | String | [parser-markdown@2.4.0](https://cdn.jsdelivr.net/npm/prettier@2.4.0/parser-markdown.js) | x | |
|
|
58
|
+
| cropperCss<sup>v1.2.0</sup> | String | [cropper.min.css@1.5.12](https://cdn.jsdelivr.net/npm/cropperjs@1.5.12/dist/cropper.min.css) | x | Cropper css url |
|
|
59
|
+
| cropperJs<sup>v1.2.0</sup> | String | [cropper.min.js@1.5.12](https://cdn.jsdelivr.net/npm/cropperjs@1.5.12/dist/cropper.min.js) | x | Cropper js url |
|
|
60
|
+
| iconfontJs<sup>v1.3.2</sup> | String | [iconfont](https://at.alicdn.com/t/font_2605852_khjf435c7th.js) | x | Icon url |
|
|
61
|
+
| editorId<sup>v1.4.0</sup> | String | random | x | Editor id, also the html id, it is used when there are two or more editor and server render in the future |
|
|
62
|
+
| tabWidth<sup>v1.4.0<sup> | Number | 2 | x | One tab eq some space |
|
|
63
|
+
| showCodeRowNumber<sup>v1.4.3</sup> | Boolean | false | x | Show row number for code block or not |
|
|
64
|
+
| screenfull<sup>v1.4.3</sup> | Object | null | x | Screenfull instance, editor will not insert script of it |
|
|
65
|
+
| screenfullJs<sup><v1.4.3</sup> | String | [screenfull@5.1.0](https://cdn.jsdelivr.net/npm/screenfull@5.1.0/dist/screenfull.js) | x | Screenfull js url |
|
|
66
|
+
| previewTheme<sup>v1.4.3</sup> | 'default' \| 'github' \| 'vuepress' | 'default' | √ | Preview themes |
|
|
67
|
+
|
|
68
|
+
> If responsive is `x`, you can set it's default value once.
|
|
64
69
|
|
|
65
70
|
[toolbars]
|
|
66
71
|
|
|
@@ -69,6 +74,7 @@ vue3 项目下的 Markdown 编辑器,,使用 jsx 语法开发,支持在 ts
|
|
|
69
74
|
'bold',
|
|
70
75
|
'underline',
|
|
71
76
|
'italic',
|
|
77
|
+
'-',
|
|
72
78
|
'strikeThrough',
|
|
73
79
|
'title',
|
|
74
80
|
'sub',
|
|
@@ -76,14 +82,17 @@ vue3 项目下的 Markdown 编辑器,,使用 jsx 语法开发,支持在 ts
|
|
|
76
82
|
'quote',
|
|
77
83
|
'unorderedList',
|
|
78
84
|
'orderedList',
|
|
85
|
+
'-',
|
|
79
86
|
'codeRow',
|
|
80
87
|
'code',
|
|
81
88
|
'link',
|
|
82
89
|
'image',
|
|
83
90
|
'table',
|
|
91
|
+
'-',
|
|
84
92
|
'revoke',
|
|
85
93
|
'next',
|
|
86
94
|
'save',
|
|
95
|
+
'=',
|
|
87
96
|
'pageFullscreen',
|
|
88
97
|
'fullscreen',
|
|
89
98
|
'preview',
|
|
@@ -92,15 +101,17 @@ vue3 项目下的 Markdown 编辑器,,使用 jsx 语法开发,支持在 ts
|
|
|
92
101
|
];
|
|
93
102
|
```
|
|
94
103
|
|
|
95
|
-
|
|
104
|
+
> after v1.6.0, You can sort the toolbar as you like, split tools by `'-'`, the left and right toolbars are divided by `'='`!
|
|
105
|
+
|
|
106
|
+
Expand language,you need to replace all the content here:
|
|
96
107
|
|
|
97
108
|
[StaticTextDefaultValue]
|
|
98
109
|
|
|
99
110
|
```ts
|
|
100
111
|
export interface StaticTextDefaultValue {
|
|
101
|
-
//
|
|
112
|
+
// Toolbar hover tips(html title)
|
|
102
113
|
toolbarTips?: ToolbarTips;
|
|
103
|
-
//
|
|
114
|
+
// h1-h6 dropdown menu item
|
|
104
115
|
titleItem?: {
|
|
105
116
|
h1?: string;
|
|
106
117
|
h2?: string;
|
|
@@ -109,7 +120,13 @@ export interface StaticTextDefaultValue {
|
|
|
109
120
|
h5?: string;
|
|
110
121
|
h6?: string;
|
|
111
122
|
};
|
|
112
|
-
//
|
|
123
|
+
// v1.6.0
|
|
124
|
+
imgTitleItem?: {
|
|
125
|
+
link: string;
|
|
126
|
+
upload: string;
|
|
127
|
+
clip2upload: string;
|
|
128
|
+
};
|
|
129
|
+
// The modal tips of add link or upload picture
|
|
113
130
|
linkModalTips?: {
|
|
114
131
|
title?: string;
|
|
115
132
|
descLable?: string;
|
|
@@ -117,14 +134,13 @@ export interface StaticTextDefaultValue {
|
|
|
117
134
|
urlLable?: string;
|
|
118
135
|
UrlLablePlaceHolder?: string;
|
|
119
136
|
buttonOK?: string;
|
|
120
|
-
buttonUpload?: string;
|
|
121
137
|
};
|
|
122
|
-
//
|
|
138
|
+
// The modal tips of clip the picture,v1.2.0
|
|
123
139
|
clipModalTips?: {
|
|
124
140
|
title?: string;
|
|
125
141
|
buttonUpload?: string;
|
|
126
142
|
};
|
|
127
|
-
//
|
|
143
|
+
// Copy code tips,v1.1.4
|
|
128
144
|
copyCode?: {
|
|
129
145
|
text?: string;
|
|
130
146
|
tips?: string;
|
|
@@ -132,50 +148,49 @@ export interface StaticTextDefaultValue {
|
|
|
132
148
|
}
|
|
133
149
|
```
|
|
134
150
|
|
|
135
|
-
###
|
|
151
|
+
### Event
|
|
136
152
|
|
|
137
|
-
|
|
|
153
|
+
| name | params | description |
|
|
138
154
|
| --- | --- | --- |
|
|
139
|
-
| onChange | v:String |
|
|
140
|
-
| onSave | v:String |
|
|
141
|
-
| onUploadImg | files:FileList, callback:Function |
|
|
142
|
-
| onHtmlChanged | h:String |
|
|
143
|
-
| onGetCatalog<sup>v1.4.0</sup> | list: HeadList[] |
|
|
144
|
-
|
|
145
|
-
### 快捷键
|
|
155
|
+
| onChange | v:String | Content changed event(bind to `oninput` of `textarea`) |
|
|
156
|
+
| onSave | v:String | Save Content event,`ctrl+s`and click button will trigger |
|
|
157
|
+
| onUploadImg | files:FileList, callback:Function | Upload picture event,when picture is uploading the modal will not close,please provide right urls to the callback function |
|
|
158
|
+
| onHtmlChanged | h:String | Compile markdown successful event,you can use it to get the html code |
|
|
159
|
+
| onGetCatalog<sup>v1.4.0</sup> | list: HeadList[] | Get catalogue of article |
|
|
160
|
+
| markedHeading<sup>[v1.6.0](https://github.com/imzbf/md-editor-v3/releases/tag/v1.6.0)</sup> | text: string,level: 1-6,raw: string, slugger: Slugger | `marked` head renderer methods |
|
|
146
161
|
|
|
147
|
-
|
|
162
|
+
### Shortcut key
|
|
148
163
|
|
|
149
|
-
|
|
|
164
|
+
| key | function | description | support |
|
|
150
165
|
| --- | --- | --- | --- |
|
|
151
|
-
| TAB |
|
|
152
|
-
| SHIFT + TAB |
|
|
153
|
-
| CTRL + C |
|
|
154
|
-
| CTRL + X |
|
|
155
|
-
| CTRL + D |
|
|
156
|
-
| CTRL + S |
|
|
157
|
-
| CTRL + B |
|
|
158
|
-
| CTRL + U |
|
|
159
|
-
| CTRL + I |
|
|
160
|
-
| CTRL + 1-6 |
|
|
161
|
-
| CTRL + ↑ |
|
|
162
|
-
| CTRL + ↓ |
|
|
163
|
-
| CTRL + Q |
|
|
164
|
-
| CTRL + O |
|
|
165
|
-
| CTRL + L |
|
|
166
|
-
| CTRL + Z |
|
|
167
|
-
| CTRL + SHIFT + S |
|
|
168
|
-
| CTRL + SHIFT + U |
|
|
169
|
-
| CTRL + SHIFT + C |
|
|
170
|
-
| CTRL + SHIFT + I |
|
|
171
|
-
| CTRL + SHIFT + Z |
|
|
172
|
-
| CTRL + SHIFT + F |
|
|
173
|
-
| CTRL + ALT + C |
|
|
174
|
-
| CTRL + SHIFT + ALT + T |
|
|
175
|
-
|
|
176
|
-
##
|
|
177
|
-
|
|
178
|
-
###
|
|
166
|
+
| TAB | insert space | Insert space, the length eq `tabWidth`, default: 2, support multiline | v1.4.0 |
|
|
167
|
+
| SHIFT + TAB | delete space, setting is the same as Tab | | v1.4.0 |
|
|
168
|
+
| CTRL + C | copy | When selected, copy the selected content. When not selected, copy the content of the current line | v1.4.0 |
|
|
169
|
+
| CTRL + X | shear | When selected, cut the selected content. When not selected, cut the current line | v1.4.0 |
|
|
170
|
+
| CTRL + D | delete | When selected, delete the selected content. When not selected, delete the current line | v1.4.0 |
|
|
171
|
+
| CTRL + S | save | Trigger `onSave` event | v1.0.0 |
|
|
172
|
+
| CTRL + B | bold text | `**bold**` | v1.0.0 |
|
|
173
|
+
| CTRL + U | underline | `<u>underline</u>` | v1.0.0 |
|
|
174
|
+
| CTRL + I | italic | `*italic*` | v1.0.0 |
|
|
175
|
+
| CTRL + 1-6 | h1-h6 | `# title` | v1.0.0 |
|
|
176
|
+
| CTRL + ↑ | superscript | `<sup>superscript</sup>` | v1.0.0 |
|
|
177
|
+
| CTRL + ↓ | subscript | `<sub>subscript</sub>` | v1.0.0 |
|
|
178
|
+
| CTRL + Q | quote | `> quote` | v1.0.0 |
|
|
179
|
+
| CTRL + O | ordered list | `1. ordered list` | v1.0.0 |
|
|
180
|
+
| CTRL + L | link | `[link](https://github.com/imzbf/md-editor-v3)` | v1.0.0 |
|
|
181
|
+
| CTRL + Z | withdraw | Withdraw history in editor, not the function of system | v1.0.0 |
|
|
182
|
+
| CTRL + SHIFT + S | line-through | `~line-through~` | v1.0.0 |
|
|
183
|
+
| CTRL + SHIFT + U | unordered list | `- unordered list` | v1.0.0 |
|
|
184
|
+
| CTRL + SHIFT + C | code block | | v1.0.0 |
|
|
185
|
+
| CTRL + SHIFT + I | picture | `` | v1.0.0 |
|
|
186
|
+
| CTRL + SHIFT + Z | forward | Forward history in editor, not the function of system | v1.0.0 |
|
|
187
|
+
| CTRL + SHIFT + F | Beautify | | v1.0.0 |
|
|
188
|
+
| CTRL + ALT + C | code row | | v1.0.0 |
|
|
189
|
+
| CTRL + SHIFT + ALT + T | table | `\|table\|` | v1.4.0 |
|
|
190
|
+
|
|
191
|
+
## Simple demo
|
|
192
|
+
|
|
193
|
+
### Jsx module
|
|
179
194
|
|
|
180
195
|
```js
|
|
181
196
|
import { defineComponent, reactive } from 'vue';
|
|
@@ -196,7 +211,7 @@ export default defineComponent({
|
|
|
196
211
|
});
|
|
197
212
|
```
|
|
198
213
|
|
|
199
|
-
###
|
|
214
|
+
### Vue template
|
|
200
215
|
|
|
201
216
|
```js
|
|
202
217
|
<template>
|
|
@@ -213,7 +228,7 @@ export default defineComponent({
|
|
|
213
228
|
components: { Editor },
|
|
214
229
|
data() {
|
|
215
230
|
return {
|
|
216
|
-
text: '
|
|
231
|
+
text: '# md-editor-v3'
|
|
217
232
|
};
|
|
218
233
|
}
|
|
219
234
|
});
|
|
@@ -221,11 +236,9 @@ export default defineComponent({
|
|
|
221
236
|
|
|
222
237
|
```
|
|
223
238
|
|
|
224
|
-
###
|
|
239
|
+
### Upload picture
|
|
225
240
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
> 注意:粘贴板上传时,如果是网页上的 gif 图,无法正确上传为 gif 格式!
|
|
241
|
+
> Tips:When you paste and upload GIF,it will upload a static picture. So you should upload it by file system!
|
|
229
242
|
|
|
230
243
|
```js
|
|
231
244
|
async onUploadImg(files: FileList, callback: (urls: string[]) => void) {
|
|
@@ -250,3 +263,11 @@ async onUploadImg(files: FileList, callback: (urls: string[]) => void) {
|
|
|
250
263
|
callback(res.map((item: any) => item.data.url));
|
|
251
264
|
}
|
|
252
265
|
```
|
|
266
|
+
|
|
267
|
+
## Support
|
|
268
|
+
|
|
269
|
+
> Refund can be made through the contact information above(Please do not operate maliciously).
|
|
270
|
+
|
|
271
|
+
| Alipay | WeChat |
|
|
272
|
+
| --- | --- |
|
|
273
|
+
|  |  |
|
package/lib/MdEditor/Editor.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { PropType } from 'vue';
|
|
2
|
+
import { Slugger } from 'marked';
|
|
2
3
|
declare global {
|
|
3
4
|
interface Window {
|
|
4
5
|
hljs: any;
|
|
5
6
|
prettier: any;
|
|
6
7
|
prettierPlugins: any;
|
|
7
8
|
Cropper: any;
|
|
9
|
+
screenfull: any;
|
|
8
10
|
}
|
|
9
11
|
}
|
|
10
12
|
export interface ToolbarTips {
|
|
@@ -32,6 +34,8 @@ export interface ToolbarTips {
|
|
|
32
34
|
preview?: string;
|
|
33
35
|
htmlPreview?: string;
|
|
34
36
|
github?: string;
|
|
37
|
+
'-'?: string;
|
|
38
|
+
'='?: string;
|
|
35
39
|
}
|
|
36
40
|
export interface StaticTextDefaultValue {
|
|
37
41
|
toolbarTips?: ToolbarTips;
|
|
@@ -43,6 +47,11 @@ export interface StaticTextDefaultValue {
|
|
|
43
47
|
h5?: string;
|
|
44
48
|
h6?: string;
|
|
45
49
|
};
|
|
50
|
+
imgTitleItem?: {
|
|
51
|
+
link: string;
|
|
52
|
+
upload: string;
|
|
53
|
+
clip2upload: string;
|
|
54
|
+
};
|
|
46
55
|
linkModalTips?: {
|
|
47
56
|
title?: string;
|
|
48
57
|
descLable?: string;
|
|
@@ -50,8 +59,6 @@ export interface StaticTextDefaultValue {
|
|
|
50
59
|
urlLable?: string;
|
|
51
60
|
UrlLablePlaceHolder?: string;
|
|
52
61
|
buttonOK?: string;
|
|
53
|
-
buttonUpload?: string;
|
|
54
|
-
buttonUploadClip?: string;
|
|
55
62
|
};
|
|
56
63
|
clipModalTips?: {
|
|
57
64
|
title?: string;
|
|
@@ -79,6 +86,8 @@ export interface HeadList {
|
|
|
79
86
|
text: string;
|
|
80
87
|
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
81
88
|
}
|
|
89
|
+
export declare type PreviewThemes = 'default' | 'github' | 'vuepress';
|
|
90
|
+
export declare type MarkedHeading = (text: string, level: 1 | 2 | 3 | 4 | 5 | 6, raw: string, slugger: Slugger) => string;
|
|
82
91
|
declare const _default: import("vue").DefineComponent<{
|
|
83
92
|
modelValue: {
|
|
84
93
|
type: PropType<string>;
|
|
@@ -140,8 +149,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
140
149
|
languageUserDefined: {
|
|
141
150
|
type: PropType<{
|
|
142
151
|
[key: string]: StaticTextDefaultValue;
|
|
143
|
-
}
|
|
144
|
-
default: () =>
|
|
152
|
+
}>;
|
|
153
|
+
default: () => {};
|
|
145
154
|
};
|
|
146
155
|
toolbars: {
|
|
147
156
|
type: PropType<(keyof ToolbarTips)[]>;
|
|
@@ -166,6 +175,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
166
175
|
onHtmlChanged: {
|
|
167
176
|
type: PropType<(h: string) => void>;
|
|
168
177
|
};
|
|
178
|
+
Cropper: {
|
|
179
|
+
type: FunctionConstructor;
|
|
180
|
+
default: null;
|
|
181
|
+
};
|
|
169
182
|
cropperCss: {
|
|
170
183
|
type: PropType<string>;
|
|
171
184
|
default: string;
|
|
@@ -189,6 +202,26 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
189
202
|
type: PropType<number>;
|
|
190
203
|
default: number;
|
|
191
204
|
};
|
|
205
|
+
showCodeRowNumber: {
|
|
206
|
+
type: PropType<boolean>;
|
|
207
|
+
default: boolean;
|
|
208
|
+
};
|
|
209
|
+
screenfull: {
|
|
210
|
+
type: ObjectConstructor;
|
|
211
|
+
default: null;
|
|
212
|
+
};
|
|
213
|
+
screenfullJs: {
|
|
214
|
+
type: PropType<string>;
|
|
215
|
+
default: string;
|
|
216
|
+
};
|
|
217
|
+
previewTheme: {
|
|
218
|
+
type: PropType<PreviewThemes>;
|
|
219
|
+
default: string;
|
|
220
|
+
};
|
|
221
|
+
markedHeading: {
|
|
222
|
+
type: PropType<MarkedHeading>;
|
|
223
|
+
default: (text: string, level: string) => string;
|
|
224
|
+
};
|
|
192
225
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
193
226
|
modelValue?: unknown;
|
|
194
227
|
theme?: unknown;
|
|
@@ -212,24 +245,36 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
212
245
|
prettierCDN?: unknown;
|
|
213
246
|
prettierMDCDN?: unknown;
|
|
214
247
|
onHtmlChanged?: unknown;
|
|
248
|
+
Cropper?: unknown;
|
|
215
249
|
cropperCss?: unknown;
|
|
216
250
|
cropperJs?: unknown;
|
|
217
251
|
iconfontJs?: unknown;
|
|
218
252
|
onGetCatalog?: unknown;
|
|
219
253
|
editorId?: unknown;
|
|
220
254
|
tabWidth?: unknown;
|
|
255
|
+
showCodeRowNumber?: unknown;
|
|
256
|
+
screenfull?: unknown;
|
|
257
|
+
screenfullJs?: unknown;
|
|
258
|
+
previewTheme?: unknown;
|
|
259
|
+
markedHeading?: unknown;
|
|
221
260
|
} & {
|
|
222
261
|
prettier: boolean;
|
|
223
262
|
preview: boolean;
|
|
224
263
|
htmlPreview: boolean;
|
|
225
264
|
tabWidth: number;
|
|
226
265
|
editorId: string;
|
|
266
|
+
previewOnly: boolean;
|
|
267
|
+
showCodeRowNumber: boolean;
|
|
268
|
+
Cropper: Function;
|
|
269
|
+
historyLength: number;
|
|
270
|
+
previewTheme: PreviewThemes;
|
|
271
|
+
screenfull: Record<string, any>;
|
|
227
272
|
pageFullScreen: boolean;
|
|
228
273
|
toolbars: (keyof ToolbarTips)[];
|
|
229
274
|
toolbarsExclude: (keyof ToolbarTips)[];
|
|
230
|
-
|
|
275
|
+
screenfullJs: string;
|
|
231
276
|
hljs: Record<string, any>;
|
|
232
|
-
|
|
277
|
+
markedHeading: MarkedHeading;
|
|
233
278
|
modelValue: string;
|
|
234
279
|
theme: "dark" | "light";
|
|
235
280
|
editorClass: string;
|
|
@@ -238,7 +283,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
238
283
|
language: string;
|
|
239
284
|
languageUserDefined: {
|
|
240
285
|
[key: string]: StaticTextDefaultValue;
|
|
241
|
-
}
|
|
286
|
+
};
|
|
242
287
|
prettierCDN: string;
|
|
243
288
|
prettierMDCDN: string;
|
|
244
289
|
cropperCss: string;
|
|
@@ -250,18 +295,24 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
250
295
|
onHtmlChanged?: ((h: string) => void) | undefined;
|
|
251
296
|
onGetCatalog?: ((list: HeadList[]) => void) | undefined;
|
|
252
297
|
onUploadImg?: ((files: FileList, callBack: (urls: string[]) => void) => void) | undefined;
|
|
253
|
-
}
|
|
298
|
+
}>, {
|
|
254
299
|
prettier: boolean;
|
|
255
300
|
preview: boolean;
|
|
256
301
|
htmlPreview: boolean;
|
|
257
302
|
tabWidth: number;
|
|
258
303
|
editorId: string;
|
|
304
|
+
previewOnly: boolean;
|
|
305
|
+
showCodeRowNumber: boolean;
|
|
306
|
+
Cropper: Function;
|
|
307
|
+
historyLength: number;
|
|
308
|
+
previewTheme: PreviewThemes;
|
|
309
|
+
screenfull: Record<string, any>;
|
|
259
310
|
pageFullScreen: boolean;
|
|
260
311
|
toolbars: (keyof ToolbarTips)[];
|
|
261
312
|
toolbarsExclude: (keyof ToolbarTips)[];
|
|
262
|
-
|
|
313
|
+
screenfullJs: string;
|
|
263
314
|
hljs: Record<string, any>;
|
|
264
|
-
|
|
315
|
+
markedHeading: MarkedHeading;
|
|
265
316
|
modelValue: string;
|
|
266
317
|
theme: "dark" | "light";
|
|
267
318
|
editorClass: string;
|
|
@@ -270,7 +321,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
270
321
|
language: string;
|
|
271
322
|
languageUserDefined: {
|
|
272
323
|
[key: string]: StaticTextDefaultValue;
|
|
273
|
-
}
|
|
324
|
+
};
|
|
274
325
|
prettierCDN: string;
|
|
275
326
|
prettierMDCDN: string;
|
|
276
327
|
cropperCss: string;
|
package/lib/MdEditor/capi.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}>, {}>;
|
|
2
2
|
export default _default;
|
|
@@ -16,10 +16,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
type: PropType<(v: boolean) => void>;
|
|
17
17
|
default: () => () => void;
|
|
18
18
|
};
|
|
19
|
-
to: {
|
|
20
|
-
type: PropType<HTMLElement>;
|
|
21
|
-
default: () => HTMLElement;
|
|
22
|
-
};
|
|
23
19
|
}, () => import("vue").VNode<unknown, unknown, {
|
|
24
20
|
[key: string]: any;
|
|
25
21
|
}>[], unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
@@ -27,18 +23,15 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
27
23
|
overlay?: unknown;
|
|
28
24
|
visible?: unknown;
|
|
29
25
|
onChange?: unknown;
|
|
30
|
-
to?: unknown;
|
|
31
26
|
} & {
|
|
32
27
|
onChange: (v: boolean) => void;
|
|
33
28
|
trigger: "click" | "hover";
|
|
34
29
|
overlay: string | JSX.Element;
|
|
35
30
|
visible: boolean;
|
|
36
|
-
|
|
37
|
-
} & {}> & ({} | {}), {
|
|
31
|
+
} & {}>, {
|
|
38
32
|
onChange: (v: boolean) => void;
|
|
39
33
|
trigger: "click" | "hover";
|
|
40
34
|
overlay: string | JSX.Element;
|
|
41
35
|
visible: boolean;
|
|
42
|
-
to: HTMLElement;
|
|
43
36
|
}>;
|
|
44
37
|
export default _default;
|
|
@@ -16,34 +16,55 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
16
16
|
default: boolean;
|
|
17
17
|
};
|
|
18
18
|
width: {
|
|
19
|
-
type: PropType<string
|
|
19
|
+
type: PropType<string>;
|
|
20
|
+
default: string;
|
|
21
|
+
};
|
|
22
|
+
height: {
|
|
23
|
+
type: PropType<string>;
|
|
20
24
|
default: string;
|
|
21
25
|
};
|
|
22
26
|
onClosed: {
|
|
23
27
|
type: PropType<() => void>;
|
|
24
28
|
default: () => () => void;
|
|
25
29
|
};
|
|
26
|
-
|
|
27
|
-
type: PropType<
|
|
28
|
-
default:
|
|
30
|
+
showAdjust: {
|
|
31
|
+
type: PropType<boolean>;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
isFullscreen: {
|
|
35
|
+
type: PropType<boolean>;
|
|
36
|
+
default: boolean;
|
|
37
|
+
};
|
|
38
|
+
onAdjust: {
|
|
39
|
+
type: PropType<(val: boolean) => void>;
|
|
40
|
+
default: () => () => void;
|
|
29
41
|
};
|
|
30
42
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
|
|
31
43
|
title?: unknown;
|
|
32
44
|
visible?: unknown;
|
|
33
45
|
width?: unknown;
|
|
46
|
+
height?: unknown;
|
|
34
47
|
onClosed?: unknown;
|
|
35
|
-
|
|
48
|
+
showAdjust?: unknown;
|
|
49
|
+
isFullscreen?: unknown;
|
|
50
|
+
onAdjust?: unknown;
|
|
36
51
|
} & {
|
|
37
52
|
title: string;
|
|
38
53
|
visible: boolean;
|
|
39
|
-
|
|
40
|
-
width: string
|
|
54
|
+
height: string;
|
|
55
|
+
width: string;
|
|
41
56
|
onClosed: () => void;
|
|
42
|
-
|
|
57
|
+
showAdjust: boolean;
|
|
58
|
+
isFullscreen: boolean;
|
|
59
|
+
onAdjust: (val: boolean) => void;
|
|
60
|
+
} & {}>, {
|
|
43
61
|
title: string;
|
|
44
62
|
visible: boolean;
|
|
45
|
-
|
|
46
|
-
width: string
|
|
63
|
+
height: string;
|
|
64
|
+
width: string;
|
|
47
65
|
onClosed: () => void;
|
|
66
|
+
showAdjust: boolean;
|
|
67
|
+
isFullscreen: boolean;
|
|
68
|
+
onAdjust: (val: boolean) => void;
|
|
48
69
|
}>;
|
|
49
70
|
export default _default;
|
package/lib/MdEditor/config.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { StaticTextDefault } from './Editor';
|
|
|
2
2
|
export declare const iconScriptId = "md-editor-v3";
|
|
3
3
|
export declare const iconfontUrl = "https://at.alicdn.com/t/font_2605852_khjf435c7th.js";
|
|
4
4
|
export declare const highlightUrl: {
|
|
5
|
-
|
|
5
|
+
atom: string;
|
|
6
|
+
github: string;
|
|
7
|
+
githubDark: string;
|
|
6
8
|
js: string;
|
|
7
9
|
};
|
|
8
10
|
export declare const prettierUrl: {
|
|
@@ -13,5 +15,6 @@ export declare const cropperUrl: {
|
|
|
13
15
|
css: string;
|
|
14
16
|
js: string;
|
|
15
17
|
};
|
|
18
|
+
export declare const screenfullUrl = "https://cdn.jsdelivr.net/npm/screenfull@5.1.0/dist/screenfull.js";
|
|
16
19
|
export declare const allToolbar: string[];
|
|
17
20
|
export declare const staticTextDefault: StaticTextDefault;
|