remons-render-markdown 2.0.2-beta.5 → 2.0.2-beta.7
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/dist/components/RenderMarkdown/index.d.ts +13 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +23 -22
- package/dist/utils/wordCount.d.ts +34 -0
- package/package.json +1 -1
- package/readme.md +33 -1
|
@@ -112,5 +112,18 @@ export interface RenderMarkdownProps {
|
|
|
112
112
|
* `validateLink={(url) => myRule(url) || defaultValidateLink(url)}`
|
|
113
113
|
*/
|
|
114
114
|
validateLink?: (url: string) => boolean;
|
|
115
|
+
/**
|
|
116
|
+
* 是否在内容底部展示字数统计,默认 true;传 false 关闭
|
|
117
|
+
*/
|
|
118
|
+
showWordCount?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* 字数统计文案模板,`{字段名}` 为占位符,可选字段同 `WordCountResult`:
|
|
121
|
+
* `{total}` / `{chinese}` / `{words}` / `{characters}` / `{charactersWithoutSpaces}`
|
|
122
|
+
* (`{total}` 另有 `{wordCount}` / `{count}` 别名)。
|
|
123
|
+
* 如 `'共{wordCount}字'`、`'{total} 字({chinese} 中文字)'`;
|
|
124
|
+
* 不传用默认 `'字数 {total}'`,未知占位符原样保留(便于发现字段名拼写错误)。
|
|
125
|
+
* 非初始化语义,可随时改
|
|
126
|
+
*/
|
|
127
|
+
wordCountTemplate?: string;
|
|
115
128
|
}
|
|
116
129
|
export default function RenderMarkdown(props: RenderMarkdownProps): React.JSX.Element;
|
package/dist/index.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import "https://at.alicdn.com/t/c/font_2004544_gigrjtfsf6.css";._container_1a6ji_4{z-index:10000;pointer-events:none;flex-direction:column;align-items:center;gap:8px;display:flex;position:fixed;top:8vh;left:50%;transform:translate(-50%)}._item_1a6ji_16{pointer-events:auto}._toast_1a6ji_19{background-color:var(--remons-markdown-color-bg-white);box-shadow:var(--remons-markdown-shadow-sm);border-radius:6px;align-items:center;gap:8px;min-width:200px;padding:10px 20px;font-size:14px;animation:.3s _fadeIn_1a6ji_1;display:flex}._toast-warning_1a6ji_31{color:#faad14}._toast-info_1a6ji_34{color:#1890ff}._toast-error_1a6ji_37{color:#ff4d4f}._toast-success_1a6ji_40{color:#52c41a}@keyframes _fadeIn_1a6ji_1{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}._back-top_gdg5d_4{position:fixed;bottom:20px;right:20px}@media screen and (width<=500px){._back-top_gdg5d_4{width:30px;height:30px}}._empty_container_fkmsv_3{color:#999;flex-direction:column;justify-content:center;align-items:center;gap:12px;height:100%;display:flex}._description_fkmsv_12{font-size:14px}._tocSidebar_1ha9l_1{background:var(--remons-markdown-color-toc);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);width:280px;max-height:min(100vh - 120px,100% - 120px);box-shadow:var(--remons-markdown-shadow-sm);z-index:1000;border:1px solid var(--remons-markdown-color-button-border);opacity:0;transform-origin:100% 0;pointer-events:none;border-radius:8px;flex-direction:column;transition:opacity .2s,transform .2s;display:flex;position:absolute;top:100px;right:32px;transform:translateY(-8px)scale(.98)}._tocSidebar_1ha9l_1._open_1ha9l_19{opacity:1;pointer-events:auto;transform:translateY(0)scale(1)}._tocHeader_1ha9l_34{border-bottom:1px solid var(--remons-markdown-color-border);justify-content:space-between;align-items:center;padding:8px 10px;display:flex}._tocHeader_1ha9l_34 ._tocTitle_1ha9l_41{color:var(--remons-markdown-color-text-primary);font-size:14px;font-weight:600}._tocHeader_1ha9l_34 ._tocActions_1ha9l_46{align-items:center;gap:6px;display:flex}._tocHeader_1ha9l_34 ._tocActions_1ha9l_46 .remons-markdown-circle{width:22px;height:22px;font-size:12px}._tocSearchBar_1ha9l_56{border-bottom:1px solid var(--remons-markdown-color-border);background:var(--remons-markdown-color-bg);align-items:center;padding:6px 8px;display:flex}._tocSearchBar_1ha9l_56 ._tocSearchInput_1ha9l_63{border:1px solid var(--remons-markdown-color-border);background:var(--remons-markdown-color-bg);height:28px;color:var(--remons-markdown-color-text);border-radius:4px;outline:none;flex:1;padding:0 8px;font-size:13px}._tocSearchBar_1ha9l_56 ._tocSearchInput_1ha9l_63::placeholder{color:var(--remons-markdown-color-text-placeholder)}._tocSearchBar_1ha9l_56 ._tocSearchInput_1ha9l_63:focus{border-color:var(--remons-markdown-color-primary);box-shadow:0 0 0 2px var(--remons-markdown-color-primary-shadow)}._tocSearchBar_1ha9l_56 ._tocSearchClear_1ha9l_81{cursor:pointer;color:var(--remons-markdown-color-text-placeholder);border-radius:2px;margin-left:4px;padding:4px;font-size:12px;transition:color .2s}._tocSearchBar_1ha9l_56 ._tocSearchClear_1ha9l_81:hover{color:var(--remons-markdown-color-text-primary)}._tocSearchBar_1ha9l_56 ._tocSearchExit_1ha9l_93{cursor:pointer;color:var(--remons-markdown-color-text-placeholder);border-radius:4px;margin-left:4px;padding:4px;font-size:16px;transition:color .2s}._tocSearchBar_1ha9l_56 ._tocSearchExit_1ha9l_93:hover{color:var(--remons-markdown-color-text-primary);background:var(--remons-markdown-color-bg-hover-light)}._tocBody_1ha9l_106{flex:1;padding:8px 0 8px 6px;overflow-y:auto}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112{cursor:pointer;border-radius:4px;align-items:center;padding:4px 10px;line-height:20px;transition:all .2s;display:flex;position:relative}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112._active_1ha9l_122{color:var(--remons-markdown-color-primary)}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112._active_1ha9l_122 ._tocLink_1ha9l_125{color:var(--remons-markdown-color-primary);font-weight:500}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocExpandIcon_1ha9l_129{color:var(--remons-markdown-color-text-placeholder);cursor:pointer;justify-content:center;align-items:center;width:16px;height:16px;font-size:10px;display:flex;position:absolute;left:-6px}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocExpandIcon_1ha9l_129:hover{color:var(--remons-markdown-color-text)}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocLink_1ha9l_125{color:var(--remons-markdown-color-text);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;text-decoration:none;overflow:hidden}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocLink_1ha9l_125:hover{color:var(--remons-markdown-color-primary)}._tocChildren_1ha9l_156{overflow:hidden}._highlight_1ha9l_159{color:var(--remons-markdown-color-warning);font-weight:600}._tocEmpty_1ha9l_163{text-align:center;color:var(--remons-markdown-color-text-placeholder);padding:20px 12px;font-size:13px}@media screen and (width<=500px){._tocSidebar_1ha9l_1{width:250px;max-height:min(100vh - 100px,100% - 110px);line-height:18px;top:90px;right:32px}._tocHeader_1ha9l_34{padding:4px 6px}._tocHeader_1ha9l_34 ._tocTitle_1ha9l_41{font-size:12px}._tocSearchBar_1ha9l_56{padding:4px 6px}._tocSearchBar_1ha9l_56 ._tocSearchInput_1ha9l_63{height:24px;padding:0 4px;font-size:12px}._tocSearchBar_1ha9l_56 ._tocSearchExit_1ha9l_93{font-size:14px}._tocBody_1ha9l_106{padding:2px 0}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112{padding:2px 6px}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocLink_1ha9l_125{font-size:12px}._tocItem_1ha9l_112 ._tocItemTitle_1ha9l_112 ._tocExpandIcon_1ha9l_129{width:12px;height:12px;font-size:8px}._tocEmpty_1ha9l_163{padding:10px 6px;font-size:12px}}.pswp{--pswp-bg:#000;--pswp-placeholder-bg:#222;--pswp-root-z-index:100000;--pswp-preloader-color:#4f4f4f66;--pswp-preloader-color-secondary:#ffffffe6;--pswp-icon-color:#fff;--pswp-icon-color-secondary:#4f4f4f;--pswp-icon-stroke-color:#4f4f4f;--pswp-icon-stroke-width:2px;--pswp-error-text-color:var(--pswp-icon-color);width:100%;height:100%;z-index:var(--pswp-root-z-index);touch-action:none;opacity:.003;contain:layout style size;-webkit-tap-highlight-color:#0000;outline:0;display:none;position:fixed;top:0;left:0}.pswp:focus{outline:0}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--open{display:block}.pswp,.pswp__bg{will-change:opacity;transform:translateZ(0)}.pswp__bg{opacity:.005;background:var(--pswp-bg)}.pswp,.pswp__scroll-wrap{overflow:hidden}.pswp__scroll-wrap,.pswp__bg,.pswp__container,.pswp__item,.pswp__content,.pswp__img,.pswp__zoom-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.pswp__img,.pswp__zoom-wrap{width:auto;height:auto}.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,.pswp__img{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out}.pswp__container,.pswp__img,.pswp__button,.pswp__counter{-webkit-user-select:none;user-select:none}.pswp__item{z-index:1;overflow:hidden}.pswp__hidden{display:none!important}.pswp__content{pointer-events:none}.pswp__content>*{pointer-events:auto}.pswp__error-msg-container{display:grid}.pswp__error-msg{color:var(--pswp-error-text-color);margin:auto;font-size:1em;line-height:1}.pswp .pswp__hide-on-close{opacity:.005;will-change:opacity;transition:opacity var(--pswp-transition-duration) cubic-bezier(.4, 0, .22, 1);z-index:10;pointer-events:none}.pswp--ui-visible .pswp__hide-on-close{opacity:1;pointer-events:auto}.pswp__button{cursor:pointer;width:50px;height:60px;box-shadow:none;opacity:.85;-webkit-appearance:none;-webkit-touch-callout:none;background:0 0;border:0;margin:0;padding:0;display:block;position:relative;overflow:hidden}.pswp__button:hover,.pswp__button:active,.pswp__button:focus{box-shadow:none;opacity:1;background:0 0;border:0;padding:0;transition:none}.pswp__button:disabled{opacity:.3;cursor:auto}.pswp__icn{fill:var(--pswp-icon-color);color:var(--pswp-icon-color-secondary);pointer-events:none;width:32px;height:32px;position:absolute;top:14px;left:9px;overflow:hidden}.pswp__icn-shadow{stroke:var(--pswp-icon-stroke-color);stroke-width:var(--pswp-icon-stroke-width);fill:none}.pswp__icn:focus{outline:0}div.pswp__img--placeholder,.pswp__img--with-bg{background:var(--pswp-placeholder-bg)}.pswp__top-bar{z-index:10;flex-direction:row;justify-content:flex-end;width:100%;height:60px;display:flex;position:absolute;top:0;left:0;pointer-events:none!important}.pswp__top-bar>*{pointer-events:auto;will-change:opacity}.pswp__button--close{margin-right:6px}.pswp__button--arrow{width:75px;height:100px;margin-top:-50px;position:absolute;top:50%}.pswp__button--arrow:disabled{cursor:default;display:none}.pswp__button--arrow .pswp__icn{background:0 0;border-radius:0;width:60px;height:60px;margin-top:-30px;top:50%}.pswp--one-slide .pswp__button--arrow{display:none}.pswp--touch .pswp__button--arrow{visibility:hidden}.pswp--has_mouse .pswp__button--arrow{visibility:visible}.pswp__button--arrow--prev{left:0;right:auto}.pswp__button--arrow--next{right:0}.pswp__button--arrow--next .pswp__icn{left:auto;right:14px;transform:scaleX(-1)}.pswp__button--zoom{display:none}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__zoom-icn-bar-v{display:none}.pswp__preloader{width:50px;height:60px;margin-right:auto;position:relative;overflow:hidden}.pswp__preloader .pswp__icn{opacity:0;transition:opacity .2s linear;animation:.6s linear infinite pswp-clockwise}.pswp__preloader--active .pswp__icn{opacity:.85}@keyframes pswp-clockwise{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pswp__counter{margin-top:15px;height:30px;color:var(--pswp-icon-color);text-shadow:1px 1px 3px var(--pswp-icon-color-secondary);opacity:.85;margin-inline-start:20px;font-size:14px;line-height:30px}.pswp--one-slide .pswp__counter{display:none}.pswp.md-image-preview{--pswp-bg:#12141eb8}html[data-theme=dark] .pswp.md-image-preview{--pswp-bg:#060810c7}.pswp.md-image-preview .pswp__bg{-webkit-backdrop-filter:blur(6px)saturate(1.1)}.pswp.md-image-preview .pswp__top-bar{background-image:linear-gradient(#00000052,#0000)}.hljs{color:#f8f8f2;background:#23241f}.hljs-tag,.hljs-subst{color:#f8f8f2}.hljs-strong,.hljs-emphasis{color:#a8a8a2}.hljs-bullet,.hljs-quote,.hljs-number,.hljs-regexp,.hljs-literal,.hljs-link{color:#ae81ff}.hljs-code,.hljs-title,.hljs-section,.hljs-selector-class{color:#a6e22e}.hljs-strong{font-weight:700}.hljs-keyword,.hljs-selector-tag,.hljs-name,.hljs-attr{color:#f92672}.hljs-symbol,.hljs-attribute{color:#66d9ef}.hljs-params,.hljs-title.class_,.hljs-class .hljs-title{color:#f8f8f2}.hljs-string,.hljs-type,.hljs-built_in,.hljs-selector-id,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-addition,.hljs-variable,.hljs-template-variable{color:#e6db74}.hljs-comment,.hljs-deletion,.hljs-meta{color:#75715e;font-family:var(--remons-markdown-font-family-editor)}.markdown-tabs-tabs-wrapper{border-radius:4px;margin-top:2px;position:relative}.markdown-tabs-tabs-wrapper:after{content:"";pointer-events:none;z-index:10;opacity:0;height:30px;transition:opacity .4s;position:absolute;top:0;left:0;right:0}.markdown-tabs-tabs-wrapper.has-left-mask:after{opacity:1;background:linear-gradient(to right, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 15%)}.markdown-tabs-tabs-wrapper.has-right-mask:after{opacity:1;background:linear-gradient(to left, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 10%)}.markdown-tabs-tabs-wrapper.has-both-masks:after{opacity:1;background:linear-gradient(to right, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 15%, transparent 85%, var(--remons-markdown-tabs-mask,#fff9) 100%)}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-header{z-index:2;background:0 0;display:flex;top:0;overflow:auto hidden}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-header::-webkit-scrollbar{display:none}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button{cursor:pointer;background-color:var(--remons-markdown-color-button);-webkit-backdrop-filter:blur(10px);border:1px solid var(--remons-markdown-color-button-border);min-width:50px;box-shadow:var(--remons-markdown-shadow-sm);border-bottom:none;border-radius:8px 8px 0 0;margin:0 2px;padding:6px 8px;font-size:14px;font-weight:400;transition:background-color .3s ease-in-out,color .3s ease-in-out;position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:last-child{border-right:none;margin-right:0}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:first-child{margin-left:0}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:hover{background-color:var(--remons-markdown-color-bg-hover);color:var(--remons-markdown-color-primary)}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button.active{color:var(--remons-markdown-color-primary);box-shadow:var(--remons-markdown-shadow-inset);position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-container{position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-content{border:1px solid var(--remons-markdown-color-button-border);background-color:var(--remons-markdown-color-button);box-shadow:var(--remons-markdown-shadow-sm);border-radius:0 8px 8px;height:auto;padding:2px 10px 0;display:none;overflow:hidden}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-content.active{display:block}[data-theme=dark] .markdown-tabs-tab-button{color:#afafaf;background:#263238;border-color:#1a1d2e}[data-theme=dark] .markdown-tabs-tab-button:hover{background:#2e3350}[data-theme=dark] .markdown-tabs-tab-button.active{background:#2e3350;border:1px solid #2e3350}[data-theme=dark] .markdown-tabs-tab-content{border-color:#2e3350}:root{--vp-c-grey-text:#656869;--vp-c-grey-hover:#e4e4e9;--vp-c-grey-bg:#ebebef;--vp-c-grey-soft:#8e96aa24;--vp-c-purple-text:#6f42c1;--vp-c-purple-hover:#7e4cc9;--vp-c-purple-bg:#8e5cd9;--vp-c-purple-soft:#9f7aea24;--vp-c-blue-text:#2888a7;--vp-c-blue-hover:#2d98ba;--vp-c-blue-bg:#2fa1c5;--vp-c-blue-soft:#1bb2e524;--vp-c-green-text:#18794e;--vp-c-green-hover:#299764;--vp-c-green-bg:#30a46c;--vp-c-green-soft:#10b98124;--vp-c-yellow-text:#915930;--vp-c-yellow-hover:#946300;--vp-c-yellow-bg:#c28100;--vp-c-yellow-soft:#eab30824;--vp-c-red-text:#b8272c;--vp-c-red-hover:#d5393e;--vp-c-red-bg:#e0575b;--vp-c-red-soft:#f43f5e24}[data-theme=dark]{--vp-c-grey-text:#939499;--vp-c-grey-hover:#414853;--vp-c-grey-bg:#32363f;--vp-c-grey-soft:#65758529;--vp-c-blue-text:#c9e8f2;--vp-c-blue-hover:#a6d9ea;--vp-c-blue-bg:#2785a3;--vp-c-blue-soft:#1bb2e529;--vp-c-purple-text:#c8abfa;--vp-c-purple-hover:#a879e6;--vp-c-purple-bg:#8e5cd9;--vp-c-purple-soft:#9f7aea29;--vp-c-green-text:#3dd68c;--vp-c-green-hover:#30a46c;--vp-c-green-bg:#298459;--vp-c-green-soft:#10b98129;--vp-c-yellow-text:#f9b44e;--vp-c-yellow-hover:#da8b17;--vp-c-yellow-bg:#a46a0a;--vp-c-yellow-soft:#eab30829;--vp-c-red-text:#f66f81;--vp-c-red-hover:#f14158;--vp-c-red-bg:#b62a3c;--vp-c-red-soft:#f43f5e29}.markdown .markdown-alert{color:inherit;border-radius:8px;margin:4px 0 8px;padding:6px 10px}.markdown .markdown-alert blockquote{border-left:none;margin:0;padding:0}.markdown .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;display:flex;position:relative}.markdown .markdown-alert .markdown-alert-title .iconfont{padding-right:4px}@media print{.markdown .markdown-alert{break-inside:avoid;page-break-inside:avoid}}.markdown .markdown-alert.markdown-alert-note{background:var(--vp-c-grey-soft)}.markdown .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--vp-c-grey-text)}.markdown .markdown-alert.markdown-alert-important{background:var(--vp-c-purple-soft)}.markdown .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--vp-c-purple-text)}.markdown .markdown-alert.markdown-alert-tip{background:var(--vp-c-green-soft)}.markdown .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--vp-c-green-text)}.markdown .markdown-alert.markdown-alert-warning{background:var(--vp-c-yellow-soft)}.markdown .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--vp-c-yellow-text)}.markdown .markdown-alert.markdown-alert-caution{background:var(--vp-c-red-soft)}.markdown .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--vp-c-red-text)}.markdown{cursor:initial;box-sizing:border-box;color:var(--remons-markdown-color-text-primary);letter-spacing:.01em;background:var(--remons-markdown-color-bg,#f6f8fa);padding:10px 8px 0;font-family:Inter,Noto Sans SC,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;font-size:16px;font-weight:400;line-height:1.75;position:relative}.markdown .markdown-footer{align-items:center;margin-top:10px;font-size:12px;display:flex}.markdown .create-time{background:var(--remons-markdown-color-bg-tooltip,#61616141);color:var(--remons-markdown-color-text,#ffffffde);float:left;border-radius:4px;padding:0 4px;font-weight:400}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6{color:var(--remons-markdown-color-text-primary);letter-spacing:0;font-weight:700;line-height:1.35;position:relative}.markdown h1,.markdown h2,.markdown h3,.markdown h4{margin:6px 0}.markdown h5,.markdown h6{margin:4px 0}.markdown h1:first-child,.markdown h2:first-child,.markdown h3:first-child,.markdown h4:first-child,.markdown h5:first-child,.markdown h6:first-child{margin-top:0}.markdown h1{font-size:22px}.markdown h2{font-size:20px}.markdown h3{font-size:18px}.markdown h4{font-size:17px}.markdown h5{font-size:15px}.markdown h6{font-size:14px}.markdown p{word-break:break-word;white-space:pre-line;margin:2px 0 6px;font-size:16px;line-height:22px}.markdown p:empty{margin:0}.markdown ul,.markdown ol{margin:0 0 10px;padding-left:1.5em}.markdown ul li,.markdown ol li{margin:4px 0;font-size:16px;line-height:22px}.markdown ul li p,.markdown ol li p{margin:0}.markdown blockquote{color:var(--remons-markdown-color-text-secondary,#57606a);background:var(--remons-markdown-color-bg-card,#f6f8fa);border-left:4px solid var(--remons-markdown-color-border-dark,#d0d7de);border-radius:0 6px 6px 0;margin:6px 0;padding:4px 6px}.markdown blockquote p:last-child{margin-bottom:0}.markdown img{border-radius:var(--remons-markdown-radius-base,6px);object-fit:cover;object-position:top;cursor:zoom-in;width:auto;max-width:100%;max-height:200px;margin:8px 0;display:block}.markdown table{border:1px solid var(--remons-markdown-color-border-dark,#d0d7de);border-spacing:0;border-collapse:separate;border-radius:6px;max-width:100%;margin:10px 0;display:inline-block;overflow:auto}.markdown table thead{background-color:var(--remons-markdown-color-table-header,#f6f8fa);text-align:left;vertical-align:bottom}.markdown table td,.markdown table th{border-right:1px solid var(--remons-markdown-color-border-dark,#d0d7de);border-bottom:1px solid var(--remons-markdown-color-border-dark,#d0d7de);min-width:56px;padding:6px 8px;font-size:15px;line-height:20px}.markdown table tr:last-child td{border-bottom:0}.markdown table td:last-child,.markdown table th:last-child{border-right:0}@media (prefers-color-scheme:dark){.markdown:not([data-theme]) table thead{background-color:var(--remons-markdown-color-table-header,#2b3046)}}.markdown ul.contains-task-list{padding-left:0}.markdown ul.contains-task-list li.task-list-item{align-items:center;list-style:none;display:flex}.markdown ul.contains-task-list li.task-list-item .task-list-item-checkbox{vertical-align:middle;width:15px;height:15px;margin-right:4px}.markdown .markdown-html{color:var(--remons-markdown-color-text-primary)}.markdown .markdown-html .header-anchor{opacity:0;color:var(--remons-markdown-color-text-placeholder,#999);text-decoration:none;transition:opacity .2s ease-in-out}.markdown .markdown-html h1:hover .header-anchor,.markdown .markdown-html h2:hover .header-anchor,.markdown .markdown-html h3:hover .header-anchor,.markdown .markdown-html h4:hover .header-anchor,.markdown .markdown-html h5:hover .header-anchor,.markdown .markdown-html h6:hover .header-anchor{opacity:1}.markdown code{color:#c7254df1;font-family:var(--remons-markdown-font-family-editor);background:#f9f2f4;border-radius:5px;margin:0 2px;padding:2px 6px;font-size:.9em;line-height:1.5}.markdown pre:has(code.mermaid-render-noCode){display:none}.markdown pre{color:#f8f8f2;cursor:auto;font-family:var(--remons-markdown-font-family-editor);background-color:#263238;border-radius:10px;margin:10px 0;font-size:14px;font-weight:400;line-height:1.6;position:relative;overflow:hidden;box-shadow:inset 5px 5px 10px #0f1416,inset -5px -5px 10px #3d505a}.markdown pre code{width:calc(100% - 32px);color:inherit;font-size:inherit;line-height:inherit;background-color:#0000;border-radius:0;margin:0;padding:4px 16px 0;display:inline-block;overflow:auto}.markdown pre .pre-handle{color:#c9d1d9;background:#242933;justify-content:space-between;align-items:center;height:32px;padding-left:16px;padding-right:10px;font-size:12px;line-height:32px;display:flex}.markdown pre .pre-handle>span{font-family:var(--remons-markdown-font-family-editor);align-items:center;display:inline-flex}.markdown pre .pre-handle .traffic-lights{align-items:center;gap:4px;margin-right:6px;display:inline-flex}.markdown pre .pre-handle .traffic-lights .traffic-light{border-radius:50%;width:8px;height:8px}.markdown pre .pre-handle .traffic-lights .traffic-light-red{background:#ff5f56}.markdown pre .pre-handle .traffic-lights .traffic-light-yellow{background:#ffbd2e}.markdown pre .pre-handle .traffic-lights .traffic-light-green{background:#27c93f}.markdown pre .pre-handle .code-toggle{margin-left:10px}.markdown pre .pre-handle .copy,.markdown pre .pre-handle .code-toggle{cursor:pointer;font-size:14px}.markdown pre.code-collapsed{max-height:32px;overflow:hidden}.markdown pre.code-collapsed code{overflow:hidden}.markdown a{color:var(--remons-markdown-color-text-primary)}.markdown iframe{border-radius:var(--remons-markdown-radius-base,6px);width:100%;max-height:300px}.markdown .katex .katex-base{font-family:math;font-size:14px}.markdown .mdNum{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1.2em;line-height:1}.markdown .mdNumWide{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1.14em;line-height:1}.markdown .mdNumCjk{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1em;line-height:1}:where(.markdown) a{text-decoration:underline}html[data-theme=dark] .markdown table thead{background-color:var(--remons-markdown-color-table-header,#2b3046)}@media screen and (width<=500px){.markdown iframe{max-height:150px}}@media print{.markdown table{width:100%;display:table}.code-handle{display:none!important}.katex-mathml{display:none}}._tocToggle_1egap_1{position:absolute;top:50px;right:32px}._modal-mask_dzv9e_4{z-index:1000;opacity:0;background-color:#00000073;justify-content:center;align-items:center;transition:opacity .3s;display:flex;position:fixed;inset:0}._modal-mask-visible_dzv9e_18{opacity:1}._modal_dzv9e_4{background:#fff;border-radius:8px;flex-direction:column;max-height:90vh;transition:transform .3s;display:flex;transform:scale(.9);box-shadow:0 6px 16px #00000026}._modal-mask-visible_dzv9e_18 ._modal_dzv9e_4{transform:scale(1)}._modal-header_dzv9e_34{border-bottom:1px solid #f0f0f0;justify-content:space-between;align-items:center;padding:10px;display:flex}._modal-title_dzv9e_41{color:#333;font-size:16px;font-weight:500}._modal-close_dzv9e_46{color:#999;cursor:pointer;border-radius:4px;justify-content:center;align-items:center;width:32px;height:32px;font-size:20px;transition:all .2s;display:flex}._modal-close_dzv9e_46:hover{color:#333;background-color:#f5f5f5}._modal-body_dzv9e_62{flex:1;padding:6px;overflow:auto}._modal-footer_dzv9e_67{text-align:right;border-top:1px solid #f0f0f0;padding:16px 24px}[data-theme=dark] ._modal_dzv9e_4{background:#2e3350;box-shadow:0 6px 16px #0006}[data-theme=dark] ._modal-header_dzv9e_34{border-bottom:1px solid #3d4258}[data-theme=dark] ._modal-title_dzv9e_41{color:#e8ecf4}[data-theme=dark] ._modal-close_dzv9e_46{color:#8892a4}[data-theme=dark] ._modal-close_dzv9e_46:hover{color:#e8ecf4;background-color:#3d4258}[data-theme=dark] ._modal-footer_dzv9e_67{border-top:1px solid #3d4258}._tooltip_1kuma_4{display:inline-block}._tooltip-trigger_1kuma_7{cursor:pointer;display:inline-block}._tooltip-inner_1kuma_11{color:#fff;white-space:nowrap;z-index:1070;opacity:0;pointer-events:none;background:#000000bf;border-radius:4px;margin-left:-5px;padding:6px 10px;font-size:12px;line-height:1.5;transition:opacity .2s;position:fixed;transform:translate(-50%,-100%)translateY(0)}._tooltip-inner-visible_1kuma_27{opacity:1}._tooltip-content_1kuma_30{text-overflow:ellipsis;white-space:nowrap;max-width:250px;overflow:hidden}._tooltip-arrow_1kuma_36{border:5px solid #0000;border-top-color:#000000bf;width:0;height:0;position:absolute;top:100%;left:50%;transform:translate(-50%)}._dropdown_13j0u_4{display:inline-block;position:relative}._dropdown-trigger_13j0u_8{cursor:pointer;display:inline-block}._dropdown-menu_13j0u_12{z-index:1050;opacity:0;background:#fff;border-radius:6px;margin-top:4px;padding:4px 0;transition:opacity .2s,transform .2s;position:absolute;top:100%;right:0;transform:translateY(8px);box-shadow:0 4px 12px #00000026}._dropdown-menu-visible_13j0u_26{opacity:1;transform:translateY(0)}._dropdown-item_13j0u_30{white-space:nowrap;color:#333;cursor:pointer;padding:4px 8px;font-size:12px;transition:background-color .2s}._dropdown-item_13j0u_30:hover{background-color:#f5f5f5}._dropdown-item_13j0u_30:active{background-color:#e8e8e8}[data-theme=dark] ._dropdown-menu_13j0u_12{background:#2e3350;box-shadow:0 4px 12px #0006}[data-theme=dark] ._dropdown-item_13j0u_30{color:#e8ecf4}[data-theme=dark] ._dropdown-item_13j0u_30:hover{background-color:#3d4258}[data-theme=dark] ._dropdown-item_13j0u_30:active{background-color:#1e2235}._previewArea_1hpuo_2{background:var(--remons-markdown-color-bg-card,#f8f9fa);cursor:grab;border-radius:var(--remons-markdown-radius-base);width:100%;height:100%;position:relative;overflow:hidden}._previewArea_1hpuo_2:active{cursor:grabbing}.mermaid-mini ._previewArea_1hpuo_2{visibility:hidden}.print-preview ._previewArea_1hpuo_2{background:0 0}._previewAreaMin_1hpuo_24{min-height:64px}._previewAreaDisabled_1hpuo_27._previewArea_1hpuo_2,._previewAreaDisabled_1hpuo_27._previewArea_1hpuo_2:active{cursor:default}._previewContent_1hpuo_36{transform-origin:50%;touch-action:pan-y;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._previewContent_1hpuo_36 svg{max-width:100%;max-height:100%;display:block;font-family:var(--remons-markdown-font-family-base)!important}._errorTip_1hpuo_52{color:var(--remons-markdown-color-danger,#ef4444);word-break:break-all;background:#fef2f2;border-bottom:1px solid #fee2e2;flex-shrink:0;max-height:120px;padding:8px 12px;font-size:12px;overflow:auto}._emptyTip_1hpuo_64{color:var(--remons-markdown-color-text-light,#9ca3af);pointer-events:none;justify-content:center;align-items:center;font-size:14px;display:flex;position:absolute;inset:0}.mermaid-react-root{min-height:36px;margin:10px 0}.mermaid-wrapper,.mermaid-loading{background-color:var(--remons-markdown-mermaid-surface,transparent);border-radius:var(--remons-markdown-radius-base);border:1px solid var(--remons-markdown-color-border,#e4e4e4);box-sizing:border-box;transition:background-color .3s ease-in-out;position:relative;overflow:hidden}.mermaid-wrapper.mermaid-mini,.mermaid-loading.mermaid-mini{max-height:36px}.mermaid-wrapper.print-preview,.mermaid-loading.print-preview{background-color:#0000}.mermaid-wrapper.mermaid-collapsed,.mermaid-loading.mermaid-collapsed{max-height:200px}.mermaid-wrapper.mermaid-collapsed:after,.mermaid-loading.mermaid-collapsed:after{pointer-events:none;content:"";background:linear-gradient(to bottom, transparent, var(--remons-markdown-color-bg-white));height:28px;position:absolute;bottom:0;left:0;right:0}.mermaid-wrapper.mermaid-wrapper-fullscreen{background:var(--remons-markdown-mermaid-fullscreen-bg)}.mermaid-wrapper.mermaid-wrapper-fullscreen.mermaid-collapsed{max-height:none}.mermaid-wrapper.mermaid-wrapper-fullscreen:fullscreen{overflow:hidden}.mermaid-wrapper.mermaid-wrapper-fullscreen:fullscreen .mermaid-toolbar{top:4px;right:8px}.mermaid-wrapper-fullscreen-fallback{z-index:1000;background:var(--remons-markdown-mermaid-fullscreen-bg);inset:0;overflow:hidden}.mermaid-wrapper-fullscreen-fallback.mermaid-collapsed{max-height:none}.mermaid-wrapper-fullscreen-fallback .mermaid-toolbar{top:4px;right:8px}.mermaid-loading{justify-content:center;align-items:center;height:200px;display:flex}.mermaid-wrapper svg{display:block}.mermaid-title{align-items:center;font-size:14px;line-height:34px;display:none;position:absolute;left:6px}.mermaid-title .mermaid-title-tag{color:#fc366e;background:#fdf1f6;border-radius:4px;align-items:center;margin-right:4px;display:flex;overflow:hidden}.mermaid-title .mermaid-title-text{box-sizing:border-box;border:1px solid #fc366e;border-left:0;border-radius:0 4px 4px 0;height:20px;margin-left:-1px;padding-left:5px;padding-right:4px;font-size:12px;line-height:18px;display:inline-block}.mermaid-title img{border-radius:0;width:auto;height:20px;margin:0;display:inline-block}.mermaid-mini .mermaid-title{display:flex}.mermaid-toolbar,.mermaid-toolbar-loading{z-index:1;gap:4px;display:inline-flex;position:absolute;top:4px;right:4px}.mermaid-toolbar .remons-markdown-circle,.mermaid-toolbar-loading .remons-markdown-circle{width:24px;height:24px;font-size:12px}.mermaid-toolbar-loading{margin-right:10px}.driver-popover button{box-shadow:none!important}.mermaid-code-modal .markdown{margin-bottom:10px;padding:0 6px}.mermaid-code-modal .markdown pre{margin:0}@media screen and (width<=500px){.mermaid-title{font-size:12px}}:root,html[data-theme=light]{--remons-markdown-color-bg:transparent;--remons-markdown-color-bg-card:transparent;--remons-markdown-color-button:#ffffff26;--remons-markdown-color-toc:#fffc;--remons-markdown-color-bg-white:#fff;--remons-markdown-color-bg-tooltip:#61616141;--remons-markdown-color-text:#61677c;--remons-markdown-color-text-primary:#202124;--remons-markdown-color-text-secondary:#595959;--remons-markdown-color-text-light:#6b7280;--remons-markdown-color-text-placeholder:#999;--remons-markdown-color-shadow:#babecc;--remons-markdown-color-shadow-light:#fff;--remons-markdown-shadow-sm:0 2px 8px #0000000f;--remons-markdown-shadow-inset:inset 1px 1px 2px var(--remons-markdown-color-shadow), inset -1px -1px 2px var(--remons-markdown-color-shadow-light);--remons-markdown-color-primary:#1890ff;--remons-markdown-color-warning:#faad14;--remons-markdown-color-danger:#ef4444;--remons-markdown-color-bg-hover:#f5f5f5;--remons-markdown-color-bg-active:#e6f7ff;--remons-markdown-color-bg-hover-light:#0000000d;--remons-markdown-color-primary-shadow:#1890ff1a;--remons-markdown-color-border:#dbdada;--remons-markdown-color-border-dark:#d0d7de;--remons-markdown-color-button-border:#fffc;--remons-markdown-mermaid-surface:transparent;--remons-markdown-color-table-header:#eef1f4;--remons-markdown-tabs-mask:#fff9;--remons-markdown-font-family-base:Inter, Noto Sans SC, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Microsoft YaHei, sans-serif;--remons-markdown-font-family-editor:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--remons-markdown-radius-base:8px;--remons-markdown-bg-gradient:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%);--remons-markdown-mermaid-fullscreen-bg:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%)}html[data-theme=dark]{--remons-markdown-color-bg:#1a1d2e;--remons-markdown-color-bg-card:#1e2235;--remons-markdown-color-toc:#1e2235b3;--remons-markdown-color-bg-white:#2e3350;--remons-markdown-color-bg-tooltip:#2e3350;--remons-markdown-color-button:#1e2235b3;--remons-markdown-color-text:#b0b8c8;--remons-markdown-color-text-primary:#e8ecf4;--remons-markdown-color-text-secondary:#8892a4;--remons-markdown-color-text-light:#8892a4;--remons-markdown-color-text-placeholder:#6b7280;--remons-markdown-color-shadow:#12141f;--remons-markdown-color-shadow-light:#28304a;--remons-markdown-shadow-sm:-5px -5px 10px var(--remons-markdown-color-shadow-light), 5px 5px 10px var(--remons-markdown-color-shadow);--remons-markdown-shadow-inset:inset 1px 1px 2px var(--remons-markdown-color-shadow), inset -1px -1px 2px var(--remons-markdown-color-shadow-light);--remons-markdown-color-danger:#ef4444;--remons-markdown-color-primary:#40a9ff;--remons-markdown-color-warning:#faad14;--remons-markdown-color-bg-hover:#363b54;--remons-markdown-color-bg-active:#1c3a5f;--remons-markdown-color-bg-hover-light:#ffffff0d;--remons-markdown-color-primary-shadow:#40a9ff26;--remons-markdown-color-border:#2e3350;--remons-markdown-color-border-dark:#3d4258;--remons-markdown-color-button-border:#ffffff1a;--remons-markdown-mermaid-surface:#2e3350;--remons-markdown-color-table-header:#28304a;--remons-markdown-tabs-mask:#2e335099;--remons-markdown-font-family-base:Inter, Noto Sans SC, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Microsoft YaHei, sans-serif;--remons-markdown-font-family-editor:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--remons-markdown-radius-base:8px;--remons-markdown-bg-gradient:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%);--remons-markdown-mermaid-fullscreen-bg:linear-gradient(137deg, #1a1d2e 0%, #232840 100%)}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG9_FnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG-3FnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGwHCnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGzjCnYw.ttf)format("truetype")}.remons-markdown-circle{background-color:var(--color-bg-white);width:40px;height:40px;box-shadow:var(--remons-markdown-shadow-sm);cursor:pointer;border:1px solid var(--remons-markdown-color-button-border);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:100%;justify-content:center;align-items:center;padding:0;transition:box-shadow .2s ease-in-out;display:inline-flex}.remons-markdown-circle:hover{box-shadow:-2px -2px 5px var(--remons-markdown-color-shadow-light), 2px 2px 5px var(--remons-markdown-color-shadow)}.remons-markdown-circle:active{box-shadow:var(--remons-markdown-shadow-inset)}@media screen and (width<=500px){.remons-markdown-circle{box-shadow:-2px -2px 10px var(--remons-markdown-color-shadow-light), 2px 2px 10px var(--remons-markdown-color-shadow);width:30px;height:30px;font-size:12px}}.driver-popover{all:unset;font-family:var(--driver-popover-font-family,"Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif);box-sizing:border-box;color:#2d2d2d;z-index:1000000000;background-color:#fff;border-radius:5px;min-width:250px;max-width:300px;margin:0;padding:15px;position:fixed;top:0;right:0;box-shadow:0 1px 10px #0006}.driver-popover-title{zoom:1;margin:0;font-size:19px;font-weight:700;line-height:1.5;display:block;position:relative}.driver-popover-close-btn{all:unset;cursor:pointer;color:#d2d2d2;z-index:1;text-align:center;width:32px;height:28px;font-size:18px;font-weight:500;transition:color .2s;position:absolute;top:0;right:0}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{zoom:1;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.5}.driver-popover-footer{text-align:right;zoom:1;justify-content:space-between;align-items:center;margin-top:15px;display:flex}.driver-popover-progress-text{color:#727272;zoom:1;font-size:13px;font-weight:400}.driver-popover-footer-btn{all:unset;box-sizing:border-box;color:#2d2d2d;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;border-radius:3px;outline:0;padding:3px 7px;font-size:12px;line-height:1.3;text-decoration:none;display:inline-block}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}.driver-popover-footer-btn:hover,.driver-popover-footer-btn:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{flex-grow:1;justify-content:flex-end;display:flex}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";border:5px solid #fff;position:absolute}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{border-top-color:#0000;border-bottom-color:#0000;border-right-color:#0000;left:100%}.driver-popover-arrow-side-right{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;right:100%}.driver-popover-arrow-side-top{border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%}.driver-popover-arrow-side-bottom{border-top-color:#0000;border-left-color:#0000;border-right-color:#0000;bottom:100%}.driver-popover-arrow-side-center,.driver-popover-arrow-none{display:none}.driver-active .driver-overlay{pointer-events:none}.driver-active.driver-no-scroll{overflow:hidden}.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in var(--driver-animation-duration,.4s) ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in var(--driver-animation-duration,.4s)}.driver-active-element-parent-no-scroll{overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}
|
|
1
|
+
@import "https://at.alicdn.com/t/c/font_2004544_gigrjtfsf6.css";._container_1a6ji_4{z-index:10000;pointer-events:none;flex-direction:column;align-items:center;gap:8px;display:flex;position:fixed;top:8vh;left:50%;transform:translate(-50%)}._item_1a6ji_16{pointer-events:auto}._toast_1a6ji_19{background-color:var(--remons-markdown-color-bg-white);box-shadow:var(--remons-markdown-shadow-sm);border-radius:6px;align-items:center;gap:8px;min-width:200px;padding:10px 20px;font-size:14px;animation:.3s _fadeIn_1a6ji_1;display:flex}._toast-warning_1a6ji_31{color:#faad14}._toast-info_1a6ji_34{color:#1890ff}._toast-error_1a6ji_37{color:#ff4d4f}._toast-success_1a6ji_40{color:#52c41a}@keyframes _fadeIn_1a6ji_1{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}._back-top_gdg5d_4{position:fixed;bottom:20px;right:20px}@media screen and (width<=500px){._back-top_gdg5d_4{width:30px;height:30px}}._empty_container_fkmsv_3{color:#999;flex-direction:column;justify-content:center;align-items:center;gap:12px;height:100%;display:flex}._description_fkmsv_12{font-size:14px}._tocSidebar_j9csj_1{background:var(--remons-markdown-color-toc);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);width:280px;max-height:min(100vh - 120px,100% - 120px);box-shadow:var(--remons-markdown-shadow-sm);z-index:1000;border:1px solid var(--remons-markdown-color-button-border);opacity:0;transform-origin:100% 0;pointer-events:none;border-radius:8px;flex-direction:column;transition:opacity .2s,transform .2s;display:flex;position:absolute;top:70px;right:16px;transform:translateY(-8px)scale(.98)}._tocSidebar_j9csj_1._open_j9csj_21{opacity:1;pointer-events:auto;transform:translateY(0)scale(1)}._tocHeader_j9csj_27{border-bottom:1px solid var(--remons-markdown-color-border);justify-content:space-between;align-items:center;padding:8px 10px;display:flex}._tocHeader_j9csj_27 ._tocTitle_j9csj_34{color:var(--remons-markdown-color-text-primary);font-size:14px;font-weight:600}._tocHeader_j9csj_27 ._tocActions_j9csj_39{align-items:center;gap:6px;display:flex}._tocHeader_j9csj_27 ._tocActions_j9csj_39 .remons-markdown-circle{width:22px;height:22px;font-size:12px}._tocSearchBar_j9csj_49{border-bottom:1px solid var(--remons-markdown-color-border);background:var(--remons-markdown-color-bg);align-items:center;padding:6px 8px;display:flex}._tocSearchBar_j9csj_49 ._tocSearchInput_j9csj_56{border:1px solid var(--remons-markdown-color-border);background:var(--remons-markdown-color-bg);height:28px;color:var(--remons-markdown-color-text);border-radius:4px;outline:none;flex:1;padding:0 8px;font-size:13px}._tocSearchBar_j9csj_49 ._tocSearchInput_j9csj_56::placeholder{color:var(--remons-markdown-color-text-placeholder)}._tocSearchBar_j9csj_49 ._tocSearchInput_j9csj_56:focus{border-color:var(--remons-markdown-color-primary);box-shadow:0 0 0 2px var(--remons-markdown-color-primary-shadow)}._tocSearchBar_j9csj_49 ._tocSearchClear_j9csj_74{cursor:pointer;color:var(--remons-markdown-color-text-placeholder);border-radius:2px;margin-left:4px;padding:4px;font-size:12px;transition:color .2s}._tocSearchBar_j9csj_49 ._tocSearchClear_j9csj_74:hover{color:var(--remons-markdown-color-text-primary)}._tocSearchBar_j9csj_49 ._tocSearchExit_j9csj_86{cursor:pointer;color:var(--remons-markdown-color-text-placeholder);border-radius:4px;margin-left:4px;padding:4px;font-size:16px;transition:color .2s}._tocSearchBar_j9csj_49 ._tocSearchExit_j9csj_86:hover{color:var(--remons-markdown-color-text-primary);background:var(--remons-markdown-color-bg-hover-light)}._tocBody_j9csj_99{flex:1;padding:8px 0 8px 6px;overflow-y:auto}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105{cursor:pointer;border-radius:4px;align-items:center;padding:4px 10px;line-height:20px;transition:all .2s;display:flex;position:relative}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105._active_j9csj_115{color:var(--remons-markdown-color-primary)}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105._active_j9csj_115 ._tocLink_j9csj_118{color:var(--remons-markdown-color-primary);font-weight:500}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocExpandIcon_j9csj_122{color:var(--remons-markdown-color-text-placeholder);cursor:pointer;justify-content:center;align-items:center;width:16px;height:16px;font-size:10px;display:flex;position:absolute;left:-6px}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocExpandIcon_j9csj_122:hover{color:var(--remons-markdown-color-text)}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocLink_j9csj_118{color:var(--remons-markdown-color-text);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;text-decoration:none;overflow:hidden}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocLink_j9csj_118:hover{color:var(--remons-markdown-color-primary)}._tocChildren_j9csj_149{overflow:hidden}._highlight_j9csj_152{color:var(--remons-markdown-color-warning);font-weight:600}._tocEmpty_j9csj_156{text-align:center;color:var(--remons-markdown-color-text-placeholder);padding:20px 12px;font-size:13px}@media screen and (width<=500px){._tocSidebar_j9csj_1{width:250px;max-height:min(100vh - 100px,100% - 110px);line-height:18px;top:60px;right:16px}._tocHeader_j9csj_27{padding:4px 6px}._tocHeader_j9csj_27 ._tocTitle_j9csj_34{font-size:12px}._tocSearchBar_j9csj_49{padding:4px 6px}._tocSearchBar_j9csj_49 ._tocSearchInput_j9csj_56{height:24px;padding:0 4px;font-size:12px}._tocSearchBar_j9csj_49 ._tocSearchExit_j9csj_86{font-size:14px}._tocBody_j9csj_99{padding:2px 0}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105{padding:2px 6px}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocLink_j9csj_118{font-size:12px}._tocItem_j9csj_105 ._tocItemTitle_j9csj_105 ._tocExpandIcon_j9csj_122{width:12px;height:12px;font-size:8px}._tocEmpty_j9csj_156{padding:10px 6px;font-size:12px}}.pswp{--pswp-bg:#000;--pswp-placeholder-bg:#222;--pswp-root-z-index:100000;--pswp-preloader-color:#4f4f4f66;--pswp-preloader-color-secondary:#ffffffe6;--pswp-icon-color:#fff;--pswp-icon-color-secondary:#4f4f4f;--pswp-icon-stroke-color:#4f4f4f;--pswp-icon-stroke-width:2px;--pswp-error-text-color:var(--pswp-icon-color);width:100%;height:100%;z-index:var(--pswp-root-z-index);touch-action:none;opacity:.003;contain:layout style size;-webkit-tap-highlight-color:#0000;outline:0;display:none;position:fixed;top:0;left:0}.pswp:focus{outline:0}.pswp *{box-sizing:border-box}.pswp img{max-width:none}.pswp--open{display:block}.pswp,.pswp__bg{will-change:opacity;transform:translateZ(0)}.pswp__bg{opacity:.005;background:var(--pswp-bg)}.pswp,.pswp__scroll-wrap{overflow:hidden}.pswp__scroll-wrap,.pswp__bg,.pswp__container,.pswp__item,.pswp__content,.pswp__img,.pswp__zoom-wrap{width:100%;height:100%;position:absolute;top:0;left:0}.pswp__img,.pswp__zoom-wrap{width:auto;height:auto}.pswp--click-to-zoom.pswp--zoom-allowed .pswp__img{cursor:-webkit-zoom-in;cursor:-moz-zoom-in;cursor:zoom-in}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.pswp--click-to-zoom.pswp--zoomed-in .pswp__img:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img,.pswp--no-mouse-drag.pswp--zoomed-in .pswp__img:active,.pswp__img{cursor:-webkit-zoom-out;cursor:-moz-zoom-out;cursor:zoom-out}.pswp__container,.pswp__img,.pswp__button,.pswp__counter{-webkit-user-select:none;user-select:none}.pswp__item{z-index:1;overflow:hidden}.pswp__hidden{display:none!important}.pswp__content{pointer-events:none}.pswp__content>*{pointer-events:auto}.pswp__error-msg-container{display:grid}.pswp__error-msg{color:var(--pswp-error-text-color);margin:auto;font-size:1em;line-height:1}.pswp .pswp__hide-on-close{opacity:.005;will-change:opacity;transition:opacity var(--pswp-transition-duration) cubic-bezier(.4, 0, .22, 1);z-index:10;pointer-events:none}.pswp--ui-visible .pswp__hide-on-close{opacity:1;pointer-events:auto}.pswp__button{cursor:pointer;width:50px;height:60px;box-shadow:none;opacity:.85;-webkit-appearance:none;-webkit-touch-callout:none;background:0 0;border:0;margin:0;padding:0;display:block;position:relative;overflow:hidden}.pswp__button:hover,.pswp__button:active,.pswp__button:focus{box-shadow:none;opacity:1;background:0 0;border:0;padding:0;transition:none}.pswp__button:disabled{opacity:.3;cursor:auto}.pswp__icn{fill:var(--pswp-icon-color);color:var(--pswp-icon-color-secondary);pointer-events:none;width:32px;height:32px;position:absolute;top:14px;left:9px;overflow:hidden}.pswp__icn-shadow{stroke:var(--pswp-icon-stroke-color);stroke-width:var(--pswp-icon-stroke-width);fill:none}.pswp__icn:focus{outline:0}div.pswp__img--placeholder,.pswp__img--with-bg{background:var(--pswp-placeholder-bg)}.pswp__top-bar{z-index:10;flex-direction:row;justify-content:flex-end;width:100%;height:60px;display:flex;position:absolute;top:0;left:0;pointer-events:none!important}.pswp__top-bar>*{pointer-events:auto;will-change:opacity}.pswp__button--close{margin-right:6px}.pswp__button--arrow{width:75px;height:100px;margin-top:-50px;position:absolute;top:50%}.pswp__button--arrow:disabled{cursor:default;display:none}.pswp__button--arrow .pswp__icn{background:0 0;border-radius:0;width:60px;height:60px;margin-top:-30px;top:50%}.pswp--one-slide .pswp__button--arrow{display:none}.pswp--touch .pswp__button--arrow{visibility:hidden}.pswp--has_mouse .pswp__button--arrow{visibility:visible}.pswp__button--arrow--prev{left:0;right:auto}.pswp__button--arrow--next{right:0}.pswp__button--arrow--next .pswp__icn{left:auto;right:14px;transform:scaleX(-1)}.pswp__button--zoom{display:none}.pswp--zoom-allowed .pswp__button--zoom{display:block}.pswp--zoomed-in .pswp__zoom-icn-bar-v{display:none}.pswp__preloader{width:50px;height:60px;margin-right:auto;position:relative;overflow:hidden}.pswp__preloader .pswp__icn{opacity:0;transition:opacity .2s linear;animation:.6s linear infinite pswp-clockwise}.pswp__preloader--active .pswp__icn{opacity:.85}@keyframes pswp-clockwise{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.pswp__counter{margin-top:15px;height:30px;color:var(--pswp-icon-color);text-shadow:1px 1px 3px var(--pswp-icon-color-secondary);opacity:.85;margin-inline-start:20px;font-size:14px;line-height:30px}.pswp--one-slide .pswp__counter{display:none}.pswp.md-image-preview{--pswp-bg:#12141eb8}html[data-theme=dark] .pswp.md-image-preview{--pswp-bg:#060810c7}.pswp.md-image-preview .pswp__bg{-webkit-backdrop-filter:blur(6px)saturate(1.1)}.pswp.md-image-preview .pswp__top-bar{background-image:linear-gradient(#00000052,#0000)}.hljs{color:#f8f8f2;background:#23241f}.hljs-tag,.hljs-subst{color:#f8f8f2}.hljs-strong,.hljs-emphasis{color:#a8a8a2}.hljs-bullet,.hljs-quote,.hljs-number,.hljs-regexp,.hljs-literal,.hljs-link{color:#ae81ff}.hljs-code,.hljs-title,.hljs-section,.hljs-selector-class{color:#a6e22e}.hljs-strong{font-weight:700}.hljs-keyword,.hljs-selector-tag,.hljs-name,.hljs-attr{color:#f92672}.hljs-symbol,.hljs-attribute{color:#66d9ef}.hljs-params,.hljs-title.class_,.hljs-class .hljs-title{color:#f8f8f2}.hljs-string,.hljs-type,.hljs-built_in,.hljs-selector-id,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-addition,.hljs-variable,.hljs-template-variable{color:#e6db74}.hljs-comment,.hljs-deletion,.hljs-meta{color:#75715e;font-family:var(--remons-markdown-font-family-editor)}.markdown-tabs-tabs-wrapper{border-radius:4px;margin-top:2px;position:relative}.markdown-tabs-tabs-wrapper:after{content:"";pointer-events:none;z-index:10;opacity:0;height:30px;transition:opacity .4s;position:absolute;top:0;left:0;right:0}.markdown-tabs-tabs-wrapper.has-left-mask:after{opacity:1;background:linear-gradient(to right, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 15%)}.markdown-tabs-tabs-wrapper.has-right-mask:after{opacity:1;background:linear-gradient(to left, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 10%)}.markdown-tabs-tabs-wrapper.has-both-masks:after{opacity:1;background:linear-gradient(to right, var(--remons-markdown-tabs-mask,#fff9) 0%, transparent 15%, transparent 85%, var(--remons-markdown-tabs-mask,#fff9) 100%)}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-header{z-index:2;background:0 0;display:flex;top:0;overflow:auto hidden}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-header::-webkit-scrollbar{display:none}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button{cursor:pointer;background-color:var(--remons-markdown-color-button);-webkit-backdrop-filter:blur(10px);border:1px solid var(--remons-markdown-color-button-border);min-width:50px;box-shadow:var(--remons-markdown-shadow-sm);border-bottom:none;border-radius:8px 8px 0 0;margin:0 2px;padding:6px 8px;font-size:14px;font-weight:400;transition:background-color .3s ease-in-out,color .3s ease-in-out;position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:last-child{border-right:none;margin-right:0}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:first-child{margin-left:0}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button:hover{background-color:var(--remons-markdown-color-bg-hover);color:var(--remons-markdown-color-primary)}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-button.active{color:var(--remons-markdown-color-primary);box-shadow:var(--remons-markdown-shadow-inset);position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tabs-container{position:relative}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-content{border:1px solid var(--remons-markdown-color-button-border);background-color:var(--remons-markdown-color-button);box-shadow:var(--remons-markdown-shadow-sm);border-radius:0 8px 8px;height:auto;padding:2px 10px 0;display:none;overflow:hidden}.markdown-tabs-tabs-wrapper .markdown-tabs-tab-content.active{display:block}[data-theme=dark] .markdown-tabs-tab-button{color:#afafaf;background:#263238;border-color:#1a1d2e}[data-theme=dark] .markdown-tabs-tab-button:hover{background:#2e3350}[data-theme=dark] .markdown-tabs-tab-button.active{background:#2e3350;border:1px solid #2e3350}[data-theme=dark] .markdown-tabs-tab-content{border-color:#2e3350}:root{--vp-c-grey-text:#656869;--vp-c-grey-hover:#e4e4e9;--vp-c-grey-bg:#ebebef;--vp-c-grey-soft:#8e96aa24;--vp-c-purple-text:#6f42c1;--vp-c-purple-hover:#7e4cc9;--vp-c-purple-bg:#8e5cd9;--vp-c-purple-soft:#9f7aea24;--vp-c-blue-text:#2888a7;--vp-c-blue-hover:#2d98ba;--vp-c-blue-bg:#2fa1c5;--vp-c-blue-soft:#1bb2e524;--vp-c-green-text:#18794e;--vp-c-green-hover:#299764;--vp-c-green-bg:#30a46c;--vp-c-green-soft:#10b98124;--vp-c-yellow-text:#915930;--vp-c-yellow-hover:#946300;--vp-c-yellow-bg:#c28100;--vp-c-yellow-soft:#eab30824;--vp-c-red-text:#b8272c;--vp-c-red-hover:#d5393e;--vp-c-red-bg:#e0575b;--vp-c-red-soft:#f43f5e24}[data-theme=dark]{--vp-c-grey-text:#939499;--vp-c-grey-hover:#414853;--vp-c-grey-bg:#32363f;--vp-c-grey-soft:#65758529;--vp-c-blue-text:#c9e8f2;--vp-c-blue-hover:#a6d9ea;--vp-c-blue-bg:#2785a3;--vp-c-blue-soft:#1bb2e529;--vp-c-purple-text:#c8abfa;--vp-c-purple-hover:#a879e6;--vp-c-purple-bg:#8e5cd9;--vp-c-purple-soft:#9f7aea29;--vp-c-green-text:#3dd68c;--vp-c-green-hover:#30a46c;--vp-c-green-bg:#298459;--vp-c-green-soft:#10b98129;--vp-c-yellow-text:#f9b44e;--vp-c-yellow-hover:#da8b17;--vp-c-yellow-bg:#a46a0a;--vp-c-yellow-soft:#eab30829;--vp-c-red-text:#f66f81;--vp-c-red-hover:#f14158;--vp-c-red-bg:#b62a3c;--vp-c-red-soft:#f43f5e29}.markdown .markdown-alert{color:inherit;border-radius:8px;margin:4px 0 8px;padding:6px 10px}.markdown .markdown-alert blockquote{border-left:none;margin:0;padding:0}.markdown .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;display:flex;position:relative}.markdown .markdown-alert .markdown-alert-title .iconfont{padding-right:4px}@media print{.markdown .markdown-alert{break-inside:avoid;page-break-inside:avoid}}.markdown .markdown-alert.markdown-alert-note{background:var(--vp-c-grey-soft)}.markdown .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--vp-c-grey-text)}.markdown .markdown-alert.markdown-alert-important{background:var(--vp-c-purple-soft)}.markdown .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--vp-c-purple-text)}.markdown .markdown-alert.markdown-alert-tip{background:var(--vp-c-green-soft)}.markdown .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--vp-c-green-text)}.markdown .markdown-alert.markdown-alert-warning{background:var(--vp-c-yellow-soft)}.markdown .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--vp-c-yellow-text)}.markdown .markdown-alert.markdown-alert-caution{background:var(--vp-c-red-soft)}.markdown .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--vp-c-red-text)}.markdown{cursor:initial;box-sizing:border-box;color:var(--remons-markdown-color-text-primary);letter-spacing:.01em;background:var(--remons-markdown-color-bg,#f6f8fa);padding:10px 8px 0;font-family:Inter,Noto Sans SC,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;font-size:16px;font-weight:400;line-height:1.75;position:relative}.markdown .markdown-footer{align-items:center;margin-top:10px;font-size:12px;display:flex}.markdown .markdown-word-count{text-align:right;color:var(--remons-markdown-color-text-secondary,#57606a);-webkit-user-select:none;user-select:none;margin-top:8px;font-size:12px;line-height:1.5}.markdown .create-time{background:var(--remons-markdown-color-bg-tooltip,#61616141);color:var(--remons-markdown-color-text,#ffffffde);float:left;border-radius:4px;padding:0 4px;font-weight:400}.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6{color:var(--remons-markdown-color-text-primary);letter-spacing:0;font-weight:700;line-height:1.35;position:relative}.markdown h1,.markdown h2,.markdown h3,.markdown h4{margin:6px 0}.markdown h5,.markdown h6{margin:4px 0}.markdown h1:first-child,.markdown h2:first-child,.markdown h3:first-child,.markdown h4:first-child,.markdown h5:first-child,.markdown h6:first-child{margin-top:0}.markdown h1{font-size:22px}.markdown h2{font-size:20px}.markdown h3{font-size:18px}.markdown h4{font-size:17px}.markdown h5{font-size:15px}.markdown h6{font-size:14px}.markdown p{word-break:break-word;white-space:pre-line;margin:2px 0 6px;font-size:16px;line-height:22px}.markdown p:empty{margin:0}.markdown ul,.markdown ol{margin:0 0 10px;padding-left:1.5em}.markdown ul li,.markdown ol li{margin:4px 0;font-size:16px;line-height:22px}.markdown ul li p,.markdown ol li p{margin:0}.markdown blockquote{color:var(--remons-markdown-color-text-secondary,#57606a);background:var(--remons-markdown-color-bg-card,#f6f8fa);border-left:4px solid var(--remons-markdown-color-border-dark,#d0d7de);border-radius:0 6px 6px 0;margin:6px 0;padding:4px 6px}.markdown blockquote p:last-child{margin-bottom:0}.markdown img{border-radius:var(--remons-markdown-radius-base,6px);object-fit:cover;object-position:top;cursor:zoom-in;width:auto;max-width:100%;max-height:200px;margin:8px 0;display:block}.markdown table{border:1px solid var(--remons-markdown-color-border-dark,#d0d7de);border-spacing:0;border-collapse:separate;border-radius:6px;max-width:100%;margin:10px 0;display:inline-block;overflow:auto}.markdown table thead{background-color:var(--remons-markdown-color-table-header,#f6f8fa);text-align:left;vertical-align:bottom}.markdown table td,.markdown table th{border-right:1px solid var(--remons-markdown-color-border-dark,#d0d7de);border-bottom:1px solid var(--remons-markdown-color-border-dark,#d0d7de);min-width:56px;padding:6px 8px;font-size:15px;line-height:20px}.markdown table tr:last-child td{border-bottom:0}.markdown table td:last-child,.markdown table th:last-child{border-right:0}@media (prefers-color-scheme:dark){.markdown:not([data-theme]) table thead{background-color:var(--remons-markdown-color-table-header,#2b3046)}}.markdown ul.contains-task-list{padding-left:0}.markdown ul.contains-task-list li.task-list-item{align-items:center;list-style:none;display:flex}.markdown ul.contains-task-list li.task-list-item .task-list-item-checkbox{vertical-align:middle;width:15px;height:15px;margin-right:4px}.markdown .markdown-html{color:var(--remons-markdown-color-text-primary)}.markdown .markdown-html .header-anchor{opacity:0;color:var(--remons-markdown-color-text-placeholder,#999);text-decoration:none;transition:opacity .2s ease-in-out}.markdown .markdown-html h1:hover .header-anchor,.markdown .markdown-html h2:hover .header-anchor,.markdown .markdown-html h3:hover .header-anchor,.markdown .markdown-html h4:hover .header-anchor,.markdown .markdown-html h5:hover .header-anchor,.markdown .markdown-html h6:hover .header-anchor{opacity:1}.markdown code{color:#c7254df1;font-family:var(--remons-markdown-font-family-editor);background:#f9f2f4;border-radius:5px;margin:0 2px;padding:2px 6px;font-size:.9em;line-height:1.5}.markdown pre:has(code.mermaid-render-noCode){display:none}.markdown pre{color:#f8f8f2;cursor:auto;font-family:var(--remons-markdown-font-family-editor);background-color:#263238;border-radius:10px;margin:10px 0;font-size:14px;font-weight:400;line-height:1.6;position:relative;overflow:hidden;box-shadow:inset 5px 5px 10px #0f1416,inset -5px -5px 10px #3d505a}.markdown pre code{width:calc(100% - 32px);color:inherit;font-size:inherit;line-height:inherit;background-color:#0000;border-radius:0;margin:0;padding:4px 16px 0;display:inline-block;overflow:auto}.markdown pre .pre-handle{color:#c9d1d9;background:#242933;justify-content:space-between;align-items:center;height:32px;padding-left:16px;padding-right:10px;font-size:12px;line-height:32px;display:flex}.markdown pre .pre-handle>span{font-family:var(--remons-markdown-font-family-editor);align-items:center;display:inline-flex}.markdown pre .pre-handle .traffic-lights{align-items:center;gap:4px;margin-right:6px;display:inline-flex}.markdown pre .pre-handle .traffic-lights .traffic-light{border-radius:50%;width:8px;height:8px}.markdown pre .pre-handle .traffic-lights .traffic-light-red{background:#ff5f56}.markdown pre .pre-handle .traffic-lights .traffic-light-yellow{background:#ffbd2e}.markdown pre .pre-handle .traffic-lights .traffic-light-green{background:#27c93f}.markdown pre .pre-handle .code-toggle{margin-left:10px}.markdown pre .pre-handle .copy,.markdown pre .pre-handle .code-toggle{cursor:pointer;font-size:14px}.markdown pre.code-collapsed{max-height:32px;overflow:hidden}.markdown pre.code-collapsed code{overflow:hidden}.markdown a{color:var(--remons-markdown-color-text-primary)}.markdown iframe{border-radius:var(--remons-markdown-radius-base,6px);width:100%;max-height:300px}.markdown .katex .katex-base{font-family:math;font-size:14px}.markdown .mdNum{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1.2em;line-height:1}.markdown .mdNumWide{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1.14em;line-height:1}.markdown .mdNumCjk{font-family:Segoe UI Symbol,Noto Sans Symbols2,Apple Symbols,PingFang SC,Microsoft YaHei,sans-serif;font-size:1em;line-height:1}:where(.markdown) a{text-decoration:underline}html[data-theme=dark] .markdown table thead{background-color:var(--remons-markdown-color-table-header,#2b3046)}@media screen and (width<=500px){.markdown iframe{max-height:150px}}@media print{.markdown table{width:100%;display:table}.markdown-word-count{display:none}.code-handle{display:none!important}.katex-mathml{display:none}}._tocToggle_9mueg_1{position:absolute;top:16px;right:16px}._modal-mask_dzv9e_4{z-index:1000;opacity:0;background-color:#00000073;justify-content:center;align-items:center;transition:opacity .3s;display:flex;position:fixed;inset:0}._modal-mask-visible_dzv9e_18{opacity:1}._modal_dzv9e_4{background:#fff;border-radius:8px;flex-direction:column;max-height:90vh;transition:transform .3s;display:flex;transform:scale(.9);box-shadow:0 6px 16px #00000026}._modal-mask-visible_dzv9e_18 ._modal_dzv9e_4{transform:scale(1)}._modal-header_dzv9e_34{border-bottom:1px solid #f0f0f0;justify-content:space-between;align-items:center;padding:10px;display:flex}._modal-title_dzv9e_41{color:#333;font-size:16px;font-weight:500}._modal-close_dzv9e_46{color:#999;cursor:pointer;border-radius:4px;justify-content:center;align-items:center;width:32px;height:32px;font-size:20px;transition:all .2s;display:flex}._modal-close_dzv9e_46:hover{color:#333;background-color:#f5f5f5}._modal-body_dzv9e_62{flex:1;padding:6px;overflow:auto}._modal-footer_dzv9e_67{text-align:right;border-top:1px solid #f0f0f0;padding:16px 24px}[data-theme=dark] ._modal_dzv9e_4{background:#2e3350;box-shadow:0 6px 16px #0006}[data-theme=dark] ._modal-header_dzv9e_34{border-bottom:1px solid #3d4258}[data-theme=dark] ._modal-title_dzv9e_41{color:#e8ecf4}[data-theme=dark] ._modal-close_dzv9e_46{color:#8892a4}[data-theme=dark] ._modal-close_dzv9e_46:hover{color:#e8ecf4;background-color:#3d4258}[data-theme=dark] ._modal-footer_dzv9e_67{border-top:1px solid #3d4258}._tooltip_1kuma_4{display:inline-block}._tooltip-trigger_1kuma_7{cursor:pointer;display:inline-block}._tooltip-inner_1kuma_11{color:#fff;white-space:nowrap;z-index:1070;opacity:0;pointer-events:none;background:#000000bf;border-radius:4px;margin-left:-5px;padding:6px 10px;font-size:12px;line-height:1.5;transition:opacity .2s;position:fixed;transform:translate(-50%,-100%)translateY(0)}._tooltip-inner-visible_1kuma_27{opacity:1}._tooltip-content_1kuma_30{text-overflow:ellipsis;white-space:nowrap;max-width:250px;overflow:hidden}._tooltip-arrow_1kuma_36{border:5px solid #0000;border-top-color:#000000bf;width:0;height:0;position:absolute;top:100%;left:50%;transform:translate(-50%)}._dropdown_13j0u_4{display:inline-block;position:relative}._dropdown-trigger_13j0u_8{cursor:pointer;display:inline-block}._dropdown-menu_13j0u_12{z-index:1050;opacity:0;background:#fff;border-radius:6px;margin-top:4px;padding:4px 0;transition:opacity .2s,transform .2s;position:absolute;top:100%;right:0;transform:translateY(8px);box-shadow:0 4px 12px #00000026}._dropdown-menu-visible_13j0u_26{opacity:1;transform:translateY(0)}._dropdown-item_13j0u_30{white-space:nowrap;color:#333;cursor:pointer;padding:4px 8px;font-size:12px;transition:background-color .2s}._dropdown-item_13j0u_30:hover{background-color:#f5f5f5}._dropdown-item_13j0u_30:active{background-color:#e8e8e8}[data-theme=dark] ._dropdown-menu_13j0u_12{background:#2e3350;box-shadow:0 4px 12px #0006}[data-theme=dark] ._dropdown-item_13j0u_30{color:#e8ecf4}[data-theme=dark] ._dropdown-item_13j0u_30:hover{background-color:#3d4258}[data-theme=dark] ._dropdown-item_13j0u_30:active{background-color:#1e2235}._previewArea_1hpuo_2{background:var(--remons-markdown-color-bg-card,#f8f9fa);cursor:grab;border-radius:var(--remons-markdown-radius-base);width:100%;height:100%;position:relative;overflow:hidden}._previewArea_1hpuo_2:active{cursor:grabbing}.mermaid-mini ._previewArea_1hpuo_2{visibility:hidden}.print-preview ._previewArea_1hpuo_2{background:0 0}._previewAreaMin_1hpuo_24{min-height:64px}._previewAreaDisabled_1hpuo_27._previewArea_1hpuo_2,._previewAreaDisabled_1hpuo_27._previewArea_1hpuo_2:active{cursor:default}._previewContent_1hpuo_36{transform-origin:50%;touch-action:pan-y;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._previewContent_1hpuo_36 svg{max-width:100%;max-height:100%;display:block;font-family:var(--remons-markdown-font-family-base)!important}._errorTip_1hpuo_52{color:var(--remons-markdown-color-danger,#ef4444);word-break:break-all;background:#fef2f2;border-bottom:1px solid #fee2e2;flex-shrink:0;max-height:120px;padding:8px 12px;font-size:12px;overflow:auto}._emptyTip_1hpuo_64{color:var(--remons-markdown-color-text-light,#9ca3af);pointer-events:none;justify-content:center;align-items:center;font-size:14px;display:flex;position:absolute;inset:0}.mermaid-react-root{min-height:36px;margin:10px 0}.mermaid-wrapper,.mermaid-loading{background-color:var(--remons-markdown-mermaid-surface,transparent);border-radius:var(--remons-markdown-radius-base);border:1px solid var(--remons-markdown-color-border,#e4e4e4);box-sizing:border-box;transition:background-color .3s ease-in-out;position:relative;overflow:hidden}.mermaid-wrapper.mermaid-mini,.mermaid-loading.mermaid-mini{max-height:36px}.mermaid-wrapper.print-preview,.mermaid-loading.print-preview{background-color:#0000}.mermaid-wrapper.mermaid-collapsed,.mermaid-loading.mermaid-collapsed{max-height:200px}.mermaid-wrapper.mermaid-collapsed:after,.mermaid-loading.mermaid-collapsed:after{pointer-events:none;content:"";background:linear-gradient(to bottom, transparent, var(--remons-markdown-color-bg-white));height:28px;position:absolute;bottom:0;left:0;right:0}.mermaid-wrapper.mermaid-wrapper-fullscreen{background:var(--remons-markdown-mermaid-fullscreen-bg)}.mermaid-wrapper.mermaid-wrapper-fullscreen.mermaid-collapsed{max-height:none}.mermaid-wrapper.mermaid-wrapper-fullscreen:fullscreen{overflow:hidden}.mermaid-wrapper.mermaid-wrapper-fullscreen:fullscreen .mermaid-toolbar{top:4px;right:8px}.mermaid-wrapper-fullscreen-fallback{z-index:1000;background:var(--remons-markdown-mermaid-fullscreen-bg);inset:0;overflow:hidden}.mermaid-wrapper-fullscreen-fallback.mermaid-collapsed{max-height:none}.mermaid-wrapper-fullscreen-fallback .mermaid-toolbar{top:4px;right:8px}.mermaid-loading{justify-content:center;align-items:center;height:200px;display:flex}.mermaid-wrapper svg{display:block}.mermaid-title{align-items:center;font-size:14px;line-height:34px;display:none;position:absolute;left:6px}.mermaid-title .mermaid-title-tag{color:#fc366e;background:#fdf1f6;border-radius:4px;align-items:center;margin-right:4px;display:flex;overflow:hidden}.mermaid-title .mermaid-title-text{box-sizing:border-box;border:1px solid #fc366e;border-left:0;border-radius:0 4px 4px 0;height:20px;margin-left:-1px;padding-left:5px;padding-right:4px;font-size:12px;line-height:18px;display:inline-block}.mermaid-title img{border-radius:0;width:auto;height:20px;margin:0;display:inline-block}.mermaid-mini .mermaid-title{display:flex}.mermaid-toolbar,.mermaid-toolbar-loading{z-index:1;gap:4px;display:inline-flex;position:absolute;top:4px;right:4px}.mermaid-toolbar .remons-markdown-circle,.mermaid-toolbar-loading .remons-markdown-circle{width:24px;height:24px;font-size:12px}.mermaid-toolbar-loading{margin-right:10px}.driver-popover button{box-shadow:none!important}.mermaid-code-modal .markdown{margin-bottom:10px;padding:0 6px}.mermaid-code-modal .markdown pre{margin:0}@media screen and (width<=500px){.mermaid-title{font-size:12px}}:root,html[data-theme=light]{--remons-markdown-color-bg:transparent;--remons-markdown-color-bg-card:transparent;--remons-markdown-color-button:#ffffff26;--remons-markdown-color-toc:#fffc;--remons-markdown-color-bg-white:#fff;--remons-markdown-color-bg-tooltip:#61616141;--remons-markdown-color-text:#61677c;--remons-markdown-color-text-primary:#202124;--remons-markdown-color-text-secondary:#595959;--remons-markdown-color-text-light:#6b7280;--remons-markdown-color-text-placeholder:#999;--remons-markdown-color-shadow:#babecc;--remons-markdown-color-shadow-light:#fff;--remons-markdown-shadow-sm:0 2px 8px #0000000f;--remons-markdown-shadow-inset:inset 1px 1px 2px var(--remons-markdown-color-shadow), inset -1px -1px 2px var(--remons-markdown-color-shadow-light);--remons-markdown-color-primary:#1890ff;--remons-markdown-color-warning:#faad14;--remons-markdown-color-danger:#ef4444;--remons-markdown-color-bg-hover:#f5f5f5;--remons-markdown-color-bg-active:#e6f7ff;--remons-markdown-color-bg-hover-light:#0000000d;--remons-markdown-color-primary-shadow:#1890ff1a;--remons-markdown-color-border:#dbdada;--remons-markdown-color-border-dark:#d0d7de;--remons-markdown-color-button-border:#fffc;--remons-markdown-mermaid-surface:transparent;--remons-markdown-color-table-header:#eef1f4;--remons-markdown-tabs-mask:#fff9;--remons-markdown-font-family-base:Inter, Noto Sans SC, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Microsoft YaHei, sans-serif;--remons-markdown-font-family-editor:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--remons-markdown-radius-base:8px;--remons-markdown-bg-gradient:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%);--remons-markdown-mermaid-fullscreen-bg:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%)}html[data-theme=dark]{--remons-markdown-color-bg:#1a1d2e;--remons-markdown-color-bg-card:#1e2235;--remons-markdown-color-toc:#1e2235b3;--remons-markdown-color-bg-white:#2e3350;--remons-markdown-color-bg-tooltip:#2e3350;--remons-markdown-color-button:#1e2235b3;--remons-markdown-color-text:#b0b8c8;--remons-markdown-color-text-primary:#e8ecf4;--remons-markdown-color-text-secondary:#8892a4;--remons-markdown-color-text-light:#8892a4;--remons-markdown-color-text-placeholder:#6b7280;--remons-markdown-color-shadow:#12141f;--remons-markdown-color-shadow-light:#28304a;--remons-markdown-shadow-sm:-5px -5px 10px var(--remons-markdown-color-shadow-light), 5px 5px 10px var(--remons-markdown-color-shadow);--remons-markdown-shadow-inset:inset 1px 1px 2px var(--remons-markdown-color-shadow), inset -1px -1px 2px var(--remons-markdown-color-shadow-light);--remons-markdown-color-danger:#ef4444;--remons-markdown-color-primary:#40a9ff;--remons-markdown-color-warning:#faad14;--remons-markdown-color-bg-hover:#363b54;--remons-markdown-color-bg-active:#1c3a5f;--remons-markdown-color-bg-hover-light:#ffffff0d;--remons-markdown-color-primary-shadow:#40a9ff26;--remons-markdown-color-border:#2e3350;--remons-markdown-color-border-dark:#3d4258;--remons-markdown-color-button-border:#ffffff1a;--remons-markdown-mermaid-surface:#2e3350;--remons-markdown-color-table-header:#28304a;--remons-markdown-tabs-mask:#2e335099;--remons-markdown-font-family-base:Inter, Noto Sans SC, -apple-system, BlinkMacSystemFont, Segoe UI, PingFang SC, Microsoft YaHei, sans-serif;--remons-markdown-font-family-editor:SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;--remons-markdown-radius-base:8px;--remons-markdown-bg-gradient:linear-gradient(137deg, #e5f4ff 0%, #efe7ff 100%);--remons-markdown-mermaid-fullscreen-bg:linear-gradient(137deg, #1a1d2e 0%, #232840 100%)}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf)format("truetype")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG9_FnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:500;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaG-3FnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:600;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGwHCnYw.ttf)format("truetype")}@font-face{font-family:Noto Sans SC;font-style:normal;font-weight:700;font-display:swap;src:url(https://fonts.gstatic.com/s/notosanssc/v41/k3kCo84MPvpLmixcA63oeAL7Iqp5IZJF9bmaGzjCnYw.ttf)format("truetype")}.remons-markdown-circle{background-color:var(--color-bg-white);width:40px;height:40px;box-shadow:var(--remons-markdown-shadow-sm);cursor:pointer;border:1px solid var(--remons-markdown-color-button-border);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border-radius:100%;justify-content:center;align-items:center;padding:0;transition:box-shadow .2s ease-in-out;display:inline-flex}.remons-markdown-circle:hover{box-shadow:-2px -2px 5px var(--remons-markdown-color-shadow-light), 2px 2px 5px var(--remons-markdown-color-shadow)}.remons-markdown-circle:active{box-shadow:var(--remons-markdown-shadow-inset)}@media screen and (width<=500px){.remons-markdown-circle{box-shadow:-2px -2px 10px var(--remons-markdown-color-shadow-light), 2px 2px 10px var(--remons-markdown-color-shadow);width:30px;height:30px;font-size:12px}}.driver-popover{all:unset;font-family:var(--driver-popover-font-family,"Helvetica Neue", Inter, ui-sans-serif, "Apple Color Emoji", Helvetica, Arial, sans-serif);box-sizing:border-box;color:#2d2d2d;z-index:1000000000;background-color:#fff;border-radius:5px;min-width:250px;max-width:300px;margin:0;padding:15px;position:fixed;top:0;right:0;box-shadow:0 1px 10px #0006}.driver-popover-title{zoom:1;margin:0;font-size:19px;font-weight:700;line-height:1.5;display:block;position:relative}.driver-popover-close-btn{all:unset;cursor:pointer;color:#d2d2d2;z-index:1;text-align:center;width:32px;height:28px;font-size:18px;font-weight:500;transition:color .2s;position:absolute;top:0;right:0}.driver-popover-close-btn:hover,.driver-popover-close-btn:focus{color:#2d2d2d}.driver-popover-title[style*=block]+.driver-popover-description{margin-top:5px}.driver-popover-description{zoom:1;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.5}.driver-popover-footer{text-align:right;zoom:1;justify-content:space-between;align-items:center;margin-top:15px;display:flex}.driver-popover-progress-text{color:#727272;zoom:1;font-size:13px;font-weight:400}.driver-popover-footer-btn{all:unset;box-sizing:border-box;color:#2d2d2d;cursor:pointer;zoom:1;background-color:#fff;border:1px solid #ccc;border-radius:3px;outline:0;padding:3px 7px;font-size:12px;line-height:1.3;text-decoration:none;display:inline-block}.driver-popover-footer .driver-popover-btn-disabled{opacity:.5;pointer-events:none}.driver-popover-footer-btn:hover,.driver-popover-footer-btn:focus{background-color:#f7f7f7}.driver-popover-navigation-btns{flex-grow:1;justify-content:flex-end;display:flex}.driver-popover-navigation-btns button+button{margin-left:4px}.driver-popover-arrow{content:"";border:5px solid #fff;position:absolute}.driver-popover-arrow-side-over{display:none}.driver-popover-arrow-side-left{border-top-color:#0000;border-bottom-color:#0000;border-right-color:#0000;left:100%}.driver-popover-arrow-side-right{border-top-color:#0000;border-bottom-color:#0000;border-left-color:#0000;right:100%}.driver-popover-arrow-side-top{border-bottom-color:#0000;border-left-color:#0000;border-right-color:#0000;top:100%}.driver-popover-arrow-side-bottom{border-top-color:#0000;border-left-color:#0000;border-right-color:#0000;bottom:100%}.driver-popover-arrow-side-center,.driver-popover-arrow-none{display:none}.driver-active .driver-overlay{pointer-events:none}.driver-active.driver-no-scroll{overflow:hidden}.driver-active *{pointer-events:none}.driver-active .driver-active-element,.driver-active .driver-active-element *,.driver-popover,.driver-popover *{pointer-events:auto}@keyframes animate-fade-in{0%{opacity:0}to{opacity:1}}.driver-fade .driver-overlay{animation:animate-fade-in var(--driver-animation-duration,.4s) ease-in-out}.driver-fade .driver-popover{animation:animate-fade-in var(--driver-animation-duration,.4s)}.driver-active-element-parent-no-scroll{overflow:hidden!important}.driver-no-interaction,.driver-no-interaction *{pointer-events:none!important}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { useIncrementalRender, MD_PERSIST_ATTR } from './hooks/useIncrementalRen
|
|
|
8
8
|
import { addExcludedSelector, removeExcludedSelector } from './components/ImagePreview';
|
|
9
9
|
import { ThemeProvider, useTheme, initTheme, ThemeMode } from './hooks/useTheme';
|
|
10
10
|
import { registerCdn } from './utils/cdn';
|
|
11
|
+
import { countWords, formatWordCount, DEFAULT_WORD_COUNT_TEMPLATE, WordCountResult } from './utils/wordCount';
|
|
11
12
|
export default RenderMarkdown;
|
|
12
|
-
export type { RenderMarkdownProps, MarkdownPlugin, AnchorItem, ThemeMode, ICircledClass };
|
|
13
|
-
export { markdownFormat, languagesCommon, initHighlighter, defaultValidateLink, circledNumbers, DEFAULT_CIRCLED_CLASS, MermaidChart, renderMermaid, useIncrementalRender, MD_PERSIST_ATTR, addExcludedSelector, removeExcludedSelector, ThemeProvider, useTheme, initTheme, registerCdn, };
|
|
13
|
+
export type { RenderMarkdownProps, MarkdownPlugin, AnchorItem, ThemeMode, ICircledClass, WordCountResult };
|
|
14
|
+
export { countWords, formatWordCount, DEFAULT_WORD_COUNT_TEMPLATE, markdownFormat, languagesCommon, initHighlighter, defaultValidateLink, circledNumbers, DEFAULT_CIRCLED_CLASS, MermaidChart, renderMermaid, useIncrementalRender, MD_PERSIST_ATTR, addExcludedSelector, removeExcludedSelector, ThemeProvider, useTheme, initTheme, registerCdn, };
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import e,{createContext as t,forwardRef as
|
|
2
|
-
return
|
|
3
|
-
/* @__PURE__ */
|
|
4
|
-
/* @__PURE__ */
|
|
5
|
-
/* @__PURE__ */
|
|
6
|
-
/* @__PURE__ */
|
|
7
|
-
return
|
|
8
|
-
/* @__PURE__ */
|
|
9
|
-
/* @__PURE__ */
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */F("div",{className:xe.tocBody,ref:o,children:k.length>0?k.map((e,n)=>/* @__PURE__ */F(Ne,{item:e,activeId:t,searchText:u},e.href||n)):u&&/* @__PURE__ */F("div",{className:xe.tocEmpty,children:"未找到匹配项"})})]}):null}),$e=/* @__PURE__ */new Set(["[ ]","[x]","[X]"]);function Ie(e){e.core.ruler.after("inline","github-task-lists-empty",e=>{const t=e.tokens;for(let n=0;n<t.length;n++){const e=t[n];if("inline"!==e.type)continue;const r=e.content;if(!$e.has(r))continue;let o=n-1;if(o>=0&&"paragraph_open"===t[o].type&&(o-=1),o<0||"list_item_open"!==t[o].type)continue;ze(t[o],"task-list-item");for(let n=o-1;n>=0;n--)if("bullet_list_open"===t[n].type||"ordered_list_open"===t[n].type){ze(t[n],"contains-task-list");break}const i=new e.constructor("html_inline","",0);i.content="[ ]"===r?'<input class="task-list-item-checkbox" disabled="" type="checkbox">':'<input class="task-list-item-checkbox" checked="" disabled="" type="checkbox">',e.children=[i],e.content=""}})}function ze(e,t){const n=(e.attrGet("class")||"").split(/\s+/).filter(Boolean);n.includes(t)||e.attrSet("class",[...n,t].join(" "))}var Pe=/(\d\uFE0F?\u20E3)|([\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u3251-\u325F\u32B1-\u32BF])\uFE0F?/g,qe=[10111,10121,10131],Fe={base:"mdNum",wide:"mdNumWide",cjk:"mdNumCjk"};function je(e){const t=Number(e.charAt(0));return 0===t?"⓪":String.fromCharCode(9312+t-1)}function De(e,t){return function(e){return e>=12881&&e<=12895||e>=12977&&e<=12991}(e)?t.cjk||t.wide:function(e){return e>=9321&&e<=9331||e>=9341&&e<=9351||e>=9361&&e<=9371||e>=9451&&e<=9460||e>=12881&&e<=12895||e>=12977&&e<=12991||qe.indexOf(e)>=0}(e)?t.wide:t.base}function Oe(e,t){return`<span class="${De(e.codePointAt(0)||0,t)}">${e}</span>`}function Be(e,t=Fe){e.core.ruler.after("inline","circled-numbers",e=>{for(let n=0;n<e.tokens.length;n++){const r=e.tokens[n];"inline"===r.type&&r.children&&Re(e,r.children,t)}})}function Re(e,t,n){const r=e.Token;for(let o=0;o<t.length;o++){const e=t[o];if("text"!==e.type||!Pe.test(e.content))continue;Pe.lastIndex=0;const i=[];let c,s=0;for(;c=Pe.exec(e.content);){const t=c[1]?je(c[1]):c[2];if(c.index>s){const t=new r("text","",0);t.content=e.content.slice(s,c.index),i.push(t)}const o=new r("html_inline","",0);o.content=Oe(t,n),i.push(o),s=c.index+c[0].length}if(s<e.content.length){const t=new r("text","",0);t.content=e.content.slice(s),i.push(t)}t.splice(o,1,...i),o+=i.length-1}}var He=/^(vbscript|javascript|file|data):/,We=/^data:image\/(gif|png|jpeg|webp);/,Ge=/^data:image\/svg\+xml[;,]/i,Ve=/<\s*script|\bon[a-z]+\s*=|<!ENTITY|foreignobject/i;function Ue(e){const t=e.trim().toLowerCase();if(!He.test(t))return!0;if(We.test(t))return!0;if(!Ge.test(t))return!1;const n=function(e){const t=e.indexOf(",");if(t<0)return null;const n=e.slice(0,t),r=e.slice(t+1);try{return/;base64/i.test(n)?"function"==typeof atob?atob(r):null:decodeURIComponent(r)}catch{return null}}(e);return null!==n&&!Ve.test(n)}var Ke={note:"注",tip:"提示",important:"重要",warning:"注意",caution:"警告"},Ze={note:'<i class="iconfont icon-note"></i>',tip:'<i class="iconfont icon-tip"></i>',important:'<i class="iconfont icon-important"></i>',warning:'<i class="iconfont icon-warning"></i>',caution:'<i class="iconfont icon-caution"></i>'};function Xe(e){return e.replace(/[\u{1F000}-\u{1FFFF}\u{200D}\u{FE0F}\u{2600}-\u{27BF}\u{2300}-\u{23FF}\u{2700}-\u{27BF}]/gu,"").trim()}var Ye="markdown-tabs",Je=`.${Ye}-tabs-header`,Qe=`.${Ye}-tabs-wrapper`,et=`.${Ye}-tab-button`,tt=`.${Ye}-tab-content`,nt="data-md-user-active",rt="data-md-src-active",ot="data-md-tabs-count",it=!1,ct=(e,t)=>{const n=e.getAttribute("data-tab");return null!==n&&/^\d+$/.test(n)?Number(n):Array.from(t.querySelectorAll(et)).indexOf(e)},st=e=>{const t=e.querySelector(Je);if(!t)return-1;const n=t.querySelector(`${et}[data-active]`);return n?ct(n,t):-1};function at(e,t,n){const r=t.querySelectorAll(et),o=n.querySelectorAll(tt);r.forEach(e=>e.classList.remove("active")),o.forEach(e=>e.classList.remove("active"));const i=r[e];if(!i)return;i.classList.add("active");const c=n.querySelector(`${tt}[data-index="${e}"]`)??o[e];c&&c.classList.add("active")}function lt(e){e.querySelectorAll(Qe).forEach(e=>{const t=e.getAttribute(nt);if(null===t||!/^\d+$/.test(t))return;const n=e.querySelector(Je),r=e.querySelector(`.${Ye}-tabs-container`);if(!n||!r)return;const o=()=>{e.removeAttribute(nt),e.removeAttribute(rt),e.removeAttribute(ot)};if(Number(e.getAttribute(rt))!==st(e))return void o();if(Number(e.getAttribute(ot))!==n.querySelectorAll(et).length)return void o();const i=Number(t);if(!n.querySelectorAll(et)[i])return;const c=n.querySelector(`${et}.active`);c&&ct(c,n)!==i&&at(i,n,r)})}var dt=e=>{const t=e.target?.closest(et);if(!t)return;const n=t.closest(Je);if(!n)return;const r=n.closest(`.${Ye}-tabs-wrapper`)?.querySelector(`.${Ye}-tabs-container`);r&&function(e,t,n){const r=ct(e,t);at(r,t,n);const o=e.closest(Qe);o&&(o.setAttribute(nt,String(r)),o.setAttribute(rt,String(st(o))),o.setAttribute(ot,String(t.querySelectorAll(et).length)));const i=e.closest(".markdown"),c=e.offsetParent;i&&c&&i.scrollTop>c.offsetTop&&i.scrollTo({top:c.offsetTop,behavior:"smooth"})}(t,n,r)},ut=e=>{const t=e.target?.closest(Je);t&&0!==Math.abs(e.deltaY)&&(t.scrollWidth<=t.clientWidth||(e.preventDefault(),t.scrollLeft+=e.deltaY))};function mt(e){if(e.dataset.maskInited)return;e.dataset.maskInited="1";const t=e.parentElement;if(!t)return;const n=()=>{const{scrollLeft:n,scrollWidth:r,clientWidth:o}=e,i=n>1,c=n+o<r-1;t.classList.remove("has-left-mask","has-right-mask","has-both-masks"),i&&c?t.classList.add("has-both-masks"):i?t.classList.add("has-left-mask"):c&&t.classList.add("has-right-mask")};e.addEventListener("scroll",n),n()}var ht=!1;var pt=!1;function ft(){it||(it=!0,document.addEventListener("click",dt),document.addEventListener("wheel",ut,{passive:!1,capture:!0})),document.querySelectorAll(Je).forEach(e=>mt(e)),ht||"undefined"==typeof MutationObserver||(ht=!0,new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{if(1!==e.nodeType)return;const t=e;t.classList.contains("markdown-tabs-tabs-header")&&mt(t),t.querySelectorAll(Je).forEach(e=>mt(e))})})}).observe(document.body,{childList:!0,subtree:!0})),pt||(pt=!0,window.addEventListener("resize",()=>{document.querySelectorAll(Je).forEach(e=>{e.dispatchEvent(new Event("scroll"))})}))}var gt="0.18.1",wt=`https://registry.npmmirror.com/katex/${gt}/files/dist/katex.min.css`,vt=`https://registry.npmmirror.com/katex/${gt}/files/dist/katex.min.js`,yt=null;function bt(e,t={}){const n={throwOnError:!1,errorColor:"#cc0000",...t};function r(e,t){try{return function(){if(!window.katex)throw new Error("[katex-loader] KaTeX not loaded. Call ensureKatexLoaded() first.");return window.katex}().renderToString(e,{...n,displayMode:t})}catch(r){const t=r instanceof Error?r.message:String(r);return`<span style="color:${n.errorColor}" title="${o(t)}">${o(e)}</span>`}}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}"undefined"!=typeof window&&window.katex||console.warn("[markdown-it-katex] KaTeX is not loaded yet. Call `await ensureKatexLoaded()` before using this plugin, or use `renderWithKatex()` helper instead."),e.inline.ruler.before("emphasis","katex_inline",(e,t)=>{if(36!==e.src.charCodeAt(e.pos))return!1;if(36===e.src.charCodeAt(e.pos+1))return!1;if(e.pos>0&&92===e.src.charCodeAt(e.pos-1))return!1;const n=e.pos+1;if(n>=e.posMax)return!1;if(/\s/.test(e.src[n]))return!1;let r=n;for(;r<e.posMax&&(36!==e.src.charCodeAt(r)||92===e.src.charCodeAt(r-1));)r++;if(r>=e.posMax)return!1;if(r===n)return!1;if(/\s/.test(e.src[r-1]))return!1;if(!t){const t=e.push("katex_inline","math",0);t.markup="$",t.content=e.src.slice(n,r)}return e.pos=r+1,!0}),e.block.ruler.after("blockquote","katex_block",(e,t,n,r)=>{const o=e.bMarks[t]+e.tShift[t];if(o+2>e.eMarks[t]||"$$"!==e.src.slice(o,o+2))return!1;if(r)return!0;let i=t+1,c=!1;for(;i<n;){const t=e.bMarks[i]+e.tShift[i];if("$$"===e.src.slice(t,e.eMarks[i]).trim()){c=!0;break}i++}const s=e.bMarks[t+1],a=c?e.bMarks[i]:e.eMarks[n-1];e.line=i+(c?1:0);const l=e.push("katex_block","math",0);return l.block=!0,l.markup="$$",l.content=e.src.slice(s,a).trim(),l.map=[t,e.line],!0}),e.renderer.rules.katex_inline=(e,t)=>r(e[t].content,!1),e.renderer.rules.katex_block=(e,t)=>`<div class="katex-block">${r(e[t].content,!0)}</div>\n`}function kt(e){return"string"!=typeof e?"":e.trim().toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-|-$/g,"").replace(/-+/g,"-")}function _t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Et(e){const t=[],n=[];for(let r=0;r<e.length;r++){const o=e[r];if("heading_open"!==o.type)continue;const i=Number((o.tag||"").slice(1));if(!Number.isInteger(i)||i<1||i>6)continue;const c=e[r+1],s="inline"===c?.type?(c.content||"").trim():"";if(!s)continue;const a=o.attrGet("id"),l={title:s,href:("string"==typeof a?a:"")||kt(s),nodeName:`H${i}`,nodeTitle:`<h${i}>${_t(s)}</h${i}>`,children:[]};for(;n.length&&n[n.length-1].level>=i;)n.pop();const d=n[n.length-1];d?d.item.children.push(l):t.push(l),n.push({level:i,item:l})}return t}async function St(e,t,n){const r="string"==typeof e?e:null==e?"":String(e);let o=!0;try{await function(e=15e3){return yt||("undefined"==typeof window?Promise.reject(/* @__PURE__ */new Error("[katex-loader] Requires a browser environment.")):window.katex?Promise.resolve():yt=new Promise((t,n)=>{const r=setTimeout(()=>{yt=null,n(/* @__PURE__ */new Error(`[katex-loader] KaTeX CDN timeout after ${e}ms.`))},e),o=document.querySelector(`script[src="${vt}"]`);if(o)return window.katex?(clearTimeout(r),void t()):(o.addEventListener("load",()=>{clearTimeout(r),t()}),void o.addEventListener("error",()=>{clearTimeout(r),yt=null,n(/* @__PURE__ */new Error(`[katex-loader] Failed to load ${vt}`))}));if(!document.querySelector(`link[href="${wt}"]`)){const e=document.createElement("link");e.rel="stylesheet",e.href=wt,document.head.appendChild(e)}const i=document.createElement("script");i.src=vt,i.onload=()=>{clearTimeout(r),t()},i.onerror=()=>{clearTimeout(r),yt=null,i.remove(),n(/* @__PURE__ */new Error(`[katex-loader] Failed to load ${vt}`))},document.head.appendChild(i)}))}()}catch(l){o=!1,console.warn("[render-markdown] KaTeX 加载失败,公式将降级为纯文本:",l)}const i=function(){const e=/* @__PURE__ */new Set;return t=>{let n=t,r=1;for(;e.has(n);)n=`${t}-${r}`,r+=1;return e.add(n),n}}(),c=new R({langPrefix:"language-",html:n?.html??!0,highlight:function(e,t){if(t&&G.getLanguage(t))try{return G.highlight(e,{language:t}).value}catch(n){}return""}}).use(V,{name:Ye}).use(H,{permalink:H.permalink.linkInsideHeader({class:"header-anchor",symbol:"#",placement:"after"}),slugify:e=>i(kt(e))}).use(W,{matcher:e=>e.match(/^https?:\/\//),attrs:{target:"_blank",rel:"noopener"}}).use(U,{titles:Ke,icons:Ze}).use(K).use(Ie).use(Be);o&&c.use(bt,{strict:!1,throwOnError:!1}),t&&t.forEach(e=>c.use(e)),c.validateLink=n?.validateLink??Ue;const s=c.parse(r,{});!function(e,t){let n=null;for(let l=e.length-1;l>=0;l--)if("fence"===e[l].type){n=e[l];break}if(!n||!n.map)return;const r=t.split("\n"),o=n.map[0],i=n.markup||"```",c="~"===i[0]?"~":"`",s=Math.max(3,i.length),a=new RegExp("^ {0,3}"+c+"{"+s+",}[ \\t]*$");for(let l=o+1;l<r.length;l++)if(a.test(r[l]))return;n.attrJoin("class","md-fence-open")}(s,r),o||(c.renderer.rules.katex_inline=(e,t)=>_t(e[t].content||""),c.renderer.rules.katex_block=(e,t)=>`<code>${_t(e[t].content||"")}</code>\n`);const a=c.renderer.render(s,c.options,{}).replace(/class="markdown-alert markdown-alert-(\w+)"[\s\S]*?class="markdown-alert-title"[^>]*>([\s\S]*?)<\/p>/g,(e,t,n)=>{const r=Ke[t];if(!r)return e;const o=Xe(n.replace(/<[^>]*>/g,""));if(o.toLowerCase()===t.toLowerCase()){const t=n.lastIndexOf(">");if(-1!==t){const i=n.substring(0,t+1)+Xe(n.substring(t+1)).replace(o,r);return e.replace(n,i)}}return e});return queueMicrotask(()=>ft()),{anchor:Et(s),info:a}}function Ct(e){e&&"object"==typeof e?Object.entries(e).forEach(([e,t])=>{G.getLanguage(e)||G.registerLanguage(e,t)}):console.warn("[render-markdown] initHighlighter 需要传入一个语言包对象")}var Lt="data-md-persist",xt="mermaid-react-root",Nt="data-md-mermaid-src",Tt=/* @__PURE__ */new WeakMap,Mt=["pre",`.${xt}`];function At(e){(Array.isArray(e)?e:[e]).forEach(e=>{Mt.includes(e)||Mt.push(e)})}function $t(e){(Array.isArray(e)?e:[e]).forEach(e=>{const t=Mt.indexOf(e);t>=0&&Mt.splice(t,1)})}var It=(e,t)=>t.some(t=>null!==e.closest(t))||Mt.some(t=>null!==e.closest(t));function zt(e){const t=e.currentSrc||e.src,n={src:t,msrc:t,alt:e.alt||void 0,element:e.isConnected?e:void 0};e.naturalWidth&&e.naturalHeight&&(n.width=e.naturalWidth,n.height=e.naturalHeight);const r=e.getAttribute("srcset")||"";return/\d+w/.test(r)&&(n.srcset=r),n}var Pt=0,qt=null;function Ft(e,t){if(e.active)return;const n=e.images.indexOf(t);if(n<0)return;const r=new Z({dataSource:e.images.map(zt),index:n,bgOpacity:1,initialZoomLevel:"fit",secondaryZoomLevel:1,maxZoomLevel:2,padding:{top:24,bottom:24,left:24,right:24},showHideAnimationType:"zoom",preload:[1,2],loop:!1,wheelToZoom:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",pinchToClose:!0,closeOnVerticalDrag:!0,clickToCloseNonZoomable:!0,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,mainClass:"md-image-preview",errorMsg:"图片加载失败",closeTitle:"关闭",zoomTitle:"放大 / 缩小",arrowPrevTitle:"上一张",arrowNextTitle:"下一张",counterTitle:"当前图片序号"});e.active=r;let o=!1,i=()=>{};const c=()=>{o||(o=!0,(Pt=Math.max(0,Pt-1))>0||null===qt||(document.documentElement.style.overflow=qt,qt=null),i())};if(r.on("close",c),r.on("destroy",()=>{c(),e.active===r&&(e.active=null)}),!1===r.init())return void(e.active=null);!function(){if("undefined"==typeof document)return;if((Pt+=1)>1)return;const e=document.documentElement;qt=e.style.overflow,e.style.overflow="hidden"}();const s=()=>{const e=r.currSlide?.zoomLevels;e&&e.fit&&(e.min=Math.min(e.min,.5*e.fit))};r.on("change",s),r.on("loadComplete",s),window.addEventListener("resize",s),s(),i=()=>window.removeEventListener("resize",s)}var jt=/* @__PURE__ */new Map;function Dt(e,t){const n=jt.get(e);n?n.push(t):jt.set(e,[t])}function Ot(e){const t=jt.get(e);t&&(t.forEach(e=>{try{e.unmount()}catch{}}),jt.delete(e))}function Bt(e){return jt.get(e)?.[0]}function Rt(){jt.forEach((e,t)=>{t.isConnected||Ot(t)})}function Ht(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return`${t.toString(36)}-${e.length.toString(36)}`}function Wt(e){return!!e&&e.classList.contains("mermaid-react-root")&&e.hasAttribute("data-md-mermaid-src")}function Gt(e){if(e)return 1===e.nodeType&&e.classList?.contains("mermaid-react-root")?(Ot(e),void e.remove()):void e.querySelectorAll(`.${xt}`).forEach(e=>{Ot(e),e.remove()})}var Vt=/* @__PURE__ */new Set(["mermaid-render-noCode","code-collapsed","has-left-mask","has-right-mask","has-both-masks","active"]),Ut=["mermaid-render-noCode","code-collapsed","has-left-mask","has-right-mask","has-both-masks"],Kt=/* @__PURE__ */new Set(["data-tab","data-index","data-id","data-active"]),Zt=e=>{const t="string"==typeof e.className?e.className:"";return t?t.split(/\s+/).filter(e=>e&&!e.startsWith("copy-")&&!Vt.has(e)).join(" "):""},Xt=e=>{const t=e.getAttribute("id");return t?`id:${t}`:(e=>{const t=Zt(e);return t?`${e.tagName.toLowerCase()}#${t}`:""})(e)},Yt="data-md-mounted",Jt=e=>{const t=e.getAttribute("data-md-key");return`${e.tagName.toLowerCase()}#${t??Zt(e)}`},Qt=e=>Array.from(e.attributes).some(e=>e.name.endsWith("-placeholder")),en=e=>{const t={};for(const n of Array.from(e.attributes))n.name.startsWith("data-")&&"data-md-persist"!==n.name&&"data-md-key"!==n.name&&(n.name.endsWith("-placeholder")||(t[n.name]=n.value));return t},tn=e=>{const t=e.querySelector(`[${Yt}]`);return t||(Array.from(e.querySelectorAll("*")).find(Qt)??null)},nn=e=>{const t=[];e.querySelectorAll(`[${Lt}]`).forEach(e=>{const n=e;n.classList.contains("pre-handle")||n.classList.contains("mermaid-react-root")||n.parentElement?.closest("[data-md-persist]")||t.push(n)});const n=t.map(e=>{const t=tn(e);return{el:e,key:Jt(e),configEl:t,mounted:t?.hasAttribute(Yt)??!1}});return n.forEach(e=>e.el.remove()),n},rn=(e,t,n)=>{if(0===t.length)return;const r=/* @__PURE__ */new Set;Array.from(e.querySelectorAll("*")).filter(e=>Qt(e)).forEach(e=>{const n=e.closest(`[${Lt}]`);if(!n)return;const o=Jt(n),i=t.find(t=>t.key===o&&!r.has(t)&&!!t.configEl&&((e,t)=>{const n=en(t),r=en(e);return Object.keys(n).every(e=>r[e]===n[e])})(t.configEl,e));i&&(r.add(i),n.replaceWith(i.el))});const o=Array.from(e.querySelectorAll(`[${Lt}]`));t.forEach(t=>{if(r.has(t)||t.configEl)return;if(t.el.isConnected)return;const n=Jt(t.el),i=Xt(t.el),c=o.find(e=>e!==t.el&&e.isConnected&&!tn(e)&&(Jt(e)===n||Xt(e)===i));c?c.replaceWith(t.el):e.appendChild(t.el),r.add(t)}),n&&t.forEach(e=>{e.el.isConnected||n(e.el)})},on=(e,t)=>{const n=Array.from(e.children);e.innerHTML="",t&&n.forEach(e=>t(e))};function cn({content:e,codeType:t,customRenderers:n,throttleMs:r=16,html:i=!0,validateLink:s,onNodeDiscarded:a,onPatched:u}){const[m,h]=d([]),[p,f]=d(!1),g=l(""),w=l(null),v=l(!0),y=l(0),b=l({codeType:t,customRenderers:n,throttleMs:r,html:i,validateLink:s}),k=l({onNodeDiscarded:a,onPatched:u});k.current={onNodeDiscarded:a,onPatched:u};const _=l(null),E=o(async(e,t,n=0)=>{const{codeType:r,customRenderers:o,html:i,validateLink:c}=b.current,s=r&&"md"!==r?.toLocaleLowerCase()?"```"+r+"\n"+e+"\n```":e;let a;const l=()=>{t!==y.current||n>=2||(null!=_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=null,t===y.current&&E(e,t,n+1)},300))};try{a=await St(s,o,{html:i,validateLink:c})}catch(m){return console.error("[useIncrementalRender] markdown 渲染失败,保留上一版 DOM:",m),void l()}if(!a||t!==y.current)return;const d=a.info??"",u=(e=0)=>{if(t!==y.current)return;const n=w.current;if(!n)return void(e<60?setTimeout(()=>u(e+1),0):console.warn("[useIncrementalRender] 容器未挂载,放弃本轮 patch(源码与渲染可能不一致)"));if(h(a.anchor||[]),""===d.trim()){const e=nn(n);return on(n,k.current.onNodeDiscarded),e.forEach(e=>{e.el.isConnected||k.current.onNodeDiscarded?.(e.el)}),g.current=s,v.current=!0,f(!1),void k.current.onPatched?.()}if(v.current)return n.innerHTML=d,v.current=!1,void(g.current=s);const r=document.createElement("div");r.innerHTML=d;const o=nn(n),i=((e,t)=>{const n=/* @__PURE__ */new WeakMap,r=e=>{const t=/* @__PURE__ */new Map,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let o=r.nextNode();o;o=r.nextNode()){const e=o,r=Xt(e);if(!r)continue;const i=t.get(r);n.set(e,void 0===i?r:`${r}[${i}]`),t.set(r,(i??0)+1)}};return r(e),r(t),n})(n,r),c=/* @__PURE__ */new WeakMap,l=/* @__PURE__ */new WeakMap;X(n,r,{childrenOnly:!0,getNodeKey:e=>1===e.nodeType?i.get(e)??null:null,onBeforeElUpdated(e,t){const n=/* @__PURE__ */new Map;for(const o of Array.from(e.attributes))o.name.startsWith("data-")&&!Kt.has(o.name)&&(t.hasAttribute(o.name)||n.set(o.name,o.value));n.size&&c.set(e,n);const r=Ut.filter(n=>e.classList.contains(n)&&!t.classList.contains(n));return r.length&&l.set(e,r),!0},onElUpdated(e){const t=c.get(e);t&&(t.forEach((t,n)=>e.setAttribute(n,t)),c.delete(e));const n=l.get(e);n&&(n.forEach(t=>e.classList.add(t)),l.delete(e))},onBeforeNodeAdded:e=>(1!==e.nodeType||!e.classList.contains("pre-handle"))&&e,onBeforeNodeDiscarded:e=>1!==e.nodeType||!e.hasAttribute("data-md-persist"),onNodeDiscarded(e){1===e.nodeType&&k.current.onNodeDiscarded&&k.current.onNodeDiscarded(e)}}),rn(n,o,k.current.onNodeDiscarded),g.current=s,k.current.onPatched?.()};try{u()}catch(m){console.error("[useIncrementalRender] DOM patch 失败:",m),l()}},[]),S=l(0),C=l(null),L=o((e,t)=>{const n=b.current.throttleMs,r=Date.now()-S.current,o=()=>{S.current=Date.now(),E(e,t)};if(r>=n)return null!=C.current&&(clearTimeout(C.current),C.current=null),void o();null!=C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,t===y.current&&o()},n-r)},[E]);return c(()=>{const{codeType:t}=b.current;if(!e){y.current+=1,null!=_.current&&(clearTimeout(_.current),_.current=null),v.current=!0,f(!1),h([]),g.current="";const e=w.current;return void(e&&on(e,k.current.onNodeDiscarded))}const n=t&&"md"!==t?.toLocaleLowerCase()?"```"+t+"\n"+e+"\n```":e;if(g.current===n)return;y.current+=1;const r=y.current;f(!0),v.current?E(e,r):L(e,r)},[e,E,L]),c(()=>()=>{y.current+=1,null!=C.current&&(clearTimeout(C.current),C.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)},[]),{anchors:m,hasContent:p,setInnerRef:o(e=>{w.current=e},[])}}var sn="_tocToggle_1egap_1",an=/* @__PURE__ */new Map,ln=e=>{const t=e.querySelector("code");return t?gn(t):""},dn=e=>{const t=e.querySelector("code");return t?ln(e)+"\0"+(t.textContent??""):null},un=e=>{const t=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map;return e?.querySelectorAll("pre").forEach(e=>{const o=e;if(!o.querySelector("code"))return;const i=(e=>{const t=e.nextElementSibling;return Wt(t)?t:null})(o);i&&r.set(o,i);const c=dn(o);if(c){const e=t.get(c);e?e.push(o):t.set(c,[o])}const s=ln(o),a=n.get(s);a?a.push(o):n.set(s,[o])}),{exact:t,byLanguage:n,charts:r}},mn=0,hn=e=>({enableMermaid:e.enableMermaid??e.isSlotMermaid??!0,showCollapseButton:e.showCollapseButton??e.isShowCollapsed??!0,toolbarDebounceMs:e.toolbarDebounceMs??e.mermaidDebounce??pn,incremental:e.incremental??e.useIncremental??!1,transformSource:e.transformSource??e.chartConfig,html:e.html??!0}),pn=100;function fn({preNode:e}){const[t,n]=d(()=>e.classList.contains("code-collapsed")),r=l(null);c(()=>()=>r.current?.cancel(),[]);/* @__PURE__ */
|
|
12
|
-
return
|
|
13
|
-
/* @__PURE__ */
|
|
14
|
-
/* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */F("div",{className:
|
|
18
|
-
|
|
19
|
-
return F("div",{
|
|
20
|
-
return
|
|
21
|
-
return
|
|
22
|
-
|
|
1
|
+
import e,{createContext as t,forwardRef as r,memo as n,useCallback as o,useContext as c,useEffect as i,useLayoutEffect as s,useMemo as a,useRef as l,useState as d}from"react";import{CaretDownOutlined as u,CaretRightOutlined as m,CheckCircleOutlined as h,CloseCircleOutlined as p,CloseOutlined as f,CodeOutlined as g,CopyFilled as w,DownOutlined as v,DownloadOutlined as y,DragOutlined as b,ExportOutlined as k,FullscreenExitOutlined as _,FullscreenOutlined as S,ImportOutlined as E,InfoCircleOutlined as C,LoadingOutlined as L,MinusOutlined as x,PlusOutlined as N,ReloadOutlined as T,RightOutlined as M,SearchOutlined as A,UnorderedListOutlined as $,UpOutlined as j,WarningOutlined as z}from"@ant-design/icons";import{createRoot as I}from"react-dom/client";import{Fragment as P,jsx as q,jsxs as F}from"react/jsx-runtime";import D from"classnames";import{IsPC as O,copy as B}from"methods-r";import W from"markdown-it";import R from"markdown-it-anchor";import H from"markdown-it-link-attributes";import G from"highlight.js/lib/core";import{tab as V}from"@mdit/plugin-tab";import U from"markdown-it-github-alerts";import K from"markdown-it-task-lists";import Z from"photoswipe";import X from"morphdom";import Y from"highlight.js/lib/languages/javascript";import J from"highlight.js/lib/languages/typescript";import Q from"highlight.js/lib/languages/css";import ee from"highlight.js/lib/languages/json";import te from"highlight.js/lib/languages/bash";import re from"highlight.js/lib/languages/xml";import ne from"highlight.js/lib/languages/plaintext";import{createPortal as oe}from"react-dom";import ce from"@panzoom/panzoom";import{driver as ie}from"driver.js";var se=Object.create,ae=Object.defineProperty,le=Object.getOwnPropertyDescriptor,de=Object.getOwnPropertyNames,ue=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty,he=(e,t)=>{let r={};for(var n in e)ae(r,n,{get:e[n],enumerable:!0});return t||ae(r,Symbol.toStringTag,{value:"Module"}),r},pe=/* @__PURE__ */((e,t,r)=>(r=null!=e?se(ue(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var o,c=de(t),i=0,s=c.length;i<s;i++)o=c[i],me.call(e,o)||o===r||ae(e,o,{get:(e=>t[e]).bind(null,o),enumerable:!(n=le(t,o))||n.enumerable});return e})(!t&&e&&e.__esModule&&me.call(e,"default")?r:ae(r,"default",{value:e,enumerable:!0}),e)))(/* @__PURE__ */((e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports))((e,t)=>{!function(){var e={}.hasOwnProperty;function r(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=o(e,n.call(this,r)))}return e}function n(t){if("string"==typeof t||"number"==typeof t)return this&&this[t]||t;if("object"!=typeof t)return"";if(Array.isArray(t))return r.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var n="";for(var c in t)e.call(t,c)&&t[c]&&(n=o(n,this&&this[c]||c));return n}function o(e,t){return t?e?e+" "+t:e+t:e}void 0!==t&&t.exports?(r.default=r,t.exports=r):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return r}):window.classNames=r}()})(),1),fe={container:"_container_1a6ji_4",item:"_item_1a6ji_16",toast:"_toast_1a6ji_19",fadeIn:"_fadeIn_1a6ji_1","toast-warning":"_toast-warning_1a6ji_31","toast-info":"_toast-info_1a6ji_34","toast-error":"_toast-error_1a6ji_37","toast-success":"_toast-success_1a6ji_40"},ge=pe.default.bind(fe),we={warning:/* @__PURE__ */q(z,{style:{color:"#faad14",fontSize:"16px"}}),info:/* @__PURE__ */q(C,{style:{color:"#1890ff",fontSize:"16px"}}),error:/* @__PURE__ */q(p,{style:{color:"#ff4d4f",fontSize:"16px"}}),success:/* @__PURE__ */q(h,{style:{color:"#52c41a",fontSize:"16px"}})},ve=({config:e})=>/* @__PURE__ */F("div",{className:ge("toast",`toast-${e.type}`),children:[we[e.type],/* @__PURE__ */q("span",{children:e.content})]}),ye=()=>{const[e,t]=d([]),r=l(/* @__PURE__ */new Map);return i(()=>{const e=e=>{const{type:n,content:o,duration:c=3e3}=e.detail,i=`message-${Date.now()}-${Math.random()}`,s={key:i,content:o,type:n,duration:c};t(e=>[...e,s]);const a=window.setTimeout(()=>{(e=>{t(t=>t.filter(t=>t.key!==e));const n=r.current.get(e);n&&(clearTimeout(n),r.current.delete(e))})(i)},c);r.current.set(i,a)},n=()=>{t([]),r.current.forEach(e=>clearTimeout(e)),r.current.clear()};return window.addEventListener("custom-message",e),window.addEventListener("custom-message-clear",n),()=>{window.removeEventListener("custom-message",e),window.removeEventListener("custom-message-clear",n),r.current.forEach(e=>clearTimeout(e))}},[]),/* @__PURE__ */q("div",{className:ge("container"),children:e.map(e=>/* @__PURE__ */q("div",{className:ge("item"),children:/* @__PURE__ */q(ve,{config:e})},e.key))})},be=!1,ke={dispatch:(e,t,r)=>{(()=>{if(be)return;be=!0;const e=document.createElement("div");e.id="custom-message-container",document.body.appendChild(e),I(e).render(/* @__PURE__ */q(ye,{}))})(),requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent("custom-message",{detail:{type:e,content:t,duration:r}}))})},warning:(e,t)=>ke.dispatch("warning",e,t),info:(e,t)=>ke.dispatch("info",e,t),error:(e,t)=>ke.dispatch("error",e,t),success:(e,t)=>ke.dispatch("success",e,t),destroy:()=>{window.dispatchEvent(new Event("custom-message-clear"))}},_e=pe.default.bind({"back-top":"_back-top_gdg5d_4"});var Se=n(({target:e,visibilityHeight:t=300})=>{const[r,n]=d(!1),o=l(null);i(()=>{let r=!1,c=0,i=0;const s=()=>{const e=o.current;e&&n(function(e){return e===window?window.scrollY||document.documentElement.scrollTop:e.scrollTop}(e)>t)},a=()=>{if(r)return;const t=e?e():"undefined"!=typeof window?window:null;t?(e=>{o.current=e,e.addEventListener("scroll",s,{passive:!0}),s()})(t):i++>=240||(c=requestAnimationFrame(a))};return a(),()=>{r=!0,cancelAnimationFrame(c),o.current?.removeEventListener("scroll",s),o.current=null}},[e,t]);return r?/* @__PURE__ */q("div",{className:`${_e("back-top")} remons-markdown-circle`,onClick:()=>{o.current?.scrollTo({top:0,behavior:"smooth"})},children:/* @__PURE__ */q(j,{})}):null}),Ee="_empty_container_fkmsv_3",Ce="_description_fkmsv_12";function Le({description:e="暂无数据"}){/* @__PURE__ */
|
|
2
|
+
return F("div",{className:Ee,children:[/* @__PURE__ */F("svg",{width:"64",height:"64",viewBox:"0 0 64 64",fill:"none",children:[
|
|
3
|
+
/* @__PURE__ */q("rect",{x:"8",y:"16",width:"48",height:"36",rx:"4",stroke:"#d9d9d9",strokeWidth:"2"}),
|
|
4
|
+
/* @__PURE__ */q("line",{x1:"16",y1:"28",x2:"48",y2:"28",stroke:"#d9d9d9",strokeWidth:"2"}),
|
|
5
|
+
/* @__PURE__ */q("line",{x1:"16",y1:"36",x2:"40",y2:"36",stroke:"#d9d9d9",strokeWidth:"2"}),
|
|
6
|
+
/* @__PURE__ */q("line",{x1:"16",y1:"44",x2:"32",y2:"44",stroke:"#d9d9d9",strokeWidth:"2"})]}),/* @__PURE__ */q("span",{className:Ce,children:e})]})}var xe={tocSidebar:"_tocSidebar_j9csj_1",open:"_open_j9csj_21",tocHeader:"_tocHeader_j9csj_27",tocTitle:"_tocTitle_j9csj_34",tocActions:"_tocActions_j9csj_39",tocSearchBar:"_tocSearchBar_j9csj_49",tocSearchInput:"_tocSearchInput_j9csj_56",tocSearchClear:"_tocSearchClear_j9csj_74",tocSearchExit:"_tocSearchExit_j9csj_86",tocBody:"_tocBody_j9csj_99",tocItem:"_tocItem_j9csj_105",tocItemTitle:"_tocItemTitle_j9csj_105",active:"_active_j9csj_115",tocLink:"_tocLink_j9csj_118",tocExpandIcon:"_tocExpandIcon_j9csj_122",tocChildren:"_tocChildren_j9csj_149",highlight:"_highlight_j9csj_152",tocEmpty:"_tocEmpty_j9csj_156"};function Ne({item:e,depth:t=0,activeId:r,searchText:n}){const[o,c]=d(!0),s=e.children&&e.children.length>0,a=e.href===r,u=l(null),m=s?Me(e.children,n):[];if(n&&!m.length&&!Te(e.title,n))return null;i(()=>{r&&s&&e.children.some(e=>e.href===r)&&c(!0)},[r,s,e.children]);/* @__PURE__ */
|
|
7
|
+
return F("div",{className:xe.tocItem,ref:u,style:{paddingLeft:14},children:[/* @__PURE__ */F("div",{className:`${xe.tocItemTitle}${a?` ${xe.active}`:""}`,children:[s&&/* @__PURE__ */q("span",{className:xe.tocExpandIcon,onClick:e=>{e.stopPropagation(),c(!o)},children:/* @__PURE__ */q(o?v:M,{})}),/* @__PURE__ */q("a",{className:xe.tocLink,href:`#${e.href}`,onClick:t=>{t.preventDefault();const r=e.href,n=document.getElementById(r);n&&(history.pushState(null,"",`#${r}`),n.scrollIntoView({behavior:"smooth",block:"start"}))},children:(e=>{if(!n)return e;const t=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(n),r=new RegExp(`(${t})`,"gi");return e.split(r).map((e,t)=>e.toLowerCase().includes(n.toLowerCase())?/* @__PURE__ */q("span",{className:xe.highlight,children:e},t):e)})(e.title)})]}),s&&o&&/* @__PURE__ */q("div",{className:xe.tocChildren,children:n?m.map((e,o)=>/* @__PURE__ */q(Ne,{item:e,depth:t+1,activeId:r,searchText:n},e.href||o)):e.children.map((e,o)=>/* @__PURE__ */q(Ne,{item:e,depth:t+1,activeId:r,searchText:n},e.href||o))})]})}function Te(e,t){return!t||e.toLowerCase().includes(t.toLowerCase())}function Me(e,t){return t?e.map(e=>{const r=Me(e.children,t),n=Te(e.title,t);return n||r.length>0?{...e,children:n?e.children:r}:null}).filter(Boolean):e}var Ae=n(function({anchors:e,activeId:t,visible:r,onClose:n}){const o=l(null),c=l(null),s=l(null),a=l(null),[u,m]=d(""),[h,p]=d(!1),[g,w]=d(r),[v,y]=d(r);i(()=>{if(r){w(!0);const e=requestAnimationFrame(()=>y(!0));return()=>cancelAnimationFrame(e)}y(!1);const e=setTimeout(()=>w(!1),220);return()=>clearTimeout(e)},[r]),i(()=>{if(!r)return;const e=e=>{const t=e.target;a.current&&a.current.contains(t)||t.closest(".md-toc-toggle")||n()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r,n]),i(()=>{if(!t||!o.current||!r)return;const e=o.current.querySelector(`.${xe.active}`);e&&e.scrollIntoView({behavior:"smooth",block:"nearest"})},[t,r]),i(()=>{if(!h)return;const e=e=>{s.current&&!s.current.contains(e.target)&&(p(!1),m(""))};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[h]);const b=()=>{m(""),p(!1)},k=Me(e,u);return e&&0!==e.length&&g?/* @__PURE__ */F("div",{ref:a,className:D(xe.tocSidebar,"md-toc-sidebar",{[xe.open]:v}),children:[
|
|
8
|
+
/* @__PURE__ */F("div",{className:xe.tocHeader,children:[/* @__PURE__ */q("span",{className:xe.tocTitle,children:"目录"}),/* @__PURE__ */F("div",{className:xe.tocActions,children:[!h&&/* @__PURE__ */q("span",{className:"remons-markdown-circle",onClick:()=>{p(!0),setTimeout(()=>c.current?.focus(),50)},title:"搜索",children:/* @__PURE__ */q(A,{})}),/* @__PURE__ */q("span",{className:D("remons-markdown-circle",xe.tocClose),onClick:n,children:/* @__PURE__ */q(f,{})})]})]}),h&&/* @__PURE__ */F("div",{ref:s,className:xe.tocSearchBar,children:[
|
|
9
|
+
/* @__PURE__ */q("input",{ref:c,className:xe.tocSearchInput,type:"text",placeholder:"搜索目录…",value:u,onChange:e=>{m(e.target.value)}}),u&&/* @__PURE__ */q("span",{className:xe.tocSearchClear,onClick:b,children:/* @__PURE__ */q(f,{})}),
|
|
10
|
+
/* @__PURE__ */q("span",{className:xe.tocSearchExit,onClick:b,title:"退出搜索",children:"×"})]}),
|
|
11
|
+
/* @__PURE__ */q("div",{className:xe.tocBody,ref:o,children:k.length>0?k.map((e,r)=>/* @__PURE__ */q(Ne,{item:e,activeId:t,searchText:u},e.href||r)):u&&/* @__PURE__ */q("div",{className:xe.tocEmpty,children:"未找到匹配项"})})]}):null}),$e=/* @__PURE__ */new Set(["[ ]","[x]","[X]"]);function je(e){e.core.ruler.after("inline","github-task-lists-empty",e=>{const t=e.tokens;for(let r=0;r<t.length;r++){const e=t[r];if("inline"!==e.type)continue;const n=e.content;if(!$e.has(n))continue;let o=r-1;if(o>=0&&"paragraph_open"===t[o].type&&(o-=1),o<0||"list_item_open"!==t[o].type)continue;ze(t[o],"task-list-item");for(let r=o-1;r>=0;r--)if("bullet_list_open"===t[r].type||"ordered_list_open"===t[r].type){ze(t[r],"contains-task-list");break}const c=new e.constructor("html_inline","",0);c.content="[ ]"===n?'<input class="task-list-item-checkbox" disabled="" type="checkbox">':'<input class="task-list-item-checkbox" checked="" disabled="" type="checkbox">',e.children=[c],e.content=""}})}function ze(e,t){const r=(e.attrGet("class")||"").split(/\s+/).filter(Boolean);r.includes(t)||e.attrSet("class",[...r,t].join(" "))}var Ie=/(\d\uFE0F?\u20E3)|([\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u3251-\u325F\u32B1-\u32BF])\uFE0F?/g,Pe=[10111,10121,10131],qe={base:"mdNum",wide:"mdNumWide",cjk:"mdNumCjk"};function Fe(e){const t=Number(e.charAt(0));return 0===t?"⓪":String.fromCharCode(9312+t-1)}function De(e,t){return function(e){return e>=12881&&e<=12895||e>=12977&&e<=12991}(e)?t.cjk||t.wide:function(e){return e>=9321&&e<=9331||e>=9341&&e<=9351||e>=9361&&e<=9371||e>=9451&&e<=9460||e>=12881&&e<=12895||e>=12977&&e<=12991||Pe.indexOf(e)>=0}(e)?t.wide:t.base}function Oe(e,t){return`<span class="${De(e.codePointAt(0)||0,t)}">${e}</span>`}function Be(e,t=qe){e.core.ruler.after("inline","circled-numbers",e=>{for(let r=0;r<e.tokens.length;r++){const n=e.tokens[r];"inline"===n.type&&n.children&&We(e,n.children,t)}})}function We(e,t,r){const n=e.Token;for(let o=0;o<t.length;o++){const e=t[o];if("text"!==e.type||!Ie.test(e.content))continue;Ie.lastIndex=0;const c=[];let i,s=0;for(;i=Ie.exec(e.content);){const t=i[1]?Fe(i[1]):i[2];if(i.index>s){const t=new n("text","",0);t.content=e.content.slice(s,i.index),c.push(t)}const o=new n("html_inline","",0);o.content=Oe(t,r),c.push(o),s=i.index+i[0].length}if(s<e.content.length){const t=new n("text","",0);t.content=e.content.slice(s),c.push(t)}t.splice(o,1,...c),o+=c.length-1}}var Re=/^(vbscript|javascript|file|data):/,He=/^data:image\/(gif|png|jpeg|webp);/,Ge=/^data:image\/svg\+xml[;,]/i,Ve=/<\s*script|\bon[a-z]+\s*=|<!ENTITY|foreignobject/i;function Ue(e){const t=e.trim().toLowerCase();if(!Re.test(t))return!0;if(He.test(t))return!0;if(!Ge.test(t))return!1;const r=function(e){const t=e.indexOf(",");if(t<0)return null;const r=e.slice(0,t),n=e.slice(t+1);try{return/;base64/i.test(r)?"function"==typeof atob?atob(n):null:decodeURIComponent(n)}catch{return null}}(e);return null!==r&&!Ve.test(r)}var Ke={note:"注",tip:"提示",important:"重要",warning:"注意",caution:"警告"},Ze={note:'<i class="iconfont icon-note"></i>',tip:'<i class="iconfont icon-tip"></i>',important:'<i class="iconfont icon-important"></i>',warning:'<i class="iconfont icon-warning"></i>',caution:'<i class="iconfont icon-caution"></i>'};function Xe(e){return e.replace(/[\u{1F000}-\u{1FFFF}\u{200D}\u{FE0F}\u{2600}-\u{27BF}\u{2300}-\u{23FF}\u{2700}-\u{27BF}]/gu,"").trim()}var Ye="markdown-tabs",Je=`.${Ye}-tabs-header`,Qe=`.${Ye}-tabs-wrapper`,et=`.${Ye}-tab-button`,tt=`.${Ye}-tab-content`,rt="data-md-user-active",nt="data-md-src-active",ot="data-md-tabs-count",ct=!1,it=(e,t)=>{const r=e.getAttribute("data-tab");return null!==r&&/^\d+$/.test(r)?Number(r):Array.from(t.querySelectorAll(et)).indexOf(e)},st=e=>{const t=e.querySelector(Je);if(!t)return-1;const r=t.querySelector(`${et}[data-active]`);return r?it(r,t):-1};function at(e,t,r){const n=t.querySelectorAll(et),o=r.querySelectorAll(tt);n.forEach(e=>e.classList.remove("active")),o.forEach(e=>e.classList.remove("active"));const c=n[e];if(!c)return;c.classList.add("active");const i=r.querySelector(`${tt}[data-index="${e}"]`)??o[e];i&&i.classList.add("active")}function lt(e){e.querySelectorAll(Qe).forEach(e=>{const t=e.getAttribute(rt);if(null===t||!/^\d+$/.test(t))return;const r=e.querySelector(Je),n=e.querySelector(`.${Ye}-tabs-container`);if(!r||!n)return;const o=()=>{e.removeAttribute(rt),e.removeAttribute(nt),e.removeAttribute(ot)};if(Number(e.getAttribute(nt))!==st(e))return void o();if(Number(e.getAttribute(ot))!==r.querySelectorAll(et).length)return void o();const c=Number(t);if(!r.querySelectorAll(et)[c])return;const i=r.querySelector(`${et}.active`);i&&it(i,r)!==c&&at(c,r,n)})}var dt=e=>{const t=e.target?.closest(et);if(!t)return;const r=t.closest(Je);if(!r)return;const n=r.closest(`.${Ye}-tabs-wrapper`)?.querySelector(`.${Ye}-tabs-container`);n&&function(e,t,r){const n=it(e,t);at(n,t,r);const o=e.closest(Qe);o&&(o.setAttribute(rt,String(n)),o.setAttribute(nt,String(st(o))),o.setAttribute(ot,String(t.querySelectorAll(et).length)));const c=e.closest(".markdown"),i=e.offsetParent;c&&i&&c.scrollTop>i.offsetTop&&c.scrollTo({top:i.offsetTop,behavior:"smooth"})}(t,r,n)},ut=e=>{const t=e.target?.closest(Je);t&&0!==Math.abs(e.deltaY)&&(t.scrollWidth<=t.clientWidth||(e.preventDefault(),t.scrollLeft+=e.deltaY))};function mt(e){if(e.dataset.maskInited)return;e.dataset.maskInited="1";const t=e.parentElement;if(!t)return;const r=()=>{const{scrollLeft:r,scrollWidth:n,clientWidth:o}=e,c=r>1,i=r+o<n-1;t.classList.remove("has-left-mask","has-right-mask","has-both-masks"),c&&i?t.classList.add("has-both-masks"):c?t.classList.add("has-left-mask"):i&&t.classList.add("has-right-mask")};e.addEventListener("scroll",r),r()}var ht=!1;var pt=!1;function ft(){ct||(ct=!0,document.addEventListener("click",dt),document.addEventListener("wheel",ut,{passive:!1,capture:!0})),document.querySelectorAll(Je).forEach(e=>mt(e)),ht||"undefined"==typeof MutationObserver||(ht=!0,new MutationObserver(e=>{e.forEach(e=>{e.addedNodes.forEach(e=>{if(1!==e.nodeType)return;const t=e;t.classList.contains("markdown-tabs-tabs-header")&&mt(t),t.querySelectorAll(Je).forEach(e=>mt(e))})})}).observe(document.body,{childList:!0,subtree:!0})),pt||(pt=!0,window.addEventListener("resize",()=>{document.querySelectorAll(Je).forEach(e=>{e.dispatchEvent(new Event("scroll"))})}))}var gt="0.18.1",wt=`https://registry.npmmirror.com/katex/${gt}/files/dist/katex.min.css`,vt=`https://registry.npmmirror.com/katex/${gt}/files/dist/katex.min.js`,yt=null;function bt(e,t={}){const r={throwOnError:!1,errorColor:"#cc0000",...t};function n(e,t){try{return function(){if(!window.katex)throw new Error("[katex-loader] KaTeX not loaded. Call ensureKatexLoaded() first.");return window.katex}().renderToString(e,{...r,displayMode:t})}catch(n){const t=n instanceof Error?n.message:String(n);return`<span style="color:${r.errorColor}" title="${o(t)}">${o(e)}</span>`}}function o(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}"undefined"!=typeof window&&window.katex||console.warn("[markdown-it-katex] KaTeX is not loaded yet. Call `await ensureKatexLoaded()` before using this plugin, or use `renderWithKatex()` helper instead."),e.inline.ruler.before("emphasis","katex_inline",(e,t)=>{if(36!==e.src.charCodeAt(e.pos))return!1;if(36===e.src.charCodeAt(e.pos+1))return!1;if(e.pos>0&&92===e.src.charCodeAt(e.pos-1))return!1;const r=e.pos+1;if(r>=e.posMax)return!1;if(/\s/.test(e.src[r]))return!1;let n=r;for(;n<e.posMax&&(36!==e.src.charCodeAt(n)||92===e.src.charCodeAt(n-1));)n++;if(n>=e.posMax)return!1;if(n===r)return!1;if(/\s/.test(e.src[n-1]))return!1;if(!t){const t=e.push("katex_inline","math",0);t.markup="$",t.content=e.src.slice(r,n)}return e.pos=n+1,!0}),e.block.ruler.after("blockquote","katex_block",(e,t,r,n)=>{const o=e.bMarks[t]+e.tShift[t];if(o+2>e.eMarks[t]||"$$"!==e.src.slice(o,o+2))return!1;if(n)return!0;let c=t+1,i=!1;for(;c<r;){const t=e.bMarks[c]+e.tShift[c];if("$$"===e.src.slice(t,e.eMarks[c]).trim()){i=!0;break}c++}const s=e.bMarks[t+1],a=i?e.bMarks[c]:e.eMarks[r-1];e.line=c+(i?1:0);const l=e.push("katex_block","math",0);return l.block=!0,l.markup="$$",l.content=e.src.slice(s,a).trim(),l.map=[t,e.line],!0}),e.renderer.rules.katex_inline=(e,t)=>n(e[t].content,!1),e.renderer.rules.katex_block=(e,t)=>`<div class="katex-block">${n(e[t].content,!0)}</div>\n`}function kt(e){return"string"!=typeof e?"":e.trim().toLowerCase().replace(/[^a-z0-9\u4e00-\u9fff]+/g,"-").replace(/^-|-$/g,"").replace(/-+/g,"-")}function _t(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function St(e){const t=[],r=[];for(let n=0;n<e.length;n++){const o=e[n];if("heading_open"!==o.type)continue;const c=Number((o.tag||"").slice(1));if(!Number.isInteger(c)||c<1||c>6)continue;const i=e[n+1],s="inline"===i?.type?(i.content||"").trim():"";if(!s)continue;const a=o.attrGet("id"),l={title:s,href:("string"==typeof a?a:"")||kt(s),nodeName:`H${c}`,nodeTitle:`<h${c}>${_t(s)}</h${c}>`,children:[]};for(;r.length&&r[r.length-1].level>=c;)r.pop();const d=r[r.length-1];d?d.item.children.push(l):t.push(l),r.push({level:c,item:l})}return t}async function Et(e,t,r){const n="string"==typeof e?e:null==e?"":String(e);let o=!0;try{await function(e=15e3){return yt||("undefined"==typeof window?Promise.reject(/* @__PURE__ */new Error("[katex-loader] Requires a browser environment.")):window.katex?Promise.resolve():yt=new Promise((t,r)=>{const n=setTimeout(()=>{yt=null,r(/* @__PURE__ */new Error(`[katex-loader] KaTeX CDN timeout after ${e}ms.`))},e),o=document.querySelector(`script[src="${vt}"]`);if(o)return window.katex?(clearTimeout(n),void t()):(o.addEventListener("load",()=>{clearTimeout(n),t()}),void o.addEventListener("error",()=>{clearTimeout(n),yt=null,r(/* @__PURE__ */new Error(`[katex-loader] Failed to load ${vt}`))}));if(!document.querySelector(`link[href="${wt}"]`)){const e=document.createElement("link");e.rel="stylesheet",e.href=wt,document.head.appendChild(e)}const c=document.createElement("script");c.src=vt,c.onload=()=>{clearTimeout(n),t()},c.onerror=()=>{clearTimeout(n),yt=null,c.remove(),r(/* @__PURE__ */new Error(`[katex-loader] Failed to load ${vt}`))},document.head.appendChild(c)}))}()}catch(l){o=!1,console.warn("[render-markdown] KaTeX 加载失败,公式将降级为纯文本:",l)}const c=function(){const e=/* @__PURE__ */new Set;return t=>{let r=t,n=1;for(;e.has(r);)r=`${t}-${n}`,n+=1;return e.add(r),r}}(),i=new W({langPrefix:"language-",html:r?.html??!0,highlight:function(e,t){if(t&&G.getLanguage(t))try{return G.highlight(e,{language:t}).value}catch(r){}return""}}).use(V,{name:Ye}).use(R,{permalink:R.permalink.linkInsideHeader({class:"header-anchor",symbol:"#",placement:"after"}),slugify:e=>c(kt(e))}).use(H,{matcher:e=>e.match(/^https?:\/\//),attrs:{target:"_blank",rel:"noopener"}}).use(U,{titles:Ke,icons:Ze}).use(K).use(je).use(Be);o&&i.use(bt,{strict:!1,throwOnError:!1}),t&&t.forEach(e=>i.use(e)),i.validateLink=r?.validateLink??Ue;const s=i.parse(n,{});!function(e,t){let r=null;for(let l=e.length-1;l>=0;l--)if("fence"===e[l].type){r=e[l];break}if(!r||!r.map)return;const n=t.split("\n"),o=r.map[0],c=r.markup||"```",i="~"===c[0]?"~":"`",s=Math.max(3,c.length),a=new RegExp("^ {0,3}"+i+"{"+s+",}[ \\t]*$");for(let l=o+1;l<n.length;l++)if(a.test(n[l]))return;r.attrJoin("class","md-fence-open")}(s,n),o||(i.renderer.rules.katex_inline=(e,t)=>_t(e[t].content||""),i.renderer.rules.katex_block=(e,t)=>`<code>${_t(e[t].content||"")}</code>\n`);const a=i.renderer.render(s,i.options,{}).replace(/class="markdown-alert markdown-alert-(\w+)"[\s\S]*?class="markdown-alert-title"[^>]*>([\s\S]*?)<\/p>/g,(e,t,r)=>{const n=Ke[t];if(!n)return e;const o=Xe(r.replace(/<[^>]*>/g,""));if(o.toLowerCase()===t.toLowerCase()){const t=r.lastIndexOf(">");if(-1!==t){const c=r.substring(0,t+1)+Xe(r.substring(t+1)).replace(o,n);return e.replace(r,c)}}return e});return queueMicrotask(()=>ft()),{anchor:St(s),info:a}}function Ct(e){e&&"object"==typeof e?Object.entries(e).forEach(([e,t])=>{G.getLanguage(e)||G.registerLanguage(e,t)}):console.warn("[render-markdown] initHighlighter 需要传入一个语言包对象")}var Lt=/[\u3040-\u30ff\u31f0-\u31ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uac00-\ud7af]/g,xt=/[A-Za-z0-9]+(?:['’-][A-Za-z0-9]+)*/g;function Nt(e){const t="string"==typeof e?e.replace(/^(`{3,}|~{3,})[\s\S]*?^\1[ \t]*$/gm,"").replace(/`[^`]*`/g,"").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\[([^\]]*)\](?:\[[^\]]*\])?/g,"$1").replace(/<((?:https?):\/\/[^>\s]+)>/gi,"$1").replace(/<\/?[a-zA-Z][^>]*>/g,"").replace(/^#{1,6}[ \t]+/gm,"").replace(/^>[ \t]?/gm,"").replace(/^[ \t]*[-*+][ \t]+(\[[ xX]\][ \t]+)?/gm,"").replace(/^[ \t]*\d+[.()][ \t]+/gm,"").replace(/^[ \t]*([-*_])(?:[ \t]*\1){2,}[ \t]*$/gm,"").replace(/^[ \t]*\|?[ \t]*:?-{1,}:?[ \t]*(\|[ \t]*:?-{1,}:?[ \t]*)*\|?[ \t]*$/gm,"").replace(/\|/g,"").replace(/(\*\*\*|\*\*|\*|___|__|_){1,3}/g,"").replace(/~~|\+\+/g,""):"";const r=t.match(Lt),n=r?r.length:0,o=t.replace(Lt," ").match(xt),c=o?o.length:0,i=t.replace(/\s/g,"");return{chinese:n,words:c,total:n+c,characters:t.length,charactersWithoutSpaces:i.length}}var Tt="字数统计 {total}",Mt={wordCount:"total",count:"total"};function At(e,t){return("string"==typeof e&&e?e:Tt).replace(/\{(\w+)\}/g,(e,r)=>Object.prototype.hasOwnProperty.call(Mt,r)?String(t[Mt[r]]):Object.prototype.hasOwnProperty.call(t,r)?String(t[r]):e)}var $t="data-md-persist",jt="mermaid-react-root",zt="data-md-mermaid-src",It=/* @__PURE__ */new WeakMap,Pt=["pre",`.${jt}`];function qt(e){(Array.isArray(e)?e:[e]).forEach(e=>{Pt.includes(e)||Pt.push(e)})}function Ft(e){(Array.isArray(e)?e:[e]).forEach(e=>{const t=Pt.indexOf(e);t>=0&&Pt.splice(t,1)})}var Dt=(e,t)=>t.some(t=>null!==e.closest(t))||Pt.some(t=>null!==e.closest(t));function Ot(e){const t=e.currentSrc||e.src,r={src:t,msrc:t,alt:e.alt||void 0,element:e.isConnected?e:void 0};e.naturalWidth&&e.naturalHeight&&(r.width=e.naturalWidth,r.height=e.naturalHeight);const n=e.getAttribute("srcset")||"";return/\d+w/.test(n)&&(r.srcset=n),r}var Bt=0,Wt=null;function Rt(e,t){if(e.active)return;const r=e.images.indexOf(t);if(r<0)return;const n=new Z({dataSource:e.images.map(Ot),index:r,bgOpacity:1,initialZoomLevel:"fit",secondaryZoomLevel:1,maxZoomLevel:2,padding:{top:24,bottom:24,left:24,right:24},showHideAnimationType:"zoom",preload:[1,2],loop:!1,wheelToZoom:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",pinchToClose:!0,closeOnVerticalDrag:!0,clickToCloseNonZoomable:!0,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,mainClass:"md-image-preview",errorMsg:"图片加载失败",closeTitle:"关闭",zoomTitle:"放大 / 缩小",arrowPrevTitle:"上一张",arrowNextTitle:"下一张",counterTitle:"当前图片序号"});e.active=n;let o=!1,c=()=>{};const i=()=>{o||(o=!0,(Bt=Math.max(0,Bt-1))>0||null===Wt||(document.documentElement.style.overflow=Wt,Wt=null),c())};if(n.on("close",i),n.on("destroy",()=>{i(),e.active===n&&(e.active=null)}),!1===n.init())return void(e.active=null);!function(){if("undefined"==typeof document)return;if((Bt+=1)>1)return;const e=document.documentElement;Wt=e.style.overflow,e.style.overflow="hidden"}();const s=()=>{const e=n.currSlide?.zoomLevels;e&&e.fit&&(e.min=Math.min(e.min,.5*e.fit))};n.on("change",s),n.on("loadComplete",s),window.addEventListener("resize",s),s(),c=()=>window.removeEventListener("resize",s)}var Ht=/* @__PURE__ */new Map;function Gt(e,t){const r=Ht.get(e);r?r.push(t):Ht.set(e,[t])}function Vt(e){const t=Ht.get(e);t&&(t.forEach(e=>{try{e.unmount()}catch{}}),Ht.delete(e))}function Ut(e){return Ht.get(e)?.[0]}function Kt(){Ht.forEach((e,t)=>{t.isConnected||Vt(t)})}function Zt(e){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=Math.imul(t,16777619)>>>0;return`${t.toString(36)}-${e.length.toString(36)}`}function Xt(e){return!!e&&e.classList.contains("mermaid-react-root")&&e.hasAttribute("data-md-mermaid-src")}function Yt(e){if(e)return 1===e.nodeType&&e.classList?.contains("mermaid-react-root")?(Vt(e),void e.remove()):void e.querySelectorAll(`.${jt}`).forEach(e=>{Vt(e),e.remove()})}var Jt=/* @__PURE__ */new Set(["mermaid-render-noCode","code-collapsed","has-left-mask","has-right-mask","has-both-masks","active"]),Qt=["mermaid-render-noCode","code-collapsed","has-left-mask","has-right-mask","has-both-masks"],er=/* @__PURE__ */new Set(["data-tab","data-index","data-id","data-active"]),tr=e=>{const t="string"==typeof e.className?e.className:"";return t?t.split(/\s+/).filter(e=>e&&!e.startsWith("copy-")&&!Jt.has(e)).join(" "):""},rr=e=>{const t=e.getAttribute("id");return t?`id:${t}`:(e=>{const t=tr(e);return t?`${e.tagName.toLowerCase()}#${t}`:""})(e)},nr="data-md-mounted",or=e=>{const t=e.getAttribute("data-md-key");return`${e.tagName.toLowerCase()}#${t??tr(e)}`},cr=e=>Array.from(e.attributes).some(e=>e.name.endsWith("-placeholder")),ir=e=>{const t={};for(const r of Array.from(e.attributes))r.name.startsWith("data-")&&"data-md-persist"!==r.name&&"data-md-key"!==r.name&&(r.name.endsWith("-placeholder")||(t[r.name]=r.value));return t},sr=e=>{const t=e.querySelector(`[${nr}]`);return t||(Array.from(e.querySelectorAll("*")).find(cr)??null)},ar=e=>{const t=[];e.querySelectorAll(`[${$t}]`).forEach(e=>{const r=e;r.classList.contains("pre-handle")||r.classList.contains("mermaid-react-root")||r.parentElement?.closest("[data-md-persist]")||t.push(r)});const r=t.map(e=>{const t=sr(e);return{el:e,key:or(e),configEl:t,mounted:t?.hasAttribute(nr)??!1}});return r.forEach(e=>e.el.remove()),r},lr=(e,t,r)=>{if(0===t.length)return;const n=/* @__PURE__ */new Set;Array.from(e.querySelectorAll("*")).filter(e=>cr(e)).forEach(e=>{const r=e.closest(`[${$t}]`);if(!r)return;const o=or(r),c=t.find(t=>t.key===o&&!n.has(t)&&!!t.configEl&&((e,t)=>{const r=ir(t),n=ir(e);return Object.keys(r).every(e=>n[e]===r[e])})(t.configEl,e));c&&(n.add(c),r.replaceWith(c.el))});const o=Array.from(e.querySelectorAll(`[${$t}]`));t.forEach(t=>{if(n.has(t)||t.configEl)return;if(t.el.isConnected)return;const r=or(t.el),c=rr(t.el),i=o.find(e=>e!==t.el&&e.isConnected&&!sr(e)&&(or(e)===r||rr(e)===c));i?i.replaceWith(t.el):e.appendChild(t.el),n.add(t)}),r&&t.forEach(e=>{e.el.isConnected||r(e.el)})},dr=(e,t)=>{const r=Array.from(e.children);e.innerHTML="",t&&r.forEach(e=>t(e))};function ur({content:e,codeType:t,customRenderers:r,throttleMs:n=16,html:c=!0,validateLink:s,onNodeDiscarded:a,onPatched:u}){const[m,h]=d([]),[p,f]=d(!1),g=l(""),w=l(null),v=l(!0),y=l(0),b=l({codeType:t,customRenderers:r,throttleMs:n,html:c,validateLink:s}),k=l({onNodeDiscarded:a,onPatched:u});k.current={onNodeDiscarded:a,onPatched:u};const _=l(null),S=o(async(e,t,r=0)=>{const{codeType:n,customRenderers:o,html:c,validateLink:i}=b.current,s=n&&"md"!==n?.toLocaleLowerCase()?"```"+n+"\n"+e+"\n```":e;let a;const l=()=>{t!==y.current||r>=2||(null!=_.current&&clearTimeout(_.current),_.current=setTimeout(()=>{_.current=null,t===y.current&&S(e,t,r+1)},300))};try{a=await Et(s,o,{html:c,validateLink:i})}catch(m){return console.error("[useIncrementalRender] markdown 渲染失败,保留上一版 DOM:",m),void l()}if(!a||t!==y.current)return;const d=a.info??"",u=(e=0)=>{if(t!==y.current)return;const r=w.current;if(!r)return void(e<60?setTimeout(()=>u(e+1),0):console.warn("[useIncrementalRender] 容器未挂载,放弃本轮 patch(源码与渲染可能不一致)"));if(h(a.anchor||[]),""===d.trim()){const e=ar(r);return dr(r,k.current.onNodeDiscarded),e.forEach(e=>{e.el.isConnected||k.current.onNodeDiscarded?.(e.el)}),g.current=s,v.current=!0,f(!1),void k.current.onPatched?.()}if(v.current)return r.innerHTML=d,v.current=!1,void(g.current=s);const n=document.createElement("div");n.innerHTML=d;const o=ar(r),c=((e,t)=>{const r=/* @__PURE__ */new WeakMap,n=e=>{const t=/* @__PURE__ */new Map,n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(let o=n.nextNode();o;o=n.nextNode()){const e=o,n=rr(e);if(!n)continue;const c=t.get(n);r.set(e,void 0===c?n:`${n}[${c}]`),t.set(n,(c??0)+1)}};return n(e),n(t),r})(r,n),i=/* @__PURE__ */new WeakMap,l=/* @__PURE__ */new WeakMap;X(r,n,{childrenOnly:!0,getNodeKey:e=>1===e.nodeType?c.get(e)??null:null,onBeforeElUpdated(e,t){const r=/* @__PURE__ */new Map;for(const o of Array.from(e.attributes))o.name.startsWith("data-")&&!er.has(o.name)&&(t.hasAttribute(o.name)||r.set(o.name,o.value));r.size&&i.set(e,r);const n=Qt.filter(r=>e.classList.contains(r)&&!t.classList.contains(r));return n.length&&l.set(e,n),!0},onElUpdated(e){const t=i.get(e);t&&(t.forEach((t,r)=>e.setAttribute(r,t)),i.delete(e));const r=l.get(e);r&&(r.forEach(t=>e.classList.add(t)),l.delete(e))},onBeforeNodeAdded:e=>(1!==e.nodeType||!e.classList.contains("pre-handle"))&&e,onBeforeNodeDiscarded:e=>1!==e.nodeType||!e.hasAttribute("data-md-persist"),onNodeDiscarded(e){1===e.nodeType&&k.current.onNodeDiscarded&&k.current.onNodeDiscarded(e)}}),lr(r,o,k.current.onNodeDiscarded),g.current=s,k.current.onPatched?.()};try{u()}catch(m){console.error("[useIncrementalRender] DOM patch 失败:",m),l()}},[]),E=l(0),C=l(null),L=o((e,t)=>{const r=b.current.throttleMs,n=Date.now()-E.current,o=()=>{E.current=Date.now(),S(e,t)};if(n>=r)return null!=C.current&&(clearTimeout(C.current),C.current=null),void o();null!=C.current&&clearTimeout(C.current),C.current=setTimeout(()=>{C.current=null,t===y.current&&o()},r-n)},[S]);return i(()=>{const{codeType:t}=b.current;if(!e){y.current+=1,null!=_.current&&(clearTimeout(_.current),_.current=null),v.current=!0,f(!1),h([]),g.current="";const e=w.current;return void(e&&dr(e,k.current.onNodeDiscarded))}const r=t&&"md"!==t?.toLocaleLowerCase()?"```"+t+"\n"+e+"\n```":e;if(g.current===r)return;y.current+=1;const n=y.current;f(!0),v.current?S(e,n):L(e,n)},[e,S,L]),i(()=>()=>{y.current+=1,null!=C.current&&(clearTimeout(C.current),C.current=null),null!=_.current&&(clearTimeout(_.current),_.current=null)},[]),{anchors:m,hasContent:p,setInnerRef:o(e=>{w.current=e},[])}}var mr="_tocToggle_9mueg_1",hr=/* @__PURE__ */new Map,pr=e=>{const t=e.querySelector("code");return t?kr(t):""},fr=e=>{const t=e.querySelector("code");return t?pr(e)+"\0"+(t.textContent??""):null},gr=e=>{const t=/* @__PURE__ */new Map,r=/* @__PURE__ */new Map,n=/* @__PURE__ */new Map;return e?.querySelectorAll("pre").forEach(e=>{const o=e;if(!o.querySelector("code"))return;const c=(e=>{const t=e.nextElementSibling;return Xt(t)?t:null})(o);c&&n.set(o,c);const i=fr(o);if(i){const e=t.get(i);e?e.push(o):t.set(i,[o])}const s=pr(o),a=r.get(s);a?a.push(o):r.set(s,[o])}),{exact:t,byLanguage:r,charts:n}},wr=0,vr=e=>({enableMermaid:e.enableMermaid??e.isSlotMermaid??!0,showCollapseButton:e.showCollapseButton??e.isShowCollapsed??!0,toolbarDebounceMs:e.toolbarDebounceMs??e.mermaidDebounce??yr,incremental:e.incremental??e.useIncremental??!1,transformSource:e.transformSource??e.chartConfig,html:e.html??!0}),yr=100;function br({preNode:e}){const[t,r]=d(()=>e.classList.contains("code-collapsed")),n=l(null);i(()=>()=>n.current?.cancel(),[]);/* @__PURE__ */
|
|
12
|
+
return q("span",{className:"code-toggle",onClick:()=>{const t=!e.classList.contains("code-collapsed"),o=e.getBoundingClientRect().height,c=t?32:e.scrollHeight;if(n.current?.cancel(),c===o)return e.classList.toggle("code-collapsed",t),void r(t);t||e.classList.remove("code-collapsed");const i=e.animate([{height:`${o}px`},{height:`${c}px`}],{duration:280,easing:"ease-in-out"});n.current=i,t&&i.finished.then(()=>{n.current===i&&(e.classList.add("code-collapsed"),i.cancel())}),r(t)},children:/* @__PURE__ */q(t?m:u,{})})}var kr=e=>e.className.match(/language-([^\s]+)/)?.[1]??"",_r=(e,t)=>{const{enableMermaid:r,showCollapseButton:n}=vr(t);e.querySelectorAll("pre > code").forEach(e=>{const t=e,o=kr(t),c=o,i=r&&"mermaid"===o&&!t.classList.contains("md-fence-open")?"mermaid-render-noCode":"",s=t.parentNode;if(!s)return;const a=s.querySelector(".pre-handle");if(a){const e=a.getAttribute("data-md-copy-id");e&&!t.classList.contains(e)&&t.classList.add(e),i?t.classList.add(i):t.classList.remove("mermaid-render-noCode");const r=a.querySelector("[data-md-lang]");if(r&&r.textContent!==c&&(r.textContent=c),a.getAttribute("data-md-show-collapsed")===String(n))return;hr.get(a)?.unmount(),hr.delete(a),a.remove()}const l=(()=>{const e=globalThis.crypto?.randomUUID?.();return e?`copy-${e}`:`copy-${Date.now().toString(36)}-${(wr++).toString(36)}-${Math.random().toString(36).slice(2,8)}`})();t.classList.add(l),i&&t.classList.add(i);const d=document.createElement("div");d.className="pre-handle",d.setAttribute($t,""),d.setAttribute("data-md-copy-id",l),d.setAttribute("data-md-show-collapsed",String(n)),s.insertBefore(d,t);const u=/* @__PURE__ */F(P,{children:[/* @__PURE__ */F("span",{className:"traffic-lights",children:[
|
|
13
|
+
/* @__PURE__ */q("span",{className:"traffic-light traffic-light-red"}),
|
|
14
|
+
/* @__PURE__ */q("span",{className:"traffic-light traffic-light-yellow"}),
|
|
15
|
+
/* @__PURE__ */q("span",{className:"traffic-light traffic-light-green"})]}),/* @__PURE__ */q("span",{"data-md-lang":!0,children:c})]}),m=/* @__PURE__ */q("span",{className:"copy",onClick:()=>{const e=s.querySelector("code");e&&(B(e),ke.success("复制成功"))},children:/* @__PURE__ */q(w,{})}),h=I(d);hr.set(d,h),h.render(/* @__PURE__ */F(P,{children:[/* @__PURE__ */q("span",{children:u}),/* @__PURE__ */F("span",{className:"code-handle",children:[m,n&&/* @__PURE__ */q(br,{preNode:s})]})]}))})};function Sr(t){const{content:r,showBackTop:n,showToc:c,footer:a,incrementalThrottleMs:u,showWordCount:m=!0,wordCountTemplate:h}=t,p=vr(t),{incremental:f,toolbarDebounceMs:g}=p,[w,v]=d(""),[y,b]=d([]),[k,_]=d(""),[S,E]=d(!1),C=l(null),L=l(null),x=l(null),N=l(t);N.current=t;const T=l(null);"function"!=typeof t.backTopTarget&&null===T.current&&(T.current=t.backTopTarget??("undefined"!=typeof document?document.body:null));const M=o(()=>E(e=>!e),[]),A=o(()=>E(!1),[]),j=o(()=>{const e=N.current.backTopTarget;return"function"==typeof e?e():T.current},[]),z=o(e=>{const t=[];e.classList?.contains("pre-handle")&&t.push(e),e.querySelectorAll(".pre-handle").forEach(e=>t.push(e)),e.classList?.contains("mermaid-react-root")&&Yt(e),e.querySelectorAll(`.${jt}`).forEach(e=>Yt(e)),t.forEach(e=>{const t=hr.get(e);t&&(t.unmount(),hr.delete(e))})},[]),I=o(()=>{const e=C.current;e&&(_r(e,N.current),lt(e),hr.forEach((e,t)=>{t.isConnected||(e.unmount(),hr.delete(t))}))},[]),{anchors:P,hasContent:O,setInnerRef:B}=ur({content:r,codeType:t.codeType,customRenderers:t.customRenderers,throttleMs:u,html:p.html,validateLink:t.validateLink,onNodeDiscarded:z,onPatched:I}),W=f?P:y,R=f?O:!!w,H=e.useMemo(()=>Nt(r),[r]);i(()=>{let e=null,t=!1;return(async()=>{if(!f){x.current=gr(C.current);const{codeType:e}=N.current;let o,c="";c=e&&"md"!==e?.toLocaleLowerCase()?"```"+e+"\n"+r+"\n```":r;try{o=await Et(c,N.current.customRenderers,{html:vr(N.current).html,validateLink:N.current.validateLink})}catch(n){return void console.error("[RenderMarkdown] markdown 渲染失败,保留上一版内容:",n)}if(t)return;v(o?.info),b(o?.anchor||[])}e=setTimeout(async()=>{if(t)return;vr(N.current).enableMermaid&&Kt();const e=C.current;if(!e)return;_r(e,N.current),lt(e);const{isPrintPreview:r,excludedSelectors:n}=N.current;!function(e,t={}){if(!e)return;const{instanceSelectors:r=[],isPrintPreview:n=!1}=t,o=Array.from(e.querySelectorAll("img"));if(n)return void o.forEach(e=>{e.style.maxHeight="none",e.style.width="auto",e.style.display="block"});let c=It.get(e);c?c.instanceSelectors=r:(c={images:[],bound:!1,instanceSelectors:r,active:null},It.set(e,c)),c.images=o.filter(e=>!Dt(e,r)),c.bound||(c.bound=!0,e.setAttribute("mdImgBound","1"),e.addEventListener("click",t=>{const r=t.target;if(!r||"IMG"!==r.tagName)return;const n=r,o=It.get(e);o&&!Dt(n,o.instanceSelectors)&&Rt(o,n)}))}(e,{isPrintPreview:r,instanceSelectors:n});const{enableMermaid:o,transformSource:c}=vr(N.current),{showDriverGuide:i,defaultCollapsed:s,cdn:a}=N.current;if(o){const{renderMermaidWithControls:t}=await Promise.resolve().then(()=>ln);await t({showDriverGuide:i,isPrintPreview:r,transformSource:c,defaultCollapsed:s,cdn:a,rootElement:e})}},g)})(),()=>{t=!0,e&&clearTimeout(e)}},[r]),s(()=>{!f&&w&&(((e,t)=>{if(!e||!t)return;const r=Array.from(e.querySelectorAll("pre")),n=/* @__PURE__ */new Set,o=e=>{const r=t.charts.get(e);r&&(t.charts.delete(e),e.after(r))},c=(e=>{const t=/* @__PURE__ */new Map;return e.forEach(e=>{const r=pr(e);t.set(r,(t.get(r)??0)+1)}),t})(r),i=/* @__PURE__ */new Map;t.byLanguage.forEach((e,t)=>i.set(t,e.length)),r.forEach(e=>{const r=fr(e);if(!r)return;const c=t.exact.get(r)?.shift();c&&c!==e&&(n.add(c),e.replaceWith(c),o(c))}),r.forEach(e=>{if(!e.isConnected)return;const r=e.querySelector("code");if(!r)return;const s=pr(e),a=t.byLanguage.get(s);if(!a?.length)return;if(c.get(s)!==i.get(s))return;let l;for(;a.length;){const t=a.shift();if(t!==e&&!n.has(t)){l=t;break}}if(!l)return;n.add(l);const d=l.querySelector("code");d&&(d.innerHTML=r.innerHTML),e.replaceWith(l),o(l)})})(L.current,x.current),x.current=null,hr.forEach((e,t)=>{t.isConnected||(e.unmount(),hr.delete(t))}))},[w,f]);const G=l(null);return G.current=C.current,i(()=>()=>{const e=G.current;e&&(e.querySelectorAll(".pre-handle").forEach(e=>{const t=e,r=hr.get(t);r&&(r.unmount(),hr.delete(t))}),Yt(e),function(e){if(!e)return;const t=e,r=It.get(t);r&&(r.active&&(r.active.destroy(),r.active=null),r.images=[],It.delete(t))}(e))},[]),i(()=>{if(0===W.length)return;const e=[],t=r=>{r.forEach(r=>{e.push(r.href),r.children?.length&&t(r.children)})};t(W);const r=e.map(e=>document.getElementById(e)).filter(Boolean);if(0===r.length)return;const n=new IntersectionObserver(e=>{const t=e.filter(e=>e.isIntersecting);if(0===t.length)return;const r=t.reduce((e,t)=>t.boundingClientRect.top<e.boundingClientRect.top?t:e);_(r.target.id)},{rootMargin:"0px 0px -90% 0px",threshold:0});return r.forEach(e=>n.observe(e)),()=>n.disconnect()},[W]),i(()=>{const e=()=>{const e=window.location.hash.slice(1);if(!e)return;const t=document.getElementById(e);t&&(t.scrollIntoView({behavior:"smooth",block:"start"}),_(e))},t=setTimeout(e,100),r=()=>e();return window.addEventListener("hashchange",r),()=>{clearTimeout(t),window.removeEventListener("hashchange",r)}},[W]),/* @__PURE__ */F("div",{className:"markdown",children:[R?/* @__PURE__ */F("div",{className:"markdown-html",ref:C,children:[
|
|
16
|
+
/* @__PURE__ */q("div",{style:{width:"100%"},...f?{ref:B}:{ref:L,dangerouslySetInnerHTML:{__html:w}}}),m&&/* @__PURE__ */q("div",{className:"markdown-word-count","aria-label":"字数统计",children:At(h??"字数统计 {total}",H)}),a&&/* @__PURE__ */q("div",{className:"markdown-footer",children:a})]}):/* @__PURE__ */q(Le,{}),n&&/* @__PURE__ */q(Se,{target:j}),c&&W.length>0&&/* @__PURE__ */q("div",{className:D(mr,"md-toc-toggle","remons-markdown-circle"),onClick:M,children:/* @__PURE__ */q($,{})}),c&&/* @__PURE__ */q(Ae,{anchors:W,activeId:k,visible:S,onClose:A})]})}var Er={javascript:Y,typescript:J,css:Q,json:ee,bash:te,xml:re,plaintext:ne};function Cr(e,t){let r,n=!1;if(e instanceof Blob)r=URL.createObjectURL(e),n=!0;else{if("string"!=typeof e)return void ke.error("不支持的下载格式");r=e}const o=document.createElement("a");o.href=r,o.download=t,o.rel="noopener",o.style.display="none",document.body.appendChild(o),o.click(),o.remove(),n&&setTimeout(()=>URL.revokeObjectURL(r),1e3),ke.success(`${t} 已下载`)}function Lr(e,t="image",r=2){const{w:n,h:o}=function(e){const t=e.match(/viewBox=["']?([^"'>\s]+(?:[\s,]+[^"'>\s]+){3})["']/i);let r=0,n=0;if(t){const e=t[1].split(/[\s,]+/).map(Number);4===e.length&&(r=e[2],n=e[3])}const o=e.match(/width=["']?\s*([\d.]+)\s*(px|pt|cm|mm|in)["']/i),c=e.match(/height=["']?\s*([\d.]+)\s*(px|pt|cm|mm|in)["']/i),i=o?parseFloat(o[1]):0,s=c?parseFloat(c[1]):0;return i>0&&s>0?{w:i,h:s}:r>0&&n>0?{w:r,h:n}:{w:i||r||800,h:s||n||600}}(e),c=function(e){const t=(new TextEncoder).encode(e);let r="";for(let n=0;n<t.length;n++)r+=String.fromCharCode(t[n]);return`data:image/svg+xml;base64,${btoa(r)}`}(e),i=new Image;i.crossOrigin="anonymous",i.src=c,i.onload=()=>{const e=document.createElement("canvas");e.width=Math.max(1,Math.round(n*r)),e.height=Math.max(1,Math.round(o*r));const c=e.getContext("2d");c.fillStyle="#ffffff",c.fillRect(0,0,e.width,e.height),c.scale(r,r),c.drawImage(i,0,0,n,o),e.toBlob(e=>{e?Cr(e,`${t}.png`):ke.error("PNG 生成失败")},"image/png")},i.onerror=()=>{ke.error("PNG 生成失败:图片加载失败")}}var xr="app-theme-mode",Nr="light",Tr="dark";function Mr(e){return"light"===e||"dark"===e||"system"===e}function Ar(){try{const e=localStorage.getItem(xr);if(Mr(e))return e}catch{}return"system"}function $r(e){return"system"===e?"undefined"==typeof window?Nr:window.matchMedia("(prefers-color-scheme: dark)").matches?Tr:Nr:e}function jr(e){"undefined"!=typeof document&&(document.documentElement.dataset.theme=e)}function zr(){"undefined"!=typeof window&&jr($r(Ar()))}var Ir=t(null);function Pr({children:t}){const[r,n]=d(()=>Ar()),[c,u]=d(()=>$r(r)),m=l(null),h=o(e=>{m.current=e,jr(e)},[]);s(()=>{h($r(Ar()))},[h]);const p=o(e=>{if(Mr(e)){n(e);try{localStorage.setItem(xr,e),window.dispatchEvent(new Event("storage"))}catch{}}else console.warn(`[render-markdown] 非法的主题模式: ${e},应为 light | dark | system`)},[]);i(()=>{const e=$r(r);u(e),h(e)},[r,h]),i(()=>{if("system"!==r)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{const t=e.matches?Tr:Nr;u(t),h(t)};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[r,h]),i(()=>{const e=()=>{const e=Ar();e!==r&&n(e)};window.addEventListener("storage",e);const t=new MutationObserver(()=>{const e=document.documentElement.dataset.theme;e!==m.current&&("light"!==e&&"dark"!==e||e===c||u(e))});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>{window.removeEventListener("storage",e),t.disconnect()}},[r,c]);const f=c===Tr,g=a(()=>({theme:c,mode:r,isDark:f,setMode:p}),[c,r,f,p]);return e.createElement(Ir.Provider,{value:g},t)}function qr(){const e=c(Ir);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}var Fr={"modal-mask":"_modal-mask_dzv9e_4","modal-mask-visible":"_modal-mask-visible_dzv9e_18",modal:"_modal_dzv9e_4","modal-header":"_modal-header_dzv9e_34","modal-title":"_modal-title_dzv9e_41","modal-close":"_modal-close_dzv9e_46","modal-body":"_modal-body_dzv9e_62","modal-footer":"_modal-footer_dzv9e_67"},Dr=pe.default.bind(Fr),Or=({open:e,title:t,width:r=520,onCancel:n,footer:o,className:c="",children:s})=>{const a=()=>{n?.()};if(i(()=>{if(!e)return;const t=e=>{"Escape"===e.key&&a()};return document.addEventListener("keydown",t),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",t),document.body.style.overflow=""}},[e]),!e)return null;const l=/* @__PURE__ */q("div",{className:Dr("modal-mask","modal-mask-visible"),onClick:e=>{e.target===e.currentTarget&&a()},children:/* @__PURE__ */F("div",{className:Dr("modal",c),style:{width:r},onClick:e=>{e.stopPropagation()},children:[
|
|
17
|
+
/* @__PURE__ */F("div",{className:Dr("modal-header"),children:[/* @__PURE__ */q("span",{className:Dr("modal-title"),children:t}),/* @__PURE__ */q("div",{className:Dr("modal-close"),onClick:a,children:"×"})]}),
|
|
18
|
+
/* @__PURE__ */q("div",{className:Dr("modal-body"),children:s}),null!=o&&/* @__PURE__ */q("div",{className:Dr("modal-footer"),children:o})]})});return oe(l,document.body)},Br={mermaid:"https://registry.npmmirror.com/mermaid/11.17.2/files/dist/mermaid.min.js"};function Wr(e,t){t?Br[e]=t:delete Br[e]}var Rr=null;function Hr(e){return Rr||(Rr=new Promise((t,r)=>{if(window.mermaid)return void t(window.mermaid);const n=document.createElement("script");try{n.src=function(e,t){const r=t?.[e]??Br[e];if(!r)throw new Error(`[render-markdown] 未找到名为 "${e}" 的 CDN 配置,请通过 cdn 属性或 registerCdn() 注册`);return r}("mermaid",e)}catch(o){return Rr=null,void r(o)}n.onload=()=>{window.mermaid?t(window.mermaid):(Rr=null,n.remove(),r(/* @__PURE__ */new Error(`Mermaid 脚本已加载但未挂载 window.mermaid:${n.src}`)))},n.onerror=()=>{Rr=null,n.remove(),r(/* @__PURE__ */new Error(`Mermaid 脚本加载失败:${n.src}`))},document.head.appendChild(n)})),Rr}var Gr=0;function Vr({source:e,debounceMs:t=300,isDark:r,transformSource:n,chartConfig:o,cdn:c,securityLevel:s="strict"}){const{mermaid:a,loading:u,error:m}=function(e){const[t,r]=d(null),[n,o]=d(!0),[c,s]=d(null);return i(()=>{let t=!1;return Hr(e).then(e=>{t||(r(()=>e),o(!1))}).catch(e=>{t||(s(e),o(!1))}),()=>{t=!0}},[]),{mermaid:t,loading:n,error:c}}(c),[h,p]=d(""),[f,g]=d(""),w=l(0),v=l(void 0);return void 0===v.current&&(v.current=n??o),i(()=>{m&&g(m.message?.split("\n")[0]||String(m))},[m]),i(()=>{a&&a.initialize({startOnLoad:!1,theme:r?"dark":"default",securityLevel:s})},[a,r,s]),i(()=>{if(!a)return;const r=(e||"").trim();if(!r)return p(""),void g("");g("");const n=++w.current,o=setTimeout(async()=>{const e="mermaid-render-"+Gr++;try{const t=v.current,o=t?t(r):r,{svg:c}=await a.render(e,o??r);if(n!==w.current)return;p(c),g("")}catch(t){if(n!==w.current)return;console.error("Mermaid render error:",t);const e=t instanceof Error?t.message:String(t);g(e?.split("\n")[0]||e)}finally{const t=document.getElementById(e)||document.getElementById(`d${e}`);t&&t.parentNode&&t.parentNode.removeChild(t)}},t);return()=>clearTimeout(o)},[e,r,a,t]),{svg:h,error:f,loading:u}}var Ur={tooltip:"_tooltip_1kuma_4","tooltip-trigger":"_tooltip-trigger_1kuma_7","tooltip-inner":"_tooltip-inner_1kuma_11","tooltip-inner-visible":"_tooltip-inner-visible_1kuma_27","tooltip-content":"_tooltip-content_1kuma_30","tooltip-arrow":"_tooltip-arrow_1kuma_36"},Kr=pe.default.bind(Ur),Zr=({title:e,children:t,visible:r,onVisibleChange:n})=>{const[o,c]=d(!1),s=l(null),a=l(null),[u,m]=d({top:0,left:0}),h=void 0!==r?r:o,p=()=>{if(a.current){const e=a.current.getBoundingClientRect();m({top:e.top-8,left:e.left+e.width/2})}};i(()=>{if(!h)return;const e=()=>p(),t=()=>p();return window.addEventListener("resize",e,{passive:!0}),window.addEventListener("scroll",t,{passive:!0}),p(),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",t)}},[h]),i(()=>()=>{s.current&&window.clearTimeout(s.current)},[]);const f=h&&e?oe(/* @__PURE__ */F("div",{className:Kr("tooltip-inner","tooltip-inner-visible"),style:{top:u.top,left:u.left},children:[/* @__PURE__ */q("span",{className:Kr("tooltip-content"),children:e}),/* @__PURE__ */q("span",{className:Kr("tooltip-arrow")})]}),document.body):null;/* @__PURE__ */
|
|
19
|
+
return F("div",{ref:a,className:Kr("tooltip"),onMouseEnter:()=>{s.current&&window.clearTimeout(s.current),s.current=window.setTimeout(()=>{p(),c(!0),n?.(!0)},150)},onMouseLeave:()=>{s.current&&(window.clearTimeout(s.current),s.current=null),c(!1),n?.(!1)},children:[/* @__PURE__ */q("div",{className:Kr("tooltip-trigger"),children:t}),f]})},Xr={dropdown:"_dropdown_13j0u_4","dropdown-trigger":"_dropdown-trigger_13j0u_8","dropdown-menu":"_dropdown-menu_13j0u_12","dropdown-menu-visible":"_dropdown-menu-visible_13j0u_26","dropdown-item":"_dropdown-item_13j0u_30"},Yr=pe.default.bind(Xr),Jr=({items:e,children:t,onClick:r,className:n=""})=>{const[o,c]=d(!1),s=l(null),a=()=>{c(!1)};return i(()=>{const e=e=>{s.current&&!s.current.contains(e.target)&&a()};return o&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[o]),/* @__PURE__ */F("div",{ref:s,className:Yr("dropdown",n),children:[/* @__PURE__ */q("div",{className:Yr("dropdown-trigger"),onClick:()=>{c(e=>!e)},children:t}),o&&/* @__PURE__ */q("div",{className:Yr("dropdown-menu","dropdown-menu-visible"),children:e.map(e=>/* @__PURE__ */q("div",{className:Yr("dropdown-item"),onClick:()=>(e=>{r({key:e.key}),a()})(e),children:e.label},e.key))})]})};function Qr({showSourceView:e,showCollapse:t,showDownload:r,isFullscreen:n,isCollapsed:o,isMinimize:c,isPanzoomActive:i,isPanzoomAvailable:s,isPanzoomEnabled:a,setIsPanzoomEnabled:l,setIsMinimize:d,setIsCollapsed:u,setShowSource:m,toggleFullscreen:h,downloadMenu:p,panzoomRef:f}){/* @__PURE__ */
|
|
20
|
+
return q("div",{className:"mermaid-toolbar",children:[{isShow:e&&o&&!n,icon:/* @__PURE__ */q(c?k:E,{}),tooltip:c?"缩略图":"最小化",onClick:()=>d(e=>!e),className:"mermaid-minimize-btn"},{isShow:s,icon:/* @__PURE__ */q(b,{}),tooltip:a?"取消拖拽":"启用拖拽",onClick:()=>l(e=>!e),className:a?"mermaid-panzoom-btn active":"mermaid-panzoom-btn"},{isShow:i,icon:/* @__PURE__ */q(N,{}),tooltip:"放大",onClick:()=>f.current?.zoomIn()},{isShow:i,icon:/* @__PURE__ */q(x,{}),tooltip:"缩小",onClick:()=>f.current?.zoomOut()},{isShow:i,icon:/* @__PURE__ */q(T,{}),tooltip:"重置",onClick:()=>f.current?.reset()},{isShow:r&&i,icon:/* @__PURE__ */q(y,{}),tooltip:"下载",dropdown:p},{isShow:!0,icon:/* @__PURE__ */q(n?_:S,{}),tooltip:n?"退出全屏":"全屏",onClick:h,className:"mermaid-fullscreen-btn"},{isShow:e&&!n,icon:/* @__PURE__ */q(g,{}),tooltip:"查看源码",onClick:()=>m(!0),className:"mermaid-showcode-btn"},{isShow:t&&!n,icon:/* @__PURE__ */q(o?v:j,{}),tooltip:o?"展开":"收起",onClick:()=>u(e=>!e),className:"mermaid-collapsed-btn"}].map(e=>{if(!1===e.isShow)return null;const t=e.className||e.tooltip,r=e.dropdown?/* @__PURE__ */q(Jr,{items:e.dropdown.items,onClick:e.dropdown.onClick,children:/* @__PURE__ */q("div",{className:`remons-markdown-circle ${e.className||""}`,children:e.icon})},t):/* @__PURE__ */q("div",{className:`remons-markdown-circle ${e.className||""}`,onClick:e.onClick,children:e.icon},t);return e.tooltip&&O()?/* @__PURE__ */q(Zr,{title:e.tooltip,children:r},`${t}-tooltip`):r})})}var en={previewArea:"_previewArea_1hpuo_2",previewAreaMin:"_previewAreaMin_1hpuo_24",previewAreaDisabled:"_previewAreaDisabled_1hpuo_27",previewContent:"_previewContent_1hpuo_36",errorTip:"_errorTip_1hpuo_52",emptyTip:"_emptyTip_1hpuo_64"},tn=null,rn=/* @__PURE__ */new WeakSet;var nn="docList-mermaid-driver",on="docList-menu-driver",cn="docList-pc-menu-driver";function sn({source:t,options:r}){/* @__PURE__ */
|
|
21
|
+
return q(e.StrictMode,{children:/* @__PURE__ */q(Pr,{children:/* @__PURE__ */q(dn,{source:t,enablePanzoom:!0,showDownload:!0,showSourceView:!0,showCollapse:!0,transformSource:r.transformSource??r.chartConfig,defaultCollapsed:r.defaultCollapsed??!1,isPrintPreview:r.isPrintPreview??!1,minHeight:200,showDriverGuide:r.showDriverGuide,cdn:r.cdn})})})}async function an(e={}){const{rootElement:t=document}=e;Kt();const r=[];t.querySelectorAll("code.language-mermaid").forEach(e=>{const t=e;if(t.classList.contains("md-fence-open"))return void t.classList.remove("mermaid-render-noCode");const n=t.parentElement;if(!n||"PRE"!==n.tagName)return;const o=(t.textContent??"").trim();r.push({pre:n,source:o,srcHash:Zt(o)})});const n=Array.from(t.querySelectorAll(`.${jt}`)),o=new Map(r.map(e=>[e.pre,e])),c=/* @__PURE__ */new Set;for(const i of r){const e=i.pre.nextElementSibling;Xt(e)&&e.getAttribute("data-md-mermaid-src")===i.srcHash&&c.add(e)}for(const i of r){const e=i.pre.nextElementSibling;if(Xt(e)&&c.has(e))continue;const t=n.find(e=>!c.has(e)&&!o.has(e.previousElementSibling)&&e.getAttribute("data-md-mermaid-src")===i.srcHash);t&&(i.pre.after(t),c.add(t))}for(const i of r){const t=i.pre.nextElementSibling;if(Xt(t)&&c.has(t))continue;const r=Xt(t)&&!c.has(t)?t:null;if(r){r.setAttribute(zt,i.srcHash),c.add(r);const t=Ut(r);if(t){t.render(/* @__PURE__ */q(sn,{source:i.source,options:e}));continue}Vt(r),r.remove()}const n=document.createElement("div");n.className=jt,n.setAttribute(zt,i.srcHash),n.setAttribute($t,""),i.pre.after(n),Vt(n);const o=I(n);Gt(n,o),o.render(/* @__PURE__ */q(sn,{source:i.source,options:e}))}for(const i of n)c.has(i)||(Vt(i),i.remove())}var ln=/* @__PURE__ */he({MermaidChart:()=>un,default:()=>dn,renderMermaid:()=>mn,renderMermaidWithControls:()=>an}),dn=r(function({source:e,debounceMs:t=300,enablePanzoom:r=!0,showDownload:n=!0,showSourceView:c=!1,showCollapse:s=!1,defaultCollapsed:u=!1,className:m="",minHeight:h=200,showDriverGuide:p,isPrintPreview:f=!1,transformSource:g,chartConfig:w,securityLevel:v,cdn:y,driverGuideOnce:b=!0}){const{isDark:k}=qr(),{svg:_,error:S,loading:E}=Vr({source:e,debounceMs:t,isDark:k,transformSource:g,chartConfig:w,securityLevel:v,cdn:y}),C=l(null),x=l(null),{isFullscreen:N,isCollapsed:T,toggleCollapseAnimated:M,showSource:A,setShowSource:$,isMinimize:j,toggleMinimizeAnimated:z,isPanzoomEnabled:I,setIsPanzoomEnabled:D,toggleFullscreen:B,fullscreenModeRef:W}=function({showCollapse:e,showSourceView:t,defaultCollapsed:r,isPrintPreview:n,svg:c,error:s,loading:a,wrapperRef:u}){const[m,h]=d(!1),[p,f]=d(r),[g,w]=d(!1),[v,y]=d(t),[b,k]=d(!1),_=l(!1),S=l(null),E=l(!1),C=l(null),L=l(p);i(()=>{L.current=p},[p]);const x=l(v);i(()=>{x.current=v},[v]);const N=o((e,t)=>{const r=u.current;if(!r)return;const n=r.getBoundingClientRect().height,o=t?36:e?200:r.scrollHeight;Math.abs(n-o)<1||r.animate([{maxHeight:`${n}px`},{maxHeight:`${o}px`}],{duration:280,easing:"ease-in-out"})},[u]),T=o(e=>{const t="function"==typeof e?e(L.current):e;t!==L.current&&N(t,x.current),f(t)},[N]),M=o(e=>{const t="function"==typeof e?e(x.current):e;t!==x.current&&N(L.current,t),y(t)},[N]);i(()=>{n&&c&&!s&&!a&&f(!1)},[n,c,s,a]),i(()=>{if(n)return;const t=()=>{const t=u.current;if(!t)return;const n=document.fullscreenElement,o=!!n&&(n===t||t.contains(n));if(o||_.current){if(o)return _.current=!0,C.current="native",S.current=L.current,h(!0),void f(!1);_.current=!1,C.current=null,h(!1),e&&f(S.current??r),S.current=null}};return document.addEventListener("fullscreenchange",t),()=>document.removeEventListener("fullscreenchange",t)},[e,n,r,u]);const A=o(()=>{if(E.current)return E.current=!1,C.current=null,_.current=!1,h(!1),e&&f(S.current??r),void(S.current=null);document.exitFullscreen?.().catch(()=>{})},[e,r]);return i(()=>{const e=e=>{"Escape"===e.key&&E.current&&A()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[A]),{isFullscreen:m,setIsFullscreen:h,isCollapsed:p,setIsCollapsed:f,toggleCollapseAnimated:T,toggleMinimizeAnimated:M,showSource:g,setShowSource:w,isMinimize:v,setIsMinimize:y,isPanzoomEnabled:b,setIsPanzoomEnabled:k,toggleFullscreen:o(()=>{const e=u.current;if(e)if(E.current)A();else{if(document.fullscreenElement!==e)return!1===document.fullscreenEnabled||"function"!=typeof e.requestFullscreen?(E.current=!0,C.current="fallback",_.current=!0,S.current=L.current,h(!0),void f(!1)):void e.requestFullscreen?.().then(()=>{document.fullscreenElement!==e&&null===C.current&&(E.current=!0,C.current="fallback",_.current=!0,S.current=L.current,h(!0),f(!1))}).catch(()=>{console.warn("[render-markdown] 原生全屏被拒绝,降级为 CSS 全屏(宿主可能不支持 Fullscreen API)"),E.current=!0,C.current="fallback",_.current=!0,S.current=L.current,h(!0),f(!1)});document.exitFullscreen?.().catch(()=>{})}},[u,A]),fullscreenModeRef:C}}({showCollapse:s,showSourceView:c,defaultCollapsed:u,isPrintPreview:f,svg:_,error:S,loading:E,wrapperRef:C}),R=r&&(N||!T||!s),H=R&&I,G=function({contentRef:e,wrapperRef:t,canUse:r,active:n,isFullscreen:c}){const s=l(null),a=l(null),d=l(null),u=l(n);i(()=>{u.current=n},[n]);const m=o(e=>{d.current?.();const r=t.current;e.bind();const n=e.zoomWithWheel;r?.addEventListener("wheel",n),d.current=()=>{r?.removeEventListener("wheel",n),e.destroy()}},[t]),h=o(()=>{d.current?.(),d.current=null},[]);return i(()=>{const t=e.current;if(!r||!t)return h(),a.current=null,void(s.current=null);const n=ce(t,{maxScale:5,minScale:.1,startScale:1,noBind:!0});return a.current=n,s.current={destroy:()=>n.destroy(),zoomWithWheel:n.zoomWithWheel,zoomIn:()=>n.zoomIn(),zoomOut:()=>n.zoomOut(),reset:()=>n.reset()},u.current&&m(n),()=>{h(),n.destroy(),a.current===n&&(a.current=null,s.current=null)}},[r,c,e,m,h]),i(()=>{const e=a.current;e&&(n?m(e):h())},[n,m,h]),s}({contentRef:x,wrapperRef:C,canUse:r&&!!_&&!f,active:H,isFullscreen:N});i(()=>{if(!p||f||!_)return;const e=C.current;if(e){if(b){if(e.dataset.mdDriverDone)return;e.dataset.mdDriverDone="1"}!function(e){if(tn||rn.has(e))return;const t=r=>{if(r>=e.length)return tn=null,void rn.add(e);const n=e[r];if(n.condition&&!n.condition())return void t(r+1);n?.onOpen?.();const o=n.steps.filter(e=>!1!==e.isShow&&!!document.querySelector(e.element));if(0===o.length)return void t(r+1);const c=ie({nextBtnText:"下一步",prevBtnText:"上一步",doneBtnText:"我知道了",showProgress:!0,allowClose:!1,progressText:"第 {{current}} 步,共 {{total}} 步",onDestroyed:()=>{tn=null,t(r+1)},steps:o});tn=c,c.drive()};t(0)}(function(e,t){return[{id:on,condition:()=>!localStorage[on]&&e&&!O()&&"true"!==localStorage.docListMenuVisible,onOpen:()=>{localStorage[on]="1"},steps:[{element:".docList-menu-list",popover:{title:"列表",description:"点击此处您可查看当前分类下文章列表"}},{element:".docList-menu-copyHtml",popover:{title:"复制",description:"点击此处您可复制 HTML 渲染的格式内容"}},{element:".docList-menu-copyMarkdown",popover:{title:"复制",description:"点击此处您可复制 markdown 源码"}},{element:".docList-menu-print",popover:{title:"打印",description:"点击此处您可跳转至打印页面,输出为PDF"}}]},{id:cn,condition:()=>!localStorage[cn]&&O()&&e,onOpen:()=>{localStorage[cn]="1"},steps:[{element:".docList-menu-copyHtml",popover:{title:"复制",description:"点击此处您可复制 HTML 渲染的格式内容"}},{element:".docList-menu-copyMarkdown",popover:{title:"复制",description:"点击此处您可复制 markdown 源码"}},{element:".docList-menu-print",popover:{title:"打印",description:"点击此处您可跳转至打印页面,输出为PDF"}},{element:".docList-menu-mermaid-collapse",popover:{title:"展开收起mermaid",description:"点击此处按钮可一键展开收起mermaid图表"},isShow:t}]},{id:nn,condition:()=>!(!t||localStorage[nn]||!e),onOpen:()=>{localStorage[nn]="1"},steps:[{element:".mermaid-react-root",popover:{title:"mermaid",description:"恭喜您解锁 Mermaid 渲染图表"}},{element:".mermaid-react-root .mermaid-minimize-btn",popover:{title:"缩略图",description:"点击此处按钮可查看缩略图"}},{element:".mermaid-react-root .mermaid-fullscreen-btn",popover:{title:"全屏",description:"点击此处按钮可切换为全屏展示"}},{element:".mermaid-react-root .mermaid-showcode-btn",popover:{title:"源码",description:"点击此处按钮查看源码弹窗"}},{element:".mermaid-react-root .mermaid-collapsed-btn",popover:{title:"展开",description:"点击此处按钮展开大图"}}]}]}(c,!!_))}},[_,p,f,c,b]);const V=function(e){const t=e.match(/---\s*\n\s*title:\s*(.+)\s*\n\s*---/);return t?t[1].trim():"mermaid 图表"}(e),U=o(()=>{_?function(e,t="image"){Cr(new Blob([e],{type:"image/svg+xml;charset=utf-8"}),`${t}.svg`)}(_,V):ke.warning("暂无图表")},[_,V]),K=o(()=>{_?Lr(_,V,2):ke.warning("暂无图表")},[_,V]),Z=a(()=>({items:[{key:"svg",label:"下载 SVG"},{key:"png",label:"下载 PNG"}],onClick:({key:e})=>"svg"===e?U():K()}),[U,K]),X=!!_,Y=N&&"fallback"===W.current;/* @__PURE__ */
|
|
22
|
+
return F("div",{ref:C,className:pe.default.bind(en)(N?"mermaid-wrapper-fullscreen":"",Y?"mermaid-wrapper-fullscreen-fallback":"",s?"mermaid-wrapper":"",T&&s&&!j?"mermaid-collapsed":"",m,j&&T&&!N?"mermaid-mini":"",f?"print-preview":""),style:{minHeight:j?0:h,position:Y?"fixed":"relative",height:"100%"},children:[!f&&/* @__PURE__ */F(P,{children:[c&&/* @__PURE__ */F("div",{className:"mermaid-title",children:[/* @__PURE__ */F("span",{className:"mermaid-title-tag",children:[/* @__PURE__ */q("img",{src:"data:image/svg+xml,%3csvg%20t='1784097187016'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='5199'%20width='200'%20height='200'%3e%3cpath%20d='M0%200m125.754386%200l772.491228%200q125.754386%200%20125.754386%20125.754386l0%20772.491228q0%20125.754386-125.754386%20125.754386l-772.491228%200q-125.754386%200-125.754386-125.754386l0-772.491228q0-125.754386%20125.754386-125.754386Z'%20fill='%23FC366E'%20p-id='5200'%3e%3c/path%3e%3cpath%20d='M921.150877%20174.547088a417.091368%20417.091368%200%200%200-409.168842%20274.198456%20417.235088%20417.235088%200%200%200-409.150877-274.198456%20417.360842%20417.360842%200%200%200%20181.625263%20361.992982%20223.914667%20223.914667%200%200%201%2097.010526%20185.038597v128.143719h261.084071v-128.07186a223.914667%20223.914667%200%200%201%2097.010526-185.038596%20417.181193%20417.181193%200%200%200%20181.553403-361.921123z'%20fill='%23FFFFFF'%20p-id='5201'%3e%3c/path%3e%3c/svg%3e",alt:""}),/* @__PURE__ */q("span",{className:"mermaid-title-text",children:"Mermaid"})]}),V]}),!X&&/* @__PURE__ */F("div",{className:"mermaid-toolbar-loading",children:[/* @__PURE__ */q(L,{})," "]}),X&&/* @__PURE__ */q(Qr,{showSourceView:c,showCollapse:s,showDownload:n,isFullscreen:N,isCollapsed:T,isMinimize:j,isPanzoomActive:H,isPanzoomAvailable:R,isPanzoomEnabled:I,setIsPanzoomEnabled:D,setIsMinimize:z,setIsCollapsed:M,setShowSource:$,toggleFullscreen:()=>{G.current?.reset(),B()},downloadMenu:Z,panzoomRef:G})]}),S&&/* @__PURE__ */F("div",{className:en.errorTip,children:["⚠️ ",S]}),
|
|
23
|
+
/* @__PURE__ */F("div",{className:`${en.previewArea} ${en.previewAreaMin} ${H?"":en.previewAreaDisabled}`,style:{minHeight:X?void 0:h},children:[/* @__PURE__ */q("div",{ref:x,className:en.previewContent,dangerouslySetInnerHTML:{__html:_||""}}),(!X&&!S||E)&&/* @__PURE__ */q("div",{className:en.emptyTip,children:e?.trim()?"渲染中...":"← 输入 Mermaid 源码"})]}),c&&/* @__PURE__ */q(Or,{open:A,title:"Mermaid 源码",className:"mermaid-code-modal",width:O()?800:"calc(100% - 20px)",onCancel:()=>$(!1),footer:null,children:/* @__PURE__ */q(Sr,{showCollapseButton:!1,enableMermaid:!1,codeType:"mermaid",content:e})})]})}),un=e=>/* @__PURE__ */q(Pr,{children:/* @__PURE__ */q(dn,{...e})}),mn=e=>/* @__PURE__ */q(un,{...e}),hn=Sr;export{qe as DEFAULT_CIRCLED_CLASS,Tt as DEFAULT_WORD_COUNT_TEMPLATE,$t as MD_PERSIST_ATTR,un as MermaidChart,Pr as ThemeProvider,qt as addExcludedSelector,Be as circledNumbers,Nt as countWords,hn as default,Ue as defaultValidateLink,At as formatWordCount,Ct as initHighlighter,zr as initTheme,Er as languagesCommon,Et as markdownFormat,Wr as registerCdn,Ft as removeExcludedSelector,mn as renderMermaid,ur as useIncrementalRender,qr as useTheme};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* wordCount
|
|
3
|
+
* Markdown 感知的字数统计:先剥离语法壳(围栏代码块、行内代码、图片、链接地址、
|
|
4
|
+
* HTML 标签、强调/列表/表格等标记),只对正文文本计数。
|
|
5
|
+
* 中英文分别统计:CJK 按字符计,西文按空白分词计。
|
|
6
|
+
*/
|
|
7
|
+
export interface WordCountResult {
|
|
8
|
+
/** CJK 字符数(中日韩文,按字计) */
|
|
9
|
+
chinese: number;
|
|
10
|
+
/** 西文单词数(按词计) */
|
|
11
|
+
words: number;
|
|
12
|
+
/** 正文总字数 = chinese + words */
|
|
13
|
+
total: number;
|
|
14
|
+
/** 剥离语法标记后的正文字符数(含空白) */
|
|
15
|
+
characters: number;
|
|
16
|
+
/** 正文字符数(不含空白) */
|
|
17
|
+
charactersWithoutSpaces: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 统计 Markdown 正文字数(语法标记不计入)
|
|
21
|
+
* @param content - Markdown 源码
|
|
22
|
+
*/
|
|
23
|
+
export declare function countWords(content: string): WordCountResult;
|
|
24
|
+
/** 内置模板,供组件默认展示与文档引用同一口径 */
|
|
25
|
+
export declare const DEFAULT_WORD_COUNT_TEMPLATE = "\u5B57\u6570\u7EDF\u8BA1 {total}";
|
|
26
|
+
/**
|
|
27
|
+
* 按模板渲染字数统计文案,占位符为 `{WordCountResult 字段名}`:
|
|
28
|
+
* `{total}` / `{chinese}` / `{words}` / `{characters}` / `{charactersWithoutSpaces}`,
|
|
29
|
+
* 其中 `{total}` 另有 `{wordCount}` / `{count}` 两个别名。
|
|
30
|
+
* 非字符串或空串一律降级为内置模板,未知占位符原样保留,让写错的字段名可见而非静默消失。
|
|
31
|
+
* @param template - 模板字符串
|
|
32
|
+
* @param result - 计数结果
|
|
33
|
+
*/
|
|
34
|
+
export declare function formatWordCount(template: unknown, result: WordCountResult): string;
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -73,10 +73,13 @@ import RenderMarkdown, {
|
|
|
73
73
|
removeExcludedSelector,
|
|
74
74
|
defaultValidateLink,
|
|
75
75
|
registerCdn,
|
|
76
|
+
countWords,
|
|
77
|
+
formatWordCount,
|
|
78
|
+
DEFAULT_WORD_COUNT_TEMPLATE,
|
|
76
79
|
} from 'remons-render-markdown';
|
|
77
80
|
|
|
78
81
|
// 类型
|
|
79
|
-
import type { RenderMarkdownProps, MarkdownPlugin, AnchorItem, ThemeMode } from 'remons-render-markdown';
|
|
82
|
+
import type { RenderMarkdownProps, MarkdownPlugin, AnchorItem, ThemeMode, WordCountResult } from 'remons-render-markdown';
|
|
80
83
|
|
|
81
84
|
// 样式(构建产物为 dist/index.css)
|
|
82
85
|
import 'remons-render-markdown/style.css';
|
|
@@ -99,6 +102,8 @@ import 'remons-render-markdown/style.css';
|
|
|
99
102
|
- **addExcludedSelector** / **removeExcludedSelector**: 图片预览的全局排除名单增删(默认名单已含 `pre` 与 `.mermaid-react-root`)
|
|
100
103
|
- **defaultValidateLink**: 本库默认链接校验(markdown-it 原生名单 + 放行无脚本特征的内联 svg),自定义 `validateLink` 时可拿它做基线复用
|
|
101
104
|
- **registerCdn**: 注册懒加载资源(如 mermaid)的默认 CDN 地址
|
|
105
|
+
- **countWords**: Markdown 感知的字数统计函数,剥离语法标记后按正文计数,返回 `WordCountResult`
|
|
106
|
+
- **formatWordCount** / **DEFAULT_WORD_COUNT_TEMPLATE**: 按 `{字段名}` 模板渲染字数文案(与组件 `wordCountTemplate` 同一实现)与内置默认模板 `'字数 {total}'`
|
|
102
107
|
|
|
103
108
|
### RenderMarkdown 组件 Props
|
|
104
109
|
|
|
@@ -119,6 +124,8 @@ import 'remons-render-markdown/style.css';
|
|
|
119
124
|
| showBackTop | boolean | ❌ | `false` | 是否显示返回顶部按钮 |
|
|
120
125
|
| backTopTarget | HTMLElement \| null \| (() => HTMLElement \| null) | ❌ | `document.body` | 返回顶部监听的滚动容器。传元素为初始化语义(仅首次渲染读取);传 getter 则在 BackTop 挂载后(DOM 已提交)解析,返回 `null` 时逐帧重试(上限约 4s),用于滚动容器由本组件生成、宿主在 render 阶段取不到的场景(如 `.markdown-html`) |
|
|
121
126
|
| footer | React.ReactNode | ❌ | - | 内容区下方的自定义底部 |
|
|
127
|
+
| showWordCount | boolean | ❌ | `true` | 是否在内容底部展示字数统计(语法标记不计入);传 `false` 关闭,非初始化语义,可随时切换 |
|
|
128
|
+
| wordCountTemplate | string | ❌ | `'字数 {total}'` | 字数统计文案模板,`{字段名}` 为占位符(见下《字数统计文案模板》),非初始化语义 |
|
|
122
129
|
| customRenderers | MarkdownPlugin[] | ❌ | - | 自定义 markdown-it 插件,在内置插件之后按序执行 |
|
|
123
130
|
| transformSource | (text: string) => string | ❌ | - | 渲染前改写 mermaid 源码 |
|
|
124
131
|
| defaultCollapsed | boolean | ❌ | `true` | 代码块 / 图表默认折叠状态 |
|
|
@@ -137,6 +144,31 @@ import 'remons-render-markdown/style.css';
|
|
|
137
144
|
| `useIncremental` | `incremental` |
|
|
138
145
|
| `chartConfig` | `transformSource` |
|
|
139
146
|
|
|
147
|
+
### 字数统计文案模板
|
|
148
|
+
|
|
149
|
+
`wordCountTemplate` 用 `{字段名}` 占位符,字段名与 `countWords` 返回的 `WordCountResult` 一致:
|
|
150
|
+
|
|
151
|
+
| 占位符 | 含义 |
|
|
152
|
+
|--------|------|
|
|
153
|
+
| `{total}` | 总字数(CJK 字符数 + 西文词数),默认展示项;可写作 `{wordCount}` / `{count}` |
|
|
154
|
+
| `{chinese}` | CJK 字符数(中日韩,按字计) |
|
|
155
|
+
| `{words}` | 西文词数(按词计) |
|
|
156
|
+
| `{characters}` | 正文字符数(含空白) |
|
|
157
|
+
| `{charactersWithoutSpaces}` | 正文字符数(不含空白) |
|
|
158
|
+
|
|
159
|
+
```tsx
|
|
160
|
+
<RenderMarkdown content={md} /> // 字数 1234
|
|
161
|
+
<RenderMarkdown content={md} wordCountTemplate="共{total}字" /> // 共 1234 字
|
|
162
|
+
<RenderMarkdown
|
|
163
|
+
content={md}
|
|
164
|
+
wordCountTemplate="{total} 字({chinese} 中文字 / {words} 英文词)"
|
|
165
|
+
/>
|
|
166
|
+
<RenderMarkdown content={md} showWordCount={false} /> {/* 关闭 */}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
> 默认只展示 `{total}`,细分数据需要时写在模板里或直接用 `countWords` 自行取用。
|
|
170
|
+
> `{total}` 另有 `{wordCount}` / `{count}` 两个别名;除此之外未知占位符(如 `{wordCounts}`)原样保留,便于发现字段名拼写错误;传空串或不传回到默认模板。
|
|
171
|
+
|
|
140
172
|
### markdownFormat 函数
|
|
141
173
|
|
|
142
174
|
解析 Markdown 内容并返回结构化数据。**异步函数**(内部等待 KaTeX CDN 就绪)。
|