@vuepress/plugin-markdown-chart 2.0.0-rc.123 → 2.0.0-rc.125
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/client/components/ChartJS.d.ts +59 -0
- package/dist/client/components/ChartJS.js +9 -0
- package/dist/client/components/ChartJS.js.map +1 -0
- package/dist/client/components/ECharts.d.ts +59 -0
- package/dist/client/components/ECharts.js +9 -0
- package/dist/client/components/ECharts.js.map +1 -0
- package/dist/client/components/FlowChart.d.ts +47 -0
- package/dist/client/components/FlowChart.js +2 -0
- package/dist/client/components/FlowChart.js.map +1 -0
- package/dist/client/components/MarkMap.d.ts +27 -0
- package/dist/client/components/MarkMap.js +2 -0
- package/dist/client/components/MarkMap.js.map +1 -0
- package/dist/client/components/Mermaid.d.ts +39 -0
- package/dist/client/components/Mermaid.js +2 -0
- package/dist/client/components/Mermaid.js.map +1 -0
- package/dist/client/index.d.ts +166 -0
- package/dist/client/index.js +1 -0
- package/dist/echarts-C9C0qkV9.js +2 -0
- package/dist/echarts-C9C0qkV9.js.map +1 -0
- package/dist/mermaid-mwYgrO0I.js +2 -0
- package/dist/mermaid-mwYgrO0I.js.map +1 -0
- package/dist/node/index.d.ts +247 -0
- package/dist/node/index.js +33 -0
- package/dist/node/index.js.map +1 -0
- package/package.json +19 -12
- package/lib/client/components/ChartJS.d.ts +0 -58
- package/lib/client/components/ChartJS.js +0 -7
- package/lib/client/components/ChartJS.js.map +0 -1
- package/lib/client/components/ECharts.d.ts +0 -58
- package/lib/client/components/ECharts.js +0 -8
- package/lib/client/components/ECharts.js.map +0 -1
- package/lib/client/components/FlowChart.d.ts +0 -46
- package/lib/client/components/FlowChart.js +0 -2
- package/lib/client/components/FlowChart.js.map +0 -1
- package/lib/client/components/MarkMap.d.ts +0 -26
- package/lib/client/components/MarkMap.js +0 -2
- package/lib/client/components/MarkMap.js.map +0 -1
- package/lib/client/components/Mermaid.d.ts +0 -38
- package/lib/client/components/Mermaid.js +0 -2
- package/lib/client/components/Mermaid.js.map +0 -1
- package/lib/client/echarts-C40_Ts42.js +0 -2
- package/lib/client/echarts-C40_Ts42.js.map +0 -1
- package/lib/client/index.d.ts +0 -163
- package/lib/client/index.js +0 -2
- package/lib/client/index.js.map +0 -1
- package/lib/client/mermaid-D26-9yYy.js +0 -2
- package/lib/client/mermaid-D26-9yYy.js.map +0 -1
- package/lib/node/index.d.ts +0 -234
- package/lib/node/index.js +0 -25
- package/lib/node/index.js.map +0 -1
- /package/{lib → dist}/client/styles/chartjs.css +0 -0
- /package/{lib → dist}/client/styles/chartjs.css.map +0 -0
- /package/{lib → dist}/client/styles/echarts.css +0 -0
- /package/{lib → dist}/client/styles/echarts.css.map +0 -0
- /package/{lib → dist}/client/styles/flowchart.css +0 -0
- /package/{lib → dist}/client/styles/flowchart.css.map +0 -0
- /package/{lib → dist}/client/styles/markmap.css +0 -0
- /package/{lib → dist}/client/styles/markmap.css.map +0 -0
- /package/{lib → dist}/client/styles/mermaid.css +0 -0
- /package/{lib → dist}/client/styles/mermaid.css.map +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FlowChart.js","sources":["../../../src/client/utils/flowchart-presets/base.ts","../../../src/client/utils/flowchart-presets/ant.ts","../../../src/client/utils/flowchart-presets/pie.ts","../../../src/client/utils/flowchart-presets/vue.ts","../../../src/client/utils/flowchart-presets/index.ts","../../../src/client/components/FlowChart.ts"],"sourcesContent":["export default {\n 'x': 0,\n 'y': 0,\n 'line-width': 2,\n 'line-length': 40,\n 'text-margin': 8,\n 'font-size': 14,\n 'font-color': '#8DA1AC',\n 'line-color': '#8DA1AC',\n 'element-color': 'black',\n 'fill': 'white',\n 'yes-text': 'Yes',\n 'no-text': 'No',\n 'arrow-end': 'block',\n 'scale': 1,\n}\n","import base from './base.js'\n\nexport default {\n ...base,\n\n // Style symbol types\n symbols: {\n start: {\n 'class': 'start-element',\n 'font-color': '#fff',\n 'fill': '#595959',\n 'line-width': 0,\n },\n end: {\n 'class': 'end-element',\n 'font-color': '#fff',\n 'fill': '#595959',\n 'line-width': 0,\n },\n operation: {\n 'class': 'operation-element',\n 'font-color': '#fff',\n 'fill': '#1890ff',\n 'line-width': 0,\n },\n inputoutput: {\n 'class': 'inputoutput-element',\n 'font-color': '#fff',\n 'fill': '#1890ff',\n 'line-width': 0,\n },\n subroutine: {\n 'class': 'subroutine-element',\n 'font-color': '#fff',\n 'fill': '#FF485E',\n 'element-color': '#fff',\n 'line-color': 'red',\n },\n condition: {\n 'class': 'condition-element',\n 'font-color': '#fff',\n 'fill': '#FF485E',\n 'line-width': 0,\n },\n parallel: {\n 'class': 'parallel-element',\n 'font-color': '#fff',\n 'fill': '#1890ff',\n 'line-width': 0,\n },\n },\n}\n","import base from './base.js'\n\nexport default {\n ...base,\n\n // Style symbol types\n 'line-width': 1,\n 'symbols': {\n start: {\n 'class': 'start-element',\n 'fill': '#ccc',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n end: {\n 'class': 'end-element',\n 'fill': '#ccc',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n operation: {\n 'class': 'operation-element',\n 'fill': '#f1f1f1',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n inputoutput: {\n 'class': 'inputoutput-element',\n 'fill': '#f1f1f1',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n subroutine: {\n 'class': 'subroutine-element',\n 'fill': '#f1f1f1',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n condition: {\n 'class': 'condition-element',\n 'fill': '#f1f1f1',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n parallel: {\n 'class': 'parallel-element',\n 'fill': '#f1f1f1',\n 'line-color': '#5c6ac4',\n 'font-color': '#000',\n },\n },\n}\n","import base from './base.js'\n\nexport default {\n ...base,\n\n // Style symbol types\n symbols: {\n start: {\n 'class': 'start-element',\n 'font-color': '#fff',\n 'fill': '#2F495F',\n 'line-width': 0,\n },\n end: {\n 'class': 'end-element',\n 'font-color': '#fff',\n 'fill': '#2F495F',\n 'line-width': 0,\n },\n operation: {\n 'class': 'operation-element',\n 'font-color': '#fff',\n 'fill': '#00BC7D',\n 'line-width': 0,\n },\n inputoutput: {\n 'class': 'inputoutput-element',\n 'font-color': '#fff',\n 'fill': '#EB4D5D',\n 'line-width': 0,\n },\n subroutine: {\n 'class': 'subroutine-element',\n 'font-color': '#fff',\n 'fill': '#937AC4',\n 'element-color': '#fff',\n 'line-color': 'red',\n },\n condition: {\n 'class': 'condition-element',\n 'font-color': '#fff',\n 'fill': '#FFB500',\n 'line-width': 0,\n },\n parallel: {\n 'class': 'parallel-element',\n 'font-color': '#fff',\n 'fill': '#2F495F',\n 'line-width': 0,\n },\n },\n}\n","/**\n * Forked from https://github.com/ulivz/vuepress-plugin-flowchart/tree/master/lib/presets\n *\n * MIT LICENSED\n */\n\nimport ant from './ant.js'\nimport pie from './pie.js'\nimport vue from './vue.js'\n\nexport const flowchartPresets = {\n ant,\n vue,\n pie,\n}\n","import { LoadingIcon, decodeData } from '@vuepress/helper/client'\nimport { useDebounceFn, useEventListener } from '@vueuse/core'\nimport type { Chart } from 'flowchart.ts'\nimport type { PropType, VNode } from 'vue'\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n toRefs,\n useId,\n watch,\n} from 'vue'\nimport { onContentUpdated } from 'vuepress/client'\n\nimport { flowchartPresets } from '../utils/index.js'\n\nimport '../styles/flowchart.css'\n\nconst getScale = (width: number): number =>\n width < 419 ? 0.8 : width > 1280 ? 1 : 0.9\n\nexport default defineComponent({\n name: 'FlowChart',\n\n props: {\n /**\n * Flowchart code content\n *\n * 流程图代码内容\n */\n code: { type: String, required: true },\n\n /**\n * Flowchart preset\n *\n * 流程图预设\n */\n preset: {\n type: String as PropType<'ant' | 'pie' | 'vue'>,\n default: 'vue',\n },\n },\n\n setup(props) {\n const id = useId()\n const { code, preset } = toRefs(props)\n const element = shallowRef<HTMLDivElement>()\n\n const loaded = ref(false)\n const scale = ref(1)\n\n let flowchart: Chart | null = null\n\n useEventListener(\n 'resize',\n useDebounceFn(() => {\n if (flowchart) {\n const newScale = getScale(window.innerWidth)\n\n if (scale.value !== newScale) {\n scale.value = newScale\n\n flowchart.draw(id, {\n ...flowchartPresets[props.preset],\n scale: newScale,\n })\n }\n }\n }, 100),\n )\n\n const destroyFlowChart = (): void => {\n flowchart?.clean()\n flowchart = null\n }\n\n const renderFlowChart = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const { parse } = await import(\n /* webpackChunkName: \"flowchart\" */ 'flowchart.ts'\n )\n\n flowchart = parse(decodeData(code.value))\n\n // Update scale\n scale.value = getScale(window.innerWidth)\n\n loaded.value = true\n\n // Draw svg to #id\n flowchart.draw(id, {\n ...flowchartPresets[props.preset],\n scale: scale.value,\n })\n }\n\n onContentUpdated(async (reason) => {\n if (reason === 'mounted') await renderFlowChart()\n })\n\n onMounted(() => {\n if (!__VUEPRESS_DEV__) return\n\n watch(\n [code, preset],\n async () => {\n destroyFlowChart()\n await nextTick()\n await renderFlowChart()\n },\n { flush: 'post' },\n )\n })\n\n onUnmounted(destroyFlowChart)\n\n return (): (VNode | null)[] => [\n loaded.value\n ? null\n : h(LoadingIcon, { class: 'flowchart-loading', height: 192 }),\n h('div', {\n ref: element,\n class: ['flowchart-wrapper', props.preset],\n id,\n style: {\n display: loaded.value ? 'block' : 'none',\n },\n }),\n ]\n },\n})\n"],"names":["l","o","base","r","t","flowchartPresets","ant","vue","pie","getScale","width","defineComponent","props","id","useId","code","preset","toRefs","element","shallowRef","loaded","ref","scale","flowchart","useEventListener","useDebounceFn","newScale","destroyFlowChart","renderFlowChart","parse","decodeData","onContentUpdated","reason","onMounted","watch","nextTick","onUnmounted","h","LoadingIcon"],"mappings":"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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as vue from 'vue';
|
|
2
|
-
import { VNode } from 'vue';
|
|
3
|
-
|
|
4
|
-
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
-
/**
|
|
6
|
-
* Markmap content
|
|
7
|
-
*
|
|
8
|
-
* Markmap
|
|
9
|
-
*/
|
|
10
|
-
content: {
|
|
11
|
-
type: StringConstructor;
|
|
12
|
-
required: true;
|
|
13
|
-
};
|
|
14
|
-
}>, () => VNode, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
15
|
-
/**
|
|
16
|
-
* Markmap content
|
|
17
|
-
*
|
|
18
|
-
* Markmap
|
|
19
|
-
*/
|
|
20
|
-
content: {
|
|
21
|
-
type: StringConstructor;
|
|
22
|
-
required: true;
|
|
23
|
-
};
|
|
24
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
25
|
-
|
|
26
|
-
export { _default as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{LoadingIcon as E,decodeData as P}from"@vuepress/helper/client";import{useEventListener as R,useDebounceFn as U}from"@vueuse/core";import{defineComponent as b,toRefs as D,shallowRef as f,ref as x,onMounted as C,watch as T,nextTick as V,onUnmounted as L,h as r}from"vue";import{onContentUpdated as q}from"vuepress/client";import"../styles/markmap.css";var z=b({name:"MarkMap",props:{content:{type:String,required:!0}},setup(o){const{content:v}=D(o),s=f(),n=f(),i=x(!1);let e=null;R("resize",U(()=>{e?.fit()},100));const m=()=>{e?.destroy(),e=null},l=async()=>{if(__VUEPRESS_SSR__)return;const[{Transformer:a},p,{Toolbar:w}]=await Promise.all([import("markmap-lib"),import("markmap-view"),import("markmap-toolbar")]),{Markmap:S,deriveOptions:_,loadJS:g,loadCSS:k}=p,u=new a,{frontmatter:y,features:h,root:M}=u.transform(P(o.content)),{styles:c,scripts:d}=u.getUsedAssets(h);await Promise.all([d?g(d,{getMarkmap:()=>p}):Promise.resolve(),c?k(c):Promise.resolve()]),e=S.create(n.value,_({maxWidth:240,...y?.markmap}));const{el:t}=w.create(e);await e.setData(M),await e.fit(),t.style.position="absolute",t.style.bottom="0.5rem",t.style.right="0.5rem",s.value.append(t)};return q(async a=>{a==="mounted"&&(await l(),i.value=!0)}),C(()=>{__VUEPRESS_DEV__&&T(v,async()=>{m(),await V(),await l()},{flush:"post"})}),L(m),()=>r("div",{class:"markmap-wrapper",ref:s},[r("svg",{ref:n,class:"markmap-svg"}),i.value?null:r(E,{class:"markmap-loading",height:360})])}});export{z as default};
|
|
2
|
-
//# sourceMappingURL=MarkMap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,GAAG,CACR,EAEA,MAAMG,EAAiB,IAAY,CACjCH,GAAS,QAAA,EACTA,EAAU,IACZ,EAEMI,EAAgB,SAA2B,CAC/C,GAAI,iBAAkB,OAEtB,KAAM,CAAC,CAAE,YAAAC,CAAY,EAAGC,EAAa,CAAE,QAAAC,CAAQ,CAAC,EAAI,MAAM,QAAQ,IAAI,CACpE,OAAyC,aAAa,EACtD,OAAyC,cAAc,EACvD,OAAyC,iBAAiB,CAC5D,CAAC,EAEK,CAAE,QAAAC,EAAS,cAAAC,EAAe,OAAAC,EAAQ,QAAAC,CAAQ,EAAIL,EAE9CM,EAAc,IAAIP,EAClB,CAAE,YAAAQ,EAAa,SAAAC,EAAU,KAAAC,CAAK,EAAIH,EAAY,UAClDI,EAAWxB,EAAM,OAAO,CAC1B,EACM,CAAE,OAAAyB,EAAQ,QAAAC,CAAQ,EAAIN,EAAY,cAAcE,CAAQ,EAE9D,MAAM,QAAQ,IAAI,CAEhBI,EACIR,EAAOQ,EAAS,CAEd,WAAY,IAAMZ,CACpB,CAAC,EACD,QAAQ,QAAA,EAEZW,EAASN,EAAQM,CAAM,EAAI,QAAQ,QAAA,CACrC,CAAC,EAEDjB,EAAUQ,EAAQ,OAChBX,EAAW,MACXY,EAAc,CACZ,SAAU,IACV,GAAGI,GAAa,OAClB,CAAC,CACH,EAEA,KAAM,CAAE,GAAAM,CAAG,EAAIZ,EAAQ,OAAOP,CAAO,EAErC,MAAMA,EAAQ,QAAQe,CAAI,EAC1B,MAAMf,EAAQ,IAAA,EAEdmB,EAAG,MAAM,SAAW,WACpBA,EAAG,MAAM,OAAS,SAClBA,EAAG,MAAM,MAAQ,SAEjBxB,EAAe,MAAO,OAAOwB,CAAE,CACjC,EAEA,OAAAC,EAAiB,MAAOC,GAAW,CAC7BA,IAAW,YACb,MAAMjB,IACNN,EAAO,MAAQ,GAEnB,CAAC,EAEDwB,EAAU,IAAM,CACT,kBAELC,EACE9B,EACA,SAAY,CACVU,IACA,MAAMqB,EAAAA,EACN,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,38 +0,0 @@
|
|
|
1
|
-
import * as vue from 'vue';
|
|
2
|
-
import { VNode } from 'vue';
|
|
3
|
-
|
|
4
|
-
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;
|
|
20
|
-
}>, () => 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;
|
|
36
|
-
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
37
|
-
|
|
38
|
-
export { _default as default };
|
|
@@ -1,2 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
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,EACxCC,EAAiBC,EAAAA,EAEjBC,EAAOC,EAAS,IAAMC,EAAWZ,EAAM,IAAI,CAAC,EAE5Ca,EAAUC,EAAI,EAAE,EAEhBC,EAAgB,SAA2B,CAC/C,GAAI,iBAAkB,OAEtB,KAAM,CAAE,QAASC,CAAQ,EAAI,aACO,kCACpC,EAEAA,EAAQ,WAAW,CACjB,MAAOb,EAAW,MAAQ,OAAS,UACnC,eAAgB,CACd,KAAMA,EAAW,MACjB,GAAIc,EAAWZ,CAAc,EACzBA,EAAeF,EAAW,KAAK,EAC/BE,CACN,EACA,UAAWR,EACX,SAAUA,EACV,QAASA,EACT,MAAOA,EACP,GAAIA,EACJ,IAAKA,EACL,GAAGS,EACH,YAAa,EACf,CAAC,EAEDO,EAAQ,OAAS,MAAMG,EAAQ,OAAOf,EAAIS,EAAK,KAAK,GAAG,GACzD,EAEMQ,EAAU,IAAY,CAC1B,KAAM,CAAE,KAAAC,CAAK,EAAI,SACXC,EAAM,SAAS,cAAc,KAAK,EAExCA,EAAI,UAAU,IAAI,iBAAiB,EAEnCA,EAAI,UAAYP,EAAQ,MACxBM,EAAK,OAAOC,CAAG,EAEfA,EAAI,iBAAiB,QAAS,IAAM,CAClCA,EAAI,QACN,CAAC,CACH,EAEMC,EAAW,IAAY,CAC3B,MAAMC,EAAUC,EAAUV,EAAQ,KAAK,EAEjCW,EAAI,SAAS,cAAc,GAAG,EAEpCA,EAAE,aAAa,OAAQF,CAAO,EAC9BE,EAAE,aACA,WACA,GAAGxB,EAAM,MAAQY,EAAWZ,EAAM,KAAK,EAAIC,CAAE,MAC/C,EACAuB,EAAE,OACJ,EAEA,OAAAC,EAAU,IAAM,CACdC,EAAevB,EAAYY,EAAe,CACxC,MAAO,MACT,CAAC,CACH,CAAC,EAEM,IAAe,CACpBY,EAAE,MAAO,CAAE,MAAO,iBAAkB,EAAG,CACrCA,EAAE,SAAU,CACV,MAAO,iBACP,MAAO,UACP,UAAWhC,EACX,QAASuB,CACX,CAAC,EACDS,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"echarts-C40_Ts42.js","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"],"names":["echartsConfig","defineEChartsConfig","config","useEChartsConfig"],"mappings":"AAyBA,IAAIA,EAA+B,CAAA,EAE5B,MAAMC,EAAuBC,GAAgC,CAClEF,EAAgBE,CAClB,EAOaC,EAAmB,IAAqBH"}
|
package/lib/client/index.d.ts
DELETED
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { EChartsOption } from 'echarts';
|
|
2
|
-
import { MermaidConfig } from 'mermaid';
|
|
3
|
-
|
|
4
|
-
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;
|
|
23
|
-
}
|
|
24
|
-
declare const defineEChartsConfig: (config: EChartsConfig) => void;
|
|
25
|
-
|
|
26
|
-
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;
|
|
155
|
-
}
|
|
156
|
-
type MermaidOptions = Omit<MermaidConfig, 'startOnLoad' | 'themeVariables'> & {
|
|
157
|
-
themeVariables?: MermaidThemeVariables | ((isDarkMode: boolean) => MermaidThemeVariables);
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
declare const defineMermaidConfig: (options: MermaidOptions) => void;
|
|
161
|
-
|
|
162
|
-
export { defineEChartsConfig, defineMermaidConfig };
|
|
163
|
-
export type { EChartsConfig };
|
package/lib/client/index.js
DELETED
package/lib/client/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-D26-9yYy.js","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"],"names":["mermaidOptions","defineMermaidConfig","options","useMermaidOptions"],"mappings":"AAEA,IAAIA,EAAiC,CAAA,EAE9B,MAAMC,EAAuBC,GAAkC,CACpEF,EAAiBE,CACnB,EAOaC,EAAoB,IAAsBH"}
|
package/lib/node/index.d.ts
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import { PluginWithOptions, PluginSimple } from 'markdown-it';
|
|
2
|
-
import { MarkdownItPlantumlOptions } from '@mdit/plugin-plantuml';
|
|
3
|
-
import { Plugin } from 'vuepress/core';
|
|
4
|
-
|
|
5
|
-
interface ChartJSPluginOptions {
|
|
6
|
-
/**
|
|
7
|
-
* Allow executing custom scripts inside Chart.js blocks.
|
|
8
|
-
*
|
|
9
|
-
* 允许在 Chart.js 块内执行自定义脚本。
|
|
10
|
-
*
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
allowScripts?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Allow all scripts to be executed inside Chart.js blocks.
|
|
16
|
-
*
|
|
17
|
-
* 允许在 Chart.js 块内执行所有脚本。
|
|
18
|
-
*
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
allowAll?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* List of files allowed to execute scripts inside Chart.js blocks.
|
|
24
|
-
*
|
|
25
|
-
* 允许在 Chart.js 块内执行脚本的文件列表。
|
|
26
|
-
*
|
|
27
|
-
* @default new Set()
|
|
28
|
-
*/
|
|
29
|
-
allowList?: Set<string>;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Chart.js markdown-it plugin
|
|
33
|
-
*
|
|
34
|
-
* Chart.js markdown-it 插件
|
|
35
|
-
*
|
|
36
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
37
|
-
* @param options - Plugin options / 插件选项
|
|
38
|
-
*/
|
|
39
|
-
declare const chartjs: PluginWithOptions<ChartJSPluginOptions>;
|
|
40
|
-
|
|
41
|
-
interface EChartsPluginOptions {
|
|
42
|
-
/**
|
|
43
|
-
* Allow executing custom scripts inside ECharts blocks.
|
|
44
|
-
*
|
|
45
|
-
* 允许在 ECharts 块内执行自定义脚本。
|
|
46
|
-
*
|
|
47
|
-
* @default false
|
|
48
|
-
*/
|
|
49
|
-
allowScripts?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Allow all scripts to be executed inside ECharts blocks.
|
|
52
|
-
*
|
|
53
|
-
* 允许在 ECharts 块内执行所有脚本。
|
|
54
|
-
*
|
|
55
|
-
* @default false
|
|
56
|
-
*/
|
|
57
|
-
allowAll?: boolean;
|
|
58
|
-
/**
|
|
59
|
-
* List of files allowed to execute scripts inside ECharts blocks.
|
|
60
|
-
*
|
|
61
|
-
* 允许在 ECharts 块内执行脚本的文件列表。
|
|
62
|
-
*
|
|
63
|
-
* @default new Set()
|
|
64
|
-
*/
|
|
65
|
-
allowList?: Set<string>;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* ECharts markdown-it plugin
|
|
69
|
-
*
|
|
70
|
-
* ECharts markdown-it 插件
|
|
71
|
-
*
|
|
72
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
73
|
-
* @param options - Plugin options / 插件选项
|
|
74
|
-
*/
|
|
75
|
-
declare const echarts: PluginWithOptions<EChartsPluginOptions>;
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Flowchart markdown-it plugin
|
|
79
|
-
*
|
|
80
|
-
* Flowchart markdown-it 插件
|
|
81
|
-
*
|
|
82
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
83
|
-
*/
|
|
84
|
-
declare const flowchart: PluginSimple;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Markmap markdown-it plugin
|
|
88
|
-
*
|
|
89
|
-
* Markmap markdown-it 插件
|
|
90
|
-
*
|
|
91
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
92
|
-
*/
|
|
93
|
-
declare const markmap: PluginSimple;
|
|
94
|
-
|
|
95
|
-
interface MermaidOptions {
|
|
96
|
-
content: string;
|
|
97
|
-
diagram?: string;
|
|
98
|
-
title?: string;
|
|
99
|
-
indent?: boolean;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Get Mermaid content with proper formatting
|
|
103
|
-
*
|
|
104
|
-
* 获取格式化的 Mermaid 内容
|
|
105
|
-
*
|
|
106
|
-
* @param options - Mermaid options / Mermaid 选项
|
|
107
|
-
*
|
|
108
|
-
* @returns Formatted Mermaid content / 格式化的 Mermaid 内容
|
|
109
|
-
*/
|
|
110
|
-
declare const getMermaidContent: ({ diagram, content, title, indent, }: MermaidOptions) => string;
|
|
111
|
-
/**
|
|
112
|
-
* Mermaid markdown-it plugin
|
|
113
|
-
*
|
|
114
|
-
* Mermaid markdown-it 插件
|
|
115
|
-
*
|
|
116
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
117
|
-
*/
|
|
118
|
-
declare const mermaid: PluginSimple;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* PlantUML markdown-it plugin
|
|
122
|
-
*
|
|
123
|
-
* PlantUML markdown-it 插件
|
|
124
|
-
*
|
|
125
|
-
* @param md - MarkdownIt instance / MarkdownIt 实例
|
|
126
|
-
* @param options - PlantUML options / PlantUML 选项
|
|
127
|
-
*/
|
|
128
|
-
declare const plantuml: PluginWithOptions<MarkdownItPlantumlOptions[]>;
|
|
129
|
-
|
|
130
|
-
interface MarkdownChartPluginOptions {
|
|
131
|
-
/**
|
|
132
|
-
* Whether to enable chart support
|
|
133
|
-
*
|
|
134
|
-
* 是否启用 chart 图表支持
|
|
135
|
-
*
|
|
136
|
-
* @default false
|
|
137
|
-
*/
|
|
138
|
-
chartjs?: boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Whether to enable echarts support
|
|
141
|
-
*
|
|
142
|
-
* 是否启用 echarts 图表支持
|
|
143
|
-
*
|
|
144
|
-
* @default false
|
|
145
|
-
*/
|
|
146
|
-
echarts?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Whether to enable flowchart support
|
|
149
|
-
*
|
|
150
|
-
* 是否启用 flowchart 流程图支持
|
|
151
|
-
*
|
|
152
|
-
* @default false
|
|
153
|
-
*/
|
|
154
|
-
flowchart?: boolean;
|
|
155
|
-
/**
|
|
156
|
-
* Whether to enable markmap support
|
|
157
|
-
*
|
|
158
|
-
* 是否启用 markmap 流程图支持
|
|
159
|
-
*
|
|
160
|
-
* @default false
|
|
161
|
-
*/
|
|
162
|
-
markmap?: boolean;
|
|
163
|
-
/**
|
|
164
|
-
* Whether to enable mermaid support
|
|
165
|
-
*
|
|
166
|
-
* 是否启用 Mermaid 流程图支持
|
|
167
|
-
*
|
|
168
|
-
* @default false
|
|
169
|
-
*/
|
|
170
|
-
mermaid?: boolean;
|
|
171
|
-
/**
|
|
172
|
-
* Whether enable plantuml support
|
|
173
|
-
*
|
|
174
|
-
* 是否启用 plantuml 支持
|
|
175
|
-
*
|
|
176
|
-
* @default false
|
|
177
|
-
*/
|
|
178
|
-
plantuml?: MarkdownItPlantumlOptions[] | boolean;
|
|
179
|
-
/**
|
|
180
|
-
* Allow executing custom scripts inside chart blocks.
|
|
181
|
-
*
|
|
182
|
-
* 允许在图表代码块中执行自定义脚本。
|
|
183
|
-
*
|
|
184
|
-
* # Caution! Enabling this may introduce XSS or remote code risks.
|
|
185
|
-
*
|
|
186
|
-
* # 注意!启用可能带来 XSS 或远程代码风险。
|
|
187
|
-
*
|
|
188
|
-
* @default false
|
|
189
|
-
*/
|
|
190
|
-
DANGEROUS_ALLOW_SCRIPT_EXECUTION?: boolean;
|
|
191
|
-
/**
|
|
192
|
-
* Allowlist of source files permitted to run chart scripts.
|
|
193
|
-
*
|
|
194
|
-
* 允许执行图表脚本的源文件列表(允许清单)。
|
|
195
|
-
*
|
|
196
|
-
* @description Only effective when `DANGEROUS_ALLOW_SCRIPT_EXECUTION` is set; paths must match real files.
|
|
197
|
-
*
|
|
198
|
-
* 仅在 `DANGEROUS_ALLOW_SCRIPT_EXECUTION` 被设置后生效;路径需与实际文件匹配。
|
|
199
|
-
*/
|
|
200
|
-
DANGEROUS_SCRIPT_EXECUTION_ALLOWLIST?: string[] | '*';
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
declare module 'vuepress/markdown' {
|
|
204
|
-
interface MarkdownOptions {
|
|
205
|
-
chart?: MarkdownChartPluginOptions;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Markdown chart plugin
|
|
210
|
-
*
|
|
211
|
-
* Markdown 图表插件
|
|
212
|
-
*
|
|
213
|
-
* @example
|
|
214
|
-
* ```ts
|
|
215
|
-
* import { markdownChartPlugin } from '@vuepress/plugin-markdown-chart'
|
|
216
|
-
*
|
|
217
|
-
* export default {
|
|
218
|
-
* plugins: [
|
|
219
|
-
* markdownChartPlugin({
|
|
220
|
-
* chartjs: true,
|
|
221
|
-
* echarts: true,
|
|
222
|
-
* flowchart: true,
|
|
223
|
-
* markmap: true,
|
|
224
|
-
* mermaid: true,
|
|
225
|
-
* plantuml: true,
|
|
226
|
-
* }),
|
|
227
|
-
* ],
|
|
228
|
-
* }
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
declare const markdownChartPlugin: (options?: MarkdownChartPluginOptions) => Plugin;
|
|
232
|
-
|
|
233
|
-
export { chartjs, echarts, flowchart, getMermaidContent, markdownChartPlugin, markmap, mermaid, plantuml };
|
|
234
|
-
export type { ChartJSPluginOptions, EChartsPluginOptions, MarkdownChartPluginOptions };
|
package/lib/node/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import{encodeData as h,Logger as U,isModuleAvailable as P,ensureEndingSlash as q,deepAssign as G,addViteSsrNoExternal as V,addViteOptimizeDepsExclude as y,addViteSsrExternal as C,addViteOptimizeDepsInclude as W,isArray as M}from"@vuepress/helper";import{colors as $,path as z,getDirname as X}from"vuepress/utils";import{container as E}from"@mdit/plugin-container";import{plantuml as B}from"@mdit/plugin-plantuml";const R=(r,t)=>{const{allowScripts:a,allowAll:o,allowList:n=new Set}=t??{};E(r,{name:"chartjs",openRender:(e,s,i,l)=>{const c=e[s].info.trimStart().slice(7).trim();let m="{}",u=!1,f=!1;const g=l?.filePathRelative??"";for(let d=s;d<e.length;d++){const{type:p,content:k,info:w}=e[d];if(p==="container_chartjs_close"){u&&!f&&(console.warn(`${$.magenta("chartjs")}: JavaScript in Chart.js block is found in ${$.cyan(g)}, ${$.red("it is ignored for security reasons")}.
|
|
2
|
-
To enable the chart, you must manually add it to allowlist, see https://vuepress.vuejs.org/plugin/markdown/markdown-charts/chartjs.html for details.
|
|
3
|
-
`),e[d].hidden=!0);break}k&&(p==="fence"&&(w==="json"?m=h(k):(w==="js"||w==="javascript")&&(m=h(k),u=!0,a&&(o||n.has(g))&&(f=!0))),e[d].type="chartjs_empty",e[d].hidden=!0)}return u&&!f?"":`<ChartJS config="${m}"${c?` title="${encodeURIComponent(c)}"`:""}${u?' type="js"':""}>`},closeRender:(e,s)=>e[s].hidden?"":"</ChartJS>"})},_=(r,t)=>{const{content:a,info:o}=r[t],[,n]=o.trim().split(":",2);return`<ECharts config="${h(a)}"${n?` title="${encodeURIComponent(n)}"`:""}></ECharts>`},x=(r,t)=>{const{allowScripts:a,allowAll:o,allowList:n=new Set}=t??{},{fence:e}=r.renderer.rules;r.renderer.rules.fence=(...s)=>{const[i,l]=s,{info:c}=i[l],[m]=c.split(":",2);return m==="echarts"?_(i,l):e(...s)},r.renderer.rules.echarts=_,E(r,{name:"echarts",openRender:(s,i,l,c)=>{const m=s[i].info.trimStart().slice(7).trim();let u="{}",f=!1,g=!1;const d=c?.filePathRelative??"";for(let p=i;p<s.length;p++){const{type:k,content:w,info:S}=s[p];if(k==="container_echarts_close"){f&&!g&&(console.warn(`${$.magenta("[echarts]")}: JavaScript in echarts block is found in ${$.cyan(d)}, ${$.red("it is ignored for security reasons")}.
|
|
4
|
-
To enable the chart, you must manually add it to allowlist, see https://vuepress.vuejs.org/plugin/markdown/markdown-chart/echarts.html for details.
|
|
5
|
-
`),s[p].hidden=!0);break}w&&(k==="fence"&&(S==="json"?u=w:(S==="js"||S==="javascript")&&(u=w,f=!0,a&&(o||n.has(d))&&(g=!0))),s[p].type="echarts_empty",s[p].hidden=!0)}return f&&!g?"":`<ECharts config="${h(u)}"${m?` title="${encodeURIComponent(m)}"`:""}${f?' type="js"':""}>`},closeRender:(s,i)=>s[i].hidden?"":"</ECharts>"})},H=new Set(["ant","pie","vue"]),A=(r,t)=>{const a=r[t],{content:o,info:n}=a,[,e]=n.trim().split(":",2);return`<FlowChart code="${h(o)}" preset="${H.has(e)?e:"vue"}"></FlowChart>`},D=r=>{const{fence:t}=r.renderer.rules;r.renderer.rules.fence=(...a)=>{const[o,n]=a,{info:e}=o[n],[s]=e.split(":",2);return s==="flow"||s==="flowchart"?A(o,n):t(...a)},r.renderer.rules.flowchart=A},I=(r,t)=>`<MarkMap content="${h(r[t].content)}"></MarkMap>`,L=r=>{const{fence:t}=r.renderer.rules;r.renderer.rules.fence=(...a)=>{const[o,n]=a,{info:e}=o[n],[s]=e.split(":",2);return s==="markmap"?I(o,n):t(...a)},r.renderer.rules.markmap=I},K=(r,t)=>`<Mermaid code="${h(r[t].content)}"></Mermaid>`,O=({diagram:r="mermaid",content:t,title:a="",indent:o=r!=="mermaid"})=>{const[,n,e]=/^\s*---\n([^]*?)\n---\n\n([\s\S]*)\s*$/m.exec(t)??[null,"",t],s=(!a||/^title:\s*(.*)/m.test(n)?n:`title: ${a}
|
|
6
|
-
${n}`).trim();return`${s?`---
|
|
7
|
-
${s}
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
`:""}${r==="mermaid"?"":`${r}
|
|
11
|
-
`}${o?e.split(`
|
|
12
|
-
`).map(i=>i?` ${i}`:"").join(`
|
|
13
|
-
`):e}`},F=r=>`<Mermaid code="${h(O(r))}"${r.title?` title="${h(r.title)}"`:""}></Mermaid>`,b={class:["classDiagram"],c4c:["C4Context"],er:["erDiagram"],gantt:[""],"git-graph":["gitGraph"],journey:[""],mindmap:[""],kanban:[""],pie:[""],quadrant:["quadrantChart"],requirement:["requirementDiagram"],sequence:["sequenceDiagram"],state:["stateDiagram-v2"],timeline:[""],architecture:["architecture-beta"],block:["block-beta",!1],packet:["packet-beta",!1],sankey:["sankey-beta",!1],xy:["xychart-beta",!1],treemap:["treemap-beta",!1],radar:["radar-beta"]},T=r=>{const{fence:t}=r.renderer.rules;r.renderer.rules.fence=(...a)=>{const[o,n]=a,{content:e,info:s}=o[n],i=s.trim();if(i==="mermaid")return F({content:e,indent:!1});const[l,...c]=i.split(" ");return l in b?F({diagram:b[l][0]||l,title:c.join(" "),content:e,indent:b[l][1]??!0}):t(...a)},r.renderer.rules.mermaid=K},v=(r,t=["chronology","gantt","json","latex","math","mindmap","regex","salt","uml","wbs","yaml"].map(a=>({name:a})))=>{t.forEach(a=>{r.use(B,a)})},Q=X(import.meta.url),J="@vuepress/plugin-markdown-chart",N=new U(J),j=q(z.resolve(Q,"../client")),Y=(r,t=!0)=>{const a=P(r,import.meta);return t&&!a&&N.error(`Package ${r} is not installed, please install it manually!`),a},Z=async(r,t)=>{const a=new Set,o=new Set;return t.chartjs&&(a.add(`import ChartJS from "${j}components/ChartJS.js";`),o.add('app.component("ChartJS", ChartJS)')),t.echarts&&(a.add(`import ECharts from "${j}components/ECharts.js";`),o.add('app.component("ECharts", ECharts);')),t.flowchart&&(a.add(`import FlowChart from "${j}components/FlowChart.js";`),o.add('app.component("FlowChart", FlowChart);')),t.markmap&&(a.add(`import MarkMap from "${j}components/MarkMap.js";`),o.add('app.component("MarkMap", MarkMap);')),t.mermaid&&(a.add(`import Mermaid from "${j}components/Mermaid.js";`),o.add('app.component("Mermaid", Mermaid);')),r.writeTemp("markdown-chart/config.js",`import { defineClientConfig } from "vuepress/client";
|
|
14
|
-
${[...a.values()].join(`
|
|
15
|
-
`)}
|
|
16
|
-
|
|
17
|
-
export default defineClientConfig({
|
|
18
|
-
enhance: ({ app }) => {
|
|
19
|
-
${Array.from(o.values(),n=>n.split(`
|
|
20
|
-
`).map(e=>` ${e}`)).flat().join(`
|
|
21
|
-
`)}
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
`)},ee=(r={})=>t=>{const a=G({},t.options.markdown.chart,r);t.options.markdown.chart=a,t.env.isDebug&&N.info("Options:",a);const o=(e,s=[])=>{const i=!!a[e],l=s.every(c=>Y(c,!!a[e]));return i&&l},n={chartjs:o("chartjs",["chart.js"]),echarts:o("echarts",["echarts"]),flowchart:o("flowchart",["flowchart.ts"]),markmap:o("markmap",["markmap-lib","markmap-toolbar","markmap-view"]),mermaid:o("mermaid",["mermaid"])};return{name:J,extendsMarkdown:e=>{const{DANGEROUS_ALLOW_SCRIPT_EXECUTION:s,DANGEROUS_SCRIPT_EXECUTION_ALLOWLIST:i}=a,l={allowScripts:s??!1,allowAll:i==="*",allowList:new Set(M(i)?i.map(c=>{const m=c.replaceAll("\\","/").replace(/^\//,"");return m.endsWith(".md")?m:`${m}.md`}):[])};n.chartjs&&e.use(R,l),n.echarts&&e.use(x,l),n.flowchart&&e.use(D),M(a.plantuml)?e.use(v,a.plantuml):a.plantuml&&e.use(v),n.markmap&&e.use(L),n.mermaid&&e.use(T)},extendsBundlerOptions:e=>{V(e,t,["@vuepress/helper","fflate"]),n.chartjs&&(y(e,t,"chart.js/auto/auto.mjs"),C(e,t,"chart.js")),n.echarts&&(y(e,t,"echarts"),C(e,t,"echarts")),n.flowchart&&(y(e,t,"flowchart.ts"),C(e,t,"flowchart.ts")),n.markmap&&(W(e,t,["markmap-lib","markmap-toolbar","markmap-view"]),C(e,t,["markmap-lib","markmap-toolbar","markmap-view"])),n.mermaid&&(y(e,t,"mermaid/dist/mermaid.esm.min.mjs"),C(e,t,"mermaid"))},clientConfigFile:()=>Z(t,n)}};export{R as chartjs,x as echarts,D as flowchart,O as getMermaidContent,ee as markdownChartPlugin,L as markmap,T as mermaid,v as plantuml};
|
|
25
|
-
//# sourceMappingURL=index.js.map
|