@magmamath/students-features 0.11.0-rc.9 → 1.0.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/chatbot/components/Chat/Chat.js +59 -221
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +58 -45
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
- package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +34 -14
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +8 -48
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -14
- 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 +12 -22
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +4 -4
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/helpers.js +1 -8
- 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 +10 -46
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +1 -2
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.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/ChatbotTranslation.js +1 -1
- package/dist/commonjs/features/chatbot/model/ChatbotTranslation.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -9
- 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/gifCelebrations/helpers.js +1 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -1
- package/dist/commonjs/features/voice/constants.js +23 -0
- package/dist/commonjs/features/voice/constants.js.map +1 -0
- package/dist/commonjs/features/voice/helpers.js +208 -0
- package/dist/commonjs/features/voice/helpers.js.map +1 -0
- package/dist/commonjs/features/voice/index.js +105 -0
- package/dist/commonjs/features/voice/index.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +49 -0
- package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +215 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +108 -0
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +50 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
- package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js +98 -0
- package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
- package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +39 -0
- package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +223 -0
- package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js +41 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +15 -0
- package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
- package/dist/commonjs/features/voice/playing/model/index.js +20 -0
- package/dist/commonjs/features/voice/playing/model/index.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +74 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +63 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +35 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +27 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js +50 -0
- package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +59 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +22 -0
- package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
- package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +53 -0
- package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +78 -0
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +51 -0
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/Recorder.model.js +55 -0
- package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/Uploader.model.js +44 -0
- package/dist/commonjs/features/voice/recording/model/Uploader.model.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +248 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js +30 -0
- package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
- package/dist/commonjs/features/voice/types.js +6 -0
- package/dist/commonjs/features/voice/types.js.map +1 -0
- package/dist/commonjs/index.js +12 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/shared/components/PlayButton.js +70 -0
- package/dist/commonjs/shared/components/PlayButton.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +18 -2
- package/dist/commonjs/shared/translation/localization/de.json +18 -2
- package/dist/commonjs/shared/translation/localization/en.json +18 -2
- package/dist/commonjs/shared/translation/localization/gb.json +18 -2
- package/dist/commonjs/shared/translation/localization/sct.json +18 -2
- package/dist/commonjs/shared/translation/localization/sw.json +18 -2
- package/dist/module/features/chatbot/components/Chat/Chat.js +61 -223
- package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +59 -47
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -1
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
- package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
- package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +36 -17
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +9 -49
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +12 -13
- 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 +11 -20
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +5 -5
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/helpers.js +1 -8
- 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 +10 -46
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -2
- package/dist/module/features/chatbot/model/ChatBoxTextManager.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/ChatbotTranslation.js +1 -1
- package/dist/module/features/chatbot/model/ChatbotTranslation.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -9
- 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/gifCelebrations/helpers.js +1 -0
- package/dist/module/features/gifCelebrations/helpers.js.map +1 -1
- package/dist/module/features/voice/constants.js +19 -0
- package/dist/module/features/voice/constants.js.map +1 -0
- package/dist/module/features/voice/helpers.js +191 -0
- package/dist/module/features/voice/helpers.js.map +1 -0
- package/dist/module/features/voice/index.js +12 -0
- package/dist/module/features/voice/index.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceIcon.js +41 -0
- package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +208 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +102 -0
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +45 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
- package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
- package/dist/module/features/voice/playing/model/Player.model.js +93 -0
- package/dist/module/features/voice/playing/model/Player.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
- package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +34 -0
- package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js +218 -0
- package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js +36 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +10 -0
- package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
- package/dist/module/features/voice/playing/model/index.js +5 -0
- package/dist/module/features/voice/playing/model/index.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceRecord.js +67 -0
- package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js +57 -0
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +29 -0
- package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +21 -0
- package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
- package/dist/module/features/voice/recording/components/VoiceRecordTimer.js +44 -0
- package/dist/module/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
- package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +54 -0
- package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
- package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +17 -0
- package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
- package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +47 -0
- package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
- package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +71 -0
- package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
- package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +45 -0
- package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
- package/dist/module/features/voice/recording/model/Recorder.model.js +50 -0
- package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -0
- package/dist/module/features/voice/recording/model/Uploader.model.js +39 -0
- package/dist/module/features/voice/recording/model/Uploader.model.js.map +1 -0
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js +244 -0
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
- package/dist/module/features/voice/recording/model/VoiceRecordCollection.js +25 -0
- package/dist/module/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
- package/dist/module/features/voice/types.js +4 -0
- package/dist/module/features/voice/types.js.map +1 -0
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/shared/components/PlayButton.js +64 -0
- package/dist/module/shared/components/PlayButton.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +18 -2
- package/dist/module/shared/translation/localization/de.json +18 -2
- package/dist/module/shared/translation/localization/en.json +18 -2
- package/dist/module/shared/translation/localization/gb.json +18 -2
- package/dist/module/shared/translation/localization/sct.json +18 -2
- package/dist/module/shared/translation/localization/sw.json +18 -2
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +1 -2
- 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 +3 -3
- 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/ChatInput/RequestHintButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +1 -2
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +5 -5
- 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 -2
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +1 -2
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +17 -19
- 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 +13 -8
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -1
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/constants.d.ts +16 -0
- package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/helpers.d.ts +46 -0
- package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/index.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
- package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +23 -0
- package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
- package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
- package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
- package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +19 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts +18 -0
- package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
- package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/voice/types.d.ts +72 -0
- package/dist/typescript/commonjs/features/voice/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/shared/components/PlayButton.d.ts +18 -0
- package/dist/typescript/commonjs/shared/components/PlayButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -6
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +34 -2
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +1 -2
- 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 +3 -3
- 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/ChatInput/RequestHintButton.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -2
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +1 -2
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +5 -5
- 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 -2
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +1 -2
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
- package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +17 -19
- 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 +13 -8
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -1
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/constants.d.ts +16 -0
- package/dist/typescript/module/features/voice/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/helpers.d.ts +46 -0
- package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/index.d.ts +10 -0
- package/dist/typescript/module/features/voice/index.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts +8 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
- package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
- package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +23 -0
- package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
- package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
- package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
- package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/playing/model/index.d.ts +3 -0
- package/dist/typescript/module/features/voice/playing/model/index.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts +10 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
- package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
- package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
- package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
- package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
- package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +19 -0
- package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts +18 -0
- package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
- package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
- package/dist/typescript/module/features/voice/types.d.ts +72 -0
- package/dist/typescript/module/features/voice/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/shared/components/PlayButton.d.ts +18 -0
- package/dist/typescript/module/shared/components/PlayButton.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +102 -6
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +34 -2
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +3 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -1
- package/package.json +11 -6
- package/src/features/chatbot/components/Chat/Chat.tsx +70 -288
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +66 -46
- package/src/features/chatbot/components/ChatInput/ChatInput.tsx +1 -2
- 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/ChatInput/RequestHintButton.tsx +0 -1
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -1
- package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +1 -1
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +33 -17
- package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +9 -51
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +12 -13
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
- package/src/features/chatbot/components/Chatbot.tsx +11 -21
- package/src/features/chatbot/constants.ts +4 -4
- package/src/features/chatbot/helpers.ts +0 -3
- package/src/features/chatbot/index.ts +2 -16
- package/src/features/chatbot/model/ChatBotModel.ts +8 -51
- package/src/features/chatbot/model/ChatBoxTextManager.ts +0 -1
- package/src/features/chatbot/model/ChatbotApi.ts +1 -1
- package/src/features/chatbot/model/ChatbotTranslation.ts +1 -1
- package/src/features/chatbot/model/ChatsCacheModel.ts +0 -7
- package/src/features/chatbot/types/api.types.ts +17 -17
- package/src/features/chatbot/types/model.types.ts +15 -8
- package/src/features/chatbot/types/units.types.ts +0 -1
- package/src/features/gifCelebrations/helpers.ts +1 -0
- package/src/features/voice/constants.ts +15 -0
- package/src/features/voice/helpers.ts +251 -0
- package/src/features/voice/index.ts +11 -0
- package/src/features/voice/playing/components/VoiceIcon.tsx +38 -0
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +251 -0
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +127 -0
- package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts +54 -0
- package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
- package/src/features/voice/playing/model/Player.model.ts +104 -0
- package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
- package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +42 -0
- package/src/features/voice/playing/model/VoicePlayer.model.ts +255 -0
- package/src/features/voice/playing/model/VoiceTranscriptionsCollection.ts +40 -0
- package/src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts +11 -0
- package/src/features/voice/playing/model/index.ts +2 -0
- package/src/features/voice/recording/components/VoiceRecord.tsx +65 -0
- package/src/features/voice/recording/components/VoiceRecordButton.tsx +64 -0
- package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +25 -0
- package/src/features/voice/recording/components/VoiceRecordDivider.tsx +17 -0
- package/src/features/voice/recording/components/VoiceRecordTimer.tsx +49 -0
- package/src/features/voice/recording/hooks/useVoiceRecorder.ts +62 -0
- package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +19 -0
- package/src/features/voice/recording/modal/ModalFooterButtons.tsx +54 -0
- package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +82 -0
- package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +50 -0
- package/src/features/voice/recording/model/Recorder.model.ts +63 -0
- package/src/features/voice/recording/model/Uploader.model.ts +48 -0
- package/src/features/voice/recording/model/VoiceRecord.model.ts +302 -0
- package/src/features/voice/recording/model/VoiceRecordCollection.ts +26 -0
- package/src/features/voice/types.ts +84 -0
- package/src/index.ts +1 -0
- package/src/shared/components/PlayButton.tsx +84 -0
- package/src/shared/translation/localization/ca.json +18 -2
- package/src/shared/translation/localization/de.json +18 -2
- package/src/shared/translation/localization/en.json +18 -2
- package/src/shared/translation/localization/gb.json +18 -2
- package/src/shared/translation/localization/sct.json +18 -2
- package/src/shared/translation/localization/sw.json +18 -2
- package/src/types/common.types.ts +1 -0
- package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +0 -39
- package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js +0 -44
- package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -41
- package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
- package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/dist/module/features/chatbot/components/Chat/CloseButton.js +0 -33
- package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +0 -1
- package/dist/module/features/chatbot/components/Chat/GradientFade.js +0 -39
- package/dist/module/features/chatbot/components/Chat/GradientFade.js.map +0 -1
- package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -34
- package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
- package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts +0 -10
- package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
- package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts +0 -10
- package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
- package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
- package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
- package/src/features/chatbot/components/Chat/CloseButton.tsx +0 -31
- package/src/features/chatbot/components/Chat/GradientFade.tsx +0 -43
- package/src/features/chatbot/components/ChatMessage/AnimatedMessage.tsx +0 -30
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
import {
|
|
4
|
-
|
|
3
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
|
+
|
|
5
|
+
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
6
|
+
import { ThreeDotsLoader } from '../ThreeDotsLoader/ThreeDotsLoader'
|
|
7
|
+
import { CONTROLS_COLORS_MAP } from '../../constants'
|
|
8
|
+
import { ColorScheme } from '../../types/style.types'
|
|
9
|
+
import { LavaIconInGlasses } from '@magmamath/students-features'
|
|
5
10
|
|
|
6
11
|
type MessageLoaderProps = {
|
|
7
|
-
|
|
12
|
+
colorScheme?: ColorScheme
|
|
8
13
|
}
|
|
9
14
|
|
|
10
|
-
export const MessageLoader = ({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
export const MessageLoader = ({ colorScheme = ColorScheme.Blue }: MessageLoaderProps) => (
|
|
16
|
+
<View style={styles.container}>
|
|
17
|
+
<View style={styles.icon}>
|
|
18
|
+
<LavaIconInGlasses width={60} height={80} />
|
|
19
|
+
</View>
|
|
14
20
|
<View style={styles.loader}>
|
|
15
|
-
<
|
|
21
|
+
<ThreeDotsLoader backgroundColor={CONTROLS_COLORS_MAP[colorScheme].background} />
|
|
16
22
|
</View>
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
</View>
|
|
24
|
+
)
|
|
19
25
|
|
|
20
26
|
const styles = StyleSheet.create({
|
|
27
|
+
container: {
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
width: 327,
|
|
30
|
+
alignItems: 'flex-end',
|
|
31
|
+
paddingLeft:70
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
zIndex:1,
|
|
36
|
+
alignSelf: 'flex-end',
|
|
37
|
+
left: 0
|
|
38
|
+
},
|
|
21
39
|
loader: {
|
|
22
|
-
|
|
23
|
-
alignSelf: 'flex-start',
|
|
24
|
-
marginTop: SPACING['200'],
|
|
40
|
+
flex: 1,
|
|
25
41
|
flexDirection: 'row',
|
|
26
42
|
alignItems: 'flex-start',
|
|
27
|
-
|
|
28
|
-
maxWidth: 62,
|
|
43
|
+
maxWidth: 70,
|
|
29
44
|
padding: 8,
|
|
45
|
+
paddingTop: 15,
|
|
30
46
|
shadowColor: '#333333',
|
|
31
47
|
shadowOffset: { width: 0, height: 1 },
|
|
32
48
|
shadowOpacity: 0.25,
|
|
33
49
|
shadowRadius: 3,
|
|
34
50
|
elevation: 3,
|
|
35
|
-
borderRadius:
|
|
51
|
+
borderRadius: 8,
|
|
36
52
|
borderBottomLeftRadius: 0,
|
|
37
53
|
backgroundColor: COLORS.NEUTRAL_3,
|
|
38
54
|
},
|
|
@@ -1,42 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { ActivityIndicator } from 'react-native'
|
|
3
|
-
import { Button, COLORS } from '@magmamath/react-native-ui'
|
|
4
|
-
|
|
5
|
-
import { SpeakerIcon } from '../../../../shared/icons/SpeakerIcon'
|
|
6
|
-
import { PlayIcon } from '../../../../shared/icons/PlayIcon'
|
|
7
|
-
import { PauseIcon } from '../../../../shared/icons/PauseIcon'
|
|
8
|
-
import { AudioStatus, T2SState } from '../../types/t2s.types'
|
|
9
2
|
import { useChatModel } from '../../context/ChatBotModelContext'
|
|
3
|
+
import { PlayButton } from '../../../../shared/components/PlayButton'
|
|
4
|
+
import { T2SState } from '../../types/t2s.types'
|
|
10
5
|
import { ConversationMessage } from '../../types/units.types'
|
|
11
|
-
import { ColorScheme } from '../../types/style.types'
|
|
12
6
|
import { MessageVariant } from '../../types/model.types'
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
type TextToSpeechIconProps = {
|
|
16
|
-
status: AudioStatus
|
|
17
|
-
isLoading: boolean
|
|
18
|
-
isActive: boolean
|
|
19
|
-
colorScheme?: ColorScheme
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const TextToSpeechIcon = ({
|
|
23
|
-
status,
|
|
24
|
-
isActive,
|
|
25
|
-
isLoading,
|
|
26
|
-
colorScheme = ColorScheme.Blue,
|
|
27
|
-
}: TextToSpeechIconProps) => {
|
|
28
|
-
if (isLoading && isActive) {
|
|
29
|
-
return <ActivityIndicator color={CONTROLS_COLORS_MAP[colorScheme].background} />
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (!isActive) {
|
|
33
|
-
return <SpeakerIcon />
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (status === 'playing') return <PauseIcon color={COLORS.NEUTRAL_1} />
|
|
37
|
-
if (status === 'paused') return <PlayIcon color={COLORS.NEUTRAL_1} />
|
|
38
|
-
return <SpeakerIcon />
|
|
39
|
-
}
|
|
7
|
+
import { ColorScheme } from '../../types/style.types'
|
|
8
|
+
import { MESSAGE_COLORS_MAP } from '../../constants'
|
|
40
9
|
|
|
41
10
|
type MessageTextToSpeechProps = {
|
|
42
11
|
state: T2SState
|
|
@@ -46,14 +15,14 @@ type MessageTextToSpeechProps = {
|
|
|
46
15
|
}
|
|
47
16
|
|
|
48
17
|
export const MessageTextToSpeech = ({
|
|
49
|
-
state
|
|
50
|
-
message,
|
|
18
|
+
state,
|
|
51
19
|
variant,
|
|
20
|
+
message,
|
|
52
21
|
colorScheme = ColorScheme.Blue,
|
|
53
22
|
}: MessageTextToSpeechProps) => {
|
|
54
23
|
const model = useChatModel()
|
|
55
24
|
|
|
56
|
-
|
|
25
|
+
const play = () => {
|
|
57
26
|
void model.t2s.play({
|
|
58
27
|
isTranslated: model.translation.$isTranslated.getState(),
|
|
59
28
|
message,
|
|
@@ -61,21 +30,10 @@ export const MessageTextToSpeech = ({
|
|
|
61
30
|
}
|
|
62
31
|
|
|
63
32
|
return (
|
|
64
|
-
<
|
|
65
|
-
disabled={disabled}
|
|
66
|
-
isActive={isActive}
|
|
67
|
-
variant={'secondary'}
|
|
33
|
+
<PlayButton
|
|
68
34
|
colorScheme={MESSAGE_COLORS_MAP[colorScheme][variant].icon}
|
|
69
|
-
|
|
35
|
+
state={state}
|
|
70
36
|
onPress={play}
|
|
71
|
-
icon={
|
|
72
|
-
<TextToSpeechIcon
|
|
73
|
-
isActive={isActive}
|
|
74
|
-
isLoading={isLoading}
|
|
75
|
-
status={status}
|
|
76
|
-
colorScheme={colorScheme}
|
|
77
|
-
/>
|
|
78
|
-
}
|
|
79
37
|
/>
|
|
80
38
|
)
|
|
81
39
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
|
|
4
|
-
import { ChatbotIcon } from '@magmamath/students-features'
|
|
5
|
-
import { ColorScheme } from '../../types/style.types'
|
|
6
|
-
import { MessageVariant } from '../../types/model.types'
|
|
3
|
+
|
|
7
4
|
import { VariantProps } from './ChatMessage'
|
|
5
|
+
import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
|
|
6
|
+
import { ColorScheme } from '../../types/style.types'
|
|
8
7
|
import { MessageContent } from './MessageContent'
|
|
8
|
+
import { MessageVariant } from '../../types/model.types'
|
|
9
9
|
|
|
10
10
|
export const ReceivedMessage = ({
|
|
11
11
|
message,
|
|
@@ -23,7 +23,7 @@ export const ReceivedMessage = ({
|
|
|
23
23
|
<View style={styles.container}>
|
|
24
24
|
{withIcon && (
|
|
25
25
|
<View style={styles.icon}>
|
|
26
|
-
<ChatbotIcon width={
|
|
26
|
+
<ChatbotIcon width={60} height={80} />
|
|
27
27
|
</View>
|
|
28
28
|
)}
|
|
29
29
|
|
|
@@ -47,11 +47,14 @@ const styles = StyleSheet.create({
|
|
|
47
47
|
container: {
|
|
48
48
|
flex: 1,
|
|
49
49
|
flexDirection: 'row',
|
|
50
|
-
maxWidth:
|
|
51
|
-
width:
|
|
50
|
+
maxWidth: 372,
|
|
51
|
+
width: 372,
|
|
52
52
|
alignItems: 'flex-end',
|
|
53
53
|
justifyContent: 'flex-end',
|
|
54
|
-
|
|
54
|
+
},
|
|
55
|
+
icon: {
|
|
56
|
+
alignSelf: 'flex-end',
|
|
57
|
+
marginRight: 8,
|
|
55
58
|
},
|
|
56
59
|
message: {
|
|
57
60
|
flex: 1,
|
|
@@ -63,12 +66,8 @@ const styles = StyleSheet.create({
|
|
|
63
66
|
shadowOpacity: 0.25,
|
|
64
67
|
shadowRadius: 3,
|
|
65
68
|
elevation: 3,
|
|
66
|
-
borderRadius:
|
|
69
|
+
borderRadius: 8,
|
|
67
70
|
borderBottomLeftRadius: 0,
|
|
68
71
|
backgroundColor: '#F2F2F4',
|
|
69
72
|
},
|
|
70
|
-
|
|
71
|
-
icon: {
|
|
72
|
-
paddingRight: SPACING[200],
|
|
73
|
-
},
|
|
74
73
|
})
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ComponentType, PropsWithChildren,
|
|
1
|
+
import React, { ComponentType, PropsWithChildren, useMemo } from 'react'
|
|
2
2
|
import { useStoreMap, useUnit } from 'effector-react'
|
|
3
3
|
|
|
4
4
|
import { ChatbotModel } from '../model/ChatBotModel'
|
|
@@ -13,7 +13,6 @@ type ChatbotProps = {
|
|
|
13
13
|
model: ChatbotModel
|
|
14
14
|
isHintFeedback: boolean
|
|
15
15
|
isTextToSpeechEnabled: boolean
|
|
16
|
-
withQuickActionButton?: boolean
|
|
17
16
|
textToSpeechConfig?: {
|
|
18
17
|
voice: typeof DEFAULT_VOICE
|
|
19
18
|
audioConfig: typeof AUDIO_CONFIG
|
|
@@ -34,31 +33,23 @@ export const Chatbot = ({
|
|
|
34
33
|
ButtonWrapper,
|
|
35
34
|
iconSize,
|
|
36
35
|
colorScheme = ColorScheme.Blue,
|
|
37
|
-
withQuickActionButton,
|
|
38
36
|
TTSHighlightRenderer,
|
|
39
37
|
}: ChatbotProps) => {
|
|
40
|
-
const alternatives = useUnit(model.$alternatives)
|
|
41
38
|
const isChatAllowed = useUnit(model.$chatAccess)
|
|
42
39
|
const isAvailable = useStoreMap(model.$currentChatData, ({ isAvailable }) => isAvailable)
|
|
43
|
-
const hasBeenOpened = useStoreMap(model.$currentChatData, ({ hasBeenOpened }) => hasBeenOpened)
|
|
44
|
-
|
|
45
40
|
model.t2s.setAudioConfig(textToSpeechConfig ?? null)
|
|
46
41
|
|
|
42
|
+
const shouldAnimateCloseButton = useStoreMap({
|
|
43
|
+
store: model.$currentChatData,
|
|
44
|
+
fn: (chat, [isInputDisabled]) => {
|
|
45
|
+
return isInputDisabled && chat.messages.length === 1
|
|
46
|
+
},
|
|
47
|
+
keys: [isInputDisabled],
|
|
48
|
+
})
|
|
49
|
+
|
|
47
50
|
const openChat = () => model.setIsOpen(true)
|
|
48
51
|
const closeChat = () => model.setIsOpen(false)
|
|
49
52
|
|
|
50
|
-
const sendHelpRequest = useCallback(() => {
|
|
51
|
-
const option = alternatives?.options.default[0]
|
|
52
|
-
if (!option) return
|
|
53
|
-
|
|
54
|
-
model.setIsOpen(true)
|
|
55
|
-
void model.sendHelpRequestFx({
|
|
56
|
-
message: option.text,
|
|
57
|
-
translatedMessage: option.translatedText,
|
|
58
|
-
skipOwnMessage: true,
|
|
59
|
-
})
|
|
60
|
-
}, [alternatives])
|
|
61
|
-
|
|
62
53
|
if (!isAvailable || !isChatAllowed) {
|
|
63
54
|
return null
|
|
64
55
|
}
|
|
@@ -73,16 +64,15 @@ export const Chatbot = ({
|
|
|
73
64
|
isInputDisabled={isInputDisabled}
|
|
74
65
|
MessageWrapper={ButtonWrapper}
|
|
75
66
|
TTSHighlightRenderer={TTSHighlightRenderer}
|
|
76
|
-
onPressClose={closeChat}
|
|
77
67
|
/>
|
|
78
68
|
|
|
79
69
|
<ChatControls
|
|
80
70
|
model={model}
|
|
81
71
|
onPressChatIcon={openChat}
|
|
82
|
-
|
|
72
|
+
onPressClose={closeChat}
|
|
83
73
|
iconSize={iconSize}
|
|
84
74
|
ButtonWrapper={isInputDisabled ? undefined : ButtonWrapper}
|
|
85
|
-
|
|
75
|
+
shouldAnimateCloseButton={shouldAnimateCloseButton}
|
|
86
76
|
/>
|
|
87
77
|
</ChatBotModelContext.Provider>
|
|
88
78
|
)
|
|
@@ -46,24 +46,24 @@ export const MESSAGE_COLORS_MAP = {
|
|
|
46
46
|
[MessageVariant.RECEIVED]: {
|
|
47
47
|
background: COLORS.NEUTRAL_3,
|
|
48
48
|
border: COLORS.NEUTRAL_3,
|
|
49
|
-
icon:
|
|
49
|
+
icon: ColorScheme.Blue,
|
|
50
50
|
},
|
|
51
51
|
[MessageVariant.SENT]: {
|
|
52
52
|
background: COLORS.PRIMARY_BLUE,
|
|
53
53
|
border: COLORS.PRIMARY_BLUE,
|
|
54
|
-
icon:
|
|
54
|
+
icon: ColorScheme.Blue,
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
[ColorScheme.Yellow]: {
|
|
58
58
|
[MessageVariant.RECEIVED]: {
|
|
59
59
|
background: COLORS.NEUTRAL_3,
|
|
60
60
|
border: COLORS.NEUTRAL_3,
|
|
61
|
-
icon:
|
|
61
|
+
icon: ColorScheme.Yellow,
|
|
62
62
|
},
|
|
63
63
|
[MessageVariant.SENT]: {
|
|
64
64
|
background: COLORS.PRIMARY_YELLOW,
|
|
65
65
|
border: COLORS.PRIMARY_YELLOW,
|
|
66
|
-
icon:
|
|
66
|
+
icon: ColorScheme.Yellow,
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
}
|
|
@@ -65,7 +65,6 @@ export function prepareChatRequestPayload(
|
|
|
65
65
|
imageAltText,
|
|
66
66
|
answerOptions,
|
|
67
67
|
answer,
|
|
68
|
-
chatHistory,
|
|
69
68
|
} = payload
|
|
70
69
|
|
|
71
70
|
if (freeTextMessage) {
|
|
@@ -75,7 +74,6 @@ export function prepareChatRequestPayload(
|
|
|
75
74
|
data: {
|
|
76
75
|
conversationId,
|
|
77
76
|
message: freeTextMessage,
|
|
78
|
-
...(chatHistory && { chatHistory }),
|
|
79
77
|
...(!!problemStandards?.length && { problemStandards }),
|
|
80
78
|
},
|
|
81
79
|
}
|
|
@@ -86,7 +84,6 @@ export function prepareChatRequestPayload(
|
|
|
86
84
|
correctAnswer: problemAnswer,
|
|
87
85
|
problemDescription,
|
|
88
86
|
language,
|
|
89
|
-
...(chatHistory && { chatHistory }),
|
|
90
87
|
...(imageCdnId && { imageCdnId }),
|
|
91
88
|
...(imageAltText && { altText: imageAltText }),
|
|
92
89
|
...(!!problemStandards?.length && { problemStandards }),
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
export { Chatbot } from './components/Chatbot'
|
|
2
2
|
export { ChatbotModel } from './model/ChatBotModel'
|
|
3
|
-
export {
|
|
4
|
-
AudioStatus,
|
|
5
|
-
type AudioProvider,
|
|
6
|
-
type TTSHighlightRenderer,
|
|
7
|
-
type TTSHighlightRendererProps,
|
|
8
|
-
} from './types/t2s.types'
|
|
3
|
+
export { AudioStatus, type AudioProvider, type TTSHighlightRenderer, type TTSHighlightRendererProps } from './types/t2s.types'
|
|
9
4
|
export {
|
|
10
5
|
MessageVariant,
|
|
11
6
|
type ChatbotModelProps,
|
|
12
7
|
type IChatDrawBoardAdapter,
|
|
13
8
|
} from './types/model.types'
|
|
14
9
|
export type { RequestOptionalConfig } from '../../lib/effector/createControllerEffect'
|
|
15
|
-
export type {
|
|
16
|
-
ChatHintPayload,
|
|
17
|
-
ChatHintResponse,
|
|
18
|
-
ChatHistory,
|
|
19
|
-
GetAlternativesResponse,
|
|
20
|
-
GetAlternativesPayload,
|
|
21
|
-
SendMessagePayload,
|
|
22
|
-
SendMessageResponse,
|
|
23
|
-
PostMessageResponse,
|
|
24
|
-
} from './types/api.types'
|
|
10
|
+
export type { PostMessageResponse } from './types/api.types'
|
|
25
11
|
export { DefaultMessagesCreator } from './model/DefaultMessageCreator'
|
|
26
12
|
export type { ChatAnswer } from './types/units.types'
|
|
27
13
|
export type { ConversationMessage } from './types/units.types'
|
|
@@ -58,7 +58,7 @@ export class ChatbotModel {
|
|
|
58
58
|
|
|
59
59
|
readonly resetAlternatives = createEvent()
|
|
60
60
|
readonly setAlternatives = createEvent<GetAlternativesResponse | null>()
|
|
61
|
-
readonly $alternatives
|
|
61
|
+
readonly $alternatives: Store<GetAlternativesResponse | null>
|
|
62
62
|
|
|
63
63
|
readonly setIsOpen = createEvent<boolean>()
|
|
64
64
|
readonly toggleOpen = createEvent()
|
|
@@ -94,7 +94,7 @@ export class ChatbotModel {
|
|
|
94
94
|
this.threadManager.setMessagesLimit(threadMessagesLimit)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
this.$alternatives
|
|
97
|
+
this.$alternatives = createStore<GetAlternativesResponse | null>(null)
|
|
98
98
|
.on(this.api.getAlternativesFx.doneData, (_, payload) => transformAlternatives(payload))
|
|
99
99
|
.on(this.setAlternatives, (_, payload) => transformAlternatives(payload))
|
|
100
100
|
.reset(this.resetAlternatives)
|
|
@@ -127,21 +127,6 @@ export class ChatbotModel {
|
|
|
127
127
|
target: [this.t2s.reset, this.errorSpotting.spottingHidden],
|
|
128
128
|
})
|
|
129
129
|
|
|
130
|
-
sample({
|
|
131
|
-
clock: this.$isOpen.updates,
|
|
132
|
-
filter: (isOpen) => !isOpen,
|
|
133
|
-
fn: () => false,
|
|
134
|
-
target: this.setScrollActive,
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
sample({
|
|
138
|
-
clock: this.setIsOpen,
|
|
139
|
-
source: this.$currentChatData,
|
|
140
|
-
filter: ({ hasBeenOpened }, isOpen) => isOpen && !hasBeenOpened,
|
|
141
|
-
fn: ({ key }) => ({ key, data: { hasBeenOpened: true } }),
|
|
142
|
-
target: this.cache.update,
|
|
143
|
-
})
|
|
144
|
-
|
|
145
130
|
sample({
|
|
146
131
|
clock: this.removeLastMessage,
|
|
147
132
|
source: [this.$lastMessageKey, this.cache.$data] as const,
|
|
@@ -211,58 +196,30 @@ export class ChatbotModel {
|
|
|
211
196
|
|
|
212
197
|
private createSendHelpRequestFx() {
|
|
213
198
|
const effect = attach({
|
|
214
|
-
source: {
|
|
215
|
-
key: this.$currentKey,
|
|
216
|
-
context: this.$context,
|
|
217
|
-
cache: this.cache.$data,
|
|
218
|
-
alternatives: this.$alternatives,
|
|
219
|
-
},
|
|
199
|
+
source: { key: this.$currentKey, context: this.$context, cache: this.cache.$data },
|
|
220
200
|
mapParams: (params: SendHelpParams, source) => ({
|
|
221
201
|
...params,
|
|
222
202
|
...source,
|
|
223
203
|
}),
|
|
224
204
|
effect: createEffect(
|
|
225
|
-
async ({
|
|
226
|
-
message,
|
|
227
|
-
translatedMessage,
|
|
228
|
-
key,
|
|
229
|
-
context,
|
|
230
|
-
isFreeText,
|
|
231
|
-
skipOwnMessage,
|
|
232
|
-
cache,
|
|
233
|
-
alternatives,
|
|
234
|
-
}: SendHelpProps) => {
|
|
205
|
+
async ({ message, translatedMessage, key, context, isFreeText, cache }: SendHelpProps) => {
|
|
235
206
|
if (!context) throw new Error('Trying to send message in chat without context')
|
|
236
207
|
this.setLastMessageKey(key)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
this.cache.addMessages(key, {
|
|
241
|
-
messages: [messagesHelper.createOwn({ message, translatedMessage })],
|
|
242
|
-
})
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const chatHistory =
|
|
246
|
-
context.assignmentId && context.problemId
|
|
247
|
-
? {
|
|
248
|
-
exerciseId: context.assignmentId,
|
|
249
|
-
problemId: context.problemId,
|
|
250
|
-
chatVersion: alternatives?.version,
|
|
251
|
-
}
|
|
252
|
-
: undefined
|
|
208
|
+
this.cache.addMessages(key, {
|
|
209
|
+
messages: [messagesHelper.createOwn({ message, translatedMessage })],
|
|
210
|
+
})
|
|
253
211
|
|
|
254
212
|
// Request is overridden by ThreadManager.postMessage (delegates to sendMessage/getHint)
|
|
255
213
|
const response = await this.api.postMessageFx({
|
|
256
214
|
answer: context.answer,
|
|
257
215
|
answerOptions: context.answerOptions,
|
|
258
|
-
problemDescription: context.
|
|
216
|
+
problemDescription: context.problem,
|
|
259
217
|
problemStandards: context.problemStandards,
|
|
260
218
|
problemAnswer: context.problemAnswer,
|
|
261
219
|
language: context.language,
|
|
262
220
|
imageAltText: context.imageDescription,
|
|
263
221
|
imageCdnId: context.imageCdnId,
|
|
264
222
|
conversationId: cache[key].conversationId,
|
|
265
|
-
chatHistory,
|
|
266
223
|
...(isFreeText && { freeTextMessage: message }),
|
|
267
224
|
})
|
|
268
225
|
|
|
@@ -16,7 +16,6 @@ export class ChatBotTextManager {
|
|
|
16
16
|
start: this.messagesCreator.createMessage('chat.howCanIHelp'),
|
|
17
17
|
endMessage: this.messagesCreator.createMessage('chat.answerAgain'),
|
|
18
18
|
anotherHintOption: this.messagesCreator.createOption('chat.anotherHint'),
|
|
19
|
-
wantHelp: this.messagesCreator.createOption('chat.wantHelp'),
|
|
20
19
|
}
|
|
21
20
|
private readonly defaultMessages = { ...this.messages }
|
|
22
21
|
|
|
@@ -13,7 +13,6 @@ export class ChatbotAPI {
|
|
|
13
13
|
constructor(api: ChatbotApiRequests) {
|
|
14
14
|
this.postMessageFx = createControllerEffect(api.postMessage)
|
|
15
15
|
this.getAlternativesFx = createEffect(api.getAlternatives)
|
|
16
|
-
this.textToSpeechTextFx = createEffect(api.postTextToSpeech)
|
|
17
16
|
this.translateTextFx = createEffect(
|
|
18
17
|
async (payload: GoogleTranslatePayload): Promise<GoogleTranslateResponse> => {
|
|
19
18
|
const response = await api.postTranslateText({
|
|
@@ -33,5 +32,6 @@ export class ChatbotAPI {
|
|
|
33
32
|
}
|
|
34
33
|
},
|
|
35
34
|
)
|
|
35
|
+
this.textToSpeechTextFx = createEffect(api.postTextToSpeech)
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -153,7 +153,7 @@ export class ChatbotTranslation {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
const defaultMessages = [this.defaultMessages.error, this.defaultMessages.endMessage]
|
|
156
|
-
const defaultOptions = [this.defaultMessages.anotherHintOption
|
|
156
|
+
const defaultOptions = [this.defaultMessages.anotherHintOption]
|
|
157
157
|
const options = getOptionsForTranslation({ lastMessage: messages.at(-1), alternatives })
|
|
158
158
|
|
|
159
159
|
const translatedTextsList = await this.translateRequest({
|
|
@@ -71,13 +71,6 @@ export class ChatsCacheModel {
|
|
|
71
71
|
})
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
public clearMessages(key: string) {
|
|
75
|
-
this.cache.setField({
|
|
76
|
-
key,
|
|
77
|
-
fn: (current) => (current ? { ...current, messages: [] } : undefined),
|
|
78
|
-
})
|
|
79
|
-
}
|
|
80
|
-
|
|
81
74
|
public setSingleMessage(key: string, message: ConversationMessage) {
|
|
82
75
|
this.cache.setField({
|
|
83
76
|
key,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChatAnswer, Stroke } from './units.types'
|
|
1
|
+
import { ChatAnswer, FullStrokeData, Stroke } from './units.types'
|
|
2
|
+
import { ProblemStandard } from './model.types'
|
|
2
3
|
|
|
3
4
|
export type GetAlternativesPayload = {
|
|
4
5
|
municipalityId: string
|
|
@@ -10,15 +11,6 @@ export type AlternativesOptions = {
|
|
|
10
11
|
hints: ChatAnswer[]
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
export type ChatHistory = { exerciseId: string; problemId: string; chatVersion?: string }
|
|
14
|
-
|
|
15
|
-
export type ProblemStandard = {
|
|
16
|
-
id: string
|
|
17
|
-
name: string
|
|
18
|
-
description: string
|
|
19
|
-
numberOfMatchedSkills: number
|
|
20
|
-
}
|
|
21
|
-
|
|
22
14
|
export type GetAlternativesResponse = {
|
|
23
15
|
/**
|
|
24
16
|
* @deprecated chatAccess depends on assignment.lavaChat or class grade
|
|
@@ -31,15 +23,14 @@ export type GetAlternativesResponse = {
|
|
|
31
23
|
}
|
|
32
24
|
|
|
33
25
|
export type SendMessagePayload = {
|
|
34
|
-
message: string
|
|
35
|
-
altText?: string
|
|
36
|
-
answerOptions?: string[]
|
|
37
|
-
chatHistory?: ChatHistory
|
|
38
|
-
correctAnswer?: string | string[]
|
|
39
|
-
conversationId?: string
|
|
40
26
|
problemDescription?: string
|
|
41
27
|
problemStandards?: ProblemStandard[]
|
|
28
|
+
correctAnswer?: string | string[]
|
|
29
|
+
answerOptions?: string[]
|
|
30
|
+
altText?: string
|
|
42
31
|
language?: string
|
|
32
|
+
message: string
|
|
33
|
+
conversationId?: string
|
|
43
34
|
}
|
|
44
35
|
|
|
45
36
|
export type SendMessageResponse = {
|
|
@@ -58,7 +49,6 @@ export type PostMessagePayload = {
|
|
|
58
49
|
imageCdnId?: string
|
|
59
50
|
freeTextMessage?: string
|
|
60
51
|
conversationId?: string | null
|
|
61
|
-
chatHistory?: ChatHistory
|
|
62
52
|
}
|
|
63
53
|
|
|
64
54
|
export type PostMessageResponse = {
|
|
@@ -124,3 +114,13 @@ export type ChatHintResponse = {
|
|
|
124
114
|
conversationId?: string | null
|
|
125
115
|
errorStrokeIds?: string[]
|
|
126
116
|
}
|
|
117
|
+
export type ErrorSpottingPayload = {
|
|
118
|
+
strokes: FullStrokeData[]
|
|
119
|
+
problemDescription: string
|
|
120
|
+
correctAnswer: string[]
|
|
121
|
+
userAnswer: string | string[]
|
|
122
|
+
hint: string
|
|
123
|
+
}
|
|
124
|
+
export type ErrorSpottingResponse = {
|
|
125
|
+
highlightedStrokeIds: string[]
|
|
126
|
+
}
|