vditor 3.10.9 → 3.11.1
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/LICENSE +1 -1
- package/README.md +4 -1
- package/dist/index.css +21 -15
- package/dist/index.d.ts +1 -0
- package/dist/index.js +900 -879
- package/dist/index.min.js +1 -1
- package/dist/js/highlight.js/styles/ant-design.min.css +1 -1
- package/dist/js/i18n/de_DE.js +86 -0
- package/dist/js/i18n/en_US.js +3 -2
- package/dist/js/i18n/fr_FR.js +1 -0
- package/dist/js/i18n/ja_JP.js +1 -0
- package/dist/js/i18n/ko_KR.js +1 -0
- package/dist/js/i18n/pt_BR.js +1 -0
- package/dist/js/i18n/ru_RU.js +1 -0
- package/dist/js/i18n/sv_SE.js +1 -0
- package/dist/js/i18n/zh_CN.js +1 -0
- package/dist/js/i18n/zh_TW.js +1 -0
- package/dist/js/mermaid/mermaid.min.js +1592 -744
- package/dist/method.js +237 -233
- package/dist/method.min.js +1 -1
- package/dist/types/index.d.ts +13 -3
- package/package.json +1 -1
- package/src/assets/less/_reset.less +1 -1
- package/src/index.ts +10 -4
- package/src/ts/markdown/codeRender.ts +1 -1
- package/src/ts/markdown/mermaidRender.ts +1 -1
- package/src/ts/markdown/previewRender.ts +1 -1
- package/src/ts/undo/index.ts +2 -2
- package/src/ts/upload/index.ts +19 -6
- package/src/ts/util/editorCommonEvent.ts +3 -0
- package/src/ts/util/fixBrowserBehavior.ts +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -201,7 +201,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
|
|
|
201
201
|
| minHeight | 编辑区域最小高度 | - |
|
|
202
202
|
| width | 编辑器总宽度,支持 % | 'auto' |
|
|
203
203
|
| placeholder | 输入区域为空时的提示 | '' |
|
|
204
|
-
| lang | 语言种类:en_US, fr_FR, pt_BR, ja_JP, ko_KR, ru_RU, sv_SE, zh_CN, zh_TW | 'zh_CN' |
|
|
204
|
+
| lang | 语言种类:de_DE, en_US, fr_FR, pt_BR, ja_JP, ko_KR, ru_RU, sv_SE, zh_CN, zh_TW | 'zh_CN' |
|
|
205
205
|
| input(value: string) | 输入后触发 | - |
|
|
206
206
|
| focus(value: string) | 聚焦后触发 | - |
|
|
207
207
|
| blur(value: string) | 失焦后触发 | - |
|
|
@@ -209,6 +209,7 @@ Markdown 输出的 HTML 所展现的外观。内置 ant-design, light,dark,w
|
|
|
209
209
|
| esc(value: string) | <kbd>esc</kbd> 按下后触发 | - |
|
|
210
210
|
| ctrlEnter(value: string) | <kbd>⌘/ctrl+enter</kbd> 按下后触发 | - |
|
|
211
211
|
| select(value: string) | 编辑器中选中文字后触发 | - |
|
|
212
|
+
| unSelect() | 编辑器中未选中文字后触发 | - |
|
|
212
213
|
| tab | <kbd>tab</kbd> 键操作字符串,支持 `\t` 及任意字符串 | - |
|
|
213
214
|
| typewriterMode | 是否启用打字机模式 | false |
|
|
214
215
|
| cdn | 配置自建 CDN 地址 | `https://unpkg.com/vditor@${VDITOR_VERSION}` |
|
|
@@ -464,6 +465,7 @@ if (xhr.status === 200) {
|
|
|
464
465
|
|
|
465
466
|
| | 说明 | 默认值 |
|
|
466
467
|
| - | - | - |
|
|
468
|
+
| xhr | 上传时使用的 XMLHttpRequest | - |
|
|
467
469
|
| url | 上传 url,为空则不会触发上传相关事件 | '' |
|
|
468
470
|
| max | 上传文件最大 Byte | 10 * 1024 * 1024 |
|
|
469
471
|
| linkToImgUrl | 剪切板中包含图片地址时,使用此 url 重新上传 | '' |
|
|
@@ -480,6 +482,7 @@ if (xhr.status === 200) {
|
|
|
480
482
|
| handler(files: File[]) => string \| null \| Promise<string> \| Promise<null> | 自定义上传,当发生错误时返回错误信息 | - |
|
|
481
483
|
| format(files: File[], responseText: string): string | 对服务端返回的数据进行转换,以满足内置的数据结构 | - |
|
|
482
484
|
| file(files: File[]): File[] \| Promise<File[]> | 将上传的文件处理后再返回 | - |
|
|
485
|
+
| cancel(files: File[]): void | 取消正在上传的文件 | - |
|
|
483
486
|
| setHeaders(): { [key: string]: string } | 上传前使用返回值设置头 | - |
|
|
484
487
|
| extraData: { [key: string]: string \| Blob } | 为 FormData 添加额外的参数 | - |
|
|
485
488
|
| multiple | 上传文件是否为多个 | true |
|
package/dist/index.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vditor v3.
|
|
2
|
+
* Vditor v3.11.1 - A markdown editor written in TypeScript.
|
|
3
3
|
*
|
|
4
4
|
* MIT License
|
|
5
5
|
*
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
27
|
/*!
|
|
28
|
-
* Vditor v3.
|
|
28
|
+
* Vditor v3.11.1 - A markdown editor written in TypeScript.
|
|
29
29
|
*
|
|
30
30
|
* MIT License
|
|
31
31
|
*
|
|
@@ -277,8 +277,9 @@
|
|
|
277
277
|
z-index: 3;
|
|
278
278
|
font-size: 14px;
|
|
279
279
|
display: none;
|
|
280
|
-
-
|
|
281
|
-
|
|
280
|
+
-webkit-user-select: none;
|
|
281
|
+
-moz-user-select: none;
|
|
282
|
+
user-select: none;
|
|
282
283
|
max-width: 320px;
|
|
283
284
|
min-width: 80px;
|
|
284
285
|
animation-duration: 0.15s;
|
|
@@ -599,8 +600,9 @@
|
|
|
599
600
|
background-color: var(--count-background-color);
|
|
600
601
|
border-radius: 3px;
|
|
601
602
|
font-size: 12px;
|
|
602
|
-
-
|
|
603
|
-
|
|
603
|
+
-webkit-user-select: none;
|
|
604
|
+
-moz-user-select: none;
|
|
605
|
+
user-select: none;
|
|
604
606
|
float: right;
|
|
605
607
|
margin: 8px 3px 0 0;
|
|
606
608
|
}
|
|
@@ -611,8 +613,9 @@
|
|
|
611
613
|
.vditor-resize {
|
|
612
614
|
padding: 3px 0;
|
|
613
615
|
cursor: row-resize;
|
|
614
|
-
-
|
|
615
|
-
|
|
616
|
+
-webkit-user-select: none;
|
|
617
|
+
-moz-user-select: none;
|
|
618
|
+
user-select: none;
|
|
616
619
|
position: absolute;
|
|
617
620
|
width: 100%;
|
|
618
621
|
}
|
|
@@ -722,8 +725,9 @@
|
|
|
722
725
|
align-items: center;
|
|
723
726
|
cursor: pointer;
|
|
724
727
|
margin-left: 24px;
|
|
725
|
-
-
|
|
726
|
-
|
|
728
|
+
-webkit-user-select: none;
|
|
729
|
+
-moz-user-select: none;
|
|
730
|
+
user-select: none;
|
|
727
731
|
color: var(--toolbar-icon-color);
|
|
728
732
|
}
|
|
729
733
|
.vditor-img__btn:hover {
|
|
@@ -1115,12 +1119,13 @@
|
|
|
1115
1119
|
.vditor-linenumber__rows {
|
|
1116
1120
|
position: absolute;
|
|
1117
1121
|
pointer-events: none;
|
|
1118
|
-
top:
|
|
1122
|
+
top: 1em;
|
|
1119
1123
|
left: 0;
|
|
1120
1124
|
width: 3em;
|
|
1121
1125
|
/* works for line-numbers below 1000 lines */
|
|
1122
|
-
-
|
|
1123
|
-
|
|
1126
|
+
-webkit-user-select: none;
|
|
1127
|
+
-moz-user-select: none;
|
|
1128
|
+
user-select: none;
|
|
1124
1129
|
counter-reset: linenumber;
|
|
1125
1130
|
}
|
|
1126
1131
|
.vditor-linenumber__rows > span {
|
|
@@ -1249,8 +1254,9 @@
|
|
|
1249
1254
|
}
|
|
1250
1255
|
.vditor-toc {
|
|
1251
1256
|
margin-bottom: 16px;
|
|
1252
|
-
-
|
|
1253
|
-
|
|
1257
|
+
-webkit-user-select: text;
|
|
1258
|
+
-moz-user-select: text;
|
|
1259
|
+
user-select: text;
|
|
1254
1260
|
color: #4285f4;
|
|
1255
1261
|
}
|
|
1256
1262
|
.vditor-toc .vditor-outline__action {
|