@magmamath/students-features 0.10.0-rc.7 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/celebrations/helpers.js +1 -4
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js +19 -41
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +2 -7
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +4 -16
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +2 -6
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +4 -17
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +1 -2
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/helpers.js +2 -19
- 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 +11 -32
- 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/ChatbotApi.js +1 -1
- package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/t2s.js +107 -0
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -0
- 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 +5 -8
- 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 +2 -4
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js +6 -1
- 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 +1 -3
- package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +6 -27
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +1 -9
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +0 -1
- 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 +1 -2
- package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +4 -20
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/commonjs/features/keyboard/helpers.js +0 -7
- package/dist/commonjs/features/keyboard/helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -20
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +3 -6
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/commonjs/index.js +1 -13
- package/dist/commonjs/index.js.map +1 -1
- 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/translation/localization/ca.json +1 -2
- package/dist/commonjs/shared/translation/localization/de.json +1 -2
- package/dist/commonjs/shared/translation/localization/en.json +1 -2
- package/dist/commonjs/shared/translation/localization/gb.json +1 -2
- package/dist/commonjs/shared/translation/localization/sct.json +1 -2
- package/dist/commonjs/shared/translation/localization/sw.json +1 -2
- package/dist/commonjs/types/common.types.js +0 -4
- package/dist/module/features/celebrations/helpers.js +1 -4
- package/dist/module/features/celebrations/helpers.js.map +1 -1
- package/dist/module/features/chatbot/components/Chat/Chat.js +19 -41
- package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +2 -5
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +4 -16
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +2 -6
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +4 -17
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +0 -1
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/helpers.js +2 -19
- 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 +11 -32
- 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/ChatbotApi.js +1 -1
- package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
- package/dist/module/features/chatbot/model/t2s.js +102 -0
- package/dist/module/features/chatbot/model/t2s.js.map +1 -0
- 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 +5 -8
- 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 +2 -4
- 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 +7 -2
- 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 +1 -2
- package/dist/module/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +6 -27
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +1 -9
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/types.js +0 -1
- 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 +2 -3
- package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboardLayouts.js +4 -19
- package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/module/features/keyboard/helpers.js +0 -5
- package/dist/module/features/keyboard/helpers.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -20
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js +3 -6
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/module/index.js +0 -1
- package/dist/module/index.js.map +1 -1
- 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/translation/localization/ca.json +1 -2
- package/dist/module/shared/translation/localization/de.json +1 -2
- package/dist/module/shared/translation/localization/en.json +1 -2
- package/dist/module/shared/translation/localization/gb.json +1 -2
- package/dist/module/shared/translation/localization/sct.json +1 -2
- package/dist/module/shared/translation/localization/sw.json +1 -2
- package/dist/module/types/common.types.js +0 -2
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +2 -6
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +1 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -3
- 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 +2 -4
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.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 +1 -4
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +0 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +2 -3
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +3 -5
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +3 -4
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +34 -0
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +16 -28
- 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 +11 -14
- 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 +0 -25
- package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts +1 -4
- 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 +1 -2
- 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 +0 -1
- 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 +7 -4
- 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 +0 -1
- 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 +1 -7
- 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 +0 -4
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/helpers.d.ts +0 -1
- package/dist/typescript/commonjs/features/keyboard/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -10
- 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 +0 -36
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +0 -1
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- 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/translation/constants.d.ts +0 -6
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +0 -2
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +0 -2
- 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 +2 -6
- package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +1 -2
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -3
- 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 +2 -4
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.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 +1 -4
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +0 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +2 -3
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +3 -5
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +3 -4
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts +34 -0
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +16 -28
- 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 +11 -14
- 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 +0 -25
- package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts +1 -4
- 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 +1 -2
- 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 +0 -1
- 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 +7 -4
- 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 +0 -1
- 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 +1 -7
- 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 +0 -4
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/helpers.d.ts +0 -1
- package/dist/typescript/module/features/keyboard/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -10
- 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 +0 -36
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +0 -1
- package/dist/typescript/module/index.d.ts.map +1 -1
- 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/translation/constants.d.ts +0 -6
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +0 -2
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +0 -2
- package/dist/typescript/module/types/common.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/features/celebrations/helpers.ts +33 -35
- package/src/features/chatbot/components/Chat/Chat.tsx +22 -48
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +2 -9
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -3
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +3 -25
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +0 -4
- package/src/features/chatbot/components/Chatbot.tsx +2 -19
- package/src/features/chatbot/constants.ts +0 -2
- package/src/features/chatbot/helpers.ts +1 -14
- package/src/features/chatbot/index.ts +2 -17
- package/src/features/chatbot/model/ChatBotModel.ts +13 -51
- package/src/features/chatbot/model/ChatBotThreadManager.ts +4 -12
- package/src/features/chatbot/model/ChatbotApi.ts +1 -1
- package/src/features/chatbot/model/ChatsCacheModel.ts +0 -4
- package/src/features/chatbot/model/t2s.ts +123 -0
- package/src/features/chatbot/types/api.types.ts +19 -25
- package/src/features/chatbot/types/model.types.ts +12 -24
- package/src/features/chatbot/types/t2s.types.ts +0 -33
- package/src/features/feedback/model/model.ts +1 -4
- package/src/features/feedback/model/sockets.ts +6 -8
- package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +3 -4
- package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +2 -2
- package/src/features/keyboard/components/BasicPlusLayout/keyboardGroups.ts +17 -27
- package/src/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.tsx +2 -3
- package/src/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.ts +24 -30
- package/src/features/keyboard/components/Keyboard.tsx +4 -14
- package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -1
- package/src/features/keyboard/components/MainLayout/MainLayout.tsx +6 -2
- package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +1 -1
- package/src/features/keyboard/components/UnitsLayout/helpers.tsx +0 -3
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +22 -36
- package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +0 -11
- package/src/features/keyboard/components/UnitsLayout/types.ts +0 -7
- package/src/features/keyboard/constants/constants.ts +1 -1
- package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +0 -2
- package/src/features/keyboard/constants/keyboardLayouts.ts +1 -18
- package/src/features/keyboard/helpers.ts +0 -6
- package/src/features/keyboard/types/MathKeysGroups/basicOperators.tsx +3 -15
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +0 -3
- package/src/index.ts +0 -1
- package/src/lib/effector/createControllerEffect.ts +1 -1
- package/src/shared/icons/keyboard/CDotIcon/CDotIcon.tsx +2 -2
- package/src/shared/translation/localization/ca.json +1 -2
- package/src/shared/translation/localization/de.json +1 -2
- package/src/shared/translation/localization/en.json +1 -2
- package/src/shared/translation/localization/gb.json +1 -2
- package/src/shared/translation/localization/sct.json +1 -2
- package/src/shared/translation/localization/sw.json +1 -2
- package/src/types/common.types.ts +0 -4
- package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js +0 -29
- package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js +0 -56
- package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js.map +0 -1
- package/dist/commonjs/features/chatbot/model/ChatTTSModel.js +0 -154
- package/dist/commonjs/features/chatbot/model/ChatTTSModel.js.map +0 -1
- package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js +0 -34
- package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js.map +0 -1
- package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js +0 -77
- package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js.map +0 -1
- package/dist/commonjs/features/openEnded/index.js +0 -48
- package/dist/commonjs/features/openEnded/index.js.map +0 -1
- package/dist/commonjs/features/openEnded/oe.helpers.js +0 -26
- package/dist/commonjs/features/openEnded/oe.helpers.js.map +0 -1
- package/dist/commonjs/features/openEnded/oe.types.js +0 -14
- package/dist/commonjs/features/openEnded/oe.types.js.map +0 -1
- package/dist/commonjs/lib/components/ConditionalWrapper.js +0 -23
- package/dist/commonjs/lib/components/ConditionalWrapper.js.map +0 -1
- package/dist/commonjs/shared/common.constants.js +0 -9
- package/dist/commonjs/shared/common.constants.js.map +0 -1
- package/dist/commonjs/shared/icons/TimeIcon.js +0 -37
- package/dist/commonjs/shared/icons/TimeIcon.js.map +0 -1
- package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +0 -32
- package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +0 -1
- package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +0 -32
- package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +0 -1
- package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/dist/module/features/chatbot/helpers/ttsHighlight.js +0 -23
- package/dist/module/features/chatbot/helpers/ttsHighlight.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js +0 -52
- package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js.map +0 -1
- package/dist/module/features/chatbot/model/ChatTTSModel.js +0 -149
- package/dist/module/features/chatbot/model/ChatTTSModel.js.map +0 -1
- package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js +0 -28
- package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js.map +0 -1
- package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js +0 -71
- package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js.map +0 -1
- package/dist/module/features/openEnded/index.js +0 -7
- package/dist/module/features/openEnded/index.js.map +0 -1
- package/dist/module/features/openEnded/oe.helpers.js +0 -21
- package/dist/module/features/openEnded/oe.helpers.js.map +0 -1
- package/dist/module/features/openEnded/oe.types.js +0 -10
- package/dist/module/features/openEnded/oe.types.js.map +0 -1
- package/dist/module/lib/components/ConditionalWrapper.js +0 -17
- package/dist/module/lib/components/ConditionalWrapper.js.map +0 -1
- package/dist/module/shared/common.constants.js +0 -5
- package/dist/module/shared/common.constants.js.map +0 -1
- package/dist/module/shared/icons/TimeIcon.js +0 -29
- package/dist/module/shared/icons/TimeIcon.js.map +0 -1
- package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +0 -24
- package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +0 -1
- package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +0 -24
- package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts +0 -8
- package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts +0 -25
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts +0 -38
- package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +0 -7
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts +0 -12
- package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/openEnded/index.d.ts +0 -5
- package/dist/typescript/commonjs/features/openEnded/index.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts +0 -13
- package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts +0 -7
- package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts.map +0 -1
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +0 -9
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/common.constants.d.ts +0 -2
- package/dist/typescript/commonjs/shared/common.constants.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts +0 -8
- package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts +0 -25
- package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts +0 -38
- package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts.map +0 -1
- package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +0 -7
- package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +0 -1
- package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts +0 -12
- package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +0 -1
- package/dist/typescript/module/features/openEnded/index.d.ts +0 -5
- package/dist/typescript/module/features/openEnded/index.d.ts.map +0 -1
- package/dist/typescript/module/features/openEnded/oe.helpers.d.ts +0 -13
- package/dist/typescript/module/features/openEnded/oe.helpers.d.ts.map +0 -1
- package/dist/typescript/module/features/openEnded/oe.types.d.ts +0 -7
- package/dist/typescript/module/features/openEnded/oe.types.d.ts.map +0 -1
- package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +0 -9
- package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts.map +0 -1
- package/dist/typescript/module/shared/common.constants.d.ts +0 -2
- package/dist/typescript/module/shared/common.constants.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +0 -1
- package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/src/features/chatbot/helpers/ttsHighlight.ts +0 -25
- package/src/features/chatbot/model/ChatTTSHighlightModel.ts +0 -64
- package/src/features/chatbot/model/ChatTTSModel.ts +0 -168
- package/src/features/openEnded/components/OpenEndedAttemptsLimit.tsx +0 -26
- package/src/features/openEnded/components/OpenEndedScoreLabel.tsx +0 -81
- package/src/features/openEnded/index.ts +0 -4
- package/src/features/openEnded/oe.helpers.ts +0 -31
- package/src/features/openEnded/oe.types.ts +0 -6
- package/src/lib/components/ConditionalWrapper.tsx +0 -15
- package/src/shared/common.constants.ts +0 -3
- package/src/shared/icons/TimeIcon.tsx +0 -23
- package/src/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.tsx +0 -18
- package/src/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.tsx +0 -18
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { restore, createEvent, combine } from 'effector'
|
|
2
|
-
import { Timepoint } from '../types/api.types'
|
|
3
|
-
import { OnTimeUpdate } from '../types/t2s.types'
|
|
4
|
-
import { findCurrentMark } from '../helpers/ttsHighlight'
|
|
5
|
-
import { WORD_MARK_REGEX } from '../constants'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Manages word-by-word highlight state during TTS playback.
|
|
9
|
-
* Tracks which word index should be highlighted based on audio timepoints
|
|
10
|
-
* and current playback time from the AudioProvider.
|
|
11
|
-
*/
|
|
12
|
-
export class ChatTTSHighlightModel {
|
|
13
|
-
private lastMark: string | undefined = undefined
|
|
14
|
-
|
|
15
|
-
readonly setTimepoints = createEvent<Timepoint[]>()
|
|
16
|
-
readonly setTime = createEvent<number>()
|
|
17
|
-
readonly setIsActive = createEvent<boolean>()
|
|
18
|
-
readonly reset = createEvent()
|
|
19
|
-
|
|
20
|
-
readonly $time = restore(this.setTime, 0).reset(this.reset)
|
|
21
|
-
readonly $timepoints = restore(this.setTimepoints, []).reset(this.reset)
|
|
22
|
-
readonly $isActive = restore(this.setIsActive, false).reset(this.reset)
|
|
23
|
-
|
|
24
|
-
readonly $highlightedWordIndex = combine(
|
|
25
|
-
this.$timepoints,
|
|
26
|
-
this.$time,
|
|
27
|
-
this.$isActive,
|
|
28
|
-
(timepoints, time, isActive) => {
|
|
29
|
-
if (!isActive || !timepoints.length) return -1
|
|
30
|
-
|
|
31
|
-
const currentMark = findCurrentMark(timepoints, time)
|
|
32
|
-
if (!currentMark) return -1
|
|
33
|
-
|
|
34
|
-
const match = currentMark.match(WORD_MARK_REGEX)
|
|
35
|
-
return match ? parseInt(match[1], 10) : -1
|
|
36
|
-
},
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Sets timepoints and starts listening to AudioProvider time updates.
|
|
41
|
-
* Only triggers store updates when the highlighted word actually changes.
|
|
42
|
-
*/
|
|
43
|
-
activate(timepoints: Timepoint[], onTimeUpdate: OnTimeUpdate) {
|
|
44
|
-
this.setTimepoints(timepoints)
|
|
45
|
-
this.setIsActive(true)
|
|
46
|
-
this.lastMark = undefined
|
|
47
|
-
|
|
48
|
-
onTimeUpdate((time: number) => {
|
|
49
|
-
const currentMark = findCurrentMark(this.$timepoints.getState(), time)
|
|
50
|
-
if (!currentMark) return
|
|
51
|
-
|
|
52
|
-
if (currentMark !== this.lastMark) {
|
|
53
|
-
this.lastMark = currentMark
|
|
54
|
-
this.setTime(time)
|
|
55
|
-
}
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
deactivate(onTimeUpdate: OnTimeUpdate | null) {
|
|
60
|
-
onTimeUpdate?.(null)
|
|
61
|
-
this.lastMark = undefined
|
|
62
|
-
this.reset()
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { restore, createEvent, createEffect, sample, Store } from 'effector'
|
|
2
|
-
import { AUDIO_CONFIG, DEFAULT_VOICE } from '../constants'
|
|
3
|
-
import {
|
|
4
|
-
AudioCache,
|
|
5
|
-
AudioConfig,
|
|
6
|
-
AudioProvider,
|
|
7
|
-
AudioStatus,
|
|
8
|
-
PlayTextToSpeechProps,
|
|
9
|
-
T2SConfig,
|
|
10
|
-
} from '../types/t2s.types'
|
|
11
|
-
|
|
12
|
-
import { ChatItem } from '../types/units.types'
|
|
13
|
-
import { textToSSML } from '../helpers/ttsHighlight'
|
|
14
|
-
import { ChatbotAPI } from './ChatbotApi'
|
|
15
|
-
import { ChatTTSHighlightModel } from './ChatTTSHighlightModel'
|
|
16
|
-
|
|
17
|
-
type ChatTextToSpeechModelProps = {
|
|
18
|
-
api: ChatbotAPI
|
|
19
|
-
$currentChatData: Store<ChatItem>
|
|
20
|
-
$isTranslated: Store<boolean>
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class ChatTTSModel {
|
|
24
|
-
private readonly api: ChatbotAPI
|
|
25
|
-
public readonly wordHighlight = new ChatTTSHighlightModel()
|
|
26
|
-
private readonly audioCache = new Map<string, AudioCache>()
|
|
27
|
-
private readonly $currentChatData
|
|
28
|
-
private readonly $isTranslated
|
|
29
|
-
private audioProvider: AudioProvider | null = null
|
|
30
|
-
private wordHighlightEnabled = false
|
|
31
|
-
|
|
32
|
-
readonly setCurrentPlayingId = createEvent<string | null>()
|
|
33
|
-
readonly $currentPlayingId = restore(this.setCurrentPlayingId, null)
|
|
34
|
-
readonly setStatus = createEvent<AudioStatus>()
|
|
35
|
-
readonly $status = restore(this.setStatus, AudioStatus.STOPPED)
|
|
36
|
-
|
|
37
|
-
private audioConfig: AudioConfig | null = null
|
|
38
|
-
private textSanitizer = (value: string) => value
|
|
39
|
-
|
|
40
|
-
constructor({ api, $currentChatData, $isTranslated }: ChatTextToSpeechModelProps) {
|
|
41
|
-
this.api = api
|
|
42
|
-
this.$currentChatData = $currentChatData
|
|
43
|
-
this.$isTranslated = $isTranslated
|
|
44
|
-
|
|
45
|
-
sample({
|
|
46
|
-
clock: $isTranslated,
|
|
47
|
-
target: this.reset,
|
|
48
|
-
})
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public setAudioConfig(config: AudioConfig | null) {
|
|
52
|
-
this.audioConfig = config
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public setConfig({ audioProvider, textSanitizer, isWordHighlightEnabled }: T2SConfig) {
|
|
56
|
-
if (audioProvider) this.audioProvider = audioProvider
|
|
57
|
-
if (textSanitizer) this.textSanitizer = textSanitizer
|
|
58
|
-
// Highlighting requires audioProvider.onTimeUpdate to sync playback time with word highlights
|
|
59
|
-
this.wordHighlightEnabled = !!isWordHighlightEnabled && !!this.audioProvider?.onTimeUpdate
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
public get isWordHighlightEnabled() {
|
|
63
|
-
return this.wordHighlightEnabled
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
private getCacheKey = (messageId: string, isTranslated: boolean) => {
|
|
67
|
-
return `${messageId}-${isTranslated ? 'translated' : 'original'}`
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
private async fetchAudio(text: string): Promise<AudioCache> {
|
|
71
|
-
const config = this.audioConfig
|
|
72
|
-
const response = await this.api.textToSpeechTextFx({
|
|
73
|
-
input: this.wordHighlightEnabled ? { ssml: textToSSML(text) } : { text },
|
|
74
|
-
voice: config?.voice ?? DEFAULT_VOICE,
|
|
75
|
-
audioConfig: config?.audioConfig ?? AUDIO_CONFIG,
|
|
76
|
-
enableTimePointing: this.wordHighlightEnabled ? ['SSML_MARK'] : [],
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
const audioPath =
|
|
80
|
-
typeof response.audioContent === 'string'
|
|
81
|
-
? `data:audio/mpeg;base64,${response.audioContent}`
|
|
82
|
-
: (response?.audioContent ?? '')
|
|
83
|
-
|
|
84
|
-
return { audioPath, timepoints: response.timepoints ?? [] }
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
public async play({ message, isTranslated }: PlayTextToSpeechProps) {
|
|
88
|
-
if (!this.audioProvider) throw new Error('Audio provider is not set. Use setConfig.')
|
|
89
|
-
const messageText = isTranslated ? message.translatedMessage! : message.message
|
|
90
|
-
const messageId = message.id
|
|
91
|
-
const text = this.textSanitizer(messageText)
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
const status = this.$status.getState()
|
|
95
|
-
const playingId = this.$currentPlayingId.getState()
|
|
96
|
-
const isPlaying = status === AudioStatus.PLAYING
|
|
97
|
-
const isPaused = status === AudioStatus.PAUSED
|
|
98
|
-
const isCurrentMessage = messageId === playingId
|
|
99
|
-
|
|
100
|
-
if (isPlaying && isCurrentMessage) {
|
|
101
|
-
this.audioProvider.pause()
|
|
102
|
-
if (this.wordHighlightEnabled) this.wordHighlight.setIsActive(false)
|
|
103
|
-
this.setStatus(AudioStatus.PAUSED)
|
|
104
|
-
return
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (isPaused && isCurrentMessage) {
|
|
108
|
-
this.audioProvider.resume()
|
|
109
|
-
if (this.wordHighlightEnabled) this.wordHighlight.setIsActive(true)
|
|
110
|
-
this.setStatus(AudioStatus.PLAYING)
|
|
111
|
-
return
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (messageId && !isCurrentMessage) {
|
|
115
|
-
this.audioProvider.stop()
|
|
116
|
-
this.wordHighlight.deactivate(this.audioProvider?.onTimeUpdate ?? null)
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const cacheKey = this.getCacheKey(messageId, isTranslated)
|
|
120
|
-
this.setCurrentPlayingId(messageId)
|
|
121
|
-
|
|
122
|
-
const cached = this.audioCache.get(cacheKey)
|
|
123
|
-
const { audioPath, timepoints } = cached ?? (await this.fetchAudio(text))
|
|
124
|
-
|
|
125
|
-
if (!cached) {
|
|
126
|
-
this.audioCache.set(cacheKey, { audioPath, timepoints })
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (this.wordHighlightEnabled && this.audioProvider?.onTimeUpdate && timepoints.length > 0) {
|
|
130
|
-
this.wordHighlight.activate(timepoints, this.audioProvider.onTimeUpdate)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
this.setStatus(AudioStatus.PLAYING)
|
|
134
|
-
await this.audioProvider.play(audioPath, () => {
|
|
135
|
-
this.onPlaybackComplete()
|
|
136
|
-
})
|
|
137
|
-
} catch (error) {
|
|
138
|
-
void this.reset()
|
|
139
|
-
console.error('Error playing text-to-speech: ', error)
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
public async playLatest() {
|
|
144
|
-
const lastMessage = this.$currentChatData.getState().messages.at(-1)
|
|
145
|
-
if (!lastMessage) return
|
|
146
|
-
|
|
147
|
-
const isTranslated = this.$isTranslated.getState()
|
|
148
|
-
return this.play({ message: lastMessage, isTranslated })
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
private onPlaybackComplete = () => {
|
|
152
|
-
this.setStatus(AudioStatus.STOPPED)
|
|
153
|
-
this.setCurrentPlayingId(null)
|
|
154
|
-
this.wordHighlight.deactivate(this.audioProvider?.onTimeUpdate ?? null)
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
public stop() {
|
|
158
|
-
if (!this.audioProvider) throw new Error('Audio provider is not set. Use setAudioProvider.')
|
|
159
|
-
this.audioProvider.stop()
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
public readonly reset = createEffect(() => {
|
|
163
|
-
this.stop()
|
|
164
|
-
this.setStatus(AudioStatus.STOPPED)
|
|
165
|
-
this.setCurrentPlayingId(null)
|
|
166
|
-
this.wordHighlight.deactivate(this.audioProvider?.onTimeUpdate ?? null)
|
|
167
|
-
})
|
|
168
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, StyleSheet, Text } from 'react-native'
|
|
3
|
-
import { SPACING, BORDER_RADIUS, COLORS } from '@magmamath/react-native-ui'
|
|
4
|
-
|
|
5
|
-
type OEAttemptsLimitProps = {
|
|
6
|
-
text: string
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const OpenEndedAttemptsLimit = ({ text }: OEAttemptsLimitProps) => (
|
|
10
|
-
<View style={styles.container}>
|
|
11
|
-
<Text style={styles.text}>{text}</Text>
|
|
12
|
-
</View>
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
const styles = StyleSheet.create({
|
|
16
|
-
container: {
|
|
17
|
-
paddingVertical: SPACING[50],
|
|
18
|
-
paddingHorizontal: SPACING[200],
|
|
19
|
-
borderRadius: BORDER_RADIUS[300],
|
|
20
|
-
backgroundColor: COLORS.PRIMARY_RED,
|
|
21
|
-
},
|
|
22
|
-
text: {
|
|
23
|
-
fontSize: 14,
|
|
24
|
-
color: COLORS.NEUTRAL_1,
|
|
25
|
-
},
|
|
26
|
-
})
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { View, StyleSheet } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
Typography,
|
|
5
|
-
HeadingVariants,
|
|
6
|
-
SPACING,
|
|
7
|
-
BORDER_RADIUS,
|
|
8
|
-
COLORS,
|
|
9
|
-
} from '@magmamath/react-native-ui'
|
|
10
|
-
import { getScoreLabelColor } from '../oe.helpers'
|
|
11
|
-
import { OpenEndedScoreLabelVariant } from '../oe.types'
|
|
12
|
-
import { isWeb } from '../../../shared/common.constants'
|
|
13
|
-
|
|
14
|
-
type OpenEndedScoreLabelProps = {
|
|
15
|
-
label: string
|
|
16
|
-
score: number | null
|
|
17
|
-
maxScore: number
|
|
18
|
-
disabled: boolean
|
|
19
|
-
variant: OpenEndedScoreLabelVariant
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const SCORE_WIDTH = {
|
|
23
|
-
DEFAULT: isWeb ? 20 : 26,
|
|
24
|
-
LARGE: isWeb ? 26 : 30,
|
|
25
|
-
} as const
|
|
26
|
-
|
|
27
|
-
export const OpenEndedScoreLabel = ({
|
|
28
|
-
label,
|
|
29
|
-
score,
|
|
30
|
-
maxScore,
|
|
31
|
-
disabled,
|
|
32
|
-
variant,
|
|
33
|
-
}: OpenEndedScoreLabelProps) => {
|
|
34
|
-
const colors = getScoreLabelColor({ variant, disabled })
|
|
35
|
-
const scoreContainerWidth =
|
|
36
|
-
score !== null && score >= 10 ? SCORE_WIDTH.LARGE : SCORE_WIDTH.DEFAULT
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<View style={styles.container}>
|
|
40
|
-
<View style={[styles.score, { width: scoreContainerWidth }]}>
|
|
41
|
-
<Typography
|
|
42
|
-
variant={HeadingVariants.H3}
|
|
43
|
-
style={[styles.scoreText, { color: colors.score }]}
|
|
44
|
-
>
|
|
45
|
-
{score}
|
|
46
|
-
</Typography>
|
|
47
|
-
</View>
|
|
48
|
-
<Typography
|
|
49
|
-
variant={HeadingVariants.H3}
|
|
50
|
-
style={[styles.maxScoreText, { color: colors.maxScore }]}
|
|
51
|
-
>
|
|
52
|
-
/ {maxScore} {label}
|
|
53
|
-
</Typography>
|
|
54
|
-
</View>
|
|
55
|
-
)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const styles = StyleSheet.create({
|
|
59
|
-
container: {
|
|
60
|
-
alignItems: 'center',
|
|
61
|
-
flexDirection: 'row',
|
|
62
|
-
},
|
|
63
|
-
score: {
|
|
64
|
-
flexDirection: 'row',
|
|
65
|
-
alignItems: 'center',
|
|
66
|
-
justifyContent: 'center',
|
|
67
|
-
height: 32,
|
|
68
|
-
borderWidth: 1,
|
|
69
|
-
borderRadius: BORDER_RADIUS[200],
|
|
70
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
71
|
-
paddingVertical: isWeb ? SPACING[50] : 0,
|
|
72
|
-
paddingHorizontal: SPACING[100],
|
|
73
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
74
|
-
},
|
|
75
|
-
scoreText: {
|
|
76
|
-
textAlign: 'center',
|
|
77
|
-
},
|
|
78
|
-
maxScoreText: {
|
|
79
|
-
marginLeft: SPACING[200],
|
|
80
|
-
},
|
|
81
|
-
})
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { COLORS } from '@magmamath/react-native-ui'
|
|
2
|
-
import { ColorValue } from '../../types/common.types'
|
|
3
|
-
import { OpenEndedScoreLabelVariant } from './oe.types'
|
|
4
|
-
|
|
5
|
-
type GetScoreLabelColorProps = {
|
|
6
|
-
variant: OpenEndedScoreLabelVariant
|
|
7
|
-
disabled: boolean
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
type ScoreLabelColors = {
|
|
11
|
-
score: ColorValue
|
|
12
|
-
maxScore: ColorValue
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const scoreVariantToColor = (variant: OpenEndedScoreLabelVariant): ColorValue => {
|
|
16
|
-
const colors: Record<OpenEndedScoreLabelVariant, ColorValue> = {
|
|
17
|
-
[OpenEndedScoreLabelVariant.CORRECT]: COLORS.PRIMARY_YELLOW,
|
|
18
|
-
[OpenEndedScoreLabelVariant.FIRST_ATTEMPT]: COLORS.PRIMARY_GREEN,
|
|
19
|
-
[OpenEndedScoreLabelVariant.WRONG]: COLORS.PRIMARY_RED,
|
|
20
|
-
[OpenEndedScoreLabelVariant.DEFAULT]: COLORS.PRIMARY_BLUE,
|
|
21
|
-
}
|
|
22
|
-
return colors[variant] ?? COLORS.PRIMARY_BLUE
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const getScoreLabelColor = ({
|
|
26
|
-
variant,
|
|
27
|
-
disabled,
|
|
28
|
-
}: GetScoreLabelColorProps): ScoreLabelColors => ({
|
|
29
|
-
score: disabled ? COLORS.NEUTRAL_6 : COLORS.NEUTRAL_9,
|
|
30
|
-
maxScore: disabled ? COLORS.NEUTRAL_6 : scoreVariantToColor(variant),
|
|
31
|
-
})
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { ComponentType, PropsWithChildren, ReactNode } from 'react'
|
|
2
|
-
|
|
3
|
-
type ConditionalWrapperProps = {
|
|
4
|
-
children: ReactNode
|
|
5
|
-
withWrapper?: boolean
|
|
6
|
-
Wrapper?: ComponentType<PropsWithChildren>
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const ConditionalWrapper = ({ withWrapper, Wrapper, children }: ConditionalWrapperProps) => {
|
|
10
|
-
if (withWrapper && Wrapper) {
|
|
11
|
-
return <Wrapper>{children}</Wrapper>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
return children
|
|
15
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { COLORS } from '@magmamath/react-native-ui'
|
|
2
|
-
import { IconProps } from './icon.types'
|
|
3
|
-
import Svg, { Path } from 'react-native-svg'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
|
|
6
|
-
export const TimeIcon = ({ size = 20, color = COLORS.NEUTRAL_9 }: IconProps) => {
|
|
7
|
-
return (
|
|
8
|
-
<Svg width={size} height={size} viewBox="0 0 17 17" fill="none">
|
|
9
|
-
<Path
|
|
10
|
-
fillRule="evenodd"
|
|
11
|
-
clipRule="evenodd"
|
|
12
|
-
d="M7.84 1.5C4.33851 1.5 1.5 4.33851 1.5 7.84C1.5 11.3415 4.33851 14.18 7.84 14.18C11.3415 14.18 14.18 11.3415 14.18 7.84C14.18 4.33851 11.3415 1.5 7.84 1.5ZM0 7.84C0 3.51009 3.51009 0 7.84 0C12.1699 0 15.68 3.51009 15.68 7.84C15.68 12.1699 12.1699 15.68 7.84 15.68C3.51009 15.68 0 12.1699 0 7.84Z"
|
|
13
|
-
fill={color}
|
|
14
|
-
/>
|
|
15
|
-
<Path
|
|
16
|
-
fillRule="evenodd"
|
|
17
|
-
clipRule="evenodd"
|
|
18
|
-
d="M7.83999 3.0826C8.2542 3.0826 8.58999 3.41839 8.58999 3.8326V7.8033L10.4859 9.42838C10.8004 9.69794 10.8368 10.1714 10.5673 10.4859C10.2977 10.8004 9.82421 10.8368 9.50972 10.5673L7.57539 8.90926C7.2673 8.64519 7.08999 8.25967 7.08999 7.85389V3.8326C7.08999 3.41839 7.42578 3.0826 7.83999 3.0826Z"
|
|
19
|
-
fill={color}
|
|
20
|
-
/>
|
|
21
|
-
</Svg>
|
|
22
|
-
)
|
|
23
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { IconProps } from '../../icon.types'
|
|
3
|
-
import Svg, { Path } from 'react-native-svg'
|
|
4
|
-
|
|
5
|
-
const ASPECT_RATIO = 5 / 14
|
|
6
|
-
|
|
7
|
-
export const RoundBracketLeftIcon = ({ size = 20, color }: IconProps) => {
|
|
8
|
-
return (
|
|
9
|
-
<Svg width={size * ASPECT_RATIO} height={size} viewBox="0 0 5 14" fill="none">
|
|
10
|
-
<Path
|
|
11
|
-
fillRule="evenodd"
|
|
12
|
-
clipRule="evenodd"
|
|
13
|
-
d="M3.90533 0.21967C4.19823 0.512563 4.19823 0.987437 3.90533 1.28033C0.67361 4.51206 0.736927 10.001 3.8631 12.6806C4.17759 12.9501 4.21401 13.4236 3.94445 13.7381C3.67488 14.0526 3.20141 14.089 2.88691 13.8194C-0.986916 10.499 -0.923598 3.98794 2.84467 0.21967C3.13757 -0.0732233 3.61244 -0.0732233 3.90533 0.21967Z"
|
|
14
|
-
fill={color}
|
|
15
|
-
/>
|
|
16
|
-
</Svg>
|
|
17
|
-
)
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { IconProps } from '../../icon.types'
|
|
3
|
-
import Svg, { Path } from 'react-native-svg'
|
|
4
|
-
|
|
5
|
-
const ASPECT_RATIO = 5 / 14
|
|
6
|
-
|
|
7
|
-
export const RoundBracketRightIcon = ({ size = 20, color }: IconProps) => {
|
|
8
|
-
return (
|
|
9
|
-
<Svg width={size * ASPECT_RATIO} height={size} viewBox="0 0 5 14" fill="none">
|
|
10
|
-
<Path
|
|
11
|
-
fillRule="evenodd"
|
|
12
|
-
clipRule="evenodd"
|
|
13
|
-
d="M0.219696 0.21967C-0.0731974 0.512563 -0.0731974 0.987437 0.219696 1.28033C3.45142 4.51206 3.3881 10.001 0.261932 12.6806C-0.0525622 12.9501 -0.0889835 13.4236 0.180583 13.7381C0.45015 14.0526 0.923625 14.089 1.23812 13.8194C5.11195 10.499 5.04863 3.98794 1.28036 0.21967C0.987463 -0.0732233 0.512589 -0.0732233 0.219696 0.21967Z"
|
|
14
|
-
fill={color}
|
|
15
|
-
/>
|
|
16
|
-
</Svg>
|
|
17
|
-
)
|
|
18
|
-
}
|