@magmamath/students-features 0.6.0 → 0.6.1-2.rc-2
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/README.md +14 -5
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +6 -2
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +27 -24
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +9 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +18 -5
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +10 -3
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +16 -12
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +14 -8
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +14 -4
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +5 -2
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +2 -1
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +36 -1
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +8 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.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/ChatBotModel.js +67 -39
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +3 -8
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +12 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +4 -2
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/translation.js +9 -1
- package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/style.types.js +12 -0
- package/dist/commonjs/features/chatbot/types/style.types.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +2 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +31 -0
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +43 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/index.js +2 -0
- package/dist/commonjs/features/exampleSolution/components/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/constants.js +13 -0
- package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +54 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/index.js +39 -0
- package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +24 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +19 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/types.js +6 -0
- package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
- package/dist/commonjs/features/feedback/model/comments.js +5 -3
- package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
- package/dist/commonjs/features/feedback/model/model.js +7 -9
- package/dist/commonjs/features/feedback/model/model.js.map +1 -1
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js +62 -0
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/commonjs/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js +44 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js +46 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js +90 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js +96 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/constants.js +34 -0
- package/dist/commonjs/features/gifCelebrations/constants.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js +114 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/index.js +20 -0
- package/dist/commonjs/features/gifCelebrations/index.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js +136 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js +27 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsCache.js +30 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsCache.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js +6 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +12 -9
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/commonjs/features/problemSelector/constants.js +3 -6
- package/dist/commonjs/features/problemSelector/constants.js.map +1 -1
- package/dist/commonjs/index.js +36 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/effector/ControlledSample.js +40 -0
- package/dist/commonjs/lib/effector/ControlledSample.js.map +1 -0
- package/dist/commonjs/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/react-app-env.d.js +2 -0
- package/dist/commonjs/react-app-env.d.js.map +1 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/commonjs/shared/icons/index.js +204 -0
- package/dist/commonjs/shared/icons/index.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +5 -1
- package/dist/commonjs/shared/translation/constants.js.map +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +33 -0
- package/dist/commonjs/shared/translation/localization/en.json +13 -1
- package/dist/commonjs/shared/translation/localization/gb.json +13 -1
- package/dist/commonjs/shared/translation/localization/sct.json +33 -0
- package/dist/commonjs/shared/translation/localization/sw.json +13 -1
- package/dist/commonjs/shared/translation/types.js +2 -0
- package/dist/commonjs/shared/translation/types.js.map +1 -1
- package/dist/commonjs/types/common.types.js +2 -0
- package/dist/commonjs/types/common.types.js.map +1 -0
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +6 -2
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +29 -27
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +9 -4
- package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +18 -5
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +10 -3
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +16 -12
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -4
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +14 -8
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +14 -4
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +5 -2
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +3 -3
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +35 -0
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +9 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.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/ChatBotModel.js +68 -40
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js +3 -8
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +12 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +4 -2
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/chatbot/model/constants.js.map +1 -1
- package/dist/module/features/chatbot/model/translation.js +9 -1
- package/dist/module/features/chatbot/model/translation.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/chatbot/types/style.types.js +8 -0
- package/dist/module/features/chatbot/types/style.types.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js +3 -1
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/module/features/exampleSolution/assets/grid.png +0 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js +35 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/index.js +2 -0
- package/dist/module/features/exampleSolution/components/index.js.map +1 -0
- package/dist/module/features/exampleSolution/constants.js +9 -0
- package/dist/module/features/exampleSolution/constants.js.map +1 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +49 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/module/features/exampleSolution/index.js +6 -0
- package/dist/module/features/exampleSolution/index.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +19 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +14 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/module/features/exampleSolution/types.js +4 -0
- package/dist/module/features/exampleSolution/types.js.map +1 -0
- package/dist/module/features/feedback/model/comments.js +5 -3
- package/dist/module/features/feedback/model/comments.js.map +1 -1
- package/dist/module/features/feedback/model/model.js +7 -9
- package/dist/module/features/feedback/model/model.js.map +1 -1
- package/dist/module/features/gifCelebrations/GifCelebrations.js +55 -0
- package/dist/module/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/module/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/module/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js +36 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js +38 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Gif.js +82 -0
- package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Progress.js +88 -0
- package/dist/module/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/module/features/gifCelebrations/constants.js +30 -0
- package/dist/module/features/gifCelebrations/constants.js.map +1 -0
- package/dist/module/features/gifCelebrations/helpers.js +103 -0
- package/dist/module/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/module/features/gifCelebrations/index.js +5 -0
- package/dist/module/features/gifCelebrations/index.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js +131 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js +22 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsCache.js +25 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsCache.js.map +1 -0
- package/dist/module/features/gifCelebrations/types/model.types.js +4 -0
- package/dist/module/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +13 -10
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/module/features/problemSelector/constants.js +2 -5
- package/dist/module/features/problemSelector/constants.js.map +1 -1
- package/dist/module/index.js +3 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/effector/ControlledSample.js +35 -0
- package/dist/module/lib/effector/ControlledSample.js.map +1 -0
- package/dist/module/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/module/react-app-env.d.js +2 -0
- package/dist/module/react-app-env.d.js.map +1 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/module/shared/icons/index.js +21 -0
- package/dist/module/shared/icons/index.js.map +1 -0
- package/dist/module/shared/translation/constants.js +5 -1
- package/dist/module/shared/translation/constants.js.map +1 -1
- package/dist/module/shared/translation/localization/ca.json +33 -0
- package/dist/module/shared/translation/localization/en.json +13 -1
- package/dist/module/shared/translation/localization/gb.json +13 -1
- package/dist/module/shared/translation/localization/sct.json +33 -0
- package/dist/module/shared/translation/localization/sw.json +13 -1
- package/dist/module/shared/translation/types.js +2 -0
- package/dist/module/shared/translation/types.js.map +1 -1
- package/dist/module/types/common.types.js +2 -0
- package/dist/module/types/common.types.js.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +6 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts +7 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +5 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.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/ChatMessage/SentMessage.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +3 -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 +4 -3
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +33 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +4 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +7 -2
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +1 -3
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +5 -2
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/style.types.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/types/style.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +15 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +12 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +25 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsCache.d.ts +18 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts +2 -5
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +3 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/effector/ControlledSample.d.ts +17 -0
- package/dist/typescript/commonjs/lib/effector/ControlledSample.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +24 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts +3 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +5 -1
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +5 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +6 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts +7 -2
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +5 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.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/ChatMessage/SentMessage.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +3 -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 +4 -3
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +33 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +4 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +7 -2
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +1 -3
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +5 -2
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/style.types.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/types/style.types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts +1 -0
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +15 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +12 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts +25 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsCache.d.ts +18 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsCache.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
- package/dist/typescript/module/features/problemSelector/constants.d.ts +2 -5
- package/dist/typescript/module/features/problemSelector/constants.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +3 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/effector/ControlledSample.d.ts +17 -0
- package/dist/typescript/module/lib/effector/ControlledSample.d.ts.map +1 -0
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/index.d.ts +19 -0
- package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +102 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +24 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/types.d.ts +3 -1
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/validation.types.d.ts +5 -1
- package/dist/typescript/module/shared/translation/validation.types.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +5 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -0
- package/package.json +11 -7
- package/src/features/chatbot/components/Alternatives/Alternatives.tsx +6 -0
- package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +28 -29
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +6 -1
- package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +24 -4
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +39 -6
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +11 -3
- package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +28 -7
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +25 -5
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +24 -13
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +13 -3
- package/src/features/chatbot/components/Chatbot.tsx +6 -2
- package/src/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx +7 -10
- package/src/features/chatbot/constants.ts +37 -0
- package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +11 -1
- package/src/features/chatbot/index.ts +1 -0
- package/src/features/chatbot/model/ChatBotModel.ts +66 -42
- package/src/features/chatbot/model/ChatBotThreadManager.ts +4 -10
- package/src/features/chatbot/model/ChatBoxTextManager.ts +14 -1
- package/src/features/chatbot/model/DefaultMessageCreator.ts +4 -2
- package/src/features/chatbot/model/constants.ts +0 -2
- package/src/features/chatbot/model/translation.ts +11 -1
- package/src/features/chatbot/types/model.types.ts +5 -2
- package/src/features/chatbot/types/style.types.ts +4 -0
- package/src/features/endOfAssignment/components/Modal/Modal.tsx +3 -0
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
- package/src/features/exampleSolution/assets/grid.png +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +78 -0
- package/src/features/exampleSolution/components/LavaIcon.tsx +33 -0
- package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
- package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
- package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
- package/src/features/exampleSolution/components/index.ts +0 -0
- package/src/features/exampleSolution/constants.ts +5 -0
- package/src/features/exampleSolution/hooks/useExampleSolution.ts +64 -0
- package/src/features/exampleSolution/index.ts +3 -0
- package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +23 -0
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
- package/src/features/exampleSolution/types.ts +25 -0
- package/src/features/feedback/model/comments.ts +7 -7
- package/src/features/feedback/model/model.ts +6 -6
- package/src/features/gifCelebrations/GifCelebrations.tsx +75 -0
- package/src/features/gifCelebrations/assets/confetti.webp +0 -0
- package/src/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/src/features/gifCelebrations/components/Backdrop.tsx +41 -0
- package/src/features/gifCelebrations/components/ContentContainer.tsx +44 -0
- package/src/features/gifCelebrations/components/Gif.tsx +88 -0
- package/src/features/gifCelebrations/components/Progress.tsx +106 -0
- package/src/features/gifCelebrations/constants.ts +32 -0
- package/src/features/gifCelebrations/helpers.ts +144 -0
- package/src/features/gifCelebrations/index.ts +2 -0
- package/src/features/gifCelebrations/model/GifCelebrations.model.ts +167 -0
- package/src/features/gifCelebrations/model/GifCelebrationsApi.ts +26 -0
- package/src/features/gifCelebrations/model/GifCelebrationsCache.ts +41 -0
- package/src/features/gifCelebrations/types/model.types.ts +53 -0
- package/src/features/problemSelector/components/ProblemSelectorButton.tsx +17 -10
- package/src/features/problemSelector/constants.ts +3 -2
- package/src/index.ts +3 -0
- package/src/lib/effector/ControlledSample.ts +40 -0
- package/src/lib/effector/createControllerEffect.ts +41 -41
- package/src/lib/helpers/helpers.ts +1 -1
- package/src/react-app-env.d.ts +6 -0
- package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
- package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
- package/src/shared/icons/index.ts +18 -0
- package/src/shared/translation/constants.ts +4 -0
- package/src/shared/translation/localization/ca.json +33 -0
- package/src/shared/translation/localization/en.json +13 -1
- package/src/shared/translation/localization/gb.json +13 -1
- package/src/shared/translation/localization/sct.json +33 -0
- package/src/shared/translation/localization/sw.json +13 -1
- package/src/shared/translation/types.ts +6 -0
- package/src/shared/translation/validation.types.ts +9 -1
- package/src/types/common.types.ts +4 -0
- package/dist/commonjs/shared/icons/LockIcon.js +0 -31
- package/dist/commonjs/shared/icons/LockIcon.js.map +0 -1
- package/dist/module/shared/icons/LockIcon.js +0 -23
- package/dist/module/shared/icons/LockIcon.js.map +0 -1
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/LockIcon.d.ts.map +0 -1
- package/src/shared/icons/LockIcon.tsx +0 -16
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { ComponentType, PropsWithChildren } from 'react'
|
|
1
|
+
import React, { ComponentType, PropsWithChildren } from 'react'
|
|
2
2
|
import { useStoreMap, useUnit } from 'effector-react'
|
|
3
|
+
|
|
3
4
|
import { ChatbotModel } from '../model/ChatBotModel'
|
|
4
5
|
import { ChatbotMessages } from './ChatMessages/ChatbotMessages'
|
|
5
6
|
import { ChatControls } from './ChatControls/ChatControls'
|
|
6
7
|
import { AUDIO_CONFIG, DEFAULT_VOICE } from '../constants'
|
|
7
|
-
import React from 'react'
|
|
8
8
|
import { ChatBotModelContext } from '../context/ChatBotModelContext'
|
|
9
|
+
import { ColorScheme } from '../types/style.types'
|
|
9
10
|
|
|
10
11
|
type ChatbotProps = {
|
|
11
12
|
model: ChatbotModel
|
|
@@ -17,6 +18,7 @@ type ChatbotProps = {
|
|
|
17
18
|
}
|
|
18
19
|
ButtonWrapper: ComponentType<PropsWithChildren>
|
|
19
20
|
iconSize?: { width: number; height: number } // TODO: use number instead
|
|
21
|
+
colorScheme?: ColorScheme
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export const Chatbot = ({
|
|
@@ -26,6 +28,7 @@ export const Chatbot = ({
|
|
|
26
28
|
textToSpeechConfig,
|
|
27
29
|
ButtonWrapper,
|
|
28
30
|
iconSize,
|
|
31
|
+
colorScheme = ColorScheme.Blue,
|
|
29
32
|
}: ChatbotProps) => {
|
|
30
33
|
const alternatives = useUnit(model.$alternatives)
|
|
31
34
|
const isAvailable = useStoreMap(model.$currentChatData, ({ isAvailable }) => isAvailable)
|
|
@@ -42,6 +45,7 @@ export const Chatbot = ({
|
|
|
42
45
|
<ChatBotModelContext.Provider value={model}>
|
|
43
46
|
<ChatbotMessages
|
|
44
47
|
model={model}
|
|
48
|
+
colorScheme={colorScheme}
|
|
45
49
|
isHintFeedback={isHintFeedback}
|
|
46
50
|
isTextToSpeechEnabled={isTextToSpeechEnabled}
|
|
47
51
|
/>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useEffect, useMemo } from 'react'
|
|
1
|
+
import React, { useEffect, useMemo } from 'react'
|
|
3
2
|
import { View, Animated, StyleSheet, Platform } from 'react-native'
|
|
4
3
|
|
|
4
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
5
|
+
|
|
5
6
|
type ChatLoaderProps = {
|
|
6
7
|
dotsCount?: number
|
|
7
8
|
animationDuration?: number
|
|
@@ -11,12 +12,12 @@ type ChatLoaderProps = {
|
|
|
11
12
|
export const ThreeDotsLoader = ({
|
|
12
13
|
dotsCount = 3,
|
|
13
14
|
animationDuration = 250,
|
|
14
|
-
backgroundColor =
|
|
15
|
+
backgroundColor = COLORS.PRIMARY_BLUE,
|
|
15
16
|
}: ChatLoaderProps) => {
|
|
16
17
|
const isWeb = Platform.OS === 'web'
|
|
17
18
|
const animations = useMemo(
|
|
18
19
|
() => [...Array(dotsCount)].map(() => new Animated.Value(0)),
|
|
19
|
-
[dotsCount]
|
|
20
|
+
[dotsCount],
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
useEffect(() => {
|
|
@@ -33,7 +34,7 @@ export const ThreeDotsLoader = ({
|
|
|
33
34
|
duration: animationDuration,
|
|
34
35
|
useNativeDriver: !isWeb,
|
|
35
36
|
}),
|
|
36
|
-
])
|
|
37
|
+
]),
|
|
37
38
|
)
|
|
38
39
|
|
|
39
40
|
Animated.loop(Animated.parallel(animationsArray)).start()
|
|
@@ -50,11 +51,7 @@ export const ThreeDotsLoader = ({
|
|
|
50
51
|
return (
|
|
51
52
|
<Animated.View
|
|
52
53
|
key={index}
|
|
53
|
-
style={[
|
|
54
|
-
styles.dot,
|
|
55
|
-
{ transform: [{ translateY }] },
|
|
56
|
-
{ backgroundColor },
|
|
57
|
-
]}
|
|
54
|
+
style={[styles.dot, { transform: [{ translateY }] }, { backgroundColor }]}
|
|
58
55
|
/>
|
|
59
56
|
)
|
|
60
57
|
})}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { ButtonColor, COLORS } from '@magmamath/react-native-ui'
|
|
1
2
|
import { Platform } from 'react-native'
|
|
3
|
+
import { MessageVariant } from './types/model.types'
|
|
4
|
+
import { ColorScheme } from './types/style.types'
|
|
2
5
|
|
|
3
6
|
export const AUDIO_CONFIG = {
|
|
4
7
|
audioEncoding: 'LINEAR16',
|
|
@@ -36,3 +39,37 @@ export const KATEX_REPLACEMENTS = {
|
|
|
36
39
|
export const KATEX_REPLACEMENTS_REVERSE = {
|
|
37
40
|
__KATEX_DOLLAR_SYMBOL__: '$',
|
|
38
41
|
} as const
|
|
42
|
+
|
|
43
|
+
export const MESSAGE_COLORS_MAP = {
|
|
44
|
+
[ColorScheme.Blue]: {
|
|
45
|
+
[MessageVariant.RECEIVED]: {
|
|
46
|
+
background: COLORS.NEUTRAL_3,
|
|
47
|
+
icon: ButtonColor.BLUE,
|
|
48
|
+
},
|
|
49
|
+
[MessageVariant.SENT]: {
|
|
50
|
+
background: COLORS.PRIMARY_BLUE,
|
|
51
|
+
icon: ButtonColor.BLUE,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
[ColorScheme.Yellow]: {
|
|
55
|
+
[MessageVariant.RECEIVED]: {
|
|
56
|
+
background: COLORS.NEUTRAL_3,
|
|
57
|
+
icon: ButtonColor.YELLOW,
|
|
58
|
+
},
|
|
59
|
+
[MessageVariant.SENT]: {
|
|
60
|
+
background: COLORS.PRIMARY_YELLOW,
|
|
61
|
+
icon: ButtonColor.YELLOW,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const CONTROLS_COLORS_MAP = {
|
|
67
|
+
[ColorScheme.Blue]: {
|
|
68
|
+
hover: COLORS.PRIMARY_BLUE,
|
|
69
|
+
background: COLORS.PRIMARY_BLUE,
|
|
70
|
+
},
|
|
71
|
+
[ColorScheme.Yellow]: {
|
|
72
|
+
hover: COLORS.PRIMARY_YELLOW,
|
|
73
|
+
background: COLORS.PRIMARY_YELLOW,
|
|
74
|
+
},
|
|
75
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChatbotAPI } from '../model/ChatbotApi'
|
|
2
|
-
import { createEvent, createStore, sample, createEffect, Store } from 'effector'
|
|
2
|
+
import { createEvent, createStore, sample, createEffect, Store, restore } from 'effector'
|
|
3
3
|
import { ChatItem, ConversationMessage } from '../types/units.types'
|
|
4
4
|
import { ChatbotContext } from '../types/model.types'
|
|
5
5
|
|
|
@@ -35,7 +35,9 @@ export class ErrorSpottingModel {
|
|
|
35
35
|
public readonly errorSpottingPressed = createEvent<ErrorSpottingPressedProps>()
|
|
36
36
|
private readonly activeDataChanged = createEvent<ActiveErrorSpottingData | null>()
|
|
37
37
|
public readonly spottingHidden = createEvent()
|
|
38
|
+
public readonly setIsEnabled = createEvent<boolean>()
|
|
38
39
|
|
|
40
|
+
public readonly $isEnabled = restore(this.setIsEnabled, false)
|
|
39
41
|
public readonly $validationKey = createStore<string | null>(null)
|
|
40
42
|
public readonly $activeData = createStore<ActiveErrorSpottingData | null>(null)
|
|
41
43
|
.on(this.activeDataChanged, (_, payload) => payload)
|
|
@@ -147,4 +149,12 @@ export class ErrorSpottingModel {
|
|
|
147
149
|
this.activeDataChanged(null)
|
|
148
150
|
this.abortPendingRequest()
|
|
149
151
|
}
|
|
152
|
+
|
|
153
|
+
public enable() {
|
|
154
|
+
this.setIsEnabled(true)
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
public disable() {
|
|
158
|
+
this.setIsEnabled(false)
|
|
159
|
+
}
|
|
150
160
|
}
|
|
@@ -10,3 +10,4 @@ export type { PostMessageResponse } from './types/api.types'
|
|
|
10
10
|
export { DefaultMessagesCreator } from './model/DefaultMessageCreator'
|
|
11
11
|
export type { ChatAnswer } from './types/units.types'
|
|
12
12
|
export type { ConversationMessage } from './types/units.types'
|
|
13
|
+
export { ColorScheme } from './types/style.types'
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
attach,
|
|
3
|
-
combine,
|
|
4
|
-
createEffect,
|
|
5
|
-
createEvent,
|
|
6
|
-
createStore,
|
|
7
|
-
restore,
|
|
8
|
-
sample,
|
|
9
|
-
type Store,
|
|
10
|
-
} from 'effector'
|
|
1
|
+
import { attach, combine, createEffect, createEvent, restore, sample, type Store } from 'effector'
|
|
11
2
|
import {
|
|
12
3
|
ChatbotContext,
|
|
13
4
|
ChatbotModelProps,
|
|
@@ -28,6 +19,7 @@ import { ChatsCacheModel, defaultChatData } from './ChatsCacheModel'
|
|
|
28
19
|
import { ErrorSpottingModel } from '../errorSpotting/ErrorSpottingModel'
|
|
29
20
|
import { withEvent } from '../../../lib/effector/withEvent'
|
|
30
21
|
import { ChatBotTextManager } from './ChatBoxTextManager'
|
|
22
|
+
import { ControlledSample } from '../../../lib/effector/ControlledSample'
|
|
31
23
|
|
|
32
24
|
type ReinitConversationProps = {
|
|
33
25
|
key: string
|
|
@@ -46,7 +38,11 @@ export class ChatbotModel {
|
|
|
46
38
|
public readonly t2s: ChatTextToSpeechModel
|
|
47
39
|
public readonly errorSpotting: ErrorSpottingModel
|
|
48
40
|
|
|
49
|
-
|
|
41
|
+
private readonly setCurrentKey = createEvent<string>()
|
|
42
|
+
public readonly $currentKey = restore(this.setCurrentKey, '')
|
|
43
|
+
|
|
44
|
+
private unbindCurrentKey: null | (() => void) = null
|
|
45
|
+
private externalTranslationStateSync?: ControlledSample<boolean, void>
|
|
50
46
|
|
|
51
47
|
readonly resetAlternatives = createEvent()
|
|
52
48
|
readonly setAlternatives = createEvent<GetAlternativesResponse | null>()
|
|
@@ -133,6 +129,31 @@ export class ChatbotModel {
|
|
|
133
129
|
target: this.$isOpen,
|
|
134
130
|
})
|
|
135
131
|
}
|
|
132
|
+
|
|
133
|
+
this.startConversation = attach({
|
|
134
|
+
source: { currentChatData: this.$currentChatData, alternatives: this.$alternatives },
|
|
135
|
+
mapParams: (props: StartConversationProps | void, source) => ({
|
|
136
|
+
...props,
|
|
137
|
+
...source,
|
|
138
|
+
}),
|
|
139
|
+
effect: createEffect(
|
|
140
|
+
({ currentChatData, alternatives, initOnly }: StartConversationFxData) => {
|
|
141
|
+
const { key, messages } = currentChatData
|
|
142
|
+
|
|
143
|
+
if (!alternatives?.chatAccess) return
|
|
144
|
+
|
|
145
|
+
if (messages.length) {
|
|
146
|
+
if (initOnly) return
|
|
147
|
+
return this.reinitConversation({ key })
|
|
148
|
+
}
|
|
149
|
+
this.cache.add(key, {
|
|
150
|
+
messages: [this.defaultMessages.start],
|
|
151
|
+
isAvailable: true,
|
|
152
|
+
currentThread: null,
|
|
153
|
+
})
|
|
154
|
+
},
|
|
155
|
+
),
|
|
156
|
+
})
|
|
136
157
|
}
|
|
137
158
|
|
|
138
159
|
private createSendHelpRequestFx() {
|
|
@@ -174,11 +195,11 @@ export class ChatbotModel {
|
|
|
174
195
|
sample({
|
|
175
196
|
clock: effect.fail,
|
|
176
197
|
source: this.$currentChatData,
|
|
198
|
+
filter: (_, { error }) => error.message !== 'Request aborted manually',
|
|
177
199
|
fn: ({ key, messages }) => ({
|
|
178
200
|
key,
|
|
179
201
|
data: { messages: [...messages, this.defaultMessages.error] },
|
|
180
202
|
}),
|
|
181
|
-
filter: (_, { error }) => error.message !== 'Request aborted manually',
|
|
182
203
|
target: this.cache.update,
|
|
183
204
|
})
|
|
184
205
|
|
|
@@ -186,21 +207,28 @@ export class ChatbotModel {
|
|
|
186
207
|
}
|
|
187
208
|
|
|
188
209
|
public bindKey($store: Store<string>) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
210
|
+
this.unbindCurrentKey?.()
|
|
211
|
+
this.unbindCurrentKey = $store.watch((value) => {
|
|
212
|
+
this.setCurrentKey(value)
|
|
213
|
+
this.threadManager.setCurrentKey(value)
|
|
192
214
|
})
|
|
193
|
-
|
|
215
|
+
|
|
216
|
+
const initialValue = $store.getState()
|
|
217
|
+
this.setCurrentKey(initialValue)
|
|
218
|
+
this.threadManager.setCurrentKey(initialValue)
|
|
194
219
|
return this
|
|
195
220
|
}
|
|
196
221
|
|
|
197
|
-
public bindExternalTranslationState($
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
222
|
+
public bindExternalTranslationState($isTranslated: Store<boolean>) {
|
|
223
|
+
if (!this.externalTranslationStateSync) {
|
|
224
|
+
this.externalTranslationStateSync = new ControlledSample<boolean, void>({
|
|
225
|
+
clock: [this.$currentKey.updates, this.startConversation.done],
|
|
226
|
+
source: $isTranslated,
|
|
227
|
+
filter: (flag) => flag,
|
|
228
|
+
target: this.translation.translateAllMessagesFx,
|
|
229
|
+
isActiveDefault: true,
|
|
230
|
+
})
|
|
231
|
+
}
|
|
204
232
|
return this
|
|
205
233
|
}
|
|
206
234
|
|
|
@@ -215,27 +243,9 @@ export class ChatbotModel {
|
|
|
215
243
|
return this
|
|
216
244
|
}
|
|
217
245
|
|
|
246
|
+
public readonly startConversation
|
|
218
247
|
public readonly sendHelpRequestFx = this.createSendHelpRequestFx()
|
|
219
248
|
|
|
220
|
-
public readonly startConversation = attach({
|
|
221
|
-
source: this.$currentChatData,
|
|
222
|
-
mapParams: (props: StartConversationProps | void, source) => ({
|
|
223
|
-
...props,
|
|
224
|
-
...source,
|
|
225
|
-
}),
|
|
226
|
-
effect: createEffect(({ key, messages, initOnly }: StartConversationFxData) => {
|
|
227
|
-
if (messages.length) {
|
|
228
|
-
if (initOnly) return
|
|
229
|
-
return this.reinitConversation({ key })
|
|
230
|
-
}
|
|
231
|
-
this.cache.add(key, {
|
|
232
|
-
messages: [this.defaultMessages.start],
|
|
233
|
-
isAvailable: true,
|
|
234
|
-
currentThread: null,
|
|
235
|
-
})
|
|
236
|
-
}),
|
|
237
|
-
})
|
|
238
|
-
|
|
239
249
|
public setHintMessage({ key, ...message }: SetHintMessageProps) {
|
|
240
250
|
const options = this.$alternatives.getState()?.options.hints ?? message.options
|
|
241
251
|
this.cache.setSingleMessage(key, { ...message, options })
|
|
@@ -277,4 +287,18 @@ export class ChatbotModel {
|
|
|
277
287
|
this.threadManager.reset()
|
|
278
288
|
this.errorSpotting.reset()
|
|
279
289
|
})
|
|
290
|
+
|
|
291
|
+
public unbindKey() {
|
|
292
|
+
this.unbindCurrentKey?.()
|
|
293
|
+
this.unbindCurrentKey = null
|
|
294
|
+
|
|
295
|
+
this.setCurrentKey('')
|
|
296
|
+
this.threadManager.setCurrentKey('')
|
|
297
|
+
return this
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
public unbindExternalTranslationState() {
|
|
301
|
+
this.externalTranslationStateSync?.disable()
|
|
302
|
+
return this
|
|
303
|
+
}
|
|
280
304
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ThreadItem } from './ThreadItem'
|
|
2
|
-
import { Store } from 'effector'
|
|
3
2
|
import {
|
|
4
3
|
ChatHintPayload,
|
|
5
4
|
ChatHintResponse,
|
|
@@ -27,7 +26,6 @@ export class ChatBotThreadManager {
|
|
|
27
26
|
|
|
28
27
|
private messagesLimit
|
|
29
28
|
private currentKey = ''
|
|
30
|
-
private currentBinding: null | (() => void) = null
|
|
31
29
|
|
|
32
30
|
private readonly defaultMessages
|
|
33
31
|
|
|
@@ -43,14 +41,6 @@ export class ChatBotThreadManager {
|
|
|
43
41
|
this.defaultMessages = messages
|
|
44
42
|
}
|
|
45
43
|
|
|
46
|
-
public bindKeyStore($store: Store<string>) {
|
|
47
|
-
this.currentBinding?.()
|
|
48
|
-
this.currentBinding = $store.watch((value) => {
|
|
49
|
-
this.currentKey = value
|
|
50
|
-
})
|
|
51
|
-
return this
|
|
52
|
-
}
|
|
53
|
-
|
|
54
44
|
private async getThreadItem() {
|
|
55
45
|
const key = this.currentKey
|
|
56
46
|
const existingThreadItem = this.threads.get(key)
|
|
@@ -128,4 +118,8 @@ export class ChatBotThreadManager {
|
|
|
128
118
|
this.api = api
|
|
129
119
|
return this
|
|
130
120
|
}
|
|
121
|
+
|
|
122
|
+
public setCurrentKey(key: string) {
|
|
123
|
+
this.currentKey = key
|
|
124
|
+
}
|
|
131
125
|
}
|
|
@@ -10,9 +10,22 @@ export class ChatBotTextManager {
|
|
|
10
10
|
}).bindToLanguageChanged($localization.updates)
|
|
11
11
|
|
|
12
12
|
public readonly messages: ChatbotMessages = {
|
|
13
|
-
error: this.messagesCreator.createMessage('chat.errorMessage'
|
|
13
|
+
error: this.messagesCreator.createMessage('chat.errorMessage', {
|
|
14
|
+
options: [this.messagesCreator.createOption('chat.giveHint')],
|
|
15
|
+
}),
|
|
14
16
|
start: this.messagesCreator.createMessage('chat.howCanIHelp'),
|
|
15
17
|
endMessage: this.messagesCreator.createMessage('chat.answerAgain'),
|
|
16
18
|
anotherHintOption: this.messagesCreator.createOption('chat.anotherHint'),
|
|
17
19
|
}
|
|
20
|
+
private readonly defaultMessages = { ...this.messages }
|
|
21
|
+
|
|
22
|
+
public update(
|
|
23
|
+
cb: (manager: DefaultMessagesCreator<TranslationKeys>) => Partial<ChatbotMessages>,
|
|
24
|
+
) {
|
|
25
|
+
Object.assign(this.messages, cb(this.messagesCreator))
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public restore() {
|
|
29
|
+
Object.assign(this.messages, this.defaultMessages)
|
|
30
|
+
}
|
|
18
31
|
}
|
|
@@ -8,6 +8,7 @@ type ChatMessage = Omit<PostMessageResponse, 'threadId'> & {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
type DefaultMessageSettings = {
|
|
11
|
+
options?: ChatAnswer[]
|
|
11
12
|
isOwn?: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
@@ -23,11 +24,11 @@ export class DefaultMessagesCreator<K extends string> {
|
|
|
23
24
|
this.getter = textGetter
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
public createMessage(key: K, { isOwn = false }: DefaultMessageSettings = {}) {
|
|
27
|
+
public createMessage(key: K, { isOwn = false, options = [] }: DefaultMessageSettings = {}) {
|
|
27
28
|
const message: ChatMessage = {
|
|
28
29
|
id: this.list.size.toString(),
|
|
29
30
|
message: this.getter(key),
|
|
30
|
-
options
|
|
31
|
+
options,
|
|
31
32
|
isOwnMessage: isOwn,
|
|
32
33
|
}
|
|
33
34
|
this.list.set(message, key)
|
|
@@ -37,6 +38,7 @@ export class DefaultMessagesCreator<K extends string> {
|
|
|
37
38
|
public createOption(key: K) {
|
|
38
39
|
const option: ChatAnswer = {
|
|
39
40
|
text: this.getter(key),
|
|
41
|
+
translatedText: '',
|
|
40
42
|
promptKey: '',
|
|
41
43
|
}
|
|
42
44
|
this.list.set(option, key)
|
|
@@ -79,6 +79,7 @@ export class ChatbotTranslation {
|
|
|
79
79
|
|
|
80
80
|
sample({
|
|
81
81
|
clock: this.translateAllMessagesFx.doneData,
|
|
82
|
+
filter: (_, translatedMessages) => !!translatedMessages.length,
|
|
82
83
|
source: [this.$key] as const,
|
|
83
84
|
fn: ([key], translatedMessages) => ({ key, data: { messages: translatedMessages } }),
|
|
84
85
|
target: chats.update,
|
|
@@ -117,7 +118,7 @@ export class ChatbotTranslation {
|
|
|
117
118
|
private readonly translateBatchFx = createEffect(
|
|
118
119
|
async ({ messages, alternatives, targetLanguage }: TranslateBatchFxProps) => {
|
|
119
120
|
const allTranslated = messages.every((message) => message.translatedMessage)
|
|
120
|
-
if (allTranslated || !targetLanguage) {
|
|
121
|
+
if (allTranslated || !targetLanguage || !messages) {
|
|
121
122
|
return messages
|
|
122
123
|
}
|
|
123
124
|
|
|
@@ -129,6 +130,9 @@ export class ChatbotTranslation {
|
|
|
129
130
|
textList: {
|
|
130
131
|
messages: messages.map(({ message }) => message),
|
|
131
132
|
defaultMessages: defaultMessages.map(({ message }) => message),
|
|
133
|
+
defaultMessagesOptions: defaultMessages.flatMap((message) =>
|
|
134
|
+
message.options.map((option) => option.text),
|
|
135
|
+
),
|
|
132
136
|
defaultOptions: defaultOptions.map(({ text }) => text),
|
|
133
137
|
lastMessage: options.lastMessage || [],
|
|
134
138
|
alternativesHints: options.alternatives?.hints || [],
|
|
@@ -139,6 +143,12 @@ export class ChatbotTranslation {
|
|
|
139
143
|
|
|
140
144
|
translatedTextsList.defaultMessages.forEach((message, index) => {
|
|
141
145
|
defaultMessages[index].translatedMessage = message
|
|
146
|
+
defaultMessages[index].options = defaultMessages[index].options.map((option) => {
|
|
147
|
+
return {
|
|
148
|
+
...option,
|
|
149
|
+
translatedText: translatedTextsList.defaultMessagesOptions[index],
|
|
150
|
+
}
|
|
151
|
+
})
|
|
142
152
|
})
|
|
143
153
|
translatedTextsList.defaultOptions.forEach((message, index) => {
|
|
144
154
|
defaultOptions[index].translatedText = message
|
|
@@ -63,8 +63,11 @@ export type StartConversationProps = {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
export type StartConversationFxData = {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
currentChatData: {
|
|
67
|
+
key: string
|
|
68
|
+
messages: ConversationMessage[]
|
|
69
|
+
}
|
|
70
|
+
alternatives?: GetAlternativesResponse | null
|
|
68
71
|
} & StartConversationProps
|
|
69
72
|
|
|
70
73
|
export enum MessageVariant {
|
|
@@ -2,6 +2,7 @@ import React, { ReactNode, useEffect, useState } from 'react'
|
|
|
2
2
|
import {
|
|
3
3
|
Animated,
|
|
4
4
|
GestureResponderEvent,
|
|
5
|
+
Keyboard,
|
|
5
6
|
StyleProp,
|
|
6
7
|
StyleSheet,
|
|
7
8
|
TextStyle,
|
|
@@ -62,6 +63,8 @@ export const Modal = ({
|
|
|
62
63
|
useEffect(() => {
|
|
63
64
|
if (isVisible) {
|
|
64
65
|
modalModel.animation.show()
|
|
66
|
+
// It's important to blur drawboard text input when modal appears
|
|
67
|
+
Keyboard.dismiss()
|
|
65
68
|
}
|
|
66
69
|
}, [isVisible])
|
|
67
70
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { BaseModal, SPACING } from '@magmamath/react-native-ui'
|
|
3
|
+
import { ExampleSolutionModalContent } from './components/ExampleSolutionModalContent'
|
|
4
|
+
import { ExampleSolutionModalParams } from './types'
|
|
5
|
+
|
|
6
|
+
type ExampleSolutionModalComponentProps = {
|
|
7
|
+
modal: {
|
|
8
|
+
closeModal: () => void
|
|
9
|
+
params: ExampleSolutionModalParams
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const ExampleSolutionModal = ({
|
|
14
|
+
modal: { closeModal, params },
|
|
15
|
+
}: ExampleSolutionModalComponentProps) => (
|
|
16
|
+
<BaseModal
|
|
17
|
+
style={{
|
|
18
|
+
container: { paddingHorizontal: SPACING[800] },
|
|
19
|
+
}}
|
|
20
|
+
onClose={closeModal}
|
|
21
|
+
content={
|
|
22
|
+
<ExampleSolutionModalContent
|
|
23
|
+
model={params.model}
|
|
24
|
+
payload={params.payload}
|
|
25
|
+
problemId={params.problemId}
|
|
26
|
+
/>
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
)
|
|
Binary file
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import { useUnit } from 'effector-react'
|
|
5
|
+
import { $localization } from '../../../shared/translation'
|
|
6
|
+
import { MessageBlock } from './MessageBlock'
|
|
7
|
+
import { LavaIcon } from './LavaIcon'
|
|
8
|
+
import { ExampleSolutionPayload } from '../types'
|
|
9
|
+
import { ExampleSolutionModel } from '../model/ExampleSolution.model'
|
|
10
|
+
import { QuestionSection } from './QuestionSection'
|
|
11
|
+
import { SolutionSection } from './SolutionSection'
|
|
12
|
+
import { useExampleSolution } from '../hooks/useExampleSolution'
|
|
13
|
+
|
|
14
|
+
type ExampleSolutionModalContentProps = {
|
|
15
|
+
model: ExampleSolutionModel
|
|
16
|
+
payload: ExampleSolutionPayload
|
|
17
|
+
problemId: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const ExampleSolutionModalContent = ({
|
|
21
|
+
model,
|
|
22
|
+
payload,
|
|
23
|
+
problemId,
|
|
24
|
+
}: ExampleSolutionModalContentProps) => {
|
|
25
|
+
const { result, status } = useExampleSolution({ model, payload, problemId })
|
|
26
|
+
const localisation = useUnit($localization)
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<View style={styles.container}>
|
|
30
|
+
<Typography align="center" variant={HeadingVariants.H2} style={{ color: COLORS.NEUTRAL_9 }}>
|
|
31
|
+
{localisation.exampleSolution.exampleSolution}
|
|
32
|
+
</Typography>
|
|
33
|
+
<View style={styles.content}>
|
|
34
|
+
<QuestionSection status={status} question={result?.question} />
|
|
35
|
+
<SolutionSection status={status} answer={result?.answer} />
|
|
36
|
+
</View>
|
|
37
|
+
<MessageBlock status={status} style={styles.messageBlock} />
|
|
38
|
+
<LavaIcon status={status} style={styles.lavaIconContainer} />
|
|
39
|
+
</View>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const styles = StyleSheet.create({
|
|
44
|
+
container: {
|
|
45
|
+
width: 532,
|
|
46
|
+
height: 369,
|
|
47
|
+
},
|
|
48
|
+
content: {
|
|
49
|
+
flex: 1,
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
marginTop: SPACING[400],
|
|
52
|
+
gap: SPACING[400],
|
|
53
|
+
},
|
|
54
|
+
solutionContainer: {
|
|
55
|
+
width: 351,
|
|
56
|
+
overflow: 'hidden',
|
|
57
|
+
borderRadius: 8,
|
|
58
|
+
borderWidth: 1,
|
|
59
|
+
borderColor: COLORS.NEUTRAL_5,
|
|
60
|
+
},
|
|
61
|
+
lavaIconContainer: {
|
|
62
|
+
position: 'absolute',
|
|
63
|
+
bottom: -54,
|
|
64
|
+
right: -50,
|
|
65
|
+
},
|
|
66
|
+
loaderContainer: {
|
|
67
|
+
paddingTop: 34,
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
width: '100%',
|
|
70
|
+
height: '100%',
|
|
71
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
72
|
+
},
|
|
73
|
+
messageBlock: {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
right: 38,
|
|
76
|
+
bottom: -22,
|
|
77
|
+
},
|
|
78
|
+
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ExcitedLavaIcon } from '../../../shared/icons/ExcitedLavaIcon'
|
|
3
|
+
import { LavaIconInGlasses } from '../../../shared/icons'
|
|
4
|
+
import Animated, { FadeIn, useAnimatedStyle, withTiming } from 'react-native-reanimated'
|
|
5
|
+
import { StyleProp, ViewStyle } from 'react-native'
|
|
6
|
+
import { ExampleSolutionStatuses } from '../constants'
|
|
7
|
+
|
|
8
|
+
type LavaIconProps = {
|
|
9
|
+
status: ExampleSolutionStatuses
|
|
10
|
+
style?: StyleProp<ViewStyle>
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const LavaIcon = ({ status, style }: LavaIconProps) => {
|
|
14
|
+
const opacityAnimation = useAnimatedStyle(() => {
|
|
15
|
+
return {
|
|
16
|
+
opacity: withTiming(status === ExampleSolutionStatuses.LOADING ? 1 : 0, { duration: 500 }),
|
|
17
|
+
}
|
|
18
|
+
}, [status])
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<Animated.View style={[style, opacityAnimation]}>
|
|
23
|
+
<LavaIconInGlasses height={112} />
|
|
24
|
+
</Animated.View>
|
|
25
|
+
|
|
26
|
+
{status !== ExampleSolutionStatuses.LOADING && (
|
|
27
|
+
<Animated.View style={style} entering={FadeIn}>
|
|
28
|
+
<ExcitedLavaIcon height={112} />
|
|
29
|
+
</Animated.View>
|
|
30
|
+
)}
|
|
31
|
+
</>
|
|
32
|
+
)
|
|
33
|
+
}
|