whyuzeim 1.1.22 → 1.1.24

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.
@@ -138,9 +138,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
138
138
  var _renderMessage = function renderMessage(msg) {
139
139
  var cuiScrollList = document.querySelector(".cui-scrollList div");
140
140
  var generatingLoader = document.querySelector("#agent-generating-loader");
141
- if (cuiScrollList && generatingLoader) {
142
- cuiScrollList.removeChild(generatingLoader);
143
- }
141
+ if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) ;
144
142
  if (msg.type === "txt") {
145
143
  return renderTxtMsg(msg);
146
144
  } else if (msg.type === "img") {
@@ -380,7 +378,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
380
378
  }, [getHeaderInfo, initConversation, props.conversationId]);
381
379
  var handleSendMessage = /*#__PURE__*/function () {
382
380
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
383
- var txtMessage;
381
+ var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
384
382
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
385
383
  while (1) switch (_context2.prev = _context2.next) {
386
384
  case 0:
@@ -402,8 +400,20 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
402
400
  return agoraChatUikit.rootStore.messageStore.sendMessage(txtMessage);
403
401
  case 6:
404
402
  if (isAgent) {
405
- document.querySelector(".cui-scrollList div");
406
- document.querySelector(".cui-scrollList");
403
+ cuiScrollList = document.querySelector(".cui-scrollList div");
404
+ cuiScrollListWrap = document.querySelector(".cui-scrollList");
405
+ if (cuiScrollList) {
406
+ htmlString = "<div id=\"agent-generating-loader\" class=\"cui-messageList-msgItem\"><div><div class=\"thread-container\"><div id=\"1393207307050949578\" class=\"cui-message-base cui-message-base-left cui-message-base-hasAvatar cui-message-base-secondly cui-message-base-square cui-message-base-dark\"><img src=\"/icon/im/avatar_default.svg\" class=\"w-[48px] h-[48px] rounded-full overflow-hidden object-fit\"><div class=\"cui-message-base-box\"><div class=\"cui-message-base-info\"></div><div class=\"cui-message-base-body\"><div class=\"cui-message-base-content\" style=\"background: var(--im-msg-bubble-color-left); border-radius: 9px; padding: 10px 12px; color: var(--im-msg-bubble-font-color);\"><div style=\"display:flex;align-items:center\"><div class=\"generating-loader-wrap\"><div class=\"generating-loader\"></div></div><span class=\"cui-message-text\">Generating</span></div></div><div class=\"cui-message-base-time-and-status-box\"><span class=\"cui-message-status cui-message-status-icon\"></span><span class=\"cui-message-base-time\">Mar</span></div></div></div></div></div></div><div class=\"cui-modal-root\"><div tabindex=\"-1\" class=\"cui-modal-wrap modify-message-modal\" style=\"display: none;\"></div></div></div>";
407
+ template = document.createElement('template');
408
+ template.innerHTML = _trimInstanceProperty(htmlString).call(htmlString);
409
+ node = template.content.firstChild;
410
+ if (node) {
411
+ cuiScrollList.appendChild(node);
412
+ cuiScrollListWrap === null || cuiScrollListWrap === void 0 || cuiScrollListWrap.scrollTo({
413
+ top: 1000000000
414
+ });
415
+ }
416
+ }
407
417
  }
408
418
  afterSendMsg(txtMessage);
409
419
  _context2.next = 13;
@@ -438,6 +448,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
438
448
  return _ref4.apply(this, arguments);
439
449
  };
440
450
  }();
451
+ React.useEffect(function () {
452
+ console.log(currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.lastMessage, 'fdsfsfs');
453
+ }, [currentConversation]);
441
454
  return /*#__PURE__*/React.createElement("div", {
442
455
  className: "bg-[var(--im-main-backgroundColor)] im-agent-mid ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "", " w-full h-full overflow-hidden flex flex-col")
443
456
  }, loading ? /*#__PURE__*/React.createElement("div", {
@@ -136,9 +136,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
136
136
  var _renderMessage = function renderMessage(msg) {
137
137
  var cuiScrollList = document.querySelector(".cui-scrollList div");
138
138
  var generatingLoader = document.querySelector("#agent-generating-loader");
139
- if (cuiScrollList && generatingLoader) {
140
- cuiScrollList.removeChild(generatingLoader);
141
- }
139
+ if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) ;
142
140
  if (msg.type === "txt") {
143
141
  return renderTxtMsg(msg);
144
142
  } else if (msg.type === "img") {
@@ -378,7 +376,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
378
376
  }, [getHeaderInfo, initConversation, props.conversationId]);
379
377
  var handleSendMessage = /*#__PURE__*/function () {
380
378
  var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
381
- var txtMessage;
379
+ var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
382
380
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
383
381
  while (1) switch (_context2.prev = _context2.next) {
384
382
  case 0:
@@ -400,8 +398,20 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
400
398
  return rootStore.messageStore.sendMessage(txtMessage);
401
399
  case 6:
402
400
  if (isAgent) {
403
- document.querySelector(".cui-scrollList div");
404
- document.querySelector(".cui-scrollList");
401
+ cuiScrollList = document.querySelector(".cui-scrollList div");
402
+ cuiScrollListWrap = document.querySelector(".cui-scrollList");
403
+ if (cuiScrollList) {
404
+ htmlString = "<div id=\"agent-generating-loader\" class=\"cui-messageList-msgItem\"><div><div class=\"thread-container\"><div id=\"1393207307050949578\" class=\"cui-message-base cui-message-base-left cui-message-base-hasAvatar cui-message-base-secondly cui-message-base-square cui-message-base-dark\"><img src=\"/icon/im/avatar_default.svg\" class=\"w-[48px] h-[48px] rounded-full overflow-hidden object-fit\"><div class=\"cui-message-base-box\"><div class=\"cui-message-base-info\"></div><div class=\"cui-message-base-body\"><div class=\"cui-message-base-content\" style=\"background: var(--im-msg-bubble-color-left); border-radius: 9px; padding: 10px 12px; color: var(--im-msg-bubble-font-color);\"><div style=\"display:flex;align-items:center\"><div class=\"generating-loader-wrap\"><div class=\"generating-loader\"></div></div><span class=\"cui-message-text\">Generating</span></div></div><div class=\"cui-message-base-time-and-status-box\"><span class=\"cui-message-status cui-message-status-icon\"></span><span class=\"cui-message-base-time\">Mar</span></div></div></div></div></div></div><div class=\"cui-modal-root\"><div tabindex=\"-1\" class=\"cui-modal-wrap modify-message-modal\" style=\"display: none;\"></div></div></div>";
405
+ template = document.createElement('template');
406
+ template.innerHTML = _trimInstanceProperty(htmlString).call(htmlString);
407
+ node = template.content.firstChild;
408
+ if (node) {
409
+ cuiScrollList.appendChild(node);
410
+ cuiScrollListWrap === null || cuiScrollListWrap === void 0 || cuiScrollListWrap.scrollTo({
411
+ top: 1000000000
412
+ });
413
+ }
414
+ }
405
415
  }
406
416
  afterSendMsg(txtMessage);
407
417
  _context2.next = 13;
@@ -436,6 +446,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
436
446
  return _ref4.apply(this, arguments);
437
447
  };
438
448
  }();
449
+ useEffect(function () {
450
+ console.log(currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.lastMessage, 'fdsfsfs');
451
+ }, [currentConversation]);
439
452
  return /*#__PURE__*/React.createElement("div", {
440
453
  className: "bg-[var(--im-main-backgroundColor)] im-agent-mid ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "", " w-full h-full overflow-hidden flex flex-col")
441
454
  }, loading ? /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whyuzeim",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "im componenets",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",