@fe-free/ai 4.1.32 → 4.1.33

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,14 @@
1
1
  # @fe-free/ai
2
2
 
3
+ ## 4.1.33
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: ai
8
+ - @fe-free/core@4.1.33
9
+ - @fe-free/icons@4.1.33
10
+ - @fe-free/tool@4.1.33
11
+
3
12
  ## 4.1.32
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/ai",
3
- "version": "4.1.32",
3
+ "version": "4.1.33",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -19,7 +19,7 @@
19
19
  "lodash-es": "^4.17.21",
20
20
  "uuid": "^13.0.0",
21
21
  "zustand": "^4.5.7",
22
- "@fe-free/core": "4.1.32"
22
+ "@fe-free/core": "4.1.33"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "antd": "^5.27.1",
@@ -29,8 +29,8 @@
29
29
  "i18next-icu": "^2.4.1",
30
30
  "react": "^19.2.0",
31
31
  "react-i18next": "^16.4.0",
32
- "@fe-free/icons": "4.1.32",
33
- "@fe-free/tool": "4.1.32"
32
+ "@fe-free/icons": "4.1.33",
33
+ "@fe-free/tool": "4.1.33"
34
34
  },
35
35
  "scripts": {
36
36
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -1,10 +1,8 @@
1
1
  import { CodeHighlighter, Mermaid } from '@ant-design/x';
2
2
  import type { ComponentProps } from '@ant-design/x-markdown';
3
- import classNames from 'classnames';
4
3
  import { memo } from 'react';
5
4
  import { ChartBlock } from './chart';
6
5
  import { HMChartBlock } from './hm_chart';
7
- import { PartialHtml } from './partial_html';
8
6
 
9
7
  const CodeComponent = memo((props: ComponentProps) => {
10
8
  const { className, children } = props;
@@ -25,12 +23,6 @@ const CodeComponent = memo((props: ComponentProps) => {
25
23
  return <HMChartBlock>{children}</HMChartBlock>;
26
24
  }
27
25
 
28
- if (lang === 'pptpartialhtml') {
29
- return (
30
- <PartialHtml srcDoc={children} className={classNames('aspect-[16/9] w-full', className)} />
31
- );
32
- }
33
-
34
26
  return <CodeHighlighter lang={lang}>{children}</CodeHighlighter>;
35
27
  });
36
28
 
@@ -86,8 +86,9 @@ function CustomMarkdown(props: CustomMarkdownProps) {
86
86
  const { content: propsContent = '', knowledgeRefs, onKnowledgeRef } = props;
87
87
 
88
88
  const content = useMemo(() => {
89
- return processWithKnowledgeRef(compatibleWithDeepSeek(propsContent));
90
- }, [propsContent]);
89
+ const newContent = compatibleWithDeepSeek(propsContent);
90
+ return processWithKnowledgeRef(newContent, knowledgeRefs);
91
+ }, [propsContent, knowledgeRefs]);
91
92
 
92
93
  const KnowledgeRefComponent = useMemo(
93
94
  () => (p: any) => {
@@ -44,8 +44,9 @@ function processWithKnowledgeRef(text: string, knowledgeRefs?: { id: string }[])
44
44
  return `<knowledge-ref data-id="${id}">${id}</knowledge-ref>`;
45
45
  });
46
46
 
47
+ console.log('newText', newText);
47
48
  if (count > 0 && knowledgeRefs && knowledgeRefs.length > 0) {
48
- newText = `${newText}\n\n<knowledge-ref>来源&gt;&gt;</knowledge>`;
49
+ newText = `${newText}\n\n<knowledge-ref>来源&gt;&gt;</knowledge-ref>`;
49
50
  }
50
51
 
51
52
  return newText;
@@ -1,29 +0,0 @@
1
- import classNames from 'classnames';
2
- import { useEffect, useMemo, useRef } from 'react';
3
- import { completeHtml } from '../helper/complete';
4
-
5
- function PartialHtml({ srcDoc: propsSrcDoc, className }: { srcDoc: string; className?: string }) {
6
- const ref = useRef<HTMLIFrameElement>(null);
7
-
8
- const srcDoc = useMemo(() => {
9
- return completeHtml(propsSrcDoc);
10
- }, [propsSrcDoc]);
11
-
12
- useEffect(() => {
13
- if (ref.current?.contentDocument) {
14
- ref.current.contentDocument.open();
15
- ref.current.contentDocument.write(srcDoc);
16
- ref.current.contentDocument.close();
17
- }
18
- }, [srcDoc]);
19
-
20
- return (
21
- <iframe
22
- ref={ref}
23
- className={classNames('border border-01', className)}
24
- sandbox="allow-scripts allow-same-origin"
25
- />
26
- );
27
- }
28
-
29
- export { PartialHtml };