@magmamath/students-features 0.3.2 → 0.4.0-rc.0
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/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +12 -4
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +6 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +12 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +5 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/context/ChatBotContext.js +17 -0
- package/dist/commonjs/features/chatbot/context/ChatBotContext.js.map +1 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +58 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +99 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
- package/dist/commonjs/features/chatbot/index.js +0 -7
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +136 -117
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +28 -17
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/{api.js → ChatbotApi.js} +16 -1
- package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +110 -0
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +0 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ThreadItem.js +21 -8
- package/dist/commonjs/features/chatbot/model/ThreadItem.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/messagesHelper.js +1 -5
- package/dist/commonjs/features/chatbot/model/messagesHelper.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/t2s.js +0 -6
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/translation.helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/translation.js +54 -45
- package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/api.types.js +4 -0
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/units.types.js +2 -0
- package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -0
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +18 -9
- package/dist/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -1
- package/dist/commonjs/lib/effector/createEntityFieldStore.js +4 -0
- package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -1
- package/dist/commonjs/lib/helpers/randomElements.js +24 -0
- package/dist/commonjs/lib/helpers/randomElements.js.map +1 -0
- package/dist/commonjs/shared/icons/HighlighterIcon.js +36 -0
- package/dist/commonjs/shared/icons/HighlighterIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/StopIcon.js +33 -0
- package/dist/commonjs/shared/icons/StopIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/icon.types.js +4 -0
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +12 -4
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +6 -4
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +12 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +6 -2
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/context/ChatBotContext.js +12 -0
- package/dist/module/features/chatbot/context/ChatBotContext.js.map +1 -0
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +52 -0
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -0
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +94 -0
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -0
- package/dist/module/features/chatbot/index.js +0 -1
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotModel.js +138 -119
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js} +26 -15
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -0
- package/dist/module/features/chatbot/model/{api.js → ChatbotApi.js} +16 -1
- package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -0
- package/dist/module/features/chatbot/model/ChatsCacheModel.js +104 -0
- package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -0
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +0 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/chatbot/model/ThreadItem.js +21 -8
- package/dist/module/features/chatbot/model/ThreadItem.js.map +1 -1
- package/dist/module/features/chatbot/model/messagesHelper.js +1 -5
- package/dist/module/features/chatbot/model/messagesHelper.js.map +1 -1
- package/dist/module/features/chatbot/model/t2s.js +1 -7
- package/dist/module/features/chatbot/model/t2s.js.map +1 -1
- package/dist/module/features/chatbot/model/translation.helpers.js.map +1 -1
- package/dist/module/features/chatbot/model/translation.js +54 -45
- package/dist/module/features/chatbot/model/translation.js.map +1 -1
- package/dist/module/features/chatbot/types/api.types.js +2 -0
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/chatbot/types/units.types.js +2 -0
- package/dist/module/features/chatbot/types/units.types.js.map +1 -0
- package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js +18 -9
- package/dist/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.js.map +1 -1
- package/dist/module/lib/effector/createEntityFieldStore.js +4 -0
- package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -1
- package/dist/module/lib/helpers/randomElements.js +20 -0
- package/dist/module/lib/helpers/randomElements.js.map +1 -0
- package/dist/module/shared/icons/HighlighterIcon.js +29 -0
- package/dist/module/shared/icons/HighlighterIcon.js.map +1 -0
- package/dist/module/shared/icons/StopIcon.js +26 -0
- package/dist/module/shared/icons/StopIcon.js.map +1 -0
- package/dist/module/shared/icons/icon.types.js +2 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts +8 -0
- package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +3 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +28 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +4 -3
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +19 -14
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/{module/features/chatbot/model/ChatBotMessageHandler.d.ts → commonjs/features/chatbot/model/ChatBotThreadManager.d.ts} +11 -8
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +26 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +3 -2
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts +12 -6
- package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts +3 -4
- package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +2 -4
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +7 -8
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +2 -11
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +26 -19
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +31 -0
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +2 -0
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts +2 -0
- package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +2 -0
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts +8 -0
- package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +3 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +28 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/index.d.ts +4 -3
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +19 -14
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/{commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts → module/features/chatbot/model/ChatBotThreadManager.d.ts} +11 -8
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/{api.d.ts → ChatbotApi.d.ts} +4 -3
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +26 -0
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +3 -2
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts +12 -6
- package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts +3 -4
- package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts +2 -4
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts +7 -8
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +2 -11
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +26 -19
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts +31 -0
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -0
- package/dist/typescript/module/features/feedback/components/TeacherFeedbackButton/colorSchemes.d.ts.map +1 -1
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +2 -0
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/randomElements.d.ts +2 -0
- package/dist/typescript/module/lib/helpers/randomElements.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/StopIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/StopIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/icon.types.d.ts +2 -0
- package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +10 -3
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -0
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +3 -0
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +14 -0
- package/src/features/chatbot/components/Chatbot.tsx +3 -2
- package/src/features/chatbot/context/ChatBotContext.ts +18 -0
- package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +53 -0
- package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +116 -0
- package/src/features/chatbot/index.ts +3 -3
- package/src/features/chatbot/model/ChatBotModel.ts +123 -124
- package/src/features/chatbot/model/{ChatBotMessageHandler.ts → ChatBotThreadManager.ts} +28 -16
- package/src/features/chatbot/model/{api.ts → ChatbotApi.ts} +19 -2
- package/src/features/chatbot/model/ChatsCacheModel.ts +94 -0
- package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
- package/src/features/chatbot/model/ThreadItem.ts +20 -9
- package/src/features/chatbot/model/messagesHelper.ts +2 -6
- package/src/features/chatbot/model/t2s.ts +3 -10
- package/src/features/chatbot/model/translation.helpers.ts +2 -1
- package/src/features/chatbot/model/translation.ts +52 -46
- package/src/features/chatbot/types/api.types.ts +2 -12
- package/src/features/chatbot/types/model.types.ts +38 -26
- package/src/features/chatbot/types/translation.types.ts +2 -1
- package/src/features/chatbot/types/units.types.ts +34 -0
- package/src/features/feedback/components/TeacherFeedbackButton/colorSchemes.ts +9 -0
- package/src/lib/effector/createEntityFieldStore.ts +9 -1
- package/src/lib/helpers/randomElements.ts +22 -0
- package/src/shared/icons/HighlighterIcon.tsx +21 -0
- package/src/shared/icons/StopIcon.tsx +17 -0
- package/src/shared/icons/icon.types.ts +9 -6
- package/dist/commonjs/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/api.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatBotMessageHandler.js.map +0 -1
- package/dist/module/features/chatbot/model/api.js.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/api.d.ts.map +0 -1
|
@@ -6,10 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ChatbotModel = void 0;
|
|
7
7
|
var _effector = require("effector");
|
|
8
8
|
var _index = require("../../../lib/effector/index.js");
|
|
9
|
-
var
|
|
9
|
+
var _ChatbotApi = require("./ChatbotApi.js");
|
|
10
10
|
var _translation = require("./translation.js");
|
|
11
11
|
var _t2s = require("./t2s.js");
|
|
12
12
|
var _messagesHelper = require("./messagesHelper.js");
|
|
13
|
+
var _ChatBotThreadManager = require("./ChatBotThreadManager.js");
|
|
14
|
+
var _ChatsCacheModel = require("./ChatsCacheModel.js");
|
|
15
|
+
var _ErrorSpottingModel = require("../errorSpotting/ErrorSpottingModel.js");
|
|
13
16
|
class ChatbotModel {
|
|
14
17
|
$currentKey = (0, _effector.createStore)('');
|
|
15
18
|
resetAlternatives = (0, _effector.createEvent)();
|
|
@@ -24,84 +27,106 @@ class ChatbotModel {
|
|
|
24
27
|
$context = (0, _effector.restore)(this.setContext, null);
|
|
25
28
|
setScrollActive = (0, _effector.createEvent)();
|
|
26
29
|
$isScrollActive = (0, _effector.restore)(this.setScrollActive, false);
|
|
27
|
-
|
|
28
|
-
threadIds = (0, _index.createEntityFieldStore)();
|
|
29
|
-
availableChats = (0, _index.createEntityFieldStore)();
|
|
30
|
+
cache = new _ChatsCacheModel.ChatsCacheModel();
|
|
30
31
|
$currentChatData = (0, _effector.combine)({
|
|
31
|
-
|
|
32
|
-
threadIds: this.threadIds.$state,
|
|
33
|
-
availableChats: this.availableChats.$state,
|
|
32
|
+
data: this.cache.$data,
|
|
34
33
|
key: this.$currentKey
|
|
35
34
|
}, ({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
data,
|
|
36
|
+
key
|
|
37
|
+
}) => data[key] ? {
|
|
38
|
+
...data[key],
|
|
39
|
+
key
|
|
40
|
+
} : {
|
|
41
|
+
...(0, _ChatsCacheModel.defaultChatData)(),
|
|
39
42
|
key
|
|
40
|
-
}) => {
|
|
41
|
-
return {
|
|
42
|
-
messages: messages[key] ?? [],
|
|
43
|
-
threadId: threadIds[key] ?? null,
|
|
44
|
-
isAvailable: availableChats[key] ?? false,
|
|
45
|
-
key
|
|
46
|
-
};
|
|
47
43
|
});
|
|
48
44
|
constructor({
|
|
49
45
|
api,
|
|
50
46
|
messages,
|
|
51
|
-
$key
|
|
47
|
+
$key,
|
|
48
|
+
threadMessagesLimit
|
|
52
49
|
}) {
|
|
53
|
-
this.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
this.threadManager = new _ChatBotThreadManager.ChatBotThreadManager({
|
|
51
|
+
api: {
|
|
52
|
+
getHint: api.requestHint
|
|
53
|
+
},
|
|
54
|
+
messages,
|
|
55
|
+
messagesLimit: threadMessagesLimit
|
|
56
|
+
});
|
|
57
|
+
this.api = new _ChatbotApi.ChatbotAPI({
|
|
58
|
+
...api,
|
|
59
|
+
postMessage: this.threadManager.postMessage
|
|
58
60
|
});
|
|
61
|
+
this.defaultMessages = messages;
|
|
59
62
|
this.$alternatives = (0, _effector.restore)(this.api.getAlternativesFx.doneData, null).on(this.setAlternatives, (_, payload) => payload).reset(this.resetAlternatives);
|
|
63
|
+
this.t2s = new _t2s.ChatTextToSpeechModel({
|
|
64
|
+
api: this.api
|
|
65
|
+
});
|
|
60
66
|
this.translation = new _translation.ChatbotTranslation({
|
|
61
67
|
$context: this.$context,
|
|
62
68
|
defaultMessages: messages,
|
|
63
69
|
$key: this.$currentKey,
|
|
64
70
|
api: this.api,
|
|
65
|
-
messagesModel: this.messages,
|
|
66
71
|
alternativesModel: {
|
|
67
72
|
$store: this.$alternatives,
|
|
68
73
|
set: this.setAlternatives
|
|
69
|
-
}
|
|
74
|
+
},
|
|
75
|
+
chats: this.cache
|
|
70
76
|
});
|
|
71
|
-
this.
|
|
72
|
-
|
|
73
|
-
|
|
77
|
+
this.errorSpotting = new _ErrorSpottingModel.ErrorSpottingModel({
|
|
78
|
+
api: this.api,
|
|
79
|
+
$currentChatData: this.$currentChatData
|
|
80
|
+
});
|
|
81
|
+
if ($key) this.bindKey($key);
|
|
82
|
+
(0, _effector.sample)({
|
|
83
|
+
source: this.$isOpen.updates,
|
|
84
|
+
filter: isOpen => !isOpen,
|
|
85
|
+
target: this.t2s.reset
|
|
86
|
+
});
|
|
87
|
+
(0, _effector.sample)({
|
|
88
|
+
clock: this.removeLastMessage,
|
|
89
|
+
source: [this.$lastMessageKey, this.cache.$data],
|
|
90
|
+
fn: ([lastMessageKey, chatsData]) => {
|
|
91
|
+
const chat = chatsData[lastMessageKey ?? ''];
|
|
92
|
+
if (!chat) return {
|
|
93
|
+
key: '',
|
|
94
|
+
data: {}
|
|
95
|
+
};
|
|
96
|
+
const updatedMessages = [...chat.messages];
|
|
97
|
+
updatedMessages.pop();
|
|
98
|
+
return {
|
|
99
|
+
key: lastMessageKey ?? '',
|
|
100
|
+
data: {
|
|
101
|
+
messages: updatedMessages
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
filter: ([lastMessageKey]) => !!lastMessageKey,
|
|
106
|
+
target: this.cache.update
|
|
74
107
|
});
|
|
75
|
-
this.sendHelpRequestFx = this.createSendHelpRequestFx();
|
|
76
|
-
this.initChatReplyWatcher();
|
|
77
108
|
}
|
|
78
109
|
createSendHelpRequestFx() {
|
|
79
110
|
const effect = (0, _effector.attach)({
|
|
80
|
-
source: [this.$currentKey, this
|
|
81
|
-
mapParams: (params, [key,
|
|
111
|
+
source: [this.$currentKey, this.$context],
|
|
112
|
+
mapParams: (params, [key, context]) => ({
|
|
82
113
|
message: params.message,
|
|
83
114
|
translatedMessage: params.translatedMessage,
|
|
84
115
|
context,
|
|
85
|
-
key
|
|
86
|
-
isTranslated,
|
|
87
|
-
threadId: currentData.threadId
|
|
116
|
+
key
|
|
88
117
|
}),
|
|
89
118
|
effect: (0, _index.createControllerEffect)(async ({
|
|
90
119
|
message,
|
|
91
120
|
translatedMessage,
|
|
92
121
|
key,
|
|
93
|
-
isTranslated,
|
|
94
|
-
threadId,
|
|
95
122
|
context
|
|
96
123
|
}) => {
|
|
97
124
|
if (!context) throw new Error('Context is required');
|
|
98
125
|
this.setLastMessageKey(key);
|
|
99
|
-
this.
|
|
100
|
-
|
|
101
|
-
fn: currentMessages => [...(currentMessages || []), _messagesHelper.messagesHelper.createOwn({
|
|
126
|
+
this.cache.addMessages(key, {
|
|
127
|
+
messages: [_messagesHelper.messagesHelper.createOwn({
|
|
102
128
|
message,
|
|
103
|
-
translatedMessage
|
|
104
|
-
threadId
|
|
129
|
+
translatedMessage
|
|
105
130
|
})]
|
|
106
131
|
});
|
|
107
132
|
const response = await this.api.postMessageFx({
|
|
@@ -109,26 +134,19 @@ class ChatbotModel {
|
|
|
109
134
|
language: context.language,
|
|
110
135
|
problemAnswer: context.problemAnswer,
|
|
111
136
|
answer: context.answer,
|
|
112
|
-
threadId,
|
|
113
137
|
imageAltText: context.imageDescription
|
|
114
138
|
});
|
|
115
139
|
let messages = [_messagesHelper.messagesHelper.createAnswer(response)];
|
|
116
140
|
if (response.endMessage) {
|
|
117
141
|
messages.push(_messagesHelper.messagesHelper.createLast(this.defaultMessages.endMessage));
|
|
118
142
|
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
messages
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
this.messages.setField({
|
|
126
|
-
key,
|
|
127
|
-
fn: currentMessages => [...(currentMessages || []), ...messages]
|
|
143
|
+
messages = await this.translation.applyTranslationFx({
|
|
144
|
+
targetLanguage: context.translationTargetLanguage,
|
|
145
|
+
messages
|
|
128
146
|
});
|
|
129
|
-
this.
|
|
130
|
-
|
|
131
|
-
|
|
147
|
+
this.cache.addMessages(key, {
|
|
148
|
+
messages,
|
|
149
|
+
thread: response.thread
|
|
132
150
|
});
|
|
133
151
|
})
|
|
134
152
|
});
|
|
@@ -140,35 +158,35 @@ class ChatbotModel {
|
|
|
140
158
|
messages
|
|
141
159
|
}) => ({
|
|
142
160
|
key,
|
|
143
|
-
data:
|
|
161
|
+
data: {
|
|
162
|
+
messages: [...messages, this.defaultMessages.error]
|
|
163
|
+
}
|
|
144
164
|
}),
|
|
145
165
|
filter: (_, {
|
|
146
166
|
error
|
|
147
167
|
}) => error.message !== 'Request aborted manually',
|
|
148
|
-
target: this.
|
|
168
|
+
target: this.cache.update
|
|
149
169
|
});
|
|
150
170
|
return effect;
|
|
151
171
|
}
|
|
152
|
-
|
|
172
|
+
bindKey($store) {
|
|
153
173
|
(0, _effector.sample)({
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
fn: ([lastMessageKey, messages]) => {
|
|
157
|
-
if (!lastMessageKey) return {
|
|
158
|
-
key: '',
|
|
159
|
-
data: []
|
|
160
|
-
};
|
|
161
|
-
const updatedMessages = [...messages[lastMessageKey]];
|
|
162
|
-
updatedMessages.pop();
|
|
163
|
-
return {
|
|
164
|
-
key: lastMessageKey,
|
|
165
|
-
data: updatedMessages
|
|
166
|
-
};
|
|
167
|
-
},
|
|
168
|
-
filter: ([lastMessageKey]) => !!lastMessageKey,
|
|
169
|
-
target: this.messages.setField
|
|
174
|
+
source: $store,
|
|
175
|
+
target: this.$currentKey
|
|
170
176
|
});
|
|
177
|
+
this.threadManager.bindKeyStore($store);
|
|
178
|
+
return this;
|
|
171
179
|
}
|
|
180
|
+
setT2SAudioProvider(audioProvider) {
|
|
181
|
+
this.t2s.setAudioProvider(audioProvider);
|
|
182
|
+
return this;
|
|
183
|
+
}
|
|
184
|
+
setDrawBoardAdapter(adapter) {
|
|
185
|
+
this.threadManager.setDrawBoardAdapter(adapter);
|
|
186
|
+
this.errorSpotting.bindStrokesValidation(adapter.$strokesValidationKey);
|
|
187
|
+
return this;
|
|
188
|
+
}
|
|
189
|
+
sendHelpRequestFx = this.createSendHelpRequestFx();
|
|
172
190
|
startConversation = (0, _effector.attach)({
|
|
173
191
|
source: this.$currentChatData,
|
|
174
192
|
mapParams: (props, source) => ({
|
|
@@ -186,13 +204,10 @@ class ChatbotModel {
|
|
|
186
204
|
key
|
|
187
205
|
});
|
|
188
206
|
}
|
|
189
|
-
this.
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.availableChats.setField({
|
|
194
|
-
key,
|
|
195
|
-
data: true
|
|
207
|
+
this.cache.add(key, {
|
|
208
|
+
messages: [this.defaultMessages.start],
|
|
209
|
+
isAvailable: true,
|
|
210
|
+
currentThread: null
|
|
196
211
|
});
|
|
197
212
|
})
|
|
198
213
|
});
|
|
@@ -201,49 +216,53 @@ class ChatbotModel {
|
|
|
201
216
|
...message
|
|
202
217
|
}) {
|
|
203
218
|
const options = this.$alternatives.getState()?.options.hints ?? message.options;
|
|
204
|
-
this.
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
if (!messages || messages.length > 1) return;
|
|
208
|
-
return [{
|
|
209
|
-
...message,
|
|
210
|
-
options
|
|
211
|
-
}];
|
|
212
|
-
}
|
|
219
|
+
this.cache.setSingleMessage(key, {
|
|
220
|
+
...message,
|
|
221
|
+
options
|
|
213
222
|
});
|
|
214
223
|
}
|
|
215
|
-
reinitConversation = (
|
|
224
|
+
reinitConversation = ({
|
|
216
225
|
key
|
|
217
226
|
}) => {
|
|
218
|
-
this.
|
|
219
|
-
|
|
220
|
-
fn: messages => {
|
|
221
|
-
if (!messages?.length || messages.length === 1) return;
|
|
222
|
-
const copy = [...messages];
|
|
223
|
-
while (copy.at(-1)?.endMessage) {
|
|
224
|
-
copy.pop();
|
|
225
|
-
}
|
|
226
|
-
const lastMessage = copy.at(-1);
|
|
227
|
-
if (!lastMessage) return;
|
|
228
|
-
copy.splice(copy.length - 1, 1, {
|
|
229
|
-
...lastMessage,
|
|
230
|
-
options: [this.defaultMessages.anotherHintOption]
|
|
231
|
-
});
|
|
232
|
-
return copy;
|
|
233
|
-
}
|
|
227
|
+
this.cache.reinitChatThread(key, {
|
|
228
|
+
initialOption: this.defaultMessages.anotherHintOption
|
|
234
229
|
});
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
(0, _effector.sample)({
|
|
238
|
-
source: $store,
|
|
239
|
-
target: this.$currentKey
|
|
230
|
+
this.threadManager.resetThread({
|
|
231
|
+
key
|
|
240
232
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
this.t2s.
|
|
245
|
-
|
|
233
|
+
};
|
|
234
|
+
disableChat(key) {
|
|
235
|
+
this.t2s.stop();
|
|
236
|
+
void this.t2s.reset();
|
|
237
|
+
this.cache.disableChat(key);
|
|
246
238
|
}
|
|
239
|
+
softReset = (0, _effector.attach)({
|
|
240
|
+
source: {
|
|
241
|
+
isLoading: this.sendHelpRequestFx.pending,
|
|
242
|
+
lastMessageKey: this.$lastMessageKey
|
|
243
|
+
},
|
|
244
|
+
mapParams: (_, {
|
|
245
|
+
isLoading,
|
|
246
|
+
lastMessageKey
|
|
247
|
+
}) => !!(isLoading && lastMessageKey),
|
|
248
|
+
effect: (0, _effector.createEffect)(hasPendingMessage => {
|
|
249
|
+
if (hasPendingMessage) {
|
|
250
|
+
this.api.postMessageFx.controller.abort();
|
|
251
|
+
this.removeLastMessage();
|
|
252
|
+
}
|
|
253
|
+
this.errorSpotting.abortPendingRequest();
|
|
254
|
+
this.t2s.stop();
|
|
255
|
+
void this.t2s.reset();
|
|
256
|
+
this.translation.reset();
|
|
257
|
+
this.setScrollActive(false);
|
|
258
|
+
})
|
|
259
|
+
});
|
|
260
|
+
reset = () => {
|
|
261
|
+
this.cache.reset();
|
|
262
|
+
this.resetAlternatives();
|
|
263
|
+
this.threadManager.resetAll();
|
|
264
|
+
this.errorSpotting.reset();
|
|
265
|
+
};
|
|
247
266
|
}
|
|
248
267
|
exports.ChatbotModel = ChatbotModel;
|
|
249
268
|
//# sourceMappingURL=ChatBotModel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_effector","require","_index","
|
|
1
|
+
{"version":3,"names":["_effector","require","_index","_ChatbotApi","_translation","_t2s","_messagesHelper","_ChatBotThreadManager","_ChatsCacheModel","_ErrorSpottingModel","ChatbotModel","$currentKey","createStore","resetAlternatives","createEvent","setAlternatives","setIsOpen","toggleOpen","$isOpen","restore","on","isOpen","removeLastMessage","setLastMessageKey","$lastMessageKey","setContext","$context","setScrollActive","$isScrollActive","cache","ChatsCacheModel","$currentChatData","combine","data","$data","key","defaultChatData","constructor","api","messages","$key","threadMessagesLimit","threadManager","ChatBotThreadManager","getHint","requestHint","messagesLimit","ChatbotAPI","postMessage","defaultMessages","$alternatives","getAlternativesFx","doneData","_","payload","reset","t2s","ChatTextToSpeechModel","translation","ChatbotTranslation","alternativesModel","$store","set","chats","errorSpotting","ErrorSpottingModel","bindKey","sample","source","updates","filter","target","clock","fn","lastMessageKey","chatsData","chat","updatedMessages","pop","update","createSendHelpRequestFx","effect","attach","mapParams","params","context","message","translatedMessage","createControllerEffect","Error","addMessages","messagesHelper","createOwn","response","postMessageFx","problem","language","problemAnswer","answer","imageAltText","imageDescription","createAnswer","endMessage","push","createLast","applyTranslationFx","targetLanguage","translationTargetLanguage","thread","fail","error","bindKeyStore","setT2SAudioProvider","audioProvider","setAudioProvider","setDrawBoardAdapter","adapter","bindStrokesValidation","$strokesValidationKey","sendHelpRequestFx","startConversation","props","createEffect","initOnly","length","reinitConversation","add","start","isAvailable","currentThread","setHintMessage","options","getState","hints","setSingleMessage","reinitChatThread","initialOption","anotherHintOption","resetThread","disableChat","stop","softReset","isLoading","pending","hasPendingMessage","controller","abort","abortPendingRequest","resetAll","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBotModel.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAUA,IAAAC,MAAA,GAAAD,OAAA;AAYA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAEA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAP,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAMO,MAAMS,YAAY,CAAC;EAQRC,WAAW,GAAG,IAAAC,qBAAW,EAAC,EAAE,CAAC;EAEpCC,iBAAiB,GAAG,IAAAC,qBAAW,EAAC,CAAC;EACjCC,eAAe,GAAG,IAAAD,qBAAW,EAAiC,CAAC;EAG/DE,SAAS,GAAG,IAAAF,qBAAW,EAAU,CAAC;EAClCG,UAAU,GAAG,IAAAH,qBAAW,EAAC,CAAC;EAC1BI,OAAO,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,SAAS,EAAE,KAAK,CAAC,CAACI,EAAE,CAAC,IAAI,CAACH,UAAU,EAAGI,MAAM,IAAK,CAACA,MAAM,CAAC;EAE1EC,iBAAiB,GAAG,IAAAR,qBAAW,EAAC,CAAC;EAChCS,iBAAiB,GAAG,IAAAT,qBAAW,EAAS,CAAC;EAC1CU,eAAe,GAAG,IAAAL,iBAAO,EAAC,IAAI,CAACI,iBAAiB,EAAE,IAAI,CAAC;EAEvDE,UAAU,GAAG,IAAAX,qBAAW,EAAwB,CAAC;EACjDY,QAAQ,GAAG,IAAAP,iBAAO,EAAC,IAAI,CAACM,UAAU,EAAE,IAAI,CAAC;EAEhDE,eAAe,GAAG,IAAAb,qBAAW,EAAU,CAAC;EACxCc,eAAe,GAAG,IAAAT,iBAAO,EAAC,IAAI,CAACQ,eAAe,EAAE,KAAK,CAA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AI,CAACpF,GAAG,CAACD,KAAK,CAAC,CAAC;MACrB,IAAI,CAACG,WAAW,CAACH,KAAK,CAAC,CAAC;MACxB,IAAI,CAAC5B,eAAe,CAAC,KAAK,CAAC;IAC7B,CAAC;EACH,CAAC,CAAC;EAEc4B,KAAK,GAAGA,CAAA,KAAM;IAC5B,IAAI,CAAC1B,KAAK,CAAC0B,KAAK,CAAC,CAAC;IAClB,IAAI,CAAC1C,iBAAiB,CAAC,CAAC;IACxB,IAAI,CAAC6B,aAAa,CAAC0G,QAAQ,CAAC,CAAC;IAC7B,IAAI,CAACpF,aAAa,CAACT,KAAK,CAAC,CAAC;EAC5B,CAAC;AACH;AAAC8F,OAAA,CAAA3I,YAAA,GAAAA,YAAA","ignoreList":[]}
|
package/dist/commonjs/features/chatbot/model/{ChatBotMessageHandler.js → ChatBotThreadManager.js}
RENAMED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ChatBotThreadManager = void 0;
|
|
7
7
|
var _ThreadItem = require("./ThreadItem.js");
|
|
8
|
-
var _effector = require("effector
|
|
8
|
+
var _effector = require("effector");
|
|
9
9
|
var _constants = require("./constants.js");
|
|
10
|
-
class
|
|
10
|
+
class ChatBotThreadManager {
|
|
11
|
+
drawBoardAdapter = null;
|
|
11
12
|
threads = new Map();
|
|
13
|
+
$threads = (0, _effector.createStore)(new Map());
|
|
12
14
|
currentKey = '';
|
|
13
15
|
currentBinding = null;
|
|
14
16
|
constructor({
|
|
@@ -18,7 +20,7 @@ class ChatMessageHandler {
|
|
|
18
20
|
messages
|
|
19
21
|
}) {
|
|
20
22
|
this.api = api;
|
|
21
|
-
this.drawBoardAdapter = drawBoardAdapter;
|
|
23
|
+
this.drawBoardAdapter = drawBoardAdapter ?? null;
|
|
22
24
|
this.messagesLimit = messagesLimit;
|
|
23
25
|
this.defaultMessages = messages;
|
|
24
26
|
}
|
|
@@ -33,18 +35,27 @@ class ChatMessageHandler {
|
|
|
33
35
|
const key = this.currentKey;
|
|
34
36
|
let threadItem = this.threads.get(key);
|
|
35
37
|
if (threadItem) return threadItem;
|
|
38
|
+
if (!this.drawBoardAdapter) {
|
|
39
|
+
threadItem = new _ThreadItem.ThreadItem();
|
|
40
|
+
this.threads.set(key, threadItem);
|
|
41
|
+
return threadItem;
|
|
42
|
+
}
|
|
36
43
|
try {
|
|
37
|
-
const
|
|
38
|
-
threadItem = new _ThreadItem.ThreadItem({
|
|
39
|
-
strokes
|
|
40
|
-
|
|
44
|
+
const result = await this.drawBoardAdapter.getVisibleStrokes();
|
|
45
|
+
threadItem = new _ThreadItem.ThreadItem(result ? {
|
|
46
|
+
strokes: result.strokes,
|
|
47
|
+
key: result.validationKey
|
|
48
|
+
} : null);
|
|
41
49
|
} catch {
|
|
42
50
|
threadItem = new _ThreadItem.ThreadItem();
|
|
43
51
|
}
|
|
44
52
|
this.threads.set(key, threadItem);
|
|
45
53
|
return threadItem;
|
|
46
54
|
}
|
|
47
|
-
|
|
55
|
+
setDrawBoardAdapter(adapter) {
|
|
56
|
+
this.drawBoardAdapter = adapter;
|
|
57
|
+
}
|
|
58
|
+
postMessage = async ({
|
|
48
59
|
problemAnswer,
|
|
49
60
|
problem,
|
|
50
61
|
answer,
|
|
@@ -60,23 +71,23 @@ class ChatMessageHandler {
|
|
|
60
71
|
language,
|
|
61
72
|
imageAltText
|
|
62
73
|
});
|
|
63
|
-
threadItem.
|
|
64
|
-
const nextOptions = threadItem.
|
|
74
|
+
threadItem.history.push(result.message);
|
|
75
|
+
const nextOptions = threadItem.history.length < this.messagesLimit ? [this.defaultMessages.anotherHintOption] : [];
|
|
65
76
|
return {
|
|
66
77
|
message: result.message,
|
|
67
78
|
options: nextOptions,
|
|
68
|
-
|
|
69
|
-
|
|
79
|
+
endMessage: !nextOptions.length,
|
|
80
|
+
thread: threadItem.toObject()
|
|
70
81
|
};
|
|
71
82
|
};
|
|
72
|
-
resetThread = (
|
|
83
|
+
resetThread = ({
|
|
73
84
|
key
|
|
74
85
|
}) => {
|
|
75
86
|
this.threads.delete(key);
|
|
76
|
-
}
|
|
87
|
+
};
|
|
77
88
|
resetAll() {
|
|
78
89
|
this.threads.clear();
|
|
79
90
|
}
|
|
80
91
|
}
|
|
81
|
-
exports.
|
|
82
|
-
//# sourceMappingURL=
|
|
92
|
+
exports.ChatBotThreadManager = ChatBotThreadManager;
|
|
93
|
+
//# sourceMappingURL=ChatBotThreadManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ThreadItem","require","_effector","_constants","ChatBotThreadManager","drawBoardAdapter","threads","Map","$threads","createStore","currentKey","currentBinding","constructor","api","messagesLimit","CHAT_BOT_MODEL_DEFAULTS","THREAD_MESSAGES_LIMIT","messages","defaultMessages","bindKeyStore","$store","watch","value","getThreadItem","key","threadItem","get","ThreadItem","set","result","getVisibleStrokes","strokes","validationKey","setDrawBoardAdapter","adapter","postMessage","problemAnswer","problem","answer","language","imageAltText","getHint","getNextHintProps","correctAnswer","problemDescription","userAnswer","history","push","message","nextOptions","length","anotherHintOption","options","endMessage","thread","toObject","resetThread","delete","resetAll","clear","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBotThreadManager.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AAeO,MAAMG,oBAAoB,CAAC;EAExBC,gBAAgB,GAAiC,IAAI;EAC5CC,OAAO,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAExCC,QAAQ,GAAG,IAAAC,qBAAW,EAAC,IAAIF,GAAG,CAAqB,CAAC,CAAC;EAG7DG,UAAU,GAAG,EAAE;EACfC,cAAc,GAAwB,IAAI;EAI3CC,WAAWA,CAAC;IACjBP,gBAAgB;IAChBQ,GAAG;IACHC,aAAa,GAAGC,kCAAu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
|
|
|
7
7
|
var _effector = require("effector");
|
|
8
8
|
var _index = require("../../../lib/effector/index.js");
|
|
9
9
|
var _helpers = require("../helpers.js");
|
|
10
|
+
var _randomElements = require("../../../lib/helpers/randomElements.js");
|
|
10
11
|
class ChatbotAPI {
|
|
11
12
|
constructor(api) {
|
|
13
|
+
this.spotErrorFx = (0, _index.createControllerEffect)(props => {
|
|
14
|
+
return new Promise(res => {
|
|
15
|
+
if (props.strokes.length <= 3) return res({
|
|
16
|
+
strokesIds: []
|
|
17
|
+
});
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
const randomStrokes = (0, _randomElements.getRandomElements)(props.strokes, 4);
|
|
20
|
+
res({
|
|
21
|
+
strokesIds: randomStrokes.map(stroke => stroke.id ?? '')
|
|
22
|
+
});
|
|
23
|
+
}, 1000);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
// this.spotErrorFx = createControllerEffect(api.spotError)
|
|
12
27
|
this.postMessageFx = (0, _index.createControllerEffect)(api.postMessage);
|
|
13
28
|
this.getAlternativesFx = (0, _effector.createEffect)(api.getAlternatives);
|
|
14
29
|
this.translateTextFx = (0, _effector.createEffect)(async payload => {
|
|
@@ -31,4 +46,4 @@ class ChatbotAPI {
|
|
|
31
46
|
}
|
|
32
47
|
}
|
|
33
48
|
exports.ChatbotAPI = ChatbotAPI;
|
|
34
|
-
//# sourceMappingURL=
|
|
49
|
+
//# sourceMappingURL=ChatbotApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","_index","_helpers","_randomElements","ChatbotAPI","constructor","api","spotErrorFx","createControllerEffect","props","Promise","res","strokes","length","strokesIds","setTimeout","randomStrokes","getRandomElements","map","stroke","id","postMessageFx","postMessage","getAlternativesFx","createEffect","getAlternatives","translateTextFx","payload","response","postTranslateText","text","replaceKatexSyntax","data","translations","translation","translatedText","textToSpeechTextFx","postTextToSpeech","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatbotAp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