yt-chat-components 1.3.1 → 1.3.2

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.3.1",
3
+ "version": "1.3.2",
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",
@@ -83,6 +83,8 @@ export default function ChatWindow({
83
83
  modalWidth,
84
84
  isMobile = false,
85
85
  isShowChatHeader = true,
86
+ tipTitle,
87
+ tipContent,
86
88
  }: {
87
89
  is_enable_call:boolean;
88
90
  tags: [];
@@ -127,6 +129,8 @@ export default function ChatWindow({
127
129
  modalWidth: number;
128
130
  isMobile: boolean;
129
131
  isShowChatHeader: boolean;
132
+ tipTitle?: string;
133
+ tipContent?: string;
130
134
  }) {
131
135
  const ref = useRef<HTMLDivElement>(null);
132
136
  const lastMessage = useRef<HTMLDivElement>(null);
@@ -948,7 +952,10 @@ export default function ChatWindow({
948
952
  return (
949
953
  <div className={'cl-tips-wrapper'}>
950
954
  <img className="drop-man-img" src={dropManUrl}/>
951
- <div className="drop-down-title"><strong>Hi,</strong><br/><strong>欢迎使用{window_title}!</strong><br/><div style={{fontSize:'14px'}}>您可以这样问我:</div></div>
955
+ <div className="drop-down-title">
956
+ <strong>Hi,</strong><br/><strong>{tipTitle || `欢迎使用${window_title}!`}</strong><br/>
957
+ <div style={{fontSize:'14px'}}>{tipTitle || `您可以这样问我:`}</div>
958
+ </div>
952
959
  <div className={'cl-drop-down-mobile'}>
953
960
  <div className="drop-down-list-mobile">
954
961
  {dropDownList.map(({backgroundImg, title}) => (
@@ -979,7 +986,7 @@ export default function ChatWindow({
979
986
  if (isEmpty(dropManUrl)){
980
987
  return (
981
988
  <div className='cl-drop-down'>
982
- <div className="drop-down-title">Hi,欢迎使用{window_title},您可以这样问我:</div>
989
+ <div className="drop-down-title">Hi{tipTitle || `欢迎使用${window_title}`},{tipContent || '您可以这样问我:'}</div>
983
990
  <div className="drop-down-list">
984
991
  {dropDownList.map(({backgroundImg, title}) => (
985
992
  <div className="drop-down-item-card" key={title}>
@@ -1013,7 +1020,7 @@ export default function ChatWindow({
1013
1020
  <div className={judgeDropClass()}>
1014
1021
  <img className="drop-man-img" src={dropManUrl}/>
1015
1022
  <div className='cl-drop-down'>
1016
- <div className="drop-down-title">Hi,欢迎使用{window_title},您可以这样问我:</div>
1023
+ <div className="drop-down-title">Hi{tipTitle || `欢迎使用${window_title}`},{tipContent || '您可以这样问我:'}</div>
1017
1024
  <div className="drop-down-list">
1018
1025
  {dropDownList.map(({backgroundImg, title}) => (
1019
1026
  <div
@@ -45,6 +45,8 @@ export default function ChatWidget({
45
45
  modalWidth,
46
46
  isMobile = false,
47
47
  isShowChatHeader = true,
48
+ tipTitle,
49
+ tipContent,
48
50
  }: {
49
51
  is_enable_call:boolean,
50
52
  tags: [];
@@ -85,6 +87,8 @@ export default function ChatWidget({
85
87
  modalWidth: number;
86
88
  isMobile: boolean;
87
89
  isShowChatHeader: boolean;
90
+ tipTitle: string,
91
+ tipContent: string,
88
92
  }) {
89
93
  const [open, setOpen] = useState(start_open);
90
94
  const [messages, setMessages] = useState<ChatMessageType[]>([]);
@@ -157,6 +161,8 @@ export default function ChatWidget({
157
161
  modalWidth={modalWidth}
158
162
  isMobile={isMobile}
159
163
  isShowChatHeader={isShowChatHeader}
164
+ tipTitle={tipTitle}
165
+ tipContent={tipContent}
160
166
  />
161
167
  </div>
162
168
  );
@@ -382,8 +382,6 @@ export class MobileChatPage extends React.Component {
382
382
 
383
383
  setWindowTitle = (title) => {
384
384
  if (!isEmpty(title)){
385
- document.title = 'AI校园智多星';
386
- window.document.title = 'AI校园智多星';
387
385
  }
388
386
  }
389
387
 
@@ -499,6 +497,8 @@ export class MobileChatPage extends React.Component {
499
497
  isLogin = false,
500
498
  isShowLogin = false,
501
499
  loginBtnClick,
500
+ tipTitle,
501
+ tipContent
502
502
  } = this.props;
503
503
  const { sceneInfo, currentFlow = {} } = this.state;
504
504
  const { flows = [], name: sceneName, character } = sceneInfo;
@@ -771,6 +771,8 @@ export class MobileChatPage extends React.Component {
771
771
  modalWidth={modalWidth}
772
772
  isMobile={true}
773
773
  isShowChatHeader={false}
774
+ tipTitle={tipTitle}
775
+ tipContent={tipContent}
774
776
  />
775
777
  </div>
776
778
  {