@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
|
@@ -51,18 +51,26 @@ const ChatControls = ({
|
|
|
51
51
|
},
|
|
52
52
|
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
53
53
|
size: _reactNativeUi.ButtonSize.LARGE,
|
|
54
|
-
colorScheme: _reactNativeUi.ButtonColor.
|
|
54
|
+
colorScheme: _reactNativeUi.ButtonColor.WHITE,
|
|
55
55
|
raiseLevel: 5,
|
|
56
56
|
customColorScheme: {
|
|
57
57
|
[_reactNativeUi.ButtonStates.DEFAULT]: {
|
|
58
|
-
backgroundColor:
|
|
58
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
59
59
|
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
60
|
-
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
60
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
61
|
+
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
61
62
|
},
|
|
62
63
|
[_reactNativeUi.ButtonStates.PRESSED]: {
|
|
63
64
|
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_4,
|
|
64
65
|
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
65
|
-
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
66
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
67
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
68
|
+
},
|
|
69
|
+
[_reactNativeUi.ButtonStates.HOVER]: {
|
|
70
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
|
|
71
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
72
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
73
|
+
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
66
74
|
}
|
|
67
75
|
},
|
|
68
76
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseIcon.CloseIcon, {})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeUi","_effectorReact","_ChatbotIcon","_GlobeIcon","_CloseIcon","_jsxRuntime","e","__esModule","default","ChatControls","model","onPressTranslate","onPressChatIcon","onPressClose","isTranslationEnabled","ButtonWrapper","iconSize","width","height","isOpen","useUnit","$isOpen","isTranslated","translation","$isTranslated","isTranslationPending","translateAllMessagesFx","pending","isHelpRequestPending","sendHelpRequestFx","backgroundColor","COLORS","PRIMARY_BLUE","NEUTRAL_1","translatedFillColor","NEUTRAL_9","fillColor","NEUTRAL_5","jsxs","View","style","styles","container","children","jsx","Pressable","onPress","disabled","buttonTranslate","ActivityIndicator","GlobeIcon","color","Button","button","buttonClose","variant","ButtonVariant","PRIMARY","size","ButtonSize","LARGE","colorScheme","ButtonColor","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeUi","_effectorReact","_ChatbotIcon","_GlobeIcon","_CloseIcon","_jsxRuntime","e","__esModule","default","ChatControls","model","onPressTranslate","onPressChatIcon","onPressClose","isTranslationEnabled","ButtonWrapper","iconSize","width","height","isOpen","useUnit","$isOpen","isTranslated","translation","$isTranslated","isTranslationPending","translateAllMessagesFx","pending","isHelpRequestPending","sendHelpRequestFx","backgroundColor","COLORS","PRIMARY_BLUE","NEUTRAL_1","translatedFillColor","NEUTRAL_9","fillColor","NEUTRAL_5","jsxs","View","style","styles","container","children","jsx","Pressable","onPress","disabled","buttonTranslate","ActivityIndicator","GlobeIcon","color","Button","button","buttonClose","variant","ButtonVariant","PRIMARY","size","ButtonSize","LARGE","colorScheme","ButtonColor","WHITE","raiseLevel","customColorScheme","ButtonStates","DEFAULT","borderColor","raiseColor","NEUTRAL_10","PRESSED","NEUTRAL_4","HOVER","NEUTRAL_3","CloseIcon","ChatbotIcon","exports","StyleSheet","create","alignItems","justifyContent","flexDirection","maxHeight","gap","paddingBottom","borderRadius","paddingHorizontal","borderWidth","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatControls/ChatControls.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAQA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA8D,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAYvD,MAAMG,YAAY,GAAGA,CAAC;EAC3BC,KAAK;EACLC,gBAAgB;EAChBC,eAAe;EACfC,YAAY;EACZC,oBAAoB;EACpBC,aAAa;EACbC,QAAQ,GAAG;IAAEC,KAAK,EAAE,EAAE;IAAEC,MAAM,EAAE;EAAI;AACnB,CAAC,KAAK;EACvB,MAAMC,MAAM,GAAG,IAAAC,sBAAO,EAACV,KAAK,CAACW,OAAO,CAAC;EACrC,MAAMC,YAAY,GAAG,IAAAF,sBAAO,EAACV,KAAK,CAACa,WAAW,CAACC,aAAa,CAAC;EAC7D,MAAMC,oBAAoB,GAAG,IAAAL,sBAAO,EAACV,KAAK,CAACa,WAAW,CAACG,sBAAsB,CAAC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AAQ,EAAEE;QAAO,CAAE;MAAC,CACxD;IAAC,CACC;EAAC,CACZ,CAAC;AAEX,CAAC;AAAA2D,OAAA,CAAApE,YAAA,GAAAA,YAAA;AAED,MAAMgC,MAAM,GAAGqC,uBAAU,CAACC,MAAM,CAAC;EAC/BrC,SAAS,EAAE;IACTsC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAE,GAAG;IACdC,GAAG,EAAE,CAAC;IACNC,aAAa,EAAE;EACjB,CAAC;EACD/B,WAAW,EAAE;IACXrC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVoE,YAAY,EAAE,EAAE;IAChBC,iBAAiB,EAAE,CAAC;IACpBC,WAAW,EAAE,GAAG;IAChBpB,WAAW,EAAErC,qBAAM,CAACM;EACtB,CAAC;EACDW,eAAe,EAAE;IACfgC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBhE,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVoE,YAAY,EAAE,EAAE;IAChBE,WAAW,EAAE,CAAC;IACdpB,WAAW,EAAE,SAAS;IACtBqB,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEzE,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCyE,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZ/D,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_ReceivedMessage","_SentMessage","_modelTypes","_jsxRuntime","e","__esModule","default","variantsMap","MessageVariant","SENT","SentMessage","RECEIVED","ReceivedMessage","ChatMessage","variant","props","Component","jsx","exports"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ChatMessage.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAAyE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_ReceivedMessage","_SentMessage","_modelTypes","_jsxRuntime","e","__esModule","default","variantsMap","MessageVariant","SENT","SentMessage","RECEIVED","ReceivedMessage","ChatMessage","variant","props","Component","jsx","exports"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ChatMessage.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAAyE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAgBzE,MAAMG,WAAgE,GAAG;EACvE,CAACC,0BAAc,CAACC,IAAI,GAAGC,wBAAW;EAClC,CAACF,0BAAc,CAACG,QAAQ,GAAGC;AAC7B,CAAC;AAEM,MAAMC,WAAW,GAAGA,CAAC;EAAEC,OAAO;EAAE,GAAGC;AAAwB,CAAC,KAAK;EACtE,MAAMC,SAAS,GAAGT,WAAW,CAACO,OAAO,CAAC;EACtC,oBAAO,IAAAX,WAAA,CAAAc,GAAA,EAACD,SAAS;IAAA,GAAKD;EAAK,CAAG,CAAC;AACjC,CAAC;AAAAG,OAAA,CAAAL,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -9,6 +9,7 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _ChatbotIcon = require("../../../../shared/icons/ChatbotIcon.js");
|
|
10
10
|
var _MessageTextToSpeech = require("./MessageTextToSpeech.js");
|
|
11
11
|
var _modelTypes = require("../../types/model.types.js");
|
|
12
|
+
var _ErrorSpottingButton = require("../../errorSpotting/ErrorSpottingButton.js");
|
|
12
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
const ReceivedMessage = ({
|
|
@@ -18,7 +19,8 @@ const ReceivedMessage = ({
|
|
|
18
19
|
isActive,
|
|
19
20
|
audioStatus,
|
|
20
21
|
renderer,
|
|
21
|
-
withTextToSpeech = true
|
|
22
|
+
withTextToSpeech = true,
|
|
23
|
+
withErrorSpotting
|
|
22
24
|
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
23
25
|
style: styles.container,
|
|
24
26
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
@@ -29,15 +31,15 @@ const ReceivedMessage = ({
|
|
|
29
31
|
})
|
|
30
32
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
31
33
|
style: styles.message,
|
|
32
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.
|
|
34
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
33
35
|
style: [styles.messageText, {
|
|
34
36
|
width: withTextToSpeech ? 240 : 305
|
|
35
37
|
}],
|
|
36
|
-
children: renderer ? renderer({
|
|
38
|
+
children: [renderer ? renderer({
|
|
37
39
|
message,
|
|
38
40
|
variant: _modelTypes.MessageVariant.RECEIVED,
|
|
39
41
|
withTextToSpeech
|
|
40
|
-
}) : message
|
|
42
|
+
}) : message, !!withErrorSpotting && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorSpottingButton.ErrorSpottingButton, {})]
|
|
41
43
|
}), withTextToSpeech && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageTextToSpeech.MessageTextToSpeech, {
|
|
42
44
|
isActive: isActive,
|
|
43
45
|
isLoading: isTextToSpeechPending,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ChatbotIcon","_MessageTextToSpeech","_modelTypes","_jsxRuntime","e","__esModule","default","ReceivedMessage","message","onPressTextToSpeech","isTextToSpeechPending","isActive","audioStatus","renderer","withTextToSpeech","jsxs","View","style","styles","container","children","jsx","icon","ChatbotIcon","width","height","Text","messageText","variant","MessageVariant","RECEIVED","MessageTextToSpeech","isLoading","onPress","disabled","status","exports","StyleSheet","create","flex","flexDirection","maxWidth","alignItems","alignSelf","marginRight","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderBottomLeftRadius","backgroundColor","fontSize","fontWeight","fontFamily","color"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ReceivedMessage.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ChatbotIcon","_MessageTextToSpeech","_modelTypes","_ErrorSpottingButton","_jsxRuntime","e","__esModule","default","ReceivedMessage","message","onPressTextToSpeech","isTextToSpeechPending","isActive","audioStatus","renderer","withTextToSpeech","withErrorSpotting","jsxs","View","style","styles","container","children","jsx","icon","ChatbotIcon","width","height","Text","messageText","variant","MessageVariant","RECEIVED","ErrorSpottingButton","MessageTextToSpeech","isLoading","onPress","disabled","status","exports","StyleSheet","create","flex","flexDirection","maxWidth","alignItems","alignSelf","marginRight","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderBottomLeftRadius","backgroundColor","fontSize","fontWeight","fontFamily","color"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ReceivedMessage.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AAA6E,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtE,MAAMG,eAAe,GAAGA,CAAC;EAC9BC,OAAO;EACPC,mBAAmB;EACnBC,qBAAqB;EACrBC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACRC,gBAAgB,GAAG,IAAI;EACvBC;AACY,CAAC,kBACb,IAAAZ,WAAA,CAAAa,IAAA,EAAClB,YAAA,CAAAmB,IAAI;EAACC,KAAK,EAAEC,MAAM,CAACC,SAAU;EAAAC,QAAA,gBAC5B,IAAAlB,WAAA,CAAAmB,GAAA,EAACxB,YAAA,CAAAmB,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACI,IAAK;IAAAF,QAAA,eACvB,IAAAlB,WAAA,CAAAmB,GAAA,EAACvB,YAAA,CAAAyB,WAAW;MAACC,KAAK,EAAE,EAAG;MAACC,MAAM,EAAE;IAAG,CAAE;EAAC,CAClC,CAAC,eAEP,IAAAvB,WAAA,CAAAa,IAAA,EAAClB,YAAA,CAAAmB,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACX,OAAQ;IAAAa,QAAA,gBAC1B,IAAAlB,WAAA,CAAAa,IAAA,EAAClB,YAAA,CAAA6B,IAAI;MAACT,KAAK,EAAE,CAACC,MAAM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AE,CAAC;IACZC,YAAY,EAAE,CAAC;IACfC,sBAAsB,EAAE,CAAC;IACzBC,eAAe,EAAE;EACnB,CAAC;EACD3B,WAAW,EAAE;IACXa,IAAI,EAAE,CAAC;IACPe,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,GAAG;IACfC,UAAU,EAAE,cAAc;IAC1BC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -20,6 +20,15 @@ const BOTTOM_OFFSET = _reactNative.Platform.select({
|
|
|
20
20
|
web: 265,
|
|
21
21
|
default: 294
|
|
22
22
|
});
|
|
23
|
+
function findListReceivedMessage(messages) {
|
|
24
|
+
let i = messages.length - 1;
|
|
25
|
+
while (i >= 2) {
|
|
26
|
+
const message = messages[i];
|
|
27
|
+
if (!message.isOwnMessage && !message.endMessage) return messages[i];
|
|
28
|
+
i--;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
23
32
|
const ChatbotMessages = ({
|
|
24
33
|
model,
|
|
25
34
|
isHintFeedback,
|
|
@@ -55,6 +64,7 @@ const ChatbotMessages = ({
|
|
|
55
64
|
translatedMessage
|
|
56
65
|
});
|
|
57
66
|
};
|
|
67
|
+
const lastReceivedMessage = findListReceivedMessage(messages);
|
|
58
68
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
59
69
|
style: [styles.container, {
|
|
60
70
|
maxHeight: MAX_HEIGHT
|
|
@@ -83,7 +93,8 @@ const ChatbotMessages = ({
|
|
|
83
93
|
isActive: id === currentPlayingId,
|
|
84
94
|
isTextToSpeechPending: isTextToSpeechPending,
|
|
85
95
|
variant: isOwnMessage ? _modelTypes.MessageVariant.SENT : _modelTypes.MessageVariant.RECEIVED,
|
|
86
|
-
withTextToSpeech: isTextToSpeechEnabled && !isOwnMessage
|
|
96
|
+
withTextToSpeech: isTextToSpeechEnabled && !isOwnMessage,
|
|
97
|
+
withErrorSpotting: !isHelpRequestPending && lastReceivedMessage?.id === id
|
|
87
98
|
}, id)), isHelpRequestPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageLoader.MessageLoader, {})]
|
|
88
99
|
}), !isHelpRequestPending && isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alternatives.Alternatives, {
|
|
89
100
|
model: model,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_effectorReact","_ChatMessage","_MessageLoader","_Alternatives","_constants","_modelTypes","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TOOLBAR_HEIGHT","BOTTOM_OFFSET","Platform","select","web","ChatbotMessages","model","isHintFeedback","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","renderer","dimensions","useWindowDimensions","ref","useRef","isOpen","useUnit","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","MAX_HEIGHT","height","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_effectorReact","_ChatMessage","_MessageLoader","_Alternatives","_constants","_modelTypes","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TOOLBAR_HEIGHT","BOTTOM_OFFSET","Platform","select","web","findListReceivedMessage","messages","length","message","isOwnMessage","endMessage","ChatbotMessages","model","isHintFeedback","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","renderer","dimensions","useWindowDimensions","ref","useRef","isOpen","useUnit","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","MAX_HEIGHT","height","useStoreMap","$currentChatData","playTextToSpeech","id","translatedMessage","text","play","messageId","config","TEXT_TO_SPEECH_CONFIG","askChatForHelp","lastReceivedMessage","jsx","View","style","styles","container","maxHeight","children","jsxs","ScrollView","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","ChatMessage","onPressTextToSpeech","isActive","variant","MessageVariant","SENT","RECEIVED","withTextToSpeech","withErrorSpotting","MessageLoader","Alternatives","onPressAlternative","hasMessages","exports","StyleSheet","create","flex","alignItems","width","paddingVertical"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAAyE,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,C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sB;UAC7C8C,OAAO,EAAEjE,YAAY,GAAGkE,0BAAc,CAACC,IAAI,GAAGD,0BAAc,CAACE,QAAS;UACtEC,gBAAgB,EAAE/D,qBAAqB,IAAI,CAACN,YAAa;UACzDsE,iBAAiB,EAAE,CAACtD,oBAAoB,IAAI2B,mBAAmB,EAAER,EAAE,KAAKA;QAAG,GATtEA,EAUN,CACF,CAAC,EAEDnB,oBAAoB,iBAAI,IAAA9C,WAAA,CAAA0E,GAAA,EAAC9E,cAAA,CAAAyG,aAAa,IAAE,CAAC;MAAA,CACtC,CACP,EAEA,CAACvD,oBAAoB,IAAIH,MAAM,iBAC9B,IAAA3C,WAAA,CAAA0E,GAAA,EAAC7E,aAAA,CAAAyG,YAAY;QACXrE,KAAK,EAAEA,KAAM;QACbsE,kBAAkB,EAAE/B,cAAe;QACnCgC,WAAW,EAAE7E,QAAQ,CAACC,MAAM,GAAG,CAAE;QACjCM,cAAc,EAAEA;MAAe,CAChC,CACF;IAAA,CACS;EAAC,CACT,CAAC;AAEX,CAAC;AAAAuE,OAAA,CAAAzE,eAAA,GAAAA,eAAA;AAED,MAAM6C,MAAM,GAAG6B,uBAAU,CAACC,MAAM,CAAC;EAC/B7B,SAAS,EAAE;IACT8B,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,UAAU;IACtBC,KAAK,EAAE,GAAG;IACVjD,MAAM,EAAE;EACV,CAAC;EACDuB,IAAI,EAAE;IACJyB,UAAU,EAAE,UAAU;IACtBE,eAAe,EAAE;EACnB,CAAC;EACDrB,GAAG,EAAE;IACHkB,IAAI,EAAE,CAAC;IACPlB,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _effectorReact = require("effector-react");
|
|
|
8
8
|
var _ChatbotMessages = require("./ChatMessages/ChatbotMessages.js");
|
|
9
9
|
var _ChatControls = require("./ChatControls/ChatControls.js");
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _ChatBotContext = require("../context/ChatBotContext.js");
|
|
11
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
14
|
const Chatbot = ({
|
|
@@ -33,7 +34,10 @@ const Chatbot = ({
|
|
|
33
34
|
if (!isAvailable || alternatives?.chatAccess === false) {
|
|
34
35
|
return null;
|
|
35
36
|
}
|
|
36
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
37
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ChatBotContext.ChatBotContext.Provider, {
|
|
38
|
+
value: {
|
|
39
|
+
model
|
|
40
|
+
},
|
|
37
41
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotMessages.ChatbotMessages, {
|
|
38
42
|
model: model,
|
|
39
43
|
renderer: renderer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_effectorReact","require","_ChatbotMessages","_ChatControls","_react","_interopRequireDefault","_jsxRuntime","e","__esModule","default","Chatbot","model","isHintFeedback","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","isTranslationEnabled","renderer","ButtonWrapper","iconSize","alternatives","useUnit","$alternatives","isAvailable","useStoreMap","$currentChatData","translateMessages","translation","translateAllMessagesFx","openChat","setIsOpen","closeChat","chatAccess","jsxs","
|
|
1
|
+
{"version":3,"names":["_effectorReact","require","_ChatbotMessages","_ChatControls","_react","_interopRequireDefault","_ChatBotContext","_jsxRuntime","e","__esModule","default","Chatbot","model","isHintFeedback","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","isTranslationEnabled","renderer","ButtonWrapper","iconSize","alternatives","useUnit","$alternatives","isAvailable","useStoreMap","$currentChatData","translateMessages","translation","translateAllMessagesFx","openChat","setIsOpen","closeChat","chatAccess","jsxs","ChatBotContext","Provider","value","children","jsx","ChatbotMessages","ChatControls","onPressTranslate","onPressChatIcon","onPressClose","exports"],"sourceRoot":"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QAAA,gBACxC,IAAA/B,WAAA,CAAAgC,GAAA,EAACrC,gBAAA,CAAAsC,eAAe;MACd5B,KAAK,EAAEA,KAAM;MACbM,QAAQ,EAAEA,QAAS;MACnBL,cAAc,EAAEA,cAAe;MAC/BC,mBAAmB,EAAEA,mBAAoB;MACzCC,qBAAqB,EAAEA,qBAAsB;MAC7CC,kBAAkB,EAAEA;IAAmB,CACxC,CAAC,eAEF,IAAAT,WAAA,CAAAgC,GAAA,EAACpC,aAAA,CAAAsC,YAAY;MACX7B,KAAK,EAAEA,KAAM;MACb8B,gBAAgB,EAAEf,iBAAkB;MACpCgB,eAAe,EAAEb,QAAS;MAC1Bc,YAAY,EAAEZ,SAAU;MACxBf,oBAAoB,EAAEA,oBAAqB;MAC3CE,aAAa,EAAEA,aAAc;MAC7BC,QAAQ,EAAEA;IAAS,CACpB,CAAC;EAAA,CACqB,CAAC;AAE9B,CAAC;AAAAyB,OAAA,CAAAlC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChatBotContext = void 0;
|
|
7
|
+
exports.useChatModel = useChatModel;
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
const ChatBotContext = exports.ChatBotContext = /*#__PURE__*/(0, _react.createContext)(null);
|
|
10
|
+
function useChatModel() {
|
|
11
|
+
const context = (0, _react.useContext)(ChatBotContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error('Something went wrong, you are probably trying to use component that is supposed to be inside ChatBotContext.Provider');
|
|
14
|
+
}
|
|
15
|
+
return context.model;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ChatBotContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","require","ChatBotContext","exports","createContext","useChatModel","context","useContext","Error","model"],"sourceRoot":"../../../../../src","sources":["features/chatbot/context/ChatBotContext.ts"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAOO,MAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,gBAAG,IAAAE,oBAAa,EAA6B,IAAI,CAAC;AAEtE,SAASC,YAAYA,CAAA,EAAG;EAC7B,MAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACL,cAAc,CAAC;EAC1C,IAAI,CAACI,OAAO,EAAE;IACZ,MAAM,IAAIE,KAAK,CACb,sHACF,CAAC;EACH;EACA,OAAOF,OAAO,CAACG,KAAK;AACtB","ignoreList":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ErrorSpottingButton = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
9
|
+
var _ChatBotContext = require("../context/ChatBotContext.js");
|
|
10
|
+
var _effectorReact = require("effector-react");
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
var _HighlighterIcon = require("../../../shared/icons/HighlighterIcon.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const ErrorSpottingButton = () => {
|
|
16
|
+
const model = (0, _ChatBotContext.useChatModel)();
|
|
17
|
+
const activeErrorSpotting = (0, _effectorReact.useUnit)(model.errorSpotting.$activeData);
|
|
18
|
+
const validationKey = (0, _effectorReact.useUnit)(model.errorSpotting.$validationKey);
|
|
19
|
+
const isLoading = (0, _effectorReact.useUnit)(model.errorSpotting.$isLoading);
|
|
20
|
+
const currentThread = (0, _effectorReact.useStoreMap)(model.$currentChatData, chatData => chatData.currentThread);
|
|
21
|
+
if (!currentThread?.strokes) return null;
|
|
22
|
+
const isActive = !!activeErrorSpotting?.isActive;
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
|
+
style: styles.container,
|
|
25
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
26
|
+
style: buttonStyles,
|
|
27
|
+
disabled: validationKey !== currentThread.key,
|
|
28
|
+
isActive: isActive,
|
|
29
|
+
isLoading: isLoading,
|
|
30
|
+
variant: 'secondary',
|
|
31
|
+
colorScheme: 'blue',
|
|
32
|
+
size: 'small',
|
|
33
|
+
onPress: () => {
|
|
34
|
+
if (isLoading) return;
|
|
35
|
+
model.errorSpotting.errorSpottingPressed();
|
|
36
|
+
},
|
|
37
|
+
icon: isActive ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.StopIcon, {
|
|
38
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
39
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_HighlighterIcon.HighlighterIcon, {}),
|
|
40
|
+
children: "show error"
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
exports.ErrorSpottingButton = ErrorSpottingButton;
|
|
45
|
+
const buttonStyles = _reactNative.StyleSheet.create({
|
|
46
|
+
container: {
|
|
47
|
+
marginLeft: 'auto'
|
|
48
|
+
},
|
|
49
|
+
text: {
|
|
50
|
+
textTransform: 'uppercase'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const styles = _reactNative.StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
width: '100%'
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=ErrorSpottingButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeUi","_ChatBotContext","_effectorReact","_reactNative","_HighlighterIcon","_jsxRuntime","e","__esModule","default","ErrorSpottingButton","model","useChatModel","activeErrorSpotting","useUnit","errorSpotting","$activeData","validationKey","$validationKey","isLoading","$isLoading","currentThread","useStoreMap","$currentChatData","chatData","strokes","isActive","jsx","View","style","styles","container","children","Button","buttonStyles","disabled","key","variant","colorScheme","size","onPress","errorSpottingPressed","icon","StopIcon","color","COLORS","NEUTRAL_1","HighlighterIcon","exports","StyleSheet","create","marginLeft","text","textTransform","width"],"sourceRoot":"../../../../../src","sources":["features/chatbot/errorSpotting/ErrorSpottingButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAAuE,IAAAM,WAAA,GAAAN,OAAA;AAAA,SAAAD,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhE,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,KAAK,GAAG,IAAAC,4BAAY,EAAC,CAAC;EAC5B,MAAMC,mBAAmB,GAAG,IAAAC,sBAAO,EAACH,KAAK,CAACI,aAAa,CAACC,WAAW,CAAC;EACpE,MAAMC,aAAa,GAAG,IAAAH,sBAAO,EAACH,KAAK,CAACI,aAAa,CAACG,cAAc,CAAC;EACjE,MAAMC,SAAS,GAAG,IAAAL,sBAAO,EAACH,KAAK,CAACI,aAAa,CAACK,UAAU,CAAC;EACzD,MAAMC,aAAa,GAAG,IAAAC,0BAAW,EAACX,KAAK,CAACY,gBAAgB,EAAGC,QAAQ,IAAKA,QAAQ,CAACH,aAAa,CAAC;EAE/F,IAAI,CAACA,aAAa,EAAEI,OAAO,EAAE,OAAO,IAAI;EAExC,MAAMC,QAAQ,GAAG,CAAC,CAACb,mBAAmB,EAAEa,Q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
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ErrorSpottingModel = void 0;
|
|
7
|
+
var _effector = require("effector");
|
|
8
|
+
class ErrorSpottingModel {
|
|
9
|
+
errorSpottingPressed = (0, _effector.createEvent)();
|
|
10
|
+
activeDataChanged = (0, _effector.createEvent)();
|
|
11
|
+
$validationKey = (0, _effector.createStore)(null);
|
|
12
|
+
$activeData = (0, _effector.createStore)(null).on(this.activeDataChanged, (state, payload) => {
|
|
13
|
+
if (typeof payload === 'function') return payload(state);
|
|
14
|
+
return payload;
|
|
15
|
+
}).on(this.$validationKey, (state, payload) => {
|
|
16
|
+
if (!state || payload === null) return state;
|
|
17
|
+
const isDisabled = payload !== state.validationKey;
|
|
18
|
+
return {
|
|
19
|
+
...state,
|
|
20
|
+
isDisabled,
|
|
21
|
+
isActive: isDisabled ? false : state.isActive
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
constructor({
|
|
25
|
+
api,
|
|
26
|
+
$currentChatData
|
|
27
|
+
}) {
|
|
28
|
+
this.api = api;
|
|
29
|
+
this.$isLoading = api.spotErrorFx.pending;
|
|
30
|
+
this.$activeData.on($currentChatData, (state, payload) => {
|
|
31
|
+
if (!state || state.validationKey !== payload.currentThread?.key) return null;
|
|
32
|
+
});
|
|
33
|
+
(0, _effector.sample)({
|
|
34
|
+
clock: api.spotErrorFx.doneData,
|
|
35
|
+
source: {
|
|
36
|
+
chatData: $currentChatData,
|
|
37
|
+
activeSpotting: this.$activeData,
|
|
38
|
+
validationKey: this.$validationKey
|
|
39
|
+
},
|
|
40
|
+
fn: (source, result) => {
|
|
41
|
+
const key = source.chatData.currentThread?.key || null;
|
|
42
|
+
const currentKey = source.validationKey;
|
|
43
|
+
const isDisabled = !!currentKey && currentKey !== key;
|
|
44
|
+
return {
|
|
45
|
+
validationKey: key,
|
|
46
|
+
strokesIds: result.strokesIds,
|
|
47
|
+
isActive: !isDisabled,
|
|
48
|
+
isDisabled
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
target: this.$activeData
|
|
52
|
+
});
|
|
53
|
+
(0, _effector.sample)({
|
|
54
|
+
clock: this.errorSpottingPressed,
|
|
55
|
+
source: {
|
|
56
|
+
chatData: $currentChatData,
|
|
57
|
+
activeSpotting: this.$activeData
|
|
58
|
+
},
|
|
59
|
+
fn: source => source,
|
|
60
|
+
target: (0, _effector.createEffect)(({
|
|
61
|
+
chatData,
|
|
62
|
+
activeSpotting
|
|
63
|
+
}) => {
|
|
64
|
+
if (!chatData.currentThread?.strokes) return;
|
|
65
|
+
if (!activeSpotting) {
|
|
66
|
+
return this.api.spotErrorFx({
|
|
67
|
+
strokes: chatData.currentThread.strokes
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
this.toggleActiveSpotting();
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
toggleActiveSpotting() {
|
|
75
|
+
this.activeDataChanged(state => {
|
|
76
|
+
if (state) return {
|
|
77
|
+
...state,
|
|
78
|
+
isActive: !state.isActive
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
bindStrokesValidation($store) {
|
|
83
|
+
(0, _effector.sample)({
|
|
84
|
+
source: $store,
|
|
85
|
+
target: this.$validationKey
|
|
86
|
+
});
|
|
87
|
+
return this;
|
|
88
|
+
}
|
|
89
|
+
abortPendingRequest() {
|
|
90
|
+
const isPending = this.api.spotErrorFx.pending.getState();
|
|
91
|
+
if (isPending) this.api.spotErrorFx.controller.abort();
|
|
92
|
+
}
|
|
93
|
+
reset() {
|
|
94
|
+
this.activeDataChanged(null);
|
|
95
|
+
this.abortPendingRequest();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.ErrorSpottingModel = ErrorSpottingModel;
|
|
99
|
+
//# sourceMappingURL=ErrorSpottingModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","ErrorSpottingModel","errorSpottingPressed","createEvent","activeDataChanged","$validationKey","createStore","$activeData","on","state","payload","isDisabled","validationKey","isActive","constructor","api","$currentChatData","$isLoading","spotErrorFx","pending","currentThread","key","sample","clock","doneData","source","chatData","activeSpotting","fn","result","currentKey","strokesIds","target","createEffect","strokes","toggleActiveSpotting","bindStrokesValidation","$store","abortPendingRequest","isPending","getState","controller","abort","reset","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/errorSpotting/ErrorSpottingModel.ts"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAoBO,MAAMC,kBAAkB,CAAC;EAGdC,oBAAoB,GAAG,IAAAC,qBAAW,EAAC,CAAC;EACnCC,iBAAiB,GAAG,IAAAD,qBAAW,EAI9C,CAAC;EAEaE,cAAc,GAAG,IAAAC,qBAAW,EAAgB,IAAI,CAAC;EACjDC,WAAW,GAAG,IAAAD,qBAAW,EAAiC,IAAI,CAAC,CAC5EE,EAAE,CAAC,IAAI,CAACJ,iBAAiB,EAAE,CAACK,KAAK,EAAEC,OAAO,KAAK;IAC9C,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE,OAAOA,OAAO,CAACD,KAAK,CAAC;IACxD,OAAOC,OAAO;EAChB,CAAC,CAAC,CACDF,EAAE,CAAC,IAAI,CAACH,cAAc,EAAE,CAACI,KAAK,EAAEC,OAAO,KAAK;IAC3C,IAAI,CAACD,KAAK,IAAIC,OAAO,KAAK,IAAI,EAAE,OAAOD,KAAK;IAC5C,MAAME,UAAU,GAAGD,OAAO,KAAKD,KAAK,CAACG,aAAa;IAClD,OAAO;MAAE,GAAGH,KAAK;MAAEE,UAAU;MAAEE,QAAQ,EAAEF,UAAU,GAAG,KAAK,GAAGF,KAAK,CAACI;IAAS,CAAC;EAChF,CAAC,CAAC;EAIGC,WAAWA,CAAC;IAAEC,GAAG;IAAEC;EAAqC,CAAC,EAAE;IAChE,IAAI,CAACD,GAAG,GAAGA,GAAG;IAEd,IAAI,CAACE,UAAU,GAAGF,GAAG,CAACG,WA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I,CAACP,cAAc,EAAE;UACnB,OAAO,IAAI,CAACZ,GAAG,CAACG,WAAW,CAAC;YAAEgB,OAAO,EAAER,QAAQ,CAACN,aAAa,CAACc;UAAQ,CAAC,CAAC;QAC1E;QACA,IAAI,CAACC,oBAAoB,CAAC,CAAC;MAC7B,CAAC;IACH,CAAC,CAAC;EACJ;EAEQA,oBAAoBA,CAAA,EAAG;IAC7B,IAAI,CAAC/B,iBAAiB,CAAEK,KAAK,IAAK;MAChC,IAAIA,KAAK,EAAE,OAAO;QAAE,GAAGA,KAAK;QAAEI,QAAQ,EAAE,CAACJ,KAAK,CAACI;MAAS,CAAC;IAC3D,CAAC,CAAC;EACJ;EAEOuB,qBAAqBA,CAACC,MAA4B,EAAE;IACzD,IAAAf,gBAAM,EAAC;MACLG,MAAM,EAAEY,MAAM;MACdL,MAAM,EAAE,IAAI,CAAC3B;IACf,CAAC,CAAC;IACF,OAAO,IAAI;EACb;EAEOiC,mBAAmBA,CAAA,EAAG;IAC3B,MAAMC,SAAS,GAAG,IAAI,CAACxB,GAAG,CAACG,WAAW,CAACC,OAAO,CAACqB,QAAQ,CAAC,CAAC;IACzD,IAAID,SAAS,EAAE,IAAI,CAACxB,GAAG,CAACG,WAAW,CAACuB,UAAU,CAACC,KAAK,CAAC,CAAC;EACxD;EAEOC,KAAKA,CAAA,EAAG;IACb,IAAI,CAACvC,iBAAiB,CAAC,IAAI,CAAC;IAC5B,IAAI,CAACkC,mBAAmB,CAAC,CAAC;EAC5B;AACF;AAACM,OAAA,CAAA3C,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -9,12 +9,6 @@ Object.defineProperty(exports, "AudioStatus", {
|
|
|
9
9
|
return _t2sTypes.AudioStatus;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "ChatMessageHandler", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _ChatBotMessageHandler.ChatMessageHandler;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "Chatbot", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
@@ -43,6 +37,5 @@ var _Chatbot = require("./components/Chatbot.js");
|
|
|
43
37
|
var _ChatBotModel = require("./model/ChatBotModel.js");
|
|
44
38
|
var _t2sTypes = require("./types/t2s.types.js");
|
|
45
39
|
var _modelTypes = require("./types/model.types.js");
|
|
46
|
-
var _ChatBotMessageHandler = require("./model/ChatBotMessageHandler.js");
|
|
47
40
|
var _DefaultMessageCreator = require("./model/DefaultMessageCreator.js");
|
|
48
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Chatbot","require","_ChatBotModel","_t2sTypes","_modelTypes","
|
|
1
|
+
{"version":3,"names":["_Chatbot","require","_ChatBotModel","_t2sTypes","_modelTypes","_DefaultMessageCreator"],"sourceRoot":"../../../../src","sources":["features/chatbot/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAOA,IAAAI,sBAAA,GAAAJ,OAAA","ignoreList":[]}
|