@baishuyun/chat-sdk 1.0.2 → 1.0.3
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/.turbo/turbo-build.log +16 -76
- package/CHANGELOG.md +9 -0
- package/dist/chat-sdk.js +7634 -7637
- package/dist/chat-sdk.js.map +1 -1
- package/dist/chat-sdk.umd.cjs +118 -118
- package/dist/chat-sdk.umd.cjs.map +1 -1
- package/package.json +5 -5
- package/src/lib/utils.ts +2 -2
- package/src/plugins/form-builder-plugin/components/fields-part.tsx +1 -1
- package/src/plugins/form-filling-plugin/components/first-batch-generating-animation.tsx +9 -3
- package/src/plugins/form-filling-plugin/hooks/use-fields-data.ts +3 -3
- package/src/plugins/form-filling-plugin/hooks/use-conversation-id-in-ctx.ts +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baishuyun/chat-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "src/index.jsx",
|
|
6
6
|
"module": "dist/chat-sdk.js",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"tw-animate-css": "^1.4.0",
|
|
36
36
|
"use-stick-to-bottom": "^1.1.1",
|
|
37
37
|
"zustand": "^5.0.8",
|
|
38
|
-
"@baishuyun/ai-design": "1.0.
|
|
39
|
-
"@baishuyun/agents": "1.0.
|
|
38
|
+
"@baishuyun/ai-design": "1.0.3",
|
|
39
|
+
"@baishuyun/agents": "1.0.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@storybook/react-vite": "^10.1.11",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"tailwindcss": "^4.1.17",
|
|
53
53
|
"vite": "^5.1.4",
|
|
54
54
|
"vite-plugin-dts": "^4.5.4",
|
|
55
|
-
"@baishuyun/
|
|
56
|
-
"@baishuyun/
|
|
55
|
+
"@baishuyun/types": "2.0.2",
|
|
56
|
+
"@baishuyun/typescript-config": "1.0.2"
|
|
57
57
|
},
|
|
58
58
|
"exports": {
|
|
59
59
|
".": {
|
package/src/lib/utils.ts
CHANGED
|
@@ -38,7 +38,7 @@ export const extractTextPartMeta = (part: any) => {
|
|
|
38
38
|
|
|
39
39
|
export const IsFieldsJsonPart = (part: any): boolean => {
|
|
40
40
|
const payload = extractTextPartMeta(part);
|
|
41
|
-
return payload?.type === 'mcp-fields-json';
|
|
41
|
+
return payload?.type === 'mcp-fields-json' || payload?.deprecatedType === 'mcp-fields-json';
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const IsQueryResultPart = (part: any): boolean => {
|
|
@@ -133,7 +133,7 @@ export const getMetaErrorMsg = (part: any): string => {
|
|
|
133
133
|
|
|
134
134
|
export const GetFieldJsonInfo = (part: any): IFilledField | null => {
|
|
135
135
|
const payload = extractTextPartMeta(part);
|
|
136
|
-
if (payload?.type !== 'mcp-fields-json') {
|
|
136
|
+
if (payload?.type !== 'mcp-fields-json' && payload?.deprecatedType !== 'mcp-fields-json') {
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
139
|
|
|
@@ -56,7 +56,7 @@ export const FieldsPart: React.FC<MsgPartCompProps & IExtraPartProps> = (props)
|
|
|
56
56
|
>
|
|
57
57
|
{status === 'ready' ? (
|
|
58
58
|
<PrimaryConfirmBtn
|
|
59
|
-
className="mt-
|
|
59
|
+
className="mt-5 mb-2.5"
|
|
60
60
|
disabledWithInfo={fieldsConfirmed}
|
|
61
61
|
onClick={() => {
|
|
62
62
|
evtBus.emit(
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BorderColorAnimation } from '@baishuyun/ai-design/border-color-animation';
|
|
2
2
|
import { GenerateAnimation } from '@baishuyun/ai-design/generate-animation';
|
|
3
3
|
import { memo } from 'react';
|
|
4
4
|
|
|
5
5
|
export const FirstBatchGeneratingAnimation = memo(() => {
|
|
6
6
|
return (
|
|
7
|
-
<
|
|
7
|
+
<BorderColorAnimation
|
|
8
|
+
width="100%"
|
|
9
|
+
height={40}
|
|
10
|
+
borderRadius={4}
|
|
11
|
+
borderWidth={1}
|
|
12
|
+
style={{ display: 'flex', alignItems: 'center', padding: '0 10px' }}
|
|
13
|
+
>
|
|
8
14
|
<GenerateAnimation>数据生成中,可点击下方按钮暂停</GenerateAnimation>
|
|
9
|
-
</
|
|
15
|
+
</BorderColorAnimation>
|
|
10
16
|
);
|
|
11
17
|
});
|
|
@@ -79,10 +79,10 @@ const createFieldConfig = (
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
export const useFieldsData = (
|
|
82
|
-
part: TextUIPart
|
|
83
|
-
formFillingCtx: FormFillingPluginCtx | null
|
|
82
|
+
part: TextUIPart
|
|
83
|
+
// formFillingCtx: FormFillingPluginCtx | null
|
|
84
84
|
): IFieldsData => {
|
|
85
|
-
const evtBus = useEvtBus();
|
|
85
|
+
// const evtBus = useEvtBus();
|
|
86
86
|
|
|
87
87
|
const rawFieldParts = useMemo(() => extractFieldParts(part), [part]);
|
|
88
88
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
|
-
import { FormFillingPluginCtx } from '../types';
|
|
3
|
-
|
|
4
|
-
export const useConversationIdInCtx = (
|
|
5
|
-
ctx: FormFillingPluginCtx | null,
|
|
6
|
-
conversationId?: string
|
|
7
|
-
) => {
|
|
8
|
-
useEffect(() => {
|
|
9
|
-
if (ctx && conversationId) {
|
|
10
|
-
ctx.conversationId = conversationId;
|
|
11
|
-
}
|
|
12
|
-
}, [ctx, conversationId]);
|
|
13
|
-
};
|