@magmamath/students-features 0.10.0 → 0.11.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/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 +66 -30
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +61 -0
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +44 -54
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +3 -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/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 +12 -20
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -8
- 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 +29 -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 +59 -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/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/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 +2 -1
- package/dist/commonjs/shared/translation/localization/de.json +2 -1
- package/dist/commonjs/shared/translation/localization/en.json +2 -1
- package/dist/commonjs/shared/translation/localization/gb.json +2 -1
- package/dist/commonjs/shared/translation/localization/sct.json +2 -1
- package/dist/commonjs/shared/translation/localization/sw.json +2 -1
- 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 +66 -30
- package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/module/features/chatbot/components/Chat/CloseButton.js +55 -0
- package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +44 -55
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +3 -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/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 +12 -20
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -8
- 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 +27 -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 +59 -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/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/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 +2 -1
- package/dist/module/shared/translation/localization/de.json +2 -1
- package/dist/module/shared/translation/localization/en.json +2 -1
- package/dist/module/shared/translation/localization/gb.json +2 -1
- package/dist/module/shared/translation/localization/sct.json +2 -1
- package/dist/module/shared/translation/localization/sw.json +2 -1
- 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/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/ChatMessage.d.ts +3 -1
- 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 +1 -6
- 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 +4 -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/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 +14 -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 +6 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -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/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/ChatMessage.d.ts +3 -1
- 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 +1 -6
- 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 +4 -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/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 +14 -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 +6 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +2 -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 +1 -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 +76 -33
- package/src/features/chatbot/components/Chat/CloseButton.tsx +60 -0
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +45 -60
- package/src/features/chatbot/components/ChatInput/ChatInput.tsx +3 -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/ChatMessage.tsx +3 -1
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +25 -3
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +9 -21
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +11 -6
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
- package/src/features/chatbot/components/Chatbot.tsx +28 -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 +67 -16
- package/src/features/chatbot/model/ChatBotThreadManager.ts +12 -4
- 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/ChatsCacheModel.ts +11 -0
- package/src/features/chatbot/types/api.types.ts +25 -19
- package/src/features/chatbot/types/model.types.ts +23 -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 +2 -1
- package/src/shared/translation/localization/de.json +2 -1
- package/src/shared/translation/localization/en.json +2 -1
- package/src/shared/translation/localization/gb.json +2 -1
- package/src/shared/translation/localization/sct.json +2 -1
- package/src/shared/translation/localization/sw.json +2 -1
- 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
|
@@ -13,7 +13,10 @@ const isDateInRange = (currentDate, startDateStr, endDateStr) => {
|
|
|
13
13
|
const [endDay, endMonth] = endDateStr.split('-').map(Number);
|
|
14
14
|
const currentYear = currentDate.getFullYear();
|
|
15
15
|
const startDate = new Date(currentYear, startMonth - 1, startDay);
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
// If end month is earlier than start month, it spans to next year
|
|
18
|
+
const endYear = endMonth < startMonth ? currentYear + 1 : currentYear;
|
|
19
|
+
const endDate = new Date(endYear, endMonth - 1, endDay + 1);
|
|
17
20
|
return currentDate >= startDate && currentDate <= endDate;
|
|
18
21
|
};
|
|
19
22
|
const getIconForCurrentDate = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_Spark","require","_config","randomRange","min","max","Math","random","exports","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endDate","getIconForCurrentDate","celebration","CELEBRATION_ICON_CONFIG","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","CELEBRATION_VARIANTS","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","Spark","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;
|
|
1
|
+
{"version":3,"names":["_Spark","require","_config","randomRange","min","max","Math","random","exports","isDateInRange","currentDate","startDateStr","endDateStr","startDay","startMonth","split","map","Number","endDay","endMonth","currentYear","getFullYear","startDate","Date","endYear","endDate","getIconForCurrentDate","celebration","CELEBRATION_ICON_CONFIG","activePeriod","start","end","Icon","MainIcon","generateParticle","variant","elementsCount","angle","rotation","sparkSize","mainSize","velocityMultiplier","friction","life","angularAcceleration","speedRange","CELEBRATION_VARIANTS","sparkSpeedMin","spark","sparkSpeedMax","mainSpeedMin","main","mainSpeedMax","particles","i","randomAngle","from","PI","to","randomSpeed","randomAngularAcceleration","push","id","size","type","velocity","x","cos","y","sin","rotationSpeed","Component","Spark","star"],"sourceRoot":"../../../../src","sources":["features/celebrations/helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAGO,MAAME,WAAW,GAAGA,CAACC,GAAW,EAAEC,GAAW,KAAKC,IAAI,CAACC,MAAM,CAAC,CAAC,IAAIF,GAAG,GAAGD,GAAG,CAAC,GAAGA,GAAG;AAAAI,OAAA,CAAAL,WAAA,GAAAA,WAAA;AAE1F,MAAMM,aAAa,GAAGA,CAACC,WAAiB,EAAEC,YAAoB,EAAEC,UAAkB,KAAK;EACrF,MAAM,CAACC,QAAQ,EAAEC,UAAU,CAAC,GAAGH,YAAY,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,MAAM,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGP,UAAU,CAACG,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAE5D,MAAMG,WAAW,GAAGV,WAAW,CAACW,WAAW,CAAC,CAAC;EAC7C,MAAMC,SAAS,GAAG,IAAIC,IAAI,CAACH,WAAW,EAAEN,UAAU,GAAG,CAAC,EAAED,QAAQ,CAAC;;EAEjE;EACA,MAAMW,OAAO,GAAGL,QAAQ,GAAGL,UAAU,GAAGM,WAAW,GAAG,CAAC,GAAGA,WAAW;EACrE,MAAMK,OAAO,GAAG,IAAIF,IAAI,CAACC,OAAO,EAAEL,QAAQ,GAAG,CAAC,EAAED,MAAM,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AGxD,WAAW,CAAC+C,YAAY,EAAEE,YAAY,CAAC;IAC3D,MAAMQ,yBAAyB,GAAGzD,WAAW,CAACyC,mBAAmB,CAACY,IAAI,EAAEZ,mBAAmB,CAACc,EAAE,CAAC;IAE/FL,SAAS,CAACQ,IAAI,CAAC;MACbC,EAAE,EAAExD,IAAI,CAACC,MAAM,CAAC,CAAC;MACjBwD,IAAI,EAAE5D,WAAW,CAACqC,QAAQ,CAACgB,IAAI,EAAEhB,QAAQ,CAACkB,EAAE,CAAC;MAC7CM,IAAI,EAAE,MAAM;MACZ3B,KAAK,EAAEkB,WAAW;MAClBU,QAAQ,EAAE;QACRC,CAAC,EAAE5D,IAAI,CAAC6D,GAAG,CAACZ,WAAW,CAAC,GAAGI,WAAW,GAAGlB,kBAAkB;QAC3D2B,CAAC,EAAE9D,IAAI,CAAC+D,GAAG,CAACd,WAAW,CAAC,GAAGI;MAC7B,CAAC;MACDrB,QAAQ,EAAEnC,WAAW,CAACmC,QAAQ,CAACkB,IAAI,EAAElB,QAAQ,CAACoB,EAAE,CAAC;MACjDY,aAAa,EAAEnE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;MACjCyC,mBAAmB,EAAEgB,yBAAyB;MAC9ClB,QAAQ;MACR6B,SAAS,EAAEtC,QAAQ;MACnBU;IACF,CAAC,CAAC;EACJ;EAEA,OAAOU,SAAS;AAClB,CAAC;AAAA7C,OAAA,CAAA0B,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# TTS Word-by-Word Highlighting
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Word-by-word text highlighting synchronized with text-to-speech playback in the chatbot. The feature is optional and enabled via `isWordHighlightEnabled` config flag.
|
|
6
|
+
|
|
7
|
+
## How It Works
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
11
|
+
│ 1. User clicks TTS button on a message │
|
|
12
|
+
│ ↓ │
|
|
13
|
+
│ 2. Text is converted to SSML with word marks │
|
|
14
|
+
│ "Hello world" → <speak><mark name="w_0"/>Hello │
|
|
15
|
+
│ <mark name="w_1"/>world</speak> │
|
|
16
|
+
│ ↓ │
|
|
17
|
+
│ 3. Google TTS API returns audio + timepoints │
|
|
18
|
+
│ [{ markName: "w_0", timeSeconds: 0.0 }, │
|
|
19
|
+
│ { markName: "w_1", timeSeconds: 0.5 }] │
|
|
20
|
+
│ ↓ │
|
|
21
|
+
│ 4. Audio plays, onTimeUpdate fires via RAF loop │
|
|
22
|
+
│ ↓ │
|
|
23
|
+
│ 5. Current time → find matching timepoint → word index │
|
|
24
|
+
│ ↓ │
|
|
25
|
+
│ 6. $highlightedWordIndex updates → UI re-renders highlighted │
|
|
26
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// In students-web model setup
|
|
33
|
+
chatModel.bot.setUpT2S({
|
|
34
|
+
audioProvider: createT2SAudioProvider(),
|
|
35
|
+
textSanitizer: removeKatexPartFromTextToSpeech,
|
|
36
|
+
isWordHighlightEnabled: true,
|
|
37
|
+
})
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Architecture
|
|
41
|
+
|
|
42
|
+
### ChatTTSModel (ChatTTSModel.ts)
|
|
43
|
+
|
|
44
|
+
Handles TTS playback and word highlighting. Key design decisions:
|
|
45
|
+
|
|
46
|
+
- **Map-based cache** — `audioCache: Map<string, AudioCache>` stores both `audioPath` and `timepoints` per message. When highlighting is off, `timepoints` is `[]`. Cache lives for the model's lifetime (cleared when user leaves the problem).
|
|
47
|
+
- **`fetchAudio()` method** — encapsulates API call + audioContent decoding. Highlight vs non-highlight differences are ternaries (SSML vs plain text, `enableTimePointing`).
|
|
48
|
+
- **`play()` is linear** — cache lookup → fetch if miss → store → activate highlight if enabled → play audio. No branching between highlight/non-highlight paths.
|
|
49
|
+
- **Pause/resume guards** — `wordHighlightEnabled` check before toggling `setIsActive(false)`/`setIsActive(true)` on pause/resume.
|
|
50
|
+
- **`wordHighlightEnabled` (private)** — stored result of `!!isWordHighlightEnabled && !!audioProvider.onTimeUpdate`. Set once at `setConfig`.
|
|
51
|
+
- **`isWordHighlightEnabled` (public getter)** — read-only access for external consumers (e.g. `Chat.tsx`).
|
|
52
|
+
|
|
53
|
+
### AudioProvider type
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
type AudioProvider = {
|
|
57
|
+
play: (audioPath: string, onPlaybackComplete: () => void) => Promise<void>
|
|
58
|
+
pause: () => void
|
|
59
|
+
resume: () => void
|
|
60
|
+
stop: () => void
|
|
61
|
+
onTimeUpdate?: OnTimeUpdate // optional — presence enables highlight capability
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
`onTimeUpdate` is optional. It's the mechanism that syncs audio playback time with word highlights via a RAF loop. If the provider doesn't have it, highlighting won't activate even if `isWordHighlightEnabled: true`.
|
|
66
|
+
|
|
67
|
+
### ChatTTSHighlightModel (ChatTTSHighlightModel.ts)
|
|
68
|
+
|
|
69
|
+
Manages highlight state using Effector stores with declarative reset. Receives `OnTimeUpdate` callback directly (not the whole `AudioProvider`).
|
|
70
|
+
|
|
71
|
+
- **`$isActive`** — gates `$highlightedWordIndex` computation. Toggled on pause/resume without resetting timepoints.
|
|
72
|
+
- **`$highlightedWordIndex`** — derived store, returns `-1` when inactive or no match. Parses mark name via `WORD_MARK_REGEX`.
|
|
73
|
+
- **`activate(timepoints, onTimeUpdate)`** — sets timepoints, enables highlighting, registers time update callback. Only triggers store updates when the highlighted word actually changes (`lastMark` comparison).
|
|
74
|
+
- **`deactivate(onTimeUpdate)`** — stops listening, resets all state via declarative `.reset()` chain.
|
|
75
|
+
- **All stores use `.reset(this.reset)`** — single `reset` event clears `$time`, `$timepoints`, and `$isActive`.
|
|
76
|
+
|
|
77
|
+
### Helpers (helpers/ttsHighlight.ts)
|
|
78
|
+
|
|
79
|
+
- **`textToSSML(text)`** — converts plain text to SSML with `<mark>` tags for word timing.
|
|
80
|
+
- **`findCurrentMark(timepoints, time)`** — iterates backwards through timepoints to find the current mark. Efficient for linear playback.
|
|
81
|
+
|
|
82
|
+
### Constants (constants.ts)
|
|
83
|
+
|
|
84
|
+
- **`WORD_MARK_REGEX`** — `/^w_(\d+)$/` — extracts word index from mark names like `w_0`, `w_1`.
|
|
85
|
+
|
|
86
|
+
### Naming conventions
|
|
87
|
+
|
|
88
|
+
| Name | Scope | Purpose |
|
|
89
|
+
|------|-------|---------|
|
|
90
|
+
| `wordHighlight` | public instance | `ChatTTSHighlightModel` instance on `ChatTTSModel` |
|
|
91
|
+
| `wordHighlightEnabled` | private field | Whether highlighting is active (set once at config) |
|
|
92
|
+
| `isWordHighlightEnabled` | public getter | Read-only access to `wordHighlightEnabled` for external consumers |
|
|
93
|
+
| `isWordHighlightEnabled` | T2SConfig field | Config flag passed to `setUpT2S()` |
|
|
94
|
+
|
|
95
|
+
## Data Flow
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
AudioProvider.onTimeUpdate(callback)
|
|
99
|
+
↓
|
|
100
|
+
ChatTTSHighlightModel.activate(timepoints, onTimeUpdate)
|
|
101
|
+
↓
|
|
102
|
+
RAF loop → audio.currentTime → findCurrentMark() → only updates when mark changes
|
|
103
|
+
↓
|
|
104
|
+
$highlightedWordIndex = parse mark name "w_N" → N (or -1 if inactive/no match)
|
|
105
|
+
↓
|
|
106
|
+
Chat.tsx: model.t2s.isWordHighlightEnabled && isPlayingMessage ? highlightedWordIndex : -1
|
|
107
|
+
↓
|
|
108
|
+
ChatMessage → MessageContent → TTSHighlightRenderer({ text, highlightedIndex })
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Key Files
|
|
112
|
+
|
|
113
|
+
| File | Purpose |
|
|
114
|
+
|------|---------|
|
|
115
|
+
| `model/ChatTTSModel.ts` | `ChatTTSModel` — TTS playback, caching, highlight orchestration |
|
|
116
|
+
| `model/ChatTTSHighlightModel.ts` | Highlight state — timepoints, current time, `$isActive`, derived word index |
|
|
117
|
+
| `helpers/ttsHighlight.ts` | `textToSSML` + `findCurrentMark` — SSML conversion and playback position lookup |
|
|
118
|
+
| `constants.ts` | `WORD_MARK_REGEX` and audio config defaults |
|
|
119
|
+
| `types/t2s.types.ts` | `AudioProvider`, `OnTimeUpdate`, `AudioStatus`, `AudioCache`, `TTSHighlightRendererProps` types |
|
|
120
|
+
| `components/Chat/Chat.tsx` | Reads `isWordHighlightEnabled` and `$highlightedWordIndex`, passes to messages |
|
|
@@ -7,11 +7,14 @@ exports.Chat = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _effectorReact = require("effector-react");
|
|
10
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
11
|
var _ChatMessage = require("../ChatMessage/ChatMessage.js");
|
|
11
12
|
var _MessageLoader = require("../ChatMessage/MessageLoader.js");
|
|
12
13
|
var _ChatInput = require("../ChatInput/ChatInput.js");
|
|
14
|
+
var _CloseButton = require("./CloseButton.js");
|
|
13
15
|
var _modelTypes = require("../../types/model.types.js");
|
|
14
16
|
var _styleTypes = require("../../types/style.types.js");
|
|
17
|
+
var _ConditionalWrapper = require("../../../../lib/components/ConditionalWrapper.js");
|
|
15
18
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -24,61 +27,86 @@ const Chat = ({
|
|
|
24
27
|
model,
|
|
25
28
|
isHintFeedback,
|
|
26
29
|
isTextToSpeechEnabled,
|
|
27
|
-
|
|
30
|
+
isInputDisabled,
|
|
31
|
+
colorScheme = _styleTypes.ColorScheme.Blue,
|
|
32
|
+
MessageWrapper,
|
|
33
|
+
TTSHighlightRenderer,
|
|
34
|
+
onPressClose
|
|
28
35
|
}) => {
|
|
29
36
|
const dimensions = (0, _reactNative.useWindowDimensions)();
|
|
30
37
|
const ref = (0, _react.useRef)(null);
|
|
31
38
|
const isOpen = (0, _effectorReact.useUnit)(model.$isOpen);
|
|
32
39
|
const isHelpRequestPending = (0, _effectorReact.useUnit)(model.sendHelpRequestFx.pending);
|
|
33
40
|
const isTextToSpeechPending = (0, _effectorReact.useUnit)(model.api.textToSpeechTextFx.pending);
|
|
41
|
+
const audioStatus = (0, _effectorReact.useUnit)(model.t2s.$status);
|
|
34
42
|
const currentPlayingId = (0, _effectorReact.useUnit)(model.t2s.$currentPlayingId);
|
|
43
|
+
const highlightedWordIndex = (0, _effectorReact.useUnit)(model.t2s.wordHighlight.$highlightedWordIndex);
|
|
44
|
+
const isScrollActive = (0, _effectorReact.useUnit)(model.$isScrollActive);
|
|
35
45
|
const isTranslated = (0, _effectorReact.useUnit)(model.translation.$isTranslated);
|
|
36
|
-
const audioStatus = (0, _effectorReact.useUnit)(model.t2s.$status);
|
|
37
46
|
const errorSpottingEnabled = (0, _effectorReact.useUnit)(model.errorSpotting.$isEnabled);
|
|
38
47
|
const messages = (0, _effectorReact.useStoreMap)(model.$currentChatData, ({
|
|
39
48
|
messages
|
|
40
49
|
}) => messages);
|
|
41
50
|
const lastMessageId = messages.at(-1)?.id;
|
|
42
51
|
const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET;
|
|
43
|
-
|
|
52
|
+
const shouldWrapMessage = MessageWrapper && isInputDisabled && messages.length === 1;
|
|
53
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
44
54
|
style: [styles.container, {
|
|
45
55
|
maxHeight: MAX_HEIGHT
|
|
46
56
|
}],
|
|
47
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
57
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
48
58
|
ref: ref,
|
|
49
59
|
bounces: false,
|
|
50
60
|
contentContainerStyle: styles.list,
|
|
51
61
|
onContentSizeChange: (_, height) => {
|
|
52
|
-
|
|
62
|
+
if (messages.length > 1) {
|
|
63
|
+
ref.current?.scrollToEnd();
|
|
64
|
+
}
|
|
53
65
|
if (height >= MAX_HEIGHT) {
|
|
54
66
|
model.setScrollActive(true);
|
|
55
67
|
}
|
|
56
68
|
},
|
|
57
|
-
children:
|
|
58
|
-
style: styles.gap,
|
|
59
|
-
children: [messages.map(message
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
children: isOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
70
|
+
style: [styles.gap, isInputDisabled && styles.messagesWithoutInput],
|
|
71
|
+
children: [messages.map((message, index) => {
|
|
72
|
+
const key = `${message.id}-${index}`;
|
|
73
|
+
const isPlayingMessage = message.id === currentPlayingId;
|
|
74
|
+
const messageHighlightIndex = model.t2s.isWordHighlightEnabled && isPlayingMessage ? highlightedWordIndex : -1;
|
|
75
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
76
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ConditionalWrapper.ConditionalWrapper, {
|
|
77
|
+
withWrapper: shouldWrapMessage,
|
|
78
|
+
Wrapper: MessageWrapper,
|
|
79
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatMessage.ChatMessage, {
|
|
80
|
+
isTranslated: isTranslated,
|
|
81
|
+
withIcon: !message.isOwnMessage && message.id === lastMessageId,
|
|
82
|
+
message: message,
|
|
83
|
+
variant: message.isOwnMessage ? _modelTypes.MessageVariant.SENT : _modelTypes.MessageVariant.RECEIVED,
|
|
84
|
+
colorScheme: colorScheme,
|
|
85
|
+
withErrorSpotting: errorSpottingEnabled && !message.isOwnMessage,
|
|
86
|
+
highlightedWordIndex: messageHighlightIndex,
|
|
87
|
+
TTSHighlightRenderer: TTSHighlightRenderer,
|
|
88
|
+
t2sState: {
|
|
89
|
+
isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
|
|
90
|
+
isActive: isPlayingMessage,
|
|
91
|
+
isLoading: isTextToSpeechPending,
|
|
92
|
+
status: audioStatus,
|
|
93
|
+
disabled: isTextToSpeechPending
|
|
94
|
+
}
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
}, key);
|
|
98
|
+
}), isHelpRequestPending && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageLoader.MessageLoader, {})]
|
|
99
|
+
})
|
|
100
|
+
}), isOpen && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
101
|
+
style: styles.inputRow,
|
|
102
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseButton.CloseButton, {
|
|
103
|
+
onPress: onPressClose
|
|
104
|
+
}), !isInputDisabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatInput.ChatInput, {
|
|
77
105
|
isHintFeedback: isHintFeedback,
|
|
78
106
|
colorScheme: colorScheme,
|
|
79
107
|
hasMessages: messages.length > 1
|
|
80
108
|
})]
|
|
81
|
-
})
|
|
109
|
+
})]
|
|
82
110
|
});
|
|
83
111
|
};
|
|
84
112
|
exports.Chat = Chat;
|
|
@@ -87,16 +115,24 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
87
115
|
flex: 1,
|
|
88
116
|
alignItems: 'flex-end',
|
|
89
117
|
width: 378,
|
|
90
|
-
height: '100%'
|
|
118
|
+
height: '100%',
|
|
119
|
+
paddingRight: _reactNativeUi.SPACING['200']
|
|
91
120
|
},
|
|
92
121
|
list: {
|
|
93
122
|
alignItems: 'flex-end',
|
|
94
|
-
paddingVertical: 2
|
|
95
|
-
|
|
123
|
+
paddingVertical: 2
|
|
124
|
+
},
|
|
125
|
+
messagesWithoutInput: {
|
|
126
|
+
marginBottom: _reactNativeUi.SPACING['200']
|
|
127
|
+
},
|
|
128
|
+
inputRow: {
|
|
129
|
+
flexDirection: 'row',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
gap: _reactNativeUi.SPACING['200']
|
|
96
132
|
},
|
|
97
133
|
gap: {
|
|
98
134
|
flex: 1,
|
|
99
|
-
gap:
|
|
135
|
+
gap: _reactNativeUi.SPACING['200']
|
|
100
136
|
}
|
|
101
137
|
});
|
|
102
138
|
//# sourceMappingURL=Chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_effectorReact","_ChatMessage","_MessageLoader","_ChatInput","_modelTypes","_styleTypes","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TOOLBAR_HEIGHT","BOTTOM_OFFSET","Platform","select","web","Chat","model","isHintFeedback","isTextToSpeechEnabled","colorScheme","ColorScheme","Blue","dimensions","useWindowDimensions","ref","useRef","isOpen","useUnit","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_effectorReact","_reactNativeUi","_ChatMessage","_MessageLoader","_ChatInput","_CloseButton","_modelTypes","_styleTypes","_ConditionalWrapper","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TOOLBAR_HEIGHT","BOTTOM_OFFSET","Platform","select","web","Chat","model","isHintFeedback","isTextToSpeechEnabled","isInputDisabled","colorScheme","ColorScheme","Blue","MessageWrapper","TTSHighlightRenderer","onPressClose","dimensions","useWindowDimensions","ref","useRef","isOpen","useUnit","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","audioStatus","t2s","$status","currentPlayingId","$currentPlayingId","highlightedWordIndex","wordHighlight","$highlightedWordIndex","isScrollActive","$isScrollActive","isTranslated","translation","$isTranslated","errorSpottingEnabled","errorSpotting","$isEnabled","messages","useStoreMap","$currentChatData","lastMessageId","at","id","MAX_HEIGHT","height","shouldWrapMessage","length","jsxs","View","style","styles","container","maxHeight","children","jsx","ScrollView","bounces","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","messagesWithoutInput","map","message","index","key","isPlayingMessage","messageHighlightIndex","isWordHighlightEnabled","Fragment","ConditionalWrapper","withWrapper","Wrapper","ChatMessage","withIcon","isOwnMessage","variant","MessageVariant","SENT","RECEIVED","withErrorSpotting","t2sState","isEnabled","isActive","isLoading","status","disabled","MessageLoader","inputRow","CloseButton","onPress","ChatInput","hasMessages","exports","StyleSheet","create","flex","alignItems","width","paddingRight","SPACING","paddingVertical","marginBottom","flexDirection"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/Chat.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAA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AAEwC,sBAAO,CAAC,KAAK;EACpB,CAAC;EACDxC,GAAG,EAAE;IACHoC,IAAI,EAAE,CAAC;IACPpC,GAAG,EAAEwC,sBAAO,CAAC,KAAK;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CloseButton = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _CloseIcon = require("../../../../shared/icons/CloseIcon.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const COLOR_SCHEME = {
|
|
14
|
+
[_reactNativeUi.ButtonStates.DEFAULT]: {
|
|
15
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
16
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
17
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
18
|
+
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
19
|
+
},
|
|
20
|
+
[_reactNativeUi.ButtonStates.PRESSED]: {
|
|
21
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_4,
|
|
22
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
23
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
24
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
25
|
+
},
|
|
26
|
+
[_reactNativeUi.ButtonStates.HOVER]: {
|
|
27
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
|
|
28
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
29
|
+
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
30
|
+
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const CloseButton = ({
|
|
34
|
+
onPress
|
|
35
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
36
|
+
onPress: onPress,
|
|
37
|
+
style: {
|
|
38
|
+
button: styles.button
|
|
39
|
+
},
|
|
40
|
+
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
41
|
+
size: _reactNativeUi.ButtonSize.MEDIUM,
|
|
42
|
+
colorScheme: _reactNativeUi.ButtonColor.WHITE,
|
|
43
|
+
raiseLevel: 5
|
|
44
|
+
// customColorScheme={COLOR_SCHEME}
|
|
45
|
+
,
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseIcon.CloseIcon, {
|
|
47
|
+
width: 18,
|
|
48
|
+
height: 18
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
exports.CloseButton = CloseButton;
|
|
52
|
+
const styles = _reactNative.StyleSheet.create({
|
|
53
|
+
button: {
|
|
54
|
+
width: 38,
|
|
55
|
+
height: 38,
|
|
56
|
+
borderRadius: 36,
|
|
57
|
+
paddingHorizontal: 0,
|
|
58
|
+
borderColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//# sourceMappingURL=CloseButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeUi","_CloseIcon","_jsxRuntime","e","__esModule","default","COLOR_SCHEME","ButtonStates","DEFAULT","backgroundColor","COLORS","NEUTRAL_1","borderColor","NEUTRAL_5","raiseColor","color","NEUTRAL_10","PRESSED","NEUTRAL_4","HOVER","NEUTRAL_3","CloseButton","onPress","jsx","Button","style","button","styles","variant","ButtonVariant","PRIMARY","size","ButtonSize","MEDIUM","colorScheme","ButtonColor","WHITE","raiseLevel","children","CloseIcon","width","height","exports","StyleSheet","create","borderRadius","paddingHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/CloseButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAQA,IAAAG,UAAA,GAAAH,OAAA;AAA8D,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9D,MAAMG,YAAY,GAAG;EACnB,CAACC,2BAAY,CAACC,OAAO,GAAG;IACtBC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,WAAW,EAAEF,qBAAM,CAACG,SAAS;IAC7BC,UAAU,EAAEJ,qBAAM,CAACG,SAAS;IAC5BE,KAAK,EAAEL,qBAAM,CAACM;EAChB,CAAC;EACD,CAACT,2BAAY,CAACU,OAAO,GAAG;IACtBR,eAAe,EAAEC,qBAAM,CAACQ,SAAS;IACjCN,WAAW,EAAEF,qBAAM,CAACG,SAAS;IAC7BC,UAAU,EAAEJ,qBAAM,CAACG,SAAS;IAC5BE,KAAK,EAAEL,qBAAM,CAACC;EAChB,CAAC;EACD,CAACJ,2BAAY,CAACY,KAAK,GAAG;IACpBV,eAAe,EAAEC,qBAAM,CAACU,SAAS;IACjCR,WAAW,EAAEF,qBAAM,CAACG,SAAS;IAC7BC,UAAU,EAAEJ,qBAAM,CAACG,SAAS;IAC5BE,KAAK,EAAEL,qBAAM,CAACM;EAChB;AACF,CAAC;AAMM,MAAMK,WAAW,GAAGA,CAAC;EAAEC;AAA0B,CAAC,kBACvD,IAAApB,WAAA,CAAAqB,GAAA,EAACvB,cAAA,CAAAwB,MAAM;EACLF,OAAO,EAAEA,OAAQ;EACjBG,KAAK,EAAE;IAAEC,MAAM,EAAEC,MAAM,CAACD;EAAO,CAAE;EACjCE,OAAO,EAAEC,4BAAa,CAACC,OAAQ;EAC/BC,IAAI,EAAEC,yBAAU,CAACC,MAAO;EACxBC,WAAW,EAAEC,0BAAW,CAACC,KAAM;EAC/BC,UAAU,EAAE;EACZ;EAAA;EAAAC,QAAA,eAEA,IAAApC,WAAA,CAAAqB,GAAA,EAACtB,UAAA,CAAAsC,SAAS;IAACC,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE;EAAG,CAAE;AAAC,CAC9B,CACT;AAAAC,OAAA,CAAArB,WAAA,GAAAA,WAAA;AAED,MAAMM,MAAM,GAAGgB,uBAAU,CAACC,MAAM,CAAC;EAC/BlB,MAAM,EAAE;IACNc,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVI,YAAY,EAAE,EAAE;IAChBC,iBAAiB,EAAE,CAAC;IACpBlC,WAAW,EAAEF,qBAAM,CAACG;EACtB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,70 +4,60 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ChatControls = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
10
|
var _effectorReact = require("effector-react");
|
|
11
11
|
var _ChatbotIcon = require("../../../../shared/icons/ChatbotIcon.js");
|
|
12
|
-
var _CloseIcon = require("../../../../shared/icons/CloseIcon.js");
|
|
13
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const HELP_BUTTON_TIMEOUT_MS = 5000;
|
|
15
16
|
const ChatControls = ({
|
|
16
17
|
model,
|
|
17
18
|
onPressChatIcon,
|
|
18
|
-
|
|
19
|
+
onPressHelpButton,
|
|
20
|
+
withHelpButton = false,
|
|
19
21
|
ButtonWrapper = _react.default.Fragment,
|
|
20
22
|
iconSize = {
|
|
21
|
-
width:
|
|
22
|
-
height:
|
|
23
|
+
width: 70,
|
|
24
|
+
height: 90
|
|
23
25
|
}
|
|
24
26
|
}) => {
|
|
25
27
|
const isOpen = (0, _effectorReact.useUnit)(model.$isOpen);
|
|
28
|
+
const [isHelpButtonVisible, setIsHelpButtonVisible] = (0, _react.useState)(withHelpButton);
|
|
29
|
+
(0, _react.useEffect)(() => {
|
|
30
|
+
const timeoutId = setTimeout(() => setIsHelpButtonVisible(false), HELP_BUTTON_TIMEOUT_MS);
|
|
31
|
+
return () => {
|
|
32
|
+
clearTimeout(timeoutId);
|
|
33
|
+
setIsHelpButtonVisible(false);
|
|
34
|
+
};
|
|
35
|
+
}, [withHelpButton]);
|
|
26
36
|
if (isOpen) {
|
|
27
|
-
return
|
|
28
|
-
style: styles.container,
|
|
29
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
30
|
-
onPress: onPressClose,
|
|
31
|
-
style: {
|
|
32
|
-
button: styles.buttonClose
|
|
33
|
-
},
|
|
34
|
-
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
35
|
-
size: _reactNativeUi.ButtonSize.LARGE,
|
|
36
|
-
colorScheme: _reactNativeUi.ButtonColor.WHITE,
|
|
37
|
-
raiseLevel: 5,
|
|
38
|
-
customColorScheme: {
|
|
39
|
-
[_reactNativeUi.ButtonStates.DEFAULT]: {
|
|
40
|
-
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
41
|
-
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
42
|
-
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
43
|
-
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
44
|
-
},
|
|
45
|
-
[_reactNativeUi.ButtonStates.PRESSED]: {
|
|
46
|
-
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_4,
|
|
47
|
-
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
48
|
-
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
49
|
-
color: _reactNativeUi.COLORS.NEUTRAL_1
|
|
50
|
-
},
|
|
51
|
-
[_reactNativeUi.ButtonStates.HOVER]: {
|
|
52
|
-
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
|
|
53
|
-
borderColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
54
|
-
raiseColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
55
|
-
color: _reactNativeUi.COLORS.NEUTRAL_10
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseIcon.CloseIcon, {})
|
|
59
|
-
})
|
|
60
|
-
});
|
|
37
|
+
return null;
|
|
61
38
|
}
|
|
62
39
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
40
|
style: styles.container,
|
|
64
41
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonWrapper, {
|
|
65
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
66
|
-
|
|
67
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
42
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
43
|
+
style: styles.closedWrapper,
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
45
|
+
onPress: onPressChatIcon,
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotIcon.ChatbotIcon, {
|
|
47
|
+
width: iconSize?.width,
|
|
48
|
+
height: iconSize?.height
|
|
49
|
+
})
|
|
50
|
+
}), isHelpButtonVisible && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
51
|
+
variant: _reactNativeUi.ButtonVariant.PRIMARY,
|
|
52
|
+
colorScheme: _reactNativeUi.ButtonColor.WHITE,
|
|
53
|
+
size: _reactNativeUi.ButtonSize.MEDIUM,
|
|
54
|
+
raiseLevel: 3,
|
|
55
|
+
onPress: onPressHelpButton,
|
|
56
|
+
style: {
|
|
57
|
+
text: styles.helpButtonText
|
|
58
|
+
},
|
|
59
|
+
children: "Want some help?"
|
|
60
|
+
})]
|
|
71
61
|
})
|
|
72
62
|
})
|
|
73
63
|
});
|
|
@@ -79,16 +69,16 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
79
69
|
justifyContent: 'flex-end',
|
|
80
70
|
flexDirection: 'row',
|
|
81
71
|
maxHeight: 100,
|
|
82
|
-
gap:
|
|
72
|
+
gap: 2,
|
|
83
73
|
paddingBottom: 5
|
|
84
74
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
closedWrapper: {
|
|
76
|
+
flexDirection: 'row',
|
|
77
|
+
alignItems: 'flex-end',
|
|
78
|
+
gap: 8
|
|
79
|
+
},
|
|
80
|
+
helpButtonText: {
|
|
81
|
+
textTransform: 'uppercase'
|
|
92
82
|
}
|
|
93
83
|
});
|
|
94
84
|
//# sourceMappingURL=ChatControls.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeUi","_effectorReact","_ChatbotIcon","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","HELP_BUTTON_TIMEOUT_MS","ChatControls","model","onPressChatIcon","onPressHelpButton","withHelpButton","ButtonWrapper","React","Fragment","iconSize","width","height","isOpen","useUnit","$isOpen","isHelpButtonVisible","setIsHelpButtonVisible","useState","useEffect","timeoutId","setTimeout","clearTimeout","jsx","View","style","styles","container","children","jsxs","closedWrapper","Pressable","onPress","ChatbotIcon","Button","variant","ButtonVariant","PRIMARY","colorScheme","ButtonColor","WHITE","size","ButtonSize","MEDIUM","raiseLevel","text","helpButtonText","exports","StyleSheet","create","alignItems","justifyContent","flexDirection","maxHeight","gap","paddingBottom","textTransform"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatControls/ChatControls.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AAAkE,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,C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,CAAQ,CACT;MAAA,CACG;IAAC,CACM;EAAC,CACZ,CAAC;AAEX,CAAC;AAAAmB,OAAA,CAAA7C,YAAA,GAAAA,YAAA;AAED,MAAMwB,MAAM,GAAGsB,uBAAU,CAACC,MAAM,CAAC;EAC/BtB,SAAS,EAAE;IACTuB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,UAAU;IAC1BC,aAAa,EAAE,KAAK;IACpBC,SAAS,EAAE,GAAG;IACdC,GAAG,EAAE,CAAC;IACNC,aAAa,EAAE;EACjB,CAAC;EACDzB,aAAa,EAAE;IACbsB,aAAa,EAAE,KAAK;IACpBF,UAAU,EAAE,UAAU;IACtBI,GAAG,EAAE;EACP,CAAC;EACDR,cAAc,EAAE;IACdU,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.ChatInput = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
9
10
|
var _effectorReact = require("effector-react");
|
|
10
11
|
var _ChatBotModelContext = require("../../context/ChatBotModelContext.js");
|
|
11
12
|
var _styleTypes = require("../../types/style.types.js");
|
|
@@ -67,7 +68,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
67
68
|
width: 305,
|
|
68
69
|
alignItems: 'center',
|
|
69
70
|
justifyContent: 'center',
|
|
70
|
-
marginVertical:
|
|
71
|
+
marginVertical: _reactNativeUi.SPACING['200'],
|
|
72
|
+
marginLeft: 6
|
|
71
73
|
}
|
|
72
74
|
});
|
|
73
75
|
//# sourceMappingURL=ChatInput.js.map
|