whyuzeim 1.1.22 → 1.1.23
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.
|
@@ -12,6 +12,7 @@ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/esm/asyncToGener
|
|
|
12
12
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/esm/defineProperty');
|
|
13
13
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/esm/slicedToArray');
|
|
14
14
|
var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
|
|
15
|
+
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
15
16
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
16
17
|
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
17
18
|
var _setInterval = require('@babel/runtime-corejs3/core-js-stable/set-interval');
|
|
@@ -137,8 +138,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
137
138
|
};
|
|
138
139
|
var _renderMessage = function renderMessage(msg) {
|
|
139
140
|
var cuiScrollList = document.querySelector(".cui-scrollList div");
|
|
141
|
+
console.log(_JSON$stringify(msg), 'fdsfsfsd');
|
|
140
142
|
var generatingLoader = document.querySelector("#agent-generating-loader");
|
|
141
|
-
if (cuiScrollList && generatingLoader) {
|
|
143
|
+
if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) {
|
|
142
144
|
cuiScrollList.removeChild(generatingLoader);
|
|
143
145
|
}
|
|
144
146
|
if (msg.type === "txt") {
|
|
@@ -380,7 +382,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
380
382
|
}, [getHeaderInfo, initConversation, props.conversationId]);
|
|
381
383
|
var handleSendMessage = /*#__PURE__*/function () {
|
|
382
384
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
|
|
383
|
-
var txtMessage;
|
|
385
|
+
var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
|
|
384
386
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
385
387
|
while (1) switch (_context2.prev = _context2.next) {
|
|
386
388
|
case 0:
|
|
@@ -402,8 +404,20 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
402
404
|
return agoraChatUikit.rootStore.messageStore.sendMessage(txtMessage);
|
|
403
405
|
case 6:
|
|
404
406
|
if (isAgent) {
|
|
405
|
-
document.querySelector(".cui-scrollList div");
|
|
406
|
-
document.querySelector(".cui-scrollList");
|
|
407
|
+
cuiScrollList = document.querySelector(".cui-scrollList div");
|
|
408
|
+
cuiScrollListWrap = document.querySelector(".cui-scrollList");
|
|
409
|
+
if (cuiScrollList) {
|
|
410
|
+
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>";
|
|
411
|
+
template = document.createElement('template');
|
|
412
|
+
template.innerHTML = _trimInstanceProperty(htmlString).call(htmlString);
|
|
413
|
+
node = template.content.firstChild;
|
|
414
|
+
if (node) {
|
|
415
|
+
cuiScrollList.appendChild(node);
|
|
416
|
+
cuiScrollListWrap === null || cuiScrollListWrap === void 0 || cuiScrollListWrap.scrollTo({
|
|
417
|
+
top: 1000000000
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
}
|
|
407
421
|
}
|
|
408
422
|
afterSendMsg(txtMessage);
|
|
409
423
|
_context2.next = 13;
|
|
@@ -10,6 +10,7 @@ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerat
|
|
|
10
10
|
import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
11
11
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
12
12
|
import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
|
|
13
|
+
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
13
14
|
import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
|
|
14
15
|
import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
|
|
15
16
|
import _setInterval from '@babel/runtime-corejs3/core-js-stable/set-interval';
|
|
@@ -135,8 +136,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
135
136
|
};
|
|
136
137
|
var _renderMessage = function renderMessage(msg) {
|
|
137
138
|
var cuiScrollList = document.querySelector(".cui-scrollList div");
|
|
139
|
+
console.log(_JSON$stringify(msg), 'fdsfsfsd');
|
|
138
140
|
var generatingLoader = document.querySelector("#agent-generating-loader");
|
|
139
|
-
if (cuiScrollList && generatingLoader) {
|
|
141
|
+
if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) {
|
|
140
142
|
cuiScrollList.removeChild(generatingLoader);
|
|
141
143
|
}
|
|
142
144
|
if (msg.type === "txt") {
|
|
@@ -378,7 +380,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
378
380
|
}, [getHeaderInfo, initConversation, props.conversationId]);
|
|
379
381
|
var handleSendMessage = /*#__PURE__*/function () {
|
|
380
382
|
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
|
|
381
|
-
var txtMessage;
|
|
383
|
+
var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
|
|
382
384
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
383
385
|
while (1) switch (_context2.prev = _context2.next) {
|
|
384
386
|
case 0:
|
|
@@ -400,8 +402,20 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
400
402
|
return rootStore.messageStore.sendMessage(txtMessage);
|
|
401
403
|
case 6:
|
|
402
404
|
if (isAgent) {
|
|
403
|
-
document.querySelector(".cui-scrollList div");
|
|
404
|
-
document.querySelector(".cui-scrollList");
|
|
405
|
+
cuiScrollList = document.querySelector(".cui-scrollList div");
|
|
406
|
+
cuiScrollListWrap = document.querySelector(".cui-scrollList");
|
|
407
|
+
if (cuiScrollList) {
|
|
408
|
+
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>";
|
|
409
|
+
template = document.createElement('template');
|
|
410
|
+
template.innerHTML = _trimInstanceProperty(htmlString).call(htmlString);
|
|
411
|
+
node = template.content.firstChild;
|
|
412
|
+
if (node) {
|
|
413
|
+
cuiScrollList.appendChild(node);
|
|
414
|
+
cuiScrollListWrap === null || cuiScrollListWrap === void 0 || cuiScrollListWrap.scrollTo({
|
|
415
|
+
top: 1000000000
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
}
|
|
405
419
|
}
|
|
406
420
|
afterSendMsg(txtMessage);
|
|
407
421
|
_context2.next = 13;
|