yt-chat-components 0.2.0 → 0.3.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yt-chat-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"main": "build/static/js/bundle.min.js",
|
|
5
5
|
"module": "build/static/js/bundle.min.js",
|
|
6
6
|
"types": "build/static/js/index.d.ts",
|
|
@@ -9,9 +9,7 @@
|
|
|
9
9
|
"react-dom": "^17.0.0 || ^18.0.0"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"antd": "5.24.2",
|
|
13
12
|
"@ant-design/icons": "5.0.0",
|
|
14
|
-
"lodash": "^4.17.21",
|
|
15
13
|
"@testing-library/jest-dom": "^5.16.5",
|
|
16
14
|
"@testing-library/react": "^13.4.0",
|
|
17
15
|
"@testing-library/user-event": "^13.5.0",
|
|
@@ -19,10 +17,12 @@
|
|
|
19
17
|
"@types/node": "^16.18.37",
|
|
20
18
|
"@types/react": "^18.2.14",
|
|
21
19
|
"@types/react-dom": "^18.2.6",
|
|
20
|
+
"antd": "5.24.2",
|
|
22
21
|
"axios": "^1.4.0",
|
|
22
|
+
"lodash": "^4.17.21",
|
|
23
23
|
"lucide-react": "^0.256.0",
|
|
24
|
-
"react": "^18.
|
|
25
|
-
"react-dom": "^18.
|
|
24
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
25
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
26
26
|
"react-markdown": "^8.0.7",
|
|
27
27
|
"react-scripts": "5.0.1",
|
|
28
28
|
"react-shadow": "^20.3.0",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"typescript": "^4.9.5",
|
|
32
32
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
33
33
|
"uuid": "^10.0.0",
|
|
34
|
-
"web-vitals": "^2.1.4"
|
|
34
|
+
"web-vitals": "^2.1.4",
|
|
35
|
+
"yt-chat-components": "^0.2.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"start": "react-scripts start",
|
|
@@ -347,7 +347,7 @@ export class ToolDialog extends React.Component {
|
|
|
347
347
|
// 获取历史对话列表
|
|
348
348
|
getHistoryList = (sceneData) => {
|
|
349
349
|
const realFlowId = sceneData?.flows[0].id || this.props.flowId;
|
|
350
|
-
if(sceneData){
|
|
350
|
+
if(!isEmpty(sceneData)){
|
|
351
351
|
const currentFlow = sceneData.flows[0];
|
|
352
352
|
const dropDownList = this.getDropDownList(currentFlow.welcome_words);
|
|
353
353
|
this.setState({ currentFlow, dropDownList })
|
|
@@ -391,8 +391,8 @@ export class ToolDialog extends React.Component {
|
|
|
391
391
|
|
|
392
392
|
render() {
|
|
393
393
|
const dialogHeight = 650;
|
|
394
|
-
const { title, flowId, hostUrl, setDialogVisible, userInfo, boxStyle, isShowSideRight } = this.props;
|
|
395
|
-
const { sceneInfo, currentFlow } = this.state;
|
|
394
|
+
const { title, flowId, hostUrl, setDialogVisible, userInfo, boxStyle, isShowSideRight, tags = [] } = this.props;
|
|
395
|
+
const { sceneInfo, currentFlow = {} } = this.state;
|
|
396
396
|
const { flows=[], name: sceneName } = sceneInfo;
|
|
397
397
|
return (
|
|
398
398
|
<div style={boxStyle}>
|
|
@@ -449,9 +449,9 @@ export class ToolDialog extends React.Component {
|
|
|
449
449
|
</div>
|
|
450
450
|
<div className="p_toolRight">
|
|
451
451
|
<ChatWidget
|
|
452
|
-
window_title={currentFlow
|
|
453
|
-
flow_id={currentFlow
|
|
454
|
-
tags={currentFlow?.keywords||
|
|
452
|
+
window_title={currentFlow?.name || title}
|
|
453
|
+
flow_id={currentFlow?.id || flowId}
|
|
454
|
+
tags={currentFlow?.keywords || tags}
|
|
455
455
|
host_url={hostUrl}
|
|
456
456
|
api_key={api_key}
|
|
457
457
|
session_id={this.state.sessionId}
|
package/src/chatWidget/index.tsx
CHANGED
|
@@ -2178,14 +2178,8 @@ input::-ms-input-placeholder { /* Microsoft Edge */
|
|
|
2178
2178
|
window_title={"测试"}
|
|
2179
2179
|
input_container_style={input_container_style}
|
|
2180
2180
|
tweaks={tweaks}
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
// 学涯
|
|
2184
|
-
flowId={"a8e7ebd8-9bf7-499b-9e4a-c235078a0910"}
|
|
2185
|
-
// 心理
|
|
2186
|
-
// flowId={"2d5ae455-86d8-4769-833b-7815c38ac859"}
|
|
2187
|
-
// hostUrl={"http://localhost:7860"}
|
|
2188
|
-
hostUrl={"https://ai-api.yuntu.cn"}
|
|
2181
|
+
flowId={flow_id}
|
|
2182
|
+
hostUrl={host_url}
|
|
2189
2183
|
updateLastMessage={updateLastMessage}
|
|
2190
2184
|
addMessage={addMessage}
|
|
2191
2185
|
messages={messages}
|
|
Binary file
|