vditor 3.8.6 → 3.8.10

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 CHANGED
@@ -6,9 +6,8 @@
6
6
  <br><br>
7
7
  <a title="MIT" target="_blank" href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square"></a>
8
8
  <a title="npm bundle size" target="_blank" href="https://www.npmjs.com/package/vditor"><img alt="npm bundle size" src="https://img.shields.io/bundlephobia/minzip/vditor?style=flat-square&color=blueviolet"></a>
9
- <a title="Dependencies" target="_blank" href="https://github.com/Vanessa219/vditor"><img src="https://img.shields.io/david/Vanessa219/vditor.svg?style=flat-square&color=ff96b4"></a> <br>
10
- <a title="Version" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/v/vditor.svg?style=flat-square"></a>
11
- <a title="Downloads" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/dt/vditor.svg?style=flat-square&color=97ca00"></a><br>
9
+ <a title="Version" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/v/vditor.svg?style=flat-square"></a><br>
10
+ <a title="Downloads" target="_blank" href="https://www.npmjs.com/package/vditor"><img src="https://img.shields.io/npm/dt/vditor.svg?style=flat-square&color=97ca00"></a>
12
11
  <a title="jsdelivr" target="_blank" href="https://www.jsdelivr.com/package/npm/vditor"><img src="https://data.jsdelivr.com/v1/package/npm/vditor/badge"/></a>
13
12
  <a title="Hits" target="_blank" href="https://github.com/88250/hits"><img src="https://hits.b3log.org/Vanessa219/vditor.svg"></a> <br><br>
14
13
  <a title="GitHub Watchers" target="_blank" href="https://github.com/Vanessa219/vditor/watchers"><img src="https://img.shields.io/github/watchers/Vanessa219/vditor.svg?label=Watchers&style=social"></a>
@@ -23,7 +22,7 @@
23
22
 
24
23
  ## 💡 简介
25
24
 
26
- [Vditor](https://b3log.org/vditor) 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。它使用 TypeScript 实现,支持原生 JavaScript、Vue、React、Angular、Svelte,提供[桌面版](https://b3log.org/siyuan)。
25
+ [Vditor](https://b3log.org/vditor) 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
27
26
 
28
27
  欢迎到 [Vditor 官方讨论区](https://ld246.com/tag/vditor)了解更多。同时也欢迎关注 B3log 开源社区微信公众号 `B3log开源`:
29
28
 
@@ -115,7 +114,6 @@ Vditor 在这些方面做了努力,希望能为现代化的通用 Markdown 编
115
114
 
116
115
  * [Sym](https://github.com/88250/symphony) 一款用 Java 实现的现代化社区(论坛/BBS/社交网络/博客)平台
117
116
  * [Solo](https://github.com/88250/solo) & [Pipe](https://github.com/88250/pipe) B3log 分布式社区的博客端节点,欢迎加入下一代社区网络
118
- * [思源笔记](https://b3log.org/siyuan) 一款 Markdown 块级引用和双向链接的网状笔记应用
119
117
  * [Arya](https://github.com/nicejade/markdown-online-editor) 基于 Vue、Vditor,所构建的在线 Markdown 编辑器
120
118
  * [更多案例](https://github.com/Vanessa219/vditor/network/dependents?package_id=UGFja2FnZS0zMTY2Mzg4MzE%3D)
121
119
 
@@ -365,13 +363,15 @@ new Vditor('vditor', {
365
363
  | extend: IHintExtend[] | 对 @/话题等关键字自动补全的扩展 | [] |
366
364
 
367
365
  ```ts
366
+ interface IHintData {
367
+ html: string;
368
+ value: string;
369
+ }
370
+
368
371
  interface IHintExtend {
369
372
  key: string;
370
373
 
371
- hint?(value: string): Array<{
372
- html: string;
373
- value: string;
374
- }>;
374
+ hint?(value: string): IHintData[] | Promise<IHintData[]>;
375
375
  }
376
376
  ```
377
377
 
@@ -449,9 +449,9 @@ if (xhr.status === 200) {
449
449
  | filename(name: string): string | 文件名安全处理 | name => name.replace(/\W/g, '') |
450
450
  | accept | 文件上传类型,同[input accept](https://www.w3schools.com/tags/att_input_accept.asp) | - |
451
451
  | validate(files: File[]) => string \| boolean | 校验,成功时返回 true 否则返回错误信息 | - |
452
- | handler(files: File[]) => string \| null | 自定义上传,当发生错误时返回错误信息 | - |
452
+ | handler(files: File[]) => string \| null \| Promise<string> \| Promise<null> | 自定义上传,当发生错误时返回错误信息 | - |
453
453
  | format(files: File[], responseText: string): string | 对服务端返回的数据进行转换,以满足内置的数据结构 | - |
454
- | file(files: File[]): File[] | 将上传的文件处理后再返回 | - |
454
+ | file(files: File[]): File[] \| Promise<File[]> | 将上传的文件处理后再返回 | - |
455
455
  | setHeaders(): { [key: string]: string } | 上传前使用返回值设置头 | - |
456
456
  | extraData: { [key: string]: string \| Blob } | 为 FormData 添加额外的参数 | - |
457
457
  | multiple | 上传文件是否为多个 | true |
package/dist/index.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vditor v3.8.6 - A markdown editor written in TypeScript.
2
+ * Vditor v3.8.10 - A markdown editor written in TypeScript.
3
3
  *
4
4
  * MIT License
5
5
  *