@magmamath/students-features 0.10.0 → 0.11.0-rc.10
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/helpers.js +4 -1
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js +229 -45
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +39 -0
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js +44 -0
- package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +46 -54
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js +41 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +16 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +14 -34
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +20 -15
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +30 -7
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +2 -1
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js +29 -0
- package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js.map +1 -0
- package/dist/commonjs/features/chatbot/helpers.js +19 -2
- package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +65 -17
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +2 -2
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +2 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js +56 -0
- package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/ChatTTSModel.js +154 -0
- package/dist/commonjs/features/chatbot/model/ChatTTSModel.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/ChatbotApi.js +1 -1
- package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatbotTranslation.js +1 -1
- package/dist/commonjs/features/chatbot/model/ChatbotTranslation.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +9 -0
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/t2s.types.js.map +1 -1
- package/dist/commonjs/features/feedback/model/model.js.map +1 -1
- package/dist/commonjs/features/feedback/model/sockets.js +8 -5
- package/dist/commonjs/features/feedback/model/sockets.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +2 -2
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js +2 -2
- package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.js +4 -4
- package/dist/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js +2 -2
- package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js +4 -4
- package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Keyboard.js +4 -2
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js +1 -6
- package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js +3 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +27 -6
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +1 -0
- package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/constants.js +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js +2 -1
- package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +20 -4
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/commonjs/features/keyboard/helpers.js +7 -0
- package/dist/commonjs/features/keyboard/helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js +20 -3
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +6 -3
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js +34 -0
- package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js.map +1 -0
- package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js +77 -0
- package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js.map +1 -0
- package/dist/commonjs/features/openEnded/index.js +48 -0
- package/dist/commonjs/features/openEnded/index.js.map +1 -0
- package/dist/commonjs/features/openEnded/oe.helpers.js +26 -0
- package/dist/commonjs/features/openEnded/oe.helpers.js.map +1 -0
- package/dist/commonjs/features/openEnded/oe.types.js +14 -0
- package/dist/commonjs/features/openEnded/oe.types.js.map +1 -0
- package/dist/commonjs/index.js +13 -1
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/components/ConditionalWrapper.js +23 -0
- package/dist/commonjs/lib/components/ConditionalWrapper.js.map +1 -0
- package/dist/commonjs/shared/common.constants.js +9 -0
- package/dist/commonjs/shared/common.constants.js.map +1 -0
- package/dist/commonjs/shared/icons/TimeIcon.js +37 -0
- package/dist/commonjs/shared/icons/TimeIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/CDotIcon/CDotIcon.js +4 -4
- package/dist/commonjs/shared/icons/keyboard/CDotIcon/CDotIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +32 -0
- package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +32 -0
- package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +4 -2
- package/dist/commonjs/shared/translation/localization/de.json +4 -2
- package/dist/commonjs/shared/translation/localization/en.json +4 -2
- package/dist/commonjs/shared/translation/localization/gb.json +4 -2
- package/dist/commonjs/shared/translation/localization/sct.json +4 -2
- package/dist/commonjs/shared/translation/localization/sw.json +4 -2
- package/dist/commonjs/types/common.types.js +4 -0
- package/dist/module/features/celebrations/helpers.js +4 -1
- package/dist/module/features/celebrations/helpers.js.map +1 -1
- package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
- package/dist/module/features/chatbot/components/Chat/Chat.js +231 -47
- package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/module/features/chatbot/components/Chat/CloseButton.js +33 -0
- package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +1 -0
- package/dist/module/features/chatbot/components/Chat/GradientFade.js +39 -0
- package/dist/module/features/chatbot/components/Chat/GradientFade.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +46 -55
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
- package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js +34 -0
- package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +16 -4
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +17 -36
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +19 -14
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +28 -6
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +1 -0
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/helpers/ttsHighlight.js +23 -0
- package/dist/module/features/chatbot/helpers/ttsHighlight.js.map +1 -0
- package/dist/module/features/chatbot/helpers.js +19 -2
- package/dist/module/features/chatbot/helpers.js.map +1 -1
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotModel.js +65 -17
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js +2 -2
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +2 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js +52 -0
- package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js.map +1 -0
- package/dist/module/features/chatbot/model/ChatTTSModel.js +149 -0
- package/dist/module/features/chatbot/model/ChatTTSModel.js.map +1 -0
- package/dist/module/features/chatbot/model/ChatbotApi.js +1 -1
- package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatbotTranslation.js +1 -1
- package/dist/module/features/chatbot/model/ChatbotTranslation.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatsCacheModel.js +9 -0
- package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/chatbot/types/t2s.types.js.map +1 -1
- package/dist/module/features/feedback/model/model.js.map +1 -1
- package/dist/module/features/feedback/model/sockets.js +8 -5
- package/dist/module/features/feedback/model/sockets.js.map +1 -1
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +3 -3
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js +2 -2
- package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.js +4 -4
- package/dist/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js +2 -2
- package/dist/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js +4 -4
- package/dist/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/Keyboard.js +4 -2
- package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/module/features/keyboard/components/MainLayout/MainLayout.js +2 -7
- package/dist/module/features/keyboard/components/MainLayout/MainLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/helpers.js +2 -1
- package/dist/module/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +27 -6
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/types.js +1 -0
- package/dist/module/features/keyboard/components/UnitsLayout/types.js.map +1 -1
- package/dist/module/features/keyboard/constants/constants.js +1 -1
- package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js +3 -2
- package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboardLayouts.js +19 -4
- package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/module/features/keyboard/helpers.js +5 -0
- package/dist/module/features/keyboard/helpers.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js +20 -3
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js +6 -3
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js +28 -0
- package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js.map +1 -0
- package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js +71 -0
- package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js.map +1 -0
- package/dist/module/features/openEnded/index.js +7 -0
- package/dist/module/features/openEnded/index.js.map +1 -0
- package/dist/module/features/openEnded/oe.helpers.js +21 -0
- package/dist/module/features/openEnded/oe.helpers.js.map +1 -0
- package/dist/module/features/openEnded/oe.types.js +10 -0
- package/dist/module/features/openEnded/oe.types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/components/ConditionalWrapper.js +17 -0
- package/dist/module/lib/components/ConditionalWrapper.js.map +1 -0
- package/dist/module/shared/common.constants.js +5 -0
- package/dist/module/shared/common.constants.js.map +1 -0
- package/dist/module/shared/icons/TimeIcon.js +29 -0
- package/dist/module/shared/icons/TimeIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/CDotIcon/CDotIcon.js +4 -4
- package/dist/module/shared/icons/keyboard/CDotIcon/CDotIcon.js.map +1 -1
- package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +24 -0
- package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +24 -0
- package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +4 -2
- package/dist/module/shared/translation/localization/de.json +4 -2
- package/dist/module/shared/translation/localization/en.json +4 -2
- package/dist/module/shared/translation/localization/gb.json +4 -2
- package/dist/module/shared/translation/localization/sct.json +4 -2
- package/dist/module/shared/translation/localization/sw.json +4 -2
- package/dist/module/types/common.types.js +2 -0
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +7 -2
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +7 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts +10 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +7 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +4 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts +4 -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 +2 -3
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.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/Chatbot.d.ts +5 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts +8 -0
- package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +3 -2
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +6 -3
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +4 -3
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts +25 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts +38 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +28 -16
- 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 +15 -11
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +25 -0
- package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts +4 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/sockets.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +2 -1
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/constants.d.ts +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +4 -0
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/helpers.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +10 -0
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +36 -0
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +7 -0
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts +12 -0
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/openEnded/index.d.ts +5 -0
- package/dist/typescript/commonjs/features/openEnded/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts +13 -0
- package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts +7 -0
- package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +9 -0
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.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/shared/common.constants.d.ts +2 -0
- package/dist/typescript/commonjs/shared/common.constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +12 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +4 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +2 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +7 -2
- package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +7 -0
- package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts +10 -0
- package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -2
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +7 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +4 -2
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts +4 -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 +2 -3
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.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/Chatbot.d.ts +5 -1
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts +8 -0
- package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +3 -2
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +6 -3
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +4 -3
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts +25 -0
- package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts +38 -0
- package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +28 -16
- 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 +15 -11
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +25 -0
- package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts +4 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/sockets.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +2 -1
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/constants.d.ts +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +4 -0
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/helpers.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +10 -0
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +36 -0
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +7 -0
- package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +1 -0
- package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts +12 -0
- package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +1 -0
- package/dist/typescript/module/features/openEnded/index.d.ts +5 -0
- package/dist/typescript/module/features/openEnded/index.d.ts.map +1 -0
- package/dist/typescript/module/features/openEnded/oe.helpers.d.ts +13 -0
- package/dist/typescript/module/features/openEnded/oe.helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/openEnded/oe.types.d.ts +7 -0
- package/dist/typescript/module/features/openEnded/oe.types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +9 -0
- package/dist/typescript/module/lib/components/ConditionalWrapper.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/shared/common.constants.d.ts +2 -0
- package/dist/typescript/module/shared/common.constants.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +12 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +4 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +2 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -1
- package/package.json +3 -1
- package/src/features/celebrations/helpers.ts +35 -33
- package/src/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
- package/src/features/chatbot/components/Chat/Chat.tsx +301 -57
- package/src/features/chatbot/components/Chat/CloseButton.tsx +31 -0
- package/src/features/chatbot/components/Chat/GradientFade.tsx +43 -0
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +47 -60
- package/src/features/chatbot/components/ChatInput/ChatInput.tsx +2 -1
- package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +2 -2
- package/src/features/chatbot/components/ChatInput/FreeText/SendMessageButton.tsx +1 -1
- package/src/features/chatbot/components/ChatMessage/AnimatedMessage.tsx +30 -0
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +4 -2
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +25 -3
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +17 -33
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +17 -12
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
- package/src/features/chatbot/components/Chatbot.tsx +30 -3
- package/src/features/chatbot/constants.ts +2 -0
- package/src/features/chatbot/helpers/ttsHighlight.ts +25 -0
- package/src/features/chatbot/helpers.ts +14 -1
- package/src/features/chatbot/index.ts +17 -2
- package/src/features/chatbot/model/ChatBotModel.ts +74 -16
- package/src/features/chatbot/model/ChatBotThreadManager.ts +12 -4
- package/src/features/chatbot/model/ChatBoxTextManager.ts +1 -0
- package/src/features/chatbot/model/ChatTTSHighlightModel.ts +64 -0
- package/src/features/chatbot/model/ChatTTSModel.ts +168 -0
- package/src/features/chatbot/model/ChatbotApi.ts +1 -1
- package/src/features/chatbot/model/ChatbotTranslation.ts +1 -1
- package/src/features/chatbot/model/ChatsCacheModel.ts +11 -0
- package/src/features/chatbot/types/api.types.ts +25 -19
- package/src/features/chatbot/types/model.types.ts +24 -12
- package/src/features/chatbot/types/t2s.types.ts +33 -0
- package/src/features/chatbot/types/units.types.ts +1 -0
- package/src/features/feedback/model/model.ts +4 -1
- package/src/features/feedback/model/sockets.ts +8 -6
- package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +4 -3
- package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +2 -2
- package/src/features/keyboard/components/BasicPlusLayout/keyboardGroups.ts +27 -17
- package/src/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.tsx +3 -2
- package/src/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.ts +30 -24
- package/src/features/keyboard/components/Keyboard.tsx +14 -4
- package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -1
- package/src/features/keyboard/components/MainLayout/MainLayout.tsx +2 -6
- package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +1 -1
- package/src/features/keyboard/components/UnitsLayout/helpers.tsx +3 -0
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +36 -22
- package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +11 -0
- package/src/features/keyboard/components/UnitsLayout/types.ts +7 -0
- package/src/features/keyboard/constants/constants.ts +1 -1
- package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +2 -0
- package/src/features/keyboard/constants/keyboardLayouts.ts +18 -1
- package/src/features/keyboard/helpers.ts +6 -0
- package/src/features/keyboard/types/MathKeysGroups/basicOperators.tsx +15 -3
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +3 -0
- package/src/features/openEnded/components/OpenEndedAttemptsLimit.tsx +26 -0
- package/src/features/openEnded/components/OpenEndedScoreLabel.tsx +81 -0
- package/src/features/openEnded/index.ts +4 -0
- package/src/features/openEnded/oe.helpers.ts +31 -0
- package/src/features/openEnded/oe.types.ts +6 -0
- package/src/index.ts +1 -0
- package/src/lib/components/ConditionalWrapper.tsx +15 -0
- package/src/lib/effector/createControllerEffect.ts +1 -1
- package/src/shared/common.constants.ts +3 -0
- package/src/shared/icons/TimeIcon.tsx +23 -0
- package/src/shared/icons/keyboard/CDotIcon/CDotIcon.tsx +2 -2
- package/src/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.tsx +18 -0
- package/src/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.tsx +18 -0
- package/src/shared/translation/localization/ca.json +4 -2
- package/src/shared/translation/localization/de.json +4 -2
- package/src/shared/translation/localization/en.json +4 -2
- package/src/shared/translation/localization/gb.json +4 -2
- package/src/shared/translation/localization/sct.json +4 -2
- package/src/shared/translation/localization/sw.json +4 -2
- package/src/types/common.types.ts +4 -0
- package/dist/commonjs/features/chatbot/model/t2s.js +0 -107
- package/dist/commonjs/features/chatbot/model/t2s.js.map +0 -1
- package/dist/module/features/chatbot/model/t2s.js +0 -102
- package/dist/module/features/chatbot/model/t2s.js.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +0 -34
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts +0 -34
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +0 -1
- package/src/features/chatbot/model/t2s.ts +0 -123
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Platform, StyleSheet, View, ViewStyle } from 'react-native'
|
|
3
|
+
|
|
4
|
+
type GradientFadeProps = {
|
|
5
|
+
colors: string[]
|
|
6
|
+
locations?: number[]
|
|
7
|
+
style?: ViewStyle
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const WebGradient = ({ colors, locations, style }: GradientFadeProps) => {
|
|
11
|
+
const stops = colors
|
|
12
|
+
.map((color, i) => {
|
|
13
|
+
const position = locations ? `${locations[i] * 100}%` : undefined
|
|
14
|
+
return position ? `${color} ${position}` : color
|
|
15
|
+
})
|
|
16
|
+
.join(', ')
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<View
|
|
20
|
+
style={[
|
|
21
|
+
StyleSheet.absoluteFill,
|
|
22
|
+
style,
|
|
23
|
+
{ backgroundImage: `linear-gradient(to bottom, ${stops})` } as any,
|
|
24
|
+
]}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const NativeGradient = ({ colors, locations, style }: GradientFadeProps) => {
|
|
30
|
+
const { LinearGradient } = require('expo-linear-gradient')
|
|
31
|
+
return (
|
|
32
|
+
<LinearGradient
|
|
33
|
+
colors={colors}
|
|
34
|
+
locations={locations}
|
|
35
|
+
style={[StyleSheet.absoluteFill, style]}
|
|
36
|
+
/>
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const GradientFade = Platform.select({
|
|
41
|
+
web: WebGradient,
|
|
42
|
+
default: NativeGradient,
|
|
43
|
+
})
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { ComponentType, PropsWithChildren } from 'react'
|
|
3
3
|
import { Pressable, StyleSheet, View } from 'react-native'
|
|
4
|
-
import {
|
|
5
|
-
Button,
|
|
6
|
-
ButtonColor,
|
|
7
|
-
ButtonSize,
|
|
8
|
-
ButtonStates,
|
|
9
|
-
ButtonVariant,
|
|
10
|
-
COLORS,
|
|
11
|
-
} from '@magmamath/react-native-ui'
|
|
4
|
+
import { Button, ButtonColor, ButtonSize, ButtonVariant } from '@magmamath/react-native-ui'
|
|
12
5
|
import { useUnit } from 'effector-react'
|
|
13
6
|
import { ChatbotModel } from '../../model/ChatBotModel'
|
|
14
7
|
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
15
|
-
|
|
8
|
+
|
|
9
|
+
const HELP_BUTTON_TIMEOUT_MS = 5000
|
|
16
10
|
|
|
17
11
|
type ChatControlsProps = {
|
|
18
12
|
model: ChatbotModel
|
|
19
13
|
onPressChatIcon: () => void
|
|
20
|
-
|
|
14
|
+
onPressHelpButton?: () => void
|
|
15
|
+
withHelpButton?: boolean
|
|
21
16
|
ButtonWrapper?: ComponentType<PropsWithChildren>
|
|
22
17
|
iconSize?: { width: number; height: number }
|
|
23
18
|
}
|
|
@@ -25,56 +20,48 @@ type ChatControlsProps = {
|
|
|
25
20
|
export const ChatControls = ({
|
|
26
21
|
model,
|
|
27
22
|
onPressChatIcon,
|
|
28
|
-
|
|
23
|
+
onPressHelpButton,
|
|
24
|
+
withHelpButton = false,
|
|
29
25
|
ButtonWrapper = React.Fragment,
|
|
30
|
-
iconSize = { width:
|
|
26
|
+
iconSize = { width: 70, height: 90 },
|
|
31
27
|
}: ChatControlsProps) => {
|
|
32
28
|
const isOpen = useUnit(model.$isOpen)
|
|
29
|
+
const isTranslated = useUnit(model.translation.$isTranslated)
|
|
30
|
+
const wantHelp = model.textManager.messages.wantHelp
|
|
31
|
+
const [isHelpButtonVisible, setIsHelpButtonVisible] = useState(withHelpButton)
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
const timeoutId = setTimeout(() => setIsHelpButtonVisible(false), HELP_BUTTON_TIMEOUT_MS)
|
|
35
|
+
return () => {
|
|
36
|
+
clearTimeout(timeoutId)
|
|
37
|
+
setIsHelpButtonVisible(false)
|
|
38
|
+
}
|
|
39
|
+
}, [withHelpButton])
|
|
40
|
+
|
|
33
41
|
if (isOpen) {
|
|
34
|
-
return
|
|
35
|
-
<View style={styles.container}>
|
|
36
|
-
<Button
|
|
37
|
-
onPress={onPressClose}
|
|
38
|
-
style={{
|
|
39
|
-
button: styles.buttonClose,
|
|
40
|
-
}}
|
|
41
|
-
variant={ButtonVariant.PRIMARY}
|
|
42
|
-
size={ButtonSize.LARGE}
|
|
43
|
-
colorScheme={ButtonColor.WHITE}
|
|
44
|
-
raiseLevel={5}
|
|
45
|
-
customColorScheme={{
|
|
46
|
-
[ButtonStates.DEFAULT]: {
|
|
47
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
48
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
49
|
-
raiseColor: COLORS.NEUTRAL_5,
|
|
50
|
-
color: COLORS.NEUTRAL_10,
|
|
51
|
-
},
|
|
52
|
-
[ButtonStates.PRESSED]: {
|
|
53
|
-
backgroundColor: COLORS.NEUTRAL_4,
|
|
54
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
55
|
-
raiseColor: COLORS.NEUTRAL_5,
|
|
56
|
-
color: COLORS.NEUTRAL_1,
|
|
57
|
-
},
|
|
58
|
-
[ButtonStates.HOVER]: {
|
|
59
|
-
backgroundColor: COLORS.NEUTRAL_3,
|
|
60
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
61
|
-
raiseColor: COLORS.NEUTRAL_5,
|
|
62
|
-
color: COLORS.NEUTRAL_10,
|
|
63
|
-
},
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
<CloseIcon />
|
|
67
|
-
</Button>
|
|
68
|
-
</View>
|
|
69
|
-
)
|
|
42
|
+
return null
|
|
70
43
|
}
|
|
71
44
|
|
|
72
45
|
return (
|
|
73
46
|
<View style={styles.container}>
|
|
74
47
|
<ButtonWrapper>
|
|
75
|
-
<
|
|
76
|
-
<
|
|
77
|
-
|
|
48
|
+
<View style={styles.closedWrapper}>
|
|
49
|
+
<Pressable onPress={onPressChatIcon}>
|
|
50
|
+
<ChatbotIcon width={iconSize?.width} height={iconSize?.height} />
|
|
51
|
+
</Pressable>
|
|
52
|
+
{isHelpButtonVisible && (
|
|
53
|
+
<Button
|
|
54
|
+
variant={ButtonVariant.PRIMARY}
|
|
55
|
+
colorScheme={ButtonColor.WHITE}
|
|
56
|
+
size={ButtonSize.MEDIUM}
|
|
57
|
+
raiseLevel={3}
|
|
58
|
+
onPress={onPressHelpButton}
|
|
59
|
+
style={{ text: styles.helpButtonText }}
|
|
60
|
+
>
|
|
61
|
+
{(isTranslated && wantHelp.translatedText) || wantHelp.text}
|
|
62
|
+
</Button>
|
|
63
|
+
)}
|
|
64
|
+
</View>
|
|
78
65
|
</ButtonWrapper>
|
|
79
66
|
</View>
|
|
80
67
|
)
|
|
@@ -86,15 +73,15 @@ const styles = StyleSheet.create({
|
|
|
86
73
|
justifyContent: 'flex-end',
|
|
87
74
|
flexDirection: 'row',
|
|
88
75
|
maxHeight: 100,
|
|
89
|
-
gap:
|
|
76
|
+
gap: 2,
|
|
90
77
|
paddingBottom: 5,
|
|
91
78
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
79
|
+
closedWrapper: {
|
|
80
|
+
flexDirection: 'row',
|
|
81
|
+
alignItems: 'flex-end',
|
|
82
|
+
gap: 8,
|
|
83
|
+
},
|
|
84
|
+
helpButtonText: {
|
|
85
|
+
textTransform: 'uppercase',
|
|
99
86
|
},
|
|
100
87
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
|
+
import { SPACING } from '@magmamath/react-native-ui'
|
|
3
4
|
import { useStoreMap, useUnit } from 'effector-react'
|
|
4
5
|
import { useChatModel } from '../../context/ChatBotModelContext'
|
|
5
6
|
import { ColorScheme } from '../../types/style.types'
|
|
@@ -82,6 +83,6 @@ const styles = StyleSheet.create({
|
|
|
82
83
|
width: 305,
|
|
83
84
|
alignItems: 'center',
|
|
84
85
|
justifyContent: 'center',
|
|
85
|
-
|
|
86
|
+
marginLeft: 6,
|
|
86
87
|
},
|
|
87
88
|
})
|
|
@@ -107,7 +107,7 @@ export const ChatTextInput = ({
|
|
|
107
107
|
onBlur={handleOnBlur}
|
|
108
108
|
onFocus={handleOnFocus}
|
|
109
109
|
placeholder={placeholder}
|
|
110
|
-
placeholderTextColor={COLORS.
|
|
110
|
+
placeholderTextColor={COLORS.NEUTRAL_5}
|
|
111
111
|
style={styles.input}
|
|
112
112
|
/>
|
|
113
113
|
<SendMessageButton
|
|
@@ -124,10 +124,10 @@ const styles = StyleSheet.create({
|
|
|
124
124
|
position: 'relative',
|
|
125
125
|
width: '100%',
|
|
126
126
|
alignItems: 'flex-end',
|
|
127
|
-
height: 52,
|
|
128
127
|
justifyContent: 'center',
|
|
129
128
|
},
|
|
130
129
|
inputWrapper: {
|
|
130
|
+
height: 52,
|
|
131
131
|
position: 'absolute',
|
|
132
132
|
zIndex: 1,
|
|
133
133
|
left: 0,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { PropsWithChildren, useEffect } from 'react'
|
|
2
|
+
import Animated, { useAnimatedStyle, useSharedValue, withSpring } from 'react-native-reanimated'
|
|
3
|
+
|
|
4
|
+
const INITIAL_OFFSET = 25
|
|
5
|
+
const SPRING_CONFIG = { mass: 1.1, stiffness: 177, damping: 20 }
|
|
6
|
+
|
|
7
|
+
type AnimatedMessageProps = PropsWithChildren<{ animate?: boolean }>
|
|
8
|
+
|
|
9
|
+
export const AnimatedMessage = ({ children, animate = true }: AnimatedMessageProps) => {
|
|
10
|
+
const translateY = useSharedValue(animate ? INITIAL_OFFSET : 0)
|
|
11
|
+
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (animate) {
|
|
14
|
+
translateY.value = withSpring(0, SPRING_CONFIG)
|
|
15
|
+
}
|
|
16
|
+
}, [])
|
|
17
|
+
|
|
18
|
+
const animatedStyle = useAnimatedStyle(
|
|
19
|
+
() => ({
|
|
20
|
+
transform: [{ translateY: translateY.value }],
|
|
21
|
+
}),
|
|
22
|
+
[translateY],
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Animated.View style={[animate && animatedStyle, { alignItems: 'flex-end' }]}>
|
|
27
|
+
{children}
|
|
28
|
+
</Animated.View>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
@@ -2,7 +2,7 @@ import React, { ComponentType } from 'react'
|
|
|
2
2
|
|
|
3
3
|
import { ReceivedMessage } from './ReceivedMessage'
|
|
4
4
|
import { SentMessage } from './SentMessage'
|
|
5
|
-
import { T2SState } from '../../types/t2s.types'
|
|
5
|
+
import { TTSHighlightRenderer, T2SState } from '../../types/t2s.types'
|
|
6
6
|
import { MessageVariant } from '../../types/model.types'
|
|
7
7
|
import { ConversationMessage } from '../../types/units.types'
|
|
8
8
|
import { ColorScheme } from '../../types/style.types'
|
|
@@ -13,8 +13,10 @@ type ChatMessageProps = {
|
|
|
13
13
|
t2sState: T2SState
|
|
14
14
|
isTranslated?: boolean
|
|
15
15
|
withErrorSpotting?: boolean
|
|
16
|
-
withIcon?: boolean
|
|
17
16
|
colorScheme?: ColorScheme
|
|
17
|
+
highlightedWordIndex?: number
|
|
18
|
+
TTSHighlightRenderer?: TTSHighlightRenderer
|
|
19
|
+
withIcon?: boolean
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export type VariantProps = Omit<ChatMessageProps, 'variant'>
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { Platform, StyleSheet, Text, View } from 'react-native'
|
|
3
3
|
|
|
4
4
|
import { ConversationMessage } from '../../types/units.types'
|
|
5
|
-
import { T2SState } from '../../types/t2s.types'
|
|
5
|
+
import { TTSHighlightRenderer, T2SState } from '../../types/t2s.types'
|
|
6
6
|
import { ColorScheme } from '../../types/style.types'
|
|
7
7
|
|
|
8
8
|
import { MessageButtonsBlock } from './MessageButtonsBlock'
|
|
@@ -16,6 +16,8 @@ type MessageContentProps = {
|
|
|
16
16
|
variant: MessageVariant
|
|
17
17
|
colorScheme?: ColorScheme
|
|
18
18
|
withErrorSpotting?: boolean
|
|
19
|
+
highlightedWordIndex?: number
|
|
20
|
+
TTSHighlightRenderer?: TTSHighlightRenderer
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
const MessageContentWeb = ({
|
|
@@ -25,10 +27,20 @@ const MessageContentWeb = ({
|
|
|
25
27
|
variant,
|
|
26
28
|
colorScheme = ColorScheme.Blue,
|
|
27
29
|
withErrorSpotting,
|
|
30
|
+
highlightedWordIndex,
|
|
31
|
+
TTSHighlightRenderer: TTSHighlightComponent,
|
|
28
32
|
}: MessageContentProps) => {
|
|
29
33
|
return (
|
|
30
34
|
<Text style={styles.messageText}>
|
|
31
|
-
{
|
|
35
|
+
{TTSHighlightComponent ? (
|
|
36
|
+
<TTSHighlightComponent
|
|
37
|
+
text={text}
|
|
38
|
+
highlightedIndex={highlightedWordIndex ?? -1}
|
|
39
|
+
colorScheme={colorScheme}
|
|
40
|
+
/>
|
|
41
|
+
) : (
|
|
42
|
+
text
|
|
43
|
+
)}
|
|
32
44
|
<MessageButtonsBlock
|
|
33
45
|
message={message}
|
|
34
46
|
t2sState={t2sState}
|
|
@@ -47,11 +59,21 @@ const MessageContentMobile = ({
|
|
|
47
59
|
variant,
|
|
48
60
|
colorScheme = ColorScheme.Blue,
|
|
49
61
|
withErrorSpotting,
|
|
62
|
+
highlightedWordIndex,
|
|
63
|
+
TTSHighlightRenderer: TTSHighlightComponent,
|
|
50
64
|
}: MessageContentProps) => {
|
|
51
65
|
return (
|
|
52
66
|
<>
|
|
53
67
|
<Text style={[styles.messageText, styles.mobileMessageText]}>
|
|
54
|
-
{
|
|
68
|
+
{TTSHighlightComponent ? (
|
|
69
|
+
<TTSHighlightComponent
|
|
70
|
+
text={text}
|
|
71
|
+
highlightedIndex={highlightedWordIndex ?? -1}
|
|
72
|
+
colorScheme={colorScheme}
|
|
73
|
+
/>
|
|
74
|
+
) : (
|
|
75
|
+
text
|
|
76
|
+
)}
|
|
55
77
|
<View style={{ width: getSpacerSize(message, t2sState) }} />
|
|
56
78
|
</Text>
|
|
57
79
|
<MessageButtonsBlock
|
|
@@ -1,54 +1,38 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { PropsWithChildren } from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
-
|
|
5
|
-
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
6
|
-
import { ThreeDotsLoader } from '../ThreeDotsLoader/ThreeDotsLoader'
|
|
7
|
-
import { CONTROLS_COLORS_MAP } from '../../constants'
|
|
8
|
-
import { ColorScheme } from '../../types/style.types'
|
|
9
|
-
import { LavaIconInGlasses } from '@magmamath/students-features'
|
|
3
|
+
import { BORDER_RADIUS, COLORS, Loader, LoaderColor } from '@magmamath/react-native-ui'
|
|
4
|
+
import { SPACING } from '@magmamath/react-native-ui'
|
|
10
5
|
|
|
11
6
|
type MessageLoaderProps = {
|
|
12
|
-
|
|
7
|
+
isLoading?: boolean
|
|
13
8
|
}
|
|
14
9
|
|
|
15
|
-
export const MessageLoader = ({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</View>
|
|
10
|
+
export const MessageLoader = ({ isLoading }: MessageLoaderProps) => {
|
|
11
|
+
if (!isLoading) return null
|
|
12
|
+
|
|
13
|
+
return (
|
|
20
14
|
<View style={styles.loader}>
|
|
21
|
-
<
|
|
15
|
+
<Loader color={LoaderColor.GRAY} />
|
|
22
16
|
</View>
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
)
|
|
18
|
+
}
|
|
25
19
|
|
|
26
20
|
const styles = StyleSheet.create({
|
|
27
|
-
container: {
|
|
28
|
-
flexDirection: 'row',
|
|
29
|
-
width: 327,
|
|
30
|
-
alignItems: 'flex-end',
|
|
31
|
-
paddingLeft:70
|
|
32
|
-
},
|
|
33
|
-
icon: {
|
|
34
|
-
position: 'absolute',
|
|
35
|
-
zIndex:1,
|
|
36
|
-
alignSelf: 'flex-end',
|
|
37
|
-
left: 0
|
|
38
|
-
},
|
|
39
21
|
loader: {
|
|
40
|
-
|
|
22
|
+
marginLeft: 68,
|
|
23
|
+
alignSelf: 'flex-start',
|
|
24
|
+
marginTop: SPACING['200'],
|
|
41
25
|
flexDirection: 'row',
|
|
42
26
|
alignItems: 'flex-start',
|
|
43
|
-
|
|
27
|
+
justifyContent: 'flex-start',
|
|
28
|
+
maxWidth: 62,
|
|
44
29
|
padding: 8,
|
|
45
|
-
paddingTop: 15,
|
|
46
30
|
shadowColor: '#333333',
|
|
47
31
|
shadowOffset: { width: 0, height: 1 },
|
|
48
32
|
shadowOpacity: 0.25,
|
|
49
33
|
shadowRadius: 3,
|
|
50
34
|
elevation: 3,
|
|
51
|
-
borderRadius:
|
|
35
|
+
borderRadius: BORDER_RADIUS['300'],
|
|
52
36
|
borderBottomLeftRadius: 0,
|
|
53
37
|
backgroundColor: COLORS.NEUTRAL_3,
|
|
54
38
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
3
|
+
import { BORDER_RADIUS, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
+
import { ChatbotIcon } from '@magmamath/students-features'
|
|
6
5
|
import { ColorScheme } from '../../types/style.types'
|
|
7
|
-
import { MessageContent } from './MessageContent'
|
|
8
6
|
import { MessageVariant } from '../../types/model.types'
|
|
7
|
+
import { VariantProps } from './ChatMessage'
|
|
8
|
+
import { MessageContent } from './MessageContent'
|
|
9
9
|
|
|
10
10
|
export const ReceivedMessage = ({
|
|
11
11
|
message,
|
|
@@ -14,6 +14,8 @@ export const ReceivedMessage = ({
|
|
|
14
14
|
withIcon,
|
|
15
15
|
colorScheme = ColorScheme.Blue,
|
|
16
16
|
withErrorSpotting,
|
|
17
|
+
highlightedWordIndex,
|
|
18
|
+
TTSHighlightRenderer,
|
|
17
19
|
}: VariantProps) => {
|
|
18
20
|
const text = isTranslated ? message.translatedMessage : message.message
|
|
19
21
|
|
|
@@ -21,7 +23,7 @@ export const ReceivedMessage = ({
|
|
|
21
23
|
<View style={styles.container}>
|
|
22
24
|
{withIcon && (
|
|
23
25
|
<View style={styles.icon}>
|
|
24
|
-
<ChatbotIcon width={
|
|
26
|
+
<ChatbotIcon width={53} height={73} />
|
|
25
27
|
</View>
|
|
26
28
|
)}
|
|
27
29
|
|
|
@@ -33,6 +35,8 @@ export const ReceivedMessage = ({
|
|
|
33
35
|
text={text ?? ''}
|
|
34
36
|
colorScheme={colorScheme}
|
|
35
37
|
withErrorSpotting={withErrorSpotting}
|
|
38
|
+
highlightedWordIndex={highlightedWordIndex}
|
|
39
|
+
TTSHighlightRenderer={TTSHighlightRenderer}
|
|
36
40
|
/>
|
|
37
41
|
</View>
|
|
38
42
|
</View>
|
|
@@ -43,14 +47,11 @@ const styles = StyleSheet.create({
|
|
|
43
47
|
container: {
|
|
44
48
|
flex: 1,
|
|
45
49
|
flexDirection: 'row',
|
|
46
|
-
maxWidth:
|
|
47
|
-
width:
|
|
50
|
+
maxWidth: 365,
|
|
51
|
+
width: 305,
|
|
48
52
|
alignItems: 'flex-end',
|
|
49
53
|
justifyContent: 'flex-end',
|
|
50
|
-
|
|
51
|
-
icon: {
|
|
52
|
-
alignSelf: 'flex-end',
|
|
53
|
-
marginRight: 8,
|
|
54
|
+
paddingHorizontal: 2,
|
|
54
55
|
},
|
|
55
56
|
message: {
|
|
56
57
|
flex: 1,
|
|
@@ -62,8 +63,12 @@ const styles = StyleSheet.create({
|
|
|
62
63
|
shadowOpacity: 0.25,
|
|
63
64
|
shadowRadius: 3,
|
|
64
65
|
elevation: 3,
|
|
65
|
-
borderRadius:
|
|
66
|
+
borderRadius: BORDER_RADIUS[300],
|
|
66
67
|
borderBottomLeftRadius: 0,
|
|
67
68
|
backgroundColor: '#F2F2F4',
|
|
68
69
|
},
|
|
70
|
+
|
|
71
|
+
icon: {
|
|
72
|
+
paddingRight: SPACING[200],
|
|
73
|
+
},
|
|
69
74
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentType, PropsWithChildren } from 'react'
|
|
1
|
+
import React, { ComponentType, PropsWithChildren, useCallback } from 'react'
|
|
2
2
|
import { useStoreMap, useUnit } from 'effector-react'
|
|
3
3
|
|
|
4
4
|
import { ChatbotModel } from '../model/ChatBotModel'
|
|
@@ -7,36 +7,58 @@ import { ChatControls } from './ChatControls/ChatControls'
|
|
|
7
7
|
import { AUDIO_CONFIG, DEFAULT_VOICE } from '../constants'
|
|
8
8
|
import { ChatBotModelContext } from '../context/ChatBotModelContext'
|
|
9
9
|
import { ColorScheme } from '../types/style.types'
|
|
10
|
+
import { TTSHighlightRenderer } from '../types/t2s.types'
|
|
10
11
|
|
|
11
12
|
type ChatbotProps = {
|
|
12
13
|
model: ChatbotModel
|
|
13
14
|
isHintFeedback: boolean
|
|
14
15
|
isTextToSpeechEnabled: boolean
|
|
16
|
+
withQuickActionButton?: boolean
|
|
15
17
|
textToSpeechConfig?: {
|
|
16
18
|
voice: typeof DEFAULT_VOICE
|
|
17
19
|
audioConfig: typeof AUDIO_CONFIG
|
|
18
20
|
}
|
|
19
21
|
ButtonWrapper?: ComponentType<PropsWithChildren>
|
|
20
22
|
iconSize?: { width: number; height: number } // TODO: use number instead
|
|
23
|
+
isInputDisabled?: boolean
|
|
21
24
|
colorScheme?: ColorScheme
|
|
25
|
+
TTSHighlightRenderer?: TTSHighlightRenderer
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
export const Chatbot = ({
|
|
25
29
|
model,
|
|
26
30
|
isHintFeedback,
|
|
27
31
|
isTextToSpeechEnabled = false,
|
|
32
|
+
isInputDisabled,
|
|
28
33
|
textToSpeechConfig,
|
|
29
34
|
ButtonWrapper,
|
|
30
35
|
iconSize,
|
|
31
36
|
colorScheme = ColorScheme.Blue,
|
|
37
|
+
withQuickActionButton,
|
|
38
|
+
TTSHighlightRenderer,
|
|
32
39
|
}: ChatbotProps) => {
|
|
40
|
+
const alternatives = useUnit(model.$alternatives)
|
|
33
41
|
const isChatAllowed = useUnit(model.$chatAccess)
|
|
34
42
|
const isAvailable = useStoreMap(model.$currentChatData, ({ isAvailable }) => isAvailable)
|
|
43
|
+
const hasBeenOpened = useStoreMap(model.$currentChatData, ({ hasBeenOpened }) => hasBeenOpened)
|
|
44
|
+
|
|
35
45
|
model.t2s.setAudioConfig(textToSpeechConfig ?? null)
|
|
36
46
|
|
|
37
47
|
const openChat = () => model.setIsOpen(true)
|
|
38
48
|
const closeChat = () => model.setIsOpen(false)
|
|
39
49
|
|
|
50
|
+
const sendHelpRequest = useCallback(() => {
|
|
51
|
+
const option = alternatives?.options.default[0]
|
|
52
|
+
if (!option) return
|
|
53
|
+
|
|
54
|
+
model.setIsOpen(true)
|
|
55
|
+
void model.sendHelpRequestFx({
|
|
56
|
+
message: option.text,
|
|
57
|
+
translatedMessage: option.translatedText,
|
|
58
|
+
skipOwnMessage: true,
|
|
59
|
+
})
|
|
60
|
+
}, [alternatives])
|
|
61
|
+
|
|
40
62
|
if (!isAvailable || !isChatAllowed) {
|
|
41
63
|
return null
|
|
42
64
|
}
|
|
@@ -48,14 +70,19 @@ export const Chatbot = ({
|
|
|
48
70
|
colorScheme={colorScheme}
|
|
49
71
|
isHintFeedback={isHintFeedback}
|
|
50
72
|
isTextToSpeechEnabled={isTextToSpeechEnabled}
|
|
73
|
+
isInputDisabled={isInputDisabled}
|
|
74
|
+
MessageWrapper={ButtonWrapper}
|
|
75
|
+
TTSHighlightRenderer={TTSHighlightRenderer}
|
|
76
|
+
onPressClose={closeChat}
|
|
51
77
|
/>
|
|
52
78
|
|
|
53
79
|
<ChatControls
|
|
54
80
|
model={model}
|
|
55
81
|
onPressChatIcon={openChat}
|
|
56
|
-
|
|
57
|
-
ButtonWrapper={ButtonWrapper}
|
|
82
|
+
onPressHelpButton={sendHelpRequest}
|
|
58
83
|
iconSize={iconSize}
|
|
84
|
+
ButtonWrapper={isInputDisabled ? undefined : ButtonWrapper}
|
|
85
|
+
withHelpButton={withQuickActionButton && !hasBeenOpened}
|
|
59
86
|
/>
|
|
60
87
|
</ChatBotModelContext.Provider>
|
|
61
88
|
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Timepoint } from '../types/api.types'
|
|
2
|
+
|
|
3
|
+
const escapeXml = (str: string): string =>
|
|
4
|
+
str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Converts plain text to SSML with word marks for TTS highlighting.
|
|
8
|
+
* "Hello world" -> '<speak><mark name="w_0"/>Hello <mark name="w_1"/>world</speak>'
|
|
9
|
+
*/
|
|
10
|
+
export const textToSSML = (text: string): string => {
|
|
11
|
+
const words = text.split(/\s+/).filter(Boolean)
|
|
12
|
+
if (words.length === 0) return '<speak></speak>'
|
|
13
|
+
|
|
14
|
+
const ssmlParts = words.map((word, i) => `<mark name="w_${i}"/>${escapeXml(word)}`)
|
|
15
|
+
return `<speak>${ssmlParts.join(' ')}</speak>`
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const findCurrentMark = (timepoints: Timepoint[], time: number): string | undefined => {
|
|
19
|
+
for (let i = timepoints.length - 1; i >= 0; i--) {
|
|
20
|
+
if (timepoints[i].timeSeconds <= time) {
|
|
21
|
+
return timepoints[i].markName
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return undefined
|
|
25
|
+
}
|
|
@@ -58,17 +58,27 @@ export function prepareChatRequestPayload(
|
|
|
58
58
|
conversationId,
|
|
59
59
|
freeTextMessage,
|
|
60
60
|
problemDescription,
|
|
61
|
+
problemStandards,
|
|
61
62
|
problemAnswer,
|
|
62
63
|
language,
|
|
63
64
|
imageCdnId,
|
|
64
65
|
imageAltText,
|
|
65
66
|
answerOptions,
|
|
66
67
|
answer,
|
|
68
|
+
chatHistory,
|
|
67
69
|
} = payload
|
|
68
70
|
|
|
69
71
|
if (freeTextMessage) {
|
|
70
72
|
return conversationId
|
|
71
|
-
? {
|
|
73
|
+
? {
|
|
74
|
+
type: ChatRequestType.FREETEXT,
|
|
75
|
+
data: {
|
|
76
|
+
conversationId,
|
|
77
|
+
message: freeTextMessage,
|
|
78
|
+
...(chatHistory && { chatHistory }),
|
|
79
|
+
...(!!problemStandards?.length && { problemStandards }),
|
|
80
|
+
},
|
|
81
|
+
}
|
|
72
82
|
: {
|
|
73
83
|
type: ChatRequestType.FREETEXT,
|
|
74
84
|
data: {
|
|
@@ -76,8 +86,10 @@ export function prepareChatRequestPayload(
|
|
|
76
86
|
correctAnswer: problemAnswer,
|
|
77
87
|
problemDescription,
|
|
78
88
|
language,
|
|
89
|
+
...(chatHistory && { chatHistory }),
|
|
79
90
|
...(imageCdnId && { imageCdnId }),
|
|
80
91
|
...(imageAltText && { altText: imageAltText }),
|
|
92
|
+
...(!!problemStandards?.length && { problemStandards }),
|
|
81
93
|
...(!!answerOptions?.length && { answerOptions }),
|
|
82
94
|
},
|
|
83
95
|
}
|
|
@@ -93,6 +105,7 @@ export function prepareChatRequestPayload(
|
|
|
93
105
|
language,
|
|
94
106
|
...(imageCdnId && { imageCdnId }),
|
|
95
107
|
...(imageAltText && { altText: imageAltText }),
|
|
108
|
+
...(!!problemStandards?.length && { problemStandards }),
|
|
96
109
|
},
|
|
97
110
|
}
|
|
98
111
|
}
|