ds-markdown 0.1.10-beta.1 → 0.1.10-beta.2
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/README.en.md +272 -758
- package/README.md +7 -7
- package/dist/cjs/i18n/en/index.d.ts +17 -10
- package/dist/cjs/i18n/en/index.js +7 -0
- package/dist/cjs/i18n/en/index.js.map +1 -1
- package/dist/cjs/i18n/zh/index.d.ts +17 -10
- package/dist/cjs/i18n/zh/index.js +7 -0
- package/dist/cjs/i18n/zh/index.js.map +1 -1
- package/dist/cjs/index.d.ts +68 -35
- package/dist/cjs/index.js +127 -267
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/i18n/en/index.d.ts +17 -10
- package/dist/esm/i18n/en/index.js +7 -0
- package/dist/esm/i18n/en/index.js.map +1 -1
- package/dist/esm/i18n/zh/index.d.ts +17 -10
- package/dist/esm/i18n/zh/index.js +7 -0
- package/dist/esm/i18n/zh/index.js.map +1 -1
- package/dist/esm/index.d.ts +68 -35
- package/dist/esm/index.js +82 -225
- package/dist/esm/index.js.map +1 -1
- package/dist/style.css +4 -87
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
[](https://react.dev)
|
|
13
13
|
[](https://www.typescriptlang.org/)
|
|
14
14
|
|
|
15
|
-
[使用文档](https://onshinpei.github.io/ds-markdown/)
|
|
16
|
-
|
|
17
|
-
- [基本用法](https://stackblitz.com/edit/vitejs-vite-ddfw8avb?file=src%2FApp.tsx)
|
|
18
|
-
- [流式数据用法](https://stackblitz.com/edit/vitejs-vite-2ri8kex3?file=src%2FApp.tsx)
|
|
19
|
-
- [mermaid图表](https://stackblitz.com/edit/vitejs-vite-iqbyta3j?file=index.html)
|
|
20
|
-
- [数学公式demo1](https://stackblitz.com/edit/vitejs-vite-iqbyta3j?file=index.html)
|
|
21
|
-
- [数学公式demo2](https://stackblitz.com/edit/vitejs-vite-xk9lxagc?file=src%2FApp.tsx)
|
|
15
|
+
- [使用文档](https://onshinpei.github.io/ds-markdown/)
|
|
16
|
+
- 使用示例
|
|
17
|
+
- [基本用法](https://stackblitz.com/edit/vitejs-vite-ddfw8avb?file=src%2FApp.tsx)
|
|
18
|
+
- [流式数据用法](https://stackblitz.com/edit/vitejs-vite-2ri8kex3?file=src%2FApp.tsx)
|
|
19
|
+
- [mermaid图表](https://stackblitz.com/edit/vitejs-vite-iqbyta3j?file=index.html)
|
|
20
|
+
- [数学公式demo1](https://stackblitz.com/edit/vitejs-vite-iqbyta3j?file=index.html)
|
|
21
|
+
- [数学公式demo2](https://stackblitz.com/edit/vitejs-vite-xk9lxagc?file=src%2FApp.tsx)
|
|
22
22
|
|
|
23
23
|
如果你想要一个纯净的`react markdown` 打字组件,可以使用[react-markdown-typer](https://github.com/onshinpei/react-markdown-typer)
|
|
24
24
|
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
declare const enUS: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
codeBlock: {
|
|
3
|
+
copy: string;
|
|
4
|
+
copied: string;
|
|
5
|
+
download: string;
|
|
6
|
+
downloaded: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
mermaid: {
|
|
9
|
+
diagram: string;
|
|
10
|
+
code: string;
|
|
11
|
+
zoomOut: string;
|
|
12
|
+
zoomIn: string;
|
|
13
|
+
download: string;
|
|
14
|
+
fullScreen: string;
|
|
15
|
+
exitFullScreen: string;
|
|
16
|
+
downloadImage: string;
|
|
17
|
+
downloadedImage: string;
|
|
18
|
+
copiedImage: string;
|
|
19
|
+
copyImage: string;
|
|
13
20
|
};
|
|
14
21
|
};
|
|
15
22
|
type EnUS = typeof enUS;
|
|
@@ -7,6 +7,7 @@ const enUS = {
|
|
|
7
7
|
copy: 'Copy',
|
|
8
8
|
copied: 'Copied',
|
|
9
9
|
download: 'Download',
|
|
10
|
+
downloaded: 'Downloaded',
|
|
10
11
|
},
|
|
11
12
|
mermaid: {
|
|
12
13
|
diagram: 'Diagram',
|
|
@@ -14,6 +15,12 @@ const enUS = {
|
|
|
14
15
|
zoomOut: 'Zoom Out',
|
|
15
16
|
zoomIn: 'Zoom In',
|
|
16
17
|
download: 'Download',
|
|
18
|
+
fullScreen: 'Full Screen',
|
|
19
|
+
exitFullScreen: 'Exit Full Screen',
|
|
20
|
+
downloadImage: 'Download Image',
|
|
21
|
+
downloadedImage: 'Downloaded',
|
|
22
|
+
copiedImage: 'Copied',
|
|
23
|
+
copyImage: 'Copy Image',
|
|
17
24
|
},
|
|
18
25
|
};
|
|
19
26
|
|
|
@@ -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;
|
|
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;AACxB,KAAA;;;;;;"}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
declare const zhCN: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
codeBlock: {
|
|
3
|
+
copy: string;
|
|
4
|
+
copied: string;
|
|
5
|
+
download: string;
|
|
6
|
+
downloaded: string;
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
mermaid: {
|
|
9
|
+
diagram: string;
|
|
10
|
+
code: string;
|
|
11
|
+
zoomOut: string;
|
|
12
|
+
zoomIn: string;
|
|
13
|
+
download: string;
|
|
14
|
+
fullScreen: string;
|
|
15
|
+
exitFullScreen: string;
|
|
16
|
+
downloadImage: string;
|
|
17
|
+
downloadedImage: string;
|
|
18
|
+
copyImage: string;
|
|
19
|
+
copiedImage: string;
|
|
13
20
|
};
|
|
14
21
|
};
|
|
15
22
|
type ZhCN = typeof zhCN;
|
|
@@ -7,6 +7,7 @@ const zhCN = {
|
|
|
7
7
|
copy: '复制',
|
|
8
8
|
copied: '已复制',
|
|
9
9
|
download: '下载',
|
|
10
|
+
downloaded: '已下载',
|
|
10
11
|
},
|
|
11
12
|
mermaid: {
|
|
12
13
|
diagram: '图表',
|
|
@@ -14,6 +15,12 @@ const zhCN = {
|
|
|
14
15
|
zoomOut: '缩小',
|
|
15
16
|
zoomIn: '放大',
|
|
16
17
|
download: '下载',
|
|
18
|
+
fullScreen: '全屏',
|
|
19
|
+
exitFullScreen: '退出全屏',
|
|
20
|
+
downloadImage: '下载图片',
|
|
21
|
+
downloadedImage: '已下载',
|
|
22
|
+
copyImage: '复制图片',
|
|
23
|
+
copiedImage: '已复制',
|
|
17
24
|
},
|
|
18
25
|
};
|
|
19
26
|
|
|
@@ -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;
|
|
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;AACnB,KAAA;;;;;;"}
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -116,35 +116,22 @@ declare const MarkdownCMD: React$1.ForwardRefExoticComponent<MarkdownCMDProps &
|
|
|
116
116
|
|
|
117
117
|
declare const _default: React__default.NamedExoticComponent<MarkdownProps & React__default.RefAttributes<MarkdownBaseRef>>;
|
|
118
118
|
|
|
119
|
-
interface ButtonProps {
|
|
119
|
+
interface ButtonProps$1 {
|
|
120
120
|
className?: string;
|
|
121
121
|
children?: React__default.ReactNode;
|
|
122
122
|
icon?: React__default.ReactNode;
|
|
123
123
|
onClick?: () => void;
|
|
124
124
|
style?: React__default.CSSProperties;
|
|
125
|
+
disabled?: boolean;
|
|
125
126
|
}
|
|
126
|
-
declare const Button: React__default.FC<ButtonProps>;
|
|
127
|
+
declare const Button: React__default.FC<ButtonProps$1>;
|
|
127
128
|
|
|
128
|
-
interface IconButtonProps {
|
|
129
|
+
interface IconButtonProps extends ButtonProps$1 {
|
|
129
130
|
icon: React__default.ReactNode;
|
|
130
|
-
style?: React__default.CSSProperties;
|
|
131
131
|
className?: string;
|
|
132
|
-
onClick?: () => void;
|
|
133
132
|
}
|
|
134
133
|
declare const IconButton: React__default.FC<IconButtonProps>;
|
|
135
134
|
|
|
136
|
-
type TooltipPosition = 'top' | 'bottom' | 'left' | 'right';
|
|
137
|
-
interface ToolTipProps {
|
|
138
|
-
title: React__default.ReactNode;
|
|
139
|
-
children: React__default.ReactElement;
|
|
140
|
-
position?: TooltipPosition;
|
|
141
|
-
className?: string;
|
|
142
|
-
style?: React__default.CSSProperties;
|
|
143
|
-
showArrow?: boolean;
|
|
144
|
-
delay?: number;
|
|
145
|
-
}
|
|
146
|
-
declare const ToolTip: React__default.ForwardRefExoticComponent<ToolTipProps & React__default.RefAttributes<HTMLElement>>;
|
|
147
|
-
|
|
148
135
|
interface SegmentedItem {
|
|
149
136
|
label: string;
|
|
150
137
|
value: string;
|
|
@@ -156,6 +143,14 @@ interface SegmentedProps {
|
|
|
156
143
|
}
|
|
157
144
|
declare const Segmented: React__default.FC<SegmentedProps>;
|
|
158
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
|
+
|
|
159
154
|
interface CopyButtonProps {
|
|
160
155
|
codeContent?: string;
|
|
161
156
|
style?: React__default.CSSProperties;
|
|
@@ -189,6 +184,39 @@ interface HighlightCodeProps {
|
|
|
189
184
|
}
|
|
190
185
|
declare const HighlightCode: React__default.FC<HighlightCodeProps>;
|
|
191
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
|
+
|
|
192
220
|
declare namespace Mermaid {
|
|
193
221
|
/**
|
|
194
222
|
* The font size to use
|
|
@@ -1703,12 +1731,24 @@ declare namespace Mermaid {
|
|
|
1703
1731
|
}
|
|
1704
1732
|
}
|
|
1705
1733
|
|
|
1706
|
-
|
|
1734
|
+
type Locale = ZhCN;
|
|
1735
|
+
interface ConfigProviderProps {
|
|
1736
|
+
locale?: Locale;
|
|
1737
|
+
mermaidConfig?: Mermaid.MermaidConfig;
|
|
1738
|
+
children: React__default.ReactNode;
|
|
1739
|
+
}
|
|
1740
|
+
interface ConfigContextType {
|
|
1741
|
+
locale: Locale;
|
|
1742
|
+
mermaidConfig?: Mermaid.MermaidConfig;
|
|
1743
|
+
}
|
|
1744
|
+
declare const ConfigProvider: React__default.FC<ConfigProviderProps>;
|
|
1745
|
+
declare const useConfig: () => ConfigContextType;
|
|
1746
|
+
declare const useLocale: () => {
|
|
1707
1747
|
codeBlock: {
|
|
1708
1748
|
copy: string;
|
|
1709
1749
|
copied: string;
|
|
1710
1750
|
download: string;
|
|
1711
|
-
|
|
1751
|
+
downloaded: string;
|
|
1712
1752
|
};
|
|
1713
1753
|
mermaid: {
|
|
1714
1754
|
diagram: string;
|
|
@@ -1716,23 +1756,16 @@ interface Locale {
|
|
|
1716
1756
|
zoomOut: string;
|
|
1717
1757
|
zoomIn: string;
|
|
1718
1758
|
download: string;
|
|
1759
|
+
fullScreen: string;
|
|
1760
|
+
exitFullScreen: string;
|
|
1761
|
+
downloadImage: string;
|
|
1762
|
+
downloadedImage: string;
|
|
1763
|
+
copyImage: string;
|
|
1764
|
+
copiedImage: string;
|
|
1719
1765
|
};
|
|
1720
|
-
|
|
1721
|
-
}
|
|
1722
|
-
interface ConfigProviderProps {
|
|
1723
|
-
locale?: Locale;
|
|
1724
|
-
mermaidConfig?: Mermaid.MermaidConfig;
|
|
1725
|
-
children: React__default.ReactNode;
|
|
1726
|
-
}
|
|
1727
|
-
interface ConfigContextType {
|
|
1728
|
-
locale: Locale;
|
|
1729
|
-
mermaidConfig?: Mermaid.MermaidConfig;
|
|
1730
|
-
}
|
|
1731
|
-
declare const ConfigProvider: React__default.FC<ConfigProviderProps>;
|
|
1732
|
-
declare const useConfig: () => ConfigContextType;
|
|
1733
|
-
declare const useLocale: () => Locale;
|
|
1766
|
+
};
|
|
1734
1767
|
|
|
1735
1768
|
declare const useThemeState: () => IMarkdownThemeStateProps;
|
|
1736
1769
|
|
|
1737
|
-
export { Button, CodeBlockActions, CodeBlockWrap, ConfigProvider, CopyButton, DownloadButton, HighlightCode, IconButton, _default as Markdown, MarkdownCMD, Segmented,
|
|
1738
|
-
export type { ConfigContextType, ConfigProviderProps, IMarkdownMath, ITypedChar, Locale, MarkdownCMDProps, MarkdownCMDRef, MarkdownProps, MarkdownRef };
|
|
1770
|
+
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 };
|