yt-chat-components 1.0.9 → 1.1.1

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.0.9",
3
+ "version": "1.1.1",
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",
@@ -140,7 +140,7 @@ export default function ChatMessage({
140
140
 
141
141
  const renderUserMessage = () => {
142
142
  return (
143
- <div className="msg_userMessageBox">
143
+ <div style={user_message_style} className="msg_userMessageBox">
144
144
  <div style={user_message_style} className="cl-user_message">
145
145
  {message.message}
146
146
  </div>
@@ -832,13 +832,15 @@ export default function ChatWindow({
832
832
  {
833
833
  display: tagList?.length > 0 ? '' : 'none',
834
834
  zIndex: tagList?.length > 0 ? '2' : '-1',
835
- maxWidth: 'calc(100vw - 3.2rem)',
835
+ maxWidth: 'calc(100vw - 3.2rem - 24px)',
836
836
  flexWrap: "nowrap",
837
837
  overflowX: "auto",
838
838
  WebkitOverflowScrolling: 'touch',
839
839
  scrollbarWidth: "none",
840
840
  overflowY: "hidden",
841
841
  background: 'transparent',
842
+ padding: '8px 0 8px 0',
843
+ marginLeft: 10,
842
844
  } : {
843
845
  // bottom: fileList.length > 0 ? '130px' : '80px',
844
846
  display: tagList?.length > 0 ? '' : 'none',
@@ -16,7 +16,7 @@ import icon_history_upload from '../../assets/aicenter/icon_history_upload.png';
16
16
  import icon_history_headerbg from '../../assets/aicenter/icon_history_headerbg.png';
17
17
  import icon_history_add from '../../assets/aicenter/icon_history_add.png';
18
18
  import ChatWidget from "../chatWidget";
19
- import Draggable from 'react-draggable';
19
+ // import Draggable from 'react-draggable';
20
20
 
21
21
 
22
22
  const style=`
@@ -634,6 +634,7 @@ export class MobileChatPage extends React.Component {
634
634
  currentFlow: item,
635
635
  dropDownList: this.getDropDownList(item.welcome_words),
636
636
  agentDrawerVisible: false,
637
+ drawerVisible: false,
637
638
  });
638
639
  this.setWindowTitle(item.name)
639
640
  this.getCurrentFlowHistory(item.id);
@@ -752,7 +753,7 @@ export class MobileChatPage extends React.Component {
752
753
  <ChatWidget
753
754
  input_container_style={{zIndex:2}}
754
755
  chat_window_style={{paddingTop: 0}}
755
- bot_message_style={{background: '#fff'}}
756
+ bot_message_style={{background: '#fff', maxWidth:'100%'}}
756
757
  window_title={currentFlow?.name || title}
757
758
  flow_id={currentFlow?.id || flowId}
758
759
  tags={currentFlow?.keywords || tags}
@@ -775,15 +776,16 @@ export class MobileChatPage extends React.Component {
775
776
  {
776
777
  isShowSideRight && (
777
778
  <>
778
- <Draggable onStart={() => { this.dragging = false; }}
779
- onDrag={() => { this.dragging = true; }}
780
- onStop={(e) => {
781
- if (!this.dragging) {
782
- this.setState({drawerVisible: true})
783
- }
784
- }}>
779
+ {/*<Draggable onStart={() => { this.dragging = false; }}*/}
780
+ {/* onDrag={() => { this.dragging = true; }}*/}
781
+ {/* onStop={(e) => {*/}
782
+ {/* if (!this.dragging) {*/}
783
+ {/* this.setState({drawerVisible: true})*/}
784
+ {/* }*/}
785
+ {/* }}>*/}
785
786
  <img
786
787
  src={icon_agents}
788
+ onClick={() => {this.setState({drawerVisible: true})}}
787
789
  style={{
788
790
  width: '60px',
789
791
  height: '60px',
@@ -793,7 +795,7 @@ export class MobileChatPage extends React.Component {
793
795
  zIndex: 1000
794
796
  }}
795
797
  />
796
- </Draggable>
798
+ {/*</Draggable>*/}
797
799
  <Drawer
798
800
  title={'专项技能'}
799
801
  // closable={false}
package/webpack.config.js CHANGED
@@ -48,8 +48,4 @@ module.exports = {
48
48
  minimize: true,
49
49
  usedExports: false, // 禁用 tree-shaking,避免移除 React
50
50
  },
51
- externals: {
52
- react: 'react', // 避免重复打包 React
53
- 'react-draggable': 'react-draggable', // 声明为外部依赖
54
- },
55
51
  };