@fe-free/core 3.0.45 → 3.0.47
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 +16 -0
- package/package.json +3 -3
- package/src/markdown/index.tsx +2 -1
- package/src/markdown/knowledge_ref.tsx +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @fe-free/core
|
|
2
2
|
|
|
3
|
+
## 3.0.47
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: markdown
|
|
8
|
+
- @fe-free/icons@3.0.47
|
|
9
|
+
- @fe-free/tool@3.0.47
|
|
10
|
+
|
|
11
|
+
## 3.0.46
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- feat: markdown
|
|
16
|
+
- @fe-free/icons@3.0.46
|
|
17
|
+
- @fe-free/tool@3.0.46
|
|
18
|
+
|
|
3
19
|
## 3.0.45
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.47",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"antd": "^5.27.1",
|
|
47
47
|
"dayjs": "~1.11.10",
|
|
48
48
|
"react": "^19.2.0",
|
|
49
|
-
"@fe-free/icons": "3.0.
|
|
50
|
-
"@fe-free/tool": "3.0.
|
|
49
|
+
"@fe-free/icons": "3.0.47",
|
|
50
|
+
"@fe-free/tool": "3.0.47"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/src/markdown/index.tsx
CHANGED
|
@@ -10,9 +10,10 @@ import './style.scss';
|
|
|
10
10
|
|
|
11
11
|
interface MarkdownProps {
|
|
12
12
|
children: string;
|
|
13
|
-
knowledgeRefs?: { id: string
|
|
13
|
+
knowledgeRefs?: { id: string }[];
|
|
14
14
|
onKnowledgeRef?: (id?: string) => void;
|
|
15
15
|
}
|
|
16
|
+
|
|
16
17
|
function Markdown(props: MarkdownProps) {
|
|
17
18
|
const { children, knowledgeRefs, onKnowledgeRef } = props;
|
|
18
19
|
|
|
@@ -4,8 +4,6 @@ function KnowledgeRefBlock(props: any) {
|
|
|
4
4
|
const { knowledgeRefs, onKnowledgeRef } = props;
|
|
5
5
|
const id = props['data-id'];
|
|
6
6
|
|
|
7
|
-
console.log('KnowledgeRefBlock', props);
|
|
8
|
-
|
|
9
7
|
const handleClick = useCallback(() => {
|
|
10
8
|
onKnowledgeRef?.(id);
|
|
11
9
|
}, [id, onKnowledgeRef]);
|
|
@@ -36,7 +34,7 @@ function KnowledgeRefBlock(props: any) {
|
|
|
36
34
|
);
|
|
37
35
|
}
|
|
38
36
|
|
|
39
|
-
function processWithKnowledgeRef(text: string, knowledgeRefs?: { id: string
|
|
37
|
+
function processWithKnowledgeRef(text: string, knowledgeRefs?: { id: string }[]) {
|
|
40
38
|
// 匹配 [^knowledge:X-Y] 格式
|
|
41
39
|
const knowledgeRefRegex = /\[\^knowledge:(\d+-\d+)\]/g;
|
|
42
40
|
|
|
@@ -47,7 +45,7 @@ function processWithKnowledgeRef(text: string, knowledgeRefs?: { id: string; tit
|
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
if (count > 0 && knowledgeRefs && knowledgeRefs.length > 0) {
|
|
50
|
-
newText = `${newText}\n<knowledge-ref>来源>></knowledge>`;
|
|
48
|
+
newText = `${newText}\n\n<knowledge-ref>来源>></knowledge>`;
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
return newText;
|