yt-chat-components 1.4.8 → 1.5.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": "1.4.8",
3
+ "version": "1.5.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",
package/public/index.html CHANGED
@@ -124,6 +124,7 @@
124
124
  is-show-upload-button=false
125
125
  drop-man-url="https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/ai/ai_man01.png"
126
126
  banner-map='{"a":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/banner.png","b":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/banner.png","c":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/banner.png"}'
127
+ asset-map='{"sendMessageUrl":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/sendMessage.png","stopMessageUrl":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/stopMessage.png","speakUrl":"https://trans-from-yuntu-resourse.oss-cn-beijing.aliyuncs.com/smartSchool/appCreator/school/bcyz/user/ai/speak.png"}'
127
128
  />
128
129
  </body>
129
130
  </html>
@@ -178,10 +178,11 @@
178
178
  */
179
179
 
180
180
  .w_send_voice_box {
181
- height: 23px;
181
+ height: 100%;
182
+ align-items: end;
183
+ padding-bottom: 16px;
182
184
  display: flex;
183
185
  background: transparent;
184
- align-items: center;
185
186
  justify-content: center;
186
187
  border-radius: 24px;
187
188
  font-size: 12px;
@@ -158,7 +158,7 @@ export default function ChatWindow({
158
158
  const isStream = true;//是否流式输出(手动开关)
159
159
  const [recordState, setRecordState] = useState(false); // 录音状态。true为正在录音,false为停止录音
160
160
  const [tagList, setTagList] = useState([]); // 问题标签列表
161
- const {isTitleSideIcon, logoWidth, agentUrl} = baseConfig;
161
+ const {isTitleSideIcon, logoWidth, agentUrl, stopMessageUrl, sendMessageUrl, speakUrl} = baseConfig;
162
162
  const [inputContainerHeight, setInputContainerHeight] = useState('120px')
163
163
  let content_id: string = null
164
164
  let content_ns: string = null
@@ -1219,7 +1219,7 @@ export default function ChatWindow({
1219
1219
  style={receivingMessage ? {cursor: 'not-allowed'} : {}}
1220
1220
  onClick={startRecord}
1221
1221
  >
1222
- <img src={recordState ? soundWavePng : luyinPng} style={{width: 23}}
1222
+ <img src={recordState ? soundWavePng : (speakUrl || luyinPng)} style={{width: 35}}
1223
1223
  className={recordState ? "w_recordIng" : ''}></img>
1224
1224
  </div>
1225
1225
  </Tooltip>
@@ -1252,10 +1252,11 @@ export default function ChatWindow({
1252
1252
  <button
1253
1253
  style={{
1254
1254
  ...(receivingMessage ? {cursor: 'pointer'} : {}),
1255
- padding: '0 13px',
1255
+ height:'100%',
1256
+ padding: '0 13px 16px',
1256
1257
  background: 'transparent',
1257
1258
  display: 'flex',
1258
- alignItems: 'center',
1259
+ alignItems: 'end',
1259
1260
  justifyContent: 'center'
1260
1261
  }}
1261
1262
  onClick={() => {
@@ -1273,7 +1274,10 @@ export default function ChatWindow({
1273
1274
  }
1274
1275
  }}
1275
1276
  >
1276
- <img src={receivingMessage ? stopmessagePng : sendmessagePng} style={{width: 55}}/>
1277
+ <img
1278
+ src={receivingMessage ? (stopMessageUrl || stopmessagePng) : (sendMessageUrl || sendmessagePng)}
1279
+ style={{width: 35}}
1280
+ />
1277
1281
  </button>
1278
1282
  </Tooltip>
1279
1283
  </div>
@@ -737,7 +737,7 @@ margin-bottom:1rem;
737
737
  }
738
738
 
739
739
  .cl-input-element::placeholder {
740
- line-height:45px;
740
+ // line-height:45px;
741
741
  }
742
742
 
743
743
  .cl-input-element:focus {
@@ -2441,10 +2441,11 @@ export const yt_style = `
2441
2441
  }
2442
2442
 
2443
2443
  .w_send_voice_box {
2444
- height: 23px;
2444
+ height: 100%;
2445
+ align-items: end;
2446
+ padding-bottom: 16px;
2445
2447
  display: flex;
2446
2448
  background: transparent;
2447
- align-items: center;
2448
2449
  justify-content: center;
2449
2450
  border-radius: 24px;
2450
2451
  font-size: 12px;
@@ -16,7 +16,7 @@ const commentSvg = ()=> (
16
16
  p-id="3118" width="24" height="20">
17
17
  <path
18
18
  d="M806.9 155.2H217.2c-64 0-116.1 55.6-116.1 124v380c0 68.4 52.1 124 116.1 124h101.3l-5.9 101.6c-0.5 9.4 4.5 18.3 12.8 22.6 3.5 1.8 7.3 2.8 11.2 2.8 5.2 0 10.4-1.7 14.7-5.1l156.8-122h298.7c64 0 116.1-55.6 116.1-124v-380c0.1-68.3-52-123.9-116-123.9zM303 528.7c-33.1 0-60-26.9-60-60s26.9-60 60-60 60 26.9 60 60-26.8 60-60 60z m209 1c-33.1 0-60-26.9-60-60s26.9-60 60-60 60 26.9 60 60-26.8 60-60 60z m209-1c-33.1 0-60-26.9-60-60s26.9-60 60-60 60 26.9 60 60-26.8 60-60 60z"
19
- p-id="3119" fill="#bfbfbf"></path>
19
+ p-id="3119"></path>
20
20
  </svg>
21
21
  )
22
22
  const CommentIcon = (props) => (
@@ -43,6 +43,7 @@ const style = `
43
43
  border-radius:8px;
44
44
  display: flex;
45
45
  flex-direction: column;
46
+ justify-content: space-between;
46
47
  }
47
48
  .p_toolDialog .p_sign{
48
49
  width: calc(100vw - 140px);
@@ -51,9 +52,9 @@ const style = `
51
52
  }
52
53
 
53
54
  .dialog_box{
54
- margin: 24px auto 0;
55
+ margin: 1.5rem auto 0;
55
56
  width: calc(100vw - 140px);
56
- height: calc(100vh - 200px);
57
+ height: calc(100vh - 192px);
57
58
  background: #fff;
58
59
  border-radius: 15px;
59
60
  display: flex;
@@ -100,8 +101,8 @@ const style = `
100
101
 
101
102
  .p_toolDialog .p_toolLeft .p_historyDialog {
102
103
  user-select: none;
103
- margin-top: 20px;
104
- margin-bottom: 20px;
104
+ margin-top: 24px;
105
+ margin-bottom: 24px;
105
106
  border-radius: 10px;
106
107
  flex: 1;
107
108
  width: 100%;
@@ -169,25 +170,26 @@ const style = `
169
170
  .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem {
170
171
  padding: 10px 16px;
171
172
  padding-left: 0;
172
- margin-bottom:4px;
173
+
173
174
  }
174
175
 
175
176
  .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem:hover{
176
177
  background: #F5F5F5;
177
178
  border-radius: 9px;
179
+ color: #1552FF
178
180
  }
179
181
 
180
182
  .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem:hover .p_historyName{
181
- color: #1552FF
183
+
182
184
  }
183
185
 
184
186
  .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_activeItem{
185
- background: #F5F5F5;
187
+ background: #1974FF !important;
186
188
  border-radius: 9px;
189
+ color:#FFFFFF !important;
187
190
  }
188
191
 
189
192
  .p_toolDialog .p_toolLeft .p_historyDialog .p_historyList .p_historyItem .p_historyName {
190
- color: #333333;
191
193
  overflow: hidden;
192
194
  text-overflow: ellipsis;
193
195
  white-space: nowrap;
@@ -270,6 +272,11 @@ const style = `
270
272
  .p_newDialog .p_newDialogText {
271
273
  margin-left: 6px;
272
274
  }
275
+ .p_footer{
276
+ text-align: center;
277
+ margin-bottom: 1.5rem;
278
+ margin-top: 1.5rem;
279
+ }
273
280
  `
274
281
 
275
282
  const defaultList = [
@@ -412,6 +419,7 @@ export class ToolDialogV2 extends React.Component {
412
419
  logoWidth = '42px',
413
420
  logoFontSize = '26px',
414
421
  isTitleSideIcon = false,// 是否将左侧历史顶部icon移到中间顶部左侧蓝点位置
422
+ assetMap,
415
423
  modalIndex,
416
424
  isShowUploadButton = false,
417
425
  dropManUrl,
@@ -427,7 +435,7 @@ export class ToolDialogV2 extends React.Component {
427
435
  <div className="p_toolDialog">
428
436
  {/*对话上边的学校标志,定位到左上角header上端*/}
429
437
  <div className={'p_sign'} >
430
- <img src={signUrl} style={{ width: 600, marginTop: '50px', }}/>
438
+ <img src={signUrl} style={{ width: 600, marginTop: '1.5rem', }}/>
431
439
  </div>
432
440
  <div className={"dialog_box"}>
433
441
  <div className="p_toolLogo">
@@ -472,7 +480,10 @@ export class ToolDialogV2 extends React.Component {
472
480
  <div
473
481
  className={`p_historyName ${item.session_id === this.state.sessionId ? 'p_activeHistoryName' : ''}`}
474
482
  >
475
- <CommentIcon style={{marginRight:'8px'}}/>
483
+ <CommentIcon style={{
484
+ marginRight: '8px',
485
+ fill: item.session_id === this.state.sessionId ? '#FFFFFF' : '#bfbfbf'
486
+ }}/>
476
487
  <span>{item.text}</span>
477
488
  </div>
478
489
  </div>
@@ -501,7 +512,7 @@ export class ToolDialogV2 extends React.Component {
501
512
  getHistoryList={this.getHistoryList}
502
513
  setDropDownList={(list) => this.setState({ dropDownList: list })}
503
514
  dropDownList={this.state.dropDownList}
504
- baseConfig={{ isTitleSideIcon, logoWidth, agentUrl }}
515
+ baseConfig={{ isTitleSideIcon, logoWidth, agentUrl, ...assetMap }}
505
516
  isShowUploadButton={isShowUploadButton}
506
517
  dropManUrl={currentFlow.character}
507
518
  modalWidth={modalWidth}
@@ -537,7 +548,7 @@ export class ToolDialogV2 extends React.Component {
537
548
  </div>
538
549
  </div>
539
550
  </div>
540
- <div style={{textAlign: 'center', marginTop: 20}}><span style={{fontSize: 16}}>技术支持:北京云图科技有限公司</span></div>
551
+ <div className={'p_footer'}><span style={{fontSize: 16}}>技术支持:北京云图科技有限公司</span></div>
541
552
  </div>
542
553
  </div>
543
554
  );
@@ -8,6 +8,7 @@
8
8
  border-radius: 8px;
9
9
  display: flex;
10
10
  flex-direction: column;
11
+ justify-content: space-between;
11
12
  }
12
13
 
13
14
  .toolDialogSign {
@@ -17,9 +18,9 @@
17
18
  }
18
19
 
19
20
  .dialogBox {
20
- margin: 24px auto 0;
21
+ margin: 1.5rem auto 0;
21
22
  width: calc(100vw - 140px);
22
- height: calc(100vh - 200px);
23
+ height: calc(100vh - 192px);
23
24
  background: #fff;
24
25
  border-radius: 15px;
25
26
  display: flex;
@@ -65,8 +66,8 @@
65
66
 
66
67
  .historyDialog {
67
68
  user-select: none;
68
- margin-top: 20px;
69
- margin-bottom: 20px;
69
+ margin-top: 24px;
70
+ margin-bottom: 24px;
70
71
  border-radius: 10px;
71
72
  flex: 1;
72
73
  width: 100%;
@@ -112,7 +113,7 @@
112
113
  height: calc(100% - 1.7rem);
113
114
  margin-top: 10px;
114
115
  overflow-y: auto;
115
- scrollbar-width: none !important;
116
+ scrollbar-width: none !important; /* firefox */
116
117
  }
117
118
 
118
119
  .historyList::-webkit-scrollbar {
@@ -120,32 +121,28 @@
120
121
  }
121
122
 
122
123
  .historyList:hover {
123
- scrollbar-width: thin !important;
124
+ scrollbar-width: thin !important; /* firefox */
124
125
  scrollbar-color: #ced4e3 transparent;
125
126
  }
126
127
 
127
128
  .historyItem {
128
129
  padding: 10px 16px;
129
130
  padding-left: 0;
130
- margin-bottom: 4px;
131
131
  }
132
132
 
133
133
  .historyItem:hover {
134
134
  background: #F5F5F5;
135
135
  border-radius: 9px;
136
- }
137
-
138
- .historyItem:hover .historyName {
139
136
  color: #1552FF;
140
137
  }
141
138
 
142
139
  .activeItem {
143
- background: #F5F5F5;
140
+ background: #1974FF !important;
144
141
  border-radius: 9px;
142
+ color: #FFFFFF !important;
145
143
  }
146
144
 
147
145
  .historyName {
148
- color: #333333;
149
146
  overflow: hidden;
150
147
  text-overflow: ellipsis;
151
148
  white-space: nowrap;
@@ -188,17 +185,17 @@
188
185
  border-radius: 12px;
189
186
  }
190
187
 
191
- .carousel .slick-dots-bottom {
188
+ .carousel .slickDotsBottom {
192
189
  justify-content: end;
193
190
  right: 12px;
194
191
  bottom: -10px;
195
192
  }
196
193
 
197
- :where(.css-dev-only-do-not-override-1v613y0).ant-carousel .slick-dots li.slick-active::after {
194
+ .antCarousel .slickDots li.slickActive::after {
198
195
  background: #1974FF;
199
196
  }
200
197
 
201
- :where(.css-dev-only-do-not-override-1v613y0).ant-carousel .slick-dots li button {
198
+ .antCarousel .slickDots li button {
202
199
  background: #000000;
203
200
  }
204
201
 
@@ -229,4 +226,10 @@
229
226
 
230
227
  .newDialogText {
231
228
  margin-left: 6px;
229
+ }
230
+
231
+ .footer {
232
+ text-align: center;
233
+ margin-bottom: 1.5rem;
234
+ margin-top: 1.5rem;
232
235
  }