whyuzeim 1.1.43 → 1.1.44
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/cjs/HighlyCustomChat/QuestionButton/index.d.ts +1 -1
- package/cjs/HighlyCustomChat/QuestionButton/index.js +5 -1
- package/cjs/HighlyCustomChat/index.d.ts +1 -1
- package/cjs/HighlyCustomChat/index.js +9 -7
- package/es/HighlyCustomChat/QuestionButton/index.d.ts +1 -1
- package/es/HighlyCustomChat/QuestionButton/index.js +5 -1
- package/es/HighlyCustomChat/index.d.ts +1 -1
- package/es/HighlyCustomChat/index.js +9 -7
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ interface IQuestionButtonMsg {
|
|
|
5
5
|
msg: ChatSDK.MessageBody | NoticeMessageBody;
|
|
6
6
|
isMySelf: boolean;
|
|
7
7
|
avatar?: React.ReactNode;
|
|
8
|
-
onSelectAnswer?: (
|
|
8
|
+
onSelectAnswer?: (extInfo: any) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const QustionButtonMsg: React.FC<IQuestionButtonMsg>;
|
|
11
11
|
export default QustionButtonMsg;
|
|
@@ -48,7 +48,11 @@ var QustionButtonMsg = function QustionButtonMsg(props) {
|
|
|
48
48
|
key: text,
|
|
49
49
|
className: "w-[400px] !h-[45px] !bg-[#2c7cf5]",
|
|
50
50
|
onClick: function onClick() {
|
|
51
|
-
onSelectAnswer && onSelectAnswer(
|
|
51
|
+
onSelectAnswer && onSelectAnswer({
|
|
52
|
+
text: text,
|
|
53
|
+
step: msg.customExts.step,
|
|
54
|
+
customEvent: msg.customEvent
|
|
55
|
+
});
|
|
52
56
|
}
|
|
53
57
|
}, /*#__PURE__*/React.createElement("span", {
|
|
54
58
|
className: "text-[#fff]"
|
|
@@ -12,7 +12,7 @@ export interface IHighlyCustomChat {
|
|
|
12
12
|
renderHeader?: (cvs: Conversation) => React.ReactNode;
|
|
13
13
|
renderInputView?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
14
14
|
renderQuestionList?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
15
|
-
sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody) => void;
|
|
15
|
+
sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody, extInfo?: any) => void;
|
|
16
16
|
onLoginSuccess?: () => void;
|
|
17
17
|
onApply?: (code: string) => void;
|
|
18
18
|
onReportClick?: (report: AIReportMessageExts) => void;
|
|
@@ -219,7 +219,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
219
219
|
});
|
|
220
220
|
} else if (msg.type === "custom" && (msg === null || msg === void 0 ? void 0 : msg.customEvent) === "custom_qa_guidance") {
|
|
221
221
|
return /*#__PURE__*/React.createElement(index$2, {
|
|
222
|
-
onSelectAnswer:
|
|
222
|
+
onSelectAnswer: function onSelectAnswer(extInfo) {
|
|
223
|
+
handleSendMessage(extInfo.text, extInfo);
|
|
224
|
+
},
|
|
223
225
|
msg: msg,
|
|
224
226
|
isMySelf: isMySelf,
|
|
225
227
|
avatar: !isMySelf ? /*#__PURE__*/React.createElement("img", {
|
|
@@ -412,7 +414,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
412
414
|
};
|
|
413
415
|
}, [getHeaderInfo, initConversation, props.conversationId]);
|
|
414
416
|
var handleSendMessage = /*#__PURE__*/function () {
|
|
415
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
|
|
417
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text, extInfo) {
|
|
416
418
|
var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
|
|
417
419
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
418
420
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -450,7 +452,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
450
452
|
}
|
|
451
453
|
}
|
|
452
454
|
}
|
|
453
|
-
afterSendMsg(txtMessage);
|
|
455
|
+
afterSendMsg(txtMessage, extInfo);
|
|
454
456
|
_context2.next = 13;
|
|
455
457
|
break;
|
|
456
458
|
case 10:
|
|
@@ -463,23 +465,23 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
463
465
|
}
|
|
464
466
|
}, _callee, null, [[2, 10]]);
|
|
465
467
|
}));
|
|
466
|
-
return function handleSendMessage(_x) {
|
|
468
|
+
return function handleSendMessage(_x, _x2) {
|
|
467
469
|
return _ref3.apply(this, arguments);
|
|
468
470
|
};
|
|
469
471
|
}();
|
|
470
472
|
var afterSendMsg = /*#__PURE__*/function () {
|
|
471
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(msgInfo) {
|
|
473
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(msgInfo, extInfo) {
|
|
472
474
|
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
473
475
|
while (1) switch (_context3.prev = _context3.next) {
|
|
474
476
|
case 0:
|
|
475
|
-
props.sendMessageSuccessCallback && props.sendMessageSuccessCallback(msgInfo);
|
|
477
|
+
props.sendMessageSuccessCallback && props.sendMessageSuccessCallback(msgInfo, extInfo);
|
|
476
478
|
case 1:
|
|
477
479
|
case "end":
|
|
478
480
|
return _context3.stop();
|
|
479
481
|
}
|
|
480
482
|
}, _callee2);
|
|
481
483
|
}));
|
|
482
|
-
return function afterSendMsg(
|
|
484
|
+
return function afterSendMsg(_x3, _x4) {
|
|
483
485
|
return _ref4.apply(this, arguments);
|
|
484
486
|
};
|
|
485
487
|
}();
|
|
@@ -5,7 +5,7 @@ interface IQuestionButtonMsg {
|
|
|
5
5
|
msg: ChatSDK.MessageBody | NoticeMessageBody;
|
|
6
6
|
isMySelf: boolean;
|
|
7
7
|
avatar?: React.ReactNode;
|
|
8
|
-
onSelectAnswer?: (
|
|
8
|
+
onSelectAnswer?: (extInfo: any) => void;
|
|
9
9
|
}
|
|
10
10
|
declare const QustionButtonMsg: React.FC<IQuestionButtonMsg>;
|
|
11
11
|
export default QustionButtonMsg;
|
|
@@ -46,7 +46,11 @@ var QustionButtonMsg = function QustionButtonMsg(props) {
|
|
|
46
46
|
key: text,
|
|
47
47
|
className: "w-[400px] !h-[45px] !bg-[#2c7cf5]",
|
|
48
48
|
onClick: function onClick() {
|
|
49
|
-
onSelectAnswer && onSelectAnswer(
|
|
49
|
+
onSelectAnswer && onSelectAnswer({
|
|
50
|
+
text: text,
|
|
51
|
+
step: msg.customExts.step,
|
|
52
|
+
customEvent: msg.customEvent
|
|
53
|
+
});
|
|
50
54
|
}
|
|
51
55
|
}, /*#__PURE__*/React.createElement("span", {
|
|
52
56
|
className: "text-[#fff]"
|
|
@@ -12,7 +12,7 @@ export interface IHighlyCustomChat {
|
|
|
12
12
|
renderHeader?: (cvs: Conversation) => React.ReactNode;
|
|
13
13
|
renderInputView?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
14
14
|
renderQuestionList?: (cvs: Conversation, sendMessage: (text: string) => void) => React.ReactNode;
|
|
15
|
-
sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody) => void;
|
|
15
|
+
sendMessageSuccessCallback?: (msg: ChatSDK.MessageBody, extInfo?: any) => void;
|
|
16
16
|
onLoginSuccess?: () => void;
|
|
17
17
|
onApply?: (code: string) => void;
|
|
18
18
|
onReportClick?: (report: AIReportMessageExts) => void;
|
|
@@ -217,7 +217,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
217
217
|
});
|
|
218
218
|
} else if (msg.type === "custom" && (msg === null || msg === void 0 ? void 0 : msg.customEvent) === "custom_qa_guidance") {
|
|
219
219
|
return /*#__PURE__*/React.createElement(QustionButtonMsg, {
|
|
220
|
-
onSelectAnswer:
|
|
220
|
+
onSelectAnswer: function onSelectAnswer(extInfo) {
|
|
221
|
+
handleSendMessage(extInfo.text, extInfo);
|
|
222
|
+
},
|
|
221
223
|
msg: msg,
|
|
222
224
|
isMySelf: isMySelf,
|
|
223
225
|
avatar: !isMySelf ? /*#__PURE__*/React.createElement("img", {
|
|
@@ -410,7 +412,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
410
412
|
};
|
|
411
413
|
}, [getHeaderInfo, initConversation, props.conversationId]);
|
|
412
414
|
var handleSendMessage = /*#__PURE__*/function () {
|
|
413
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text) {
|
|
415
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(text, extInfo) {
|
|
414
416
|
var txtMessage, cuiScrollList, cuiScrollListWrap, htmlString, template, node;
|
|
415
417
|
return _regeneratorRuntime.wrap(function _callee$(_context2) {
|
|
416
418
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -448,7 +450,7 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
448
450
|
}
|
|
449
451
|
}
|
|
450
452
|
}
|
|
451
|
-
afterSendMsg(txtMessage);
|
|
453
|
+
afterSendMsg(txtMessage, extInfo);
|
|
452
454
|
_context2.next = 13;
|
|
453
455
|
break;
|
|
454
456
|
case 10:
|
|
@@ -461,23 +463,23 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
|
|
|
461
463
|
}
|
|
462
464
|
}, _callee, null, [[2, 10]]);
|
|
463
465
|
}));
|
|
464
|
-
return function handleSendMessage(_x) {
|
|
466
|
+
return function handleSendMessage(_x, _x2) {
|
|
465
467
|
return _ref3.apply(this, arguments);
|
|
466
468
|
};
|
|
467
469
|
}();
|
|
468
470
|
var afterSendMsg = /*#__PURE__*/function () {
|
|
469
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(msgInfo) {
|
|
471
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(msgInfo, extInfo) {
|
|
470
472
|
return _regeneratorRuntime.wrap(function _callee2$(_context3) {
|
|
471
473
|
while (1) switch (_context3.prev = _context3.next) {
|
|
472
474
|
case 0:
|
|
473
|
-
props.sendMessageSuccessCallback && props.sendMessageSuccessCallback(msgInfo);
|
|
475
|
+
props.sendMessageSuccessCallback && props.sendMessageSuccessCallback(msgInfo, extInfo);
|
|
474
476
|
case 1:
|
|
475
477
|
case "end":
|
|
476
478
|
return _context3.stop();
|
|
477
479
|
}
|
|
478
480
|
}, _callee2);
|
|
479
481
|
}));
|
|
480
|
-
return function afterSendMsg(
|
|
482
|
+
return function afterSendMsg(_x3, _x4) {
|
|
481
483
|
return _ref4.apply(this, arguments);
|
|
482
484
|
};
|
|
483
485
|
}();
|