@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
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { PropType, VNode } from "vue";
|
|
3
|
+
//#region src/client/components/ChartJS.d.ts
|
|
4
|
+
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
+
/**
|
|
6
|
+
* Chart config
|
|
7
|
+
*
|
|
8
|
+
* 图表配置
|
|
9
|
+
*/
|
|
10
|
+
config: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Chart title
|
|
16
|
+
*
|
|
17
|
+
* 图表标题
|
|
18
|
+
*/
|
|
19
|
+
title: StringConstructor;
|
|
20
|
+
/**
|
|
21
|
+
* Chart config type
|
|
22
|
+
*
|
|
23
|
+
* 图表配置类型
|
|
24
|
+
*/
|
|
25
|
+
type: {
|
|
26
|
+
type: PropType<"js" | "json">;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>, () => (VNode | null)[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
30
|
+
/**
|
|
31
|
+
* Chart config
|
|
32
|
+
*
|
|
33
|
+
* 图表配置
|
|
34
|
+
*/
|
|
35
|
+
config: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Chart title
|
|
41
|
+
*
|
|
42
|
+
* 图表标题
|
|
43
|
+
*/
|
|
44
|
+
title: StringConstructor;
|
|
45
|
+
/**
|
|
46
|
+
* Chart config type
|
|
47
|
+
*
|
|
48
|
+
* 图表配置类型
|
|
49
|
+
*/
|
|
50
|
+
type: {
|
|
51
|
+
type: PropType<"js" | "json">;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
}>> & Readonly<{}>, {
|
|
55
|
+
type: "js" | "json";
|
|
56
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { _default as default };
|
|
59
|
+
//# sourceMappingURL=ChartJS.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{LoadingIcon as e,decodeData as t,useDarkMode as n}from"@vuepress/helper/client";import{watchImmediate as r}from"@vueuse/core";import{defineComponent as i,h as a,nextTick as o,onMounted as s,onUnmounted as c,ref as l,shallowRef as u,useId as d}from"vue";import"../styles/chartjs.css";const f=(e,t)=>t===`json`?JSON.parse(e):Function(`\
|
|
2
|
+
let config,__chart_js_config__;
|
|
3
|
+
{
|
|
4
|
+
${e}
|
|
5
|
+
__chart_js_config__=config;
|
|
6
|
+
}
|
|
7
|
+
return __chart_js_config__;\
|
|
8
|
+
`)();var p=i({name:`ChartJS`,props:{config:{type:String,required:!0},title:String,type:{type:String,default:`json`}},setup(i){let p=n(),m=u(),h=d(),g=l(!1),_,v=()=>{_?.destroy(),_=null},y=async()=>{if(__VUEPRESS_SSR__)return;let{default:e}=await import(`chart.js/auto`);e.defaults.borderColor=p.value?`#ccc`:`#36A2EB`,e.defaults.color=p.value?`#fff`:`#000`,e.defaults.maintainAspectRatio=!1,_=new e(h,f(t(i.config),i.type))};return s(()=>{r(__VUEPRESS_DEV__?[()=>i.config,p]:p,async()=>{v(),await o(),await y(),g.value=!0},{flush:`post`})}),c(v),()=>[i.title?a(`div`,{class:`chartjs-title`},decodeURIComponent(i.title)):null,g.value?null:a(e,{class:`chartjs-loading`,height:192}),a(`div`,{ref:m,class:`chartjs-wrapper`,style:{display:g.value?`block`:`none`}},a(`canvas`,{id:h,height:400}))]}});export{p as default};
|
|
9
|
+
//# sourceMappingURL=ChartJS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartJS.js","names":[],"sources":["../../../src/client/components/ChartJS.ts"],"sourcesContent":["import { LoadingIcon, decodeData, useDarkMode } from '@vuepress/helper/client'\nimport { watchImmediate } from '@vueuse/core'\nimport type { Chart, ChartConfiguration } from 'chart.js'\nimport type { PropType, VNode } from 'vue'\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n useId,\n} from 'vue'\n\nimport '../styles/chartjs.css'\n\nconst parseChartConfig = (\n config: string,\n type: 'js' | 'json',\n): ChartConfiguration => {\n if (type === 'json') return JSON.parse(config) as ChartConfiguration\n\n // oxlint-disable-next-line no-new-func, typescript/no-implied-eval\n const runner = new Function(\n `\\\nlet config,__chart_js_config__;\n{\n${config}\n__chart_js_config__=config;\n}\nreturn __chart_js_config__;\\\n`,\n ) as () => ChartConfiguration\n\n return runner()\n}\n\nexport default defineComponent({\n name: 'ChartJS',\n\n props: {\n /**\n * Chart config\n *\n * 图表配置\n */\n config: {\n type: String,\n required: true,\n },\n\n /**\n * Chart title\n *\n * 图表标题\n */\n title: String,\n\n /**\n * Chart config type\n *\n * 图表配置类型\n */\n type: {\n type: String as PropType<'js' | 'json'>,\n default: 'json',\n },\n },\n\n setup(props) {\n const isDarkMode = useDarkMode()\n const chartElement = shallowRef<HTMLElement>()\n const id = useId()\n const loaded = ref(false)\n\n let chartjs: Chart | null\n\n const destroyChart = (): void => {\n chartjs?.destroy()\n chartjs = null\n }\n\n const renderChart = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const { default: ChartJs } = await import(\n /* webpackChunkName: \"chart\" */ 'chart.js/auto'\n )\n\n ChartJs.defaults.borderColor = isDarkMode.value ? '#ccc' : '#36A2EB'\n ChartJs.defaults.color = isDarkMode.value ? '#fff' : '#000'\n ChartJs.defaults.maintainAspectRatio = false\n\n const chartConfig = decodeData(props.config)\n const data = parseChartConfig(chartConfig, props.type)\n\n chartjs = new ChartJs(id, data)\n }\n\n onMounted(() => {\n watchImmediate(\n __VUEPRESS_DEV__\n ? // config must be changed if type is changed, so no need to watch type\n [(): string => props.config, isDarkMode]\n : isDarkMode,\n async () => {\n destroyChart()\n await nextTick()\n await renderChart()\n loaded.value = true\n },\n { flush: 'post' },\n )\n })\n\n onUnmounted(destroyChart)\n\n return (): (VNode | null)[] => [\n props.title\n ? h('div', { class: 'chartjs-title' }, decodeURIComponent(props.title))\n : null,\n loaded.value\n ? null\n : h(LoadingIcon, { class: 'chartjs-loading', height: 192 }),\n h(\n 'div',\n {\n ref: chartElement,\n class: 'chartjs-wrapper',\n style: {\n display: loaded.value ? 'block' : 'none',\n },\n },\n h('canvas', {\n id,\n height: 400,\n }),\n ),\n ]\n },\n})\n"],"mappings":"kSAiBA,MAAM,GACJ,EACA,IAEI,IAAS,OAAe,KAAK,MAAM,EAAO,CAG3B,SACjB;;;EAGF,EAAO;;;;EAKN,EAEc,CAGjB,IAAA,EAAe,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,OAAQ,CACN,KAAM,OACN,SAAU,GACX,CAOD,MAAO,OAOP,KAAM,CACJ,KAAM,OACN,QAAS,OACV,CACF,CAED,MAAM,EAAO,CACX,IAAM,EAAa,GAAa,CAC1B,EAAe,GAAyB,CACxC,EAAK,GAAO,CACZ,EAAS,EAAI,GAAM,CAErB,EAEE,MAA2B,CAC/B,GAAS,SAAS,CAClB,EAAU,MAGN,EAAc,SAA2B,CAC7C,GAAI,iBAAkB,OAEtB,GAAM,CAAE,QAAS,GAAY,MAAM,OACD,iBAGlC,EAAQ,SAAS,YAAc,EAAW,MAAQ,OAAS,UAC3D,EAAQ,SAAS,MAAQ,EAAW,MAAQ,OAAS,OACrD,EAAQ,SAAS,oBAAsB,GAKvC,EAAU,IAAI,EAAQ,EAFT,EADO,EAAW,EAAM,OAAO,CACD,EAAM,KAAK,CAEvB,EAqBjC,OAlBA,MAAgB,CACd,EACE,iBAEI,KAAe,EAAM,OAAQ,EAAW,CACxC,EACJ,SAAY,CACV,GAAc,CACd,MAAM,GAAU,CAChB,MAAM,GAAa,CACnB,EAAO,MAAQ,IAEjB,CAAE,MAAO,OAAQ,CAClB,EACD,CAEF,EAAY,EAAa,KAEM,CAC7B,EAAM,MACF,EAAE,MAAO,CAAE,MAAO,gBAAiB,CAAE,mBAAmB,EAAM,MAAM,CAAC,CACrE,KACJ,EAAO,MACH,KACA,EAAE,EAAa,CAAE,MAAO,kBAAmB,OAAQ,IAAK,CAAC,CAC7D,EACE,MACA,CACE,IAAK,EACL,MAAO,kBACP,MAAO,CACL,QAAS,EAAO,MAAQ,QAAU,OACnC,CACF,CACD,EAAE,SAAU,CACV,KACA,OAAQ,IACT,CAAC,CACH,CACF,EAEJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { PropType, VNode } from "vue";
|
|
3
|
+
//#region src/client/components/ECharts.d.ts
|
|
4
|
+
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
+
/**
|
|
6
|
+
* ECharts config
|
|
7
|
+
*
|
|
8
|
+
* 图表配置
|
|
9
|
+
*/
|
|
10
|
+
config: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Chart title
|
|
16
|
+
*
|
|
17
|
+
* 图表标题
|
|
18
|
+
*/
|
|
19
|
+
title: StringConstructor;
|
|
20
|
+
/**
|
|
21
|
+
* Chart config type
|
|
22
|
+
*
|
|
23
|
+
* 图表配置类型
|
|
24
|
+
*/
|
|
25
|
+
type: {
|
|
26
|
+
type: PropType<"js" | "json">;
|
|
27
|
+
default: string;
|
|
28
|
+
};
|
|
29
|
+
}>, () => (VNode | null)[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
30
|
+
/**
|
|
31
|
+
* ECharts config
|
|
32
|
+
*
|
|
33
|
+
* 图表配置
|
|
34
|
+
*/
|
|
35
|
+
config: {
|
|
36
|
+
type: StringConstructor;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Chart title
|
|
41
|
+
*
|
|
42
|
+
* 图表标题
|
|
43
|
+
*/
|
|
44
|
+
title: StringConstructor;
|
|
45
|
+
/**
|
|
46
|
+
* Chart config type
|
|
47
|
+
*
|
|
48
|
+
* 图表配置类型
|
|
49
|
+
*/
|
|
50
|
+
type: {
|
|
51
|
+
type: PropType<"js" | "json">;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
}>> & Readonly<{}>, {
|
|
55
|
+
type: "js" | "json";
|
|
56
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
//#endregion
|
|
58
|
+
export { _default as default };
|
|
59
|
+
//# sourceMappingURL=ECharts.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{n as e}from"../../echarts-C9C0qkV9.js";import{LoadingIcon as t,decodeData as n}from"@vuepress/helper/client";import{useDebounceFn as r,useEventListener as i}from"@vueuse/core";import{defineComponent as a,h as o,nextTick as s,onMounted as c,onUnmounted as l,ref as u,shallowRef as d,watch as f}from"vue";import{onContentUpdated as p}from"vuepress/client";import"../styles/echarts.css";const m=(async()=>{}).constructor,h=(e,t,n,r)=>t===`js`?m(`echarts`,`myChart`,`\
|
|
2
|
+
let width,height,option,__echarts_config__;
|
|
3
|
+
{
|
|
4
|
+
${e}
|
|
5
|
+
__echarts_config__={width,height,option};
|
|
6
|
+
}
|
|
7
|
+
return __echarts_config__;
|
|
8
|
+
`)(n,r):Promise.resolve({option:JSON.parse(e)});var g=a({name:`ECharts`,props:{config:{type:String,required:!0},title:String,type:{type:String,default:`json`}},setup(a){let m=e(),g=d(),_=u(!1),v=null;i(`resize`,r(()=>{v?.resize()},100));let y=()=>{v?.dispose(),v=null},b=async()=>{if(__VUEPRESS_SSR__)return;let e=await import(`echarts`);m.isSetup||=(await m.setup?.(),!0),v=e.init(g.value);let{option:t,...r}=await h(n(a.config),a.type,e,v);v.resize(r),v.setOption({...m.option,...t})};return p(async e=>{e===`mounted`&&(await b(),_.value=!0)}),c(()=>{__VUEPRESS_DEV__&&f(()=>a.config,async()=>{y(),await s(),await b()},{flush:`post`})}),l(y),()=>[a.title?o(`div`,{class:`echarts-title`},decodeURIComponent(a.title)):null,o(`div`,{class:`echarts-wrapper`},[o(`div`,{ref:g,class:`echarts-container`}),_.value?null:o(t,{class:`echarts-loading`,height:360})])]}});export{g as default};
|
|
9
|
+
//# sourceMappingURL=ECharts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ECharts.js","names":[],"sources":["../../../src/client/components/ECharts.ts"],"sourcesContent":["import { LoadingIcon, decodeData } from '@vuepress/helper/client'\nimport { useDebounceFn, useEventListener } from '@vueuse/core'\nimport type { EChartsOption, EChartsType } from 'echarts'\n// oxlint-disable-next-line import/no-namespace\nimport type * as ECharts from 'echarts'\nimport type { PropType, VNode } from 'vue'\nimport {\n defineComponent,\n h,\n nextTick,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n watch,\n} from 'vue'\nimport { onContentUpdated } from 'vuepress/client'\n\nimport { useEChartsConfig } from '../helpers/index.js'\nimport '../styles/echarts.css'\n\ninterface EChartsConfig {\n width?: number\n height?: number\n option: EChartsOption\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst AsyncFunction = (async (): Promise<void> => {}).constructor\n\nconst parseEChartsConfig = (\n config: string,\n type: 'js' | 'json',\n echarts: typeof ECharts,\n instance: EChartsType,\n): Promise<EChartsConfig> => {\n if (type === 'js') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, new-cap\n const runner = AsyncFunction(\n 'echarts',\n 'myChart',\n `\\\nlet width,height,option,__echarts_config__;\n{\n${config}\n__echarts_config__={width,height,option};\n}\nreturn __echarts_config__;\n`,\n )\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n return runner(echarts, instance) as Promise<EChartsConfig>\n }\n\n return Promise.resolve({ option: JSON.parse(config) as EChartsOption })\n}\n\nexport default defineComponent({\n name: 'ECharts',\n\n props: {\n /**\n * ECharts config\n *\n * 图表配置\n */\n config: {\n type: String,\n required: true,\n },\n\n /**\n * Chart title\n *\n * 图表标题\n */\n title: String,\n\n /**\n * Chart config type\n *\n * 图表配置类型\n */\n type: {\n type: String as PropType<'js' | 'json'>,\n default: 'json',\n },\n },\n\n setup(props) {\n const echartsConfig = useEChartsConfig()\n const echartsContainer = shallowRef<HTMLElement>()\n\n const loaded = ref(false)\n\n let instance: EChartsType | null = null\n\n useEventListener(\n 'resize',\n useDebounceFn(() => {\n instance?.resize()\n }, 100),\n )\n\n const destroyECharts = (): void => {\n instance?.dispose()\n instance = null\n }\n\n const renderECharts = async (): Promise<void> => {\n if (__VUEPRESS_SSR__) return\n\n const echarts = await import(/* webpackChunkName: \"echarts\" */ 'echarts')\n\n if (!echartsConfig.isSetup) {\n await echartsConfig.setup?.()\n echartsConfig.isSetup = true\n }\n\n instance = echarts.init(echartsContainer.value)\n\n const { option, ...size } = await parseEChartsConfig(\n decodeData(props.config),\n props.type,\n echarts,\n instance,\n )\n\n instance.resize(size)\n instance.setOption({ ...echartsConfig.option, ...option })\n }\n\n onContentUpdated(async (reason) => {\n if (reason === 'mounted') {\n await renderECharts()\n loaded.value = true\n }\n })\n\n onMounted(() => {\n if (!__VUEPRESS_DEV__) return\n\n // config must be changed if type is changed, so no need to watch it\n watch(\n () => props.config,\n async () => {\n destroyECharts()\n await nextTick()\n await renderECharts()\n },\n { flush: 'post' },\n )\n })\n\n onUnmounted(destroyECharts)\n\n return (): (VNode | null)[] => [\n props.title\n ? h('div', { class: 'echarts-title' }, decodeURIComponent(props.title))\n : null,\n h('div', { class: 'echarts-wrapper' }, [\n h('div', {\n ref: echartsContainer,\n class: 'echarts-container',\n }),\n loaded.value\n ? null\n : h(LoadingIcon, { class: 'echarts-loading', height: 360 }),\n ]),\n ]\n },\n})\n"],"mappings":"uYA4BA,MAAM,GAAiB,SAA2B,IAAI,YAEhD,GACJ,EACA,EACA,EACA,IAEI,IAAS,KAEI,EACb,UACA,UACA;;;EAGJ,EAAO;;;;EAKJ,CAGa,EAAS,EAAS,CAG3B,QAAQ,QAAQ,CAAE,OAAQ,KAAK,MAAM,EAAO,CAAmB,CAAC,CAGzE,IAAA,EAAe,EAAgB,CAC7B,KAAM,UAEN,MAAO,CAML,OAAQ,CACN,KAAM,OACN,SAAU,GACX,CAOD,MAAO,OAOP,KAAM,CACJ,KAAM,OACN,QAAS,OACV,CACF,CAED,MAAM,EAAO,CACX,IAAM,EAAgB,GAAkB,CAClC,EAAmB,GAAyB,CAE5C,EAAS,EAAI,GAAM,CAErB,EAA+B,KAEnC,EACE,SACA,MAAoB,CAClB,GAAU,QAAQ,EACjB,IAAI,CACR,CAED,IAAM,MAA6B,CACjC,GAAU,SAAS,CACnB,EAAW,MAGP,EAAgB,SAA2B,CAC/C,GAAI,iBAAkB,OAEtB,IAAM,EAAU,MAAM,OAAyC,WAE/D,AAEE,EAAc,WADd,MAAM,EAAc,SAAS,CACL,IAG1B,EAAW,EAAQ,KAAK,EAAiB,MAAM,CAE/C,GAAM,CAAE,SAAQ,GAAG,GAAS,MAAM,EAChC,EAAW,EAAM,OAAO,CACxB,EAAM,KACN,EACA,EACD,CAED,EAAS,OAAO,EAAK,CACrB,EAAS,UAAU,CAAE,GAAG,EAAc,OAAQ,GAAG,EAAQ,CAAC,EA2B5D,OAxBA,EAAiB,KAAO,IAAW,CAC7B,IAAW,YACb,MAAM,GAAe,CACrB,EAAO,MAAQ,KAEjB,CAEF,MAAgB,CACT,kBAGL,MACQ,EAAM,OACZ,SAAY,CACV,GAAgB,CAChB,MAAM,GAAU,CAChB,MAAM,GAAe,EAEvB,CAAE,MAAO,OAAQ,CAClB,EACD,CAEF,EAAY,EAAe,KAEI,CAC7B,EAAM,MACF,EAAE,MAAO,CAAE,MAAO,gBAAiB,CAAE,mBAAmB,EAAM,MAAM,CAAC,CACrE,KACJ,EAAE,MAAO,CAAE,MAAO,kBAAmB,CAAE,CACrC,EAAE,MAAO,CACP,IAAK,EACL,MAAO,oBACR,CAAC,CACF,EAAO,MACH,KACA,EAAE,EAAa,CAAE,MAAO,kBAAmB,OAAQ,IAAK,CAAC,CAC9D,CAAC,CACH,EAEJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { PropType, VNode } from "vue";
|
|
3
|
+
//#region src/client/components/FlowChart.d.ts
|
|
4
|
+
declare const _default: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
5
|
+
/**
|
|
6
|
+
* Flowchart code content
|
|
7
|
+
*
|
|
8
|
+
* 流程图代码内容
|
|
9
|
+
*/
|
|
10
|
+
code: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Flowchart preset
|
|
16
|
+
*
|
|
17
|
+
* 流程图预设
|
|
18
|
+
*/
|
|
19
|
+
preset: {
|
|
20
|
+
type: PropType<"ant" | "pie" | "vue">;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
}>, () => (VNode | null)[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
24
|
+
/**
|
|
25
|
+
* Flowchart code content
|
|
26
|
+
*
|
|
27
|
+
* 流程图代码内容
|
|
28
|
+
*/
|
|
29
|
+
code: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Flowchart preset
|
|
35
|
+
*
|
|
36
|
+
* 流程图预设
|
|
37
|
+
*/
|
|
38
|
+
preset: {
|
|
39
|
+
type: PropType<"ant" | "pie" | "vue">;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
}>> & Readonly<{}>, {
|
|
43
|
+
preset: "ant" | "pie" | "vue";
|
|
44
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
45
|
+
//#endregion
|
|
46
|
+
export { _default as default };
|
|
47
|
+
//# sourceMappingURL=FlowChart.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{LoadingIcon as e,decodeData as t}from"@vuepress/helper/client";import{useDebounceFn as n,useEventListener as r}from"@vueuse/core";import{defineComponent as i,h as a,nextTick as o,onMounted as s,onUnmounted as c,ref as l,shallowRef as u,toRefs as d,useId as f,watch as p}from"vue";import{onContentUpdated as m}from"vuepress/client";import"../styles/flowchart.css";var h={x:0,y:0,"line-width":2,"line-length":40,"text-margin":8,"font-size":14,"font-color":`#8DA1AC`,"line-color":`#8DA1AC`,"element-color":`black`,fill:`white`,"yes-text":`Yes`,"no-text":`No`,"arrow-end":`block`,scale:1},g={...h,symbols:{start:{class:`start-element`,"font-color":`#fff`,fill:`#595959`,"line-width":0},end:{class:`end-element`,"font-color":`#fff`,fill:`#595959`,"line-width":0},operation:{class:`operation-element`,"font-color":`#fff`,fill:`#1890ff`,"line-width":0},inputoutput:{class:`inputoutput-element`,"font-color":`#fff`,fill:`#1890ff`,"line-width":0},subroutine:{class:`subroutine-element`,"font-color":`#fff`,fill:`#FF485E`,"element-color":`#fff`,"line-color":`red`},condition:{class:`condition-element`,"font-color":`#fff`,fill:`#FF485E`,"line-width":0},parallel:{class:`parallel-element`,"font-color":`#fff`,fill:`#1890ff`,"line-width":0}}},_={...h,"line-width":1,symbols:{start:{class:`start-element`,fill:`#ccc`,"line-color":`#5c6ac4`,"font-color":`#000`},end:{class:`end-element`,fill:`#ccc`,"line-color":`#5c6ac4`,"font-color":`#000`},operation:{class:`operation-element`,fill:`#f1f1f1`,"line-color":`#5c6ac4`,"font-color":`#000`},inputoutput:{class:`inputoutput-element`,fill:`#f1f1f1`,"line-color":`#5c6ac4`,"font-color":`#000`},subroutine:{class:`subroutine-element`,fill:`#f1f1f1`,"line-color":`#5c6ac4`,"font-color":`#000`},condition:{class:`condition-element`,fill:`#f1f1f1`,"line-color":`#5c6ac4`,"font-color":`#000`},parallel:{class:`parallel-element`,fill:`#f1f1f1`,"line-color":`#5c6ac4`,"font-color":`#000`}}};const v={ant:g,vue:{...h,symbols:{start:{class:`start-element`,"font-color":`#fff`,fill:`#2F495F`,"line-width":0},end:{class:`end-element`,"font-color":`#fff`,fill:`#2F495F`,"line-width":0},operation:{class:`operation-element`,"font-color":`#fff`,fill:`#00BC7D`,"line-width":0},inputoutput:{class:`inputoutput-element`,"font-color":`#fff`,fill:`#EB4D5D`,"line-width":0},subroutine:{class:`subroutine-element`,"font-color":`#fff`,fill:`#937AC4`,"element-color":`#fff`,"line-color":`red`},condition:{class:`condition-element`,"font-color":`#fff`,fill:`#FFB500`,"line-width":0},parallel:{class:`parallel-element`,"font-color":`#fff`,fill:`#2F495F`,"line-width":0}}},pie:_},y=e=>e<419?.8:e>1280?1:.9;var b=i({name:`FlowChart`,props:{code:{type:String,required:!0},preset:{type:String,default:`vue`}},setup(i){let h=f(),{code:g,preset:_}=d(i),b=u(),x=l(!1),S=l(1),C=null;r(`resize`,n(()=>{if(C){let e=y(window.innerWidth);S.value!==e&&(S.value=e,C.draw(h,{...v[i.preset],scale:e}))}},100));let w=()=>{C?.clean(),C=null},T=async()=>{if(__VUEPRESS_SSR__)return;let{parse:e}=await import(`flowchart.ts`);C=e(t(g.value)),S.value=y(window.innerWidth),x.value=!0,C.draw(h,{...v[i.preset],scale:S.value})};return m(async e=>{e===`mounted`&&await T()}),s(()=>{__VUEPRESS_DEV__&&p([g,_],async()=>{w(),await o(),await T()},{flush:`post`})}),c(w),()=>[x.value?null:a(e,{class:`flowchart-loading`,height:192}),a(`div`,{ref:b,class:[`flowchart-wrapper`,i.preset],id:h,style:{display:x.value?`block`:`none`}})]}});export{b as default};
|
|
2
|
+
//# sourceMappingURL=FlowChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FlowChart.js","names":["base","base","base"],"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"],"mappings":"kXAAA,IAAA,EAAe,CACb,EAAK,EACL,EAAK,EACL,aAAc,EACd,cAAe,GACf,cAAe,EACf,YAAa,GACb,aAAc,UACd,aAAc,UACd,gBAAiB,QACjB,KAAQ,QACR,WAAY,MACZ,UAAW,KACX,YAAa,QACb,MAAS,EACV,CCbD,EAAe,CACb,GAAGA,EAGH,QAAS,CACP,MAAO,CACL,MAAS,gBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,IAAK,CACH,MAAS,cACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,UAAW,CACT,MAAS,oBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,YAAa,CACX,MAAS,sBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,WAAY,CACV,MAAS,qBACT,aAAc,OACd,KAAQ,UACR,gBAAiB,OACjB,aAAc,MACf,CACD,UAAW,CACT,MAAS,oBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,SAAU,CACR,MAAS,mBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACF,CACF,CCjDD,EAAe,CACb,GAAGC,EAGH,aAAc,EACd,QAAW,CACT,MAAO,CACL,MAAS,gBACT,KAAQ,OACR,aAAc,UACd,aAAc,OACf,CACD,IAAK,CACH,MAAS,cACT,KAAQ,OACR,aAAc,UACd,aAAc,OACf,CACD,UAAW,CACT,MAAS,oBACT,KAAQ,UACR,aAAc,UACd,aAAc,OACf,CACD,YAAa,CACX,MAAS,sBACT,KAAQ,UACR,aAAc,UACd,aAAc,OACf,CACD,WAAY,CACV,MAAS,qBACT,KAAQ,UACR,aAAc,UACd,aAAc,OACf,CACD,UAAW,CACT,MAAS,oBACT,KAAQ,UACR,aAAc,UACd,aAAc,OACf,CACD,SAAU,CACR,MAAS,mBACT,KAAQ,UACR,aAAc,UACd,aAAc,OACf,CACF,CACF,CEzCD,MAAa,EAAmB,CAC9B,IAAA,EACA,IDVa,CACb,GAAGC,EAGH,QAAS,CACP,MAAO,CACL,MAAS,gBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,IAAK,CACH,MAAS,cACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,UAAW,CACT,MAAS,oBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,YAAa,CACX,MAAS,sBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,WAAY,CACV,MAAS,qBACT,aAAc,OACd,KAAQ,UACR,gBAAiB,OACjB,aAAc,MACf,CACD,UAAW,CACT,MAAS,oBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACD,SAAU,CACR,MAAS,mBACT,aAAc,OACd,KAAQ,UACR,aAAc,EACf,CACF,CACF,CCtCC,IAAA,EACD,CCQK,EAAY,GAChB,EAAQ,IAAM,GAAM,EAAQ,KAAO,EAAI,GAEzC,IAAA,EAAe,EAAgB,CAC7B,KAAM,YAEN,MAAO,CAML,KAAM,CAAE,KAAM,OAAQ,SAAU,GAAM,CAOtC,OAAQ,CACN,KAAM,OACN,QAAS,MACV,CACF,CAED,MAAM,EAAO,CACX,IAAM,EAAK,GAAO,CACZ,CAAE,OAAM,UAAW,EAAO,EAAM,CAChC,EAAU,GAA4B,CAEtC,EAAS,EAAI,GAAM,CACnB,EAAQ,EAAI,EAAE,CAEhB,EAA0B,KAE9B,EACE,SACA,MAAoB,CAClB,GAAI,EAAW,CACb,IAAM,EAAW,EAAS,OAAO,WAAW,CAExC,EAAM,QAAU,IAClB,EAAM,MAAQ,EAEd,EAAU,KAAK,EAAI,CACjB,GAAG,EAAiB,EAAM,QAC1B,MAAO,EACR,CAAC,IAGL,IAAI,CACR,CAED,IAAM,MAA+B,CACnC,GAAW,OAAO,CAClB,EAAY,MAGR,EAAkB,SAA2B,CACjD,GAAI,iBAAkB,OAEtB,GAAM,CAAE,SAAU,MAAM,OACc,gBAGtC,EAAY,EAAM,EAAW,EAAK,MAAM,CAAC,CAGzC,EAAM,MAAQ,EAAS,OAAO,WAAW,CAEzC,EAAO,MAAQ,GAGf,EAAU,KAAK,EAAI,CACjB,GAAG,EAAiB,EAAM,QAC1B,MAAO,EAAM,MACd,CAAC,EAuBJ,OApBA,EAAiB,KAAO,IAAW,CAC7B,IAAW,WAAW,MAAM,GAAiB,EACjD,CAEF,MAAgB,CACT,kBAEL,EACE,CAAC,EAAM,EAAO,CACd,SAAY,CACV,GAAkB,CAClB,MAAM,GAAU,CAChB,MAAM,GAAiB,EAEzB,CAAE,MAAO,OAAQ,CAClB,EACD,CAEF,EAAY,EAAiB,KAEE,CAC7B,EAAO,MACH,KACA,EAAE,EAAa,CAAE,MAAO,oBAAqB,OAAQ,IAAK,CAAC,CAC/D,EAAE,MAAO,CACP,IAAK,EACL,MAAO,CAAC,oBAAqB,EAAM,OAAO,CAC1C,KACA,MAAO,CACL,QAAS,EAAO,MAAQ,QAAU,OACnC,CACF,CAAC,CACH,EAEJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { VNode } from "vue";
|
|
3
|
+
//#region src/client/components/MarkMap.d.ts
|
|
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
|
+
//#endregion
|
|
26
|
+
export { _default as default };
|
|
27
|
+
//# sourceMappingURL=MarkMap.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{LoadingIcon as e,decodeData as t}from"@vuepress/helper/client";import{useDebounceFn as n,useEventListener as r}from"@vueuse/core";import{defineComponent as i,h as a,nextTick as o,onMounted as s,onUnmounted as c,ref as l,shallowRef as u,toRefs as d,watch as f}from"vue";import{onContentUpdated as p}from"vuepress/client";import"../styles/markmap.css";var m=i({name:`MarkMap`,props:{content:{type:String,required:!0}},setup(i){let{content:m}=d(i),h=u(),g=u(),_=l(!1),v=null;r(`resize`,n(()=>{v?.fit()},100));let y=()=>{v?.destroy(),v=null},b=async()=>{if(__VUEPRESS_SSR__)return;let[{Transformer:e},n,{Toolbar:r}]=await Promise.all([import(`markmap-lib`),import(`markmap-view`),import(`markmap-toolbar`)]),{Markmap:a,deriveOptions:o,loadJS:s,loadCSS:c}=n,l=new e,{frontmatter:u,features:d,root:f}=l.transform(t(i.content)),{styles:p,scripts:m}=l.getUsedAssets(d);await Promise.all([m?s(m,{getMarkmap:()=>n}):Promise.resolve(),p?c(p):Promise.resolve()]),v=a.create(g.value,o({maxWidth:240,...u?.markmap}));let{el:_}=r.create(v);await v.setData(f),await v.fit(),_.style.position=`absolute`,_.style.bottom=`0.5rem`,_.style.right=`0.5rem`,h.value.append(_)};return p(async e=>{e===`mounted`&&(await b(),_.value=!0)}),s(()=>{__VUEPRESS_DEV__&&f(m,async()=>{y(),await o(),await b()},{flush:`post`})}),c(y),()=>a(`div`,{class:`markmap-wrapper`,ref:h},[a(`svg`,{ref:g,class:`markmap-svg`}),_.value?null:a(e,{class:`markmap-loading`,height:360})])}});export{m as default};
|
|
2
|
+
//# sourceMappingURL=MarkMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,GAAM,CAAC,CAAE,eAAe,EAAa,CAAE,YAAa,MAAM,QAAQ,IAAI,CACpE,OAAyC,eACzC,OAAyC,gBACzC,OAAyC,mBAC1C,CAAC,CAEI,CAAE,UAAS,gBAAe,SAAQ,WAAY,EAE9C,EAAc,IAAI,EAClB,CAAE,cAAa,WAAU,QAAS,EAAY,UAClD,EAAW,EAAM,QAAQ,CAC1B,CACK,CAAE,SAAQ,WAAY,EAAY,cAAc,EAAS,CAE/D,MAAM,QAAQ,IAAI,CAEhB,EACI,EAAO,EAAS,CAEd,eAAkB,EACnB,CAAC,CACF,QAAQ,SAAS,CAErB,EAAS,EAAQ,EAAO,CAAG,QAAQ,SAAS,CAC7C,CAAC,CAEF,EAAU,EAAQ,OAChB,EAAW,MACX,EAAc,CACZ,SAAU,IACV,GAAG,GAAa,QACjB,CAAC,CACH,CAED,GAAM,CAAE,MAAO,EAAQ,OAAO,EAAQ,CAEtC,MAAM,EAAQ,QAAQ,EAAK,CAC3B,MAAM,EAAQ,KAAK,CAEnB,EAAG,MAAM,SAAW,WACpB,EAAG,MAAM,OAAS,SAClB,EAAG,MAAM,MAAQ,SAEjB,EAAe,MAAO,OAAO,EAAG,EA0BlC,OAvBA,EAAiB,KAAO,IAAW,CAC7B,IAAW,YACb,MAAM,GAAe,CACrB,EAAO,MAAQ,KAEjB,CAEF,MAAgB,CACT,kBAEL,EACE,EACA,SAAY,CACV,GAAgB,CAChB,MAAM,GAAU,CAChB,MAAM,GAAe,EAEvB,CAAE,MAAO,OAAQ,CAClB,EACD,CAEF,EAAY,EAAe,KAGzB,EAAE,MAAO,CAAE,MAAO,kBAAmB,IAAK,EAAgB,CAAE,CAC1D,EAAE,MAAO,CACP,IAAK,EACL,MAAO,cACR,CAAC,CACF,EAAO,MACH,KACA,EAAE,EAAa,CAAE,MAAO,kBAAmB,OAAQ,IAAK,CAAC,CAC9D,CAAC,EAEP,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as vue from "vue";
|
|
2
|
+
import { VNode } from "vue";
|
|
3
|
+
//#region src/client/components/Mermaid.d.ts
|
|
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
|
+
//#endregion
|
|
38
|
+
export { _default as default };
|
|
39
|
+
//# sourceMappingURL=Mermaid.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"../../mermaid-mwYgrO0I.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
|
|
@@ -0,0 +1 @@
|
|
|
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,iBAAkB,OAEtB,GAAM,CAAE,QAAS,GAAY,MAAM,OACC,oCAGpC,EAAQ,WAAW,CACjB,MAAO,EAAW,MAAQ,OAAS,UACnC,eAAgB,CACd,KAAM,EAAW,MACjB,GAAI,EAAW,EAAe,CAC1B,EAAe,EAAW,MAAM,CAChC,EACL,CACD,UAAW,EACX,SAAU,EACV,QAAS,EACT,MAAO,EACP,GAAI,EACJ,IAAK,EACL,GAAG,EACH,YAAa,GACd,CAAC,CAEF,EAAQ,OAAS,MAAM,EAAQ,OAAO,EAAI,EAAK,MAAM,EAAE,KAGnD,MAAsB,CAC1B,GAAM,CAAE,QAAS,SACX,EAAM,SAAS,cAAc,MAAM,CAEzC,EAAI,UAAU,IAAI,kBAAkB,CAEpC,EAAI,UAAY,EAAQ,MACxB,EAAK,OAAO,EAAI,CAEhB,EAAI,iBAAiB,YAAe,CAClC,EAAI,QAAQ,EACZ,EAGE,MAAuB,CAC3B,IAAM,EAAU,EAAU,EAAQ,MAAM,CAElC,EAAI,SAAS,cAAc,IAAI,CAErC,EAAE,aAAa,OAAQ,EAAQ,CAC/B,EAAE,aACA,WACA,GAAG,EAAM,MAAQ,EAAW,EAAM,MAAM,CAAG,EAAG,MAC/C,CACD,EAAE,OAAO,EASX,OANA,MAAgB,CACd,EAAe,EAAY,EAAe,CACxC,MAAO,OACR,CAAC,EACF,KAEoB,CACpB,EAAE,MAAO,CAAE,MAAO,kBAAmB,CAAE,CACrC,EAAE,SAAU,CACV,MAAO,iBACP,MAAO,UACP,UAAW,6hBACX,QAAS,EACV,CAAC,CACF,EAAE,SAAU,CACV,MAAO,kBACP,MAAO,WACP,UAAW,y4BACX,QAAS,EACV,CAAC,CACH,CAAC,CACF,EACE,MACA,CACE,IAAK,EACL,MAAO,kBACR,CACD,EAAQ,MAEJ,EAAE,MAAO,CAAE,MAAO,kBAAmB,UAAW,EAAQ,MAAO,CAAC,CAEhE,EAAE,EAAa,CAAE,MAAO,kBAAmB,OAAQ,GAAI,CAAC,CAC7D,CACF,EAEJ,CAAC"}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { EChartsOption } from "echarts";
|
|
2
|
+
import { MermaidConfig } from "mermaid";
|
|
3
|
+
|
|
4
|
+
//#region src/client/helpers/echarts.d.ts
|
|
5
|
+
interface EChartsConfig {
|
|
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;
|
|
24
|
+
}
|
|
25
|
+
declare const defineEChartsConfig: (config: EChartsConfig) => void;
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/client/typings/mermaid.d.ts
|
|
28
|
+
interface MermaidThemeVariables {
|
|
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;
|
|
157
|
+
}
|
|
158
|
+
type MermaidOptions = Omit<MermaidConfig, 'startOnLoad' | 'themeVariables'> & {
|
|
159
|
+
themeVariables?: MermaidThemeVariables | ((isDarkMode: boolean) => MermaidThemeVariables);
|
|
160
|
+
};
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/client/helpers/mermaid.d.ts
|
|
163
|
+
declare const defineMermaidConfig: (options: MermaidOptions) => void;
|
|
164
|
+
//#endregion
|
|
165
|
+
export { EChartsConfig, defineEChartsConfig, defineMermaidConfig };
|
|
166
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"../echarts-C9C0qkV9.js";import{n,t as r}from"../mermaid-mwYgrO0I.js";export{t as defineEChartsConfig,r as defineMermaidConfig,e as useEChartsConfig,n as useMermaidOptions};
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"mermaid-mwYgrO0I.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"}
|