whyuzeim 1.1.16 → 1.1.18

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.
@@ -6,7 +6,6 @@ export interface IChatbox {
6
6
  chatType: "singleChat" | "groupChat";
7
7
  }) => void;
8
8
  onBack?: () => void;
9
- defaultAvatar?: string;
10
9
  }
11
10
  declare const Chatbox: React.FC<IChatbox>;
12
11
  export default Chatbox;
@@ -103,7 +103,7 @@ var Chatbox = function Chatbox(props) {
103
103
  select: false,
104
104
  thread: false,
105
105
  avatar: !isMySelf && currentConversation.chatType === "singleChat" ? /*#__PURE__*/React.createElement("img", {
106
- src: headerInfo.headerImageURL || props.defaultAvatar,
106
+ src: headerInfo.headerImageURL || avatar_default,
107
107
  className: "w-[48px] h-[48px] rounded-full overflow-hidden object-fit"
108
108
  }) : undefined,
109
109
  showTranslation: false,
@@ -624,9 +624,6 @@ var Chatbox = function Chatbox(props) {
624
624
  return _ref13.apply(this, arguments);
625
625
  };
626
626
  }();
627
- React.useEffect(function () {
628
- getHeaderInfo();
629
- }, []);
630
627
  React.useEffect(function () {
631
628
  if (currentConversation.conversationId) {
632
629
  getHeaderInfo();
@@ -637,7 +634,7 @@ var Chatbox = function Chatbox(props) {
637
634
  }, [currentConversation]);
638
635
  return /*#__PURE__*/React.createElement("div", {
639
636
  className: "yuze_chat_container w-full h-full overflow-hidden flex flex-col"
640
- }, customHeader(), /*#__PURE__*/React.createElement(agoraChatUikit.Chat, {
637
+ }, currentConversation.conversationId && customHeader(), /*#__PURE__*/React.createElement(agoraChatUikit.Chat, {
641
638
  className: "flex-1",
642
639
  messageInputProps: _objectSpread(_objectSpread({}, type.commonMessageInputConfig), {}, {
643
640
  onSendMessage: function onSendMessage(msg) {
@@ -12,7 +12,6 @@ export interface IHighlyCustomChat {
12
12
  renderQuestionList?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
13
13
  sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody) => void;
14
14
  onLoginSuccess?: () => void;
15
- defaultAvatar?: string;
16
15
  }
17
16
  declare const HighlyCustomChat: React.FC<IHighlyCustomChat>;
18
17
  export default HighlyCustomChat;
@@ -21,6 +21,7 @@ var agoraChatUikit = require('agora-chat-uikit');
21
21
  var context = require('../IM/context.js');
22
22
  var type = require('../type.js');
23
23
  var tools = require('../tools.js');
24
+ var avatar_default = require('../Icon/avatar_default.svg.js');
24
25
 
25
26
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
26
27
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), true)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -80,7 +81,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
80
81
  actions: []
81
82
  },
82
83
  avatar: !isMySelf ? /*#__PURE__*/React.createElement("img", {
83
- src: headerInfo.headerImageURL || props.defaultAvatar,
84
+ src: headerInfo.headerImageURL || avatar_default,
84
85
  className: "w-[48px] h-[48px] rounded-full overflow-hidden object-fit"
85
86
  }) : undefined,
86
87
  children: renderLongTextMsg(msg)
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 3C11.175 3 10.5 3.675 10.5 4.5C10.5 5.325 11.175 6 12 6C12.825 6 13.5 5.325 13.5 4.5C13.5 3.675 12.825 3 12 3ZM12 18C11.175 18 10.5 18.675 10.5 19.5C10.5 20.325 11.175 21 12 21C12.825 21 13.5 20.325 13.5 19.5C13.5 18.675 12.825 18 12 18ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z' fill='white'/%3e%3c/svg%3e";
3
+ var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 3C11.175 3 10.5 3.675 10.5 4.5C10.5 5.325 11.175 6 12 6C12.825 6 13.5 5.325 13.5 4.5C13.5 3.675 12.825 3 12 3ZM12 18C11.175 18 10.5 18.675 10.5 19.5C10.5 20.325 11.175 21 12 21C12.825 21 13.5 20.325 13.5 19.5C13.5 18.675 12.825 18 12 18ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z' fill='currentColor'/%3e%3c/svg%3e";
4
4
 
5
5
  module.exports = img;
@@ -11,4 +11,10 @@
11
11
  width: 16px;
12
12
  height: 16px;
13
13
  }
14
+ }
15
+
16
+ :global(.im-light) {
17
+ .yuze-conversationItem-action-img {
18
+ filter: var(--im-five-fontColor);
19
+ }
14
20
  }
@@ -175,6 +175,7 @@ var CustomConversationItem = function CustomConversationItem(props) {
175
175
  }();
176
176
  return canShow ? /*#__PURE__*/React.createElement(agoraChatUikit.ConversationItem, {
177
177
  className: "yuze-conversationItem cursor-pointer ".concat(cvs.conversationId === agoraChatUikit.rootStore.conversationStore.currentCvs.conversationId ? 'bg-[var(--im-highlight-blue-color)]' : ''),
178
+ badgeColor: 'red',
178
179
  avatar: /*#__PURE__*/React.createElement("div", {
179
180
  className: "yuze-conversationItem-avatar relative"
180
181
  }, /*#__PURE__*/React.createElement(agoraChatUikit.Avatar, {
@@ -27,3 +27,14 @@
27
27
  }
28
28
  }
29
29
  }
30
+
31
+ .im-light {
32
+ .yuze-searchBox {
33
+ background-color: var(--im-conversationlist-back-color);
34
+ }
35
+
36
+ .cui-input-input {
37
+ background-color: #fff;
38
+ color: var(--im-main-fontColor);
39
+ }
40
+ }
@@ -150,6 +150,13 @@ var Sidebar = function Sidebar(props) {
150
150
  var tempCVS = agoraChatUikit.rootStore.conversationStore.getConversation(chattype === 'singleChat' ? "singleChat" : "groupChat", conversationId);
151
151
  if (tempCVS) {
152
152
  props.onConversationItemClick(tempCVS);
153
+ } else {
154
+ props.onConversationItemClick({
155
+ chatType: chattype === 'singleChat' ? "singleChat" : "groupChat",
156
+ conversationId: conversationId,
157
+ lastMessage: {},
158
+ unreadCount: 0
159
+ });
153
160
  }
154
161
  }
155
162
  }
@@ -6,7 +6,6 @@ export interface IChatbox {
6
6
  chatType: "singleChat" | "groupChat";
7
7
  }) => void;
8
8
  onBack?: () => void;
9
- defaultAvatar?: string;
10
9
  }
11
10
  declare const Chatbox: React.FC<IChatbox>;
12
11
  export default Chatbox;
@@ -101,7 +101,7 @@ var Chatbox = function Chatbox(props) {
101
101
  select: false,
102
102
  thread: false,
103
103
  avatar: !isMySelf && currentConversation.chatType === "singleChat" ? /*#__PURE__*/React.createElement("img", {
104
- src: headerInfo.headerImageURL || props.defaultAvatar,
104
+ src: headerInfo.headerImageURL || img$1,
105
105
  className: "w-[48px] h-[48px] rounded-full overflow-hidden object-fit"
106
106
  }) : undefined,
107
107
  showTranslation: false,
@@ -622,9 +622,6 @@ var Chatbox = function Chatbox(props) {
622
622
  return _ref13.apply(this, arguments);
623
623
  };
624
624
  }();
625
- useEffect(function () {
626
- getHeaderInfo();
627
- }, []);
628
625
  useEffect(function () {
629
626
  if (currentConversation.conversationId) {
630
627
  getHeaderInfo();
@@ -635,7 +632,7 @@ var Chatbox = function Chatbox(props) {
635
632
  }, [currentConversation]);
636
633
  return /*#__PURE__*/React.createElement("div", {
637
634
  className: "yuze_chat_container w-full h-full overflow-hidden flex flex-col"
638
- }, customHeader(), /*#__PURE__*/React.createElement(Chat, {
635
+ }, currentConversation.conversationId && customHeader(), /*#__PURE__*/React.createElement(Chat, {
639
636
  className: "flex-1",
640
637
  messageInputProps: _objectSpread(_objectSpread({}, commonMessageInputConfig), {}, {
641
638
  onSendMessage: function onSendMessage(msg) {
@@ -12,7 +12,6 @@ export interface IHighlyCustomChat {
12
12
  renderQuestionList?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
13
13
  sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody) => void;
14
14
  onLoginSuccess?: () => void;
15
- defaultAvatar?: string;
16
15
  }
17
16
  declare const HighlyCustomChat: React.FC<IHighlyCustomChat>;
18
17
  export default HighlyCustomChat;
@@ -19,6 +19,7 @@ import { useClient, useSDK, rootStore, MessageList, MessageInput, ImageMessage,
19
19
  import { Context } from '../IM/context.js';
20
20
  import { commonMessageInputConfig, commonMessageProps } from '../type.js';
21
21
  import { reportAgentInUse } from '../tools.js';
22
+ import img from '../Icon/avatar_default.svg.js';
22
23
 
23
24
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
24
25
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context4, _context5; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context4 = ownKeys(Object(t), true)).call(_context4, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context5 = ownKeys(Object(t))).call(_context5, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -78,7 +79,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
78
79
  actions: []
79
80
  },
80
81
  avatar: !isMySelf ? /*#__PURE__*/React.createElement("img", {
81
- src: headerInfo.headerImageURL || props.defaultAvatar,
82
+ src: headerInfo.headerImageURL || img,
82
83
  className: "w-[48px] h-[48px] rounded-full overflow-hidden object-fit"
83
84
  }) : undefined,
84
85
  children: renderLongTextMsg(msg)
@@ -1,3 +1,3 @@
1
- var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 3C11.175 3 10.5 3.675 10.5 4.5C10.5 5.325 11.175 6 12 6C12.825 6 13.5 5.325 13.5 4.5C13.5 3.675 12.825 3 12 3ZM12 18C11.175 18 10.5 18.675 10.5 19.5C10.5 20.325 11.175 21 12 21C12.825 21 13.5 20.325 13.5 19.5C13.5 18.675 12.825 18 12 18ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z' fill='white'/%3e%3c/svg%3e";
1
+ var img = "data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12 3C11.175 3 10.5 3.675 10.5 4.5C10.5 5.325 11.175 6 12 6C12.825 6 13.5 5.325 13.5 4.5C13.5 3.675 12.825 3 12 3ZM12 18C11.175 18 10.5 18.675 10.5 19.5C10.5 20.325 11.175 21 12 21C12.825 21 13.5 20.325 13.5 19.5C13.5 18.675 12.825 18 12 18ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z' fill='currentColor'/%3e%3c/svg%3e";
2
2
 
3
3
  export { img as default };
@@ -11,4 +11,10 @@
11
11
  width: 16px;
12
12
  height: 16px;
13
13
  }
14
+ }
15
+
16
+ :global(.im-light) {
17
+ .yuze-conversationItem-action-img {
18
+ filter: var(--im-five-fontColor);
19
+ }
14
20
  }
@@ -173,6 +173,7 @@ var CustomConversationItem = function CustomConversationItem(props) {
173
173
  }();
174
174
  return canShow ? /*#__PURE__*/React.createElement(ConversationItem, {
175
175
  className: "yuze-conversationItem cursor-pointer ".concat(cvs.conversationId === rootStore.conversationStore.currentCvs.conversationId ? 'bg-[var(--im-highlight-blue-color)]' : ''),
176
+ badgeColor: 'red',
176
177
  avatar: /*#__PURE__*/React.createElement("div", {
177
178
  className: "yuze-conversationItem-avatar relative"
178
179
  }, /*#__PURE__*/React.createElement(Avatar, {
@@ -27,3 +27,14 @@
27
27
  }
28
28
  }
29
29
  }
30
+
31
+ .im-light {
32
+ .yuze-searchBox {
33
+ background-color: var(--im-conversationlist-back-color);
34
+ }
35
+
36
+ .cui-input-input {
37
+ background-color: #fff;
38
+ color: var(--im-main-fontColor);
39
+ }
40
+ }
@@ -148,6 +148,13 @@ var Sidebar = function Sidebar(props) {
148
148
  var tempCVS = rootStore.conversationStore.getConversation(chattype === 'singleChat' ? "singleChat" : "groupChat", conversationId);
149
149
  if (tempCVS) {
150
150
  props.onConversationItemClick(tempCVS);
151
+ } else {
152
+ props.onConversationItemClick({
153
+ chatType: chattype === 'singleChat' ? "singleChat" : "groupChat",
154
+ conversationId: conversationId,
155
+ lastMessage: {},
156
+ unreadCount: 0
157
+ });
151
158
  }
152
159
  }
153
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whyuzeim",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "description": "im componenets",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",