@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
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Typography, ScrollableList, CaretDownIcon, COLORS, IS_WEB } from '@magmamath/react-native-ui';
|
|
4
|
+
import { useUnit } from 'effector-react';
|
|
5
|
+
import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
|
|
6
|
+
import { TouchableOpacity, View, StyleSheet } from 'react-native';
|
|
7
|
+
import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
|
|
8
|
+
import { useVoiceTranscriptionsDropdown } from "../hooks/useVoiceTranscriptionsDropdown.js";
|
|
9
|
+
import { PlayerState } from "../model/index.js";
|
|
10
|
+
import { VoiceTranscriptionsDropdownItem } from "./VoiceTranscriptionsDropdownItem.js";
|
|
11
|
+
import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from "../../constants.js";
|
|
12
|
+
import { useText } from "../../../../shared/translation/index.js";
|
|
13
|
+
import { PlayButton } from "../../../../shared/components/PlayButton.js";
|
|
14
|
+
import { getActiveAttempt, getAudioStatus } from "../../helpers.js";
|
|
15
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
|
|
17
|
+
export const VoiceTranscriptionsDropdown = ({
|
|
18
|
+
style,
|
|
19
|
+
model,
|
|
20
|
+
answers,
|
|
21
|
+
attemptOffset,
|
|
22
|
+
onAttemptOffsetChange,
|
|
23
|
+
attemptsCount,
|
|
24
|
+
problemId
|
|
25
|
+
}) => {
|
|
26
|
+
const [attempts, setAttempts] = useState([]);
|
|
27
|
+
const scrollRef = useRef(null);
|
|
28
|
+
const answersRef = useRef(answers);
|
|
29
|
+
answersRef.current = answers;
|
|
30
|
+
const t = useText();
|
|
31
|
+
const [currentAttempt, transcriptsLoaded, playerState] = useUnit([model.$currentAttempt, model.loader.$transcriptsLoaded, model.$playerState]);
|
|
32
|
+
const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount);
|
|
33
|
+
const answersKey = useMemo(() => answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(','), [answers]);
|
|
34
|
+
const hasActiveTranscript = activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined;
|
|
35
|
+
const playButtonState = {
|
|
36
|
+
isActive: playerState !== PlayerState.IDLE,
|
|
37
|
+
isLoading: playerState === PlayerState.LOADING,
|
|
38
|
+
status: getAudioStatus(playerState)
|
|
39
|
+
};
|
|
40
|
+
const {
|
|
41
|
+
listAnimatedStyle,
|
|
42
|
+
iconAnimatedStyle,
|
|
43
|
+
onListLayout
|
|
44
|
+
} = useVoiceTranscriptionsDropdown(model.dropdown);
|
|
45
|
+
const scrollToAttempt = useCallback(attemptNumber => {
|
|
46
|
+
const index = attempts.findIndex(item => item.attemptNumber === attemptNumber);
|
|
47
|
+
if (index !== -1) {
|
|
48
|
+
scrollRef.current?.scrollToIndex({
|
|
49
|
+
index,
|
|
50
|
+
animated: true,
|
|
51
|
+
viewPosition: 0
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}, [attempts]);
|
|
55
|
+
const handleItemToggle = useCallback(attempt => {
|
|
56
|
+
if (onAttemptOffsetChange && attemptsCount !== undefined) {
|
|
57
|
+
onAttemptOffsetChange(attemptsCount - attempt);
|
|
58
|
+
}
|
|
59
|
+
}, [onAttemptOffsetChange, attemptsCount]);
|
|
60
|
+
const handlePlayPress = useCallback(() => {
|
|
61
|
+
if (activeAttempt) {
|
|
62
|
+
model.togglePlayPause(activeAttempt);
|
|
63
|
+
}
|
|
64
|
+
}, [model, activeAttempt]);
|
|
65
|
+
const handleScrollToIndexFailed = useCallback(info => {
|
|
66
|
+
setTimeout(() => {
|
|
67
|
+
scrollRef.current?.scrollToIndex({
|
|
68
|
+
index: info.index,
|
|
69
|
+
animated: true,
|
|
70
|
+
viewPosition: 0
|
|
71
|
+
});
|
|
72
|
+
}, 100);
|
|
73
|
+
}, []);
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
model.reinitializePlayer();
|
|
76
|
+
return () => model.cleanup();
|
|
77
|
+
}, [model]);
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing;
|
|
80
|
+
if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
|
|
81
|
+
model.dropdown.setExpanded(true);
|
|
82
|
+
} else {
|
|
83
|
+
model.dropdown.setExpanded(false);
|
|
84
|
+
}
|
|
85
|
+
model.resetPlayer();
|
|
86
|
+
}, [problemId]);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
if (answersRef.current.some(answer => answer.audioFileId)) {
|
|
89
|
+
model.initializeWithAudios(answersRef.current);
|
|
90
|
+
model.loader.loadAllTranscripts();
|
|
91
|
+
}
|
|
92
|
+
}, [model, answersKey]);
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
model.stopAudio();
|
|
95
|
+
}, [activeAttempt]);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const allAttempts = model.getAllAttempts();
|
|
98
|
+
const validAttempts = allAttempts.filter(item => typeof item.attemptNumber === 'number');
|
|
99
|
+
setAttempts(validAttempts);
|
|
100
|
+
}, [answersKey, transcriptsLoaded, currentAttempt, model]);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
if (activeAttempt !== null) {
|
|
103
|
+
scrollToAttempt(activeAttempt);
|
|
104
|
+
}
|
|
105
|
+
}, [activeAttempt, hasActiveTranscript, scrollToAttempt, model]);
|
|
106
|
+
const renderItem = useCallback(({
|
|
107
|
+
item
|
|
108
|
+
}) => {
|
|
109
|
+
const isLoading = model.loader.isTranscriptLoading(item.attemptNumber);
|
|
110
|
+
const transcript = model.loader.getTranscript(item.attemptNumber);
|
|
111
|
+
const isActive = activeAttempt === item.attemptNumber;
|
|
112
|
+
return /*#__PURE__*/_jsx(VoiceTranscriptionsDropdownItem, {
|
|
113
|
+
isLoading: isActive && isLoading,
|
|
114
|
+
attempt: item.attemptNumber,
|
|
115
|
+
content: transcript && transcript !== NO_AUDIO_BE_MESSAGE ? transcript : t('voice.transcriptNotAvailable'),
|
|
116
|
+
isActive: isActive,
|
|
117
|
+
onToggle: handleItemToggle,
|
|
118
|
+
scrollToAttempt: scrollToAttempt
|
|
119
|
+
});
|
|
120
|
+
}, [model, activeAttempt, t, handleItemToggle, scrollToAttempt]);
|
|
121
|
+
return /*#__PURE__*/_jsxs(Animated.View, {
|
|
122
|
+
style: [styles.container, style],
|
|
123
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
124
|
+
style: styles.header,
|
|
125
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
126
|
+
style: styles.title,
|
|
127
|
+
variant: "h7",
|
|
128
|
+
children: t('voice.transcriptions')
|
|
129
|
+
}), hasActiveTranscript && /*#__PURE__*/_jsx(Animated.View, {
|
|
130
|
+
entering: FadeIn.duration(120),
|
|
131
|
+
exiting: FadeOut.duration(120),
|
|
132
|
+
children: /*#__PURE__*/_jsx(PlayButton, {
|
|
133
|
+
state: playButtonState,
|
|
134
|
+
onPress: handlePlayPress,
|
|
135
|
+
activityIndicatorColor: COLORS.NEUTRAL_1
|
|
136
|
+
})
|
|
137
|
+
})]
|
|
138
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
139
|
+
style: [listAnimatedStyle, {
|
|
140
|
+
overflow: 'hidden'
|
|
141
|
+
}],
|
|
142
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
143
|
+
onLayout: onListLayout,
|
|
144
|
+
style: styles.listContainer,
|
|
145
|
+
children: /*#__PURE__*/_jsx(ScrollableList, {
|
|
146
|
+
bounces: false,
|
|
147
|
+
ref: scrollRef,
|
|
148
|
+
hideShadow: true,
|
|
149
|
+
data: attempts,
|
|
150
|
+
keyExtractor: item => item._id,
|
|
151
|
+
onScrollToIndexFailed: handleScrollToIndexFailed,
|
|
152
|
+
renderItem: renderItem,
|
|
153
|
+
style: IS_WEB && styles.list,
|
|
154
|
+
contentContainerStyle: styles.listContent
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
}), /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
|
|
158
|
+
style: [styles.expandButton, iconAnimatedStyle],
|
|
159
|
+
onPress: () => model.dropdown.toggleExpand(),
|
|
160
|
+
children: /*#__PURE__*/_jsx(CaretDownIcon, {
|
|
161
|
+
size: 22
|
|
162
|
+
})
|
|
163
|
+
})]
|
|
164
|
+
});
|
|
165
|
+
};
|
|
166
|
+
const styles = StyleSheet.create({
|
|
167
|
+
container: {
|
|
168
|
+
position: 'absolute',
|
|
169
|
+
top: 56,
|
|
170
|
+
left: 8,
|
|
171
|
+
width: 222,
|
|
172
|
+
maxHeight: 405,
|
|
173
|
+
minHeight: 51,
|
|
174
|
+
padding: 4,
|
|
175
|
+
boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
|
|
176
|
+
borderRadius: 12,
|
|
177
|
+
backgroundColor: COLORS.NEUTRAL_1,
|
|
178
|
+
overflow: 'hidden'
|
|
179
|
+
},
|
|
180
|
+
header: {
|
|
181
|
+
flexDirection: 'row',
|
|
182
|
+
justifyContent: 'space-between',
|
|
183
|
+
alignItems: 'center',
|
|
184
|
+
padding: 4,
|
|
185
|
+
marginBottom: 4,
|
|
186
|
+
height: 32
|
|
187
|
+
},
|
|
188
|
+
title: {
|
|
189
|
+
color: COLORS.NEUTRAL_9,
|
|
190
|
+
marginLeft: 4
|
|
191
|
+
},
|
|
192
|
+
list: {
|
|
193
|
+
flex: 1
|
|
194
|
+
},
|
|
195
|
+
expandButton: {
|
|
196
|
+
justifyContent: 'center',
|
|
197
|
+
alignItems: 'center'
|
|
198
|
+
},
|
|
199
|
+
listContainer: {
|
|
200
|
+
position: 'absolute',
|
|
201
|
+
maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
|
|
202
|
+
width: '100%'
|
|
203
|
+
},
|
|
204
|
+
listContent: {
|
|
205
|
+
paddingHorizontal: 4
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
//# sourceMappingURL=VoiceTranscriptionsDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Typography","ScrollableList","CaretDownIcon","COLORS","IS_WEB","useUnit","React","useRef","useEffect","useState","useCallback","useMemo","TouchableOpacity","View","StyleSheet","Animated","FadeIn","FadeOut","useVoiceTranscriptionsDropdown","PlayerState","VoiceTranscriptionsDropdownItem","DROPDOWN_MAX_CONTENT_HEIGHT","NO_AUDIO_BE_MESSAGE","useText","PlayButton","getActiveAttempt","getAudioStatus","jsx","_jsx","jsxs","_jsxs","AnimatedTouchableOpacity","createAnimatedComponent","VoiceTranscriptionsDropdown","style","model","answers","attemptOffset","onAttemptOffsetChange","attemptsCount","problemId","attempts","setAttempts","scrollRef","answersRef","current","t","currentAttempt","transcriptsLoaded","playerState","$currentAttempt","loader","$transcriptsLoaded","$playerState","activeAttempt","answersKey","map","a","_id","audioFileId","join","hasActiveTranscript","undefined","playButtonState","isActive","IDLE","isLoading","LOADING","status","listAnimatedStyle","iconAnimatedStyle","onListLayout","dropdown","scrollToAttempt","attemptNumber","index","findIndex","item","scrollToIndex","animated","viewPosition","handleItemToggle","attempt","handlePlayPress","togglePlayPause","handleScrollToIndexFailed","info","setTimeout","reinitializePlayer","cleanup","isLastAttemptsWithoutDrowing","length","drawing","setExpanded","resetPlayer","some","answer","initializeWithAudios","loadAllTranscripts","stopAudio","allAttempts","getAllAttempts","validAttempts","filter","renderItem","isTranscriptLoading","transcript","getTranscript","content","onToggle","styles","container","children","header","title","variant","entering","duration","exiting","state","onPress","activityIndicatorColor","NEUTRAL_1","overflow","onLayout","listContainer","bounces","ref","hideShadow","data","keyExtractor","onScrollToIndexFailed","list","contentContainerStyle","listContent","expandButton","toggleExpand","size","create","position","top","left","width","maxHeight","minHeight","padding","boxShadow","borderRadius","backgroundColor","flexDirection","justifyContent","alignItems","marginBottom","height","color","NEUTRAL_9","marginLeft","flex","paddingHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,MAAM,QACD,4BAA4B;AACnC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAChF,SAASC,gBAAgB,EAAkCC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACjG,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AAEnE,SAASC,8BAA8B,QAAQ,4CAAyC;AACxF,SAA2BC,WAAW,QAAQ,mBAAU;AACxD,SAASC,+BAA+B,QAAQ,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B,aAAa,EAAE;IACbc,QAAQ,EAAE,UAAU;IACpBI,SAAS,EAAE1H,2BAA2B;IACtCyH,KAAK,EAAE;EACT,CAAC;EACDR,WAAW,EAAE;IACXwB,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
4
|
+
import React, { memo, useCallback } from 'react';
|
|
5
|
+
import { Button, ButtonSize, ButtonVariant, COLORS, Loader, LoaderColor, LoaderSize, Typography } from '@magmamath/react-native-ui';
|
|
6
|
+
import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated';
|
|
7
|
+
import { useVoiceTranscriptionsDropdownItemAnimation } from "../hooks/useVoiceTranscriptionsDropdownItemAnimation.js";
|
|
8
|
+
import { useText } from "../../../../shared/translation/index.js";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
export const VoiceTranscriptionsDropdownItem = /*#__PURE__*/memo(({
|
|
11
|
+
attempt,
|
|
12
|
+
content,
|
|
13
|
+
isActive,
|
|
14
|
+
isLoading,
|
|
15
|
+
onToggle,
|
|
16
|
+
scrollToAttempt
|
|
17
|
+
}) => {
|
|
18
|
+
const t = useText();
|
|
19
|
+
const {
|
|
20
|
+
contentAnimatedStyle,
|
|
21
|
+
onLayout,
|
|
22
|
+
progress
|
|
23
|
+
} = useVoiceTranscriptionsDropdownItemAnimation(isActive);
|
|
24
|
+
const handleScrollToAttempt = useCallback(attemptNumber => {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
scrollToAttempt(attemptNumber);
|
|
27
|
+
}, 300);
|
|
28
|
+
}, [scrollToAttempt]);
|
|
29
|
+
useAnimatedReaction(() => progress.value, progress => {
|
|
30
|
+
if (progress === 1 && isActive) {
|
|
31
|
+
runOnJS(handleScrollToAttempt)(attempt);
|
|
32
|
+
}
|
|
33
|
+
}, [progress, attempt, isActive]);
|
|
34
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
35
|
+
style: styles.container,
|
|
36
|
+
children: [/*#__PURE__*/_jsx(Pressable, {
|
|
37
|
+
disabled: isActive,
|
|
38
|
+
style: styles.itemHeader,
|
|
39
|
+
onPress: () => onToggle(attempt),
|
|
40
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
41
|
+
onPress: () => !isActive && onToggle(attempt),
|
|
42
|
+
size: ButtonSize.SMALL,
|
|
43
|
+
variant: ButtonVariant.TERTIARY,
|
|
44
|
+
style: {
|
|
45
|
+
text: {
|
|
46
|
+
textTransform: 'uppercase',
|
|
47
|
+
color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
children: t('voice.attempt', {
|
|
51
|
+
number: String(attempt)
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
}), isLoading ? /*#__PURE__*/_jsx(View, {
|
|
55
|
+
style: styles.loaderContainer,
|
|
56
|
+
children: /*#__PURE__*/_jsx(Loader, {
|
|
57
|
+
size: LoaderSize.SMALL,
|
|
58
|
+
color: LoaderColor.BLUE
|
|
59
|
+
})
|
|
60
|
+
}) : /*#__PURE__*/_jsx(Animated.View, {
|
|
61
|
+
style: contentAnimatedStyle,
|
|
62
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
63
|
+
onLayout: onLayout,
|
|
64
|
+
style: styles.contentWrapper,
|
|
65
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
66
|
+
variant: "h8",
|
|
67
|
+
style: [styles.itemContent, {
|
|
68
|
+
color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
|
|
69
|
+
}],
|
|
70
|
+
children: content
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
const styles = StyleSheet.create({
|
|
77
|
+
container: {
|
|
78
|
+
borderTopWidth: 1,
|
|
79
|
+
borderColor: COLORS.NEUTRAL_3
|
|
80
|
+
},
|
|
81
|
+
itemHeader: {
|
|
82
|
+
flexDirection: 'row',
|
|
83
|
+
justifyContent: 'space-between',
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
width: '100%',
|
|
86
|
+
paddingVertical: 8
|
|
87
|
+
},
|
|
88
|
+
itemContent: {
|
|
89
|
+
paddingHorizontal: 8
|
|
90
|
+
},
|
|
91
|
+
contentWrapper: {
|
|
92
|
+
width: '100%',
|
|
93
|
+
position: 'absolute'
|
|
94
|
+
},
|
|
95
|
+
loaderContainer: {
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
paddingTop: 4,
|
|
99
|
+
paddingBottom: 8
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
//# sourceMappingURL=VoiceTranscriptionsDropdownItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pressable","StyleSheet","View","React","memo","useCallback","Button","ButtonSize","ButtonVariant","COLORS","Loader","LoaderColor","LoaderSize","Typography","Animated","runOnJS","useAnimatedReaction","useVoiceTranscriptionsDropdownItemAnimation","useText","jsx","_jsx","jsxs","_jsxs","VoiceTranscriptionsDropdownItem","attempt","content","isActive","isLoading","onToggle","scrollToAttempt","t","contentAnimatedStyle","onLayout","progress","handleScrollToAttempt","attemptNumber","setTimeout","value","style","styles","container","children","disabled","itemHeader","onPress","size","SMALL","variant","TERTIARY","text","textTransform","color","NEUTRAL_9","NEUTRAL_7","number","String","loaderContainer","BLUE","contentWrapper","itemContent","create","borderTopWidth","borderColor","NEUTRAL_3","flexDirection","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","position","paddingTop","paddingBottom"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AA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AEDhB;QAAO,CACE;MAAC,CACT;IAAC,CACM,CAChB;EAAA,CACG,CAAC;AAEX,CACF,CAAC;AAED,MAAMc,MAAM,GAAGtC,UAAU,CAAC2D,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACTqB,cAAc,EAAE,CAAC;IACjBC,WAAW,EAAErD,MAAM,CAACsD;EACtB,CAAC;EACDpB,UAAU,EAAE;IACVqB,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,eAAe,EAAE;EACnB,CAAC;EACDT,WAAW,EAAE;IACXU,iBAAiB,EAAE;EACrB,CAAC;EACDX,cAAc,EAAE;IACdS,KAAK,EAAE,MAAM;IACbG,QAAQ,EAAE;EACZ,CAAC;EACDd,eAAe,EAAE;IACfS,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBK,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useUnit } from 'effector-react';
|
|
5
|
+
import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated';
|
|
6
|
+
import { DROPDOWN_MAX_CONTENT_HEIGHT } from "../../constants.js";
|
|
7
|
+
export const useVoiceTranscriptionsDropdown = model => {
|
|
8
|
+
const isExpanded = useUnit(model.$isExpanded);
|
|
9
|
+
const contentHeight = useSharedValue(0);
|
|
10
|
+
const animationProgress = useSharedValue(isExpanded ? 1 : 0);
|
|
11
|
+
const onListLayout = event => {
|
|
12
|
+
const measuredHeight = event.nativeEvent.layout.height;
|
|
13
|
+
if (measuredHeight > 0) {
|
|
14
|
+
contentHeight.value = measuredHeight;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const listAnimatedStyle = useAnimatedStyle(() => {
|
|
18
|
+
const height = interpolate(animationProgress.value, [0, 1], [0, contentHeight.value || DROPDOWN_MAX_CONTENT_HEIGHT]);
|
|
19
|
+
const opacity = interpolate(animationProgress.value, [0, 0.3, 1], [0, 0, 1]);
|
|
20
|
+
return {
|
|
21
|
+
height,
|
|
22
|
+
opacity
|
|
23
|
+
};
|
|
24
|
+
}, [animationProgress, contentHeight]);
|
|
25
|
+
const iconAnimatedStyle = useAnimatedStyle(() => {
|
|
26
|
+
const rotation = interpolate(animationProgress.value, [0, 1], [0, 180]);
|
|
27
|
+
return {
|
|
28
|
+
transform: [{
|
|
29
|
+
rotate: `${rotation}deg`
|
|
30
|
+
}]
|
|
31
|
+
};
|
|
32
|
+
}, [animationProgress]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
animationProgress.value = withTiming(isExpanded ? 1 : 0, {
|
|
35
|
+
duration: 300
|
|
36
|
+
});
|
|
37
|
+
}, [isExpanded, animationProgress]);
|
|
38
|
+
return {
|
|
39
|
+
isExpanded,
|
|
40
|
+
listAnimatedStyle,
|
|
41
|
+
iconAnimatedStyle,
|
|
42
|
+
onListLayout
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=useVoiceTranscriptionsDropdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useUnit","useAnimatedStyle","useSharedValue","withTiming","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","useVoiceTranscriptionsDropdown","model","isExpanded","$isExpanded","contentHeight","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","listAnimatedStyle","opacity","iconAnimatedStyle","rotation","transform","rotate","duration"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC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,GAAGF,QAAQ;MAAM,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACX,iBAAiB,CAAC,CAAC;EAEvBZ,SAAS,CAAC,MAAM;IACdY,iBAAiB,CAACO,KAAK,GAAGf,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEiB,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACjB,UAAU,EAAEG,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLH,UAAU;IACVW,iBAAiB;IACjBE,iBAAiB;IACjBT;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useSharedValue, withTiming, useDerivedValue, useAnimatedStyle, interpolate } from 'react-native-reanimated';
|
|
5
|
+
export const useVoiceTranscriptionsDropdownItemAnimation = isExpanded => {
|
|
6
|
+
const height = useSharedValue(0);
|
|
7
|
+
const progress = useSharedValue(isExpanded ? 1 : 0);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
progress.value = withTiming(isExpanded ? 1 : 0);
|
|
10
|
+
}, [isExpanded, progress]);
|
|
11
|
+
const derivedHeight = useDerivedValue(() => height.value * progress.value, [height, progress]);
|
|
12
|
+
const contentAnimatedStyle = useAnimatedStyle(() => {
|
|
13
|
+
const opacity = interpolate(progress.value, [0, 0.3, 1], [0, 0, 1]);
|
|
14
|
+
return {
|
|
15
|
+
height: derivedHeight.value,
|
|
16
|
+
opacity,
|
|
17
|
+
overflow: 'hidden'
|
|
18
|
+
};
|
|
19
|
+
}, [progress, derivedHeight]);
|
|
20
|
+
const onLayout = event => {
|
|
21
|
+
height.value = event.nativeEvent.layout.height;
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
contentAnimatedStyle,
|
|
25
|
+
onLayout,
|
|
26
|
+
progress
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.js.map
|
package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useSharedValue","withTiming","useDerivedValue","useAnimatedStyle","interpolate","useVoiceTranscriptionsDropdownItemAnimation","isExpanded","height","progress","value","derivedHeight","contentAnimatedStyle","opacity","overflow","onLayout","event","nativeEvent","layout"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SACEC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,WAAW,QACN,yBAAyB;AAEhC,OAAO,MAAMC,2CAA2C,GAAIC,UAAmB,IAAK;EAClF,MAAMC,MAAM,GAAGP,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMQ,QAAQ,GAAGR,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAEnDP,SAAS,CAAC,MAAM;IACdS,QAAQ,CAACC,KAAK,GAAGR,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EACjD,CAAC,EAAE,CAACA,UAAU,EAAEE,QAAQ,CAAC,CAAC;EAE1B,MAAME,aAAa,GAAGR,eAAe,CAAC,MAAMK,MAAM,CAACE,KAAK,GAAGD,QAAQ,CAACC,KAAK,EAAE,CAACF,MAAM,EAAEC,QAAQ,CAAC,CAAC;EAE9F,MAAMG,oBAAoB,GAAGR,gBAAgB,CAAC,MAAM;IAClD,MAAMS,OAAO,GAAGR,WAAW,CAACI,QAAQ,CAACC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,OAAO;MACLF,MAAM,EAAEG,aAAa,CAACD,KAAK;MAC3BG,OAAO;MACPC,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,EAAE,CAACL,QAAQ,EAAEE,aAAa,CAAC,CAAC;EAE7B,MAAMI,QAAQ,GAAIC,KAAwB,IAAK;IAC7CR,MAAM,CAACE,KAAK,GAAGM,KAAK,CAACC,WAAW,CAACC,MAAM,CAACV,MAAM;EAChD,CAAC;EAED,OAAO;IACLI,oBAAoB;IACpBG,QAAQ;IACRN;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect, createEvent, restore } from 'effector';
|
|
4
|
+
import { createAudioPlayer, setAudioModeAsync } from 'expo-audio';
|
|
5
|
+
export let PlayerState = /*#__PURE__*/function (PlayerState) {
|
|
6
|
+
PlayerState["PLAYING"] = "playing";
|
|
7
|
+
PlayerState["PAUSED"] = "paused";
|
|
8
|
+
PlayerState["LOADING"] = "loading";
|
|
9
|
+
PlayerState["IDLE"] = "idle";
|
|
10
|
+
return PlayerState;
|
|
11
|
+
}({});
|
|
12
|
+
export class PlayerModel {
|
|
13
|
+
player = createAudioPlayer();
|
|
14
|
+
stopped = false;
|
|
15
|
+
reset = createEvent();
|
|
16
|
+
setPlayerState = createEvent();
|
|
17
|
+
playbackFinished = createEvent();
|
|
18
|
+
$playerState = restore(this.setPlayerState, PlayerState.IDLE).reset(this.reset);
|
|
19
|
+
setupAudioMode = createEffect(async () => {
|
|
20
|
+
await setAudioModeAsync({
|
|
21
|
+
playsInSilentMode: true,
|
|
22
|
+
shouldPlayInBackground: false,
|
|
23
|
+
interruptionMode: 'doNotMix'
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
pause = createEffect(() => {
|
|
27
|
+
if (this.player) {
|
|
28
|
+
this.player.pause();
|
|
29
|
+
this.setPlayerState(PlayerState.PAUSED);
|
|
30
|
+
} else {
|
|
31
|
+
console.warn('Cannot pause: audio player not initialized');
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
stop = createEffect(() => {
|
|
35
|
+
this.stopped = true;
|
|
36
|
+
if (this.player) {
|
|
37
|
+
this.player.replace('');
|
|
38
|
+
this.setPlayerState(PlayerState.IDLE);
|
|
39
|
+
} else {
|
|
40
|
+
console.warn('Cannot stop: audio player not initialized');
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
resume = createEffect(() => {
|
|
44
|
+
if (this.player) {
|
|
45
|
+
this.player.play();
|
|
46
|
+
this.setPlayerState(PlayerState.PLAYING);
|
|
47
|
+
} else {
|
|
48
|
+
console.warn('Cannot resume: audio player not initialized');
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
play = createEffect(async uri => {
|
|
52
|
+
if (!this.player) {
|
|
53
|
+
console.warn('Audio player not initialized');
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.stopped = false;
|
|
57
|
+
this.player.replace(uri);
|
|
58
|
+
const waitForLoad = () => {
|
|
59
|
+
if (this.stopped) return;
|
|
60
|
+
if (this.player && this.player.isLoaded) {
|
|
61
|
+
const unsubscribe = this.player.addListener('playbackStatusUpdate', status => {
|
|
62
|
+
if (status.didJustFinish) {
|
|
63
|
+
this.playbackFinished();
|
|
64
|
+
unsubscribe?.remove?.();
|
|
65
|
+
this.setPlayerState(PlayerState.IDLE);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
this.player.play();
|
|
69
|
+
this.setPlayerState(PlayerState.PLAYING);
|
|
70
|
+
} else {
|
|
71
|
+
setTimeout(waitForLoad, 10);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
waitForLoad();
|
|
75
|
+
});
|
|
76
|
+
reinitialize() {
|
|
77
|
+
if (!this.player) {
|
|
78
|
+
this.player = createAudioPlayer();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
release() {
|
|
82
|
+
if (this.player) {
|
|
83
|
+
try {
|
|
84
|
+
this.stop();
|
|
85
|
+
this.player.remove();
|
|
86
|
+
} catch (error) {}
|
|
87
|
+
this.player.release();
|
|
88
|
+
this.player = null;
|
|
89
|
+
}
|
|
90
|
+
this.reset();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=Player.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","createEvent","restore","createAudioPlayer","setAudioModeAsync","PlayerState","PlayerModel","player","stopped","reset","setPlayerState","playbackFinished","$playerState","IDLE","setupAudioMode","playsInSilentMode","shouldPlayInBackground","interruptionMode","pause","PAUSED","console","warn","stop","replace","resume","play","PLAYING","uri","waitForLoad","isLoaded","unsubscribe","addListener","status","didJustFinish","remove","setTimeout","reinitialize","release","error"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/Player.model.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAsBC,iBAAiB,EAAEC,iBAAiB,QAAQ,YAAY;AAE9E,WAAkBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAO7B,OAAO,MAAMC,WAAW,CAAC;EAChBC,MAAM,GAAuBJ,iBAAiB,CAAC,CAAC;EAC/CK,OAAO,GAAG,KAAK;EAEPC,KAAK,GAAGR,WAAW,CAAC,CAAC;EACrBS,cAAc,GAAGT,WAAW,CAAc,CAAC;EAC3CU,gBAAgB,GAAGV,WAAW,CAAC,CAAC;EAEhCW,YAAY,GAAGV,OAAO,CAAC,IAAI,CAACQ,cAAc,EAAEL,WAAW,CAACQ,IAAI,CAAC,CAACJ,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAE/EK,cAAc,GAAGd,YAAY,CAAC,YAAY;IACxD,MAAMI,iBAAiB,CAAC;MACtBW,iBAAiB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IAAI,IAAI,CAACpB,OAAO,EAAE;MAClB,IAAI,IAAI,CAACD,MAAM,IAAI,IAAI,CAACA,MAAM,CAACsB,QAAQ,EAAE;QACvC,MAAMC,WAAW,GAAG,IAAI,CAACvB,MAAM,CAACwB,WAAW,CAAC,sBAAsB,EAAGC,MAAM,IAAK;UAC9E,IAAIA,MAAM,CAACC,aAAa,EAAE;YACxB,IAAI,CAACtB,gBAAgB,CAAC,CAAC;YACvBmB,WAAW,EAAEI,MAAM,GAAG,CAAC;YACvB,IAAI,CAACxB,cAAc,CAACL,WAAW,CAACQ,IAAI,CAAC;UACvC;QACF,CAAC,CAAC;QAEF,IAAI,CAACN,MAAM,CAACkB,IAAI,CAAC,CAAC;QAClB,IAAI,CAACf,cAAc,CAACL,WAAW,CAACqB,OAAO,CAAC;MAC1C,CAAC,MAAM;QACLS,UAAU,CAACP,WAAW,EAAE,EAAE,CAAC;MAC7B;IACF,CAAC;IAEDA,WAAW,CAAC,CAAC;EACf,CAAC,CAAC;EAEKQ,YAAYA,CAAA,EAAG;IACpB,IAAI,CAAC,IAAI,CAAC7B,MAAM,EAAE;MAChB,IAAI,CAACA,MAAM,GAAGJ,iBAAiB,CAAC,CAAC;IACnC;EACF;EAEOkC,OAAOA,CAAA,EAAG;IACf,IAAI,IAAI,CAAC9B,MAAM,EAAE;MACf,IAAI;QACF,IAAI,CAACe,IAAI,CAAC,CAAC;QACX,IAAI,CAACf,MAAM,CAAC2B,MAAM,CAAC,CAAC;MACtB,CAAC,CAAC,OAAOI,KAAK,EAAE,CAAC;MACjB,IAAI,CAAC/B,MAAM,CAAC8B,OAAO,CAAC,CAAC;MACrB,IAAI,CAAC9B,MAAM,GAAG,IAAI;IACpB;IACA,IAAI,CAACE,KAAK,CAAC,CAAC;EACd;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect, createEvent, restore } from 'effector';
|
|
4
|
+
import { NO_AUDIO_BE_MESSAGE, TRANSCRIPT_MAX_RETRIES, TRANSCRIPT_RETRY_INTERVAL_MS } from "../../constants.js";
|
|
5
|
+
export class TranscriptionsDownloaderModel {
|
|
6
|
+
setTranscriptsLoaded = createEvent();
|
|
7
|
+
reset = createEvent();
|
|
8
|
+
$transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset);
|
|
9
|
+
constructor(collection, api) {
|
|
10
|
+
this.collection = collection;
|
|
11
|
+
this.api = api;
|
|
12
|
+
}
|
|
13
|
+
async fetchTranscriptWithRetry(audioFileId) {
|
|
14
|
+
for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
|
|
15
|
+
const response = await this.api.getAudioFileTranscript(audioFileId);
|
|
16
|
+
if (response.status === 'completed') {
|
|
17
|
+
return response.text;
|
|
18
|
+
}
|
|
19
|
+
if (response.status === 'failed') {
|
|
20
|
+
return NO_AUDIO_BE_MESSAGE;
|
|
21
|
+
}
|
|
22
|
+
if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
|
|
23
|
+
await new Promise(resolve => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return NO_AUDIO_BE_MESSAGE;
|
|
27
|
+
}
|
|
28
|
+
loadAllTranscripts = createEffect(async () => {
|
|
29
|
+
const attempts = this.collection.getAll();
|
|
30
|
+
const transcriptPromises = attempts.map(async item => {
|
|
31
|
+
if (this.collection.hasTranscript(item.attemptNumber)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.collection.update(item.attemptNumber, {
|
|
35
|
+
transcriptLoading: true
|
|
36
|
+
});
|
|
37
|
+
try {
|
|
38
|
+
const text = await this.fetchTranscriptWithRetry(item.audioFileId);
|
|
39
|
+
this.collection.update(item.attemptNumber, {
|
|
40
|
+
transcript: text,
|
|
41
|
+
transcriptLoading: false,
|
|
42
|
+
transcriptError: undefined
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
this.collection.update(item.attemptNumber, {
|
|
46
|
+
transcriptLoading: false,
|
|
47
|
+
transcriptError: error instanceof Error ? error.message : 'Failed to load transcript'
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
await Promise.all(transcriptPromises);
|
|
52
|
+
this.setTranscriptsLoaded(true);
|
|
53
|
+
});
|
|
54
|
+
getTranscript(attemptNumber) {
|
|
55
|
+
return this.collection.get(attemptNumber)?.transcript;
|
|
56
|
+
}
|
|
57
|
+
isTranscriptLoading(attemptNumber) {
|
|
58
|
+
return this.collection.get(attemptNumber)?.transcriptLoading || false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=TranscriptionsDownloaderModel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","createEvent","restore","NO_AUDIO_BE_MESSAGE","TRANSCRIPT_MAX_RETRIES","TRANSCRIPT_RETRY_INTERVAL_MS","TranscriptionsDownloaderModel","setTranscriptsLoaded","reset","$transcriptsLoaded","constructor","collection","api","fetchTranscriptWithRetry","audioFileId","attempt","response","getAudioFileTranscript","status","text","Promise","resolve","setTimeout","loadAllTranscripts","attempts","getAll","transcriptPromises","map","item","hasTranscript","attemptNumber","update","transcriptLoading","transcript","transcriptError","undefined","error","Error","message","all","getTranscript","get","isTranscriptLoading"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAG7D,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,4BAA4B,QACvB,oBAAiB;AAExB,OAAO,MAAMC,6BAA6B,CAAC;EAIzBC,oBAAoB,GAAGN,WAAW,CAAU,CAAC;EAC7CO,KAAK,GAAGP,WAAW,CAAC,CAAC;EAErBQ,kBAAkB,GAAGP,OAAO,CAAC,IAAI,CAACK,oBAAoB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AI,CAACd,WAAW,CAAC;QAElE,IAAI,CAACH,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCG,UAAU,EAAEd,IAAI;UAChBa,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEC;QACnB,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd,IAAI,CAACzB,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCE,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEE,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAG;QAC5D,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;IAEF,MAAMlB,OAAO,CAACmB,GAAG,CAACb,kBAAkB,CAAC;IACrC,IAAI,CAACnB,oBAAoB,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;EAEKiC,aAAaA,CAACV,aAAqB,EAAsB;IAC9D,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEG,UAAU;EACvD;EAEOS,mBAAmBA,CAACZ,aAAqB,EAAW;IACzD,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEE,iBAAiB,IAAI,KAAK;EACvE;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect } from 'effector';
|
|
4
|
+
import { downloadAudioFileRequestGenerator } from "../../helpers.js";
|
|
5
|
+
export class VoiceFileDownloaderModel {
|
|
6
|
+
setApi = api => {
|
|
7
|
+
this.api = api;
|
|
8
|
+
};
|
|
9
|
+
download = createEffect(async ({
|
|
10
|
+
audioFileId,
|
|
11
|
+
attemptNumber
|
|
12
|
+
}) => {
|
|
13
|
+
const {
|
|
14
|
+
downloadAudio,
|
|
15
|
+
controller
|
|
16
|
+
} = downloadAudioFileRequestGenerator(audioFileId, this.api);
|
|
17
|
+
const downloadPromise = downloadAudio();
|
|
18
|
+
const collectionItem = {
|
|
19
|
+
attemptNumber,
|
|
20
|
+
audioFileId,
|
|
21
|
+
audioLoading: true,
|
|
22
|
+
audioDownloadPromise: downloadPromise,
|
|
23
|
+
controller
|
|
24
|
+
};
|
|
25
|
+
return {
|
|
26
|
+
collectionItem,
|
|
27
|
+
downloadPromise
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
abortDownload = controller => {
|
|
31
|
+
controller?.abort();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=VoiceFileDownloader.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","downloadAudioFileRequestGenerator","VoiceFileDownloaderModel","setApi","api","download","audioFileId","attemptNumber","downloadAudio","controller","downloadPromise","collectionItem","audioLoading","audioDownloadPromise","abortDownload","abort"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceFileDownloader.model.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AAEvC,SAASC,iCAAiC,QAAQ,kBAAe;AAYjE,OAAO,MAAMC,wBAAwB,CAAC;EAGpBC,MAAM,GAAIC,GAAmB,IAAK;IAChD,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB,CAAC;EAEeC,QAAQ,GAAGL,YAAY,CACrC,OAAO;IAAEM,WAAW;IAAEC;EAA8B,CAAC,KAA8B;IACjF,MAAM;MAAEC,aAAa;MAAEC;IAAW,CAAC,GAAGR,iCAAiC,CAACK,WAAW,EAAE,IAAI,CAACF,GAAG,CAAC;IAC9F,MAAMM,eAAe,GAAGF,aAAa,CAAC,CAAC;IAEvC,MAAMG,cAA+C,GAAG;MACtDJ,aAAa;MACbD,WAAW;MACXM,YAAY,EAAE,IAAI;MAClBC,oBAAoB,EAAEH,eAAe;MACrCD;IACF,CAAC;IAED,OAAO;MAAEE,cAAc;MAAED;IAAgB,CAAC;EAC5C,CACF,CAAC;EAEeI,aAAa,GAAIL,UAA4B,IAAK;IAChEA,UAAU,EAAEM,KAAK,CAAC,CAAC;EACrB,CAAC;AACH","ignoreList":[]}
|