vditor 3.8.12 → 3.8.15
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 +2 -2
- package/dist/index.css +1807 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.min.js +1 -1
- package/dist/js/highlight.js/solidity.min.js +73 -0
- package/dist/js/highlight.js/yul.min.js +30 -0
- package/dist/js/lute/lute.min.js +47 -47
- package/dist/method.min.js +1 -1
- package/dist/types/index.d.ts +2 -0
- package/package.json +14 -7
- package/src/assets/{scss/_content.scss → less/_content.less} +8 -9
- package/src/assets/{scss/_hint.scss → less/_hint.less} +0 -0
- package/src/assets/{scss/_ir.scss → less/_ir.less} +4 -4
- package/src/assets/{scss/_panel.scss → less/_panel.less} +4 -4
- package/src/assets/{scss/_reset.scss → less/_reset.less} +13 -13
- package/src/assets/{scss/_sv.scss → less/_sv.less} +1 -2
- package/src/assets/{scss/_toolbar.scss → less/_toolbar.less} +3 -3
- package/src/assets/{scss/_tooltipped.scss → less/_tooltipped.less} +15 -15
- package/src/assets/{scss/_wysiwyg.scss → less/_wysiwyg.less} +3 -3
- package/src/assets/{scss/index.scss → less/index.less} +27 -22
- package/src/index.ts +6 -3
- package/src/ts/constants.ts +59 -56
- package/src/ts/ir/index.ts +5 -0
- package/src/ts/markdown/highlightRender.ts +65 -61
- package/src/ts/sv/index.ts +6 -0
- package/src/ts/tip/index.ts +13 -5
- package/src/ts/toolbar/Info.ts +1 -1
- package/src/ts/ui/initUI.ts +159 -151
- package/src/ts/ui/setContentTheme.ts +1 -1
- package/src/ts/upload/index.ts +3 -0
- package/src/ts/util/Options.ts +5 -0
- package/src/ts/util/editorCommonEvent.ts +2 -2
- package/src/ts/util/fixBrowserBehavior.ts +30 -2
- package/src/ts/wysiwyg/highlightToolbarWYSIWYG.ts +4 -0
- package/src/ts/wysiwyg/index.ts +2 -0
package/dist/method.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Vditor=t():e.Vditor=t()}(this,(function(){return(()=>{"use strict";var e={260:(e,t,r)=>{r.d(t,{g:()=>n});var n=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],e.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica"],e.CDN="https://cdn.jsdelivr.net/npm/vditor@3.8.12",e.MARKDOWN_OPTIONS={autoSpace:!1,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:e.CDN+"/dist/css/content-theme"},e}()},369:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var r=a.abcRenderAdapter.getElements(e);r.length>0&&(0,i.G)(t+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then((function(){r.forEach((function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,a.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))}))}))}},46:(e,t,r)=>{r.r(t),r.d(t,{mathRenderAdapter:()=>n,mermaidRenderAdapter:()=>i,mindmapRenderAdapter:()=>a,chartRenderAdapter:()=>o,abcRenderAdapter:()=>s,graphvizRenderAdapter:()=>l,flowchartRenderAdapter:()=>c,plantumlRenderAdapter:()=>d});var n={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},o={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},l={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},726:(e,t,r)=>{r.d(t,{p:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t,r){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var o=a.chartRenderAdapter.getElements(e);o.length>0&&(0,i.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.chartRenderAdapter.getCode(e).trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var n=JSON.parse(t);echarts.init(e,"dark"===r?"dark":void 0).setOption(n),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>"+t}}}))}))}},23:(e,t,r)=>{r.d(t,{O:()=>i});var n=r(769),i=function(e){e.querySelectorAll("pre > code").forEach((function(t,r){var i,a,o;if(!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&r>5)){var s=t.innerText;if(t.classList.contains("highlight-chroma")){var l=document.createElement("code");l.innerHTML=t.innerHTML,l.querySelectorAll(".highlight-ln").forEach((function(e){e.remove()})),s=l.innerText}var c='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(c='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var d=document.createElement("div");d.className="vditor-copy",d.innerHTML='<span aria-label="'+((null===(i=window.VditorI18n)||void 0===i?void 0:i.copy)||"复制")+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+((null===(a=window.VditorI18n)||void 0===a?void 0:a.copy)||"复制")+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+((null===(o=window.VditorI18n)||void 0===o?void 0:o.copy)||"已复制")+"')\">"+c+"</span>";var m=document.createElement("textarea");m.value=(0,n.X)(s),d.insertAdjacentElement("afterbegin",m),t.before(d),t.style.maxHeight=window.outerHeight-40+"px"}}))}},383:(e,t,r)=>{r.d(t,{P:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t){void 0===t&&(t=n.g.CDN);var r=a.flowchartRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then((function(){r.forEach((function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(a.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}}))}))}},890:(e,t,r)=>{r.d(t,{v:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t){void 0===t&&(t=n.g.CDN);var r=a.graphvizRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then((function(){r.forEach((function(e){var t=a.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var r=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),n=(window.URL||window.webkitURL).createObjectURL(r),i=new Worker(n);new Viz({worker:i}).renderSVGElement(t).then((function(t){e.innerHTML=t.outerHTML})).catch((function(t){e.innerHTML="graphviz render error: <br>"+t,e.className="vditor-reset--error"}))}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}}))}))}},93:(e,t,r)=>{r.d(t,{s:()=>o});var n=r(260),i=r(228),a=r(946),o=function(e,t,r){void 0===t&&(t=document),void 0===r&&(r=n.g.CDN);var o=e.style;n.g.CODE_THEME.includes(o)||(o="github");var s=document.getElementById("vditorHljsStyle"),l=r+"/dist/js/highlight.js/styles/"+o+".css";(s&&s.href!==l&&s.remove(),(0,a.c)(r+"/dist/js/highlight.js/styles/"+o+".css","vditorHljsStyle"),!1!==e.enable)&&(0!==t.querySelectorAll("pre > code").length&&(0,i.G)(r+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then((function(){t.querySelectorAll("pre > code").forEach((function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(hljs.highlightElement(t),e.lineNumber)){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var n=getComputedStyle(t).whiteSpace,i=!1;"pre-wrap"!==n&&"pre-line"!==n||(i=!0);var a="",o=t.textContent.split(/\r\n|\r|\n/g);o.pop(),o.map((function(e){var t="";i&&(r.textContent=e||"\n",t=' style="height:'+r.getBoundingClientRect().height+'px"'),a+="<span"+t+"></span>"})),r.style.display="none",a='<span class="vditor-linenumber__rows">'+a+"</span>",t.insertAdjacentHTML("beforeend",a)}}))})))}},323:(e,t,r)=>{r.d(t,{H:()=>l});var n=r(260),i=r(228),a=r(946),o=r(769),s=r(46),l=function(e,t){var r=s.mathRenderAdapter.getElements(e);if(0!==r.length){var l={cdn:n.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},l.math,t.math)),"KaTeX"===(t=Object.assign({},l,t)).math.engine)(0,a.c)(t.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,i.G)(t.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then((function(){(0,i.G)(t.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then((function(){r.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var t=(0,o.X)(s.mathRenderAdapter.getCode(e));e.setAttribute("data-math",t);try{e.innerHTML=katex.renderToString(t,{displayMode:"DIV"===e.tagName,output:"html"})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",(function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))}))}}))}))}));else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:t.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:t.math.macros}}),(0,i.J)(t.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var c=function(e,t){var r=(0,o.X)(e.textContent).trim(),n=window.MathJax.getMetricsFor(e);n.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(r,n).then((function(n){e.innerHTML="",e.setAttribute("data-math",r),e.append(n),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=n.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()}))};window.MathJax.startup.promise.then((function(){for(var e=[],t=function(t){var n=r[t];n.parentElement.classList.contains("vditor-wysiwyg__pre")||n.parentElement.classList.contains("vditor-ir__marker--pre")||n.getAttribute("data-math")||!(0,o.X)(n.textContent).trim()||e.push((function(e){t===r.length-1?c(n):c(n,e)}))},n=0;n<r.length;n++)t(n);!function(e){if(0!==e.length){var t=0,r=e[e.length-1],n=function(){var i=e[t++];i===r?i():i(n)};n()}}(e)}))}}}},207:(e,t,r)=>{r.d(t,{Y:()=>n});var n=function(e){e&&e.querySelectorAll("a").forEach((function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'+t+'"></video>'),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+t+'"></audio>'),e.remove()}(e,t):function(e,t){var r=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),n=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),o=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),l=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);r&&11===r[1].length?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+r[1]+(r[2]?"?start="+r[2]:"")+'"></iframe>'),e.remove()):n&&n[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+n[1]+'"></iframe>'),e.remove()):i&&i[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+i[1]+'"></iframe>'),e.remove()):a&&a[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+a[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove()):o&&o[0]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(o[0])+'"></iframe>'),e.remove()):s&&s[2]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove()):l&&l[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//player.bilibili.com/player.html?bvid='+l[1]+'"></iframe>'),e.remove()):c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+c[1]+'"></iframe>'),e.remove())}(e,t))}))}},765:(e,t,r)=>{r.d(t,{i:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t,r){void 0===t&&(t=n.g.CDN);var o=a.mermaidRenderAdapter.getElements(e);0!==o.length&&(0,i.G)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then((function(){var e={altFontFamily:"sans-serif",flowchart:{htmlLabels:!0,useMaxWidth:!0},fontFamily:"sans-serif",gantt:{leftPadding:75,rightPadding:20},securityLevel:"loose",sequence:{boxMargin:8,diagramMarginX:8,diagramMarginY:8,useMaxWidth:!0},startOnLoad:!1};"dark"===r&&(e.theme="dark",e.themeVariables={activationBkgColor:"hsl(180, 1.5873015873%, 28.3529411765%)",activationBorderColor:"#81B1DB",activeTaskBkgColor:"#81B1DB",activeTaskBorderColor:"#ffffff",actorBkg:"#1f2020",actorBorder:"#81B1DB",actorLineColor:"lightgrey",actorTextColor:"lightgrey",altBackground:"hsl(0, 0%, 40%)",altSectionBkgColor:"#333",arrowheadColor:"lightgrey",background:"#333",border1:"#81B1DB",border2:"rgba(255, 255, 255, 0.25)",classText:"#e0dfdf",clusterBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",clusterBorder:"rgba(255, 255, 255, 0.25)",critBkgColor:"#E83737",critBorderColor:"#E83737",darkTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",defaultLinkColor:"lightgrey",doneTaskBkgColor:"lightgrey",doneTaskBorderColor:"grey",edgeLabelBackground:"hsl(0, 0%, 34.4117647059%)",errorBkgColor:"#a44141",errorTextColor:"#ddd",fillType0:"#1f2020",fillType1:"hsl(180, 1.5873015873%, 28.3529411765%)",fillType2:"hsl(244, 1.5873015873%, 12.3529411765%)",fillType3:"hsl(244, 1.5873015873%, 28.3529411765%)",fillType4:"hsl(116, 1.5873015873%, 12.3529411765%)",fillType5:"hsl(116, 1.5873015873%, 28.3529411765%)",fillType6:"hsl(308, 1.5873015873%, 12.3529411765%)",fillType7:"hsl(308, 1.5873015873%, 28.3529411765%)",fontFamily:'"trebuchet ms", verdana, arial',fontSize:"16px",gridColor:"lightgrey",labelBackground:"#181818",labelBoxBkgColor:"#1f2020",labelBoxBorderColor:"#81B1DB",labelColor:"#ccc",labelTextColor:"lightgrey",lineColor:"lightgrey",loopTextColor:"lightgrey",mainBkg:"#1f2020",mainContrastColor:"lightgrey",nodeBkg:"#1f2020",nodeBorder:"#81B1DB",noteBkgColor:"#fff5ad",noteBorderColor:"rgba(255, 255, 255, 0.25)",noteTextColor:"#1f2020",primaryBorderColor:"hsl(180, 0%, 2.3529411765%)",primaryColor:"#1f2020",primaryTextColor:"#e0dfdf",secondBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryBorderColor:"hsl(180, 0%, 18.3529411765%)",secondaryColor:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryTextColor:"rgb(183.8476190475, 181.5523809523, 181.5523809523)",sectionBkgColor:"hsl(52.9411764706, 28.813559322%, 58.431372549%)",sectionBkgColor2:"#EAE8D9",sequenceNumberColor:"black",signalColor:"lightgrey",signalTextColor:"lightgrey",taskBkgColor:"hsl(180, 1.5873015873%, 35.3529411765%)",taskBorderColor:"#ffffff",taskTextClickableColor:"#003163",taskTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextDarkColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextLightColor:"lightgrey",taskTextOutsideColor:"lightgrey",tertiaryBorderColor:"hsl(20, 0%, 2.3529411765%)",tertiaryColor:"hsl(20, 1.5873015873%, 12.3529411765%)",tertiaryTextColor:"rgb(222.9999999999, 223.6666666666, 223.9999999999)",textColor:"#ccc",titleColor:"#F9FFFE",todayLineColor:"#DB5757"}),mermaid.initialize(e),o.forEach((function(e){var t=a.mermaidRenderAdapter.getCode(e);"true"!==e.getAttribute("data-processed")&&""!==t.trim()&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}))}))}},894:(e,t,r)=>{r.d(t,{P:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t,r){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var o=a.mindmapRenderAdapter.getElements(e);o.length>0&&(0,i.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===r?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var r;return(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>"+t}}}))}))}},198:(e,t,r)=>{r.d(t,{k:()=>a});var n=r(615),i=r(323),a=function(e,t,r){var a="",o=[];if(Array.from(e.children).forEach((function(e,t){if((0,n.W)(e)){if(r){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}o.push(e.id),a+=e.outerHTML.replace("<wbr>","")}})),""===a)return t.innerHTML="","";var s=document.createElement("div");if(r)r.lute.SetToC(!0),"wysiwyg"!==r.currentMode||r.preview.element.contains(e)?"ir"!==r.currentMode||r.preview.element.contains(e)?s.innerHTML=r.lute.HTML2VditorDOM("<p>[ToC]</p>"+a):s.innerHTML=r.lute.SpinVditorIRDOM("<p>[ToC]</p>"+a):s.innerHTML=r.lute.SpinVditorDOM("<p>[ToC]</p>"+a),r.lute.SetToC(r.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var l=Lute.New();l.SetToC(!0),s.innerHTML=l.HTML2VditorDOM("<p>[ToC]</p>"+a)}var c=s.firstElementChild.querySelectorAll("li > span[data-target-id]");return c.forEach((function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var r="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(r='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML=r+"<span>"+e.innerHTML+"</span>"}else e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>";e.setAttribute("data-target-id",o[t])})),a=s.firstElementChild.innerHTML,0===c.length?(t.innerHTML="",a):(t.innerHTML=a,r&&(0,i.H)(t,{cdn:r.options.cdn,math:r.options.preview.math}),t.firstElementChild.addEventListener("click",(function(n){for(var i=n.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),n.preventDefault(),n.stopPropagation();break}if(i.getAttribute("data-target-id")){n.preventDefault(),n.stopPropagation();var a=document.getElementById(i.getAttribute("data-target-id"));if(!a)return;if(r)if("auto"===r.options.height){var o=a.offsetTop+r.element.offsetTop;r.options.toolbarConfig.pin||(o+=r.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else r.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,r.element.offsetTop),r.preview.element.contains(e)?e.parentElement.scrollTop=a.offsetTop:e.scrollTop=a.offsetTop;else window.scrollTo(window.scrollX,a.offsetTop);break}i=i.parentElement}})),a)}},583:(e,t,r)=>{r.d(t,{B:()=>o});var n=r(260),i=r(228),a=r(46),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var r=a.plantumlRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then((function(){r.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(t)+'">'}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}}))}))}},792:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},264:(e,t,r)=>{r.d(t,{E:()=>n});var n=function(e,t,r){void 0===t&&(t="zh_CN"),void 0===r&&(r="classic");var n=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+("dark"===r?" vditor--dark":"")+'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n '+window.VditorI18n.spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X "+window.VditorI18n.close+'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: '+e.width+"px;height:"+e.height+"px;transform: translate3d("+n.left+"px, "+(n.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var i=document.querySelector(".vditor-img img"),a="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-e.naturalHeight)/2+"px, 0)";setTimeout((function(){i.setAttribute("style","transition: transform .3s ease-in-out;transform: "+a),setTimeout((function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)}),400)}));var o=document.querySelector(".vditor-img__btn");o.addEventListener("click",(function(){var t=parseInt(o.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>i.parentElement.clientHeight?i.style.transform="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+(e.naturalWidth/2-e.naturalHeight/2)+"px, 0) rotateZ("+t+"deg)":i.style.transform=a+" rotateZ("+t+"deg)",o.setAttribute("data-deg",t.toString()),setTimeout((function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)}),400)}))}},968:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(260),i=r(946),a=function(e,t){void 0===t&&(t=n.g.CDN),n.g.CODE_THEME.includes(e)||(e="github");var r=document.getElementById("vditorHljsStyle"),a=t+"/dist/js/highlight.js/styles/"+e+".css";r?r.href!==a&&(r.remove(),(0,i.c)(a,"vditorHljsStyle")):(0,i.c)(a,"vditorHljsStyle")}},958:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(946),i=function(e,t){if(e&&t){var r=document.getElementById("vditorContentTheme"),i=t+"/"+e+".css";r?r.href!==i&&(r.remove(),(0,n.c)(i,"vditorContentTheme")):(0,n.c)(i,"vditorContentTheme")}}},228:(e,t,r)=>{r.d(t,{J:()=>n,G:()=>i});var n=function(e,t){if(document.getElementById(t))return!1;var r=new XMLHttpRequest;r.open("GET",e,!1),r.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),r.send("");var n=document.createElement("script");n.type="text/javascript",n.text=r.responseText,n.id=t,document.head.appendChild(n)},i=function(e,t){return new Promise((function(r,n){if(document.getElementById(t))return r(),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onload=function(){if(document.getElementById(t))return i.remove(),r(),!1;i.id=t,r()}}))}},946:(e,t,r)=>{r.d(t,{c:()=>n});var n=function(e,t){if(!document.getElementById(t)){var r=document.createElement("link");r.id=t,r.rel="stylesheet",r.type="text/css",r.href=e,document.getElementsByTagName("head")[0].appendChild(r)}}},769:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){return e.replace(/\u00a0/g," ")}},713:(e,t,r)=>{r.d(t,{lG:()=>n,fb:()=>i});var n=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)r.nodeName===t?n=!0:r=r.parentElement;return n&&r},i=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)r.classList.contains(t)?n=!0:r=r.parentElement;return n&&r}},615:(e,t,r)=>{r.d(t,{W:()=>n});var n=function(e){var t=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)0===r.nodeName.indexOf(t)?n=!0:r=r.parentElement;return n&&r}(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},224:(e,t,r)=>{r.d(t,{T:()=>n});var n=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?r[t]=n(r[t],e[t]):r[t]=e[t])},a=0;a<e.length;a++)i(e[a]);return r}},187:(e,t,r)=>{r.d(t,{Hc:()=>n});r(260);var n=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.d(n,{default:()=>M});var e=r(369),t=r(46),i=r(726),a=r(23),o=r(383),s=r(890),l=r(93),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",(function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src})),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach((function(e){e.getAttribute("data-src")&&t(e)})),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)}))):(window.vditorImageIntersectionObserver=new IntersectionObserver((function(e){e.forEach((function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)}))})),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)})))},d=r(323),m=r(207),u=r(765),p=r(894),h=r(198),g=r(583),v=r(260),f=r(958),y=r(228),w=r(713),b=r(224),S=r(792),T=r(187),E=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',n='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',n='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");if(!i){(i=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",i);var a=function(){var e,r;return speechSynthesis.getVoices().forEach((function(n){n.lang===t.replace("_","-")&&(e=n),n.default&&(r=n)})),e||(e=r),e};void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=a);var o=a();i.onclick=function(){if("vditor-speech"===i.className){var e=new SpeechSynthesisUtterance(i.getAttribute("data-text"));e.voice=o,e.onend=function(){i.className="vditor-speech",speechSynthesis.cancel(),i.innerHTML=r},speechSynthesis.speak(e),i.className="vditor-speech vditor-speech--current",i.innerHTML=n}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=n):(speechSynthesis.pause(),i.innerHTML=r));(0,T.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",(function(){""===getSelection().toString().trim()&&"block"===i.style.display&&(i.className="vditor-speech",speechSynthesis.cancel(),i.style.display="none")}))}e.addEventListener("mouseup",(function(e){var t=getSelection().toString().trim();if(speechSynthesis.cancel(),""!==getSelection().toString().trim()){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var n=getSelection().getRangeAt(0).getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=n.top+n.height+document.querySelector("html").scrollTop-20+"px",i.style.left=e.screenX+2+"px",i.setAttribute("data-text",t)}else"block"===i.style.display&&(i.className="vditor-speech",i.style.display="none")}))}},k=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},L=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},C=function(e){var t={anchor:0,cdn:v.g.CDN,customEmoji:{},emojiPath:(e&&e.emojiPath||v.g.CDN)+"/dist/images/emoji",hljs:v.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:v.g.MARKDOWN_OPTIONS,math:v.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:v.g.THEME_OPTIONS};return(0,b.T)(t,e)},x=function(e,t){var r=C(t);return(0,y.G)(r.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then((function(){var n=(0,S.X)({autoSpace:r.markdown.autoSpace,codeBlockPreview:r.markdown.codeBlockPreview,emojiSite:r.emojiPath,emojis:r.customEmoji,fixTermTypo:r.markdown.fixTermTypo,footnotes:r.markdown.footnotes,headingAnchor:0!==r.anchor,inlineMathDigit:r.math.inlineDigit,lazyLoadImage:r.lazyLoadImage,linkBase:r.markdown.linkBase,linkPrefix:r.markdown.linkPrefix,listStyle:r.markdown.listStyle,mark:r.markdown.mark,mathBlockPreview:r.markdown.mathBlockPreview,paragraphBeginningSpace:r.markdown.paragraphBeginningSpace,sanitize:r.markdown.sanitize,toc:r.markdown.toc});return(null==t?void 0:t.renderers)&&n.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),n.SetHeadingID(!0),n.Md2HTML(e)}))},A=function(t,r,n){return k(void 0,void 0,void 0,(function(){var h,v,b;return L(this,(function(S){switch(S.label){case 0:return h=C(n),[4,x(r,h)];case 1:if(v=S.sent(),h.transform&&(v=h.transform(v)),t.innerHTML=v,t.classList.add("vditor-reset"),h.i18n)return[3,5];if(["en_US","ja_JP","ko_KR","ru_RU","zh_CN","zh_TW"].includes(h.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return b="vditorI18nScript"+h.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach((function(e){e.id!==b&&document.head.removeChild(e)})),[4,(0,y.G)(h.cdn+"/dist/js/i18n/"+h.lang+".js",b)];case 3:S.sent(),S.label=4;case 4:return[3,6];case 5:window.VditorI18n=h.i18n,S.label=6;case 6:return h.icon?[4,(0,y.G)(h.cdn+"/dist/js/icons/"+h.icon+".js","vditorIconScript")]:[3,8];case 7:S.sent(),S.label=8;case 8:return(0,f.Z)(h.theme.current,h.theme.path),1===h.anchor&&t.classList.add("vditor-reset--anchor"),(0,a.O)(t),(0,l.s)(h.hljs,t,h.cdn),(0,d.H)(t,{cdn:h.cdn,math:h.math}),(0,u.i)(t,h.cdn,h.mode),(0,o.P)(t,h.cdn),(0,s.v)(t,h.cdn),(0,i.p)(t,h.cdn,h.mode),(0,p.P)(t,h.cdn,h.mode),(0,g.B)(t,h.cdn),(0,e.Q)(t,h.cdn),(0,m.Y)(t),h.speech.enable&&E(t),0!==h.anchor&&(T=h.anchor,document.querySelectorAll(".vditor-anchor").forEach((function(e){1===T&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),r=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=r}})),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),h.after&&h.after(),h.lazyLoadImage&&c(t),t.addEventListener("click",(function(e){var r=(0,w.lG)(e.target,"SPAN");if(r&&(0,w.fb)(r,"vditor-toc")){var n=t.querySelector("#"+r.getAttribute("data-target-id"));n&&window.scrollTo(window.scrollX,n.offsetTop)}else;})),[2]}var T}))}))},_=r(264),j=r(968);const M=function(){function r(){}return r.adapterRender=t,r.previewImage=_.E,r.codeRender=a.O,r.graphvizRender=s.v,r.highlightRender=l.s,r.mathRender=d.H,r.mermaidRender=u.i,r.flowchartRender=o.P,r.chartRender=i.p,r.abcRender=e.Q,r.mindmapRender=p.P,r.plantumlRender=g.B,r.outlineRender=h.k,r.mediaRender=m.Y,r.speechRender=E,r.lazyLoadImageRender=c,r.md2html=x,r.preview=A,r.setCodeTheme=j.Y,r.setContentTheme=f.Z,r}()})(),n=n.default})()}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Vditor=t():e.Vditor=t()}(this,(function(){return(()=>{"use strict";var e={54:(e,t,r)=>{r.d(t,{g:()=>n});var n=function(){function e(){}return e.ZWSP="",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],e.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],e.CDN="https://unpkg.com/vditor@3.8.15",e.MARKDOWN_OPTIONS={autoSpace:!1,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:e.CDN+"/dist/css/content-theme"},e}()},478:(e,t,r)=>{r.d(t,{Q:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var r=a.abcRenderAdapter.getElements(e);r.length>0&&(0,i.G)(t+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then((function(){r.forEach((function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,a.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))}))}))}},156:(e,t,r)=>{r.r(t),r.d(t,{mathRenderAdapter:()=>n,mermaidRenderAdapter:()=>i,mindmapRenderAdapter:()=>a,chartRenderAdapter:()=>o,abcRenderAdapter:()=>s,graphvizRenderAdapter:()=>l,flowchartRenderAdapter:()=>c,plantumlRenderAdapter:()=>d});var n={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},o={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},l={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},314:(e,t,r)=>{r.d(t,{p:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t,r){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var o=a.chartRenderAdapter.getElements(e);o.length>0&&(0,i.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.chartRenderAdapter.getCode(e).trim();if(t)try{if("true"===e.getAttribute("data-processed"))return;var n=JSON.parse(t);echarts.init(e,"dark"===r?"dark":void 0).setOption(n),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>"+t}}}))}))}},730:(e,t,r)=>{r.d(t,{O:()=>i});var n=r(51),i=function(e){e.querySelectorAll("pre > code").forEach((function(t,r){var i,a,o;if(!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&r>5)){var s=t.innerText;if(t.classList.contains("highlight-chroma")){var l=document.createElement("code");l.innerHTML=t.innerHTML,l.querySelectorAll(".highlight-ln").forEach((function(e){e.remove()})),s=l.innerText}var c='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(c='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var d=document.createElement("div");d.className="vditor-copy",d.innerHTML='<span aria-label="'+((null===(i=window.VditorI18n)||void 0===i?void 0:i.copy)||"复制")+"\"\nonmouseover=\"this.setAttribute('aria-label', '"+((null===(a=window.VditorI18n)||void 0===a?void 0:a.copy)||"复制")+"')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '"+((null===(o=window.VditorI18n)||void 0===o?void 0:o.copy)||"已复制")+"')\">"+c+"</span>";var u=document.createElement("textarea");u.value=(0,n.X)(s),d.insertAdjacentElement("afterbegin",u),t.before(d),t.style.maxHeight=window.outerHeight-40+"px"}}))}},66:(e,t,r)=>{r.d(t,{P:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t){void 0===t&&(t=n.g.CDN);var r=a.flowchartRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then((function(){r.forEach((function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(a.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}}))}))}},218:(e,t,r)=>{r.d(t,{v:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t){void 0===t&&(t=n.g.CDN);var r=a.graphvizRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then((function(){r.forEach((function(e){var t=a.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var r=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),n=(window.URL||window.webkitURL).createObjectURL(r),i=new Worker(n);new Viz({worker:i}).renderSVGElement(t).then((function(t){e.innerHTML=t.outerHTML})).catch((function(t){e.innerHTML="graphviz render error: <br>"+t,e.className="vditor-reset--error"}))}catch(e){console.error("graphviz error",e)}e.setAttribute("data-processed","true")}}))}))}},702:(e,t,r)=>{r.d(t,{s:()=>o});var n=r(54),i=r(526),a=r(578),o=function(e,t,r){void 0===t&&(t=document),void 0===r&&(r=n.g.CDN);var o=e.style;n.g.CODE_THEME.includes(o)||(o="github");var s=document.getElementById("vditorHljsStyle"),l=r+"/dist/js/highlight.js/styles/"+o+".css";(s&&s.href!==l&&s.remove(),(0,a.c)(r+"/dist/js/highlight.js/styles/"+o+".css","vditorHljsStyle"),!1!==e.enable)&&(0!==t.querySelectorAll("pre > code").length&&(0,i.G)(r+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then((function(){(0,i.G)(r+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then((function(){(0,i.G)(r+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then((function(){t.querySelectorAll("pre > code").forEach((function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))&&(hljs.highlightElement(t),e.lineNumber)){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var n=getComputedStyle(t).whiteSpace,i=!1;"pre-wrap"!==n&&"pre-line"!==n||(i=!0);var a="",o=t.textContent.split(/\r\n|\r|\n/g);o.pop(),o.map((function(e){var t="";i&&(r.textContent=e||"\n",t=' style="height:'+r.getBoundingClientRect().height+'px"'),a+="<span"+t+"></span>"})),r.style.display="none",a='<span class="vditor-linenumber__rows">'+a+"</span>",t.insertAdjacentHTML("beforeend",a)}}))}))}))})))}},466:(e,t,r)=>{r.d(t,{H:()=>l});var n=r(54),i=r(526),a=r(578),o=r(51),s=r(156),l=function(e,t){var r=s.mathRenderAdapter.getElements(e);if(0!==r.length){var l={cdn:n.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},l.math,t.math)),"KaTeX"===(t=Object.assign({},l,t)).math.engine)(0,a.c)(t.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,i.G)(t.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then((function(){(0,i.G)(t.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then((function(){r.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var t=(0,o.X)(s.mathRenderAdapter.getCode(e));e.setAttribute("data-math",t);try{e.innerHTML=katex.renderToString(t,{displayMode:"DIV"===e.tagName,output:"html"})}catch(t){e.innerHTML=t.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",(function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))}))}}))}))}));else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:t.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:t.math.macros}}),(0,i.J)(t.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var c=function(e,t){var r=(0,o.X)(e.textContent).trim(),n=window.MathJax.getMetricsFor(e);n.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(r,n).then((function(n){e.innerHTML="",e.setAttribute("data-math",r),e.append(n),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=n.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()}))};window.MathJax.startup.promise.then((function(){for(var e=[],t=function(t){var n=r[t];n.parentElement.classList.contains("vditor-wysiwyg__pre")||n.parentElement.classList.contains("vditor-ir__marker--pre")||n.getAttribute("data-math")||!(0,o.X)(n.textContent).trim()||e.push((function(e){t===r.length-1?c(n):c(n,e)}))},n=0;n<r.length;n++)t(n);!function(e){if(0!==e.length){var t=0,r=e[e.length-1],n=function(){var i=e[t++];i===r?i():i(n)};n()}}(e)}))}}}},554:(e,t,r)=>{r.d(t,{Y:()=>n});var n=function(e){e&&e.querySelectorAll("a").forEach((function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'+t+'"></video>'),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+t+'"></audio>'),e.remove()}(e,t):function(e,t){var r=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),n=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),i=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),a=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),o=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),s=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),l=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);r&&11===r[1].length?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+r[1]+(r[2]?"?start="+r[2]:"")+'"></iframe>'),e.remove()):n&&n[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+n[1]+'"></iframe>'),e.remove()):i&&i[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+i[1]+'"></iframe>'),e.remove()):a&&a[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'+a[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),e.remove()):o&&o[0]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='+encodeURIComponent(o[0])+'"></iframe>'),e.remove()):s&&s[2]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'+s[2]+'"></iframe>'),e.remove()):l&&l[1]?(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//player.bilibili.com/player.html?bvid='+l[1]+'"></iframe>'),e.remove()):c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+c[1]+'"></iframe>'),e.remove())}(e,t))}))}},40:(e,t,r)=>{r.d(t,{i:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t,r){void 0===t&&(t=n.g.CDN);var o=a.mermaidRenderAdapter.getElements(e);0!==o.length&&(0,i.G)(t+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then((function(){var e={altFontFamily:"sans-serif",flowchart:{htmlLabels:!0,useMaxWidth:!0},fontFamily:"sans-serif",gantt:{leftPadding:75,rightPadding:20},securityLevel:"loose",sequence:{boxMargin:8,diagramMarginX:8,diagramMarginY:8,useMaxWidth:!0},startOnLoad:!1};"dark"===r&&(e.theme="dark",e.themeVariables={activationBkgColor:"hsl(180, 1.5873015873%, 28.3529411765%)",activationBorderColor:"#81B1DB",activeTaskBkgColor:"#81B1DB",activeTaskBorderColor:"#ffffff",actorBkg:"#1f2020",actorBorder:"#81B1DB",actorLineColor:"lightgrey",actorTextColor:"lightgrey",altBackground:"hsl(0, 0%, 40%)",altSectionBkgColor:"#333",arrowheadColor:"lightgrey",background:"#333",border1:"#81B1DB",border2:"rgba(255, 255, 255, 0.25)",classText:"#e0dfdf",clusterBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",clusterBorder:"rgba(255, 255, 255, 0.25)",critBkgColor:"#E83737",critBorderColor:"#E83737",darkTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",defaultLinkColor:"lightgrey",doneTaskBkgColor:"lightgrey",doneTaskBorderColor:"grey",edgeLabelBackground:"hsl(0, 0%, 34.4117647059%)",errorBkgColor:"#a44141",errorTextColor:"#ddd",fillType0:"#1f2020",fillType1:"hsl(180, 1.5873015873%, 28.3529411765%)",fillType2:"hsl(244, 1.5873015873%, 12.3529411765%)",fillType3:"hsl(244, 1.5873015873%, 28.3529411765%)",fillType4:"hsl(116, 1.5873015873%, 12.3529411765%)",fillType5:"hsl(116, 1.5873015873%, 28.3529411765%)",fillType6:"hsl(308, 1.5873015873%, 12.3529411765%)",fillType7:"hsl(308, 1.5873015873%, 28.3529411765%)",fontFamily:'"trebuchet ms", verdana, arial',fontSize:"16px",gridColor:"lightgrey",labelBackground:"#181818",labelBoxBkgColor:"#1f2020",labelBoxBorderColor:"#81B1DB",labelColor:"#ccc",labelTextColor:"lightgrey",lineColor:"lightgrey",loopTextColor:"lightgrey",mainBkg:"#1f2020",mainContrastColor:"lightgrey",nodeBkg:"#1f2020",nodeBorder:"#81B1DB",noteBkgColor:"#fff5ad",noteBorderColor:"rgba(255, 255, 255, 0.25)",noteTextColor:"#1f2020",primaryBorderColor:"hsl(180, 0%, 2.3529411765%)",primaryColor:"#1f2020",primaryTextColor:"#e0dfdf",secondBkg:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryBorderColor:"hsl(180, 0%, 18.3529411765%)",secondaryColor:"hsl(180, 1.5873015873%, 28.3529411765%)",secondaryTextColor:"rgb(183.8476190475, 181.5523809523, 181.5523809523)",sectionBkgColor:"hsl(52.9411764706, 28.813559322%, 58.431372549%)",sectionBkgColor2:"#EAE8D9",sequenceNumberColor:"black",signalColor:"lightgrey",signalTextColor:"lightgrey",taskBkgColor:"hsl(180, 1.5873015873%, 35.3529411765%)",taskBorderColor:"#ffffff",taskTextClickableColor:"#003163",taskTextColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextDarkColor:"hsl(28.5714285714, 17.3553719008%, 86.2745098039%)",taskTextLightColor:"lightgrey",taskTextOutsideColor:"lightgrey",tertiaryBorderColor:"hsl(20, 0%, 2.3529411765%)",tertiaryColor:"hsl(20, 1.5873015873%, 12.3529411765%)",tertiaryTextColor:"rgb(222.9999999999, 223.6666666666, 223.9999999999)",textColor:"#ccc",titleColor:"#F9FFFE",todayLineColor:"#DB5757"}),mermaid.initialize(e),o.forEach((function(e){var t=a.mermaidRenderAdapter.getCode(e);"true"!==e.getAttribute("data-processed")&&""!==t.trim()&&(mermaid.init(void 0,e),e.setAttribute("data-processed","true"))}))}))}},749:(e,t,r)=>{r.d(t,{P:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t,r){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var o=a.mindmapRenderAdapter.getElements(e);o.length>0&&(0,i.G)(t+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then((function(){o.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===r?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var r;return(null===(r=null==t?void 0:t.data)||void 0===r?void 0:r.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(t){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>"+t}}}))}))}},818:(e,t,r)=>{r.d(t,{k:()=>a});var n=r(64),i=r(466),a=function(e,t,r){var a="",o=[];if(Array.from(e.children).forEach((function(e,t){if((0,n.W)(e)){if(r){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}o.push(e.id),a+=e.outerHTML.replace("<wbr>","")}})),""===a)return t.innerHTML="","";var s=document.createElement("div");if(r)r.lute.SetToC(!0),"wysiwyg"!==r.currentMode||r.preview.element.contains(e)?"ir"!==r.currentMode||r.preview.element.contains(e)?s.innerHTML=r.lute.HTML2VditorDOM("<p>[ToC]</p>"+a):s.innerHTML=r.lute.SpinVditorIRDOM("<p>[ToC]</p>"+a):s.innerHTML=r.lute.SpinVditorDOM("<p>[ToC]</p>"+a),r.lute.SetToC(r.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var l=Lute.New();l.SetToC(!0),s.innerHTML=l.HTML2VditorDOM("<p>[ToC]</p>"+a)}var c=s.firstElementChild.querySelectorAll("li > span[data-target-id]");return c.forEach((function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var r="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(r='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML=r+"<span>"+e.innerHTML+"</span>"}else e.innerHTML="<svg></svg><span>"+e.innerHTML+"</span>";e.setAttribute("data-target-id",o[t])})),a=s.firstElementChild.innerHTML,0===c.length?(t.innerHTML="",a):(t.innerHTML=a,r&&(0,i.H)(t,{cdn:r.options.cdn,math:r.options.preview.math}),t.firstElementChild.addEventListener("click",(function(n){for(var i=n.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),n.preventDefault(),n.stopPropagation();break}if(i.getAttribute("data-target-id")){n.preventDefault(),n.stopPropagation();var a=document.getElementById(i.getAttribute("data-target-id"));if(!a)return;if(r)if("auto"===r.options.height){var o=a.offsetTop+r.element.offsetTop;r.options.toolbarConfig.pin||(o+=r.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,o)}else r.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,r.element.offsetTop),r.preview.element.contains(e)?e.parentElement.scrollTop=a.offsetTop:e.scrollTop=a.offsetTop;else window.scrollTo(window.scrollX,a.offsetTop);break}i=i.parentElement}})),a)}},408:(e,t,r)=>{r.d(t,{B:()=>o});var n=r(54),i=r(526),a=r(156),o=function(e,t){void 0===e&&(e=document),void 0===t&&(t=n.g.CDN);var r=a.plantumlRenderAdapter.getElements(e);0!==r.length&&(0,i.G)(t+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then((function(){r.forEach((function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=a.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(t)+'">'}catch(t){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>"+t}}}))}))}},895:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},863:(e,t,r)=>{r.d(t,{E:()=>n});var n=function(e,t,r){void 0===t&&(t="zh_CN"),void 0===r&&(r="classic");var n=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+("dark"===r?" vditor--dark":"")+'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n '+window.VditorI18n.spin+"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X "+window.VditorI18n.close+'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: '+e.width+"px;height:"+e.height+"px;transform: translate3d("+n.left+"px, "+(n.top-36)+'px, 0)" src="'+e.getAttribute("src")+'">\n </div>\n</div>'),document.body.style.overflow="hidden";var i=document.querySelector(".vditor-img img"),a="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-e.naturalHeight)/2+"px, 0)";setTimeout((function(){i.setAttribute("style","transition: transform .3s ease-in-out;transform: "+a),setTimeout((function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)}),400)}));var o=document.querySelector(".vditor-img__btn");o.addEventListener("click",(function(){var t=parseInt(o.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>i.parentElement.clientHeight?i.style.transform="translate3d("+Math.max(0,window.innerWidth-e.naturalWidth)/2+"px, "+(e.naturalWidth/2-e.naturalHeight/2)+"px, 0) rotateZ("+t+"deg)":i.style.transform=a+" rotateZ("+t+"deg)",o.setAttribute("data-deg",t.toString()),setTimeout((function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)}),400)}))}},312:(e,t,r)=>{r.d(t,{Y:()=>a});var n=r(54),i=r(578),a=function(e,t){void 0===t&&(t=n.g.CDN),n.g.CODE_THEME.includes(e)||(e="github");var r=document.getElementById("vditorHljsStyle"),a=t+"/dist/js/highlight.js/styles/"+e+".css";r?r.href!==a&&(r.remove(),(0,i.c)(a,"vditorHljsStyle")):(0,i.c)(a,"vditorHljsStyle")}},227:(e,t,r)=>{r.d(t,{Z:()=>i});var n=r(578),i=function(e,t){if(e&&t){var r=document.getElementById("vditorContentTheme"),i=t+"/"+e+".css";r?r.getAttribute("href")!==i&&(r.remove(),(0,n.c)(i,"vditorContentTheme")):(0,n.c)(i,"vditorContentTheme")}}},526:(e,t,r)=>{r.d(t,{J:()=>n,G:()=>i});var n=function(e,t){if(document.getElementById(t))return!1;var r=new XMLHttpRequest;r.open("GET",e,!1),r.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),r.send("");var n=document.createElement("script");n.type="text/javascript",n.text=r.responseText,n.id=t,document.head.appendChild(n)},i=function(e,t){return new Promise((function(r,n){if(document.getElementById(t))return r(),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onload=function(){if(document.getElementById(t))return i.remove(),r(),!1;i.id=t,r()}}))}},578:(e,t,r)=>{r.d(t,{c:()=>n});var n=function(e,t){if(!document.getElementById(t)){var r=document.createElement("link");r.id=t,r.rel="stylesheet",r.type="text/css",r.href=e,document.getElementsByTagName("head")[0].appendChild(r)}}},51:(e,t,r)=>{r.d(t,{X:()=>n});var n=function(e){return e.replace(/\u00a0/g," ")}},827:(e,t,r)=>{r.d(t,{lG:()=>n,fb:()=>i});var n=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)r.nodeName===t?n=!0:r=r.parentElement;return n&&r},i=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)r.classList.contains(t)?n=!0:r=r.parentElement;return n&&r}},64:(e,t,r)=>{r.d(t,{W:()=>n});var n=function(e){var t=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,n=!1;r&&!n&&!r.classList.contains("vditor-reset");)0===r.nodeName.indexOf(t)?n=!0:r=r.parentElement;return n&&r}(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},640:(e,t,r)=>{r.d(t,{T:()=>n});var n=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?r[t]=n(r[t],e[t]):r[t]=e[t])},a=0;a<e.length;a++)i(e[a]);return r}},393:(e,t,r)=>{r.d(t,{Hc:()=>n});r(54);var n=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{r.d(n,{default:()=>M});var e=r(478),t=r(156),i=r(314),a=r(730),o=r(66),s=r(218),l=r(702),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",(function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src})),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach((function(e){e.getAttribute("data-src")&&t(e)})),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)}))):(window.vditorImageIntersectionObserver=new IntersectionObserver((function(e){e.forEach((function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)}))})),e.querySelectorAll("img").forEach((function(e){window.vditorImageIntersectionObserver.observe(e)})))},d=r(466),u=r(554),m=r(40),p=r(749),h=r(818),g=r(408),v=r(54),f=r(227),y=r(526),w=r(827),b=r(640),S=r(895),T=r(393),E=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',n='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',n='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var i=document.querySelector(".vditor-speech");if(!i){(i=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",i);var a=function(){var e,r;return speechSynthesis.getVoices().forEach((function(n){n.lang===t.replace("_","-")&&(e=n),n.default&&(r=n)})),e||(e=r),e};void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=a);var o=a();i.onclick=function(){if("vditor-speech"===i.className){var e=new SpeechSynthesisUtterance(i.getAttribute("data-text"));e.voice=o,e.onend=function(){i.className="vditor-speech",speechSynthesis.cancel(),i.innerHTML=r},speechSynthesis.speak(e),i.className="vditor-speech vditor-speech--current",i.innerHTML=n}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),i.innerHTML=n):(speechSynthesis.pause(),i.innerHTML=r));(0,T.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",(function(){""===getSelection().toString().trim()&&"block"===i.style.display&&(i.className="vditor-speech",speechSynthesis.cancel(),i.style.display="none")}))}e.addEventListener("mouseup",(function(e){var t=getSelection().toString().trim();if(speechSynthesis.cancel(),""!==getSelection().toString().trim()){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var n=getSelection().getRangeAt(0).getBoundingClientRect();i.innerHTML=r,i.style.display="block",i.style.top=n.top+n.height+document.querySelector("html").scrollTop-20+"px",i.style.left=e.screenX+2+"px",i.setAttribute("data-text",t)}else"block"===i.style.display&&(i.className="vditor-speech",i.style.display="none")}))}},k=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},L=function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},C=function(e){var t={anchor:0,cdn:v.g.CDN,customEmoji:{},emojiPath:(e&&e.emojiPath||v.g.CDN)+"/dist/images/emoji",hljs:v.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:v.g.MARKDOWN_OPTIONS,math:v.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:v.g.THEME_OPTIONS};return(0,b.T)(t,e)},x=function(e,t){var r=C(t);return(0,y.G)(r.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then((function(){var n=(0,S.X)({autoSpace:r.markdown.autoSpace,codeBlockPreview:r.markdown.codeBlockPreview,emojiSite:r.emojiPath,emojis:r.customEmoji,fixTermTypo:r.markdown.fixTermTypo,footnotes:r.markdown.footnotes,headingAnchor:0!==r.anchor,inlineMathDigit:r.math.inlineDigit,lazyLoadImage:r.lazyLoadImage,linkBase:r.markdown.linkBase,linkPrefix:r.markdown.linkPrefix,listStyle:r.markdown.listStyle,mark:r.markdown.mark,mathBlockPreview:r.markdown.mathBlockPreview,paragraphBeginningSpace:r.markdown.paragraphBeginningSpace,sanitize:r.markdown.sanitize,toc:r.markdown.toc});return(null==t?void 0:t.renderers)&&n.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),n.SetHeadingID(!0),n.Md2HTML(e)}))},A=function(t,r,n){return k(void 0,void 0,void 0,(function(){var h,v,b;return L(this,(function(S){switch(S.label){case 0:return h=C(n),[4,x(r,h)];case 1:if(v=S.sent(),h.transform&&(v=h.transform(v)),t.innerHTML=v,t.classList.add("vditor-reset"),h.i18n)return[3,5];if(["en_US","ja_JP","ko_KR","ru_RU","zh_CN","zh_TW"].includes(h.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return b="vditorI18nScript"+h.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach((function(e){e.id!==b&&document.head.removeChild(e)})),[4,(0,y.G)(h.cdn+"/dist/js/i18n/"+h.lang+".js",b)];case 3:S.sent(),S.label=4;case 4:return[3,6];case 5:window.VditorI18n=h.i18n,S.label=6;case 6:return h.icon?[4,(0,y.G)(h.cdn+"/dist/js/icons/"+h.icon+".js","vditorIconScript")]:[3,8];case 7:S.sent(),S.label=8;case 8:return(0,f.Z)(h.theme.current,h.theme.path),1===h.anchor&&t.classList.add("vditor-reset--anchor"),(0,a.O)(t),(0,l.s)(h.hljs,t,h.cdn),(0,d.H)(t,{cdn:h.cdn,math:h.math}),(0,m.i)(t,h.cdn,h.mode),(0,o.P)(t,h.cdn),(0,s.v)(t,h.cdn),(0,i.p)(t,h.cdn,h.mode),(0,p.P)(t,h.cdn,h.mode),(0,g.B)(t,h.cdn),(0,e.Q)(t,h.cdn),(0,u.Y)(t),h.speech.enable&&E(t),0!==h.anchor&&(T=h.anchor,document.querySelectorAll(".vditor-anchor").forEach((function(e){1===T&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),r=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=r}})),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),h.after&&h.after(),h.lazyLoadImage&&c(t),t.addEventListener("click",(function(e){var r=(0,w.lG)(e.target,"SPAN");if(r&&(0,w.fb)(r,"vditor-toc")){var n=t.querySelector("#"+r.getAttribute("data-target-id"));n&&window.scrollTo(window.scrollX,n.offsetTop)}else;})),[2]}var T}))}))},_=r(863),j=r(312);const M=function(){function r(){}return r.adapterRender=t,r.previewImage=_.E,r.codeRender=a.O,r.graphvizRender=s.v,r.highlightRender=l.s,r.mathRender=d.H,r.mermaidRender=m.i,r.flowchartRender=o.P,r.chartRender=i.p,r.abcRender=e.Q,r.mindmapRender=p.P,r.plantumlRender=g.B,r.outlineRender=h.k,r.mediaRender=u.Y,r.speechRender=E,r.lazyLoadImageRender=c,r.md2html=x,r.preview=A,r.setCodeTheme=j.Y,r.setContentTheme=f.Z,r}()})(),n=n.default})()}));
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vditor",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.15",
|
|
4
4
|
"description": "♏ 易于使用的 Markdown 编辑器,为适配不同的应用场景而生",
|
|
5
5
|
"author": "Vanessa <v@b3log.org> (http://vanessa.b3log.org)",
|
|
6
6
|
"homepage": "https://b3log.org/vditor",
|
|
@@ -23,26 +23,33 @@
|
|
|
23
23
|
"@babel/preset-env": "^7.14.2",
|
|
24
24
|
"@types/diff-match-patch": "^1.0.32",
|
|
25
25
|
"@types/jest": "^26.0.23",
|
|
26
|
+
"@types/node": "^17.0.19",
|
|
26
27
|
"@types/puppeteer": "^2.1.5",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^5.12.0",
|
|
29
|
+
"@typescript-eslint/parser": "^5.12.0",
|
|
27
30
|
"autoprefixer": "^10.4.2",
|
|
28
31
|
"babel-loader": "^8.2.2",
|
|
29
32
|
"clean-webpack-plugin": "^4.0.0-alpha.0",
|
|
30
33
|
"copy-webpack-plugin": "^6.4.1",
|
|
31
34
|
"css-loader": "^5.2.4",
|
|
32
|
-
"
|
|
35
|
+
"eslint": "^8.9.0",
|
|
36
|
+
"eslint-plugin-jest": "^26.1.1",
|
|
37
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
38
|
+
"file-loader": "^6.2.0",
|
|
33
39
|
"html-webpack-plugin": "^5.3.1",
|
|
34
40
|
"identity-obj-proxy": "^3.0.0",
|
|
35
41
|
"jest": "^26.6.3",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
42
|
+
"less": "^4.1.2",
|
|
43
|
+
"less-loader": "^10.2.0",
|
|
44
|
+
"mini-css-extract-plugin": "^2.6.0",
|
|
45
|
+
"postcss": "^8.4.12",
|
|
38
46
|
"postcss-loader": "^5.2.0",
|
|
47
|
+
"prettier": "^2.5.1",
|
|
39
48
|
"puppeteer": "^1.20.0",
|
|
40
|
-
"sass-loader": "^12.4.0",
|
|
41
49
|
"style-loader": "^1.3.0",
|
|
42
50
|
"terser-webpack-plugin": "^5.3.0",
|
|
43
51
|
"ts-jest": "^26.5.6",
|
|
44
52
|
"ts-loader": "^6.2.2",
|
|
45
|
-
"tslint": "^5.20.1",
|
|
46
53
|
"typescript": "^3.9.9",
|
|
47
54
|
"webpack": "^5.66.0",
|
|
48
55
|
"webpack-bundle-analyzer": "^3.9.0",
|
|
@@ -55,7 +62,7 @@
|
|
|
55
62
|
"url": "https://github.com/Vanessa219/vditor/issues"
|
|
56
63
|
},
|
|
57
64
|
"scripts": {
|
|
58
|
-
"lint": "
|
|
65
|
+
"lint": "eslint --fix --ext src/**/*.ts",
|
|
59
66
|
"test:watch": "jest --watch",
|
|
60
67
|
"test": "jest --coverage",
|
|
61
68
|
"start": "webpack serve --config webpack.start.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
border: 1px solid var(--border-color);
|
|
16
16
|
border-radius: 3px;
|
|
17
17
|
box-sizing: border-box;
|
|
18
|
-
font-family:
|
|
18
|
+
font-family: @font-family-base;
|
|
19
19
|
|
|
20
20
|
.vditor-copy {
|
|
21
21
|
z-index: auto;
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
&::-webkit-scrollbar {
|
|
53
53
|
display: none;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
55
|
&__action {
|
|
57
56
|
text-align: center;
|
|
58
57
|
padding: 10px;
|
|
@@ -120,8 +119,8 @@
|
|
|
120
119
|
margin: 8px 3px 0 0;
|
|
121
120
|
|
|
122
121
|
&--error {
|
|
123
|
-
color:
|
|
124
|
-
background-color: rgba(
|
|
122
|
+
color: @errorColor;
|
|
123
|
+
background-color: rgba(@errorColor, 0.1);
|
|
125
124
|
}
|
|
126
125
|
}
|
|
127
126
|
|
|
@@ -143,7 +142,7 @@
|
|
|
143
142
|
& > div {
|
|
144
143
|
height: 3px;
|
|
145
144
|
background-color: var(--resize-background-color);
|
|
146
|
-
transition:
|
|
145
|
+
transition: @transition;
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
&:hover,
|
|
@@ -174,15 +173,15 @@
|
|
|
174
173
|
height: 3px;
|
|
175
174
|
left: 0;
|
|
176
175
|
top: -2px;
|
|
177
|
-
transition:
|
|
178
|
-
background-color:
|
|
176
|
+
transition: @transition;
|
|
177
|
+
background-color: @blurColor;
|
|
179
178
|
}
|
|
180
179
|
|
|
181
180
|
&-tip {
|
|
182
181
|
position: absolute;
|
|
183
182
|
font-size: 12px;
|
|
184
183
|
top: 10px;
|
|
185
|
-
animation-duration: .15s;
|
|
184
|
+
animation-duration: 0.15s;
|
|
186
185
|
animation-fill-mode: both;
|
|
187
186
|
left: 50%;
|
|
188
187
|
z-index: 5;
|
|
@@ -211,7 +210,7 @@
|
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
a {
|
|
214
|
-
color:
|
|
213
|
+
color: @blurColor;
|
|
215
214
|
}
|
|
216
215
|
}
|
|
217
216
|
|
|
File without changes
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
&[data-type="link-ref"],
|
|
28
28
|
&[data-type="footnotes-ref"] {
|
|
29
|
-
color:
|
|
29
|
+
color: @blurColor;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&[data-type="html-block"] {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
display: inline-block;
|
|
40
40
|
height: 0;
|
|
41
|
-
transition:
|
|
41
|
+
transition: @transition;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
&--hidden {
|
|
@@ -252,13 +252,13 @@
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
span[data-type="toc-h"] {
|
|
255
|
-
color:
|
|
255
|
+
color: @blurColor;
|
|
256
256
|
text-decoration: underline;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
@media screen and (max-width:
|
|
261
|
+
@media screen and (max-width: @max-width) {
|
|
262
262
|
.vditor-ir {
|
|
263
263
|
h1:before,
|
|
264
264
|
h2:before,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
@keyframes scale-in {
|
|
9
9
|
0% {
|
|
10
10
|
opacity: 0;
|
|
11
|
-
transform: scale(.5);
|
|
11
|
+
transform: scale(0.5);
|
|
12
12
|
}
|
|
13
13
|
100% {
|
|
14
14
|
opacity: 1;
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
user-select: none;
|
|
30
30
|
max-width: 320px;
|
|
31
31
|
min-width: 80px;
|
|
32
|
-
animation-duration: .15s;
|
|
32
|
+
animation-duration: 0.15s;
|
|
33
33
|
animation-name: scale-in;
|
|
34
|
-
animation-timing-function: cubic-bezier(.2, 0, .13, 1.5);
|
|
34
|
+
animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
|
|
35
35
|
color: var(--toolbar-icon-color);
|
|
36
36
|
|
|
37
37
|
&--none {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
min-width: auto;
|
|
41
41
|
max-width: none;
|
|
42
42
|
white-space: nowrap;
|
|
43
|
-
opacity: .86;
|
|
43
|
+
opacity: 0.86;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
&--arrow:before {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
&--error {
|
|
8
|
-
color:
|
|
8
|
+
color: @errorColor;
|
|
9
9
|
font-size: 12px;
|
|
10
10
|
display: block;
|
|
11
11
|
line-height: 16px;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
color: #24292e;
|
|
15
15
|
font-variant-ligatures: no-common-ligatures;
|
|
16
|
-
font-family:
|
|
16
|
+
font-family: @font-family-base;
|
|
17
17
|
word-wrap: break-word;
|
|
18
18
|
overflow: auto;
|
|
19
19
|
line-height: 1.5;
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
h4 {
|
|
98
|
-
font-size: 1.25em
|
|
98
|
+
font-size: 1.25em;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
h5 {
|
|
@@ -126,11 +126,11 @@
|
|
|
126
126
|
margin: 0 0 16px 0;
|
|
127
127
|
|
|
128
128
|
& > :first-child {
|
|
129
|
-
margin-top: 0
|
|
129
|
+
margin-top: 0;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
& > :last-child {
|
|
133
|
-
margin-bottom: 0
|
|
133
|
+
margin-bottom: 0;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
margin: 0;
|
|
194
194
|
font-size: 85%;
|
|
195
195
|
border-radius: 3px;
|
|
196
|
-
font-family:
|
|
196
|
+
font-family: @font-family-code;
|
|
197
197
|
word-break: break-word;
|
|
198
198
|
background-size: 20px 20px;
|
|
199
199
|
white-space: pre-wrap;
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
display: block;
|
|
211
211
|
overflow: auto;
|
|
212
212
|
white-space: pre;
|
|
213
|
-
font-family:
|
|
213
|
+
font-family: @font-family-code;
|
|
214
214
|
background-size: 20px 20px;
|
|
215
215
|
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==);
|
|
216
216
|
word-break: initial;
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
word-break: break-all;
|
|
311
311
|
|
|
312
312
|
input {
|
|
313
|
-
margin: 0 .2em .25em -1.6em;
|
|
313
|
+
margin: 0 0.2em 0.25em -1.6em;
|
|
314
314
|
font-size: 12px;
|
|
315
315
|
vertical-align: middle;
|
|
316
316
|
}
|
|
@@ -423,7 +423,7 @@
|
|
|
423
423
|
|
|
424
424
|
&-linkcard {
|
|
425
425
|
margin: 31px auto 16px;
|
|
426
|
-
transition:
|
|
426
|
+
transition: @transition;
|
|
427
427
|
cursor: pointer;
|
|
428
428
|
max-width: 768px;
|
|
429
429
|
padding: 0 10px;
|
|
@@ -436,10 +436,10 @@
|
|
|
436
436
|
display: flex;
|
|
437
437
|
text-decoration: none;
|
|
438
438
|
flex-wrap: wrap-reverse;
|
|
439
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
|
|
439
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
|
|
440
440
|
|
|
441
441
|
&:hover {
|
|
442
|
-
box-shadow: 0 0 3px rgba(0, 0, 0, .13), 0 3px 6px rgba(0, 0, 0, .26);
|
|
442
|
+
box-shadow: 0 0 3px rgba(0, 0, 0, 0.13), 0 3px 6px rgba(0, 0, 0, 0.26);
|
|
443
443
|
text-decoration: none;
|
|
444
444
|
}
|
|
445
445
|
|
|
@@ -508,7 +508,7 @@
|
|
|
508
508
|
&-toc {
|
|
509
509
|
margin-bottom: 16px;
|
|
510
510
|
user-select: text;
|
|
511
|
-
color:
|
|
511
|
+
color: @blurColor;
|
|
512
512
|
|
|
513
513
|
.vditor-outline__action {
|
|
514
514
|
display: none;
|
|
@@ -590,7 +590,7 @@
|
|
|
590
590
|
}
|
|
591
591
|
|
|
592
592
|
&__action {
|
|
593
|
-
transition:
|
|
593
|
+
transition: @transition;
|
|
594
594
|
fill: currentColor;
|
|
595
595
|
margin-right: 5px;
|
|
596
596
|
flex-shrink: 0;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
&--hide {
|
|
15
|
-
transition:
|
|
15
|
+
transition: @transition;
|
|
16
16
|
height: 5px;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
padding: 3px;
|
|
140
140
|
box-sizing: border-box;
|
|
141
141
|
font-size: 16px;
|
|
142
|
-
transition:
|
|
142
|
+
transition: @transition;
|
|
143
143
|
border: 0;
|
|
144
144
|
margin: 0;
|
|
145
145
|
background-color: transparent;
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
@media screen and (max-width:
|
|
167
|
+
@media screen and (max-width: @max-width) {
|
|
168
168
|
.vditor-toolbar__item {
|
|
169
169
|
padding: 0 12px;
|
|
170
170
|
}
|