@fe-free/core 6.0.28 → 6.0.30
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/CHANGELOG.md +15 -0
- package/package.json +3 -3
- package/src/markdown/index.tsx +7 -1
- package/src/markdown/markdown.stories.tsx +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @fe-free/core
|
|
2
2
|
|
|
3
|
+
## 6.0.30
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: markdown
|
|
8
|
+
- @fe-free/icons@6.0.30
|
|
9
|
+
- @fe-free/tool@6.0.30
|
|
10
|
+
|
|
11
|
+
## 6.0.29
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- @fe-free/icons@6.0.29
|
|
16
|
+
- @fe-free/tool@6.0.29
|
|
17
|
+
|
|
3
18
|
## 6.0.28
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.30",
|
|
4
4
|
"description": "React 业务核心组件库:CRUD、ProForm 扩展、布局、路由、树、上传等(Antd + ProComponents)",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"i18next-icu": "^2.4.1",
|
|
45
45
|
"react": "^19.2.0",
|
|
46
46
|
"react-i18next": "^16.4.0",
|
|
47
|
-
"@fe-free/icons": "6.0.
|
|
48
|
-
"@fe-free/tool": "6.0.
|
|
47
|
+
"@fe-free/icons": "6.0.30",
|
|
48
|
+
"@fe-free/tool": "6.0.30"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"i18n-extract": "rm -rf ./src/locales/zh-CN && npx i18next-cli extract"
|
package/src/markdown/index.tsx
CHANGED
|
@@ -12,6 +12,7 @@ import { ThinkComponent, compatibleWithDeepSeek } from './think';
|
|
|
12
12
|
interface MarkdownProps {
|
|
13
13
|
content?: string;
|
|
14
14
|
isStreaming?: boolean;
|
|
15
|
+
enableLatex?: boolean;
|
|
15
16
|
components?: XMarkdownProps['components'];
|
|
16
17
|
getComponents?: (components: XMarkdownProps['components']) => XMarkdownProps['components'];
|
|
17
18
|
}
|
|
@@ -40,16 +41,21 @@ function defaultGetComponents(components: XMarkdownProps['components']) {
|
|
|
40
41
|
function Markdown({
|
|
41
42
|
content,
|
|
42
43
|
isStreaming,
|
|
44
|
+
enableLatex = true,
|
|
43
45
|
components: propsComponents,
|
|
44
46
|
getComponents = defaultGetComponents,
|
|
45
47
|
}: MarkdownProps) {
|
|
46
48
|
const [className] = useMarkdownTheme();
|
|
47
49
|
|
|
48
50
|
const config = useMemo(() => {
|
|
51
|
+
if (!enableLatex) {
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
49
55
|
return {
|
|
50
56
|
extensions: Latex(),
|
|
51
57
|
};
|
|
52
|
-
}, []);
|
|
58
|
+
}, [enableLatex]);
|
|
53
59
|
const streaming = useMemo(() => {
|
|
54
60
|
return {
|
|
55
61
|
enableAnimation: true,
|
|
@@ -167,6 +167,25 @@ block: \n
|
|
|
167
167
|
},
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
+
export const DisableLatex: Story = {
|
|
171
|
+
args: {
|
|
172
|
+
enableLatex: false,
|
|
173
|
+
content: `
|
|
174
|
+
### Disable Latex
|
|
175
|
+
|
|
176
|
+
price: $xxx$
|
|
177
|
+
|
|
178
|
+
inline formula text: $\\frac{df}{dt}$
|
|
179
|
+
|
|
180
|
+
block formula text:
|
|
181
|
+
|
|
182
|
+
$$
|
|
183
|
+
\\Delta t' = \\frac{\\Delta t}{\\sqrt{1 - \\frac{v^2}{c^2}}}
|
|
184
|
+
$$
|
|
185
|
+
`,
|
|
186
|
+
},
|
|
187
|
+
};
|
|
188
|
+
|
|
170
189
|
export const Think: Story = {
|
|
171
190
|
render: StreamingComponent,
|
|
172
191
|
args: {
|