@hejiayue/x-markdown-test 0.0.1-beta.131 → 0.0.1-beta.133
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/x-markdown.cjs24.js +1 -1
- package/dist/x-markdown.cjs24.js.map +1 -1
- package/dist/x-markdown.cjs26.js.map +1 -1
- package/dist/x-markdown.cjs30.js.map +1 -1
- package/dist/x-markdown.cjs9.js +1 -1
- package/dist/x-markdown.cjs9.js.map +1 -1
- package/dist/x-markdown.es24.js +1 -1
- package/dist/x-markdown.es24.js.map +1 -1
- package/dist/x-markdown.es26.js.map +1 -1
- package/dist/x-markdown.es30.js.map +1 -1
- package/dist/x-markdown.es9.js +2 -4
- package/dist/x-markdown.es9.js.map +1 -1
- package/package.json +13 -2
package/dist/x-markdown.cjs24.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("./x-markdown.cjs26.js"),o=require("./x-markdown.cjs9.js"),a=require("./x-markdown.cjs28.js");;/* empty css */const l=require("./x-markdown.cjs17.js"),n={class:"toolbar-container"},r={class:"mermaid-toolbar"},i={class:"toolbar-left"},c={class:"segmented-control"},d={class:"toolbar-right"},s=["title","onClick"],u={key:0,width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},m={key:1,width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},v={class:"mermaid-source-code"},h=e.defineComponent({__name:"index",props:{isDark:{type:Boolean,default:!1},shikiTheme:{default:()=>["vitesse-light","vitesse-dark"]},config:{default:()=>({})},mermaidActions:{default:void 0},raw:{default:()=>({})}},setup(h){const k=h,w=e.ref(null),p=e.ref(!1),g=e.ref(!
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("./x-markdown.cjs26.js"),o=require("./x-markdown.cjs9.js"),a=require("./x-markdown.cjs28.js");;/* empty css */const l=require("./x-markdown.cjs17.js"),n={class:"toolbar-container"},r={class:"mermaid-toolbar"},i={class:"toolbar-left"},c={class:"segmented-control"},d={class:"toolbar-right"},s=["title","onClick"],u={key:0,width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},m={key:1,width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},v={class:"mermaid-source-code"},h=e.defineComponent({__name:"index",props:{isDark:{type:Boolean,default:!1},shikiTheme:{default:()=>["vitesse-light","vitesse-dark"]},config:{default:()=>({})},mermaidActions:{default:void 0},raw:{default:()=>({})}},setup(h){const k=h,w=e.ref(null),p=e.ref(!1),g=e.ref(!0),f=e.computed(()=>k.raw?.content||""),V=e.computed(()=>`mermaid-${k.raw?.key||"default"}`),C=e.computed(()=>w.value?.isLoading??!0),E=e.computed(()=>w.value?.svg??""),N=e.computed(()=>p.value?"code":"diagram");function y(e){e?.stopPropagation(),e?.preventDefault(),p.value||w.value?.zoomIn()}function b(e){e?.stopPropagation(),e?.preventDefault(),p.value||w.value?.zoomOut()}function B(e){e?.stopPropagation(),e?.preventDefault(),p.value||w.value?.reset()}function x(){p.value||w.value?.fullscreen()}function z(){p.value=!p.value}const{copy:L,copied:M}=t.useClipboard({copiedDuring:1500});function j(e){"code"!==e||p.value?"diagram"===e&&p.value&&(p.value=!1):p.value=!0}async function D(e){e?.stopPropagation(),e?.preventDefault(),M.value||k.raw.content&&await L(k.raw.content)}function P(){w.value?.download()}const S=e.computed(()=>k.mermaidActions||[]),_=e.computed(()=>S.value.filter(e=>!e.show||e.show(H.value))),H=e.computed(()=>({showSourceCode:p.value,svg:E.value,rawContent:k.raw.content||"",isLoading:C.value,copied:M.value,zoomIn:y,zoomOut:b,reset:B,fullscreen:x,toggleCode:z,copyCode:D,download:P,raw:k.raw}));function T(t){if(!t.icon)return null;if("string"==typeof t.icon)return e.h("span",{class:"mermaid-action-icon",innerHTML:t.icon});if("function"==typeof t.icon){try{const e=t.icon(H.value);if(e&&"object"==typeof e&&"__v_isVNode"in e)return e}catch{}return e.h(t.icon)}return e.h(t.icon)}const q=e.computed(()=>({showSourceCode:p.value,svg:E.value,rawContent:k.raw.content||"",isLoading:C.value,copied:M.value,zoomIn:y,zoomOut:b,reset:B,fullscreen:x,toggleCode:z,copyCode:D,download:P,raw:k.raw}));return e.onMounted(async()=>{const e=await o.checkMermaidAvailable();g.value=!e}),(t,o)=>g.value?(e.openBlock(),e.createBlock(l.default,{key:0,code:k.raw?.content||"",language:"mermaid","is-dark":k.isDark,"light-theme":k.shikiTheme[0],"dark-theme":k.shikiTheme[1]},null,8,["code","is-dark","light-theme","dark-theme"])):(e.openBlock(),e.createElementBlock("div",{key:k.raw.key,class:e.normalizeClass(["markdown-mermaid",{"markdown-mermaid--dark":k.isDark}])},[e.createVNode(e.Transition,{name:"toolbar",appear:""},{default:e.withCtx(()=>[e.createElementVNode("div",n,[e.renderSlot(t.$slots,"mermaidHeader",e.normalizeProps(e.guardReactiveProps(q.value)),()=>[e.createElementVNode("div",r,[e.createElementVNode("div",i,[e.createElementVNode("div",c,[e.createElementVNode("div",{class:e.normalizeClass(["segmented-slider",{"slide-right":"code"===N.value}])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["segment-item",{active:"diagram"===N.value}]),onClick:o[0]||(o[0]=e=>j("diagram"))},[...o[6]||(o[6]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M12 2L2 7L12 12L22 7L12 2Z",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M2 17L12 22L22 17",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M2 12L12 17L22 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),e.createElementVNode("span",null,"预览",-1)])],2),e.createElementVNode("div",{class:e.normalizeClass(["segment-item",{active:"code"===N.value}]),onClick:o[1]||(o[1]=e=>j("code"))},[...o[7]||(o[7]=[e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M16 18L22 12L16 6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e.createElementVNode("path",{d:"M8 6L2 12L8 18",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),e.createElementVNode("span",null,"代码",-1)])],2)])]),e.createElementVNode("div",d,[e.renderSlot(t.$slots,"mermaidActions",e.normalizeProps(e.guardReactiveProps(q.value)),()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.key,class:e.normalizeClass(["toolbar-action-btn",[t.class,{"toolbar-action-btn--disabled":t.disabled}]]),style:e.normalizeStyle(t.style),title:t.title,onClick:e=>function(e){e.disabled||e.onClick?.(H.value)}(t)},[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(T(t)),{key:0})):e.createCommentVNode("",!0)],14,s))),128)),p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["toolbar-action-btn",{"copy-success":e.unref(M)}]),title:"复制代码",onClick:o[2]||(o[2]=e=>D(e))},[e.unref(M)?(e.openBlock(),e.createElementBlock("svg",u,[...o[8]||(o[8]=[e.createElementVNode("path",{fill:"currentColor",d:"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",m,[...o[9]||(o[9]=[e.createElementVNode("path",{fill:"currentColor",d:"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64"},null,-1)])]))],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"toolbar-action-btn",title:"缩小",onClick:o[3]||(o[3]=e=>b(e))},[...o[10]||(o[10]=[e.createElementVNode("svg",{width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"})],-1)])]),e.createElementVNode("div",{class:"toolbar-action-btn",title:"放大",onClick:o[4]||(o[4]=e=>y(e))},[...o[11]||(o[11]=[e.createElementVNode("svg",{width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"})],-1)])]),e.createElementVNode("div",{class:"toolbar-action-btn",title:"重置",onClick:o[5]||(o[5]=e=>B(e))},[...o[12]||(o[12]=[e.createElementVNode("svg",{width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),e.createElementVNode("path",{fill:"currentColor",d:"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32"})],-1)])]),e.createElementVNode("div",{class:"toolbar-action-btn",title:"下载",onClick:P},[...o[13]||(o[13]=[e.createElementVNode("svg",{width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})],-1)])])],64))])])])])])]),_:3}),e.withDirectives(e.createElementVNode("div",v,[e.createVNode(l.default,{code:k.raw?.content||"",language:"mermaid","is-dark":k.isDark,"light-theme":k.shikiTheme[0],"dark-theme":k.shikiTheme[1],"show-code-block-header":!1,"sticky-code-block-header":!1},null,8,["code","is-dark","light-theme","dark-theme"])],512),[[e.vShow,p.value]]),e.withDirectives(e.createVNode(a.default,{ref_key:"syntaxMermaidRef",ref:w,content:f.value,id:V.value,"is-dark":k.isDark,config:k.config},null,8,["content","id","is-dark","config"]),[[e.vShow,!p.value]])],2))}});exports.default=h;
|
|
2
2
|
//# sourceMappingURL=x-markdown.cjs24.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x-markdown.cjs24.js","sources":["../src/components/Mermaid/index.vue"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport type { MdComponent, MermaidExposeProps, MermaidAction, MermaidSlotProps } from './types'\r\nimport type { VNode } from 'vue'\r\nimport { computed, ref, h, onMounted } from 'vue'\r\nimport { useClipboard } from '@vueuse/core'\r\n// 使用运行时检测\r\nimport { checkMermaidAvailable } from '../../hooks/useMermaid'\r\nimport SyntaxMermaid from './SyntaxMermaid.vue'\r\nimport CodeBlock from '../CodeBlock/index.vue'\r\n\r\ninterface MermaidProps extends MdComponent {\r\n isDark?: boolean\r\n shikiTheme?: [string, string]\r\n config?: Record<string, any>\r\n mermaidActions?: MermaidAction[]\r\n}\r\n\r\nconst props = withDefaults(defineProps<MermaidProps>(), {\r\n raw: () => ({}),\r\n isDark: false,\r\n shikiTheme: () => ['vitesse-light', 'vitesse-dark'],\r\n config: () => ({}),\r\n mermaidActions: undefined,\r\n})\r\n\r\nconst syntaxMermaidRef = ref<InstanceType<typeof SyntaxMermaid> | null>(null)\r\nconst showSourceCode = ref(false)\r\n// 运行时检测 mermaid 是否可用\r\nconst isDegraded = ref(false)\r\nconst mermaidContent = computed(() => props.raw?.content || '')\r\nconst mermaidId = computed(() => `mermaid-${props.raw?.key || 'default'}`)\r\nconst isLoading = computed(() => syntaxMermaidRef.value?.isLoading ?? true)\r\nconst svg = computed(() => syntaxMermaidRef.value?.svg ?? '')\r\nconst activeTab = computed(() => (showSourceCode.value ? 'code' : 'diagram'))\r\n\r\nfunction handleZoomIn(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.zoomIn()\r\n }\r\n}\r\n\r\nfunction handleZoomOut(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.zoomOut()\r\n }\r\n}\r\n\r\nfunction handleReset(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.reset()\r\n }\r\n}\r\n\r\nfunction handleFullscreen() {\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.fullscreen()\r\n }\r\n}\r\n\r\nfunction handleToggleCode() {\r\n showSourceCode.value = !showSourceCode.value\r\n}\r\n\r\nconst { copy: copyCode, copied } = useClipboard({ copiedDuring: 1500 })\r\n\r\nfunction handleTabClick(tabName: string) {\r\n if (tabName === 'code' && !showSourceCode.value) {\r\n showSourceCode.value = true\r\n } else if (tabName === 'diagram' && showSourceCode.value) {\r\n showSourceCode.value = false\r\n }\r\n}\r\n\r\nasync function handleCopyCode(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n\r\n if (copied.value) {\r\n return\r\n }\r\n\r\n if (!props.raw.content) {\r\n return\r\n }\r\n await copyCode(props.raw.content)\r\n}\r\n\r\nfunction handleDownload() {\r\n syntaxMermaidRef.value?.download()\r\n}\r\n\r\nconst normalizedActions = computed<MermaidAction[]>(() => {\r\n return props.mermaidActions || []\r\n})\r\n\r\nconst filteredActions = computed<MermaidAction[]>(() => {\r\n return normalizedActions.value.filter((action) => {\r\n if (!action.show) return true\r\n return action.show(slotProps.value)\r\n })\r\n})\r\n\r\nconst slotProps = computed<MermaidSlotProps>(() => ({\r\n showSourceCode: showSourceCode.value,\r\n svg: svg.value,\r\n rawContent: props.raw.content || '',\r\n isLoading: isLoading.value,\r\n copied: copied.value,\r\n zoomIn: handleZoomIn,\r\n zoomOut: handleZoomOut,\r\n reset: handleReset,\r\n fullscreen: handleFullscreen,\r\n toggleCode: handleToggleCode,\r\n copyCode: handleCopyCode,\r\n download: handleDownload,\r\n raw: props.raw,\r\n}))\r\n\r\nfunction renderActionIcon(action: MermaidAction): VNode | null {\r\n if (!action.icon) return null\r\n\r\n if (typeof action.icon === 'string') {\r\n return h('span', {\r\n class: 'mermaid-action-icon',\r\n innerHTML: action.icon,\r\n })\r\n }\r\n\r\n if (typeof action.icon === 'function') {\r\n try {\r\n const result = (action.icon as (props: MermaidSlotProps) => VNode)(slotProps.value)\r\n if (result && typeof result === 'object' && '__v_isVNode' in result) {\r\n return result\r\n }\r\n } catch {}\r\n return h(action.icon as any)\r\n }\r\n\r\n return h(action.icon as any)\r\n}\r\n\r\nfunction handleActionClick(action: MermaidAction) {\r\n if (action.disabled) return\r\n action.onClick?.(slotProps.value)\r\n}\r\n\r\nconst exposedMethods = computed(\r\n () =>\r\n ({\r\n showSourceCode: showSourceCode.value,\r\n svg: svg.value,\r\n rawContent: props.raw.content || '',\r\n isLoading: isLoading.value,\r\n copied: copied.value,\r\n zoomIn: handleZoomIn,\r\n zoomOut: handleZoomOut,\r\n reset: handleReset,\r\n fullscreen: handleFullscreen,\r\n toggleCode: handleToggleCode,\r\n copyCode: handleCopyCode,\r\n download: handleDownload,\r\n raw: props.raw,\r\n }) satisfies MermaidExposeProps,\r\n)\r\n\r\n// 组件挂载时检测 mermaid 是否可用\r\nonMounted(async () => {\r\n const hasMermaid = await checkMermaidAvailable()\r\n isDegraded.value = !hasMermaid\r\n})\r\n</script>\r\n\r\n<template>\r\n <!-- 当 Mermaid 不可用时(降级),渲染 CodeBlock -->\r\n <CodeBlock\r\n v-if=\"isDegraded\"\r\n :code=\"props.raw?.content || ''\"\r\n language=\"mermaid\"\r\n :is-dark=\"props.isDark\"\r\n :light-theme=\"props.shikiTheme[0]\"\r\n :dark-theme=\"props.shikiTheme[1]\"\r\n />\r\n\r\n <!-- 当 Mermaid 可用时,渲染完整的 Mermaid 组件 -->\r\n <div v-else :key=\"props.raw.key\" class=\"markdown-mermaid\" :class=\"{ 'markdown-mermaid--dark': props.isDark }\">\r\n <Transition name=\"toolbar\" appear>\r\n <div class=\"toolbar-container\">\r\n <slot name=\"mermaidHeader\" v-bind=\"exposedMethods\">\r\n <div class=\"mermaid-toolbar\">\r\n <div class=\"toolbar-left\">\r\n <div class=\"segmented-control\">\r\n <div class=\"segmented-slider\" :class=\"{ 'slide-right': activeTab === 'code' }\" />\r\n <div\r\n class=\"segment-item\"\r\n :class=\"{ active: activeTab === 'diagram' }\"\r\n @click=\"handleTabClick('diagram')\"\r\n >\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M12 2L2 7L12 12L22 7L12 2Z\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M2 17L12 22L22 17\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M2 12L12 17L22 12\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n <span>预览</span>\r\n </div>\r\n <div class=\"segment-item\" :class=\"{ active: activeTab === 'code' }\" @click=\"handleTabClick('code')\">\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M16 18L22 12L16 6\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M8 6L2 12L8 18\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n <span>代码</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"toolbar-right\">\r\n <slot name=\"mermaidActions\" v-bind=\"exposedMethods\">\r\n <div\r\n v-for=\"action in filteredActions\"\r\n :key=\"action.key\"\r\n class=\"toolbar-action-btn\"\r\n :class=\"[action.class, { 'toolbar-action-btn--disabled': action.disabled }]\"\r\n :style=\"action.style\"\r\n :title=\"action.title\"\r\n @click=\"handleActionClick(action)\"\r\n >\r\n <component :is=\"renderActionIcon(action)\" v-if=\"action.icon\" />\r\n </div>\r\n\r\n <template v-if=\"showSourceCode\">\r\n <div\r\n class=\"toolbar-action-btn\"\r\n :class=\"{ 'copy-success': copied }\"\r\n title=\"复制代码\"\r\n @click=\"handleCopyCode($event)\"\r\n >\r\n <svg\r\n v-if=\"copied\"\r\n width=\"16\"\r\n height=\"16\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 1024 1024\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z\"\r\n />\r\n </svg>\r\n <svg v-else width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64\"\r\n />\r\n </svg>\r\n </div>\r\n </template>\r\n\r\n <template v-else>\r\n <div class=\"toolbar-action-btn\" title=\"缩小\" @click=\"handleZoomOut($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"放大\" @click=\"handleZoomIn($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"重置\" @click=\"handleReset($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"下载\" @click=\"handleDownload\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z\"\r\n />\r\n </svg>\r\n </div>\r\n </template>\r\n </slot>\r\n </div>\r\n </div>\r\n </slot>\r\n </div>\r\n </Transition>\r\n\r\n <div v-show=\"showSourceCode\" class=\"mermaid-source-code\">\r\n <CodeBlock\r\n :code=\"props.raw?.content || ''\"\r\n language=\"mermaid\"\r\n :is-dark=\"props.isDark\"\r\n :light-theme=\"props.shikiTheme[0]\"\r\n :dark-theme=\"props.shikiTheme[1]\"\r\n :show-code-block-header=\"false\"\r\n :sticky-code-block-header=\"false\"\r\n />\r\n </div>\r\n\r\n <SyntaxMermaid\r\n v-show=\"!showSourceCode\"\r\n ref=\"syntaxMermaidRef\"\r\n :content=\"mermaidContent\"\r\n :id=\"mermaidId\"\r\n :is-dark=\"props.isDark\"\r\n :config=\"props.config\"\r\n />\r\n </div>\r\n</template>\r\n\r\n<style>\r\n.markdown-mermaid {\r\n border-radius: 8px;\r\n overflow: hidden;\r\n font-size: 0;\r\n background: rgba(0, 0, 0, 0.03);\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark {\r\n background: rgba(255, 255, 255, 0.13);\r\n}\r\n\r\n.markdown-mermaid .toolbar-container {\r\n position: relative;\r\n z-index: 10;\r\n flex-shrink: 0;\r\n background: rgba(0, 0, 0, 0.05);\r\n color: #333;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .toolbar-container {\r\n background: rgba(0, 0, 0, 0.25);\r\n color: #fff;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 8px 16px;\r\n background: transparent;\r\n color: inherit;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-left {\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-control {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n background: rgba(0, 0, 0, 0.06);\r\n border-radius: 6px;\r\n padding: 3px;\r\n gap: 2px;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segmented-control {\r\n background: rgba(255, 255, 255, 0.08);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-slider {\r\n position: absolute;\r\n top: 3px;\r\n left: 3px;\r\n width: calc(50% - 4px);\r\n height: calc(100% - 6px);\r\n background: #fff;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\r\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\r\n z-index: 0;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segmented-slider {\r\n background: rgba(255, 255, 255, 0.15);\r\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-slider.slide-right {\r\n transform: translateX(calc(100% + 2px));\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 4px;\r\n font-size: 12px;\r\n border: none;\r\n color: inherit;\r\n min-width: 60px;\r\n text-align: center;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n cursor: pointer;\r\n border-radius: 4px;\r\n padding: 5px 12px;\r\n transition: all 0.2s ease;\r\n background: transparent;\r\n opacity: 0.6;\r\n user-select: none;\r\n position: relative;\r\n z-index: 1;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item.active {\r\n opacity: 1;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segment-item.active {\r\n color: #fff;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item:hover {\r\n opacity: 1;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item svg {\r\n flex-shrink: 0;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-right {\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 28px;\r\n height: 28px;\r\n padding: 0;\r\n border: none;\r\n border-radius: 4px;\r\n background: transparent;\r\n color: inherit;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n opacity: 0.7;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn:hover {\r\n opacity: 1;\r\n background: rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn.copy-success {\r\n opacity: 1;\r\n color: #22c55e;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .toolbar-action-btn:hover {\r\n background: rgba(255, 255, 255, 0.1);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn.toolbar-action-btn--disabled {\r\n opacity: 0.3;\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .mermaid-action-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .mermaid-action-icon :deep(svg) {\r\n width: 16px;\r\n height: 16px;\r\n flex-shrink: 0;\r\n}\r\n\r\n.markdown-mermaid .mermaid-source-code {\r\n position: relative;\r\n z-index: 1;\r\n flex: 1;\r\n width: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n}\r\n\r\n.toolbar-enter-active,\r\n.toolbar-leave-active {\r\n transition: opacity 0.3s ease;\r\n}\r\n\r\n.toolbar-enter-from,\r\n.toolbar-leave-to {\r\n opacity: 0;\r\n}\r\n</style>\r\n"],"names":["props","__props","syntaxMermaidRef","ref","showSourceCode","isDegraded","mermaidContent","computed","raw","content","mermaidId","key","isLoading","value","svg","activeTab","handleZoomIn","event","stopPropagation","preventDefault","zoomIn","handleZoomOut","zoomOut","handleReset","reset","handleFullscreen","fullscreen","handleToggleCode","copy","copyCode","copied","useClipboard","copiedDuring","handleTabClick","tabName","async","handleCopyCode","handleDownload","download","normalizedActions","mermaidActions","filteredActions","filter","action","show","slotProps","rawContent","toggleCode","renderActionIcon","icon","h","class","innerHTML","result","exposedMethods","onMounted","hasMermaid","checkMermaidAvailable","_createBlock","CodeBlock","code","language","isDark","shikiTheme","_createElementBlock","_normalizeClass","_createVNode","_Transition","name","appear","_createElementVNode","_hoisted_1","_renderSlot","_ctx","$slots","_normalizeProps","_guardReactiveProps","_hoisted_2","_hoisted_3","_hoisted_4","active","onClick","width","height","viewBox","fill","xmlns","d","stroke","_hoisted_5","_Fragment","_renderList","disabled","style","_normalizeStyle","title","$event","handleActionClick","_resolveDynamicComponent","_unref","_cache","_openBlock","_hoisted_7","_hoisted_8","_withDirectives","_hoisted_9","SyntaxMermaid","id","config"],"mappings":"+4BAiBA,MAAMA,EAAQC,EAQRC,EAAmBC,EAAAA,IAA+C,MAClEC,EAAiBD,EAAAA,KAAI,GAErBE,EAAaF,EAAAA,KAAI,GACjBG,EAAiBC,EAAAA,SAAS,IAAMP,EAAMQ,KAAKC,SAAW,IACtDC,EAAYH,WAAS,IAAM,WAAWP,EAAMQ,KAAKG,KAAO,aACxDC,EAAYL,EAAAA,SAAS,IAAML,EAAiBW,OAAOD,YAAa,GAChEE,EAAMP,EAAAA,SAAS,IAAML,EAAiBW,OAAOC,KAAO,IACpDC,EAAYR,EAAAA,SAAS,IAAOH,EAAeS,MAAQ,OAAS,WAElE,SAASG,EAAaC,GACpBA,GAAOC,kBACPD,GAAOE,iBACFf,EAAeS,OAClBX,EAAiBW,OAAOO,QAE5B,CAEA,SAASC,EAAcJ,GACrBA,GAAOC,kBACPD,GAAOE,iBACFf,EAAeS,OAClBX,EAAiBW,OAAOS,SAE5B,CAEA,SAASC,EAAYN,GACnBA,GAAOC,kBACPD,GAAOE,iBACFf,EAAeS,OAClBX,EAAiBW,OAAOW,OAE5B,CAEA,SAASC,IACFrB,EAAeS,OAClBX,EAAi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{ MdComponent, MermaidExposeProps, MermaidAction, MermaidSlotProps } from './types'\r\nimport type { VNode } from 'vue'\r\nimport { computed, ref, h, onMounted } from 'vue'\r\nimport { useClipboard } from '@vueuse/core'\r\n// 使用运行时检测\r\nimport { checkMermaidAvailable } from '../../hooks/useMermaid'\r\nimport SyntaxMermaid from './SyntaxMermaid.vue'\r\nimport CodeBlock from '../CodeBlock/index.vue'\r\n\r\ninterface MermaidProps extends MdComponent {\r\n isDark?: boolean\r\n shikiTheme?: [string, string]\r\n config?: Record<string, any>\r\n mermaidActions?: MermaidAction[]\r\n}\r\n\r\nconst props = withDefaults(defineProps<MermaidProps>(), {\r\n raw: () => ({}),\r\n isDark: false,\r\n shikiTheme: () => ['vitesse-light', 'vitesse-dark'],\r\n config: () => ({}),\r\n mermaidActions: undefined,\r\n})\r\n\r\nconst syntaxMermaidRef = ref<InstanceType<typeof SyntaxMermaid> | null>(null)\r\nconst showSourceCode = ref(false)\r\n// 运行时检测 mermaid 是否可用\r\n// 默认为 true(降级模式),检测到可用后才切换到正常模式\r\n// 这样可以避免首次渲染时的闪烁问题\r\nconst isDegraded = ref(true)\r\nconst mermaidContent = computed(() => props.raw?.content || '')\r\nconst mermaidId = computed(() => `mermaid-${props.raw?.key || 'default'}`)\r\nconst isLoading = computed(() => syntaxMermaidRef.value?.isLoading ?? true)\r\nconst svg = computed(() => syntaxMermaidRef.value?.svg ?? '')\r\nconst activeTab = computed(() => (showSourceCode.value ? 'code' : 'diagram'))\r\n\r\nfunction handleZoomIn(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.zoomIn()\r\n }\r\n}\r\n\r\nfunction handleZoomOut(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.zoomOut()\r\n }\r\n}\r\n\r\nfunction handleReset(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.reset()\r\n }\r\n}\r\n\r\nfunction handleFullscreen() {\r\n if (!showSourceCode.value) {\r\n syntaxMermaidRef.value?.fullscreen()\r\n }\r\n}\r\n\r\nfunction handleToggleCode() {\r\n showSourceCode.value = !showSourceCode.value\r\n}\r\n\r\nconst { copy: copyCode, copied } = useClipboard({ copiedDuring: 1500 })\r\n\r\nfunction handleTabClick(tabName: string) {\r\n if (tabName === 'code' && !showSourceCode.value) {\r\n showSourceCode.value = true\r\n } else if (tabName === 'diagram' && showSourceCode.value) {\r\n showSourceCode.value = false\r\n }\r\n}\r\n\r\nasync function handleCopyCode(event?: Event) {\r\n event?.stopPropagation()\r\n event?.preventDefault()\r\n\r\n if (copied.value) {\r\n return\r\n }\r\n\r\n if (!props.raw.content) {\r\n return\r\n }\r\n await copyCode(props.raw.content)\r\n}\r\n\r\nfunction handleDownload() {\r\n syntaxMermaidRef.value?.download()\r\n}\r\n\r\nconst normalizedActions = computed<MermaidAction[]>(() => {\r\n return props.mermaidActions || []\r\n})\r\n\r\nconst filteredActions = computed<MermaidAction[]>(() => {\r\n return normalizedActions.value.filter((action) => {\r\n if (!action.show) return true\r\n return action.show(slotProps.value)\r\n })\r\n})\r\n\r\nconst slotProps = computed<MermaidSlotProps>(() => ({\r\n showSourceCode: showSourceCode.value,\r\n svg: svg.value,\r\n rawContent: props.raw.content || '',\r\n isLoading: isLoading.value,\r\n copied: copied.value,\r\n zoomIn: handleZoomIn,\r\n zoomOut: handleZoomOut,\r\n reset: handleReset,\r\n fullscreen: handleFullscreen,\r\n toggleCode: handleToggleCode,\r\n copyCode: handleCopyCode,\r\n download: handleDownload,\r\n raw: props.raw,\r\n}))\r\n\r\nfunction renderActionIcon(action: MermaidAction): VNode | null {\r\n if (!action.icon) return null\r\n\r\n if (typeof action.icon === 'string') {\r\n return h('span', {\r\n class: 'mermaid-action-icon',\r\n innerHTML: action.icon,\r\n })\r\n }\r\n\r\n if (typeof action.icon === 'function') {\r\n try {\r\n const result = (action.icon as (props: MermaidSlotProps) => VNode)(slotProps.value)\r\n if (result && typeof result === 'object' && '__v_isVNode' in result) {\r\n return result\r\n }\r\n } catch {}\r\n return h(action.icon as any)\r\n }\r\n\r\n return h(action.icon as any)\r\n}\r\n\r\nfunction handleActionClick(action: MermaidAction) {\r\n if (action.disabled) return\r\n action.onClick?.(slotProps.value)\r\n}\r\n\r\nconst exposedMethods = computed(\r\n () =>\r\n ({\r\n showSourceCode: showSourceCode.value,\r\n svg: svg.value,\r\n rawContent: props.raw.content || '',\r\n isLoading: isLoading.value,\r\n copied: copied.value,\r\n zoomIn: handleZoomIn,\r\n zoomOut: handleZoomOut,\r\n reset: handleReset,\r\n fullscreen: handleFullscreen,\r\n toggleCode: handleToggleCode,\r\n copyCode: handleCopyCode,\r\n download: handleDownload,\r\n raw: props.raw,\r\n }) satisfies MermaidExposeProps,\r\n)\r\n\r\n// 组件挂载时检测 mermaid 是否可用\r\nonMounted(async () => {\r\n const hasMermaid = await checkMermaidAvailable()\r\n isDegraded.value = !hasMermaid\r\n})\r\n</script>\r\n\r\n<template>\r\n <!-- 当 Mermaid 不可用时(降级),渲染 CodeBlock -->\r\n <CodeBlock\r\n v-if=\"isDegraded\"\r\n :code=\"props.raw?.content || ''\"\r\n language=\"mermaid\"\r\n :is-dark=\"props.isDark\"\r\n :light-theme=\"props.shikiTheme[0]\"\r\n :dark-theme=\"props.shikiTheme[1]\"\r\n />\r\n\r\n <!-- 当 Mermaid 可用时,渲染完整的 Mermaid 组件 -->\r\n <div v-else :key=\"props.raw.key\" class=\"markdown-mermaid\" :class=\"{ 'markdown-mermaid--dark': props.isDark }\">\r\n <Transition name=\"toolbar\" appear>\r\n <div class=\"toolbar-container\">\r\n <slot name=\"mermaidHeader\" v-bind=\"exposedMethods\">\r\n <div class=\"mermaid-toolbar\">\r\n <div class=\"toolbar-left\">\r\n <div class=\"segmented-control\">\r\n <div class=\"segmented-slider\" :class=\"{ 'slide-right': activeTab === 'code' }\" />\r\n <div\r\n class=\"segment-item\"\r\n :class=\"{ active: activeTab === 'diagram' }\"\r\n @click=\"handleTabClick('diagram')\"\r\n >\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M12 2L2 7L12 12L22 7L12 2Z\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M2 17L12 22L22 17\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M2 12L12 17L22 12\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n <span>预览</span>\r\n </div>\r\n <div class=\"segment-item\" :class=\"{ active: activeTab === 'code' }\" @click=\"handleTabClick('code')\">\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n <path\r\n d=\"M16 18L22 12L16 6\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n <path\r\n d=\"M8 6L2 12L8 18\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n <span>代码</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"toolbar-right\">\r\n <slot name=\"mermaidActions\" v-bind=\"exposedMethods\">\r\n <div\r\n v-for=\"action in filteredActions\"\r\n :key=\"action.key\"\r\n class=\"toolbar-action-btn\"\r\n :class=\"[action.class, { 'toolbar-action-btn--disabled': action.disabled }]\"\r\n :style=\"action.style\"\r\n :title=\"action.title\"\r\n @click=\"handleActionClick(action)\"\r\n >\r\n <component :is=\"renderActionIcon(action)\" v-if=\"action.icon\" />\r\n </div>\r\n\r\n <template v-if=\"showSourceCode\">\r\n <div\r\n class=\"toolbar-action-btn\"\r\n :class=\"{ 'copy-success': copied }\"\r\n title=\"复制代码\"\r\n @click=\"handleCopyCode($event)\"\r\n >\r\n <svg\r\n v-if=\"copied\"\r\n width=\"16\"\r\n height=\"16\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n viewBox=\"0 0 1024 1024\"\r\n >\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z\"\r\n />\r\n </svg>\r\n <svg v-else width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M768 832a128 128 0 0 1-128 128H192A128 128 0 0 1 64 832V384a128 128 0 0 1 128-128v64a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64z\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M384 128a64 64 0 0 0-64 64v448a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64V192a64 64 0 0 0-64-64zm0-64h448a128 128 0 0 1 128 128v448a128 128 0 0 1-128 128H384a128 128 0 0 1-128-128V192A128 128 0 0 1 384 64\"\r\n />\r\n </svg>\r\n </div>\r\n </template>\r\n\r\n <template v-else>\r\n <div class=\"toolbar-action-btn\" title=\"缩小\" @click=\"handleZoomOut($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"放大\" @click=\"handleZoomIn($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"重置\" @click=\"handleReset($event)\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896\"\r\n />\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M512 96a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V128a32 32 0 0 1 32-32m0 576a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V704a32 32 0 0 1 32-32M96 512a32 32 0 0 1 32-32h192a32 32 0 0 1 0 64H128a32 32 0 0 1-32-32m576 0a32 32 0 0 1 32-32h192a32 32 0 1 1 0 64H704a32 32 0 0 1-32-32\"\r\n />\r\n </svg>\r\n </div>\r\n\r\n <div class=\"toolbar-action-btn\" title=\"下载\" @click=\"handleDownload\">\r\n <svg width=\"16\" height=\"16\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\">\r\n <path\r\n fill=\"currentColor\"\r\n d=\"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z\"\r\n />\r\n </svg>\r\n </div>\r\n </template>\r\n </slot>\r\n </div>\r\n </div>\r\n </slot>\r\n </div>\r\n </Transition>\r\n\r\n <div v-show=\"showSourceCode\" class=\"mermaid-source-code\">\r\n <CodeBlock\r\n :code=\"props.raw?.content || ''\"\r\n language=\"mermaid\"\r\n :is-dark=\"props.isDark\"\r\n :light-theme=\"props.shikiTheme[0]\"\r\n :dark-theme=\"props.shikiTheme[1]\"\r\n :show-code-block-header=\"false\"\r\n :sticky-code-block-header=\"false\"\r\n />\r\n </div>\r\n\r\n <SyntaxMermaid\r\n v-show=\"!showSourceCode\"\r\n ref=\"syntaxMermaidRef\"\r\n :content=\"mermaidContent\"\r\n :id=\"mermaidId\"\r\n :is-dark=\"props.isDark\"\r\n :config=\"props.config\"\r\n />\r\n </div>\r\n</template>\r\n\r\n<style>\r\n.markdown-mermaid {\r\n border-radius: 8px;\r\n overflow: hidden;\r\n font-size: 0;\r\n background: rgba(0, 0, 0, 0.03);\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark {\r\n background: rgba(255, 255, 255, 0.13);\r\n}\r\n\r\n.markdown-mermaid .toolbar-container {\r\n position: relative;\r\n z-index: 10;\r\n flex-shrink: 0;\r\n background: rgba(0, 0, 0, 0.05);\r\n color: #333;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .toolbar-container {\r\n background: rgba(0, 0, 0, 0.25);\r\n color: #fff;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n padding: 8px 16px;\r\n background: transparent;\r\n color: inherit;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-left {\r\n display: flex;\r\n align-items: center;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-control {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n background: rgba(0, 0, 0, 0.06);\r\n border-radius: 6px;\r\n padding: 3px;\r\n gap: 2px;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segmented-control {\r\n background: rgba(255, 255, 255, 0.08);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-slider {\r\n position: absolute;\r\n top: 3px;\r\n left: 3px;\r\n width: calc(50% - 4px);\r\n height: calc(100% - 6px);\r\n background: #fff;\r\n border-radius: 4px;\r\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);\r\n transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\r\n z-index: 0;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segmented-slider {\r\n background: rgba(255, 255, 255, 0.15);\r\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segmented-slider.slide-right {\r\n transform: translateX(calc(100% + 2px));\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n gap: 4px;\r\n font-size: 12px;\r\n border: none;\r\n color: inherit;\r\n min-width: 60px;\r\n text-align: center;\r\n box-sizing: border-box;\r\n font-weight: 500;\r\n cursor: pointer;\r\n border-radius: 4px;\r\n padding: 5px 12px;\r\n transition: all 0.2s ease;\r\n background: transparent;\r\n opacity: 0.6;\r\n user-select: none;\r\n position: relative;\r\n z-index: 1;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item.active {\r\n opacity: 1;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .segment-item.active {\r\n color: #fff;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item:hover {\r\n opacity: 1;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .segment-item svg {\r\n flex-shrink: 0;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-right {\r\n display: flex;\r\n align-items: center;\r\n gap: 16px;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 28px;\r\n height: 28px;\r\n padding: 0;\r\n border: none;\r\n border-radius: 4px;\r\n background: transparent;\r\n color: inherit;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n opacity: 0.7;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn:hover {\r\n opacity: 1;\r\n background: rgba(0, 0, 0, 0.08);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn.copy-success {\r\n opacity: 1;\r\n color: #22c55e;\r\n}\r\n\r\n.markdown-mermaid.markdown-mermaid--dark .mermaid-toolbar .toolbar-action-btn:hover {\r\n background: rgba(255, 255, 255, 0.1);\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .toolbar-action-btn.toolbar-action-btn--disabled {\r\n opacity: 0.3;\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .mermaid-action-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.markdown-mermaid .mermaid-toolbar .mermaid-action-icon :deep(svg) {\r\n width: 16px;\r\n height: 16px;\r\n flex-shrink: 0;\r\n}\r\n\r\n.markdown-mermaid .mermaid-source-code {\r\n position: relative;\r\n z-index: 1;\r\n flex: 1;\r\n width: 100%;\r\n overflow: auto;\r\n box-sizing: border-box;\r\n}\r\n\r\n.toolbar-enter-active,\r\n.toolbar-leave-active {\r\n transition: opacity 0.3s ease;\r\n}\r\n\r\n.toolbar-enter-from,\r\n.toolbar-leave-to {\r\n opacity: 0;\r\n}\r\n</style>\r\n"],"names":["props","__props","syntaxMermaidRef","ref","showSourceCode","isDegraded","mermaidContent","computed","raw","content","mermaidId","key","isLoading","value","svg","activeTab","handleZoomIn","event","stopPropagation","preventDefault","zoomIn","handleZoomOut","zoomOut","handleReset","reset","handleFullscreen","fullscreen","handleToggleCode","copy","copyCode","copied","useClipboard","copiedDuring","handleTabClick","tabName","async","handleCopyCode","handleDownload","download","normalizedActions","mermaidActions","filteredActions","filter","action","show","slotProps","rawContent","toggleCode","renderActionIcon","icon","h","class","innerHTML","result","exposedMethods","onMounted","hasMermaid","checkMermaidAvailable","_createBlock","CodeBlock","code","language","isDark","shikiTheme","_createElementBlock","_normalizeClass","_createVNode","_Transition","name","appear","_createElementVNode","_hoisted_1","_renderSlot","_ctx","$slots","_normalizeProps","_guardReactiveProps","_hoisted_2","_hoisted_3","_hoisted_4","active","onClick","width","height","viewBox","fill","xmlns","d","stroke","_hoisted_5","_Fragment","_renderList","disabled","style","_normalizeStyle","title","$event","handleActionClick","_resolveDynamicComponent","_unref","_cache","_openBlock","_hoisted_7","_hoisted_8","_withDirectives","_hoisted_9","SyntaxMermaid","id","config"],"mappings":"+4BAiBA,MAAMA,EAAQC,EAQRC,EAAmBC,EAAAA,IAA+C,MAClEC,EAAiBD,EAAAA,KAAI,GAIrBE,EAAaF,EAAAA,KAAI,GACjBG,EAAiBC,EAAAA,SAAS,IAAMP,EAAMQ,KAAKC,SAAW,IACtDC,EAAYH,WAAS,IAAM,WAAWP,EAAMQ,KAAKG,KAAO,aACxDC,EAAYL,EAAAA,SAAS,IAAML,EAAiBW,OAAOD,YAAa,GAChEE,EAAMP,EAAAA,SAAS,IAAML,EAAiBW,OAAOC,KAAO,IACpDC,EAAYR,EAAAA,SAAS,IAAOH,EAAeS,MAAQ,OAAS,WAElE,SAASG,EAAaC,GACpBA,GAAOC,kBACPD,GAAOE,iBACFf,EAAeS,OAClBX,EAAiBW,OAAOO,QAE5B,CAEA,SAASC,EAAcJ,GACrBA,GAAOC,kBACPD,GAAOE,iBACFf,EAAeS,OAClBX,EAAiBW,OAAOS,SAE5B,CAEA,SAASC,EAAYN,GACnBA,GAAOC,kBACPD,GAAOE,iBACFf,EA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