ds-markdown 0.1.10-beta.2 → 0.1.10-beta.4
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/cjs/i18n/en/index.d.ts +1 -0
- package/dist/cjs/i18n/en/index.js +1 -0
- package/dist/cjs/i18n/en/index.js.map +1 -1
- package/dist/cjs/i18n/zh/index.d.ts +1 -0
- package/dist/cjs/i18n/zh/index.js +1 -0
- package/dist/cjs/i18n/zh/index.js.map +1 -1
- package/dist/cjs/index.d.ts +230 -218
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/i18n/en/index.d.ts +1 -0
- package/dist/esm/i18n/en/index.js +1 -0
- package/dist/esm/i18n/en/index.js.map +1 -1
- package/dist/esm/i18n/zh/index.d.ts +1 -0
- package/dist/esm/i18n/zh/index.js +1 -0
- package/dist/esm/i18n/zh/index.js.map +1 -1
- package/dist/esm/index.d.ts +230 -218
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/i18n/en/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAa,MAAA,IAAI,GAAG;AAClB,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,UAAU,EAAE,YAAY;AACzB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,UAAU,EAAE,aAAa;AACzB,QAAA,cAAc,EAAE,kBAAkB;AAClC,QAAA,aAAa,EAAE,gBAAgB;AAC/B,QAAA,eAAe,EAAE,YAAY;AAC7B,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,SAAS,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/i18n/en/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAa,MAAA,IAAI,GAAG;AAClB,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,UAAU,EAAE,YAAY;AACzB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,MAAM;AACZ,QAAA,OAAO,EAAE,UAAU;AACnB,QAAA,MAAM,EAAE,SAAS;AACjB,QAAA,QAAQ,EAAE,UAAU;AACpB,QAAA,UAAU,EAAE,aAAa;AACzB,QAAA,cAAc,EAAE,kBAAkB;AAClC,QAAA,aAAa,EAAE,gBAAgB;AAC/B,QAAA,eAAe,EAAE,YAAY;AAC7B,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,SAAS,EAAE,YAAY;AACvB,QAAA,SAAS,EAAE,aAAa;AACzB,KAAA;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/i18n/zh/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAa,MAAA,IAAI,GAAG;AAClB,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,UAAU,EAAE,KAAK;AAClB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,cAAc,EAAE,MAAM;AACtB,QAAA,aAAa,EAAE,MAAM;AACrB,QAAA,eAAe,EAAE,KAAK;AACtB,QAAA,SAAS,EAAE,MAAM;AACjB,QAAA,WAAW,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/i18n/zh/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAa,MAAA,IAAI,GAAG;AAClB,IAAA,SAAS,EAAE;AACT,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,MAAM,EAAE,KAAK;AACb,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,UAAU,EAAE,KAAK;AAClB,KAAA;AACD,IAAA,OAAO,EAAE;AACP,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,IAAI,EAAE,IAAI;AACV,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,MAAM,EAAE,IAAI;AACZ,QAAA,QAAQ,EAAE,IAAI;AACd,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,cAAc,EAAE,MAAM;AACtB,QAAA,aAAa,EAAE,MAAM;AACrB,QAAA,eAAe,EAAE,KAAK;AACtB,QAAA,SAAS,EAAE,MAAM;AACjB,QAAA,WAAW,EAAE,KAAK;AAClB,QAAA,SAAS,EAAE,MAAM;AAClB,KAAA;;;;;;"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -2,221 +2,6 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import { Pluggable } from 'unified';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* 回答类型,思考和回答
|
|
7
|
-
*/
|
|
8
|
-
type AnswerType = 'answer' | 'thinking';
|
|
9
|
-
type Theme = 'light' | 'dark';
|
|
10
|
-
interface IOnTypedCharData {
|
|
11
|
-
currentIndex: number;
|
|
12
|
-
currentChar: string;
|
|
13
|
-
answerType: AnswerType;
|
|
14
|
-
prevStr: string;
|
|
15
|
-
}
|
|
16
|
-
interface IStartData extends IOnTypedCharData {
|
|
17
|
-
}
|
|
18
|
-
interface ITypedChar extends IOnTypedCharData {
|
|
19
|
-
percent: number;
|
|
20
|
-
currentStr: string;
|
|
21
|
-
}
|
|
22
|
-
interface IBeforeTypedChar extends IOnTypedCharData {
|
|
23
|
-
percent: number;
|
|
24
|
-
}
|
|
25
|
-
interface IMarkdownThemeProps {
|
|
26
|
-
/** 主题 */
|
|
27
|
-
theme?: Theme;
|
|
28
|
-
/** 数学公式配置 */
|
|
29
|
-
math?: IMarkdownMath;
|
|
30
|
-
/** 代码块配置 */
|
|
31
|
-
codeBlock?: IMarkdownCode;
|
|
32
|
-
/** 插件配置 */
|
|
33
|
-
plugins?: IMarkdownPlugin[];
|
|
34
|
-
/** 回答类型 */
|
|
35
|
-
answerType?: 'thinking' | 'answer';
|
|
36
|
-
}
|
|
37
|
-
interface IMarkdownThemeStateProps extends IMarkdownThemeProps {
|
|
38
|
-
theme: Theme;
|
|
39
|
-
answerType: AnswerType;
|
|
40
|
-
}
|
|
41
|
-
interface MarkdownBaseProps {
|
|
42
|
-
/** 计时类型: 支持setTimeout和requestAnimationFrame */
|
|
43
|
-
timerType?: 'setTimeout' | 'requestAnimationFrame';
|
|
44
|
-
/** 打字机效果间隔时间 */
|
|
45
|
-
interval: number;
|
|
46
|
-
/** 是否关闭打字机效果 */
|
|
47
|
-
disableTyping?: boolean;
|
|
48
|
-
/** 打字完成后回调, */
|
|
49
|
-
onEnd?: (data?: IEndData) => void;
|
|
50
|
-
/** 开始打字回调 */
|
|
51
|
-
onStart?: (data?: IStartData) => void;
|
|
52
|
-
/** 打字前回调 */
|
|
53
|
-
onBeforeTypedChar?: (data?: IBeforeTypedChar) => Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* 打字机打完一个字符回调
|
|
56
|
-
* @param char 字符
|
|
57
|
-
* @param index 字符索引
|
|
58
|
-
*/
|
|
59
|
-
onTypedChar?: (data?: ITypedChar) => void;
|
|
60
|
-
/** 是否自动开启打字动画 */
|
|
61
|
-
autoStartTyping?: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface IMarkdownCode {
|
|
64
|
-
/** 是否显示头部操作按钮
|
|
65
|
-
* 如果为true,则显示头部操作按钮
|
|
66
|
-
* 如果为React.ReactNode,则显示自定义头部操作按钮
|
|
67
|
-
*/
|
|
68
|
-
headerActions?: boolean | React.ReactNode;
|
|
69
|
-
}
|
|
70
|
-
interface MarkdownProps extends MarkdownBaseProps, IMarkdownThemeProps {
|
|
71
|
-
children: string | undefined;
|
|
72
|
-
}
|
|
73
|
-
/** MarkdownCMD 组件不需要 children */
|
|
74
|
-
interface MarkdownCMDProps extends MarkdownBaseProps, IMarkdownThemeProps {
|
|
75
|
-
children?: undefined;
|
|
76
|
-
isInnerRender?: boolean;
|
|
77
|
-
}
|
|
78
|
-
interface IMarkdownPlugin {
|
|
79
|
-
remarkPlugin?: Pluggable;
|
|
80
|
-
rehypePlugin?: Pluggable;
|
|
81
|
-
type: 'buildIn' | 'custom';
|
|
82
|
-
id?: any;
|
|
83
|
-
components?: Record<string, React.ComponentType<unknown>>;
|
|
84
|
-
}
|
|
85
|
-
interface IMarkdownMath {
|
|
86
|
-
/** 是括号还是$作为分隔符, 默认是$ */
|
|
87
|
-
splitSymbol: 'bracket' | 'dollar';
|
|
88
|
-
/** 数学公式替换函数 */
|
|
89
|
-
replaceMathBracket?: (value: string) => string;
|
|
90
|
-
}
|
|
91
|
-
interface MarkdownBaseRef {
|
|
92
|
-
stop: () => void;
|
|
93
|
-
resume: () => void;
|
|
94
|
-
start: () => void;
|
|
95
|
-
restart: () => void;
|
|
96
|
-
}
|
|
97
|
-
/** Markdown 组件的ref 类型 */
|
|
98
|
-
type MarkdownRef = MarkdownBaseRef;
|
|
99
|
-
/** MarkdownCMD 组件的 ref 类型 */
|
|
100
|
-
interface MarkdownCMDRef extends MarkdownBaseRef {
|
|
101
|
-
push: (content: string, answerType?: AnswerType) => void;
|
|
102
|
-
clear: () => void;
|
|
103
|
-
triggerWholeEnd: () => void;
|
|
104
|
-
}
|
|
105
|
-
interface IEndData {
|
|
106
|
-
manual: boolean;
|
|
107
|
-
/** 回答字符串 */
|
|
108
|
-
answerStr: string;
|
|
109
|
-
/** 思考字符串 */
|
|
110
|
-
thinkingStr: string;
|
|
111
|
-
/** 打字机打过的字符串, 和answerStr 相同 */
|
|
112
|
-
str: string;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare const MarkdownCMD: React$1.ForwardRefExoticComponent<MarkdownCMDProps & React$1.RefAttributes<MarkdownCMDRef>>;
|
|
116
|
-
|
|
117
|
-
declare const _default: React__default.NamedExoticComponent<MarkdownProps & React__default.RefAttributes<MarkdownBaseRef>>;
|
|
118
|
-
|
|
119
|
-
interface ButtonProps$1 {
|
|
120
|
-
className?: string;
|
|
121
|
-
children?: React__default.ReactNode;
|
|
122
|
-
icon?: React__default.ReactNode;
|
|
123
|
-
onClick?: () => void;
|
|
124
|
-
style?: React__default.CSSProperties;
|
|
125
|
-
disabled?: boolean;
|
|
126
|
-
}
|
|
127
|
-
declare const Button: React__default.FC<ButtonProps$1>;
|
|
128
|
-
|
|
129
|
-
interface IconButtonProps extends ButtonProps$1 {
|
|
130
|
-
icon: React__default.ReactNode;
|
|
131
|
-
className?: string;
|
|
132
|
-
}
|
|
133
|
-
declare const IconButton: React__default.FC<IconButtonProps>;
|
|
134
|
-
|
|
135
|
-
interface SegmentedItem {
|
|
136
|
-
label: string;
|
|
137
|
-
value: string;
|
|
138
|
-
}
|
|
139
|
-
interface SegmentedProps {
|
|
140
|
-
Segmented: SegmentedItem[];
|
|
141
|
-
value?: string;
|
|
142
|
-
onChange?: (value: string) => void;
|
|
143
|
-
}
|
|
144
|
-
declare const Segmented: React__default.FC<SegmentedProps>;
|
|
145
|
-
|
|
146
|
-
type ButtonProps = React__default.ComponentProps<typeof Button>;
|
|
147
|
-
interface SuccessButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
148
|
-
children: React__default.ReactNode;
|
|
149
|
-
onClick: () => Promise<boolean>;
|
|
150
|
-
executeText?: string;
|
|
151
|
-
}
|
|
152
|
-
declare const SuccessButton: React__default.FC<SuccessButtonProps>;
|
|
153
|
-
|
|
154
|
-
interface CopyButtonProps {
|
|
155
|
-
codeContent?: string;
|
|
156
|
-
style?: React__default.CSSProperties;
|
|
157
|
-
className?: string;
|
|
158
|
-
}
|
|
159
|
-
declare const CopyButton: React__default.FC<CopyButtonProps>;
|
|
160
|
-
|
|
161
|
-
interface DownloadButtonProps {
|
|
162
|
-
codeContent?: string;
|
|
163
|
-
language: string;
|
|
164
|
-
style?: React__default.CSSProperties;
|
|
165
|
-
className?: string;
|
|
166
|
-
}
|
|
167
|
-
declare const DownloadButton: React__default.FC<DownloadButtonProps>;
|
|
168
|
-
|
|
169
|
-
interface CodeBlockActionsProps {
|
|
170
|
-
codeContent?: string;
|
|
171
|
-
language: string;
|
|
172
|
-
}
|
|
173
|
-
declare const CodeBlockActions: React__default.FC<CodeBlockActionsProps>;
|
|
174
|
-
|
|
175
|
-
interface CodeBlockWrapProps {
|
|
176
|
-
children: React__default.ReactNode;
|
|
177
|
-
title: React__default.ReactNode;
|
|
178
|
-
}
|
|
179
|
-
declare const CodeBlockWrap: React__default.FC<CodeBlockWrapProps>;
|
|
180
|
-
|
|
181
|
-
interface HighlightCodeProps {
|
|
182
|
-
code: string;
|
|
183
|
-
language: string;
|
|
184
|
-
}
|
|
185
|
-
declare const HighlightCode: React__default.FC<HighlightCodeProps>;
|
|
186
|
-
|
|
187
|
-
declare const CheckMarkIcon: React__default.FC<{
|
|
188
|
-
size: number;
|
|
189
|
-
}>;
|
|
190
|
-
declare const CopyIcon: React__default.FC<{
|
|
191
|
-
size: number;
|
|
192
|
-
}>;
|
|
193
|
-
declare const DownloadIcon: React__default.FC<{
|
|
194
|
-
size: number;
|
|
195
|
-
}>;
|
|
196
|
-
|
|
197
|
-
declare const zhCN: {
|
|
198
|
-
codeBlock: {
|
|
199
|
-
copy: string;
|
|
200
|
-
copied: string;
|
|
201
|
-
download: string;
|
|
202
|
-
downloaded: string;
|
|
203
|
-
};
|
|
204
|
-
mermaid: {
|
|
205
|
-
diagram: string;
|
|
206
|
-
code: string;
|
|
207
|
-
zoomOut: string;
|
|
208
|
-
zoomIn: string;
|
|
209
|
-
download: string;
|
|
210
|
-
fullScreen: string;
|
|
211
|
-
exitFullScreen: string;
|
|
212
|
-
downloadImage: string;
|
|
213
|
-
downloadedImage: string;
|
|
214
|
-
copyImage: string;
|
|
215
|
-
copiedImage: string;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
type ZhCN = typeof zhCN;
|
|
219
|
-
|
|
220
5
|
declare namespace Mermaid {
|
|
221
6
|
/**
|
|
222
7
|
* The font size to use
|
|
@@ -1731,15 +1516,241 @@ declare namespace Mermaid {
|
|
|
1731
1516
|
}
|
|
1732
1517
|
}
|
|
1733
1518
|
|
|
1519
|
+
/**
|
|
1520
|
+
* 回答类型,思考和回答
|
|
1521
|
+
*/
|
|
1522
|
+
type AnswerType = 'answer' | 'thinking';
|
|
1523
|
+
type Theme = 'light' | 'dark';
|
|
1524
|
+
interface IOnTypedCharData {
|
|
1525
|
+
currentIndex: number;
|
|
1526
|
+
currentChar: string;
|
|
1527
|
+
answerType: AnswerType;
|
|
1528
|
+
prevStr: string;
|
|
1529
|
+
}
|
|
1530
|
+
interface IStartData extends IOnTypedCharData {
|
|
1531
|
+
}
|
|
1532
|
+
interface ITypedChar extends IOnTypedCharData {
|
|
1533
|
+
percent: number;
|
|
1534
|
+
currentStr: string;
|
|
1535
|
+
}
|
|
1536
|
+
interface IBeforeTypedChar extends IOnTypedCharData {
|
|
1537
|
+
percent: number;
|
|
1538
|
+
}
|
|
1539
|
+
interface IMarkdownThemeProps {
|
|
1540
|
+
/** 主题 */
|
|
1541
|
+
theme?: Theme;
|
|
1542
|
+
/** 数学公式配置 */
|
|
1543
|
+
math?: IMarkdownMath;
|
|
1544
|
+
/** 代码块配置 */
|
|
1545
|
+
codeBlock?: IMarkdownCode;
|
|
1546
|
+
/** 插件配置 */
|
|
1547
|
+
plugins?: IMarkdownPlugin[];
|
|
1548
|
+
/** 回答类型 */
|
|
1549
|
+
answerType?: 'thinking' | 'answer';
|
|
1550
|
+
}
|
|
1551
|
+
interface IMarkdownThemeStateProps extends IMarkdownThemeProps {
|
|
1552
|
+
theme: Theme;
|
|
1553
|
+
answerType: AnswerType;
|
|
1554
|
+
}
|
|
1555
|
+
interface MarkdownBaseProps {
|
|
1556
|
+
/** 计时类型: 支持setTimeout和requestAnimationFrame */
|
|
1557
|
+
timerType?: 'setTimeout' | 'requestAnimationFrame';
|
|
1558
|
+
/** 打字机效果间隔时间 */
|
|
1559
|
+
interval: number;
|
|
1560
|
+
/** 是否关闭打字机效果 */
|
|
1561
|
+
disableTyping?: boolean;
|
|
1562
|
+
/** 打字完成后回调, */
|
|
1563
|
+
onEnd?: (data?: IEndData) => void;
|
|
1564
|
+
/** 开始打字回调 */
|
|
1565
|
+
onStart?: (data?: IStartData) => void;
|
|
1566
|
+
/** 打字前回调 */
|
|
1567
|
+
onBeforeTypedChar?: (data?: IBeforeTypedChar) => Promise<void>;
|
|
1568
|
+
/**
|
|
1569
|
+
* 打字机打完一个字符回调
|
|
1570
|
+
* @param char 字符
|
|
1571
|
+
* @param index 字符索引
|
|
1572
|
+
*/
|
|
1573
|
+
onTypedChar?: (data?: ITypedChar) => void;
|
|
1574
|
+
/** 是否自动开启打字动画 */
|
|
1575
|
+
autoStartTyping?: boolean;
|
|
1576
|
+
}
|
|
1577
|
+
interface IMarkdownCode {
|
|
1578
|
+
/** 是否显示头部操作按钮
|
|
1579
|
+
* 如果为true,则显示头部操作按钮
|
|
1580
|
+
* 如果为React.ReactNode,则显示自定义头部操作按钮
|
|
1581
|
+
*/
|
|
1582
|
+
headerActions?: boolean | React.ReactNode;
|
|
1583
|
+
}
|
|
1584
|
+
interface MarkdownProps extends MarkdownBaseProps, IMarkdownThemeProps {
|
|
1585
|
+
children: string | undefined;
|
|
1586
|
+
}
|
|
1587
|
+
/** MarkdownCMD 组件不需要 children */
|
|
1588
|
+
interface MarkdownCMDProps extends MarkdownBaseProps, IMarkdownThemeProps {
|
|
1589
|
+
children?: undefined;
|
|
1590
|
+
isInnerRender?: boolean;
|
|
1591
|
+
}
|
|
1592
|
+
interface IMarkdownPlugin {
|
|
1593
|
+
remarkPlugin?: Pluggable;
|
|
1594
|
+
rehypePlugin?: Pluggable;
|
|
1595
|
+
type: 'buildIn' | 'custom';
|
|
1596
|
+
id?: any;
|
|
1597
|
+
components?: Record<string, React.ComponentType<unknown>>;
|
|
1598
|
+
}
|
|
1599
|
+
interface IMarkdownMath {
|
|
1600
|
+
/** 是括号还是$作为分隔符, 默认是$ */
|
|
1601
|
+
splitSymbol: 'bracket' | 'dollar';
|
|
1602
|
+
/** 数学公式替换函数 */
|
|
1603
|
+
replaceMathBracket?: (value: string) => string;
|
|
1604
|
+
}
|
|
1605
|
+
interface MarkdownBaseRef {
|
|
1606
|
+
stop: () => void;
|
|
1607
|
+
resume: () => void;
|
|
1608
|
+
start: () => void;
|
|
1609
|
+
restart: () => void;
|
|
1610
|
+
}
|
|
1611
|
+
/** Markdown 组件的ref 类型 */
|
|
1612
|
+
type MarkdownRef = MarkdownBaseRef;
|
|
1613
|
+
/** MarkdownCMD 组件的 ref 类型 */
|
|
1614
|
+
interface MarkdownCMDRef extends MarkdownBaseRef {
|
|
1615
|
+
push: (content: string, answerType?: AnswerType) => void;
|
|
1616
|
+
clear: () => void;
|
|
1617
|
+
triggerWholeEnd: () => void;
|
|
1618
|
+
}
|
|
1619
|
+
interface IEndData {
|
|
1620
|
+
manual: boolean;
|
|
1621
|
+
/** 回答字符串 */
|
|
1622
|
+
answerStr: string;
|
|
1623
|
+
/** 思考字符串 */
|
|
1624
|
+
thinkingStr: string;
|
|
1625
|
+
/** 打字机打过的字符串, 和answerStr 相同 */
|
|
1626
|
+
str: string;
|
|
1627
|
+
}
|
|
1628
|
+
interface IMarkdownMermaidConfig extends Mermaid.MermaidConfig {
|
|
1629
|
+
/** 是否显示头部操作按钮
|
|
1630
|
+
* 如果为true,则显示头部操作按钮
|
|
1631
|
+
* 如果为React.ReactNode,则显示自定义头部操作按钮
|
|
1632
|
+
*/
|
|
1633
|
+
headerActions?: boolean | React.ReactNode | ((data: {
|
|
1634
|
+
graphSvg: SVGElement;
|
|
1635
|
+
}) => React.ReactNode);
|
|
1636
|
+
}
|
|
1637
|
+
|
|
1638
|
+
declare const MarkdownCMD: React$1.ForwardRefExoticComponent<MarkdownCMDProps & React$1.RefAttributes<MarkdownCMDRef>>;
|
|
1639
|
+
|
|
1640
|
+
declare const _default: React__default.NamedExoticComponent<MarkdownProps & React__default.RefAttributes<MarkdownBaseRef>>;
|
|
1641
|
+
|
|
1642
|
+
interface ButtonProps$1 {
|
|
1643
|
+
className?: string;
|
|
1644
|
+
children?: React__default.ReactNode;
|
|
1645
|
+
icon?: React__default.ReactNode;
|
|
1646
|
+
onClick?: () => void;
|
|
1647
|
+
style?: React__default.CSSProperties;
|
|
1648
|
+
disabled?: boolean;
|
|
1649
|
+
}
|
|
1650
|
+
declare const Button: React__default.FC<ButtonProps$1>;
|
|
1651
|
+
|
|
1652
|
+
interface IconButtonProps extends ButtonProps$1 {
|
|
1653
|
+
icon: React__default.ReactNode;
|
|
1654
|
+
className?: string;
|
|
1655
|
+
}
|
|
1656
|
+
declare const IconButton: React__default.FC<IconButtonProps>;
|
|
1657
|
+
|
|
1658
|
+
interface SegmentedItem {
|
|
1659
|
+
label: string;
|
|
1660
|
+
value: string;
|
|
1661
|
+
}
|
|
1662
|
+
interface SegmentedProps {
|
|
1663
|
+
Segmented: SegmentedItem[];
|
|
1664
|
+
value?: string;
|
|
1665
|
+
onChange?: (value: string) => void;
|
|
1666
|
+
}
|
|
1667
|
+
declare const Segmented: React__default.FC<SegmentedProps>;
|
|
1668
|
+
|
|
1669
|
+
type ButtonProps = React__default.ComponentProps<typeof Button>;
|
|
1670
|
+
interface SuccessButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
1671
|
+
children: React__default.ReactNode;
|
|
1672
|
+
onClick: () => Promise<boolean>;
|
|
1673
|
+
executeText?: string;
|
|
1674
|
+
}
|
|
1675
|
+
declare const SuccessButton: React__default.FC<SuccessButtonProps>;
|
|
1676
|
+
|
|
1677
|
+
interface CopyButtonProps {
|
|
1678
|
+
codeContent?: string;
|
|
1679
|
+
style?: React__default.CSSProperties;
|
|
1680
|
+
className?: string;
|
|
1681
|
+
}
|
|
1682
|
+
declare const CopyButton: React__default.FC<CopyButtonProps>;
|
|
1683
|
+
|
|
1684
|
+
interface DownloadButtonProps {
|
|
1685
|
+
codeContent?: string;
|
|
1686
|
+
language: string;
|
|
1687
|
+
style?: React__default.CSSProperties;
|
|
1688
|
+
className?: string;
|
|
1689
|
+
}
|
|
1690
|
+
declare const DownloadButton: React__default.FC<DownloadButtonProps>;
|
|
1691
|
+
|
|
1692
|
+
interface CodeBlockActionsProps {
|
|
1693
|
+
codeContent?: string;
|
|
1694
|
+
language: string;
|
|
1695
|
+
}
|
|
1696
|
+
declare const CodeBlockActions: React__default.FC<CodeBlockActionsProps>;
|
|
1697
|
+
|
|
1698
|
+
interface CodeBlockWrapProps {
|
|
1699
|
+
children: React__default.ReactNode;
|
|
1700
|
+
title: React__default.ReactNode;
|
|
1701
|
+
}
|
|
1702
|
+
declare const CodeBlockWrap: React__default.FC<CodeBlockWrapProps>;
|
|
1703
|
+
|
|
1704
|
+
interface HighlightCodeProps {
|
|
1705
|
+
code: string;
|
|
1706
|
+
language: string;
|
|
1707
|
+
}
|
|
1708
|
+
declare const HighlightCode: React__default.FC<HighlightCodeProps>;
|
|
1709
|
+
|
|
1710
|
+
declare const CheckMarkIcon: React__default.FC<{
|
|
1711
|
+
size: number;
|
|
1712
|
+
}>;
|
|
1713
|
+
declare const CopyIcon: React__default.FC<{
|
|
1714
|
+
size: number;
|
|
1715
|
+
}>;
|
|
1716
|
+
declare const DownloadIcon: React__default.FC<{
|
|
1717
|
+
size: number;
|
|
1718
|
+
}>;
|
|
1719
|
+
|
|
1720
|
+
declare const zhCN: {
|
|
1721
|
+
codeBlock: {
|
|
1722
|
+
copy: string;
|
|
1723
|
+
copied: string;
|
|
1724
|
+
download: string;
|
|
1725
|
+
downloaded: string;
|
|
1726
|
+
};
|
|
1727
|
+
mermaid: {
|
|
1728
|
+
diagram: string;
|
|
1729
|
+
code: string;
|
|
1730
|
+
zoomOut: string;
|
|
1731
|
+
zoomIn: string;
|
|
1732
|
+
download: string;
|
|
1733
|
+
fullScreen: string;
|
|
1734
|
+
exitFullScreen: string;
|
|
1735
|
+
downloadImage: string;
|
|
1736
|
+
downloadedImage: string;
|
|
1737
|
+
copyImage: string;
|
|
1738
|
+
copiedImage: string;
|
|
1739
|
+
fitInView: string;
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
type ZhCN = typeof zhCN;
|
|
1743
|
+
|
|
1734
1744
|
type Locale = ZhCN;
|
|
1735
1745
|
interface ConfigProviderProps {
|
|
1736
1746
|
locale?: Locale;
|
|
1737
|
-
mermaidConfig?:
|
|
1747
|
+
mermaidConfig?: IMarkdownMermaidConfig;
|
|
1738
1748
|
children: React__default.ReactNode;
|
|
1749
|
+
katexConfig?: IMarkdownKatexConfig;
|
|
1739
1750
|
}
|
|
1740
1751
|
interface ConfigContextType {
|
|
1741
1752
|
locale: Locale;
|
|
1742
|
-
mermaidConfig?:
|
|
1753
|
+
mermaidConfig?: IMarkdownMermaidConfig;
|
|
1743
1754
|
}
|
|
1744
1755
|
declare const ConfigProvider: React__default.FC<ConfigProviderProps>;
|
|
1745
1756
|
declare const useConfig: () => ConfigContextType;
|
|
@@ -1762,10 +1773,11 @@ declare const useLocale: () => {
|
|
|
1762
1773
|
downloadedImage: string;
|
|
1763
1774
|
copyImage: string;
|
|
1764
1775
|
copiedImage: string;
|
|
1776
|
+
fitInView: string;
|
|
1765
1777
|
};
|
|
1766
1778
|
};
|
|
1767
1779
|
|
|
1768
1780
|
declare const useThemeState: () => IMarkdownThemeStateProps;
|
|
1769
1781
|
|
|
1770
1782
|
export { Button, CheckMarkIcon, CodeBlockActions, CodeBlockWrap, ConfigProvider, CopyButton, CopyIcon, DownloadButton, DownloadIcon, HighlightCode, IconButton, _default as Markdown, MarkdownCMD, Segmented, SuccessButton, _default as default, useConfig, useLocale, useThemeState };
|
|
1771
|
-
export type { ConfigContextType, ConfigProviderProps, IMarkdownMath, IMarkdownPlugin, ITypedChar, Locale, MarkdownCMDProps, MarkdownCMDRef, MarkdownProps, MarkdownRef };
|
|
1783
|
+
export type { ConfigContextType, ConfigProviderProps, IMarkdownMath, IMarkdownMermaidConfig, IMarkdownPlugin, ITypedChar, Locale, MarkdownCMDProps, MarkdownCMDRef, MarkdownProps, MarkdownRef };
|