@fe-free/ai 4.1.13 → 4.1.15
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 +18 -0
- package/package.json +4 -4
- package/src/markdown/index.tsx +0 -1
- package/src/messages/message_actions.tsx +22 -6
- package/src/sender/index.tsx +0 -1
- package/src/store/types.ts +1 -1
- package/src/style.scss +77 -0
- package/src/markdown/style.scss +0 -38
- package/src/sender/style.scss +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @fe-free/ai
|
|
2
2
|
|
|
3
|
+
## 4.1.15
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat: ai
|
|
8
|
+
- @fe-free/core@4.1.15
|
|
9
|
+
- @fe-free/icons@4.1.15
|
|
10
|
+
- @fe-free/tool@4.1.15
|
|
11
|
+
|
|
12
|
+
## 4.1.14
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- feat: ai
|
|
17
|
+
- @fe-free/core@4.1.14
|
|
18
|
+
- @fe-free/icons@4.1.14
|
|
19
|
+
- @fe-free/tool@4.1.14
|
|
20
|
+
|
|
3
21
|
## 4.1.13
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/ai",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.15",
|
|
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.
|
|
22
|
+
"@fe-free/core": "4.1.15"
|
|
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.
|
|
33
|
-
"@fe-free/tool": "4.1.
|
|
32
|
+
"@fe-free/icons": "4.1.15",
|
|
33
|
+
"@fe-free/tool": "4.1.15"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"test": "echo \"Error: no test specified\" && exit 1",
|
package/src/markdown/index.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import classNames from 'classnames';
|
|
|
7
7
|
import { useMemo } from 'react';
|
|
8
8
|
import { CodeComponent } from './code';
|
|
9
9
|
import { KnowledgeRefBlock, processWithKnowledgeRef } from './knowledge_ref';
|
|
10
|
-
import './style.scss';
|
|
11
10
|
import { ThinkComponent, compatibleWithDeepSeek } from './think';
|
|
12
11
|
|
|
13
12
|
interface MarkdownProps {
|
|
@@ -34,13 +34,21 @@ function MessageActionOfCopy({ value, onCopied }: { value: string; onCopied?: ()
|
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function MessageActionOfLike({
|
|
38
|
-
|
|
37
|
+
function MessageActionOfLike({
|
|
38
|
+
active: propsActive,
|
|
39
|
+
onClick,
|
|
40
|
+
}: {
|
|
41
|
+
active?: boolean;
|
|
42
|
+
onClick?: (active: boolean) => Promise<void>;
|
|
43
|
+
}) {
|
|
44
|
+
const { message } = App.useApp();
|
|
45
|
+
const [active, setActive] = useState(propsActive || false);
|
|
39
46
|
|
|
40
47
|
const handleClick = useCallback(async () => {
|
|
41
48
|
await Promise.resolve(onClick?.(!active));
|
|
42
49
|
setActive(!active);
|
|
43
|
-
|
|
50
|
+
message.success(!active ? '点赞成功' : '取消点赞成功');
|
|
51
|
+
}, [onClick, active, message]);
|
|
44
52
|
|
|
45
53
|
return (
|
|
46
54
|
<Tooltip title={active ? '取消点赞' : '点赞'}>
|
|
@@ -55,13 +63,21 @@ function MessageActionOfLike({ onClick }: { onClick?: (active: boolean) => Promi
|
|
|
55
63
|
);
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
function MessageActionOfDislike({
|
|
59
|
-
|
|
66
|
+
function MessageActionOfDislike({
|
|
67
|
+
active: propsActive,
|
|
68
|
+
onClick,
|
|
69
|
+
}: {
|
|
70
|
+
active?: boolean;
|
|
71
|
+
onClick?: (active: boolean) => Promise<void>;
|
|
72
|
+
}) {
|
|
73
|
+
const [active, setActive] = useState(propsActive || false);
|
|
74
|
+
const { message } = App.useApp();
|
|
60
75
|
|
|
61
76
|
const handleClick = useCallback(async () => {
|
|
62
77
|
await Promise.resolve(onClick?.(!active));
|
|
63
78
|
setActive(!active);
|
|
64
|
-
|
|
79
|
+
message.success(!active ? '点踩成功' : '取消点踩成功');
|
|
80
|
+
}, [onClick, active, message]);
|
|
65
81
|
|
|
66
82
|
return (
|
|
67
83
|
<Tooltip title={active ? '取消点踩' : '点踩'}>
|
package/src/sender/index.tsx
CHANGED
|
@@ -7,7 +7,6 @@ import { useCallback, useMemo, useRef, useState } from 'react';
|
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { Actions } from './actions';
|
|
9
9
|
import { FileUpload, Files } from './files';
|
|
10
|
-
import './style.scss';
|
|
11
10
|
import type { SenderProps, SenderRef } from './types';
|
|
12
11
|
|
|
13
12
|
function Text(props: SenderProps & { refText: RefObject<HTMLTextAreaElement> }) {
|
package/src/store/types.ts
CHANGED
package/src/style.scss
CHANGED
|
@@ -1,3 +1,80 @@
|
|
|
1
|
+
.fea-markdown.x-markdown {
|
|
2
|
+
--hr-margin: 1em 0;
|
|
3
|
+
--margin-ul-ol: 0;
|
|
4
|
+
--margin-block: 0 0 8px 0;
|
|
5
|
+
|
|
6
|
+
ul,
|
|
7
|
+
ol {
|
|
8
|
+
li {
|
|
9
|
+
margin: 0;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&.x-markdown-light pre code:not([class$='-highlightCode-code'] pre code) {
|
|
14
|
+
padding: 0 !important;
|
|
15
|
+
background-color: transparent !important;
|
|
16
|
+
margin: 0 !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.fea-markdown-body-block-chart {
|
|
20
|
+
background: white;
|
|
21
|
+
border-radius: 6px;
|
|
22
|
+
margin: 0.5rem;
|
|
23
|
+
|
|
24
|
+
.fea-markdown-body-block-chart-title {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: bold;
|
|
27
|
+
padding: 10px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.fea-markdown-body-block-knowledge-ref[data-id] {
|
|
32
|
+
height: 16px;
|
|
33
|
+
min-width: 16px;
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
display: inline-flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
border-radius: 999px;
|
|
39
|
+
border: 1px solid #0374e9;
|
|
40
|
+
color: #0374e9;
|
|
41
|
+
font-size: 12px;
|
|
42
|
+
padding: 0 4px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.fea-markdown-body-block-knowledge-ref-source {
|
|
46
|
+
color: #0374e9;
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.fea-sender {
|
|
52
|
+
.ant-upload-select {
|
|
53
|
+
display: none !important;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ant-upload-list {
|
|
57
|
+
display: none !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.ant-upload-wrapper {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.fea-sender-drag-hover {
|
|
65
|
+
.ant-upload-wrapper {
|
|
66
|
+
display: block;
|
|
67
|
+
position: absolute;
|
|
68
|
+
inset: 0;
|
|
69
|
+
z-index: 10;
|
|
70
|
+
|
|
71
|
+
.ant-upload-drag {
|
|
72
|
+
border-color: theme('colors.primary');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
1
78
|
@keyframes fea-sender-rectangle-white {
|
|
2
79
|
0%,
|
|
3
80
|
80%,
|
package/src/markdown/style.scss
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
.fea-markdown {
|
|
2
|
-
&.x-markdown-light pre code:not([class$='-highlightCode-code'] pre code) {
|
|
3
|
-
padding: 0 !important;
|
|
4
|
-
background-color: transparent !important;
|
|
5
|
-
margin: 0 !important;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.fea-markdown-body-block-chart {
|
|
9
|
-
background: white;
|
|
10
|
-
border-radius: 6px;
|
|
11
|
-
margin: 0.5rem;
|
|
12
|
-
|
|
13
|
-
.fea-markdown-body-block-chart-title {
|
|
14
|
-
font-size: 16px;
|
|
15
|
-
font-weight: bold;
|
|
16
|
-
padding: 10px;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.fea-markdown-body-block-knowledge-ref[data-id] {
|
|
21
|
-
height: 16px;
|
|
22
|
-
min-width: 16px;
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
display: inline-flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
justify-content: center;
|
|
27
|
-
border-radius: 999px;
|
|
28
|
-
border: 1px solid #0374e9;
|
|
29
|
-
color: #0374e9;
|
|
30
|
-
font-size: 12px;
|
|
31
|
-
padding: 0 4px;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.fea-markdown-body-block-knowledge-ref-source {
|
|
35
|
-
color: #0374e9;
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/sender/style.scss
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
.fea-sender {
|
|
2
|
-
.ant-upload-select {
|
|
3
|
-
display: none !important;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.ant-upload-list {
|
|
7
|
-
display: none !important;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.ant-upload-wrapper {
|
|
11
|
-
display: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
&.fea-sender-drag-hover {
|
|
15
|
-
.ant-upload-wrapper {
|
|
16
|
-
display: block;
|
|
17
|
-
position: absolute;
|
|
18
|
-
inset: 0;
|
|
19
|
-
z-index: 10;
|
|
20
|
-
|
|
21
|
-
.ant-upload-drag {
|
|
22
|
-
border-color: theme('colors.primary');
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|