@superlc/md-vue 0.1.0 → 0.2.0
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/Markdown.d.ts +23 -3
- package/dist/Markdown.d.ts.map +1 -1
- package/dist/components/CodeBlock.d.ts +26 -0
- package/dist/components/CodeBlock.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/mermaid/MermaidBlock.d.ts +38 -0
- package/dist/components/mermaid/MermaidBlock.d.ts.map +1 -0
- package/dist/components/mermaid/MermaidFullscreenViewer.d.ts +29 -0
- package/dist/components/mermaid/MermaidFullscreenViewer.d.ts.map +1 -0
- package/dist/components/mermaid/icons.d.ts +52 -0
- package/dist/components/mermaid/icons.d.ts.map +1 -0
- package/dist/components/mermaid/index.d.ts +8 -0
- package/dist/components/mermaid/index.d.ts.map +1 -0
- package/dist/components/mermaid/types.d.ts +34 -0
- package/dist/components/mermaid/types.d.ts.map +1 -0
- package/dist/components/mermaid/useZoom.d.ts +24 -0
- package/dist/components/mermaid/useZoom.d.ts.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +37 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +999 -214
- package/dist/streaming/StreamingMarkdown.d.ts +12 -2
- package/dist/streaming/StreamingMarkdown.d.ts.map +1 -1
- package/dist/streaming/types.d.ts +4 -0
- package/dist/streaming/types.d.ts.map +1 -1
- package/dist/types.d.ts +23 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -12
package/dist/Markdown.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VNode, PropType } from 'vue';
|
|
2
2
|
import { PluginConfig } from '@superlc/md-core';
|
|
3
|
-
import { MarkdownComponents } from './types';
|
|
3
|
+
import { MarkdownComponents, MermaidOptions } from './types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Vue Markdown 渲染组件
|
|
@@ -38,9 +38,17 @@ export declare const Markdown: import('vue').DefineComponent<import('vue').Extra
|
|
|
38
38
|
type: PropType<PluginConfig[]>;
|
|
39
39
|
default: () => never[];
|
|
40
40
|
};
|
|
41
|
+
copyButton: {
|
|
42
|
+
type: BooleanConstructor;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
mermaid: {
|
|
46
|
+
type: PropType<boolean | MermaidOptions>;
|
|
47
|
+
default: boolean;
|
|
48
|
+
};
|
|
41
49
|
}>, () => string | VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
42
50
|
[key: string]: any;
|
|
43
|
-
}> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin,
|
|
51
|
+
}> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "codeCopy"[], "codeCopy", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
44
52
|
content: {
|
|
45
53
|
type: StringConstructor;
|
|
46
54
|
required: true;
|
|
@@ -73,9 +81,21 @@ export declare const Markdown: import('vue').DefineComponent<import('vue').Extra
|
|
|
73
81
|
type: PropType<PluginConfig[]>;
|
|
74
82
|
default: () => never[];
|
|
75
83
|
};
|
|
76
|
-
|
|
84
|
+
copyButton: {
|
|
85
|
+
type: BooleanConstructor;
|
|
86
|
+
default: boolean;
|
|
87
|
+
};
|
|
88
|
+
mermaid: {
|
|
89
|
+
type: PropType<boolean | MermaidOptions>;
|
|
90
|
+
default: boolean;
|
|
91
|
+
};
|
|
92
|
+
}>> & Readonly<{
|
|
93
|
+
onCodeCopy?: ((...args: any[]) => any) | undefined;
|
|
94
|
+
}>, {
|
|
77
95
|
components: MarkdownComponents;
|
|
78
96
|
class: string;
|
|
97
|
+
copyButton: boolean;
|
|
98
|
+
mermaid: boolean | MermaidOptions;
|
|
79
99
|
gfm: boolean;
|
|
80
100
|
highlight: boolean;
|
|
81
101
|
math: boolean;
|
package/dist/Markdown.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../src/Markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Markdown.d.ts","sourceRoot":"","sources":["../src/Markdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuC,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,KAAK,CAAC;AACrF,OAAO,EAAe,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAgDlE;;GAEG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;cAwBC,QAAQ,CAAC,kBAAkB,CAAC;;;;cAI7B,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;cAIxB,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;;;;;cAQZ,QAAQ,CAAC,OAAO,GAAG,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;cAhB7C,QAAQ,CAAC,kBAAkB,CAAC;;;;cAI7B,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;cAIxB,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;;;;;cAQZ,QAAQ,CAAC,OAAO,GAAG,cAAc,CAAC;;;;;;;;;;;;;;;4EAwHjE,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PropType, VNode } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface CodeBlockProps {
|
|
4
|
+
showCopyButton?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Vue 代码块组件,包装 <pre> 元素并添加复制按钮
|
|
8
|
+
*/
|
|
9
|
+
export declare const CodeBlock: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
10
|
+
showCopyButton: {
|
|
11
|
+
type: PropType<boolean>;
|
|
12
|
+
default: boolean;
|
|
13
|
+
};
|
|
14
|
+
}>, () => VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "copy"[], "copy", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
|
+
showCopyButton: {
|
|
18
|
+
type: PropType<boolean>;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
}>> & Readonly<{
|
|
22
|
+
onCopy?: ((...args: any[]) => any) | undefined;
|
|
23
|
+
}>, {
|
|
24
|
+
showCopyButton: boolean;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
//# sourceMappingURL=CodeBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeBlock.d.ts","sourceRoot":"","sources":["../../src/components/CodeBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,QAAQ,EAAE,KAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AA2FzE,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,SAAS;;cAIC,QAAQ,CAAC,OAAO,CAAC;;;;;;;cAAjB,QAAQ,CAAC,OAAO,CAAC;;;;;;;4EA0CtC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { CodeBlock, type CodeBlockProps } from './CodeBlock';
|
|
2
|
+
export { MermaidBlock, MermaidFullscreenViewer, useZoom } from './mermaid';
|
|
3
|
+
export type { MermaidBlockProps, MermaidFullscreenViewerProps, ViewMode, ZoomConfig, ZoomState, } from './mermaid';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3E,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,QAAQ,EACR,UAAU,EACV,SAAS,GACV,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { MermaidTheme } from '@superlc/md-core';
|
|
3
|
+
|
|
4
|
+
export declare const MermaidBlock: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
5
|
+
code: {
|
|
6
|
+
type: StringConstructor;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
theme: {
|
|
10
|
+
type: PropType<MermaidTheme | "auto">;
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
showToolbar: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "copy"[], "copy", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
code: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
theme: {
|
|
25
|
+
type: PropType<MermaidTheme | "auto">;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
showToolbar: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
}>> & Readonly<{
|
|
33
|
+
onCopy?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>, {
|
|
35
|
+
theme: MermaidTheme | "auto";
|
|
36
|
+
showToolbar: boolean;
|
|
37
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
38
|
+
//# sourceMappingURL=MermaidBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidBlock.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/MermaidBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAQL,KAAK,QAAQ,EACd,MAAM,KAAK,CAAC;AACb,OAAO,EAML,KAAK,YAAY,EAElB,MAAM,kBAAkB,CAAC;AAoD1B,eAAO,MAAM,YAAY;;;;;;cAQH,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;;;;;;;;;;;;;;;cAA/B,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC;;;;;;;;;;;;4EAgQnD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid 全屏查看器 (Vue)
|
|
3
|
+
* 使用浏览器原生 Fullscreen API 实现沉浸式体验
|
|
4
|
+
*/
|
|
5
|
+
export declare const MermaidFullscreenViewer: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
6
|
+
svg: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
open: {
|
|
11
|
+
type: BooleanConstructor;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("close" | "download")[], "close" | "download", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
17
|
+
svg: {
|
|
18
|
+
type: StringConstructor;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
open: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{
|
|
26
|
+
onClose?: ((...args: any[]) => any) | undefined;
|
|
27
|
+
onDownload?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
29
|
+
//# sourceMappingURL=MermaidFullscreenViewer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MermaidFullscreenViewer.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/MermaidFullscreenViewer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAoBH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;iFAyOlC,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid 组件图标 (Vue)
|
|
3
|
+
*/
|
|
4
|
+
/** 图片图标 */
|
|
5
|
+
export declare const ImageIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
/** 代码图标 */
|
|
9
|
+
export declare const CodeIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
12
|
+
/** 放大图标 */
|
|
13
|
+
export declare const ZoomInIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
16
|
+
/** 缩小图标 */
|
|
17
|
+
export declare const ZoomOutIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
/** 重置图标 */
|
|
21
|
+
export declare const ResetIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
/** 全屏图标 */
|
|
25
|
+
export declare const FullscreenIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
/** 退出全屏图标 */
|
|
29
|
+
export declare const FullscreenExitIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
32
|
+
/** 下载图标 */
|
|
33
|
+
export declare const DownloadIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
/** 关闭图标 */
|
|
37
|
+
export declare const CloseIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
40
|
+
/** 复制图标 */
|
|
41
|
+
export declare const CopyIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
44
|
+
/** 复制成功图标 */
|
|
45
|
+
export declare const CheckIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
46
|
+
[key: string]: any;
|
|
47
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
48
|
+
/** 适应窗口图标 */
|
|
49
|
+
export declare const FitIcon: import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
52
|
+
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/icons.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,WAAW;AACX,eAAO,MAAM,SAAS;;2OAYpB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,QAAQ;;2OAYnB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,UAAU;;2OAYrB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,WAAW;;2OAYtB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,SAAS;;2OAYpB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,cAAc;;2OAYzB,CAAC;AAEH,aAAa;AACb,eAAO,MAAM,kBAAkB;;2OAY7B,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,YAAY;;2OAYvB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,SAAS;;2OAYpB,CAAC;AAEH,WAAW;AACX,eAAO,MAAM,QAAQ;;2OAYnB,CAAC;AAEH,aAAa;AACb,eAAO,MAAM,SAAS;;2OAYpB,CAAC;AAEH,aAAa;AACb,eAAO,MAAM,OAAO;;2OAYlB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mermaid 组件导出 (Vue)
|
|
3
|
+
*/
|
|
4
|
+
export { MermaidBlock } from './MermaidBlock';
|
|
5
|
+
export { MermaidFullscreenViewer } from './MermaidFullscreenViewer';
|
|
6
|
+
export { useZoom } from './useZoom';
|
|
7
|
+
export type { MermaidBlockProps, MermaidFullscreenViewerProps, ViewMode, ZoomConfig, ZoomState, } from './types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,QAAQ,EACR,UAAU,EACV,SAAS,GACV,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MermaidTheme } from '@superlc/md-core';
|
|
2
|
+
|
|
3
|
+
/** 视图模式 */
|
|
4
|
+
export type ViewMode = 'preview' | 'code';
|
|
5
|
+
/** 缩放状态 */
|
|
6
|
+
export interface ZoomState {
|
|
7
|
+
scale: number;
|
|
8
|
+
translateX: number;
|
|
9
|
+
translateY: number;
|
|
10
|
+
}
|
|
11
|
+
/** 缩放配置 */
|
|
12
|
+
export interface ZoomConfig {
|
|
13
|
+
min: number;
|
|
14
|
+
max: number;
|
|
15
|
+
step: number;
|
|
16
|
+
default: number;
|
|
17
|
+
}
|
|
18
|
+
/** MermaidBlock Props */
|
|
19
|
+
export interface MermaidBlockProps {
|
|
20
|
+
/** Mermaid 源代码 */
|
|
21
|
+
code: string;
|
|
22
|
+
/** 主题 */
|
|
23
|
+
theme?: MermaidTheme | 'auto';
|
|
24
|
+
/** 是否显示工具栏 */
|
|
25
|
+
showToolbar?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** MermaidFullscreenViewer Props */
|
|
28
|
+
export interface MermaidFullscreenViewerProps {
|
|
29
|
+
/** SVG 内容 */
|
|
30
|
+
svg: string;
|
|
31
|
+
/** 是否显示 */
|
|
32
|
+
open: boolean;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,WAAW;AACX,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1C,WAAW;AACX,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,WAAW;AACX,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,yBAAyB;AACzB,MAAM,WAAW,iBAAiB;IAChC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS;IACT,KAAK,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC9B,cAAc;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,oCAAoC;AACpC,MAAM,WAAW,4BAA4B;IAC3C,aAAa;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW;IACX,IAAI,EAAE,OAAO,CAAC;CACf"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Ref, CSSProperties } from 'vue';
|
|
2
|
+
import { ZoomState, ZoomConfig } from './types';
|
|
3
|
+
|
|
4
|
+
export interface UseZoomOptions {
|
|
5
|
+
config?: Partial<ZoomConfig>;
|
|
6
|
+
enableDrag?: boolean;
|
|
7
|
+
enableWheelZoom?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface UseZoomReturn {
|
|
10
|
+
state: Ref<ZoomState>;
|
|
11
|
+
zoomIn: () => void;
|
|
12
|
+
zoomOut: () => void;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
fitToContainer: (containerRect: DOMRect, contentRect: DOMRect) => void;
|
|
15
|
+
setScale: (scale: number) => void;
|
|
16
|
+
canZoomIn: Ref<boolean>;
|
|
17
|
+
canZoomOut: Ref<boolean>;
|
|
18
|
+
contentStyle: Ref<CSSProperties>;
|
|
19
|
+
onMouseDown: (e: MouseEvent) => void;
|
|
20
|
+
onWheel: (e: WheelEvent) => void;
|
|
21
|
+
onDoubleClick: () => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function useZoom(options?: UseZoomOptions): UseZoomReturn;
|
|
24
|
+
//# sourceMappingURL=useZoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoom.d.ts","sourceRoot":"","sources":["../../../src/components/mermaid/useZoom.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAyC,KAAK,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,KAAK,CAAC;AAC1F,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AASrD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,cAAc,EAAE,CAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACxB,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,YAAY,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;IACjC,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CA4InE"}
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var E=Object.create;var O=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var _=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var W=(e,r,n,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of H(r))!$.call(e,i)&&i!==n&&O(e,i,{get:()=>r[i],enumerable:!(t=I(r,i))||t.enumerable});return e};var z=(e,r,n)=>(n=e!=null?E(_(e)):{},W(r||!e||!e.__esModule?O(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("vue"),N=require("@superlc/md-core");let b=!1,w=null;async function D(){if(!b)return w||(w=(async()=>{await import("katex/dist/katex.min.css"),b=!0})(),w)}function G(){return b}function U(){return D()}const j=a.defineComponent({name:"Markdown",props:{content:{type:String,required:!0},class:{type:String,default:""},gfm:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},math:{type:Boolean,default:!1},components:{type:Object,default:()=>({})},remarkPlugins:{type:Array,default:()=>[]},rehypePlugins:{type:Array,default:()=>[]}},setup(e){a.watch(()=>e.math,t=>{t&&U()},{immediate:!0});function r(t,i={}){if(t.type==="text")return t.value;if(t.type==="comment")return null;if(t.type==="root"){const l=t.children.map(s=>r(s,i)).filter(s=>s!==null);return a.h("div",{class:e.class},l)}if(t.type==="element"){const{tagName:l,properties:s,children:o}=t,c=i[l]||l,d={};if(s)for(const[m,u]of Object.entries(s))m==="className"?d.class=Array.isArray(u)?u.join(" "):u:d[m]=u;const p=o.map(m=>r(m,i)).filter(m=>m!==null);return typeof c=="string"?a.h(c,d,p):a.h(c,d,()=>p)}return null}const n=a.computed(()=>{if(!e.content)return null;const t=N.parseToHast(e.content,{gfm:e.gfm,highlight:e.highlight,math:e.math,remarkPlugins:e.remarkPlugins,rehypePlugins:e.rehypePlugins});return r(t,e.components)});return()=>n.value?n.value:null}});function M(e,r){if(e.type==="text")return e.value;if(e.type==="root"){const n=e.children.map(t=>M(t,r)).filter(t=>t!==null);return a.h("div",{},n)}if(e.type==="element"){const n=e,t=n.tagName,i=r==null?void 0:r[t],l={...n.properties};l.className&&(l.class=Array.isArray(l.className)?l.className.join(" "):l.className,delete l.className);const s=n.children.map(o=>M(o,r)).filter(o=>o!==null);return i?a.h(i,l,()=>s):a.h(t,l,s)}return null}function J(e={}){const{components:r,minUpdateInterval:n=16,immediate:t=!1,outputRate:i="medium",...l}=e,s=N.createStreamingParser(l),o=new N.OutputRateController(i),c=a.ref(0),d=a.ref(!1),p=a.ref(0),m=a.ref("idle");let u=0,f=null;const v=()=>{const g=performance.now(),C=g-u;t||C>=n?(u=g,c.value++):f===null&&(f=requestAnimationFrame(()=>{f=null,u=performance.now(),c.value++}))},h=g=>{s.append(g),v()},y=g=>{s.reset(),d.value=!1,p.value=0,m.value="running",o.start(g,C=>{C&&s.append(C),p.value=o.progress,v()},()=>{s.finish(),d.value=!0,p.value=1,m.value="complete",v()})},A=()=>{o.pause(),m.value=o.status},S=()=>{o.resume(),m.value=o.status},F=()=>{o.skipToEnd(),m.value=o.status,p.value=1},R=()=>{o.stop(),s.finish(),d.value=!0,m.value="complete",f!==null&&(cancelAnimationFrame(f),f=null),c.value++},V=()=>{o.stop(),s.reset(),d.value=!1,p.value=0,m.value="idle",f!==null&&(cancelAnimationFrame(f),f=null),c.value++};a.onUnmounted(()=>{o.stop(),f!==null&&cancelAnimationFrame(f)});const q=a.computed(()=>(c.value,s.getState().blocks)),K=a.computed(()=>(c.value,s.getStats())),L=a.computed(()=>(c.value,s.getContent()));return{vnode:a.computed(()=>{c.value;const g=s.getState();if(g.blocks.length===0)return null;const C=g.blocks.map(k=>k.hast?a.h("div",{key:k.key,"data-block-key":k.key,"data-pending":!k.stable||void 0},[M(k.hast,r)]):null).filter(k=>k!==null);return a.h("div",{"data-streaming":!d.value},C)}),append:h,start:y,pause:A,resume:S,skipToEnd:F,reset:V,finish:R,blocks:q,stats:K,isComplete:d,content:L,progress:p,outputStatus:m}}function x(e,r){if(e.type==="text")return e.value;if(e.type==="root"){const n=e.children.map(t=>x(t,r)).filter(t=>t!==null);return a.h("div",{},n)}if(e.type==="element"){const n=e,t=n.tagName,i=r==null?void 0:r[t],l={...n.properties};l.className&&(l.class=Array.isArray(l.className)?l.className.join(" "):l.className,delete l.className);const s=n.children.map(o=>x(o,r)).filter(o=>o!==null);return i?a.h(i,l,()=>s):a.h(t,l,s)}return null}const B=a.defineComponent({name:"StreamingMarkdown",props:{content:{type:String,default:void 0},source:{type:String,default:void 0},outputRate:{type:[String,Object],default:"medium"},isComplete:{type:Boolean,default:!1},components:{type:Object,default:void 0},class:{type:String,default:void 0},minUpdateInterval:{type:Number,default:16},autoStart:{type:Boolean,default:!0},gfm:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},math:{type:Boolean,default:!1}},emits:["complete","blockStable","progress"],setup(e,{emit:r}){a.watch(()=>e.math,u=>{u&&U()},{immediate:!0});const n=N.createStreamingParser({gfm:e.gfm,highlight:e.highlight,math:e.math}),t=new N.OutputRateController(e.outputRate),i=a.ref(0),l=a.ref(""),s=a.ref(void 0),o=a.ref([]),c=a.ref(!1);let d=0,p=null;const m=()=>{const u=performance.now();u-d>=e.minUpdateInterval?(d=u,i.value++):p===null&&(p=requestAnimationFrame(()=>{p=null,d=performance.now(),i.value++}))};return a.watch(()=>e.source,u=>{u!==void 0&&u!==s.value&&(s.value=u,e.autoStart&&u&&(n.reset(),l.value="",c.value=!1,t.start(u,f=>{f&&(n.append(f),l.value+=f),r("progress",t.progress),m()},()=>{n.finish(),c.value=!0,r("complete"),m()})))},{immediate:!0}),a.watch(()=>e.content,u=>{if(e.source!==void 0)return;const f=l.value,v=u||"";if(v!==f){if(v.startsWith(f)){const y=v.slice(f.length);y&&n.append(y)}else n.reset(),v&&n.append(v);l.value=v,m();const h=n.getState().blocks;h.forEach((y,A)=>{const S=o.value[A];y.stable&&(!S||!S.stable)&&r("blockStable",y)}),o.value=h}},{immediate:!0}),a.watch(()=>e.isComplete,u=>{e.source===void 0&&u&&(n.finish(),p!==null&&(cancelAnimationFrame(p),p=null),i.value++,r("complete"))}),a.watch(()=>e.outputRate,u=>{t.setRate(u)}),a.onUnmounted(()=>{t.stop(),p!==null&&cancelAnimationFrame(p)}),()=>{i.value;const u=n.getState(),f=e.source!==void 0?c.value:e.isComplete,v=u.blocks.map(h=>h.hast?a.h("div",{key:h.key,"data-block-key":h.key,"data-pending":!h.stable||void 0},[x(h.hast,e.components)]):null).filter(h=>h!==null);return a.h("div",{class:e.class,"data-streaming":!f},v)}}});function P(e,r={}){if(e.type==="text")return e.value;if(e.type==="comment")return null;if(e.type==="root"){const n=e.children.map(t=>P(t,r)).filter(t=>t!==null);return a.h("div",{},n)}if(e.type==="element"){const{tagName:n,properties:t,children:i}=e,l=r[n]||n,s={};if(t)for(const[c,d]of Object.entries(t))c==="className"?s.class=Array.isArray(d)?d.join(" "):d:s[c]=d;const o=i.map(c=>P(c,r)).filter(c=>c!==null);return a.h(l,s,()=>o)}return null}function Q(e,r={}){const{components:n={},...t}=r;return a.computed(()=>{const i=e();if(!i)return null;const l=N.parseToHast(i,t);return P(l,n)})}function T(e){e.component("Markdown",j),e.component("StreamingMarkdown",B)}const X={install:T,Markdown:j,StreamingMarkdown:B};exports.Markdown=j;exports.StreamingMarkdown=B;exports.default=X;exports.install=T;exports.isKatexCssLoaded=G;exports.preloadKatexCss=U;exports.useMarkdown=Q;exports.useStreamingMarkdown=J;
|
|
1
|
+
"use strict";var G=Object.create;var j=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ne=(t,n,l,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of Q(n))!te.call(t,o)&&o!==l&&j(t,o,{get:()=>n[o],enumerable:!(r=J(n,o))||r.enumerable});return t};var ae=(t,n,l)=>(l=t!=null?G(ee(t)):{},ne(n||!t||!t.__esModule?j(l,"default",{value:t,enumerable:!0}):l,t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),M=require("@superlc/md-core");let F=!1,H=null;async function le(){if(!F)return H||(H=(async()=>{await import("katex/dist/katex.min.css"),F=!0})(),H)}function oe(){return F}function O(){return le()}async function re(t){try{return await navigator.clipboard.writeText(t),!0}catch{return se(t)}}function se(t){const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(n)}}const ue=()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[e.h("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"})]),ce=()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},[e.h("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})]);function P(t){return typeof t=="string"?t:Array.isArray(t)?t.map(n=>typeof n=="string"?n:n&&typeof n=="object"&&"children"in n?P(n.children):"").join(""):""}const D=e.defineComponent({name:"CodeBlock",props:{showCopyButton:{type:Boolean,default:!0}},emits:["copy"],setup(t,{slots:n,emit:l}){const r=e.ref(!1),o=async()=>{var u;const a=(u=n.default)==null?void 0:u.call(n),s=a?P(a):"";await re(s)&&(r.value=!0,l("copy",s),setTimeout(()=>{r.value=!1},2e3))};return()=>{var s;const a=(s=n.default)==null?void 0:s.call(n);return e.h("div",{class:"md-code-block-wrapper"},[e.h("pre",{},a),t.showCopyButton&&e.h("button",{type:"button",class:`md-copy-button${r.value?" md-copy-button--copied":""}`,onClick:o,title:r.value?"已复制":"复制代码","aria-label":r.value?"已复制":"复制代码"},[r.value?e.h(ce):e.h(ue)])])}}}),ie={min:.25,max:4,step:.25,default:1};function R(t={}){const{config:n,enableDrag:l=!1,enableWheelZoom:r=!1}=t,o={...ie,...n},a=e.ref({scale:o.default,translateX:0,translateY:0}),s=e.ref(!1),c=e.ref({x:0,y:0}),u=e.ref({x:0,y:0}),d=y=>Math.max(o.min,Math.min(o.max,y)),v=e.computed(()=>a.value.scale<o.max),p=e.computed(()=>a.value.scale>o.min),m=()=>{a.value={...a.value,scale:d(a.value.scale+o.step)}},i=()=>{a.value={...a.value,scale:d(a.value.scale-o.step)}},h=()=>{a.value={scale:o.default,translateX:0,translateY:0}},C=y=>{a.value={...a.value,scale:d(y)}},f=(y,x)=>{const N=y.width/x.width,k=y.height/x.height,I=Math.min(N,k)*.95;a.value={scale:d(I),translateX:0,translateY:0}},z=y=>{l&&(y.preventDefault(),s.value=!0,c.value={x:y.clientX,y:y.clientY},u.value={x:a.value.translateX,y:a.value.translateY})},w=y=>{if(!s.value)return;const x=y.clientX-c.value.x,N=y.clientY-c.value.y;a.value={...a.value,translateX:u.value.x+x,translateY:u.value.y+N}},g=()=>{s.value=!1},b=y=>{if(!r)return;y.preventDefault();const x=y.deltaY>0?-o.step:o.step;a.value={...a.value,scale:d(a.value.scale+x)}},B=()=>{h()},S=e.computed(()=>({transform:`translate(${a.value.translateX}px, ${a.value.translateY}px) scale(${a.value.scale})`,transformOrigin:"center center",transition:s.value?"none":"transform 0.2s ease-out",cursor:l?s.value?"grabbing":"grab":"default"}));return e.onMounted(()=>{l&&(document.addEventListener("mousemove",w),document.addEventListener("mouseup",g))}),e.onUnmounted(()=>{l&&(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",g))}),{state:a,zoomIn:m,zoomOut:i,reset:h,fitToContainer:f,setScale:C,canZoomIn:v,canZoomOut:p,contentStyle:S,onMouseDown:z,onWheel:b,onDoubleClick:B}}const de=e.defineComponent({name:"ImageIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z"}))}}),me=e.defineComponent({name:"CodeIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M9.4 16.6L4.8 12l4.6-4.6L8 6l-6 6 6 6 1.4-1.4zm5.2 0l4.6-4.6-4.6-4.6L16 6l6 6-6 6-1.4-1.4z"}))}}),$=e.defineComponent({name:"ZoomInIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm.5-7H9v2H7v1h2v2h1v-2h2V9h-2V7z"}))}}),q=e.defineComponent({name:"ZoomOutIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7V9z"}))}}),Y=e.defineComponent({name:"ResetIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"}))}}),ve=e.defineComponent({name:"FullscreenIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"}))}}),fe=e.defineComponent({name:"FullscreenExitIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}))}}),X=e.defineComponent({name:"DownloadIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z"}))}}),he=e.defineComponent({name:"CloseIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}))}}),pe=e.defineComponent({name:"CopyIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))}}),ye=e.defineComponent({name:"CheckIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"}))}});e.defineComponent({name:"FitIcon",setup(){return()=>e.h("svg",{viewBox:"0 0 24 24",fill:"currentColor"},e.h("path",{d:"M3 5v4h2V5h4V3H5c-1.1 0-2 .9-2 2zm2 10H3v4c0 1.1.9 2 2 2h4v-2H5v-4zm14 4h-4v2h4c1.1 0 2-.9 2-2v-4h-2v4zm0-16h-4v2h4v4h2V5c0-1.1-.9-2-2-2z"}))}});const K=e.defineComponent({name:"MermaidFullscreenViewer",props:{svg:{type:String,required:!0},open:{type:Boolean,required:!0}},emits:["close","download"],setup(t,{emit:n}){const l=e.ref(null),r=e.ref(null),o=e.ref(null),a=e.ref(!1),{state:s,zoomIn:c,zoomOut:u,reset:d,fitToContainer:v,canZoomIn:p,canZoomOut:m,contentStyle:i,onMouseDown:h,onWheel:C,onDoubleClick:f}=R({enableDrag:!0,enableWheelZoom:!0}),z=async()=>{if(l.value)try{await l.value.requestFullscreen(),a.value=!0}catch{a.value=!0}},w=()=>{document.fullscreenElement&&document.exitFullscreen().catch(()=>{}),a.value=!1,n("close")};e.watch(()=>t.open,S=>{S?z():a.value&&w()});const g=()=>{!document.fullscreenElement&&a.value&&(a.value=!1,n("close"))},b=S=>{if(a.value)switch(S.key){case"+":case"=":c();break;case"-":u();break;case"0":d();break}};e.onMounted(()=>{document.addEventListener("fullscreenchange",g),document.addEventListener("keydown",b)}),e.onUnmounted(()=>{document.removeEventListener("fullscreenchange",g),document.removeEventListener("keydown",b)});const B=()=>{if(!r.value||!o.value)return;const S=r.value.getBoundingClientRect(),y=o.value.querySelector("svg");if(y){const x=y.getBoundingClientRect();v(S,x)}};return()=>e.h("div",{ref:l,class:["md-mermaid-fullscreen-wrapper",a.value&&"md-mermaid-fullscreen-wrapper--active"],role:"dialog","aria-modal":"true","aria-label":"Mermaid 图表全屏预览","aria-hidden":!a.value},a.value?[e.h("div",{class:"md-mermaid-fullscreen-toolbar"},[e.h("div",{class:"md-mermaid-toolbar-group"},[e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:u,disabled:!m.value,title:"缩小 (-)","aria-label":"缩小"},e.h(q)),e.h("span",{class:"md-mermaid-zoom-label"},`${Math.round(s.value.scale*100)}%`),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:c,disabled:!p.value,title:"放大 (+)","aria-label":"放大"},e.h($)),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:d,title:"重置 (0)","aria-label":"重置"},e.h(Y)),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:B,title:"适应窗口","aria-label":"适应窗口"},e.h(fe))]),e.h("div",{class:"md-mermaid-toolbar-group"},[e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:()=>n("download"),title:"下载 PNG","aria-label":"下载"},e.h(X)),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:w,title:"退出全屏 (Esc)","aria-label":"退出全屏"},e.h(he))])]),e.h("div",{ref:r,class:"md-mermaid-fullscreen-content",onWheel:C},e.h("div",{ref:o,class:"md-mermaid-fullscreen-svg",style:i.value,onMousedown:h,onDblclick:f,innerHTML:t.svg}))]:void 0)}});let L=null;function ge(t="auto"){return L?L.setTheme(t??"auto"):L=new M.MermaidRenderer({theme:t}),L}async function be(t){try{return await navigator.clipboard.writeText(t),!0}catch{const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.left="-9999px",document.body.appendChild(n),n.select();try{return document.execCommand("copy"),!0}catch{return!1}finally{document.body.removeChild(n)}}}const W=e.defineComponent({name:"MermaidBlock",props:{code:{type:String,required:!0},theme:{type:String,default:"auto"},showToolbar:{type:Boolean,default:!0}},emits:["copy"],setup(t,{emit:n}){const l=e.ref("preview"),r=e.ref(null),o=e.ref(!0),a=e.ref(!1),s=e.ref(!1),c=e.ref(M.detectColorScheme()),{state:u,zoomIn:d,zoomOut:v,reset:p,canZoomIn:m,canZoomOut:i,contentStyle:h}=R(),C=e.computed(()=>{var g;return((g=r.value)==null?void 0:g.success)&&r.value.svg});let f=null;e.onMounted(()=>{t.theme==="auto"&&(f=M.observeColorScheme(g=>{c.value=g}))}),e.onUnmounted(()=>{f==null||f()}),e.watch(()=>[t.code,t.theme,c.value],async()=>{o.value=!0;const b=await ge(t.theme).render(t.code);r.value=b,o.value=!1,b.success||(l.value="code")},{immediate:!0});const z=async()=>{await be(t.code)&&(s.value=!0,n("copy",t.code),setTimeout(()=>s.value=!1,2e3))},w=async()=>{var g,b;if((g=r.value)!=null&&g.svg)try{const B=((b=window.matchMedia)==null?void 0:b.call(window,"(prefers-color-scheme: dark)").matches)??!1;await M.downloadAsPng(r.value.svg,{backgroundColor:B?"#1a1a2e":"#ffffff",padding:20,scale:2})}catch(B){console.error("Download failed:",B)}};return()=>{const g=t.showToolbar?e.h("div",{class:"md-mermaid-toolbar"},[e.h("div",{class:"md-mermaid-toolbar-group md-mermaid-mode-switch"},[e.h("button",{type:"button",class:`md-mermaid-toolbar-btn${l.value==="preview"?" md-mermaid-toolbar-btn--active":""}`,onClick:()=>l.value="preview",disabled:!C.value,title:"图片模式","aria-label":"图片模式"},e.h(de)),e.h("button",{type:"button",class:`md-mermaid-toolbar-btn${l.value==="code"?" md-mermaid-toolbar-btn--active":""}`,onClick:()=>l.value="code",title:"代码模式","aria-label":"代码模式"},e.h(me))]),l.value==="preview"&&C.value?e.h("div",{class:"md-mermaid-toolbar-group"},[e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:v,disabled:!i.value,title:"缩小","aria-label":"缩小"},e.h(q)),e.h("span",{class:"md-mermaid-zoom-label"},`${Math.round(u.value.scale*100)}%`),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:d,disabled:!m.value,title:"放大","aria-label":"放大"},e.h($)),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:p,title:"重置","aria-label":"重置缩放"},e.h(Y))]):null,e.h("div",{class:"md-mermaid-toolbar-group"},[l.value==="preview"&&C.value?[e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:()=>a.value=!0,title:"全屏","aria-label":"全屏查看"},e.h(ve)),e.h("button",{type:"button",class:"md-mermaid-toolbar-btn",onClick:w,title:"下载 PNG","aria-label":"下载"},e.h(X))]:null,l.value==="code"?e.h("button",{type:"button",class:`md-mermaid-toolbar-btn${s.value?" md-mermaid-toolbar-btn--success":""}`,onClick:z,title:s.value?"已复制":"复制代码","aria-label":s.value?"已复制":"复制代码"},s.value?e.h(ye):e.h(pe)):null])]):null;let b;return o.value?b=e.h("div",{class:"md-mermaid-skeleton"},[e.h("div",{class:"md-mermaid-skeleton-box"})]):l.value==="preview"&&C.value?b=e.h("div",{class:"md-mermaid-preview",style:{overflow:"hidden"}},[e.h("div",{class:"md-mermaid-svg-container",style:h.value,innerHTML:r.value.svg})]):b=e.h("div",{class:"md-mermaid-code"},[e.h("pre",[e.h("code",{class:"language-mermaid"},t.code)]),r.value&&!r.value.success?e.h("div",{class:"md-mermaid-error"},[e.h("span","渲染失败: "),e.h("span",r.value.error)]):null]),e.h("div",{class:"md-mermaid-block"},[g,e.h("div",{class:"md-mermaid-content"},[b]),C.value?e.h(K,{svg:r.value.svg,open:a.value,onClose:()=>a.value=!1,onDownload:w}):null])}}});function Ce(t){var r;if(t.tagName!=="pre")return!1;const n=t.children.find(o=>o.type==="element"&&o.tagName==="code");if(!n)return!1;const l=(r=n.properties)==null?void 0:r.className;return Array.isArray(l)?l.some(o=>typeof o=="string"&&o.includes("language-mermaid")):typeof l=="string"&&l.includes("language-mermaid")}function we(t){const n=t.children.find(l=>l.type==="element"&&l.tagName==="code");return n?n.children.map(l=>l.type==="text"?l.value:"").join(""):""}function ke(t){return t?t===!0?{enabled:!0}:t.enabled!==!1?t:null:null}const U=e.defineComponent({name:"Markdown",props:{content:{type:String,required:!0},class:{type:String,default:""},gfm:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},math:{type:Boolean,default:!1},components:{type:Object,default:()=>({})},remarkPlugins:{type:Array,default:()=>[]},rehypePlugins:{type:Array,default:()=>[]},copyButton:{type:Boolean,default:!0},mermaid:{type:[Boolean,Object],default:!1}},emits:["codeCopy"],setup(t,{emit:n}){e.watch(()=>t.math,o=>{o&&O()},{immediate:!0});function l(o,a={},s=null){if(o.type==="text")return o.value;if(o.type==="comment")return null;if(o.type==="root"){const c=o.children.map(u=>l(u,a,s)).filter(u=>u!==null);return e.h("div",{class:t.class},c)}if(o.type==="element"){const{tagName:c,properties:u,children:d}=o;if(s&&Ce(o)){const i=we(o);return e.h(W,{code:i,theme:s.theme,onCopy:h=>n("codeCopy",h)})}const v=a[c]||c,p={};if(u)for(const[i,h]of Object.entries(u))i==="className"?p.class=Array.isArray(h)?h.join(" "):h:p[i]=h;const m=d.map(i=>l(i,a,s)).filter(i=>i!==null);return typeof v=="string"?e.h(v,p,m):e.h(v,p,()=>m)}return null}const r=e.computed(()=>{if(!t.content)return null;const o=M.parseToHast(t.content,{gfm:t.gfm,highlight:t.highlight,math:t.math,remarkPlugins:t.remarkPlugins,rehypePlugins:t.rehypePlugins}),a=ke(t.mermaid),s={...t.copyButton?{pre:e.defineComponent({setup(c,{slots:u}){return()=>e.h(D,{showCopyButton:t.copyButton,onCopy:d=>n("codeCopy",d)},u.default)}})}:{},...t.components};return l(o,s,a)});return()=>r.value?r.value:null}});function T(t,n){if(t.type==="text")return t.value;if(t.type==="root"){const l=t.children.map(r=>T(r,n)).filter(r=>r!==null);return e.h("div",{},l)}if(t.type==="element"){const l=t,r=l.tagName,o=n==null?void 0:n[r],a={...l.properties};a.className&&(a.class=Array.isArray(a.className)?a.className.join(" "):a.className,delete a.className);const s=l.children.map(c=>T(c,n)).filter(c=>c!==null);return o?e.h(o,a,()=>s):e.h(r,a,s)}return null}function xe(t={}){const{components:n,minUpdateInterval:l=16,immediate:r=!1,outputRate:o="medium",...a}=t,s=M.createStreamingParser(a),c=new M.OutputRateController(o),u=e.ref(0),d=e.ref(!1),v=e.ref(0),p=e.ref("idle");let m=0,i=null;const h=()=>{const k=performance.now(),I=k-m;r||I>=l?(m=k,u.value++):i===null&&(i=requestAnimationFrame(()=>{i=null,m=performance.now(),u.value++}))},C=k=>{s.append(k),h()},f=k=>{s.reset(),d.value=!1,v.value=0,p.value="running",c.start(k,I=>{I&&s.append(I),v.value=c.progress,h()},()=>{s.finish(),d.value=!0,v.value=1,p.value="complete",h()})},z=()=>{c.pause(),p.value=c.status},w=()=>{c.resume(),p.value=c.status},g=()=>{c.skipToEnd(),p.value=c.status,v.value=1},b=()=>{c.stop(),s.finish(),d.value=!0,p.value="complete",i!==null&&(cancelAnimationFrame(i),i=null),u.value++},B=()=>{c.stop(),s.reset(),d.value=!1,v.value=0,p.value="idle",i!==null&&(cancelAnimationFrame(i),i=null),u.value++};e.onUnmounted(()=>{c.stop(),i!==null&&cancelAnimationFrame(i)});const S=e.computed(()=>(u.value,s.getState().blocks)),y=e.computed(()=>(u.value,s.getStats())),x=e.computed(()=>(u.value,s.getContent()));return{vnode:e.computed(()=>{u.value;const k=s.getState();if(k.blocks.length===0)return null;const I=k.blocks.map(V=>V.hast?e.h("div",{key:V.key,"data-block-key":V.key,"data-pending":!V.stable||void 0},[T(V.hast,n)]):null).filter(V=>V!==null);return e.h("div",{"data-streaming":!d.value},I)}),append:C,start:f,pause:z,resume:w,skipToEnd:g,reset:B,finish:b,blocks:S,stats:y,isComplete:d,content:x,progress:v,outputStatus:p}}function A(t,n,l,r,o){if(t.type==="text")return t.value;if(t.type==="root"){const a=t.children.map(s=>A(s,n,l,r,o)).filter(s=>s!==null);return e.h("div",{},a)}if(t.type==="element"){const a=t,s=a.tagName,c=n==null?void 0:n[s],u={...a.properties};u.className&&(u.class=Array.isArray(u.className)?u.className.join(" "):u.className,delete u.className);const d=a.children.map(v=>A(v,n,l,r,o)).filter(v=>v!==null);return s==="pre"&&l&&!c?e.h(D,{showCopyButton:o&&l,onCopy:r},()=>d):c?e.h(c,u,()=>d):e.h(s,u,d)}return null}const Z=e.defineComponent({name:"StreamingMarkdown",props:{content:{type:String,default:void 0},source:{type:String,default:void 0},outputRate:{type:[String,Object],default:"medium"},isComplete:{type:Boolean,default:!1},components:{type:Object,default:void 0},class:{type:String,default:void 0},minUpdateInterval:{type:Number,default:16},autoStart:{type:Boolean,default:!0},gfm:{type:Boolean,default:!0},highlight:{type:Boolean,default:!0},math:{type:Boolean,default:!1},copyButton:{type:Boolean,default:!0}},emits:["complete","blockStable","progress","codeCopy"],setup(t,{emit:n}){e.watch(()=>t.math,m=>{m&&O()},{immediate:!0});const l=M.createStreamingParser({gfm:t.gfm,highlight:t.highlight,math:t.math}),r=new M.OutputRateController(t.outputRate),o=e.ref(0),a=e.ref(""),s=e.ref(void 0),c=e.ref([]),u=e.ref(!1);let d=0,v=null;const p=()=>{const m=performance.now();m-d>=t.minUpdateInterval?(d=m,o.value++):v===null&&(v=requestAnimationFrame(()=>{v=null,d=performance.now(),o.value++}))};return e.watch(()=>t.source,m=>{m!==void 0&&m!==s.value&&(s.value=m,t.autoStart&&m&&(l.reset(),a.value="",u.value=!1,r.start(m,i=>{i&&(l.append(i),a.value+=i),n("progress",r.progress),p()},()=>{l.finish(),u.value=!0,n("complete"),p()})))},{immediate:!0}),e.watch(()=>t.content,m=>{if(t.source!==void 0)return;const i=a.value,h=m||"";if(h!==i){if(h.startsWith(i)){const f=h.slice(i.length);f&&l.append(f)}else l.reset(),h&&l.append(h);a.value=h,p();const C=l.getState().blocks;C.forEach((f,z)=>{const w=c.value[z];f.stable&&(!w||!w.stable)&&n("blockStable",f)}),c.value=C}},{immediate:!0}),e.watch(()=>t.isComplete,m=>{t.source===void 0&&m&&(l.finish(),v!==null&&(cancelAnimationFrame(v),v=null),o.value++,n("complete"))}),e.watch(()=>t.outputRate,m=>{r.setRate(m)}),e.onUnmounted(()=>{r.stop(),v!==null&&cancelAnimationFrame(v)}),()=>{o.value;const m=l.getState(),i=t.source!==void 0?u.value:t.isComplete,h=f=>n("codeCopy",f),C=m.blocks.map(f=>f.hast?e.h("div",{key:f.key,"data-block-key":f.key,"data-pending":!f.stable||void 0},[A(f.hast,t.components,t.copyButton,h,f.stable)]):null).filter(f=>f!==null);return e.h("div",{class:t.class,"data-streaming":!i},C)}}});function E(t,n={}){if(t.type==="text")return t.value;if(t.type==="comment")return null;if(t.type==="root"){const l=t.children.map(r=>E(r,n)).filter(r=>r!==null);return e.h("div",{},l)}if(t.type==="element"){const{tagName:l,properties:r,children:o}=t,a=n[l]||l,s={};if(r)for(const[u,d]of Object.entries(r))u==="className"?s.class=Array.isArray(d)?d.join(" "):d:s[u]=d;const c=o.map(u=>E(u,n)).filter(u=>u!==null);return e.h(a,s,()=>c)}return null}function Me(t,n={}){const{components:l={},...r}=n;return e.computed(()=>{const o=t();if(!o)return null;const a=M.parseToHast(o,r);return E(a,l)})}function _(t){t.component("Markdown",U),t.component("StreamingMarkdown",Z)}const ze={install:_,Markdown:U,StreamingMarkdown:Z};exports.CodeBlock=D;exports.Markdown=U;exports.MermaidBlock=W;exports.MermaidFullscreenViewer=K;exports.StreamingMarkdown=Z;exports.default=ze;exports.install=_;exports.isKatexCssLoaded=oe;exports.preloadKatexCss=O;exports.useMarkdown=Me;exports.useStreamingMarkdown=xe;exports.useZoom=R;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { Markdown } from './Markdown';
|
|
|
3
3
|
|
|
4
4
|
export { Markdown };
|
|
5
5
|
export { useMarkdown } from './useMarkdown';
|
|
6
|
-
export
|
|
6
|
+
export { CodeBlock, MermaidBlock, MermaidFullscreenViewer, useZoom } from './components';
|
|
7
|
+
export type { CodeBlockProps, MermaidBlockProps, MermaidFullscreenViewerProps, ViewMode, ZoomConfig, ZoomState, } from './components';
|
|
8
|
+
export type { MarkdownProps, MarkdownComponents, UseMarkdownOptions, MermaidOptions } from './types';
|
|
7
9
|
export { useStreamingMarkdown, StreamingMarkdown } from './streaming';
|
|
8
10
|
export type { UseStreamingMarkdownOptions, UseStreamingMarkdownResult, StreamingMarkdownProps, StreamingMarkdownEmits, } from './streaming';
|
|
9
11
|
export { preloadKatexCss, isKatexCssLoaded } from './MathProvider';
|
|
@@ -47,9 +49,17 @@ declare const _default: {
|
|
|
47
49
|
type: import('vue').PropType<import('@superlc/md-core').PluginConfig[]>;
|
|
48
50
|
default: () => never[];
|
|
49
51
|
};
|
|
52
|
+
copyButton: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
mermaid: {
|
|
57
|
+
type: import('vue').PropType<boolean | import('./types').MermaidOptions>;
|
|
58
|
+
default: boolean;
|
|
59
|
+
};
|
|
50
60
|
}>, () => string | import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
51
61
|
[key: string]: any;
|
|
52
|
-
}> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin,
|
|
62
|
+
}> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, "codeCopy"[], "codeCopy", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
53
63
|
content: {
|
|
54
64
|
type: StringConstructor;
|
|
55
65
|
required: true;
|
|
@@ -82,9 +92,21 @@ declare const _default: {
|
|
|
82
92
|
type: import('vue').PropType<import('@superlc/md-core').PluginConfig[]>;
|
|
83
93
|
default: () => never[];
|
|
84
94
|
};
|
|
85
|
-
|
|
95
|
+
copyButton: {
|
|
96
|
+
type: BooleanConstructor;
|
|
97
|
+
default: boolean;
|
|
98
|
+
};
|
|
99
|
+
mermaid: {
|
|
100
|
+
type: import('vue').PropType<boolean | import('./types').MermaidOptions>;
|
|
101
|
+
default: boolean;
|
|
102
|
+
};
|
|
103
|
+
}>> & Readonly<{
|
|
104
|
+
onCodeCopy?: ((...args: any[]) => any) | undefined;
|
|
105
|
+
}>, {
|
|
86
106
|
components: import('./types').MarkdownComponents;
|
|
87
107
|
class: string;
|
|
108
|
+
copyButton: boolean;
|
|
109
|
+
mermaid: boolean | import('./types').MermaidOptions;
|
|
88
110
|
gfm: boolean;
|
|
89
111
|
highlight: boolean;
|
|
90
112
|
math: boolean;
|
|
@@ -136,9 +158,13 @@ declare const _default: {
|
|
|
136
158
|
type: BooleanConstructor;
|
|
137
159
|
default: boolean;
|
|
138
160
|
};
|
|
161
|
+
copyButton: {
|
|
162
|
+
type: BooleanConstructor;
|
|
163
|
+
default: boolean;
|
|
164
|
+
};
|
|
139
165
|
}>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
140
166
|
[key: string]: any;
|
|
141
|
-
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("progress" | "complete" | "blockStable")[], "progress" | "complete" | "blockStable", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
167
|
+
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("progress" | "codeCopy" | "complete" | "blockStable")[], "progress" | "codeCopy" | "complete" | "blockStable", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
142
168
|
content: {
|
|
143
169
|
type: StringConstructor;
|
|
144
170
|
default: undefined;
|
|
@@ -183,18 +209,24 @@ declare const _default: {
|
|
|
183
209
|
type: BooleanConstructor;
|
|
184
210
|
default: boolean;
|
|
185
211
|
};
|
|
212
|
+
copyButton: {
|
|
213
|
+
type: BooleanConstructor;
|
|
214
|
+
default: boolean;
|
|
215
|
+
};
|
|
186
216
|
}>> & Readonly<{
|
|
187
217
|
onProgress?: ((...args: any[]) => any) | undefined;
|
|
218
|
+
onCodeCopy?: ((...args: any[]) => any) | undefined;
|
|
188
219
|
onComplete?: ((...args: any[]) => any) | undefined;
|
|
189
220
|
onBlockStable?: ((...args: any[]) => any) | undefined;
|
|
190
221
|
}>, {
|
|
191
222
|
content: string;
|
|
192
223
|
components: import('./types').MarkdownComponents;
|
|
193
224
|
class: string;
|
|
225
|
+
copyButton: boolean;
|
|
226
|
+
source: string;
|
|
194
227
|
gfm: boolean;
|
|
195
228
|
highlight: boolean;
|
|
196
229
|
math: boolean;
|
|
197
|
-
source: string;
|
|
198
230
|
minUpdateInterval: number;
|
|
199
231
|
outputRate: import('@superlc/md-core').OutputRate;
|
|
200
232
|
isComplete: boolean;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,OAAO,EAAE,QAAQ,EAAE,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACzF,YAAY,EACV,cAAc,EACd,iBAAiB,EACjB,4BAA4B,EAC5B,QAAQ,EACR,UAAU,EACV,SAAS,GACV,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGrG,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACtE,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGnE,YAAY,EACV,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,WAAW,EACX,UAAU,EACV,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAGtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAED,wBAIE"}
|