@magmamath/students-features 0.4.0-rc.0 → 0.4.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/celebrations/components/Celebrations.js +51 -0
- package/dist/commonjs/features/celebrations/components/Celebrations.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/Particle.js +84 -0
- package/dist/commonjs/features/celebrations/components/Particle.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/ParticleBatch.js +45 -0
- package/dist/commonjs/features/celebrations/components/ParticleBatch.js.map +1 -0
- package/dist/commonjs/features/celebrations/components/Spark.js +23 -0
- package/dist/commonjs/features/celebrations/components/Spark.js.map +1 -0
- package/dist/commonjs/features/celebrations/config.js +199 -0
- package/dist/commonjs/features/celebrations/config.js.map +1 -0
- package/dist/commonjs/features/celebrations/helpers.js +94 -0
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -0
- package/dist/commonjs/features/celebrations/index.js +28 -0
- package/dist/commonjs/features/celebrations/index.js.map +1 -0
- package/dist/commonjs/features/celebrations/types.js +15 -0
- package/dist/commonjs/features/celebrations/types.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +4 -6
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -12
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +1 -5
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/index.js +7 -0
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/{ChatBotThreadManager.js → ChatBotMessageHandler.js} +17 -28
- package/dist/commonjs/features/chatbot/model/ChatBotMessageHandler.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +117 -136
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +1 -0
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ThreadItem.js +8 -21
- package/dist/commonjs/features/chatbot/model/ThreadItem.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/{ChatbotApi.js → api.js} +1 -16
- package/dist/commonjs/features/chatbot/model/api.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/messagesHelper.js +5 -1
- package/dist/commonjs/features/chatbot/model/messagesHelper.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/t2s.js +6 -0
- 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 +45 -54
- package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/api.types.js +0 -4
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js +58 -0
- package/dist/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +247 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +131 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +56 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +68 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js +53 -0
- package/dist/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js +47 -0
- package/dist/commonjs/features/endOfAssignment/components/EOAModal.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js +69 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js +55 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +102 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +83 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +96 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js +44 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +233 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +63 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/model.js +34 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/model.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js +91 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +107 -0
- package/dist/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/constants.js +55 -0
- package/dist/commonjs/features/endOfAssignment/constants.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/helpers.js +64 -0
- package/dist/commonjs/features/endOfAssignment/helpers.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js +51 -0
- package/dist/commonjs/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/index.js +40 -0
- package/dist/commonjs/features/endOfAssignment/index.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js +53 -0
- package/dist/commonjs/features/endOfAssignment/model/model.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/types.js +33 -0
- package/dist/commonjs/features/endOfAssignment/types.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js +43 -0
- package/dist/commonjs/features/endOfAssignment/ui/EOABadge.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js +30 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +65 -0
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js +29 -0
- package/dist/commonjs/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js +32 -0
- package/dist/commonjs/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
- package/dist/commonjs/index.js +24 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/effector/createEntityFieldStore.js +0 -4
- package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -1
- package/dist/commonjs/shared/icons/Halloween.js +54 -0
- package/dist/commonjs/shared/icons/Halloween.js.map +1 -0
- package/dist/commonjs/shared/icons/Pi.js +30 -0
- package/dist/commonjs/shared/icons/Pi.js.map +1 -0
- package/dist/commonjs/shared/icons/Star.js +30 -0
- package/dist/commonjs/shared/icons/Star.js.map +1 -0
- package/dist/commonjs/shared/icons/{StopIcon.js → Valentine.js} +9 -12
- package/dist/commonjs/shared/icons/Valentine.js.map +1 -0
- package/dist/commonjs/shared/icons/Winter.js +32 -0
- package/dist/commonjs/shared/icons/Winter.js.map +1 -0
- package/dist/commonjs/shared/icons/icon.types.js +0 -4
- package/dist/module/features/celebrations/components/Celebrations.js +45 -0
- package/dist/module/features/celebrations/components/Celebrations.js.map +1 -0
- package/dist/module/features/celebrations/components/Particle.js +76 -0
- package/dist/module/features/celebrations/components/Particle.js.map +1 -0
- package/dist/module/features/celebrations/components/ParticleBatch.js +38 -0
- package/dist/module/features/celebrations/components/ParticleBatch.js.map +1 -0
- package/dist/module/features/celebrations/components/Spark.js +17 -0
- package/dist/module/features/celebrations/components/Spark.js.map +1 -0
- package/dist/module/features/celebrations/config.js +194 -0
- package/dist/module/features/celebrations/config.js.map +1 -0
- package/dist/module/features/celebrations/helpers.js +87 -0
- package/dist/module/features/celebrations/helpers.js.map +1 -0
- package/dist/module/features/celebrations/index.js +5 -0
- package/dist/module/features/celebrations/index.js.map +1 -0
- package/dist/module/features/celebrations/types.js +11 -0
- package/dist/module/features/celebrations/types.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +4 -6
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +1 -12
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +2 -6
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/index.js +1 -0
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/{ChatBotThreadManager.js → ChatBotMessageHandler.js} +15 -26
- package/dist/module/features/chatbot/model/ChatBotMessageHandler.js.map +1 -0
- package/dist/module/features/chatbot/model/ChatBotModel.js +119 -138
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +1 -0
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/chatbot/model/ThreadItem.js +8 -21
- package/dist/module/features/chatbot/model/ThreadItem.js.map +1 -1
- package/dist/module/features/chatbot/model/{ChatbotApi.js → api.js} +1 -16
- package/dist/module/features/chatbot/model/api.js.map +1 -0
- package/dist/module/features/chatbot/model/messagesHelper.js +5 -1
- package/dist/module/features/chatbot/model/messagesHelper.js.map +1 -1
- package/dist/module/features/chatbot/model/t2s.js +7 -1
- 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 +45 -54
- package/dist/module/features/chatbot/model/translation.js.map +1 -1
- package/dist/module/features/chatbot/types/api.types.js +0 -2
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js +52 -0
- package/dist/module/features/endOfAssignment/components/CheatDetected/CheatDetected.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js +241 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js +124 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js +50 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js +62 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js +47 -0
- package/dist/module/features/endOfAssignment/components/CorrectAnswer/Spark.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/EOAModal.js +41 -0
- package/dist/module/features/endOfAssignment/components/EOAModal.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js +63 -0
- package/dist/module/features/endOfAssignment/components/ExamLeave/ExamLeave.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js +49 -0
- package/dist/module/features/endOfAssignment/components/ExamPaused/ExamPaused.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js +96 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js +77 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js +89 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js +38 -0
- package/dist/module/features/endOfAssignment/components/Modal/ModalBackground.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js +226 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js +56 -0
- package/dist/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/model.js +29 -0
- package/dist/module/features/endOfAssignment/components/Modal/model.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js +85 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswer.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js +100 -0
- package/dist/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.js.map +1 -0
- package/dist/module/features/endOfAssignment/constants.js +51 -0
- package/dist/module/features/endOfAssignment/constants.js.map +1 -0
- package/dist/module/features/endOfAssignment/helpers.js +58 -0
- package/dist/module/features/endOfAssignment/helpers.js.map +1 -0
- package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js +46 -0
- package/dist/module/features/endOfAssignment/hooks/useSparkAnimation.js.map +1 -0
- package/dist/module/features/endOfAssignment/index.js +6 -0
- package/dist/module/features/endOfAssignment/index.js.map +1 -0
- package/dist/module/features/endOfAssignment/model/model.js +48 -0
- package/dist/module/features/endOfAssignment/model/model.js.map +1 -0
- package/dist/module/features/endOfAssignment/types.js +29 -0
- package/dist/module/features/endOfAssignment/types.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/EOABadge.js +37 -0
- package/dist/module/features/endOfAssignment/ui/EOABadge.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButton.js +24 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButton.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +58 -0
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js +21 -0
- package/dist/module/features/endOfAssignment/ui/SparkIcon.js.map +1 -0
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js +24 -0
- package/dist/module/features/endOfAssignment/ui/ThumbUpIcon.js.map +1 -0
- package/dist/module/index.js +2 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/effector/createEntityFieldStore.js +0 -4
- package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -1
- package/dist/module/shared/icons/Halloween.js +47 -0
- package/dist/module/shared/icons/Halloween.js.map +1 -0
- package/dist/module/shared/icons/Pi.js +23 -0
- package/dist/module/shared/icons/Pi.js.map +1 -0
- package/dist/module/shared/icons/Star.js +23 -0
- package/dist/module/shared/icons/Star.js.map +1 -0
- package/dist/module/shared/icons/Valentine.js +23 -0
- package/dist/module/shared/icons/Valentine.js.map +1 -0
- package/dist/module/shared/icons/Winter.js +25 -0
- package/dist/module/shared/icons/Winter.js.map +1 -0
- package/dist/module/shared/icons/icon.types.js +0 -2
- package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts +10 -0
- package/dist/typescript/commonjs/features/celebrations/components/Celebrations.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts +19 -0
- package/dist/typescript/commonjs/features/celebrations/components/Particle.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts +26 -0
- package/dist/typescript/commonjs/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts +4 -0
- package/dist/typescript/commonjs/features/celebrations/components/Spark.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/config.d.ts +167 -0
- package/dist/typescript/commonjs/features/celebrations/config.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts +6 -0
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/celebrations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/celebrations/types.d.ts +11 -0
- package/dist/typescript/commonjs/features/celebrations/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +0 -1
- 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/index.d.ts +3 -4
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/{ChatBotThreadManager.d.ts → ChatBotMessageHandler.d.ts} +8 -11
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +14 -19
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -3
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts +6 -12
- package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/{ChatbotApi.d.ts → api.d.ts} +3 -4
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts +4 -3
- package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +4 -2
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +8 -7
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts +1 -2
- 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 +11 -2
- 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 +19 -26
- 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 +1 -2
- package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts +41 -0
- package/dist/typescript/commonjs/features/endOfAssignment/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts +9 -0
- package/dist/typescript/commonjs/features/endOfAssignment/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
- package/dist/typescript/commonjs/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/model/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts +60 -0
- package/dist/typescript/commonjs/features/endOfAssignment/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
- package/dist/typescript/commonjs/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +2 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +0 -2
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Halloween.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Pi.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Star.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Star.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Valentine.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts +5 -0
- package/dist/typescript/commonjs/shared/icons/Winter.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +0 -2
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts +10 -0
- package/dist/typescript/module/features/celebrations/components/Celebrations.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Particle.d.ts +19 -0
- package/dist/typescript/module/features/celebrations/components/Particle.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts +26 -0
- package/dist/typescript/module/features/celebrations/components/ParticleBatch.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts +4 -0
- package/dist/typescript/module/features/celebrations/components/Spark.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/config.d.ts +167 -0
- package/dist/typescript/module/features/celebrations/config.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/helpers.d.ts +6 -0
- package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/index.d.ts +3 -0
- package/dist/typescript/module/features/celebrations/index.d.ts.map +1 -0
- package/dist/typescript/module/features/celebrations/types.d.ts +11 -0
- package/dist/typescript/module/features/celebrations/types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +0 -1
- 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/index.d.ts +3 -4
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/{ChatBotThreadManager.d.ts → ChatBotMessageHandler.d.ts} +8 -11
- package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +14 -19
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -3
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts +6 -12
- package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/{ChatbotApi.d.ts → api.d.ts} +3 -4
- package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts +4 -3
- package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts +4 -2
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts +8 -7
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts +1 -2
- 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 +11 -2
- 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 +19 -26
- 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 +1 -2
- package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/CheatDetected/CheatDetected.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts +15 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts +12 -0
- package/dist/typescript/module/features/endOfAssignment/components/CorrectAnswer/Spark.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts +11 -0
- package/dist/typescript/module/features/endOfAssignment/components/EOAModal.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamLeave/ExamLeave.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamPaused/ExamPaused.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmit.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts +20 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts +3 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/ModalBackground.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/SunrisingIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/assets/TrophyIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/model.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswer.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts +8 -0
- package/dist/typescript/module/features/endOfAssignment/components/NoAnswer/NoAnswerContent.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts +41 -0
- package/dist/typescript/module/features/endOfAssignment/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts +9 -0
- package/dist/typescript/module/features/endOfAssignment/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts +27 -0
- package/dist/typescript/module/features/endOfAssignment/hooks/useSparkAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/index.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/index.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/model/model.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/types.d.ts +60 -0
- package/dist/typescript/module/features/endOfAssignment/types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts +11 -0
- package/dist/typescript/module/features/endOfAssignment/ui/EOABadge.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts +10 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButton.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts +14 -0
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/ui/SparkIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts +4 -0
- package/dist/typescript/module/features/endOfAssignment/ui/ThumbUpIcon.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +2 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +0 -2
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/Halloween.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Halloween.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Pi.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Pi.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Star.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Star.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Valentine.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Valentine.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/Winter.d.ts +5 -0
- package/dist/typescript/module/shared/icons/Winter.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/icon.types.d.ts +0 -2
- package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/features/celebrations/components/Celebrations.tsx +62 -0
- package/src/features/celebrations/components/Particle.tsx +99 -0
- package/src/features/celebrations/components/ParticleBatch.tsx +56 -0
- package/src/features/celebrations/components/Spark.tsx +14 -0
- package/src/features/celebrations/config.ts +199 -0
- package/src/features/celebrations/helpers.ts +96 -0
- package/src/features/celebrations/index.ts +2 -0
- package/src/features/celebrations/types.ts +11 -0
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +0 -1
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +0 -3
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +0 -14
- package/src/features/chatbot/components/Chatbot.tsx +2 -3
- package/src/features/chatbot/index.ts +3 -3
- package/src/features/chatbot/model/{ChatBotThreadManager.ts → ChatBotMessageHandler.ts} +16 -28
- package/src/features/chatbot/model/ChatBotModel.ts +124 -123
- package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
- package/src/features/chatbot/model/ThreadItem.ts +9 -20
- package/src/features/chatbot/model/{ChatbotApi.ts → api.ts} +2 -19
- package/src/features/chatbot/model/messagesHelper.ts +6 -2
- package/src/features/chatbot/model/t2s.ts +10 -3
- package/src/features/chatbot/model/translation.helpers.ts +1 -2
- package/src/features/chatbot/model/translation.ts +46 -52
- package/src/features/chatbot/types/api.types.ts +12 -2
- package/src/features/chatbot/types/model.types.ts +26 -38
- package/src/features/chatbot/types/translation.types.ts +1 -2
- package/src/features/endOfAssignment/components/CheatDetected/CheatDetected.tsx +48 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/AnimatedCard.tsx +293 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswer.tsx +128 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/CorrectAnswerSparks.tsx +39 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/GoodDrawingSparks.tsx +40 -0
- package/src/features/endOfAssignment/components/CorrectAnswer/Spark.tsx +45 -0
- package/src/features/endOfAssignment/components/EOAModal.tsx +64 -0
- package/src/features/endOfAssignment/components/ExamLeave/ExamLeave.tsx +56 -0
- package/src/features/endOfAssignment/components/ExamPaused/ExamPaused.tsx +46 -0
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmit.tsx +102 -0
- package/src/features/endOfAssignment/components/ExamSubmit/ExamSubmitContent.tsx +69 -0
- package/src/features/endOfAssignment/components/ExamSubmit/blurred-card.png +0 -0
- package/src/features/endOfAssignment/components/Modal/Modal.tsx +105 -0
- package/src/features/endOfAssignment/components/Modal/ModalBackground.tsx +33 -0
- package/src/features/endOfAssignment/components/Modal/assets/SunrisingIcon.tsx +196 -0
- package/src/features/endOfAssignment/components/Modal/assets/TrophyIcon.tsx +62 -0
- package/src/features/endOfAssignment/components/Modal/model.ts +34 -0
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswer.tsx +85 -0
- package/src/features/endOfAssignment/components/NoAnswer/NoAnswerContent.tsx +107 -0
- package/src/features/endOfAssignment/constants.ts +53 -0
- package/src/features/endOfAssignment/helpers.ts +28 -0
- package/src/features/endOfAssignment/hooks/useSparkAnimation.tsx +78 -0
- package/src/features/endOfAssignment/index.ts +3 -0
- package/src/features/endOfAssignment/model/model.ts +57 -0
- package/src/features/endOfAssignment/types.ts +65 -0
- package/src/features/endOfAssignment/ui/EOABadge.tsx +47 -0
- package/src/features/endOfAssignment/ui/PracticeButton.tsx +27 -0
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +75 -0
- package/src/features/endOfAssignment/ui/SparkIcon.tsx +15 -0
- package/src/features/endOfAssignment/ui/ThumbUpIcon.tsx +17 -0
- package/src/index.ts +2 -0
- package/src/lib/effector/createEntityFieldStore.ts +1 -9
- package/src/shared/icons/Halloween.tsx +33 -0
- package/src/shared/icons/Pi.tsx +16 -0
- package/src/shared/icons/Star.tsx +16 -0
- package/src/shared/icons/Valentine.tsx +16 -0
- package/src/shared/icons/Winter.tsx +19 -0
- package/src/shared/icons/icon.types.ts +6 -9
- package/dist/commonjs/features/chatbot/context/ChatBotContext.js +0 -17
- package/dist/commonjs/features/chatbot/context/ChatBotContext.js.map +0 -1
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +0 -58
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +0 -1
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +0 -99
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -110
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +0 -1
- package/dist/commonjs/features/chatbot/types/units.types.js +0 -2
- package/dist/commonjs/features/chatbot/types/units.types.js.map +0 -1
- package/dist/commonjs/lib/helpers/randomElements.js +0 -24
- package/dist/commonjs/lib/helpers/randomElements.js.map +0 -1
- package/dist/commonjs/shared/icons/HighlighterIcon.js +0 -36
- package/dist/commonjs/shared/icons/HighlighterIcon.js.map +0 -1
- package/dist/commonjs/shared/icons/StopIcon.js.map +0 -1
- package/dist/module/features/chatbot/context/ChatBotContext.js +0 -12
- package/dist/module/features/chatbot/context/ChatBotContext.js.map +0 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +0 -52
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +0 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +0 -94
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatbotApi.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -104
- package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +0 -1
- package/dist/module/features/chatbot/types/units.types.js +0 -2
- package/dist/module/features/chatbot/types/units.types.js.map +0 -1
- package/dist/module/lib/helpers/randomElements.js +0 -20
- package/dist/module/lib/helpers/randomElements.js.map +0 -1
- package/dist/module/shared/icons/HighlighterIcon.js +0 -29
- package/dist/module/shared/icons/HighlighterIcon.js.map +0 -1
- package/dist/module/shared/icons/StopIcon.js +0 -26
- package/dist/module/shared/icons/StopIcon.js.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts +0 -8
- package/dist/typescript/commonjs/features/chatbot/context/ChatBotContext.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +0 -3
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +0 -28
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -26
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -31
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +0 -1
- package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts +0 -2
- package/dist/typescript/commonjs/lib/helpers/randomElements.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts +0 -8
- package/dist/typescript/module/features/chatbot/context/ChatBotContext.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +0 -3
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +0 -28
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -26
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -31
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +0 -1
- package/dist/typescript/module/lib/helpers/randomElements.d.ts +0 -2
- package/dist/typescript/module/lib/helpers/randomElements.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/StopIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/StopIcon.d.ts.map +0 -1
- package/src/features/chatbot/context/ChatBotContext.ts +0 -18
- package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +0 -53
- package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +0 -116
- package/src/features/chatbot/model/ChatsCacheModel.ts +0 -94
- package/src/features/chatbot/types/units.types.ts +0 -34
- package/src/lib/helpers/randomElements.ts +0 -22
- package/src/shared/icons/HighlighterIcon.tsx +0 -21
- package/src/shared/icons/StopIcon.tsx +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ChatbotIcon","_MessageTextToSpeech","_modelTypes","
|
|
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/chatb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@ -20,15 +20,6 @@ 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
|
-
}
|
|
32
23
|
const ChatbotMessages = ({
|
|
33
24
|
model,
|
|
34
25
|
isHintFeedback,
|
|
@@ -64,7 +55,6 @@ const ChatbotMessages = ({
|
|
|
64
55
|
translatedMessage
|
|
65
56
|
});
|
|
66
57
|
};
|
|
67
|
-
const lastReceivedMessage = findListReceivedMessage(messages);
|
|
68
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
69
59
|
style: [styles.container, {
|
|
70
60
|
maxHeight: MAX_HEIGHT
|
|
@@ -93,8 +83,7 @@ const ChatbotMessages = ({
|
|
|
93
83
|
isActive: id === currentPlayingId,
|
|
94
84
|
isTextToSpeechPending: isTextToSpeechPending,
|
|
95
85
|
variant: isOwnMessage ? _modelTypes.MessageVariant.SENT : _modelTypes.MessageVariant.RECEIVED,
|
|
96
|
-
withTextToSpeech: isTextToSpeechEnabled && !isOwnMessage
|
|
97
|
-
withErrorSpotting: !isHelpRequestPending && lastReceivedMessage?.id === id
|
|
86
|
+
withTextToSpeech: isTextToSpeechEnabled && !isOwnMessage
|
|
98
87
|
}, id)), isHelpRequestPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageLoader.MessageLoader, {})]
|
|
99
88
|
}), !isHelpRequestPending && isOpen && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Alternatives.Alternatives, {
|
|
100
89
|
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","
|
|
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","messages","useStoreMap","$currentChatData","playTextToSpeech","id","message","translatedMessage","text","play","messageId","config","TEXT_TO_SPEECH_CONFIG","askChatForHelp","jsx","View","style","styles","container","maxHeight","children","jsxs","ScrollView","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","isOwnMessage","ChatMessage","onPressTextToSpeech","isActive","variant","MessageVariant","SENT","RECEIVED","withTextToSpeech","MessageLoader","Alternatives","onPressAlternative","hasMessages","length","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,G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-8,7 +8,6 @@ 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");
|
|
12
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
13
|
const Chatbot = ({
|
|
@@ -34,10 +33,7 @@ const Chatbot = ({
|
|
|
34
33
|
if (!isAvailable || alternatives?.chatAccess === false) {
|
|
35
34
|
return null;
|
|
36
35
|
}
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(
|
|
38
|
-
value: {
|
|
39
|
-
model
|
|
40
|
-
},
|
|
36
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
41
37
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotMessages.ChatbotMessages, {
|
|
42
38
|
model: model,
|
|
43
39
|
renderer: renderer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_effectorReact","require","_ChatbotMessages","_ChatControls","_react","_interopRequireDefault","
|
|
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","Fragment","children","jsx","ChatbotMessages","ChatControls","onPressTranslate","onPressChatIcon","onPressClose","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/components/Chatbot.tsx"],"mappings":";;;;;;AACA,IAAA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AAe;MAC/BC,mBAAmB,EAAEA,mBAAoB;MACzCC,qBAAqB,EAAEA,qBAAsB;MAC7CC,kBAAkB,EAAEA;IAAmB,CACxC,CAAC,eAEF,IAAAT,WAAA,CAAA8B,GAAA,EAACjC,aAAA,CAAAmC,YAAY;MACX3B,KAAK,EAAEA,KAAM;MACb4B,gBAAgB,EAAEb,iBAAkB;MACpCc,eAAe,EAAEX,QAAS;MAC1BY,YAAY,EAAEV,SAAU;MACxBf,oBAAoB,EAAEA,oBAAqB;MAC3CE,aAAa,EAAEA,aAAc;MAC7BC,QAAQ,EAAEA;IAAS,CACpB,CAAC;EAAA,CACF,CAAC;AAEP,CAAC;AAAAuB,OAAA,CAAAhC,OAAA,GAAAA,OAAA","ignoreList":[]}
|
|
@@ -9,6 +9,12 @@ 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
|
+
});
|
|
12
18
|
Object.defineProperty(exports, "Chatbot", {
|
|
13
19
|
enumerable: true,
|
|
14
20
|
get: function () {
|
|
@@ -37,5 +43,6 @@ var _Chatbot = require("./components/Chatbot.js");
|
|
|
37
43
|
var _ChatBotModel = require("./model/ChatBotModel.js");
|
|
38
44
|
var _t2sTypes = require("./types/t2s.types.js");
|
|
39
45
|
var _modelTypes = require("./types/model.types.js");
|
|
46
|
+
var _ChatBotMessageHandler = require("./model/ChatBotMessageHandler.js");
|
|
40
47
|
var _DefaultMessageCreator = require("./model/DefaultMessageCreator.js");
|
|
41
48
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Chatbot","require","_ChatBotModel","_t2sTypes","_modelTypes","_DefaultMessageCreator"],"sourceRoot":"../../../../src","sources":["features/chatbot/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_Chatbot","require","_ChatBotModel","_t2sTypes","_modelTypes","_ChatBotMessageHandler","_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;AAQA,IAAAI,sBAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAL,OAAA","ignoreList":[]}
|
package/dist/commonjs/features/chatbot/model/{ChatBotThreadManager.js → ChatBotMessageHandler.js}
RENAMED
|
@@ -3,14 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.ChatMessageHandler = void 0;
|
|
7
7
|
var _ThreadItem = require("./ThreadItem.js");
|
|
8
|
-
var _effector = require("effector");
|
|
8
|
+
var _effector = require("effector/effector.umd");
|
|
9
9
|
var _constants = require("./constants.js");
|
|
10
|
-
class
|
|
11
|
-
drawBoardAdapter = null;
|
|
10
|
+
class ChatMessageHandler {
|
|
12
11
|
threads = new Map();
|
|
13
|
-
$threads = (0, _effector.createStore)(new Map());
|
|
14
12
|
currentKey = '';
|
|
15
13
|
currentBinding = null;
|
|
16
14
|
constructor({
|
|
@@ -20,7 +18,7 @@ class ChatBotThreadManager {
|
|
|
20
18
|
messages
|
|
21
19
|
}) {
|
|
22
20
|
this.api = api;
|
|
23
|
-
this.drawBoardAdapter = drawBoardAdapter
|
|
21
|
+
this.drawBoardAdapter = drawBoardAdapter;
|
|
24
22
|
this.messagesLimit = messagesLimit;
|
|
25
23
|
this.defaultMessages = messages;
|
|
26
24
|
}
|
|
@@ -35,27 +33,18 @@ class ChatBotThreadManager {
|
|
|
35
33
|
const key = this.currentKey;
|
|
36
34
|
let threadItem = this.threads.get(key);
|
|
37
35
|
if (threadItem) return threadItem;
|
|
38
|
-
if (!this.drawBoardAdapter) {
|
|
39
|
-
threadItem = new _ThreadItem.ThreadItem();
|
|
40
|
-
this.threads.set(key, threadItem);
|
|
41
|
-
return threadItem;
|
|
42
|
-
}
|
|
43
36
|
try {
|
|
44
|
-
const
|
|
45
|
-
threadItem = new _ThreadItem.ThreadItem(
|
|
46
|
-
strokes
|
|
47
|
-
|
|
48
|
-
} : null);
|
|
37
|
+
const strokes = await this.drawBoardAdapter.getVisibleStrokes();
|
|
38
|
+
threadItem = new _ThreadItem.ThreadItem({
|
|
39
|
+
strokes
|
|
40
|
+
});
|
|
49
41
|
} catch {
|
|
50
42
|
threadItem = new _ThreadItem.ThreadItem();
|
|
51
43
|
}
|
|
52
44
|
this.threads.set(key, threadItem);
|
|
53
45
|
return threadItem;
|
|
54
46
|
}
|
|
55
|
-
|
|
56
|
-
this.drawBoardAdapter = adapter;
|
|
57
|
-
}
|
|
58
|
-
postMessage = async ({
|
|
47
|
+
postMessageFx = async ({
|
|
59
48
|
problemAnswer,
|
|
60
49
|
problem,
|
|
61
50
|
answer,
|
|
@@ -71,23 +60,23 @@ class ChatBotThreadManager {
|
|
|
71
60
|
language,
|
|
72
61
|
imageAltText
|
|
73
62
|
});
|
|
74
|
-
threadItem.
|
|
75
|
-
const nextOptions = threadItem.
|
|
63
|
+
threadItem.hints.push(result.message);
|
|
64
|
+
const nextOptions = threadItem.hints.length < this.messagesLimit ? [this.defaultMessages.anotherHintOption] : [];
|
|
76
65
|
return {
|
|
77
66
|
message: result.message,
|
|
78
67
|
options: nextOptions,
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
threadId: '',
|
|
69
|
+
endMessage: !nextOptions.length
|
|
81
70
|
};
|
|
82
71
|
};
|
|
83
|
-
resetThread = ({
|
|
72
|
+
resetThread = (0, _effector.createEffect)(({
|
|
84
73
|
key
|
|
85
74
|
}) => {
|
|
86
75
|
this.threads.delete(key);
|
|
87
|
-
};
|
|
76
|
+
});
|
|
88
77
|
resetAll() {
|
|
89
78
|
this.threads.clear();
|
|
90
79
|
}
|
|
91
80
|
}
|
|
92
|
-
exports.
|
|
93
|
-
//# sourceMappingURL=
|
|
81
|
+
exports.ChatMessageHandler = ChatMessageHandler;
|
|
82
|
+
//# sourceMappingURL=ChatBotMessageHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_ThreadItem","require","_effector","_constants","ChatMessageHandler","threads","Map","currentKey","currentBinding","constructor","drawBoardAdapter","api","messagesLimit","CHAT_BOT_MODEL_DEFAULTS","THREAD_MESSAGES_LIMIT","messages","defaultMessages","bindKeyStore","$store","watch","value","getThreadItem","key","threadItem","get","strokes","getVisibleStrokes","ThreadItem","set","postMessageFx","problemAnswer","problem","answer","language","imageAltText","result","getHint","getNextHintProps","correctAnswer","problemDescription","userAnswer","hints","push","message","nextOptions","length","anotherHintOption","options","threadId","endMessage","resetThread","createEffect","delete","resetAll","clear","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/ChatBotMessageHandler.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AAeO,MAAMG,kBAAkB,CAAC;EAGbC,OAAO,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAGhDC,UAAU,GAAG,EAAE;EACfC,cAAc,GAAwB,IAAI;EAI3CC,WAAWA,CAAC;IACjBC,gBAAgB;IAChBC,GAAG;IACHC,aAAa,GAAGC,kCAAuB,CAACC,qBAAqB;IAC7DC;EACuB,CAAC,EAAE;IAC1B,IAAI,CAACJ,GAAG,GAAGA,GAAG;IACd,IAAI,CAACD,gBAAgB,GAAGA,gBAAgB;IACxC,IAAI,CAACE,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACI,eAAe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IACrC,MAAMC,WAAW,GACfrB,UAAU,CAACkB,KAAK,CAACI,MAAM,GAAG,IAAI,CAACjC,aAAa,GAAG,CAAC,IAAI,CAACI,eAAe,CAAC8B,iBAAiB,CAAC,GAAG,EAAE;IAE9F,OAAO;MACLH,OAAO,EAAER,MAAM,CAACQ,OAAO;MACvBI,OAAO,EAAEH,WAAW;MACpBI,QAAQ,EAAE,EAAE;MACZC,UAAU,EAAE,CAACL,WAAW,CAACC;IAC3B,CAAC;EACH,CAAC;EAEMK,WAAW,GAAG,IAAAC,sBAAY,EAAC,CAAC;IAAE7B;EAAqB,CAAC,KAAK;IAC9D,IAAI,CAACjB,OAAO,CAAC+C,MAAM,CAAC9B,GAAG,CAAC;EAC1B,CAAC,CAAC;EAEK+B,QAAQA,CAAA,EAAG;IAChB,IAAI,CAAChD,OAAO,CAACiD,KAAK,CAAC,CAAC;EACtB;AACF;AAACC,OAAA,CAAAnD,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -6,13 +6,10 @@ 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 _api = require("./api.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");
|
|
16
13
|
class ChatbotModel {
|
|
17
14
|
$currentKey = (0, _effector.createStore)('');
|
|
18
15
|
resetAlternatives = (0, _effector.createEvent)();
|
|
@@ -27,106 +24,84 @@ class ChatbotModel {
|
|
|
27
24
|
$context = (0, _effector.restore)(this.setContext, null);
|
|
28
25
|
setScrollActive = (0, _effector.createEvent)();
|
|
29
26
|
$isScrollActive = (0, _effector.restore)(this.setScrollActive, false);
|
|
30
|
-
|
|
27
|
+
messages = (0, _index.createEntityFieldStore)();
|
|
28
|
+
threadIds = (0, _index.createEntityFieldStore)();
|
|
29
|
+
availableChats = (0, _index.createEntityFieldStore)();
|
|
31
30
|
$currentChatData = (0, _effector.combine)({
|
|
32
|
-
|
|
31
|
+
messages: this.messages.$state,
|
|
32
|
+
threadIds: this.threadIds.$state,
|
|
33
|
+
availableChats: this.availableChats.$state,
|
|
33
34
|
key: this.$currentKey
|
|
34
35
|
}, ({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
...data[key],
|
|
39
|
-
key
|
|
40
|
-
} : {
|
|
41
|
-
...(0, _ChatsCacheModel.defaultChatData)(),
|
|
36
|
+
messages,
|
|
37
|
+
threadIds,
|
|
38
|
+
availableChats,
|
|
42
39
|
key
|
|
40
|
+
}) => {
|
|
41
|
+
return {
|
|
42
|
+
messages: messages[key] ?? [],
|
|
43
|
+
threadId: threadIds[key] ?? null,
|
|
44
|
+
isAvailable: availableChats[key] ?? false,
|
|
45
|
+
key
|
|
46
|
+
};
|
|
43
47
|
});
|
|
44
48
|
constructor({
|
|
45
49
|
api,
|
|
46
50
|
messages,
|
|
47
|
-
$key
|
|
48
|
-
threadMessagesLimit
|
|
51
|
+
$key
|
|
49
52
|
}) {
|
|
50
|
-
this.
|
|
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
|
|
60
|
-
});
|
|
53
|
+
this.api = new _api.ChatbotAPI(api);
|
|
61
54
|
this.defaultMessages = messages;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
if ($key) (0, _effector.sample)({
|
|
56
|
+
source: $key,
|
|
57
|
+
target: this.$currentKey
|
|
65
58
|
});
|
|
59
|
+
this.$alternatives = (0, _effector.restore)(this.api.getAlternativesFx.doneData, null).on(this.setAlternatives, (_, payload) => payload).reset(this.resetAlternatives);
|
|
66
60
|
this.translation = new _translation.ChatbotTranslation({
|
|
67
61
|
$context: this.$context,
|
|
68
62
|
defaultMessages: messages,
|
|
69
63
|
$key: this.$currentKey,
|
|
70
64
|
api: this.api,
|
|
65
|
+
messagesModel: this.messages,
|
|
71
66
|
alternativesModel: {
|
|
72
67
|
$store: this.$alternatives,
|
|
73
68
|
set: this.setAlternatives
|
|
74
|
-
}
|
|
75
|
-
chats: this.cache
|
|
76
|
-
});
|
|
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
|
|
69
|
+
}
|
|
86
70
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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
|
|
71
|
+
this.t2s = new _t2s.ChatTextToSpeechModel({
|
|
72
|
+
$isOpen: this.$isOpen,
|
|
73
|
+
api: this.api
|
|
107
74
|
});
|
|
75
|
+
this.sendHelpRequestFx = this.createSendHelpRequestFx();
|
|
76
|
+
this.initChatReplyWatcher();
|
|
108
77
|
}
|
|
109
78
|
createSendHelpRequestFx() {
|
|
110
79
|
const effect = (0, _effector.attach)({
|
|
111
|
-
source: [this.$currentKey, this.$context],
|
|
112
|
-
mapParams: (params, [key, context]) => ({
|
|
80
|
+
source: [this.$currentKey, this.translation.$isTranslated, this.$currentChatData, this.$context],
|
|
81
|
+
mapParams: (params, [key, isTranslated, currentData, context]) => ({
|
|
113
82
|
message: params.message,
|
|
114
83
|
translatedMessage: params.translatedMessage,
|
|
115
84
|
context,
|
|
116
|
-
key
|
|
85
|
+
key,
|
|
86
|
+
isTranslated,
|
|
87
|
+
threadId: currentData.threadId
|
|
117
88
|
}),
|
|
118
89
|
effect: (0, _index.createControllerEffect)(async ({
|
|
119
90
|
message,
|
|
120
91
|
translatedMessage,
|
|
121
92
|
key,
|
|
93
|
+
isTranslated,
|
|
94
|
+
threadId,
|
|
122
95
|
context
|
|
123
96
|
}) => {
|
|
124
97
|
if (!context) throw new Error('Context is required');
|
|
125
98
|
this.setLastMessageKey(key);
|
|
126
|
-
this.
|
|
127
|
-
|
|
99
|
+
this.messages.setField({
|
|
100
|
+
key,
|
|
101
|
+
fn: currentMessages => [...(currentMessages || []), _messagesHelper.messagesHelper.createOwn({
|
|
128
102
|
message,
|
|
129
|
-
translatedMessage
|
|
103
|
+
translatedMessage,
|
|
104
|
+
threadId
|
|
130
105
|
})]
|
|
131
106
|
});
|
|
132
107
|
const response = await this.api.postMessageFx({
|
|
@@ -134,19 +109,26 @@ class ChatbotModel {
|
|
|
134
109
|
language: context.language,
|
|
135
110
|
problemAnswer: context.problemAnswer,
|
|
136
111
|
answer: context.answer,
|
|
112
|
+
threadId,
|
|
137
113
|
imageAltText: context.imageDescription
|
|
138
114
|
});
|
|
139
115
|
let messages = [_messagesHelper.messagesHelper.createAnswer(response)];
|
|
140
116
|
if (response.endMessage) {
|
|
141
117
|
messages.push(_messagesHelper.messagesHelper.createLast(this.defaultMessages.endMessage));
|
|
142
118
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
119
|
+
if (isTranslated) {
|
|
120
|
+
messages = await this.translation.translateMessagesFx({
|
|
121
|
+
targetLanguage: context.translationTargetLanguage,
|
|
122
|
+
messages
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
this.messages.setField({
|
|
126
|
+
key,
|
|
127
|
+
fn: currentMessages => [...(currentMessages || []), ...messages]
|
|
146
128
|
});
|
|
147
|
-
this.
|
|
148
|
-
|
|
149
|
-
|
|
129
|
+
this.threadIds.setField({
|
|
130
|
+
key,
|
|
131
|
+
data: response.threadId
|
|
150
132
|
});
|
|
151
133
|
})
|
|
152
134
|
});
|
|
@@ -158,35 +140,35 @@ class ChatbotModel {
|
|
|
158
140
|
messages
|
|
159
141
|
}) => ({
|
|
160
142
|
key,
|
|
161
|
-
data:
|
|
162
|
-
messages: [...messages, this.defaultMessages.error]
|
|
163
|
-
}
|
|
143
|
+
data: [...messages, this.defaultMessages.error]
|
|
164
144
|
}),
|
|
165
145
|
filter: (_, {
|
|
166
146
|
error
|
|
167
147
|
}) => error.message !== 'Request aborted manually',
|
|
168
|
-
target: this.
|
|
148
|
+
target: this.messages.setField
|
|
169
149
|
});
|
|
170
150
|
return effect;
|
|
171
151
|
}
|
|
172
|
-
|
|
152
|
+
initChatReplyWatcher() {
|
|
173
153
|
(0, _effector.sample)({
|
|
174
|
-
|
|
175
|
-
|
|
154
|
+
clock: this.removeLastMessage,
|
|
155
|
+
source: [this.$lastMessageKey, this.messages.$state],
|
|
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
|
|
176
170
|
});
|
|
177
|
-
this.threadManager.bindKeyStore($store);
|
|
178
|
-
return this;
|
|
179
171
|
}
|
|
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();
|
|
190
172
|
startConversation = (0, _effector.attach)({
|
|
191
173
|
source: this.$currentChatData,
|
|
192
174
|
mapParams: (props, source) => ({
|
|
@@ -204,10 +186,13 @@ class ChatbotModel {
|
|
|
204
186
|
key
|
|
205
187
|
});
|
|
206
188
|
}
|
|
207
|
-
this.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
189
|
+
this.messages.setField({
|
|
190
|
+
key,
|
|
191
|
+
data: [this.defaultMessages.start]
|
|
192
|
+
});
|
|
193
|
+
this.availableChats.setField({
|
|
194
|
+
key,
|
|
195
|
+
data: true
|
|
211
196
|
});
|
|
212
197
|
})
|
|
213
198
|
});
|
|
@@ -216,53 +201,49 @@ class ChatbotModel {
|
|
|
216
201
|
...message
|
|
217
202
|
}) {
|
|
218
203
|
const options = this.$alternatives.getState()?.options.hints ?? message.options;
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
204
|
+
this.messages.setField({
|
|
205
|
+
key,
|
|
206
|
+
fn: messages => {
|
|
207
|
+
if (!messages || messages.length > 1) return;
|
|
208
|
+
return [{
|
|
209
|
+
...message,
|
|
210
|
+
options
|
|
211
|
+
}];
|
|
212
|
+
}
|
|
222
213
|
});
|
|
223
214
|
}
|
|
224
|
-
reinitConversation = ({
|
|
215
|
+
reinitConversation = (0, _effector.createEffect)(({
|
|
225
216
|
key
|
|
226
217
|
}) => {
|
|
227
|
-
this.
|
|
228
|
-
|
|
218
|
+
this.messages.setField({
|
|
219
|
+
key,
|
|
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
|
+
}
|
|
229
234
|
});
|
|
230
|
-
|
|
231
|
-
|
|
235
|
+
});
|
|
236
|
+
bindKey($store) {
|
|
237
|
+
(0, _effector.sample)({
|
|
238
|
+
source: $store,
|
|
239
|
+
target: this.$currentKey
|
|
232
240
|
});
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
this
|
|
241
|
+
return this;
|
|
242
|
+
}
|
|
243
|
+
setT2SAudioProvider(audioProvider) {
|
|
244
|
+
this.t2s.setAudioProvider(audioProvider);
|
|
245
|
+
return this;
|
|
238
246
|
}
|
|
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
|
-
};
|
|
266
247
|
}
|
|
267
248
|
exports.ChatbotModel = ChatbotModel;
|
|
268
249
|
//# sourceMappingURL=ChatBotModel.js.map
|