@vuepress/plugin-markdown-chart 2.0.0-rc.123 → 2.0.0-rc.124

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.
@@ -1 +1 @@
1
- {"version":3,"file":"MarkMap.js","sources":["../../../src/client/components/MarkMap.ts"],"sourcesContent":["import { LoadingIcon, decodeData } from '@vuepress/helper/client'\nimport { useDebounceFn, useEventListener } from '@vueuse/core'\nimport type { Markmap } from 'markmap-view'\nimport type { VNode } from 'vue'\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n toRefs,\n watch,\n} from 'vue'\nimport { onContentUpdated } from 'vuepress/client'\n\nimport '../styles/markmap.css'\n\nexport default defineComponent({\n name: 'MarkMap',\n\n props: {\n /**\n * Markmap content\n *\n * Markmap\n */\n content: {\n type: String,\n required: true,\n },\n },\n\n setup(props) {\n const { content } = toRefs(props)\n const markmapWrapper = shallowRef<HTMLElement>()\n const markmapSVG = shallowRef<SVGElement>()\n\n const loaded = ref(false)\n\n let markmap: Markmap | null = null\n\n useEventListener(\n 'resize',\n useDebounceFn(() => {\n void markmap?.fit()\n }, 100),\n )\n\n const destroyMarkmap = (): void => {\n markmap?.destroy()\n markmap = null\n }\n\n const renderMarkmap = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const [{ Transformer }, markmapView, { Toolbar }] = await Promise.all([\n import(/* webpackChunkName: \"markmap\" */ 'markmap-lib'),\n import(/* webpackChunkName: \"markmap\" */ 'markmap-view'),\n import(/* webpackChunkName: \"markmap\" */ 'markmap-toolbar'),\n ])\n\n const { Markmap, deriveOptions, loadJS, loadCSS } = markmapView\n\n const transformer = new Transformer()\n const { frontmatter, features, root } = transformer.transform(\n decodeData(props.content),\n )\n const { styles, scripts } = transformer.getUsedAssets(features)\n\n await Promise.all([\n // Load scripts\n scripts\n ? loadJS(scripts, {\n // For plugins to access the `markmap-view` module\n getMarkmap: () => markmapView,\n })\n : Promise.resolve(),\n // Load styles\n styles ? loadCSS(styles) : Promise.resolve(),\n ])\n\n markmap = Markmap.create(\n markmapSVG.value!,\n deriveOptions({\n maxWidth: 240,\n ...frontmatter?.markmap,\n }),\n )\n\n const { el } = Toolbar.create(markmap)\n\n await markmap.setData(root)\n await markmap.fit()\n\n el.style.position = 'absolute'\n el.style.bottom = '0.5rem'\n el.style.right = '0.5rem'\n\n markmapWrapper.value!.append(el)\n }\n\n onContentUpdated(async (reason) => {\n if (reason === 'mounted') {\n await renderMarkmap()\n loaded.value = true\n }\n })\n\n onMounted(() => {\n if (!__VUEPRESS_DEV__) return\n\n watch(\n content,\n async () => {\n destroyMarkmap()\n await nextTick()\n await renderMarkmap()\n },\n { flush: 'post' },\n )\n })\n\n onUnmounted(destroyMarkmap)\n\n return (): VNode =>\n h('div', { class: 'markmap-wrapper', ref: markmapWrapper }, [\n h('svg', {\n ref: markmapSVG,\n class: 'markmap-svg',\n }),\n loaded.value\n ? null\n : h(LoadingIcon, { class: 'markmap-loading', height: 360 }),\n ])\n },\n})\n"],"names":["MarkMap","defineComponent","props","content","toRefs","markmapWrapper","shallowRef","markmapSVG","loaded","ref","markmap","useEventListener","useDebounceFn","destroyMarkmap","renderMarkmap","Transformer","markmapView","Toolbar","Markmap","deriveOptions","loadJS","loadCSS","transformer","frontmatter","features","root","decodeData","styles","scripts","el","onContentUpdated","reason","onMounted","watch","nextTick","onUnmounted","h","LoadingIcon"],"mappings":"qWAmBA,IAAAA,EAAeC,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,QAAS,CACP,KAAM,OACN,SAAU,EACZ,CACF,EAEA,MAAMC,EAAO,CACX,KAAM,CAAE,QAAAC,CAAQ,EAAIC,EAAOF,CAAK,EAC1BG,EAAiBC,EAAAA,EACjBC,EAAaD,EAAAA,EAEbE,EAASC,EAAI,EAAK,EAExB,IAAIC,EAA0B,KAE9BC,EACE,SACAC,EAAc,IAAM,CACbF,GAAS,IAAA,CAChB,EAAG,GAA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N,MAAMpB,EAAAA,CACR,EACA,CAAE,MAAO,MAAO,CAClB,CACF,CAAC,EAEDqB,EAAYtB,CAAc,EAEnB,IACLuB,EAAE,MAAO,CAAE,MAAO,kBAAmB,IAAK/B,CAAe,EAAG,CAC1D+B,EAAE,MAAO,CACP,IAAK7B,EACL,MAAO,aACT,CAAC,EACDC,EAAO,MACH,KACA4B,EAAEC,EAAa,CAAE,MAAO,kBAAmB,OAAQ,GAAI,CAAC,CAC9D,CAAC,CACL,CACF,CAAC"}
1
+ {"version":3,"file":"MarkMap.js","names":[],"sources":["../../../src/client/components/MarkMap.ts"],"sourcesContent":["import { LoadingIcon, decodeData } from '@vuepress/helper/client'\nimport { useDebounceFn, useEventListener } from '@vueuse/core'\nimport type { Markmap } from 'markmap-view'\nimport type { VNode } from 'vue'\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n toRefs,\n watch,\n} from 'vue'\nimport { onContentUpdated } from 'vuepress/client'\n\nimport '../styles/markmap.css'\n\nexport default defineComponent({\n name: 'MarkMap',\n\n props: {\n /**\n * Markmap content\n *\n * Markmap\n */\n content: {\n type: String,\n required: true,\n },\n },\n\n setup(props) {\n const { content } = toRefs(props)\n const markmapWrapper = shallowRef<HTMLElement>()\n const markmapSVG = shallowRef<SVGElement>()\n\n const loaded = ref(false)\n\n let markmap: Markmap | null = null\n\n useEventListener(\n 'resize',\n useDebounceFn(() => {\n void markmap?.fit()\n }, 100),\n )\n\n const destroyMarkmap = (): void => {\n markmap?.destroy()\n markmap = null\n }\n\n const renderMarkmap = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const [{ Transformer }, markmapView, { Toolbar }] = await Promise.all([\n import(/* webpackChunkName: \"markmap\" */ 'markmap-lib'),\n import(/* webpackChunkName: \"markmap\" */ 'markmap-view'),\n import(/* webpackChunkName: \"markmap\" */ 'markmap-toolbar'),\n ])\n\n const { Markmap, deriveOptions, loadJS, loadCSS } = markmapView\n\n const transformer = new Transformer()\n const { frontmatter, features, root } = transformer.transform(\n decodeData(props.content),\n )\n const { styles, scripts } = transformer.getUsedAssets(features)\n\n await Promise.all([\n // Load scripts\n scripts\n ? loadJS(scripts, {\n // For plugins to access the `markmap-view` module\n getMarkmap: () => markmapView,\n })\n : Promise.resolve(),\n // Load styles\n styles ? loadCSS(styles) : Promise.resolve(),\n ])\n\n markmap = Markmap.create(\n markmapSVG.value!,\n deriveOptions({\n maxWidth: 240,\n ...frontmatter?.markmap,\n }),\n )\n\n const { el } = Toolbar.create(markmap)\n\n await markmap.setData(root)\n await markmap.fit()\n\n el.style.position = 'absolute'\n el.style.bottom = '0.5rem'\n el.style.right = '0.5rem'\n\n markmapWrapper.value!.append(el)\n }\n\n onContentUpdated(async (reason) => {\n if (reason === 'mounted') {\n await renderMarkmap()\n loaded.value = true\n }\n })\n\n onMounted(() => {\n if (!__VUEPRESS_DEV__) return\n\n watch(\n content,\n async () => {\n destroyMarkmap()\n await nextTick()\n await renderMarkmap()\n },\n { flush: 'post' },\n )\n })\n\n onUnmounted(destroyMarkmap)\n\n return (): VNode =>\n h('div', { class: 'markmap-wrapper', ref: markmapWrapper }, [\n h('svg', {\n ref: markmapSVG,\n class: 'markmap-svg',\n }),\n loaded.value\n ? null\n : h(LoadingIcon, { class: 'markmap-loading', height: 360 }),\n ])\n },\n})\n"],"mappings":"qWAmBA,IAAA,EAAe,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,QAAS,CACP,KAAM,OACN,SAAU,GACX,CACF,CAED,MAAM,EAAO,CACX,GAAM,CAAE,WAAY,EAAO,EAAM,CAC3B,EAAiB,GAAyB,CAC1C,EAAa,GAAwB,CAErC,EAAS,EAAI,GAAM,CAErB,EAA0B,KAE9B,EACE,SACA,MAAoB,CACb,GAAS,KAAK,EAClB,IAAI,CACR,CAED,IAAM,MAA6B,CACjC,GAAS,SAAS,CAClB,EAAU,MAGN,EAAgB,SAA2B,CAC/C,GAAI,iBAAkB,OAEtB,GAA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
1
+ import * as vue from "vue";
2
+ import { VNode } from "vue";
3
+ import "../styles/mermaid.css";
3
4
 
5
+ //#region src/client/components/Mermaid.d.ts
4
6
  declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
5
- /**
6
- * Mermaid config
7
- *
8
- * Mermaid 配置
9
- */
10
- code: {
11
- type: StringConstructor;
12
- required: true;
13
- };
14
- /**
15
- * Mermaid title
16
- *
17
- * Mermaid 标题
18
- */
19
- title: StringConstructor;
7
+ /**
8
+ * Mermaid config
9
+ *
10
+ * Mermaid 配置
11
+ */
12
+ code: {
13
+ type: StringConstructor;
14
+ required: true;
15
+ };
16
+ /**
17
+ * Mermaid title
18
+ *
19
+ * Mermaid 标题
20
+ */
21
+ title: StringConstructor;
20
22
  }>, () => VNode[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
21
- /**
22
- * Mermaid config
23
- *
24
- * Mermaid 配置
25
- */
26
- code: {
27
- type: StringConstructor;
28
- required: true;
29
- };
30
- /**
31
- * Mermaid title
32
- *
33
- * Mermaid 标题
34
- */
35
- title: StringConstructor;
23
+ /**
24
+ * Mermaid config
25
+ *
26
+ * Mermaid 配置
27
+ */
28
+ code: {
29
+ type: StringConstructor;
30
+ required: true;
31
+ };
32
+ /**
33
+ * Mermaid title
34
+ *
35
+ * Mermaid 标题
36
+ */
37
+ title: StringConstructor;
36
38
  }>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
37
-
39
+ //#endregion
38
40
  export { _default as default };
41
+ //# sourceMappingURL=Mermaid.d.ts.map
@@ -1,2 +1,2 @@
1
- import{useDarkMode as h,decodeData as l,LoadingIcon as f,isFunction as g,encodeSVG as M}from"@vuepress/helper/client";import{watchImmediate as L}from"@vueuse/core";import{defineComponent as b,useId as C,shallowRef as S,computed as k,ref as z,onMounted as E,h as a}from"vue";import"../styles/mermaid.css";import{u as V}from"../mermaid-D26-9yYy.js";const _='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1316 1024" fill="currentColor"><path d="M658.286 0C415.89 0 0 297.106 0 512c0 214.82 415.89 512 658.286 512 242.322 0 658.285-294.839 658.285-512S900.608 0 658.286 0zm0 877.714c-161.573 0-512-221.769-512-365.714 0-144.018 350.427-365.714 512-365.714 161.572 0 512 217.16 512 365.714s-350.428 365.714-512 365.714z"/><path d="M658.286 292.571a219.429 219.429 0 1 0 0 438.858 219.429 219.429 0 0 0 0-438.858zm0 292.572a73.143 73.143 0 1 1 0-146.286 73.143 73.143 0 0 1 0 146.286z"/></svg>',x='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" fill="currentColor"><path d="M828.976 894.125H190.189c-70.55 0-127.754-57.185-127.754-127.753V606.674c0-17.634 14.31-31.933 31.933-31.933h63.889c17.634 0 31.932 14.299 31.932 31.933v95.822c0 35.282 28.596 63.877 63.877 63.877h511.033c35.281 0 63.877-28.595 63.877-63.877v-95.822c0-17.634 14.298-31.933 31.943-31.933h63.878c17.635 0 31.933 14.299 31.933 31.933v159.7c0 70.566-57.191 127.751-127.754 127.751zM249.939 267.51c12.921-12.92 33.885-12.92 46.807 0l148.97 148.972V94.893c0-17.634 14.302-31.947 31.934-31.947h63.876c17.638 0 31.946 14.313 31.946 31.947v321.589l148.97-148.972c12.922-12.92 33.876-12.92 46.797 0l46.814 46.818c12.922 12.922 12.922 33.874 0 46.807L552.261 624.93c-1.14 1.138-21.664 13.684-42.315 13.693-20.877.01-41.88-12.542-43.021-13.693L203.122 361.135c-12.923-12.934-12.923-33.885 0-46.807l46.817-46.818z"/></svg>',i={useMaxWidth:!1};var I=b({name:"Mermaid",props:{code:{type:String,required:!0},title:String},setup(n){const s=C(),r=h(),{themeVariables:c,...d}=V(),m=S(),u=k(()=>l(n.code)),o=z(""),v=async()=>{if(__VUEPRESS_SSR__)return;const{default:t}=await import("mermaid/dist/mermaid.esm.min.mjs");t.initialize({theme:r.value?"dark":"default",themeVariables:{dark:r.value,...g(c)?c(r.value):c},flowchart:i,sequence:i,journey:i,gantt:i,er:i,pie:i,...d,startOnLoad:!1}),o.value=(await t.render(s,u.value)).svg},p=()=>{const{body:t}=document,e=document.createElement("div");e.classList.add("mermaid-preview"),e.innerHTML=o.value,t.append(e),e.addEventListener("click",()=>{e.remove()})},w=()=>{const t=M(o.value),e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("download",`${n.title?l(n.title):s}.svg`),e.click()};return E(()=>{L(r,v,{flush:"post"})}),()=>[a("div",{class:"mermaid-actions"},[a("button",{class:"preview-button",title:"preview",innerHTML:_,onClick:p}),a("button",{class:"download-button",title:"download",innerHTML:x,onClick:w})]),a("div",{ref:m,class:"mermaid-wrapper"},o.value?a("div",{class:"mermaid-content",innerHTML:o.value}):a(f,{class:"mermaid-loading",height:96}))]}});export{I as default};
2
- //# sourceMappingURL=Mermaid.js.map
1
+ import{n as e}from"../../mermaid-BPRrFw7i.js";import{LoadingIcon as t,decodeData as n,encodeSVG as r,isFunction as i,useDarkMode as a}from"@vuepress/helper/client";import{watchImmediate as o}from"@vueuse/core";import{computed as s,defineComponent as c,h as l,onMounted as u,ref as d,shallowRef as f,useId as p}from"vue";import"../styles/mermaid.css";const m={useMaxWidth:!1};var h=c({name:`Mermaid`,props:{code:{type:String,required:!0},title:String},setup(c){let h=p(),g=a(),{themeVariables:_,...v}=e(),y=f(),b=s(()=>n(c.code)),x=d(``),S=async()=>{if(__VUEPRESS_SSR__)return;let{default:e}=await import(`mermaid/dist/mermaid.esm.min.mjs`);e.initialize({theme:g.value?`dark`:`default`,themeVariables:{dark:g.value,...i(_)?_(g.value):_},flowchart:m,sequence:m,journey:m,gantt:m,er:m,pie:m,...v,startOnLoad:!1}),x.value=(await e.render(h,b.value)).svg},C=()=>{let{body:e}=document,t=document.createElement(`div`);t.classList.add(`mermaid-preview`),t.innerHTML=x.value,e.append(t),t.addEventListener(`click`,()=>{t.remove()})},w=()=>{let e=r(x.value),t=document.createElement(`a`);t.setAttribute(`href`,e),t.setAttribute(`download`,`${c.title?n(c.title):h}.svg`),t.click()};return u(()=>{o(g,S,{flush:`post`})}),()=>[l(`div`,{class:`mermaid-actions`},[l(`button`,{class:`preview-button`,title:`preview`,innerHTML:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1316 1024" fill="currentColor"><path d="M658.286 0C415.89 0 0 297.106 0 512c0 214.82 415.89 512 658.286 512 242.322 0 658.285-294.839 658.285-512S900.608 0 658.286 0zm0 877.714c-161.573 0-512-221.769-512-365.714 0-144.018 350.427-365.714 512-365.714 161.572 0 512 217.16 512 365.714s-350.428 365.714-512 365.714z"/><path d="M658.286 292.571a219.429 219.429 0 1 0 0 438.858 219.429 219.429 0 0 0 0-438.858zm0 292.572a73.143 73.143 0 1 1 0-146.286 73.143 73.143 0 0 1 0 146.286z"/></svg>`,onClick:C}),l(`button`,{class:`download-button`,title:`download`,innerHTML:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" fill="currentColor"><path d="M828.976 894.125H190.189c-70.55 0-127.754-57.185-127.754-127.753V606.674c0-17.634 14.31-31.933 31.933-31.933h63.889c17.634 0 31.932 14.299 31.932 31.933v95.822c0 35.282 28.596 63.877 63.877 63.877h511.033c35.281 0 63.877-28.595 63.877-63.877v-95.822c0-17.634 14.298-31.933 31.943-31.933h63.878c17.635 0 31.933 14.299 31.933 31.933v159.7c0 70.566-57.191 127.751-127.754 127.751zM249.939 267.51c12.921-12.92 33.885-12.92 46.807 0l148.97 148.972V94.893c0-17.634 14.302-31.947 31.934-31.947h63.876c17.638 0 31.946 14.313 31.946 31.947v321.589l148.97-148.972c12.922-12.92 33.876-12.92 46.797 0l46.814 46.818c12.922 12.922 12.922 33.874 0 46.807L552.261 624.93c-1.14 1.138-21.664 13.684-42.315 13.693-20.877.01-41.88-12.542-43.021-13.693L203.122 361.135c-12.923-12.934-12.923-33.885 0-46.807l46.817-46.818z"/></svg>`,onClick:w})]),l(`div`,{ref:y,class:`mermaid-wrapper`},x.value?l(`div`,{class:`mermaid-content`,innerHTML:x.value}):l(t,{class:`mermaid-loading`,height:96}))]}});export{h as default};
2
+ //# sourceMappingURL=Mermaid.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Mermaid.js","sources":["../../../src/client/utils/icons.ts","../../../src/client/components/Mermaid.ts"],"sourcesContent":["export const PREVIEW_ICON =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1316 1024\" fill=\"currentColor\"><path d=\"M658.286 0C415.89 0 0 297.106 0 512c0 214.82 415.89 512 658.286 512 242.322 0 658.285-294.839 658.285-512S900.608 0 658.286 0zm0 877.714c-161.573 0-512-221.769-512-365.714 0-144.018 350.427-365.714 512-365.714 161.572 0 512 217.16 512 365.714s-350.428 365.714-512 365.714z\"/><path d=\"M658.286 292.571a219.429 219.429 0 1 0 0 438.858 219.429 219.429 0 0 0 0-438.858zm0 292.572a73.143 73.143 0 1 1 0-146.286 73.143 73.143 0 0 1 0 146.286z\"/></svg>'\n\nexport const DOWNLOAD_ICON =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\" fill=\"currentColor\"><path d=\"M828.976 894.125H190.189c-70.55 0-127.754-57.185-127.754-127.753V606.674c0-17.634 14.31-31.933 31.933-31.933h63.889c17.634 0 31.932 14.299 31.932 31.933v95.822c0 35.282 28.596 63.877 63.877 63.877h511.033c35.281 0 63.877-28.595 63.877-63.877v-95.822c0-17.634 14.298-31.933 31.943-31.933h63.878c17.635 0 31.933 14.299 31.933 31.933v159.7c0 70.566-57.191 127.751-127.754 127.751zM249.939 267.51c12.921-12.92 33.885-12.92 46.807 0l148.97 148.972V94.893c0-17.634 14.302-31.947 31.934-31.947h63.876c17.638 0 31.946 14.313 31.946 31.947v321.589l148.97-148.972c12.922-12.92 33.876-12.92 46.797 0l46.814 46.818c12.922 12.922 12.922 33.874 0 46.807L552.261 624.93c-1.14 1.138-21.664 13.684-42.315 13.693-20.877.01-41.88-12.542-43.021-13.693L203.122 361.135c-12.923-12.934-12.923-33.885 0-46.807l46.817-46.818z\"/></svg>'\n","import {\n LoadingIcon,\n decodeData,\n encodeSVG,\n isFunction,\n useDarkMode,\n} from '@vuepress/helper/client'\nimport { watchImmediate } from '@vueuse/core'\nimport type { VNode } from 'vue'\nimport {\n computed,\n defineComponent,\n h,\n onMounted,\n ref,\n shallowRef,\n useId,\n} from 'vue'\n\nimport { useMermaidOptions } from '../helpers/index.js'\nimport { DOWNLOAD_ICON, PREVIEW_ICON } from '../utils/index.js'\n\nimport '../styles/mermaid.css'\n\nconst DEFAULT_CHART_OPTIONS = { useMaxWidth: false }\n\nexport default defineComponent({\n name: 'Mermaid',\n\n props: {\n /**\n * Mermaid config\n *\n * Mermaid 配置\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * Mermaid title\n *\n * Mermaid 标题\n */\n title: String,\n },\n\n setup(props) {\n const id = useId()\n const isDarkMode = useDarkMode()\n const { themeVariables, ...mermaidOptions } = useMermaidOptions()\n const mermaidElement = shallowRef<HTMLElement>()\n\n const code = computed(() => decodeData(props.code))\n\n const svgCode = ref('')\n\n const renderMermaid = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const { default: mermaid } = await import(\n /* webpackChunkName: \"mermaid\" */ 'mermaid/dist/mermaid.esm.min.mjs'\n )\n\n mermaid.initialize({\n theme: isDarkMode.value ? 'dark' : 'default',\n themeVariables: {\n dark: isDarkMode.value,\n ...(isFunction(themeVariables)\n ? themeVariables(isDarkMode.value)\n : themeVariables),\n },\n flowchart: DEFAULT_CHART_OPTIONS,\n sequence: DEFAULT_CHART_OPTIONS,\n journey: DEFAULT_CHART_OPTIONS,\n gantt: DEFAULT_CHART_OPTIONS,\n er: DEFAULT_CHART_OPTIONS,\n pie: DEFAULT_CHART_OPTIONS,\n ...mermaidOptions,\n startOnLoad: false,\n })\n\n svgCode.value = (await mermaid.render(id, code.value)).svg\n }\n\n const preview = (): void => {\n const { body } = document\n const div = document.createElement('div')\n\n div.classList.add('mermaid-preview')\n\n div.innerHTML = svgCode.value\n body.append(div)\n\n div.addEventListener('click', () => {\n div.remove()\n })\n }\n\n const download = (): void => {\n const dataURI = encodeSVG(svgCode.value)\n\n const a = document.createElement('a')\n\n a.setAttribute('href', dataURI)\n a.setAttribute(\n 'download',\n `${props.title ? decodeData(props.title) : id}.svg`,\n )\n a.click()\n }\n\n onMounted(() => {\n watchImmediate(isDarkMode, renderMermaid, {\n flush: 'post',\n })\n })\n\n return (): VNode[] => [\n h('div', { class: 'mermaid-actions' }, [\n h('button', {\n class: 'preview-button',\n title: 'preview',\n innerHTML: PREVIEW_ICON,\n onClick: preview,\n }),\n h('button', {\n class: 'download-button',\n title: 'download',\n innerHTML: DOWNLOAD_ICON,\n onClick: download,\n }),\n ]),\n h(\n 'div',\n {\n ref: mermaidElement,\n class: 'mermaid-wrapper',\n },\n svgCode.value\n ? // Mermaid\n h('div', { class: 'mermaid-content', innerHTML: svgCode.value })\n : // Loading\n h(LoadingIcon, { class: 'mermaid-loading', height: 96 }),\n ),\n ]\n },\n})\n"],"names":["PREVIEW_ICON","DOWNLOAD_ICON","DEFAULT_CHART_OPTIONS","Mermaid","defineComponent","props","id","useId","isDarkMode","useDarkMode","themeVariables","mermaidOptions","useMermaidOptions","mermaidElement","shallowRef","code","computed","decodeData","svgCode","ref","renderMermaid","mermaid","isFunction","preview","body","div","download","dataURI","encodeSVG","a","onMounted","watchImmediate","h","LoadingIcon"],"mappings":"2VAAO,MAAMA,EACX,6hBAEWC,EACX,y4BCoBIC,EAAwB,CAAE,YAAa,EAAM,EAEnD,IAAAC,EAAeC,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,KAAM,CACJ,KAAM,OACN,SAAU,EACZ,EAOA,MAAO,MACT,EAEA,MAAMC,EAAO,CACX,MAAMC,EAAKC,EAAAA,EACLC,EAAaC,EAAAA,EACb,CAAE,eAAAC,EAAgB,GAAGC,CAAe,EAAIC,EAAAA,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S,EAAE,SAAU,CACV,MAAO,kBACP,MAAO,WACP,UAAW/B,EACX,QAASyB,CACX,CAAC,CACH,CAAC,EACDM,EACE,MACA,CACE,IAAKnB,EACL,MAAO,iBACT,EACAK,EAAQ,MAEJc,EAAE,MAAO,CAAE,MAAO,kBAAmB,UAAWd,EAAQ,KAAM,CAAC,EAE/Dc,EAAEC,EAAa,CAAE,MAAO,kBAAmB,OAAQ,EAAG,CAAC,CAC7D,CACF,CACF,CACF,CAAC"}
1
+ {"version":3,"file":"Mermaid.js","names":[],"sources":["../../../src/client/utils/icons.ts","../../../src/client/components/Mermaid.ts"],"sourcesContent":["export const PREVIEW_ICON =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1316 1024\" fill=\"currentColor\"><path d=\"M658.286 0C415.89 0 0 297.106 0 512c0 214.82 415.89 512 658.286 512 242.322 0 658.285-294.839 658.285-512S900.608 0 658.286 0zm0 877.714c-161.573 0-512-221.769-512-365.714 0-144.018 350.427-365.714 512-365.714 161.572 0 512 217.16 512 365.714s-350.428 365.714-512 365.714z\"/><path d=\"M658.286 292.571a219.429 219.429 0 1 0 0 438.858 219.429 219.429 0 0 0 0-438.858zm0 292.572a73.143 73.143 0 1 1 0-146.286 73.143 73.143 0 0 1 0 146.286z\"/></svg>'\n\nexport const DOWNLOAD_ICON =\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1024 1024\" fill=\"currentColor\"><path d=\"M828.976 894.125H190.189c-70.55 0-127.754-57.185-127.754-127.753V606.674c0-17.634 14.31-31.933 31.933-31.933h63.889c17.634 0 31.932 14.299 31.932 31.933v95.822c0 35.282 28.596 63.877 63.877 63.877h511.033c35.281 0 63.877-28.595 63.877-63.877v-95.822c0-17.634 14.298-31.933 31.943-31.933h63.878c17.635 0 31.933 14.299 31.933 31.933v159.7c0 70.566-57.191 127.751-127.754 127.751zM249.939 267.51c12.921-12.92 33.885-12.92 46.807 0l148.97 148.972V94.893c0-17.634 14.302-31.947 31.934-31.947h63.876c17.638 0 31.946 14.313 31.946 31.947v321.589l148.97-148.972c12.922-12.92 33.876-12.92 46.797 0l46.814 46.818c12.922 12.922 12.922 33.874 0 46.807L552.261 624.93c-1.14 1.138-21.664 13.684-42.315 13.693-20.877.01-41.88-12.542-43.021-13.693L203.122 361.135c-12.923-12.934-12.923-33.885 0-46.807l46.817-46.818z\"/></svg>'\n","import {\n LoadingIcon,\n decodeData,\n encodeSVG,\n isFunction,\n useDarkMode,\n} from '@vuepress/helper/client'\nimport { watchImmediate } from '@vueuse/core'\nimport type { VNode } from 'vue'\nimport {\n computed,\n defineComponent,\n h,\n onMounted,\n ref,\n shallowRef,\n useId,\n} from 'vue'\n\nimport { useMermaidOptions } from '../helpers/index.js'\nimport { DOWNLOAD_ICON, PREVIEW_ICON } from '../utils/index.js'\n\nimport '../styles/mermaid.css'\n\nconst DEFAULT_CHART_OPTIONS = { useMaxWidth: false }\n\nexport default defineComponent({\n name: 'Mermaid',\n\n props: {\n /**\n * Mermaid config\n *\n * Mermaid 配置\n */\n code: {\n type: String,\n required: true,\n },\n\n /**\n * Mermaid title\n *\n * Mermaid 标题\n */\n title: String,\n },\n\n setup(props) {\n const id = useId()\n const isDarkMode = useDarkMode()\n const { themeVariables, ...mermaidOptions } = useMermaidOptions()\n const mermaidElement = shallowRef<HTMLElement>()\n\n const code = computed(() => decodeData(props.code))\n\n const svgCode = ref('')\n\n const renderMermaid = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const { default: mermaid } = await import(\n /* webpackChunkName: \"mermaid\" */ 'mermaid/dist/mermaid.esm.min.mjs'\n )\n\n mermaid.initialize({\n theme: isDarkMode.value ? 'dark' : 'default',\n themeVariables: {\n dark: isDarkMode.value,\n ...(isFunction(themeVariables)\n ? themeVariables(isDarkMode.value)\n : themeVariables),\n },\n flowchart: DEFAULT_CHART_OPTIONS,\n sequence: DEFAULT_CHART_OPTIONS,\n journey: DEFAULT_CHART_OPTIONS,\n gantt: DEFAULT_CHART_OPTIONS,\n er: DEFAULT_CHART_OPTIONS,\n pie: DEFAULT_CHART_OPTIONS,\n ...mermaidOptions,\n startOnLoad: false,\n })\n\n svgCode.value = (await mermaid.render(id, code.value)).svg\n }\n\n const preview = (): void => {\n const { body } = document\n const div = document.createElement('div')\n\n div.classList.add('mermaid-preview')\n\n div.innerHTML = svgCode.value\n body.append(div)\n\n div.addEventListener('click', () => {\n div.remove()\n })\n }\n\n const download = (): void => {\n const dataURI = encodeSVG(svgCode.value)\n\n const a = document.createElement('a')\n\n a.setAttribute('href', dataURI)\n a.setAttribute(\n 'download',\n `${props.title ? decodeData(props.title) : id}.svg`,\n )\n a.click()\n }\n\n onMounted(() => {\n watchImmediate(isDarkMode, renderMermaid, {\n flush: 'post',\n })\n })\n\n return (): VNode[] => [\n h('div', { class: 'mermaid-actions' }, [\n h('button', {\n class: 'preview-button',\n title: 'preview',\n innerHTML: PREVIEW_ICON,\n onClick: preview,\n }),\n h('button', {\n class: 'download-button',\n title: 'download',\n innerHTML: DOWNLOAD_ICON,\n onClick: download,\n }),\n ]),\n h(\n 'div',\n {\n ref: mermaidElement,\n class: 'mermaid-wrapper',\n },\n svgCode.value\n ? // Mermaid\n h('div', { class: 'mermaid-content', innerHTML: svgCode.value })\n : // Loading\n h(LoadingIcon, { class: 'mermaid-loading', height: 96 }),\n ),\n ]\n },\n})\n"],"mappings":"8VAAA,MCwBM,EAAwB,CAAE,YAAa,GAAO,CAEpD,IAAA,EAAe,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,KAAM,CACJ,KAAM,OACN,SAAU,GACX,CAOD,MAAO,OACR,CAED,MAAM,EAAO,CACX,IAAM,EAAK,GAAO,CACZ,EAAa,GAAa,CAC1B,CAAE,iBAAgB,GAAG,GAAmB,GAAmB,CAC3D,EAAiB,GAAyB,CAE1C,EAAO,MAAe,EAAW,EAAM,KAAK,CAAC,CAE7C,EAAU,EAAI,GAAG,CAEjB,EAAgB,SAA2B,CAC/C,GAAI,i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7D,CACF,EAEJ,CAAC"}
@@ -1,163 +1,166 @@
1
- import { EChartsOption } from 'echarts';
2
- import { MermaidConfig } from 'mermaid';
1
+ import { EChartsOption } from "echarts";
2
+ import { MermaidConfig } from "mermaid";
3
3
 
4
+ //#region src/client/helpers/echarts.d.ts
4
5
  interface EChartsConfig {
5
- /**
6
- * ECharts global options
7
- *
8
- * ECharts 全局选项
9
- */
10
- option?: EChartsOption;
11
- /**
12
- * ECharts setup function
13
- *
14
- * ECharts 初始化函数
15
- */
16
- setup?: () => Promise<void>;
17
- /**
18
- * Whether ECharts has been set up
19
- *
20
- * ECharts 是否已初始化
21
- */
22
- isSetup?: boolean;
6
+ /**
7
+ * ECharts global options
8
+ *
9
+ * ECharts 全局选项
10
+ */
11
+ option?: EChartsOption;
12
+ /**
13
+ * ECharts setup function
14
+ *
15
+ * ECharts 初始化函数
16
+ */
17
+ setup?: () => Promise<void>;
18
+ /**
19
+ * Whether ECharts has been set up
20
+ *
21
+ * ECharts 是否已初始化
22
+ */
23
+ isSetup?: boolean;
23
24
  }
24
25
  declare const defineEChartsConfig: (config: EChartsConfig) => void;
25
-
26
+ //#endregion
27
+ //#region src/client/typings/mermaid.d.ts
26
28
  interface MermaidThemeVariables {
27
- dark?: boolean;
28
- background?: string;
29
- textColor?: string;
30
- lineColor?: string;
31
- mainBkg?: string;
32
- errorBkgColor?: string;
33
- errorTextColor?: string;
34
- fontFamily?: string;
35
- titleColor?: string;
36
- border1?: string;
37
- border2?: string;
38
- nodeBorder?: string;
39
- nodeTextColor?: string;
40
- primaryColor?: string;
41
- primaryBorderColor?: string;
42
- primaryTextColor?: string;
43
- secondaryColor?: string;
44
- secondaryBorderColor?: string;
45
- secondaryTextColor?: string;
46
- tertiaryColor?: string;
47
- tertiaryBorderColor?: string;
48
- tertiaryTextColor?: string;
49
- personBorder?: string;
50
- personBkg?: string;
51
- classText?: string;
52
- attributeBackgroundColorOdd?: string;
53
- attributeBackgroundColorEven?: string;
54
- arrowheadColor?: string;
55
- clusterBkg?: string;
56
- clusterBorder?: string;
57
- edgeLabelBackground?: string;
58
- excludeBkgColor?: string;
59
- sectionBkgColor?: string;
60
- sectionBkgColor2?: string;
61
- altSectionBkgColor?: string;
62
- gridColor?: string;
63
- todayLineColor?: string;
64
- taskBkgColor?: string;
65
- taskBorderColor?: string;
66
- taskTextColor?: string;
67
- taskTextDarkColor?: string;
68
- taskTextClickableColor?: string;
69
- taskTextOutsideColor?: string;
70
- activeTaskBorderColor?: string;
71
- activeTaskBkgColor?: string;
72
- doneTaskBorderColor?: string;
73
- doneTaskBkgColor?: string;
74
- critBorderColor?: string;
75
- critBkgColor?: string;
76
- git1?: string;
77
- git2?: string;
78
- git3?: string;
79
- git4?: string;
80
- git5?: string;
81
- git6?: string;
82
- git7?: string;
83
- gitBranchLabel1?: string;
84
- gitBranchLabel2?: string;
85
- gitBranchLabel3?: string;
86
- gitBranchLabel4?: string;
87
- gitBranchLabel5?: string;
88
- gitBranchLabel6?: string;
89
- gitBranchLabel7?: string;
90
- gitInv1?: string;
91
- gitInv2?: string;
92
- gitInv3?: string;
93
- gitInv4?: string;
94
- gitInv5?: string;
95
- gitInv6?: string;
96
- gitInv7?: string;
97
- commitLabelBackground?: string;
98
- commitLabelColor?: string;
99
- commitLabelFontSize?: string;
100
- tagLabelBorder?: string;
101
- tagLabelBackground?: string;
102
- tagLabelColor?: string;
103
- tagLabelFontSize?: string;
104
- fillType0?: string;
105
- fillType1?: string;
106
- fillType2?: string;
107
- fillType3?: string;
108
- fillType4?: string;
109
- fillType5?: string;
110
- fillType6?: string;
111
- fillType7?: string;
112
- pie1?: string;
113
- pie2?: string;
114
- pie3?: string;
115
- pie4?: string;
116
- pie5?: string;
117
- pie6?: string;
118
- pie7?: string;
119
- pie8?: string;
120
- pie9?: string;
121
- pie10?: string;
122
- pie11?: string;
123
- pie12?: string;
124
- pieStrokeWidth?: string;
125
- pieOpacity?: string;
126
- pieOuterStrokeColor?: string;
127
- pieOuterStrokeWidth?: string;
128
- pieTitleTextSize?: string;
129
- pieTitleTextColor?: string;
130
- requirementBackground?: string;
131
- requirementBorderColor?: string;
132
- requirementBorderSize?: string;
133
- requirementTextColor?: string;
134
- relationColor?: string;
135
- relationLabelBackground?: string;
136
- relationLabelColor?: string;
137
- labelColor?: string;
138
- signalColor?: string;
139
- signalTextColor?: string;
140
- labelBoxBorderColor?: string;
141
- labelBoxBkgColor?: string;
142
- labelTextColor?: string;
143
- loopTextColor?: string;
144
- noteBkgColor?: string;
145
- noteTextColor?: string;
146
- noteBorderColor?: string;
147
- activationBorderColor?: string;
148
- activationBkgColor?: string;
149
- sequenceNumberColor?: string;
150
- actorBorder?: string;
151
- actorBkg?: string;
152
- actorTextColor?: string;
153
- actorLineColor?: string;
154
- [props: string]: boolean | string | undefined;
29
+ dark?: boolean;
30
+ background?: string;
31
+ textColor?: string;
32
+ lineColor?: string;
33
+ mainBkg?: string;
34
+ errorBkgColor?: string;
35
+ errorTextColor?: string;
36
+ fontFamily?: string;
37
+ titleColor?: string;
38
+ border1?: string;
39
+ border2?: string;
40
+ nodeBorder?: string;
41
+ nodeTextColor?: string;
42
+ primaryColor?: string;
43
+ primaryBorderColor?: string;
44
+ primaryTextColor?: string;
45
+ secondaryColor?: string;
46
+ secondaryBorderColor?: string;
47
+ secondaryTextColor?: string;
48
+ tertiaryColor?: string;
49
+ tertiaryBorderColor?: string;
50
+ tertiaryTextColor?: string;
51
+ personBorder?: string;
52
+ personBkg?: string;
53
+ classText?: string;
54
+ attributeBackgroundColorOdd?: string;
55
+ attributeBackgroundColorEven?: string;
56
+ arrowheadColor?: string;
57
+ clusterBkg?: string;
58
+ clusterBorder?: string;
59
+ edgeLabelBackground?: string;
60
+ excludeBkgColor?: string;
61
+ sectionBkgColor?: string;
62
+ sectionBkgColor2?: string;
63
+ altSectionBkgColor?: string;
64
+ gridColor?: string;
65
+ todayLineColor?: string;
66
+ taskBkgColor?: string;
67
+ taskBorderColor?: string;
68
+ taskTextColor?: string;
69
+ taskTextDarkColor?: string;
70
+ taskTextClickableColor?: string;
71
+ taskTextOutsideColor?: string;
72
+ activeTaskBorderColor?: string;
73
+ activeTaskBkgColor?: string;
74
+ doneTaskBorderColor?: string;
75
+ doneTaskBkgColor?: string;
76
+ critBorderColor?: string;
77
+ critBkgColor?: string;
78
+ git1?: string;
79
+ git2?: string;
80
+ git3?: string;
81
+ git4?: string;
82
+ git5?: string;
83
+ git6?: string;
84
+ git7?: string;
85
+ gitBranchLabel1?: string;
86
+ gitBranchLabel2?: string;
87
+ gitBranchLabel3?: string;
88
+ gitBranchLabel4?: string;
89
+ gitBranchLabel5?: string;
90
+ gitBranchLabel6?: string;
91
+ gitBranchLabel7?: string;
92
+ gitInv1?: string;
93
+ gitInv2?: string;
94
+ gitInv3?: string;
95
+ gitInv4?: string;
96
+ gitInv5?: string;
97
+ gitInv6?: string;
98
+ gitInv7?: string;
99
+ commitLabelBackground?: string;
100
+ commitLabelColor?: string;
101
+ commitLabelFontSize?: string;
102
+ tagLabelBorder?: string;
103
+ tagLabelBackground?: string;
104
+ tagLabelColor?: string;
105
+ tagLabelFontSize?: string;
106
+ fillType0?: string;
107
+ fillType1?: string;
108
+ fillType2?: string;
109
+ fillType3?: string;
110
+ fillType4?: string;
111
+ fillType5?: string;
112
+ fillType6?: string;
113
+ fillType7?: string;
114
+ pie1?: string;
115
+ pie2?: string;
116
+ pie3?: string;
117
+ pie4?: string;
118
+ pie5?: string;
119
+ pie6?: string;
120
+ pie7?: string;
121
+ pie8?: string;
122
+ pie9?: string;
123
+ pie10?: string;
124
+ pie11?: string;
125
+ pie12?: string;
126
+ pieStrokeWidth?: string;
127
+ pieOpacity?: string;
128
+ pieOuterStrokeColor?: string;
129
+ pieOuterStrokeWidth?: string;
130
+ pieTitleTextSize?: string;
131
+ pieTitleTextColor?: string;
132
+ requirementBackground?: string;
133
+ requirementBorderColor?: string;
134
+ requirementBorderSize?: string;
135
+ requirementTextColor?: string;
136
+ relationColor?: string;
137
+ relationLabelBackground?: string;
138
+ relationLabelColor?: string;
139
+ labelColor?: string;
140
+ signalColor?: string;
141
+ signalTextColor?: string;
142
+ labelBoxBorderColor?: string;
143
+ labelBoxBkgColor?: string;
144
+ labelTextColor?: string;
145
+ loopTextColor?: string;
146
+ noteBkgColor?: string;
147
+ noteTextColor?: string;
148
+ noteBorderColor?: string;
149
+ activationBorderColor?: string;
150
+ activationBkgColor?: string;
151
+ sequenceNumberColor?: string;
152
+ actorBorder?: string;
153
+ actorBkg?: string;
154
+ actorTextColor?: string;
155
+ actorLineColor?: string;
156
+ [props: string]: boolean | string | undefined;
155
157
  }
156
158
  type MermaidOptions = Omit<MermaidConfig, 'startOnLoad' | 'themeVariables'> & {
157
- themeVariables?: MermaidThemeVariables | ((isDarkMode: boolean) => MermaidThemeVariables);
159
+ themeVariables?: MermaidThemeVariables | ((isDarkMode: boolean) => MermaidThemeVariables);
158
160
  };
159
-
161
+ //#endregion
162
+ //#region src/client/helpers/mermaid.d.ts
160
163
  declare const defineMermaidConfig: (options: MermaidOptions) => void;
161
-
162
- export { defineEChartsConfig, defineMermaidConfig };
163
- export type { EChartsConfig };
164
+ //#endregion
165
+ export { EChartsConfig, defineEChartsConfig, defineMermaidConfig };
166
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
- import{d as a,u as i}from"./echarts-C40_Ts42.js";import{d as r,u as f}from"./mermaid-D26-9yYy.js";export{a as defineEChartsConfig,r as defineMermaidConfig,i as useEChartsConfig,f as useMermaidOptions};
2
- //# sourceMappingURL=index.js.map
1
+ import{n as e,t}from"../echarts-C9C0qkV9.js";import{n,t as r}from"../mermaid-BPRrFw7i.js";export{t as defineEChartsConfig,r as defineMermaidConfig,e as useEChartsConfig,n as useMermaidOptions};
@@ -0,0 +1,2 @@
1
+ let e={};const t=t=>{e=t},n=()=>e;export{n,t};
2
+ //# sourceMappingURL=echarts-C9C0qkV9.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"echarts-C9C0qkV9.js","names":[],"sources":["../src/client/helpers/echarts.ts"],"sourcesContent":["import type { EChartsOption } from 'echarts'\n\nexport interface EChartsConfig {\n /**\n * ECharts global options\n *\n * ECharts 全局选项\n */\n option?: EChartsOption\n\n /**\n * ECharts setup function\n *\n * ECharts 初始化函数\n */\n setup?: () => Promise<void>\n\n /**\n * Whether ECharts has been set up\n *\n * ECharts 是否已初始化\n */\n isSetup?: boolean\n}\n\nlet echartsConfig: EChartsConfig = {}\n\nexport const defineEChartsConfig = (config: EChartsConfig): void => {\n echartsConfig = config\n}\n\n/**\n * @internal\n *\n * @returns ECharts options defined by user / 用户定义的 ECharts 配置\n */\nexport const useEChartsConfig = (): EChartsConfig => echartsConfig\n"],"mappings":"AAyBA,IAAI,EAA+B,EAAE,CAErC,MAAa,EAAuB,GAAgC,CAClE,EAAgB,GAQL,MAAwC"}
@@ -0,0 +1,2 @@
1
+ let e={};const t=t=>{e=t},n=()=>e;export{n,t};
2
+ //# sourceMappingURL=mermaid-BPRrFw7i.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mermaid-BPRrFw7i.js","names":[],"sources":["../src/client/helpers/mermaid.ts"],"sourcesContent":["import type { MermaidOptions } from '../typings/index.js'\n\nlet mermaidOptions: MermaidOptions = {}\n\nexport const defineMermaidConfig = (options: MermaidOptions): void => {\n mermaidOptions = options\n}\n\n/**\n * @internal\n *\n * @returns Mermaid options defined by user / 用户定义的 Mermaid 配置\n */\nexport const useMermaidOptions = (): MermaidOptions => mermaidOptions\n"],"mappings":"AAEA,IAAI,EAAiC,EAAE,CAEvC,MAAa,EAAuB,GAAkC,CACpE,EAAiB,GAQN,MAA0C"}