@nocobase/plugin-block-markdown 2.0.0-alpha.22

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.
Files changed (330) hide show
  1. package/LICENSE.txt +172 -0
  2. package/README.md +1 -0
  3. package/build.config.ts +15 -0
  4. package/client.d.ts +2 -0
  5. package/client.js +1 -0
  6. package/dist/client/index.d.ts +9 -0
  7. package/dist/client/index.js +10 -0
  8. package/dist/client/locale.d.ts +10 -0
  9. package/dist/client/models/MarkdownBlockModel.d.ts +13 -0
  10. package/dist/client/models/index.d.ts +10 -0
  11. package/dist/client/plugin.d.ts +15 -0
  12. package/dist/client/vditor/dist/css/content-theme/ant-design.css +210 -0
  13. package/dist/client/vditor/dist/css/content-theme/dark.css +123 -0
  14. package/dist/client/vditor/dist/css/content-theme/light.css +101 -0
  15. package/dist/client/vditor/dist/css/content-theme/wechat.css +94 -0
  16. package/dist/client/vditor/dist/images/emoji/b3log.png +0 -0
  17. package/dist/client/vditor/dist/images/emoji/chainbook.png +0 -0
  18. package/dist/client/vditor/dist/images/emoji/doge.png +0 -0
  19. package/dist/client/vditor/dist/images/emoji/hacpai.png +0 -0
  20. package/dist/client/vditor/dist/images/emoji/huaji.gif +0 -0
  21. package/dist/client/vditor/dist/images/emoji/latke.png +0 -0
  22. package/dist/client/vditor/dist/images/emoji/liandi.png +0 -0
  23. package/dist/client/vditor/dist/images/emoji/lute.png +0 -0
  24. package/dist/client/vditor/dist/images/emoji/octocat.png +0 -0
  25. package/dist/client/vditor/dist/images/emoji/pipe.png +0 -0
  26. package/dist/client/vditor/dist/images/emoji/siyuan.png +0 -0
  27. package/dist/client/vditor/dist/images/emoji/solo.png +0 -0
  28. package/dist/client/vditor/dist/images/emoji/sym.png +0 -0
  29. package/dist/client/vditor/dist/images/emoji/trollface.png +0 -0
  30. package/dist/client/vditor/dist/images/emoji/vditor.png +0 -0
  31. package/dist/client/vditor/dist/images/emoji/wide.png +0 -0
  32. package/dist/client/vditor/dist/images/emoji/wulian.png +0 -0
  33. package/dist/client/vditor/dist/images/img-loading.svg +1 -0
  34. package/dist/client/vditor/dist/images/logo.png +0 -0
  35. package/dist/client/vditor/dist/index.css +1836 -0
  36. package/dist/client/vditor/dist/index.d.ts +76 -0
  37. package/dist/client/vditor/dist/index.min.js +10 -0
  38. package/dist/client/vditor/dist/js/abcjs/abcjs_basic.min.js +12 -0
  39. package/dist/client/vditor/dist/js/echarts/echarts.min.js +32 -0
  40. package/dist/client/vditor/dist/js/flowchart.js/flowchart.min.js +17 -0
  41. package/dist/client/vditor/dist/js/graphviz/full.render.js +99 -0
  42. package/dist/client/vditor/dist/js/graphviz/viz.js +342 -0
  43. package/dist/client/vditor/dist/js/highlight.js/highlight.pack.js +1626 -0
  44. package/dist/client/vditor/dist/js/highlight.js/solidity.min.js +82 -0
  45. package/dist/client/vditor/dist/js/highlight.js/styles/abap.css +155 -0
  46. package/dist/client/vditor/dist/js/highlight.js/styles/algol.css +143 -0
  47. package/dist/client/vditor/dist/js/highlight.js/styles/algol_nu.css +90 -0
  48. package/dist/client/vditor/dist/js/highlight.js/styles/ant-design.css +469 -0
  49. package/dist/client/vditor/dist/js/highlight.js/styles/arduino.css +157 -0
  50. package/dist/client/vditor/dist/js/highlight.js/styles/autumn.css +138 -0
  51. package/dist/client/vditor/dist/js/highlight.js/styles/borland.css +147 -0
  52. package/dist/client/vditor/dist/js/highlight.js/styles/bw.css +150 -0
  53. package/dist/client/vditor/dist/js/highlight.js/styles/colorful.css +158 -0
  54. package/dist/client/vditor/dist/js/highlight.js/styles/dracula.css +140 -0
  55. package/dist/client/vditor/dist/js/highlight.js/styles/emacs.css +167 -0
  56. package/dist/client/vditor/dist/js/highlight.js/styles/friendly.css +183 -0
  57. package/dist/client/vditor/dist/js/highlight.js/styles/fruity.css +123 -0
  58. package/dist/client/vditor/dist/js/highlight.js/styles/github.css +174 -0
  59. package/dist/client/vditor/dist/js/highlight.js/styles/igor.css +124 -0
  60. package/dist/client/vditor/dist/js/highlight.js/styles/lovelace.css +146 -0
  61. package/dist/client/vditor/dist/js/highlight.js/styles/manni.css +139 -0
  62. package/dist/client/vditor/dist/js/highlight.js/styles/monokai.css +132 -0
  63. package/dist/client/vditor/dist/js/highlight.js/styles/monokailight.css +180 -0
  64. package/dist/client/vditor/dist/js/highlight.js/styles/murphy.css +144 -0
  65. package/dist/client/vditor/dist/js/highlight.js/styles/native.css +164 -0
  66. package/dist/client/vditor/dist/js/highlight.js/styles/paraiso-dark.css +137 -0
  67. package/dist/client/vditor/dist/js/highlight.js/styles/paraiso-light.css +136 -0
  68. package/dist/client/vditor/dist/js/highlight.js/styles/pastie.css +180 -0
  69. package/dist/client/vditor/dist/js/highlight.js/styles/perldoc.css +141 -0
  70. package/dist/client/vditor/dist/js/highlight.js/styles/pygments.css +159 -0
  71. package/dist/client/vditor/dist/js/highlight.js/styles/rainbow_dash.css +164 -0
  72. package/dist/client/vditor/dist/js/highlight.js/styles/rrt.css +159 -0
  73. package/dist/client/vditor/dist/js/highlight.js/styles/solarized-dark.css +146 -0
  74. package/dist/client/vditor/dist/js/highlight.js/styles/solarized-dark256.css +146 -0
  75. package/dist/client/vditor/dist/js/highlight.js/styles/solarized-light.css +163 -0
  76. package/dist/client/vditor/dist/js/highlight.js/styles/swapoff.css +144 -0
  77. package/dist/client/vditor/dist/js/highlight.js/styles/tango.css +183 -0
  78. package/dist/client/vditor/dist/js/highlight.js/styles/trac.css +167 -0
  79. package/dist/client/vditor/dist/js/highlight.js/styles/vim.css +144 -0
  80. package/dist/client/vditor/dist/js/highlight.js/styles/vs.css +113 -0
  81. package/dist/client/vditor/dist/js/highlight.js/styles/xcode.css +174 -0
  82. package/dist/client/vditor/dist/js/highlight.js/yul.min.js +39 -0
  83. package/dist/client/vditor/dist/js/i18n/en_US.js +94 -0
  84. package/dist/client/vditor/dist/js/i18n/fr_FR.js +94 -0
  85. package/dist/client/vditor/dist/js/i18n/ja_JP.js +94 -0
  86. package/dist/client/vditor/dist/js/i18n/ko_KR.js +94 -0
  87. package/dist/client/vditor/dist/js/i18n/pt_BR.js +94 -0
  88. package/dist/client/vditor/dist/js/i18n/ru_RU.js +94 -0
  89. package/dist/client/vditor/dist/js/i18n/sv_SE.js +94 -0
  90. package/dist/client/vditor/dist/js/i18n/zh_CN.js +94 -0
  91. package/dist/client/vditor/dist/js/i18n/zh_TW.js +94 -0
  92. package/dist/client/vditor/dist/js/icons/ant.js +183 -0
  93. package/dist/client/vditor/dist/js/icons/material.js +204 -0
  94. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
  95. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  96. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  97. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  98. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  99. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  100. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  101. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  102. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  103. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  104. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  105. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  106. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  107. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  108. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  109. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
  110. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  111. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  112. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  113. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  114. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  115. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
  116. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  117. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  118. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
  119. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  120. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  121. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  122. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  123. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  124. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
  125. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  126. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  127. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  128. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  129. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  130. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  131. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  132. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  133. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  134. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  135. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  136. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
  137. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff +0 -0
  138. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  139. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
  140. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  141. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  142. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
  143. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  144. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  145. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
  146. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  147. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  148. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
  149. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  150. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  151. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  152. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  153. package/dist/client/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  154. package/dist/client/vditor/dist/js/katex/katex.min.css +1 -0
  155. package/dist/client/vditor/dist/js/katex/katex.min.js +10 -0
  156. package/dist/client/vditor/dist/js/katex/mhchem.min.js +10 -0
  157. package/dist/client/vditor/dist/js/lute/lute.min.js +80 -0
  158. package/dist/client/vditor/dist/js/markmap/katex.min.css +1 -0
  159. package/dist/client/vditor/dist/js/markmap/markmap.min.js +8260 -0
  160. package/dist/client/vditor/dist/js/markmap/prism.css +140 -0
  161. package/dist/client/vditor/dist/js/mathjax/LICENSE +202 -0
  162. package/dist/client/vditor/dist/js/mathjax/a11y/assistive-mml.js +10 -0
  163. package/dist/client/vditor/dist/js/mathjax/a11y/complexity.js +10 -0
  164. package/dist/client/vditor/dist/js/mathjax/a11y/explorer.js +10 -0
  165. package/dist/client/vditor/dist/js/mathjax/a11y/semantic-enrich.js +10 -0
  166. package/dist/client/vditor/dist/js/mathjax/input/asciimath.js +10 -0
  167. package/dist/client/vditor/dist/js/mathjax/input/mml/entities.js +10 -0
  168. package/dist/client/vditor/dist/js/mathjax/input/mml.js +10 -0
  169. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/action.js +10 -0
  170. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/all-packages.js +10 -0
  171. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/ams.js +10 -0
  172. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/amscd.js +10 -0
  173. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/autoload.js +10 -0
  174. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/bbox.js +10 -0
  175. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/boldsymbol.js +10 -0
  176. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/braket.js +10 -0
  177. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/bussproofs.js +10 -0
  178. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/cancel.js +10 -0
  179. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/color.js +10 -0
  180. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/colorV2.js +10 -0
  181. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/configMacros.js +10 -0
  182. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/enclose.js +10 -0
  183. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/extpfeil.js +10 -0
  184. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/html.js +10 -0
  185. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/mhchem.js +10 -0
  186. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/newcommand.js +10 -0
  187. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/noerrors.js +10 -0
  188. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/noundefined.js +10 -0
  189. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/physics.js +10 -0
  190. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/require.js +10 -0
  191. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/tagFormat.js +10 -0
  192. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/textmacros.js +10 -0
  193. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/unicode.js +10 -0
  194. package/dist/client/vditor/dist/js/mathjax/input/tex/extensions/verb.js +10 -0
  195. package/dist/client/vditor/dist/js/mathjax/input/tex-base.js +10 -0
  196. package/dist/client/vditor/dist/js/mathjax/input/tex-full.js +10 -0
  197. package/dist/client/vditor/dist/js/mathjax/input/tex.js +10 -0
  198. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/de.js +113 -0
  199. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/en.js +119 -0
  200. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/es.js +113 -0
  201. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/fr.js +113 -0
  202. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/mathmaps_ie.js +527 -0
  203. package/dist/client/vditor/dist/js/mathjax/sre/mathmaps/nemeth.js +113 -0
  204. package/dist/client/vditor/dist/js/mathjax/sre/sre-node.js +20 -0
  205. package/dist/client/vditor/dist/js/mathjax/sre/sre_browser.js +1642 -0
  206. package/dist/client/vditor/dist/js/mathjax/tex-svg-full.js +10 -0
  207. package/dist/client/vditor/dist/js/mermaid/mermaid.min.js +1768 -0
  208. package/dist/client/vditor/dist/js/plantuml/plantuml-encoder.min.js +10 -0
  209. package/dist/client/vditor/dist/method.d.ts +50 -0
  210. package/dist/client/vditor/dist/method.min.js +10 -0
  211. package/dist/client/vditor/dist/ts/constants.d.ts +45 -0
  212. package/dist/client/vditor/dist/ts/devtools/index.d.ts +7 -0
  213. package/dist/client/vditor/dist/ts/export/index.d.ts +5 -0
  214. package/dist/client/vditor/dist/ts/hint/index.d.ts +14 -0
  215. package/dist/client/vditor/dist/ts/ir/expandMarker.d.ts +2 -0
  216. package/dist/client/vditor/dist/ts/ir/highlightToolbarIR.d.ts +2 -0
  217. package/dist/client/vditor/dist/ts/ir/index.d.ts +13 -0
  218. package/dist/client/vditor/dist/ts/ir/input.d.ts +2 -0
  219. package/dist/client/vditor/dist/ts/ir/process.d.ts +9 -0
  220. package/dist/client/vditor/dist/ts/ir/processKeydown.d.ts +2 -0
  221. package/dist/client/vditor/dist/ts/markdown/abcRender.d.ts +1 -0
  222. package/dist/client/vditor/dist/ts/markdown/adapterRender.d.ts +37 -0
  223. package/dist/client/vditor/dist/ts/markdown/anchorRender.d.ts +1 -0
  224. package/dist/client/vditor/dist/ts/markdown/chartRender.d.ts +1 -0
  225. package/dist/client/vditor/dist/ts/markdown/codeRender.d.ts +2 -0
  226. package/dist/client/vditor/dist/ts/markdown/flowchartRender.d.ts +1 -0
  227. package/dist/client/vditor/dist/ts/markdown/getHTML.d.ts +2 -0
  228. package/dist/client/vditor/dist/ts/markdown/getMarkdown.d.ts +2 -0
  229. package/dist/client/vditor/dist/ts/markdown/graphvizRender.d.ts +1 -0
  230. package/dist/client/vditor/dist/ts/markdown/highlightRender.d.ts +2 -0
  231. package/dist/client/vditor/dist/ts/markdown/lazyLoadImageRender.d.ts +6 -0
  232. package/dist/client/vditor/dist/ts/markdown/markmapRender.d.ts +1 -0
  233. package/dist/client/vditor/dist/ts/markdown/mathRender.d.ts +10 -0
  234. package/dist/client/vditor/dist/ts/markdown/mediaRender.d.ts +1 -0
  235. package/dist/client/vditor/dist/ts/markdown/mermaidRender.d.ts +1 -0
  236. package/dist/client/vditor/dist/ts/markdown/mindmapRender.d.ts +1 -0
  237. package/dist/client/vditor/dist/ts/markdown/outlineRender.d.ts +2 -0
  238. package/dist/client/vditor/dist/ts/markdown/plantumlRender.d.ts +1 -0
  239. package/dist/client/vditor/dist/ts/markdown/previewRender.d.ts +3 -0
  240. package/dist/client/vditor/dist/ts/markdown/setLute.d.ts +2 -0
  241. package/dist/client/vditor/dist/ts/markdown/speechRender.d.ts +7 -0
  242. package/dist/client/vditor/dist/ts/outline/index.d.ts +7 -0
  243. package/dist/client/vditor/dist/ts/preview/image.d.ts +2 -0
  244. package/dist/client/vditor/dist/ts/preview/index.d.ts +10 -0
  245. package/dist/client/vditor/dist/ts/resize/index.d.ts +6 -0
  246. package/dist/client/vditor/dist/ts/sv/combineFootnote.d.ts +6 -0
  247. package/dist/client/vditor/dist/ts/sv/index.d.ts +13 -0
  248. package/dist/client/vditor/dist/ts/sv/inputEvent.d.ts +2 -0
  249. package/dist/client/vditor/dist/ts/sv/process.d.ts +12 -0
  250. package/dist/client/vditor/dist/ts/sv/processKeydown.d.ts +2 -0
  251. package/dist/client/vditor/dist/ts/tip/index.d.ts +6 -0
  252. package/dist/client/vditor/dist/ts/toolbar/Both.d.ts +5 -0
  253. package/dist/client/vditor/dist/ts/toolbar/Br.d.ts +4 -0
  254. package/dist/client/vditor/dist/ts/toolbar/CodeTheme.d.ts +6 -0
  255. package/dist/client/vditor/dist/ts/toolbar/ContentTheme.d.ts +6 -0
  256. package/dist/client/vditor/dist/ts/toolbar/Counter.d.ts +6 -0
  257. package/dist/client/vditor/dist/ts/toolbar/Custom.d.ts +5 -0
  258. package/dist/client/vditor/dist/ts/toolbar/Devtools.d.ts +5 -0
  259. package/dist/client/vditor/dist/ts/toolbar/Divider.d.ts +4 -0
  260. package/dist/client/vditor/dist/ts/toolbar/EditMode.d.ts +8 -0
  261. package/dist/client/vditor/dist/ts/toolbar/Emoji.d.ts +7 -0
  262. package/dist/client/vditor/dist/ts/toolbar/Export.d.ts +6 -0
  263. package/dist/client/vditor/dist/ts/toolbar/Fullscreen.d.ts +6 -0
  264. package/dist/client/vditor/dist/ts/toolbar/Headings.d.ts +7 -0
  265. package/dist/client/vditor/dist/ts/toolbar/Help.d.ts +5 -0
  266. package/dist/client/vditor/dist/ts/toolbar/Indent.d.ts +5 -0
  267. package/dist/client/vditor/dist/ts/toolbar/Info.d.ts +5 -0
  268. package/dist/client/vditor/dist/ts/toolbar/InsertAfter.d.ts +5 -0
  269. package/dist/client/vditor/dist/ts/toolbar/InsertBefore.d.ts +5 -0
  270. package/dist/client/vditor/dist/ts/toolbar/MenuItem.d.ts +5 -0
  271. package/dist/client/vditor/dist/ts/toolbar/Outdent.d.ts +5 -0
  272. package/dist/client/vditor/dist/ts/toolbar/Outline.d.ts +5 -0
  273. package/dist/client/vditor/dist/ts/toolbar/Preview.d.ts +6 -0
  274. package/dist/client/vditor/dist/ts/toolbar/Record.d.ts +6 -0
  275. package/dist/client/vditor/dist/ts/toolbar/Redo.d.ts +5 -0
  276. package/dist/client/vditor/dist/ts/toolbar/Undo.d.ts +5 -0
  277. package/dist/client/vditor/dist/ts/toolbar/Upload.d.ts +6 -0
  278. package/dist/client/vditor/dist/ts/toolbar/index.d.ts +9 -0
  279. package/dist/client/vditor/dist/ts/toolbar/setToolbar.d.ts +21 -0
  280. package/dist/client/vditor/dist/ts/ui/initUI.d.ts +10 -0
  281. package/dist/client/vditor/dist/ts/ui/setCodeTheme.d.ts +1 -0
  282. package/dist/client/vditor/dist/ts/ui/setContentTheme.d.ts +1 -0
  283. package/dist/client/vditor/dist/ts/ui/setPreviewMode.d.ts +2 -0
  284. package/dist/client/vditor/dist/ts/ui/setTheme.d.ts +2 -0
  285. package/dist/client/vditor/dist/ts/undo/index.d.ts +19 -0
  286. package/dist/client/vditor/dist/ts/upload/getElement.d.ts +2 -0
  287. package/dist/client/vditor/dist/ts/upload/index.d.ts +9 -0
  288. package/dist/client/vditor/dist/ts/upload/setHeaders.d.ts +2 -0
  289. package/dist/client/vditor/dist/ts/util/Options.d.ts +8 -0
  290. package/dist/client/vditor/dist/ts/util/RecordMedia.d.ts +18 -0
  291. package/dist/client/vditor/dist/ts/util/addScript.d.ts +2 -0
  292. package/dist/client/vditor/dist/ts/util/addStyle.d.ts +1 -0
  293. package/dist/client/vditor/dist/ts/util/code160to32.d.ts +1 -0
  294. package/dist/client/vditor/dist/ts/util/compatibility.d.ts +7 -0
  295. package/dist/client/vditor/dist/ts/util/editorCommonEvent.d.ts +10 -0
  296. package/dist/client/vditor/dist/ts/util/fixBrowserBehavior.d.ts +40 -0
  297. package/dist/client/vditor/dist/ts/util/function.d.ts +2 -0
  298. package/dist/client/vditor/dist/ts/util/getSelectText.d.ts +1 -0
  299. package/dist/client/vditor/dist/ts/util/hasClosest.d.ts +9 -0
  300. package/dist/client/vditor/dist/ts/util/hasClosestByHeadings.d.ts +2 -0
  301. package/dist/client/vditor/dist/ts/util/highlightToolbar.d.ts +2 -0
  302. package/dist/client/vditor/dist/ts/util/hotKey.d.ts +1 -0
  303. package/dist/client/vditor/dist/ts/util/log.d.ts +1 -0
  304. package/dist/client/vditor/dist/ts/util/merge.d.ts +1 -0
  305. package/dist/client/vditor/dist/ts/util/processCode.d.ts +3 -0
  306. package/dist/client/vditor/dist/ts/util/selection.d.ts +15 -0
  307. package/dist/client/vditor/dist/ts/util/toc.d.ts +6 -0
  308. package/dist/client/vditor/dist/ts/wysiwyg/afterRenderEvent.d.ts +6 -0
  309. package/dist/client/vditor/dist/ts/wysiwyg/highlightToolbarWYSIWYG.d.ts +5 -0
  310. package/dist/client/vditor/dist/ts/wysiwyg/index.d.ts +22 -0
  311. package/dist/client/vditor/dist/ts/wysiwyg/inlineTag.d.ts +11 -0
  312. package/dist/client/vditor/dist/ts/wysiwyg/input.d.ts +2 -0
  313. package/dist/client/vditor/dist/ts/wysiwyg/processKeydown.d.ts +3 -0
  314. package/dist/client/vditor/dist/ts/wysiwyg/renderDomByMd.d.ts +6 -0
  315. package/dist/client/vditor/dist/ts/wysiwyg/setHeading.d.ts +3 -0
  316. package/dist/client/vditor/dist/ts/wysiwyg/showCode.d.ts +2 -0
  317. package/dist/client/vditor/dist/ts/wysiwyg/toolbarEvent.d.ts +2 -0
  318. package/dist/client/vditor/dist/types/index.d.ts +866 -0
  319. package/dist/externalVersion.js +16 -0
  320. package/dist/index.d.ts +10 -0
  321. package/dist/index.js +48 -0
  322. package/dist/locale/en-US.json +1 -0
  323. package/dist/locale/zh-CN.json +1 -0
  324. package/dist/server/index.d.ts +9 -0
  325. package/dist/server/index.js +42 -0
  326. package/dist/server/plugin.d.ts +19 -0
  327. package/dist/server/plugin.js +54 -0
  328. package/package.json +21 -0
  329. package/server.d.ts +2 -0
  330. package/server.js +1 -0
@@ -0,0 +1,866 @@
1
+ declare module "*.svg";
2
+
3
+ declare module "*.png";
4
+
5
+ interface Window {
6
+ VditorI18n: ITips;
7
+ }
8
+
9
+ interface IObject {
10
+ [key: string]: string;
11
+ }
12
+
13
+ interface ILuteNode {
14
+ TokensStr: () => string;
15
+ __internal_object__: {
16
+ Parent: {
17
+ Type: number,
18
+ },
19
+ HeadingLevel: string,
20
+ };
21
+ }
22
+
23
+ type ILuteRenderCallback = (node: ILuteNode, entering: boolean) => [string, number];
24
+
25
+ /** @link https://ld246.com/article/1588412297062 */
26
+ interface ILuteRender {
27
+ renderDocument?: ILuteRenderCallback;
28
+ renderParagraph?: ILuteRenderCallback;
29
+ renderText?: ILuteRenderCallback;
30
+ renderCodeBlock?: ILuteRenderCallback;
31
+ renderCodeBlockOpenMarker?: ILuteRenderCallback;
32
+ renderCodeBlockInfoMarker?: ILuteRenderCallback;
33
+ renderCodeBlockCode?: ILuteRenderCallback;
34
+ renderCodeBlockCloseMarker?: ILuteRenderCallback;
35
+ renderMathBlock?: ILuteRenderCallback;
36
+ renderMathBlockOpenMarker?: ILuteRenderCallback;
37
+ renderMathBlockContent?: ILuteRenderCallback;
38
+ renderMathBlockCloseMarker?: ILuteRenderCallback;
39
+ renderBlockquote?: ILuteRenderCallback;
40
+ renderBlockquoteMarker?: ILuteRenderCallback;
41
+ renderHeading?: ILuteRenderCallback;
42
+ renderHeadingC8hMarker?: ILuteRenderCallback;
43
+ renderList?: ILuteRenderCallback;
44
+ renderListItem?: ILuteRenderCallback;
45
+ renderTaskListItemMarker?: ILuteRenderCallback;
46
+ renderThematicBreak?: ILuteRenderCallback;
47
+ renderHTML?: ILuteRenderCallback;
48
+ renderTable?: ILuteRenderCallback;
49
+ renderTableHead?: ILuteRenderCallback;
50
+ renderTableRow?: ILuteRenderCallback;
51
+ renderTableCell?: ILuteRenderCallback;
52
+ renderFootnotesDef?: ILuteRenderCallback;
53
+ renderCodeSpan?: ILuteRenderCallback;
54
+ renderCodeSpanOpenMarker?: ILuteRenderCallback;
55
+ renderCodeSpanContent?: ILuteRenderCallback;
56
+ renderCodeSpanCloseMarker?: ILuteRenderCallback;
57
+ renderInlineMath?: ILuteRenderCallback;
58
+ renderInlineMathOpenMarker?: ILuteRenderCallback;
59
+ renderInlineMathContent?: ILuteRenderCallback;
60
+ renderInlineMathCloseMarker?: ILuteRenderCallback;
61
+ renderEmphasis?: ILuteRenderCallback;
62
+ renderEmAsteriskOpenMarker?: ILuteRenderCallback;
63
+ renderEmAsteriskCloseMarker?: ILuteRenderCallback;
64
+ renderEmUnderscoreOpenMarker?: ILuteRenderCallback;
65
+ renderEmUnderscoreCloseMarker?: ILuteRenderCallback;
66
+ renderStrong?: ILuteRenderCallback;
67
+ renderStrongA6kOpenMarker?: ILuteRenderCallback;
68
+ renderStrongA6kCloseMarker?: ILuteRenderCallback;
69
+ renderStrongU8eOpenMarker?: ILuteRenderCallback;
70
+ renderStrongU8eCloseMarker?: ILuteRenderCallback;
71
+ renderStrikethrough?: ILuteRenderCallback;
72
+ renderStrikethrough1OpenMarker?: ILuteRenderCallback;
73
+ renderStrikethrough1CloseMarker?: ILuteRenderCallback;
74
+ renderStrikethrough2OpenMarker?: ILuteRenderCallback;
75
+ renderStrikethrough2CloseMarker?: ILuteRenderCallback;
76
+ renderHardBreak?: ILuteRenderCallback;
77
+ renderSoftBreak?: ILuteRenderCallback;
78
+ renderInlineHTML?: ILuteRenderCallback;
79
+ renderLink?: ILuteRenderCallback;
80
+ renderOpenBracket?: ILuteRenderCallback;
81
+ renderCloseBracket?: ILuteRenderCallback;
82
+ renderOpenParen?: ILuteRenderCallback;
83
+ renderCloseParen?: ILuteRenderCallback;
84
+ renderLinkText?: ILuteRenderCallback;
85
+ renderLinkSpace?: ILuteRenderCallback;
86
+ renderLinkDest?: ILuteRenderCallback;
87
+ renderLinkTitle?: ILuteRenderCallback;
88
+ renderImage?: ILuteRenderCallback;
89
+ renderBang?: ILuteRenderCallback;
90
+ renderEmoji?: ILuteRenderCallback;
91
+ renderEmojiUnicode?: ILuteRenderCallback;
92
+ renderEmojiImg?: ILuteRenderCallback;
93
+ renderEmojiAlias?: ILuteRenderCallback;
94
+ renderToC?: ILuteRenderCallback;
95
+ renderFootnotesRef?: ILuteRenderCallback;
96
+ renderBackslash?: ILuteRenderCallback;
97
+ renderBackslashContent?: ILuteRenderCallback;
98
+ }
99
+
100
+ interface ILuteOptions extends IMarkdownConfig {
101
+ emojis: IObject;
102
+ emojiSite: string;
103
+ headingAnchor: boolean;
104
+ inlineMathDigit: boolean;
105
+ lazyLoadImage?: string;
106
+ }
107
+
108
+ declare class Lute {
109
+ public static WalkStop: number;
110
+ public static WalkSkipChildren: number;
111
+ public static WalkContinue: number;
112
+ public static Version: string;
113
+ public static Caret: string;
114
+
115
+ public static New(): Lute;
116
+
117
+ public static EscapeHTMLStr(html: string): string;
118
+
119
+ public static GetHeadingID(node: ILuteNode): string;
120
+
121
+ public static NewNodeID(): string;
122
+
123
+ public static Sanitize(html: string): string;
124
+
125
+ private constructor();
126
+
127
+ public SetJSRenderers(options?: {
128
+ renderers: {
129
+ HTML2VditorDOM?: ILuteRender,
130
+ HTML2VditorIRDOM?: ILuteRender,
131
+ HTML2Md?: ILuteRender,
132
+ Md2HTML?: ILuteRender,
133
+ Md2VditorDOM?: ILuteRender,
134
+ Md2VditorIRDOM?: ILuteRender,
135
+ Md2VditorSVDOM?: ILuteRender,
136
+ },
137
+ }): void;
138
+
139
+ public SetChineseParagraphBeginningSpace(enable: boolean): void;
140
+
141
+ public SetHeadingID(enable: boolean): void;
142
+
143
+ public SetRenderListStyle(enable: boolean): void;
144
+
145
+ public SetLinkBase(url: string): void;
146
+
147
+ public SetVditorIR(enable: boolean): void;
148
+
149
+ public SetVditorSV(enable: boolean): void;
150
+
151
+ public SetVditorWYSIWYG(enable: boolean): void;
152
+
153
+ public SetLinkPrefix(url: string): void;
154
+
155
+ public SetMark(enable: boolean): void;
156
+
157
+ public SetGFMAutoLink(enable: boolean): void;
158
+
159
+ public SetSanitize(enable: boolean): void;
160
+
161
+ public SetHeadingAnchor(enable: boolean): void;
162
+
163
+ public SetImageLazyLoading(imagePath: string): void;
164
+
165
+ public SetInlineMathAllowDigitAfterOpenMarker(enable: boolean): void;
166
+
167
+ public SetToC(enable: boolean): void;
168
+
169
+ public SetFootnotes(enable: boolean): void;
170
+
171
+ public SetAutoSpace(enable: boolean): void;
172
+
173
+ public SetFixTermTypo(enable: boolean): void;
174
+
175
+ public SetEmojiSite(emojiSite: string): void;
176
+
177
+ public SetVditorCodeBlockPreview(enable: boolean): void;
178
+
179
+ public SetVditorMathBlockPreview(enable: boolean): void;
180
+
181
+ public PutEmojis(emojis: IObject): void;
182
+
183
+ public GetEmojis(): IObject;
184
+
185
+ public IsValidLinkDest(link: string): boolean;
186
+
187
+ // debugger md
188
+ public RenderEChartsJSON(text: string): string;
189
+
190
+ // md 转换为 html
191
+ public Md2HTML(markdown: string): string;
192
+
193
+ // 粘贴时将 html 转换为 md
194
+ public HTML2Md(html: string): string;
195
+
196
+ // wysiwyg 转换为 html
197
+ public VditorDOM2HTML(vhtml: string): string;
198
+
199
+ // wysiwyg 输入渲染
200
+ public SpinVditorDOM(html: string): string;
201
+
202
+ // 粘贴时将 html 转换为 wysiwyg
203
+ public HTML2VditorDOM(html: string): string;
204
+
205
+ // 将 wysiwyg 转换为 md
206
+ public VditorDOM2Md(html: string): string;
207
+
208
+ // 将 md 转换为 wysiwyg
209
+ public Md2VditorDOM(markdown: string): string;
210
+
211
+ // ir 输入渲染
212
+ public SpinVditorIRDOM(markdown: string): string;
213
+
214
+ // ir 获取 md
215
+ public VditorIRDOM2Md(html: string): string;
216
+
217
+ // md 转换为 ir
218
+ public Md2VditorIRDOM(text: string): string;
219
+
220
+ // 获取 HTML
221
+ public VditorIRDOM2HTML(html: string): string;
222
+
223
+ // 粘贴时将 html 转换为 sv
224
+ public HTML2VditorIRDOM(html: string): string;
225
+
226
+ // sv 输入渲染
227
+ public SpinVditorSVDOM(text: string): string;
228
+
229
+ // 粘贴是 md 转换为 sv
230
+ public Md2VditorSVDOM(text: string): string;
231
+
232
+ // 将markdown转化为JSON结构输出 https://github.com/88250/lute/issues/120
233
+ public RenderJSON(markdown: string): string;
234
+ }
235
+
236
+ declare const webkitAudioContext: {
237
+ prototype: AudioContext
238
+ new(contextOptions?: AudioContextOptions): AudioContext,
239
+ };
240
+
241
+ interface ITips {
242
+ [index: string]: string;
243
+
244
+ alignCenter: string;
245
+ alignLeft: string;
246
+ alignRight: string;
247
+ alternateText: string;
248
+ bold: string;
249
+ both: string;
250
+ check: string;
251
+ close: string;
252
+ code: string;
253
+ "code-theme": string;
254
+ column: string;
255
+ comment: string;
256
+ confirm: string;
257
+ "content-theme": string;
258
+ copied: string;
259
+ copy: string;
260
+ "delete-column": string;
261
+ "delete-row": string;
262
+ devtools: string;
263
+ down: string;
264
+ downloadTip: string;
265
+ edit: string;
266
+ "edit-mode": string;
267
+ emoji: string;
268
+ export: string;
269
+ fileTypeError: string;
270
+ footnoteRef: string;
271
+ fullscreen: string;
272
+ generate: string;
273
+ headings: string;
274
+ help: string;
275
+ imageURL: string;
276
+ indent: string;
277
+ info: string;
278
+ "inline-code": string;
279
+ "insert-after": string;
280
+ "insert-before": string;
281
+ insertColumnLeft: string;
282
+ insertColumnRight: string;
283
+ insertRowAbove: string;
284
+ insertRowBelow: string;
285
+ instantRendering: string;
286
+ italic: string;
287
+ language: string;
288
+ line: string;
289
+ link: string;
290
+ linkRef: string;
291
+ list: string;
292
+ more: string;
293
+ nameEmpty: string;
294
+ "ordered-list": string;
295
+ outdent: string;
296
+ outline: string;
297
+ over: string;
298
+ performanceTip: string;
299
+ preview: string;
300
+ quote: string;
301
+ record: string;
302
+ "record-tip": string;
303
+ recording: string;
304
+ redo: string;
305
+ remove: string;
306
+ row: string;
307
+ spin: string;
308
+ splitView: string;
309
+ strike: string;
310
+ table: string;
311
+ textIsNotEmpty: string;
312
+ title: string;
313
+ tooltipText: string;
314
+ undo: string;
315
+ up: string;
316
+ update: string;
317
+ upload: string;
318
+ uploadError: string;
319
+ uploading: string;
320
+ wysiwyg: string;
321
+ }
322
+
323
+ interface II18n {
324
+ en_US: ITips;
325
+ fr_FR: ITips;
326
+ ja_JP: ITips;
327
+ ko_KR: ITips;
328
+ ru_RU: ITips;
329
+ sv_SE: ITips;
330
+ zh_CN: ITips;
331
+ zh_TW: ITips;
332
+ pt_BR: ITips;
333
+ }
334
+
335
+ interface IClasses {
336
+ preview?: string;
337
+ }
338
+
339
+ interface IPreviewTheme {
340
+ current: string;
341
+ list?: IObject;
342
+ path?: string;
343
+ }
344
+
345
+ /** @link https://ld246.com/article/1549638745630#options-upload */
346
+ interface IUpload {
347
+ /** 上传 url */
348
+ url?: string;
349
+ /** 上传文件最大 Byte */
350
+ max?: number;
351
+ /** 剪切板中包含图片地址时,使用此 url 重新上传 */
352
+ linkToImgUrl?: string;
353
+ /** CORS 上传验证,头为 X-Upload-Token */
354
+ token?: string;
355
+ /** 文件上传类型,同 [input accept](https://www.w3schools.com/tags/att_input_accept.asp) */
356
+ accept?: string;
357
+ /** 跨站点访问控制。默认值: false */
358
+ withCredentials?: boolean;
359
+ /** 请求头设置 */
360
+ headers?: IObject;
361
+ /** 额外请求参数 */
362
+ extraData?: { [key: string]: string | Blob };
363
+ /** 是否允许多文件上传。默认值:true */
364
+ multiple?: boolean;
365
+ /** 上传字段名。默认值:file[] */
366
+ fieldName?: string;
367
+
368
+ /** 每次上传前都会重新设置请求头 */
369
+ setHeaders?(): IObject;
370
+
371
+ /** 上传成功回调 */
372
+ success?(editor: HTMLPreElement, msg: string): void;
373
+
374
+ /** 上传失败回调 */
375
+ error?(msg: string): void;
376
+
377
+ /** 文件名安全处理。 默认值: name => name.replace(/\W/g, '') */
378
+ filename?(name: string): string;
379
+
380
+ /** 校验,成功时返回 true 否则返回错误信息 */
381
+ validate?(files: File[]): string | boolean;
382
+
383
+ /** 自定义上传,当发生错误时返回错误信息 */
384
+ handler?(files: File[]): string | null | Promise<string> | Promise<null>;
385
+
386
+ /** 对服务端返回的数据进行转换,以满足内置的数据结构 */
387
+ format?(files: File[], responseText: string): string;
388
+
389
+ /** 对服务端返回的数据进行转换(对应linkToImgUrl),以满足内置的数据结构 */
390
+ linkToImgFormat?(responseText: string): string;
391
+
392
+ /** 将上传的文件处理后再返回 */
393
+ file?(files: File[]): File[] | Promise<File[]>;
394
+
395
+ /** 图片地址上传后的回调 */
396
+ linkToImgCallback?(responseText: string): void;
397
+ }
398
+
399
+ /** @link https://ld246.com/article/1549638745630#options-toolbar */
400
+ interface IMenuItem {
401
+ /** 唯一标示 */
402
+ name: string;
403
+ /** svg 图标 HTML */
404
+ icon?: string;
405
+ /** 元素的样式名称 */
406
+ className?: string;
407
+ /** 提示 */
408
+ tip?: string;
409
+ /** 快捷键,支持⌘/ctrl-key 或 ⌘/ctrl-⇧/shift-key 格式的配置,不支持 wysiwyg 模式 */
410
+ hotkey?: string;
411
+ /** 插入编辑器中的后缀 */
412
+ suffix?: string;
413
+ /** 插入编辑器中的前缀 */
414
+ prefix?: string;
415
+ /** 提示位置:ne, nw */
416
+ tipPosition?: string;
417
+ /** 子菜单 */
418
+ toolbar?: Array<string | IMenuItem>;
419
+ /** 菜单层级,最大为 3,内部使用 */
420
+ level?: number;
421
+
422
+ /** 自定义按钮点击时触发的事件 */
423
+ click?(event: Event, vditor: IVditor): void;
424
+ }
425
+
426
+ /** @link https://ld246.com/article/1549638745630#options-preview-hljs */
427
+ interface IHljs {
428
+ /** 代码块没有指定语言时,使用此值。默认值: "" */
429
+ defaultLang?: string;
430
+ /** 是否启用行号。默认值: false */
431
+ lineNumber?: boolean;
432
+ /** 代码风格,可选值参见 [Chroma](https://xyproto.github.io/splash/docs/longer/all.html)。 默认值: 'github' */
433
+ style?: string;
434
+ /** 是否启用代码高亮。默认值: true */
435
+ enable?: boolean;
436
+ /** 自定义指定语言: CODE_LANGUAGES */
437
+ langs?: string[];
438
+
439
+ /** 渲染右上角菜单按钮 */
440
+ renderMenu?(element: HTMLElement, menuElement: HTMLElement): void;
441
+ }
442
+
443
+ /** @link https://ld246.com/article/1549638745630#options-preview-math */
444
+ interface IMath {
445
+ /** 内联数学公式起始 $ 后是否允许数字。默认值: false */
446
+ inlineDigit?: boolean;
447
+ /** 使用 MathJax 渲染时传入的宏定义。默认值: {} */
448
+ macros?: object;
449
+ /** 数学公式渲染引擎。默认值: 'KaTeX' */
450
+ engine?: "KaTeX" | "MathJax";
451
+ /** 数学公式渲染引擎为 MathJax 时传入的参数 */
452
+ mathJaxOptions?: any;
453
+ }
454
+
455
+ /** @link https://ld246.com/article/1549638745630#options-preview-markdown */
456
+ interface IMarkdownConfig {
457
+ /** 自动空格。默认值: false */
458
+ autoSpace?: boolean;
459
+ /** 段落开头是否空两格。默认值: false */
460
+ paragraphBeginningSpace?: boolean;
461
+ /** 自动矫正术语。默认值: false */
462
+ fixTermTypo?: boolean;
463
+ /** 插入目录。默认值: false */
464
+ toc?: boolean;
465
+ /** 脚注。默认值: true */
466
+ footnotes?: boolean;
467
+ /** wysiwyg & ir 模式代码块是否渲染。默认值: true */
468
+ codeBlockPreview?: boolean;
469
+ /** wysiwyg & ir 模式数学公式块是否渲染。默认值: true */
470
+ mathBlockPreview?: boolean;
471
+ /** 是否启用过滤 XSS。默认值: true */
472
+ sanitize?: boolean;
473
+ /** 链接相对路径前缀。默认值:'' */
474
+ linkBase?: string;
475
+ /** 链接强制前缀。默认值:'' */
476
+ linkPrefix?: string;
477
+ /** 为列表添加标记,以便[自定义列表样式](https://github.com/Vanessa219/vditor/issues/390) 默认值:false */
478
+ listStyle?: boolean;
479
+ /** 支持 mark 标记 */
480
+ mark?: boolean;
481
+ /** 支持自动链接 */
482
+ gfmAutoLink?: boolean;
483
+ }
484
+
485
+ /** @link https://ld246.com/article/1549638745630#options-preview */
486
+ interface IPreview {
487
+ /** 预览 debounce 毫秒间隔。默认值: 1000 */
488
+ delay?: number;
489
+ /** 预览区域最大宽度。默认值: 768 */
490
+ maxWidth?: number;
491
+ /** 显示模式。默认值: 'both' */
492
+ mode?: "both" | "editor";
493
+ /** md 解析请求 */
494
+ url?: string;
495
+ /** @link https://ld246.com/article/1549638745630#options-preview-hljs */
496
+ hljs?: IHljs;
497
+ /** @link https://ld246.com/article/1549638745630#options-preview-math */
498
+ math?: IMath;
499
+ /** @link https://ld246.com/article/1549638745630#options-preview-markdown */
500
+ markdown?: IMarkdownConfig;
501
+ /** @link https://ld246.com/article/1549638745630#options-preview-theme */
502
+ theme?: IPreviewTheme;
503
+ /** @link https://ld246.com/article/1549638745630#options-preview-actions */
504
+ actions?: Array<IPreviewAction | IPreviewActionCustom>;
505
+ render?: IPreviewRender
506
+ /** 预览回调 */
507
+ parse?(element: HTMLElement): void;
508
+
509
+ /** 渲染之前回调 */
510
+ transform?(html: string): string;
511
+ }
512
+
513
+ interface IPreviewRender {
514
+ media?: {
515
+ enable?: boolean;
516
+ }
517
+ }
518
+
519
+ type IPreviewAction = "desktop" | "tablet" | "mobile" | "mp-wechat" | "zhihu";
520
+
521
+ interface IPreviewActionCustom {
522
+ /** 键名 */
523
+ key: string;
524
+ /** 按钮文本 */
525
+ text: string;
526
+ /** 按钮 className 值 */
527
+ className?: string;
528
+ /** 按钮提示信息 */
529
+ tooltip?: string;
530
+ /** 点击回调 */
531
+ click: (key: string) => void;
532
+ }
533
+
534
+ interface IPreviewOptions {
535
+ mode: "dark" | "light";
536
+ customEmoji?: IObject;
537
+ lang?: (keyof II18n);
538
+ i18n?: ITips;
539
+ lazyLoadImage?: string;
540
+ emojiPath?: string;
541
+ hljs?: IHljs;
542
+ speech?: {
543
+ enable?: boolean,
544
+ };
545
+ anchor?: number; // 0: no render, 1: render left, 2: render right
546
+ math?: IMath;
547
+ cdn?: string;
548
+ markdown?: IMarkdownConfig;
549
+ renderers?: ILuteRender;
550
+ theme?: IPreviewTheme;
551
+ icon?: "ant" | "material" | undefined;
552
+ render?: IPreviewRender
553
+
554
+ transform?(html: string): string;
555
+
556
+ after?(): void;
557
+ }
558
+
559
+ interface IHintData {
560
+ html: string;
561
+ value: string;
562
+ }
563
+
564
+ interface IHintExtend {
565
+ key: string;
566
+
567
+ hint?(value: string): IHintData[] | Promise<IHintData[]>;
568
+ }
569
+
570
+ /** @link https://ld246.com/article/1549638745630#options-hint */
571
+ interface IHint {
572
+ /** 提示内容是否进行 md 解析 */
573
+ parse?: boolean;
574
+ /** 常用表情提示 HTML */
575
+ emojiTail?: string;
576
+ /** 提示 debounce 毫秒间隔。默认值: 200 */
577
+ delay?: number;
578
+ /** 默认表情,可从 [lute/emoji_map](https://github.com/88250/lute/blob/master/parse/emoji_map.go#L32) 中选取,也可自定义 */
579
+ emoji?: IObject;
580
+ /** 表情图片地址。默认值: 'https://unpkg.com/vditor@${VDITOR_VERSION}/dist/images/emoji' */
581
+ emojiPath?: string;
582
+ extend?: IHintExtend[];
583
+ }
584
+
585
+ /** @link https://ld246.com/article/1549638745630#options-toolbarConfig */
586
+ interface IToolbarConfig {
587
+ /** 是否隐藏工具栏。默认值: false */
588
+ hide?: boolean;
589
+ /** 是否固定工具栏。默认值: false */
590
+ pin?: boolean;
591
+ }
592
+
593
+ /** @link https://ld246.com/article/1549638745630#options-comment */
594
+ interface IComment {
595
+ /** 是否启用评论模式。默认值: false */
596
+ enable: boolean;
597
+
598
+ /** 添加评论回调 */
599
+ add?(id: string, text: string, commentsData: ICommentsData[]): void;
600
+
601
+ /** 删除评论回调 */
602
+ remove?(ids: string[]): void;
603
+
604
+ /** 滚动回调 */
605
+ scroll?(top: number): void;
606
+
607
+ /** 文档修改时,适配评论高度 */
608
+ adjustTop?(commentsData: ICommentsData[]): void;
609
+ }
610
+
611
+ /** @link https://ld246.com/article/1549638745630#options-outline */
612
+ interface IOutline {
613
+ /** 初始化是否展现大纲。默认值: false */
614
+ enable: boolean;
615
+ /** 大纲位置:'left', 'right'。默认值: 'left' */
616
+ position: "left" | "right";
617
+ }
618
+
619
+ interface IResize {
620
+ position?: string;
621
+ enable?: boolean;
622
+
623
+ after?(height: number): void;
624
+ }
625
+
626
+ /** @link https://ld246.com/article/1549638745630#options */
627
+ interface IOptions {
628
+ /** RTL */
629
+ rtl?: boolean;
630
+ /** 历史记录间隔 */
631
+ undoDelay?: number;
632
+ /** 内部调试时使用 */
633
+ _lutePath?: string;
634
+ /** 编辑器初始化值。默认值: '' */
635
+ value?: string;
636
+ /** 是否显示日志。默认值: false */
637
+ debugger?: boolean;
638
+ /** 是否启用打字机模式。默认值: false */
639
+ typewriterMode?: boolean;
640
+ /** 编辑器总高度。默认值: 'auto' */
641
+ height?: number | string;
642
+ /** 编辑器最小高度 */
643
+ minHeight?: number;
644
+ /** 编辑器总宽度,支持 %。默认值: 'auto' */
645
+ width?: number | string;
646
+ /** 输入区域为空时的提示。默认值: '' */
647
+ placeholder?: string;
648
+ /** 多语言。默认值: 'zh_CN' */
649
+ lang?: (keyof II18n);
650
+ /** 国际化, 自定义语言。优先级低于lang */
651
+ i18n?: ITips;
652
+ /** @link https://ld246.com/article/1549638745630#options-fullscreen */
653
+ fullscreen?: {
654
+ /** 全屏层级。默认值: 90 */
655
+ index: number;
656
+ };
657
+ /** @link https://ld246.com/article/1549638745630#options-toolbar */
658
+ toolbar?: Array<string | IMenuItem>;
659
+ /** @link https://ld246.com/article/1549638745630#options-resize */
660
+ resize?: IResize;
661
+ /** @link https://ld246.com/article/1549638745630#options-counter */
662
+ counter?: {
663
+ /** 是否启用计数器。默认值: false */
664
+ enable: boolean;
665
+ /** 允许输入的最大值 */
666
+ max?: number;
667
+ /** 统计类型。默认值: 'markdown' */
668
+ type?: "markdown" | "text";
669
+ /** 字数统计回调。 */
670
+ after?(length: number, counter: {
671
+ /** 是否启用计数器。默认值: false */
672
+ enable: boolean;
673
+ /** 允许输入的最大值 */
674
+ max?: number;
675
+ /** 统计类型。默认值: 'markdown' */
676
+ type?: "markdown" | "text"
677
+ }): void
678
+ };
679
+ /** @link https://ld246.com/article/1549638745630#options-cache */
680
+ cache?: {
681
+ /** 缓存 key,第一个参数为元素且启用缓存时必填 */
682
+ id?: string;
683
+ /** 是否使用 localStorage 进行缓存。默认值: true */
684
+ enable?: boolean;
685
+ /** 缓存后的回调 */
686
+ after?(markdown: string): void;
687
+ };
688
+ /** 编辑模式。默认值: 'wysiwyg'
689
+ *
690
+ * wysiwyg: 所见即所得
691
+ *
692
+ * ir: 即时渲染
693
+ *
694
+ * sv: 分屏预览
695
+ */
696
+ mode?: "wysiwyg" | "sv" | "ir";
697
+ /** @link https://ld246.com/article/1549638745630#options-preview */
698
+ preview?: IPreview;
699
+ /** @link https://ld246.com/article/1549638745630#options-link */
700
+ link?: {
701
+ /** 是否打开链接地址。默认值: true */
702
+ isOpen?: boolean;
703
+ /** 点击链接事件 */
704
+ click?: (bom: Element) => void;
705
+ },
706
+ /** @link https://ld246.com/article/1549638745630#options-image */
707
+ image?: {
708
+ /** 是否预览图片。默认值: true */
709
+ isPreview?: boolean;
710
+ /** 图片预览处理 */
711
+ preview?: (bom: Element) => void;
712
+ },
713
+ /** @link https://ld246.com/article/1549638745630#options-hint */
714
+ hint?: IHint;
715
+ /** @link https://ld246.com/article/1549638745630#options-toolbarConfig */
716
+ toolbarConfig?: IToolbarConfig;
717
+ /** 评论
718
+ * @link https://ld246.com/article/1549638745630#options-comment
719
+ */
720
+ comment?: IComment;
721
+ /** 主题。默认值: 'classic' */
722
+ theme?: "classic" | "dark";
723
+ /** 图标。默认值: 'ant' */
724
+ icon?: "ant" | "material";
725
+ /** @link https://ld246.com/article/1549638745630#options-upload */
726
+ upload?: IUpload;
727
+ /** @link https://ld246.com/article/1549638745630#options-classes */
728
+ classes?: IClasses;
729
+ /** 配置自建 CDN 地址。默认值: 'https://unpkg.com/vditor@${VDITOR_VERSION}' */
730
+ cdn?: string;
731
+ /** tab 键操作字符串,支持 \t 及任意字符串 */
732
+ tab?: string;
733
+ /** @link https://ld246.com/article/1549638745630#options-outline */
734
+ outline?: IOutline;
735
+ customRenders?: {
736
+ language: string,
737
+ render: (element: HTMLElement, vditor: IVditor) => void
738
+ }[],
739
+
740
+ /** 编辑器异步渲染完成后的回调方法 */
741
+ after?(): void;
742
+
743
+ /** 输入后触发 */
744
+ input?(value: string): void;
745
+
746
+ /** 聚焦后触发 */
747
+ focus?(value: string): void;
748
+
749
+ /** 失焦后触发 */
750
+ blur?(value: string): void;
751
+
752
+ /** 按下键盘触发 */
753
+ keydown?(event: KeyboardEvent): void;
754
+
755
+ /** `esc` 按下后触发 */
756
+ esc?(value: string): void;
757
+
758
+ /** `⌘/ctrl+enter` 按下后触发 */
759
+ ctrlEnter?(value: string): void;
760
+
761
+ /** 编辑器中选中文字后触发 */
762
+ select?(value: string): void;
763
+ }
764
+
765
+ interface IEChart {
766
+ setOption(option: any): void;
767
+
768
+ resize(): void;
769
+ }
770
+
771
+ interface IVditor {
772
+ element: HTMLElement;
773
+ options: IOptions;
774
+ originalInnerHTML: string;
775
+ lute: Lute;
776
+ currentMode: "sv" | "wysiwyg" | "ir";
777
+ devtools?: {
778
+ element: HTMLDivElement,
779
+ renderEchart(vditor: IVditor): void,
780
+ };
781
+ outline: {
782
+ element: HTMLElement,
783
+ render(vditor: IVditor): string,
784
+ toggle(vditor: IVditor, show?: boolean, focus?: boolean): void,
785
+ };
786
+ toolbar?: {
787
+ elements?: { [key: string]: HTMLElement },
788
+ element?: HTMLElement,
789
+ };
790
+ preview?: {
791
+ element: HTMLElement,
792
+ previewElement: HTMLElement,
793
+ render(vditor: IVditor, value?: string): void,
794
+ };
795
+ counter?: {
796
+ element: HTMLElement
797
+ render(vditor: IVditor, mdText?: string): void,
798
+ };
799
+ resize?: {
800
+ element: HTMLElement,
801
+ };
802
+ hint: {
803
+ timeId: number
804
+ element: HTMLDivElement
805
+ recentLanguage: string
806
+ fillEmoji(element: HTMLElement, vditor: IVditor): void
807
+ render(vditor: IVditor): void,
808
+ genHTML(data: IHintData[], key: string, vditor: IVditor): void
809
+ select(event: KeyboardEvent, vditor: IVditor): boolean,
810
+ };
811
+ tip: {
812
+ element: HTMLElement
813
+ show(text: string, time?: number): void
814
+ hide(): void,
815
+ };
816
+ upload?: {
817
+ element: HTMLElement
818
+ isUploading: boolean
819
+ range: Range,
820
+ };
821
+ undo?: {
822
+ clearStack(vditor: IVditor): void,
823
+ redo(vditor: IVditor): void
824
+ undo(vditor: IVditor): void
825
+ addToUndoStack(vditor: IVditor): void
826
+ recordFirstPosition(vditor: IVditor, event: KeyboardEvent): void,
827
+ resetIcon(vditor: IVditor): void,
828
+ };
829
+ wysiwyg?: {
830
+ range: Range,
831
+ element: HTMLPreElement,
832
+ selectPopover: HTMLDivElement,
833
+ popover: HTMLDivElement,
834
+ afterRenderTimeoutId: number,
835
+ hlToolbarTimeoutId: number,
836
+ preventInput: boolean,
837
+ composingLock: boolean,
838
+ commentIds: string[]
839
+ getComments(vditor: IVditor, getData?: boolean): ICommentsData[],
840
+ triggerRemoveComment(vditor: IVditor): void,
841
+ showComment(): void,
842
+ hideComment(): void,
843
+ unbindListener(): void,
844
+ };
845
+ ir?: {
846
+ range: Range,
847
+ element: HTMLPreElement,
848
+ composingLock: boolean,
849
+ preventInput: boolean,
850
+ processTimeoutId: number,
851
+ hlToolbarTimeoutId: number,
852
+ };
853
+ sv?: {
854
+ range: Range,
855
+ element: HTMLPreElement,
856
+ processTimeoutId: number,
857
+ hlToolbarTimeoutId: number,
858
+ composingLock: boolean,
859
+ preventInput: boolean,
860
+ };
861
+ }
862
+
863
+ interface ICommentsData {
864
+ id: string;
865
+ top: number;
866
+ }