@fe-free/core 6.0.29 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 6.0.29
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "6.0.29",
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.29",
48
- "@fe-free/tool": "6.0.29"
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"
@@ -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: {