@magmamath/students-features 0.1.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/README.md +33 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +60 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +96 -0
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +97 -0
- package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js +27 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +56 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +88 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +87 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +43 -0
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +130 -0
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Chatbot.js +69 -0
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +65 -0
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -0
- package/dist/commonjs/features/chatbot/constants.js +31 -0
- package/dist/commonjs/features/chatbot/constants.js.map +1 -0
- package/dist/commonjs/features/chatbot/helpers.js +12 -0
- package/dist/commonjs/features/chatbot/helpers.js.map +1 -0
- package/dist/commonjs/features/chatbot/index.js +34 -0
- package/dist/commonjs/features/chatbot/index.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/api.js +18 -0
- package/dist/commonjs/features/chatbot/model/api.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/model.js +244 -0
- package/dist/commonjs/features/chatbot/model/model.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/t2s.js +104 -0
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/translation.js +203 -0
- package/dist/commonjs/features/chatbot/model/translation.js.map +1 -0
- package/dist/commonjs/features/chatbot/types/api.types.js +2 -0
- package/dist/commonjs/features/chatbot/types/api.types.js.map +1 -0
- package/dist/commonjs/features/chatbot/types/model.types.js +12 -0
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -0
- package/dist/commonjs/features/chatbot/types/t2s.types.js +13 -0
- package/dist/commonjs/features/chatbot/types/t2s.types.js.map +1 -0
- package/dist/commonjs/features/chatbot/types/translation.types.js +6 -0
- package/dist/commonjs/features/chatbot/types/translation.types.js.map +1 -0
- package/dist/commonjs/index.js +42 -0
- package/dist/commonjs/index.js.map +1 -0
- package/dist/commonjs/lib/createFeature/createFeature.js +28 -0
- package/dist/commonjs/lib/createFeature/createFeature.js.map +1 -0
- package/dist/commonjs/lib/effector/createControllerEffect.js +51 -0
- package/dist/commonjs/lib/effector/createControllerEffect.js.map +1 -0
- package/dist/commonjs/lib/effector/createEntityFieldStore.js +42 -0
- package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -0
- package/dist/commonjs/lib/effector/index.js +20 -0
- package/dist/commonjs/lib/effector/index.js.map +1 -0
- package/dist/commonjs/lib/helpers/helpers.js +9 -0
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -0
- package/dist/commonjs/lib/localization/en.json +2 -0
- package/dist/commonjs/lib/localization/gb.json +2 -0
- package/dist/commonjs/lib/localization/sw.json +2 -0
- package/dist/commonjs/shared/hooks/useDebounce.js +21 -0
- package/dist/commonjs/shared/hooks/useDebounce.js.map +1 -0
- package/dist/commonjs/shared/icons/ArrowRightIcon.js +30 -0
- package/dist/commonjs/shared/icons/ArrowRightIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/ChatbotIcon.js +148 -0
- package/dist/commonjs/shared/icons/ChatbotIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/CloseIcon.js +28 -0
- package/dist/commonjs/shared/icons/CloseIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/GlobeIcon.js +30 -0
- package/dist/commonjs/shared/icons/GlobeIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/PauseIcon.js +32 -0
- package/dist/commonjs/shared/icons/PauseIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/PlayIcon.js +32 -0
- package/dist/commonjs/shared/icons/PlayIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/SpeakerIcon.js +37 -0
- package/dist/commonjs/shared/icons/SpeakerIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/icon.types.js +2 -0
- package/dist/commonjs/shared/icons/icon.types.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +17 -0
- package/dist/commonjs/shared/translation/constants.js.map +1 -0
- package/dist/commonjs/shared/translation/helpers.js +31 -0
- package/dist/commonjs/shared/translation/helpers.js.map +1 -0
- package/dist/commonjs/shared/translation/hooks.js +28 -0
- package/dist/commonjs/shared/translation/hooks.js.map +1 -0
- package/dist/commonjs/shared/translation/index.js +52 -0
- package/dist/commonjs/shared/translation/index.js.map +1 -0
- package/dist/commonjs/shared/translation/model.js +15 -0
- package/dist/commonjs/shared/translation/model.js.map +1 -0
- package/dist/commonjs/shared/translation/types.js +13 -0
- package/dist/commonjs/shared/translation/types.js.map +1 -0
- package/dist/commonjs/types/types.d.js +2 -0
- package/dist/commonjs/types/types.d.js.map +1 -0
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +54 -0
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -0
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +90 -0
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +91 -0
- package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js +21 -0
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +50 -0
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +82 -0
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +81 -0
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +37 -0
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +123 -0
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -0
- package/dist/module/features/chatbot/components/Chatbot.js +63 -0
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -0
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +59 -0
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -0
- package/dist/module/features/chatbot/constants.js +27 -0
- package/dist/module/features/chatbot/constants.js.map +1 -0
- package/dist/module/features/chatbot/helpers.js +7 -0
- package/dist/module/features/chatbot/helpers.js.map +1 -0
- package/dist/module/features/chatbot/index.js +7 -0
- package/dist/module/features/chatbot/index.js.map +1 -0
- package/dist/module/features/chatbot/model/api.js +13 -0
- package/dist/module/features/chatbot/model/api.js.map +1 -0
- package/dist/module/features/chatbot/model/model.js +239 -0
- package/dist/module/features/chatbot/model/model.js.map +1 -0
- package/dist/module/features/chatbot/model/t2s.js +99 -0
- package/dist/module/features/chatbot/model/t2s.js.map +1 -0
- package/dist/module/features/chatbot/model/translation.js +198 -0
- package/dist/module/features/chatbot/model/translation.js.map +1 -0
- package/dist/module/features/chatbot/types/api.types.js +2 -0
- package/dist/module/features/chatbot/types/api.types.js.map +1 -0
- package/dist/module/features/chatbot/types/model.types.js +8 -0
- package/dist/module/features/chatbot/types/model.types.js.map +1 -0
- package/dist/module/features/chatbot/types/t2s.types.js +9 -0
- package/dist/module/features/chatbot/types/t2s.types.js.map +1 -0
- package/dist/module/features/chatbot/types/translation.types.js +4 -0
- package/dist/module/features/chatbot/types/translation.types.js.map +1 -0
- package/dist/module/index.js +5 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/lib/createFeature/createFeature.js +22 -0
- package/dist/module/lib/createFeature/createFeature.js.map +1 -0
- package/dist/module/lib/effector/createControllerEffect.js +45 -0
- package/dist/module/lib/effector/createControllerEffect.js.map +1 -0
- package/dist/module/lib/effector/createEntityFieldStore.js +38 -0
- package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -0
- package/dist/module/lib/effector/index.js +5 -0
- package/dist/module/lib/effector/index.js.map +1 -0
- package/dist/module/lib/helpers/helpers.js +4 -0
- package/dist/module/lib/helpers/helpers.js.map +1 -0
- package/dist/module/lib/localization/en.json +2 -0
- package/dist/module/lib/localization/gb.json +2 -0
- package/dist/module/lib/localization/sw.json +2 -0
- package/dist/module/shared/hooks/useDebounce.js +16 -0
- package/dist/module/shared/hooks/useDebounce.js.map +1 -0
- package/dist/module/shared/icons/ArrowRightIcon.js +22 -0
- package/dist/module/shared/icons/ArrowRightIcon.js.map +1 -0
- package/dist/module/shared/icons/ChatbotIcon.js +140 -0
- package/dist/module/shared/icons/ChatbotIcon.js.map +1 -0
- package/dist/module/shared/icons/CloseIcon.js +20 -0
- package/dist/module/shared/icons/CloseIcon.js.map +1 -0
- package/dist/module/shared/icons/GlobeIcon.js +22 -0
- package/dist/module/shared/icons/GlobeIcon.js.map +1 -0
- package/dist/module/shared/icons/PauseIcon.js +24 -0
- package/dist/module/shared/icons/PauseIcon.js.map +1 -0
- package/dist/module/shared/icons/PlayIcon.js +24 -0
- package/dist/module/shared/icons/PlayIcon.js.map +1 -0
- package/dist/module/shared/icons/SpeakerIcon.js +29 -0
- package/dist/module/shared/icons/SpeakerIcon.js.map +1 -0
- package/dist/module/shared/icons/icon.types.js +2 -0
- package/dist/module/shared/icons/icon.types.js.map +1 -0
- package/dist/module/shared/translation/constants.js +12 -0
- package/dist/module/shared/translation/constants.js.map +1 -0
- package/dist/module/shared/translation/helpers.js +24 -0
- package/dist/module/shared/translation/helpers.js.map +1 -0
- package/dist/module/shared/translation/hooks.js +22 -0
- package/dist/module/shared/translation/hooks.js.map +1 -0
- package/dist/module/shared/translation/index.js +7 -0
- package/dist/module/shared/translation/index.js.map +1 -0
- package/dist/module/shared/translation/model.js +11 -0
- package/dist/module/shared/translation/model.js.map +1 -0
- package/dist/module/shared/translation/types.js +9 -0
- package/dist/module/shared/translation/types.js.map +1 -0
- package/dist/module/types/types.d.js +2 -0
- package/dist/module/types/types.d.js.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +11 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +9 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +14 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +17 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +12 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +4 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts +4 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +21 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +25 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts +9 -0
- package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +21 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts +2 -0
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts +12 -0
- package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/model.d.ts +73 -0
- package/dist/typescript/commonjs/features/chatbot/model/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +18 -0
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +22 -0
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +60 -0
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +64 -0
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +22 -0
- package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +23 -0
- package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/index.d.ts +4 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/createFeature/createFeature.d.ts +7 -0
- package/dist/typescript/commonjs/lib/createFeature/createFeature.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +16 -0
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +16 -0
- package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/effector/index.d.ts +3 -0
- package/dist/typescript/commonjs/lib/effector/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts +2 -0
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/package.json +1 -0
- package/dist/typescript/commonjs/shared/hooks/useDebounce.d.ts +2 -0
- package/dist/typescript/commonjs/shared/hooks/useDebounce.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/ArrowRightIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ArrowRightIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/ChatbotIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ChatbotIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/CloseIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/CloseIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/GlobeIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/GlobeIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/PauseIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/PauseIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/PlayIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/PlayIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/SpeakerIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/SpeakerIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +9 -0
- package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +6 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts +6 -0
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts +5 -0
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/index.d.ts +6 -0
- package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts +5 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/types.d.ts +8 -0
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +11 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +9 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +14 -0
- package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +17 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +12 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +4 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts +4 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +21 -0
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +25 -0
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts +9 -0
- package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts +21 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/helpers.d.ts +2 -0
- package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/index.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/api.d.ts +12 -0
- package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/model.d.ts +73 -0
- package/dist/typescript/module/features/chatbot/model/model.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts +18 -0
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/translation.d.ts +22 -0
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +60 -0
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +64 -0
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +22 -0
- package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +23 -0
- package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -0
- package/dist/typescript/module/index.d.ts +4 -0
- package/dist/typescript/module/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/createFeature/createFeature.d.ts +7 -0
- package/dist/typescript/module/lib/createFeature/createFeature.d.ts.map +1 -0
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +16 -0
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -0
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +16 -0
- package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -0
- package/dist/typescript/module/lib/effector/index.d.ts +3 -0
- package/dist/typescript/module/lib/effector/index.d.ts.map +1 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts +2 -0
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -0
- package/dist/typescript/module/package.json +1 -0
- package/dist/typescript/module/shared/hooks/useDebounce.d.ts +2 -0
- package/dist/typescript/module/shared/hooks/useDebounce.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/ArrowRightIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ArrowRightIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/ChatbotIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ChatbotIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/CloseIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/CloseIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/GlobeIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/GlobeIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/PauseIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/PauseIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/PlayIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/PlayIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/SpeakerIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/SpeakerIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/icon.types.d.ts +9 -0
- package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +6 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/helpers.d.ts +6 -0
- package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/hooks.d.ts +5 -0
- package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/index.d.ts +6 -0
- package/dist/typescript/module/shared/translation/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/model.d.ts +5 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/types.d.ts +8 -0
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -0
- package/package.json +73 -0
- package/src/features/chatbot/components/Alternatives/Alternatives.tsx +64 -0
- package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +92 -0
- package/src/features/chatbot/components/ChatControls/ChatControls.tsx +103 -0
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +28 -0
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +42 -0
- package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +78 -0
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +73 -0
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +31 -0
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +148 -0
- package/src/features/chatbot/components/Chatbot.tsx +92 -0
- package/src/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx +77 -0
- package/src/features/chatbot/constants.ts +30 -0
- package/src/features/chatbot/helpers.ts +4 -0
- package/src/features/chatbot/index.ts +4 -0
- package/src/features/chatbot/model/api.ts +28 -0
- package/src/features/chatbot/model/model.ts +277 -0
- package/src/features/chatbot/model/t2s.ts +107 -0
- package/src/features/chatbot/model/translation.ts +231 -0
- package/src/features/chatbot/types/api.types.ts +59 -0
- package/src/features/chatbot/types/model.types.ts +73 -0
- package/src/features/chatbot/types/t2s.types.ts +24 -0
- package/src/features/chatbot/types/translation.types.ts +23 -0
- package/src/index.ts +3 -0
- package/src/lib/createFeature/createFeature.tsx +21 -0
- package/src/lib/effector/createControllerEffect.ts +66 -0
- package/src/lib/effector/createEntityFieldStore.ts +43 -0
- package/src/lib/effector/index.ts +2 -0
- package/src/lib/helpers/helpers.ts +2 -0
- package/src/lib/localization/en.json +2 -0
- package/src/lib/localization/gb.json +2 -0
- package/src/lib/localization/sw.json +2 -0
- package/src/shared/hooks/useDebounce.ts +17 -0
- package/src/shared/icons/ArrowRightIcon.tsx +14 -0
- package/src/shared/icons/ChatbotIcon.tsx +109 -0
- package/src/shared/icons/CloseIcon.tsx +12 -0
- package/src/shared/icons/GlobeIcon.tsx +14 -0
- package/src/shared/icons/PauseIcon.tsx +16 -0
- package/src/shared/icons/PlayIcon.tsx +16 -0
- package/src/shared/icons/SpeakerIcon.tsx +22 -0
- package/src/shared/icons/icon.types.ts +8 -0
- package/src/shared/translation/constants.ts +10 -0
- package/src/shared/translation/helpers.ts +34 -0
- package/src/shared/translation/hooks.ts +28 -0
- package/src/shared/translation/index.ts +5 -0
- package/src/shared/translation/model.ts +15 -0
- package/src/shared/translation/types.ts +9 -0
- package/src/types/types.d.ts +4 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ActivityIndicator, Pressable, StyleSheet, TouchableOpacity } from 'react-native';
|
|
5
|
+
import { SpeakerIcon } from "../../../../shared/icons/SpeakerIcon.js";
|
|
6
|
+
import { PlayIcon } from "../../../../shared/icons/PlayIcon.js";
|
|
7
|
+
import { PauseIcon } from "../../../../shared/icons/PauseIcon.js";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const TextToSpeechIcon = ({
|
|
10
|
+
status,
|
|
11
|
+
isActive,
|
|
12
|
+
isLoading
|
|
13
|
+
}) => {
|
|
14
|
+
if (isLoading && isActive) {
|
|
15
|
+
return /*#__PURE__*/_jsx(ActivityIndicator, {});
|
|
16
|
+
}
|
|
17
|
+
if (!isActive) {
|
|
18
|
+
return /*#__PURE__*/_jsx(SpeakerIcon, {
|
|
19
|
+
color: isActive ? '#55ABE0' : undefined
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (status === 'playing') return /*#__PURE__*/_jsx(PauseIcon, {
|
|
23
|
+
color: "#FFF"
|
|
24
|
+
});
|
|
25
|
+
if (status === 'paused') return /*#__PURE__*/_jsx(PlayIcon, {
|
|
26
|
+
color: "#FFF"
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/_jsx(SpeakerIcon, {
|
|
29
|
+
color: isActive ? '#55ABE0' : undefined
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export const MessageTextToSpeech = ({
|
|
33
|
+
status,
|
|
34
|
+
disabled,
|
|
35
|
+
isActive,
|
|
36
|
+
isLoading,
|
|
37
|
+
onPress
|
|
38
|
+
}) => /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
39
|
+
style: styles.container,
|
|
40
|
+
onPress: onPress,
|
|
41
|
+
children: /*#__PURE__*/_jsx(Pressable, {
|
|
42
|
+
disabled: disabled,
|
|
43
|
+
onPress: onPress,
|
|
44
|
+
style: [styles.button, {
|
|
45
|
+
backgroundColor: isActive && !isLoading ? '#55ABE0' : '#FFF'
|
|
46
|
+
}],
|
|
47
|
+
children: /*#__PURE__*/_jsx(TextToSpeechIcon, {
|
|
48
|
+
isActive: isActive,
|
|
49
|
+
isLoading: isLoading,
|
|
50
|
+
status: status
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
});
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
alignSelf: 'flex-end',
|
|
57
|
+
justifyContent: 'flex-end',
|
|
58
|
+
width: 45,
|
|
59
|
+
height: '100%'
|
|
60
|
+
},
|
|
61
|
+
button: {
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
width: 28,
|
|
65
|
+
height: 28,
|
|
66
|
+
padding: 1,
|
|
67
|
+
marginLeft: 'auto',
|
|
68
|
+
shadowColor: '#333',
|
|
69
|
+
shadowOffset: {
|
|
70
|
+
width: 0,
|
|
71
|
+
height: 1
|
|
72
|
+
},
|
|
73
|
+
shadowOpacity: 0.25,
|
|
74
|
+
shadowRadius: 3,
|
|
75
|
+
elevation: 3,
|
|
76
|
+
borderRadius: 6,
|
|
77
|
+
borderColor: '#F2F2F4',
|
|
78
|
+
borderWidth: 0.5,
|
|
79
|
+
backgroundColor: '#FFF'
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=MessageTextToSpeech.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ActivityIndicator","Pressable","StyleSheet","TouchableOpacity","SpeakerIcon","PlayIcon","PauseIcon","jsx","_jsx","TextToSpeechIcon","status","isActive","isLoading","color","undefined","MessageTextToSpeech","disabled","onPress","style","styles","container","children","button","backgroundColor","create","alignSelf","justifyContent","width","height","alignItems","padding","marginLeft","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderColor","borderWidth"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AACzF,SAASC,WAAW,QAAQ,yCAAsC;AAClE,SAASC,QAAQ,QAAQ,sCAAmC;AAC5D,SAASC,SAAS,QAAQ,uCAAoC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAS9D,MAAMC,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KAAK;EACnF,IAAIA,SAAS,IAAID,QAAQ,EAAE;IACzB,oBAAOH,IAAA,CAACR,iBAAiB,IA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,MAAM,EAAE;IACNO,UAAU,EAAE,QAAQ;IACpBH,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVE,OAAO,EAAE,CAAC;IACVC,UAAU,EAAE,MAAM;IAClBC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEN,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCM,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,SAAS;IACtBC,WAAW,EAAE,GAAG;IAChBhB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { ChatbotIcon } from "../../../../shared/icons/ChatbotIcon.js";
|
|
6
|
+
import { MessageTextToSpeech } from "./MessageTextToSpeech.js";
|
|
7
|
+
import { MessageVariant } from "../../types/model.types.js";
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const ReceivedMessage = ({
|
|
10
|
+
message,
|
|
11
|
+
onPressTextToSpeech,
|
|
12
|
+
isTextToSpeechPending,
|
|
13
|
+
isActive,
|
|
14
|
+
audioStatus,
|
|
15
|
+
renderer,
|
|
16
|
+
withTextToSpeech = true
|
|
17
|
+
}) => /*#__PURE__*/_jsxs(View, {
|
|
18
|
+
style: styles.container,
|
|
19
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
20
|
+
style: styles.icon,
|
|
21
|
+
children: /*#__PURE__*/_jsx(ChatbotIcon, {
|
|
22
|
+
width: 38,
|
|
23
|
+
height: 38
|
|
24
|
+
})
|
|
25
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
26
|
+
style: styles.message,
|
|
27
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
28
|
+
style: [styles.messageText, {
|
|
29
|
+
width: withTextToSpeech ? 240 : 305
|
|
30
|
+
}],
|
|
31
|
+
children: renderer ? renderer({
|
|
32
|
+
message,
|
|
33
|
+
variant: MessageVariant.RECEIVED,
|
|
34
|
+
withTextToSpeech
|
|
35
|
+
}) : message
|
|
36
|
+
}), withTextToSpeech && /*#__PURE__*/_jsx(MessageTextToSpeech, {
|
|
37
|
+
isActive: isActive,
|
|
38
|
+
isLoading: isTextToSpeechPending,
|
|
39
|
+
onPress: onPressTextToSpeech,
|
|
40
|
+
disabled: isTextToSpeechPending,
|
|
41
|
+
status: audioStatus
|
|
42
|
+
})]
|
|
43
|
+
})]
|
|
44
|
+
});
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
container: {
|
|
47
|
+
flex: 1,
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
maxWidth: 350,
|
|
50
|
+
width: 350
|
|
51
|
+
},
|
|
52
|
+
icon: {
|
|
53
|
+
alignSelf: 'flex-end',
|
|
54
|
+
marginRight: 8
|
|
55
|
+
},
|
|
56
|
+
message: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
flexDirection: 'row',
|
|
59
|
+
maxWidth: 305,
|
|
60
|
+
padding: 8,
|
|
61
|
+
shadowColor: '#333',
|
|
62
|
+
shadowOffset: {
|
|
63
|
+
width: 0,
|
|
64
|
+
height: 1
|
|
65
|
+
},
|
|
66
|
+
shadowOpacity: 0.25,
|
|
67
|
+
shadowRadius: 3,
|
|
68
|
+
elevation: 3,
|
|
69
|
+
borderRadius: 8,
|
|
70
|
+
borderBottomLeftRadius: 0,
|
|
71
|
+
backgroundColor: '#F2F2F4'
|
|
72
|
+
},
|
|
73
|
+
messageText: {
|
|
74
|
+
flex: 1,
|
|
75
|
+
fontSize: 20,
|
|
76
|
+
fontWeight: 400,
|
|
77
|
+
fontFamily: 'Buenos Aires',
|
|
78
|
+
color: '#33334D'
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=ReceivedMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","View","ChatbotIcon","MessageTextToSpeech","MessageVariant","jsx","_jsx","jsxs","_jsxs","ReceivedMessage","message","onPressTextToSpeech","isTextToSpeechPending","isActive","audioStatus","renderer","withTextToSpeech","style","styles","container","children","icon","width","height","messageText","variant","RECEIVED","isLoading","onPress","disabled","status","create","flex","flexDirection","maxWidth","alignSelf","marginRight","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderBottomLeftRadius","backgroundColor","fontSize","fontWeight","fontFamily","color"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ReceivedMessage.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SAASC,WAAW,QAAQ,yCAAsC;AAClE,SAASC,mBAAmB,QAAQ,0BAAuB;AAC3D,SAASC,cAAc,QAAQ,4BAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAExD,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,OAAO;EACPC,mBAAmB;EACnBC,qBAAqB;EACrBC,QAAQ;EACRC,WAAW;EACXC,QAAQ;EACRC,gBAAgB,GAAG;AACP,CAAC,kBACbR,KAAA,CAACP,IAAI;EAACgB,KAAK,EAAEC,MAAM,CAACC,SAAU;EAAAC,QAAA,gBAC5Bd,IAAA,CAACL,IAAI;IAACgB,KAAK,EAAEC,MAAM,CAACG,IAAK;IAAAD,QAAA,eACvBd,IAAA,CAACJ,WAAW;MAACoB,KAAK,EAAE,EAAG;MAACC,MAAM,EAAE;IAAG,CAAE;EAAC,CAClC,CAAC,eAEPf,KAAA,CAACP,IAAI;IAACgB,KAAK,EAAEC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AAC;IACPc,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,GAAG;IACfC,UAAU,EAAE,cAAc;IAC1BC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
5
|
+
import { MessageVariant } from "../../types/model.types.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const SentMessage = ({
|
|
8
|
+
message,
|
|
9
|
+
renderer
|
|
10
|
+
}) => /*#__PURE__*/_jsx(View, {
|
|
11
|
+
style: styles.container,
|
|
12
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
13
|
+
style: styles.text,
|
|
14
|
+
children: renderer ? renderer({
|
|
15
|
+
message,
|
|
16
|
+
variant: MessageVariant.SENT,
|
|
17
|
+
withTextToSpeech: false
|
|
18
|
+
}) : message
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
const styles = StyleSheet.create({
|
|
22
|
+
container: {
|
|
23
|
+
alignSelf: 'flex-end',
|
|
24
|
+
maxWidth: 305,
|
|
25
|
+
padding: 8,
|
|
26
|
+
borderRadius: 8,
|
|
27
|
+
borderBottomRightRadius: 0,
|
|
28
|
+
backgroundColor: '#55ABE0'
|
|
29
|
+
},
|
|
30
|
+
text: {
|
|
31
|
+
fontSize: 20,
|
|
32
|
+
fontWeight: 400,
|
|
33
|
+
fontFamily: 'Buenos Aires',
|
|
34
|
+
color: '#FFF'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=SentMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","View","MessageVariant","jsx","_jsx","SentMessage","message","renderer","style","styles","container","children","text","variant","SENT","withTextToSpeech","create","alignSelf","maxWidth","padding","borderRadius","borderBottomRightRadius","backgroundColor","fontSize","fontWeight","fontFamily","color"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/SentMessage.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AAErD,SAASC,cAAc,QAAQ,4BAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAExD,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAuB,CAAC,kBAC7DH,IAAA,CAACH,IAAI;EAACO,KAAK,EAAEC,MAAM,CAACC,SAAU;EAAAC,QAAA,eAC5BP,IAAA,CAACJ,IAAI;IAACQ,KAAK,EAAEC,MAAM,CAACG,IAAK;IAAAD,QAAA,EACtBJ,QAAQ,GACLA,QAAQ,CAAC;MAAED,OAAO;MAAEO,OAAO,EAAEX,cAAc,CAACY,IAAI;MAAEC,gBAAgB,EAAE;IAAM,CAAC,CAAC,GAC5ET;EAAO,CACP;AAAC,CACH,CACP;AAED,MAAMG,MAAM,GAAGV,UAAU,CAACiB,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,SAAS,EAAE,UAAU;IACrBC,QAAQ,EAAE,GAAG;IACbC,OAAO,EAAE,CAAC;IACVC,YAAY,EAAE,CAAC;IACfC,uBAAuB,EAAE,CAAC;IAC1BC,eAAe,EAAE;EACnB,CAAC;EACDV,IAAI,EAAE;IACJW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,GAAG;IACfC,UAAU,EAAE,cAAc;IAC1BC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useRef } from 'react';
|
|
4
|
+
import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
|
+
import { useStoreMap, useUnit } from 'effector-react';
|
|
6
|
+
import { ChatMessage } from "../ChatMessage/ChatMessage.js";
|
|
7
|
+
import { MessageLoader } from "../ChatMessage/MessageLoader.js";
|
|
8
|
+
import { Alternatives } from "../Alternatives/Alternatives.js";
|
|
9
|
+
import { TEXT_TO_SPEECH_CONFIG } from "../../constants.js";
|
|
10
|
+
import { MessageVariant } from "../../types/model.types.js";
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const TOOLBAR_HEIGHT = 140;
|
|
13
|
+
const BOTTOM_OFFSET = Platform.OS === 'web' ? 250 : 284;
|
|
14
|
+
export const ChatbotMessages = ({
|
|
15
|
+
model,
|
|
16
|
+
isHintFeedback,
|
|
17
|
+
sendHelpRequestPayload,
|
|
18
|
+
translationTargetLanguage,
|
|
19
|
+
sanitizeSpeechInput,
|
|
20
|
+
isTextToSpeechEnabled,
|
|
21
|
+
textToSpeechConfig,
|
|
22
|
+
renderer
|
|
23
|
+
}) => {
|
|
24
|
+
const dimensions = useWindowDimensions();
|
|
25
|
+
const ref = useRef(null);
|
|
26
|
+
const assignmentId = useUnit(model.credits.$assignmentId);
|
|
27
|
+
const exerciseId = useUnit(model.credits.$exerciseId);
|
|
28
|
+
const isOpen = useUnit(model.$isOpen);
|
|
29
|
+
const isHelpRequestPending = useUnit(model.sendHelpRequestFx.pending);
|
|
30
|
+
const isTextToSpeechPending = useUnit(model.api.textToSpeechTextFx.pending);
|
|
31
|
+
const currentPlayingId = useUnit(model.t2s.$currentPlayingId);
|
|
32
|
+
const isTranslated = useUnit(model.translation.$isTranslated);
|
|
33
|
+
const audioStatus = useUnit(model.t2s.$status);
|
|
34
|
+
const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET;
|
|
35
|
+
const messages = useStoreMap({
|
|
36
|
+
store: model.messages.$state,
|
|
37
|
+
keys: [assignmentId, exerciseId],
|
|
38
|
+
fn: state => state[assignmentId]?.[exerciseId]?.messages ?? []
|
|
39
|
+
});
|
|
40
|
+
const playTextToSpeech = (id, message, translatedMessage) => {
|
|
41
|
+
if (isTranslated) {
|
|
42
|
+
model.t2s.play({
|
|
43
|
+
text: sanitizeSpeechInput(translatedMessage),
|
|
44
|
+
messageId: id,
|
|
45
|
+
isTranslated: true,
|
|
46
|
+
config: textToSpeechConfig ?? TEXT_TO_SPEECH_CONFIG
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
model.t2s.play({
|
|
50
|
+
text: sanitizeSpeechInput(message),
|
|
51
|
+
messageId: id,
|
|
52
|
+
isTranslated: false,
|
|
53
|
+
config: textToSpeechConfig ?? TEXT_TO_SPEECH_CONFIG
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const askChatForHelp = (message, promptKey, translatedMessage) => {
|
|
58
|
+
model.sendHelpRequestFx({
|
|
59
|
+
payload: {
|
|
60
|
+
...sendHelpRequestPayload,
|
|
61
|
+
type: promptKey
|
|
62
|
+
},
|
|
63
|
+
message,
|
|
64
|
+
translatedMessage,
|
|
65
|
+
translationTargetLanguage
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
return /*#__PURE__*/_jsx(View, {
|
|
69
|
+
style: [styles.container, {
|
|
70
|
+
maxHeight: MAX_HEIGHT
|
|
71
|
+
}],
|
|
72
|
+
children: /*#__PURE__*/_jsxs(ScrollView, {
|
|
73
|
+
ref: ref,
|
|
74
|
+
contentContainerStyle: styles.list,
|
|
75
|
+
onContentSizeChange: (_, height) => {
|
|
76
|
+
ref.current?.scrollToEnd();
|
|
77
|
+
if (height >= MAX_HEIGHT) {
|
|
78
|
+
model.setScrollActive(true);
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
children: [isOpen && /*#__PURE__*/_jsxs(View, {
|
|
82
|
+
style: styles.gap,
|
|
83
|
+
children: [messages.map(({
|
|
84
|
+
id,
|
|
85
|
+
message,
|
|
86
|
+
translatedMessage,
|
|
87
|
+
isOwnMessage
|
|
88
|
+
}) => /*#__PURE__*/_jsx(ChatMessage, {
|
|
89
|
+
message: isTranslated ? translatedMessage : message,
|
|
90
|
+
renderer: renderer,
|
|
91
|
+
audioStatus: audioStatus,
|
|
92
|
+
onPressTextToSpeech: () => playTextToSpeech(id, message, translatedMessage),
|
|
93
|
+
isActive: id === currentPlayingId,
|
|
94
|
+
isTextToSpeechPending: isTextToSpeechPending,
|
|
95
|
+
variant: isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED,
|
|
96
|
+
withTextToSpeech: isTextToSpeechEnabled && !isOwnMessage
|
|
97
|
+
}, id)), isHelpRequestPending && /*#__PURE__*/_jsx(MessageLoader, {})]
|
|
98
|
+
}), !isHelpRequestPending && isOpen && /*#__PURE__*/_jsx(Alternatives, {
|
|
99
|
+
model: model,
|
|
100
|
+
onPressAlternative: askChatForHelp,
|
|
101
|
+
hasMessages: messages.length > 1,
|
|
102
|
+
isHintFeedback: isHintFeedback
|
|
103
|
+
})]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const styles = StyleSheet.create({
|
|
108
|
+
container: {
|
|
109
|
+
flex: 1,
|
|
110
|
+
alignItems: 'flex-end',
|
|
111
|
+
width: 350,
|
|
112
|
+
height: '100%'
|
|
113
|
+
},
|
|
114
|
+
list: {
|
|
115
|
+
alignItems: 'flex-end',
|
|
116
|
+
paddingVertical: 2
|
|
117
|
+
},
|
|
118
|
+
gap: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
gap: 8
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
//# sourceMappingURL=ChatbotMessages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","Platform","ScrollView","StyleSheet","useWindowDimensions","View","useStoreMap","useUnit","ChatMessage","MessageLoader","Alternatives","TEXT_TO_SPEECH_CONFIG","MessageVariant","jsx","_jsx","jsxs","_jsxs","TOOLBAR_HEIGHT","BOTTOM_OFFSET","OS","ChatbotMessages","model","isHintFeedback","sendHelpRequestPayload","translationTargetLanguage","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","renderer","dimensions","ref","assignmentId","credits","$assignmentId","exerciseId","$exerciseId","isOpen","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","MAX_HEIGHT","height","messages","store","$state","keys","fn","state","playTextToSpeech","id","message","translatedMessage","play","text","messageId","config","askChatForHelp","promptKey","payload","type","style","styles","container","maxHeight","children","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","isOwnMessage","onPressTextToSpeech","isActive","variant","SENT","RECEIVED","withTextToSpeech","onPressAlternative","hasMessages","length","create","flex","alignItems","width","paddingVertical"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAeC,MAAM,QAAQ,OAAO;AAChD,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC1F,SAASC,WAAW,EAAEC,OAAO,QAAQ,gBAAgB;AAErD,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAASC,aAAa,QAAQ,iCAA8B;AAC5D,SAASC,YAAY,QAAQ,iCAA8B;AAE3D,SAAsCC,qBAAqB,QAAQ,oBAAiB;AACpF,SAASC,cAAc,QAAyB,4BAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAgBzE,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,aAAa,GAAGjB,QAAQ,CAACkB,EAAE,KAAK,KAAK,GAAG,GAAG,GAAG,GAAG;AAEvD,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,KAAK;EACLC,cAAc;EACdC,sBAAsB;EACtBC,yBAAyB;EACzBC,mBAAmB;EACnBC,qBAAqB;EACrBC,kBAA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,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect } from 'react';
|
|
4
|
+
import { useStoreMap, useUnit } from 'effector-react';
|
|
5
|
+
import { ChatbotMessages } from "./ChatMessages/ChatbotMessages.js";
|
|
6
|
+
import { ChatControls } from "./ChatControls/ChatControls.js";
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export const Chatbot = ({
|
|
10
|
+
model,
|
|
11
|
+
translationTargetLanguage,
|
|
12
|
+
isEnabled,
|
|
13
|
+
isHintFeedback,
|
|
14
|
+
sendHelpRequestPayload,
|
|
15
|
+
sanitizeSpeechInput,
|
|
16
|
+
isTextToSpeechEnabled = false,
|
|
17
|
+
textToSpeechConfig,
|
|
18
|
+
isTranslationEnabled,
|
|
19
|
+
renderer,
|
|
20
|
+
ButtonWrapper
|
|
21
|
+
}) => {
|
|
22
|
+
const assignmentId = useUnit(model.credits.$assignmentId);
|
|
23
|
+
const exerciseId = useUnit(model.credits.$exerciseId);
|
|
24
|
+
const alternatives = useUnit(model.$alternatives);
|
|
25
|
+
const isAvailable = useStoreMap({
|
|
26
|
+
store: model.availableChats.$state,
|
|
27
|
+
keys: [assignmentId, exerciseId],
|
|
28
|
+
fn: state => !!state[assignmentId]?.[exerciseId]?.isAvailable
|
|
29
|
+
});
|
|
30
|
+
const translateMessages = () => {
|
|
31
|
+
model.translation.translateBatchFx({
|
|
32
|
+
targetLanguage: translationTargetLanguage
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const openChat = () => model.setIsOpen(true);
|
|
36
|
+
const closeChat = () => model.setIsOpen(false);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (!alternatives) model.api.getAlternativesFx();
|
|
39
|
+
}, [alternatives, model]);
|
|
40
|
+
if (!isEnabled || !isAvailable) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
44
|
+
children: [/*#__PURE__*/_jsx(ChatbotMessages, {
|
|
45
|
+
model: model,
|
|
46
|
+
renderer: renderer,
|
|
47
|
+
sendHelpRequestPayload: sendHelpRequestPayload,
|
|
48
|
+
translationTargetLanguage: translationTargetLanguage,
|
|
49
|
+
isHintFeedback: isHintFeedback,
|
|
50
|
+
sanitizeSpeechInput: sanitizeSpeechInput,
|
|
51
|
+
isTextToSpeechEnabled: isTextToSpeechEnabled,
|
|
52
|
+
textToSpeechConfig: textToSpeechConfig
|
|
53
|
+
}), /*#__PURE__*/_jsx(ChatControls, {
|
|
54
|
+
model: model,
|
|
55
|
+
onPressTranslate: translateMessages,
|
|
56
|
+
onPressChatIcon: openChat,
|
|
57
|
+
onPressClose: closeChat,
|
|
58
|
+
isTranslationEnabled: isTranslationEnabled,
|
|
59
|
+
ButtonWrapper: ButtonWrapper
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=Chatbot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useStoreMap","useUnit","ChatbotMessages","ChatControls","React","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","Chatbot","model","translationTargetLanguage","isEnabled","isHintFeedback","sendHelpRequestPayload","sanitizeSpeechInput","isTextToSpeechEnabled","textToSpeechConfig","isTranslationEnabled","renderer","ButtonWrapper","assignmentId","credits","$assignmentId","exerciseId","$exerciseId","alternatives","$alternatives","isAvailable","store","availableChats","$state","keys","fn","state","translateMessages","translation","translateBatchFx","targetLanguage","openChat","setIsOpen","closeChat","api","getAlternativesFx","children","onPressTranslate","onPressChatIcon","onPressClose"],"sourceRoot":"../../../../../src","sources":["features/chatbot/components/Chatbot.tsx"],"mappings":";;AAAA,SAAsDA,SAAS,QAAQ,OAAO;AAC9E,SAASC,WAAW,EAAEC,OAAO,QAAQ,gBA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CAAC6B,YAAY,EAAEhB,KAAK,CAACgC,GAAG,CAACC,iBAAiB,CAAC,CAAC;EAClD,CAAC,EAAE,CAACjB,YAAY,EAAEhB,KAAK,CAAC,CAAC;EAEzB,IAAI,CAACE,SAAS,IAAI,CAACgB,WAAW,EAAE;IAC9B,OAAO,IAAI;EACb;EAEA,oBACEpB,KAAA,CAAAF,SAAA;IAAAsC,QAAA,gBACExC,IAAA,CAACJ,eAAe;MACdU,KAAK,EAAEA,KAAM;MACbS,QAAQ,EAAEA,QAAS;MACnBL,sBAAsB,EAAEA,sBAAuB;MAC/CH,yBAAyB,EAAEA,yBAA0B;MACrDE,cAAc,EAAEA,cAAe;MAC/BE,mBAAmB,EAAEA,mBAAoB;MACzCC,qBAAqB,EAAEA,qBAAsB;MAC7CC,kBAAkB,EAAEA;IAAmB,CACxC,CAAC,eAEFb,IAAA,CAACH,YAAY;MACXS,KAAK,EAAEA,KAAM;MACbmC,gBAAgB,EAAEV,iBAAkB;MACpCW,eAAe,EAAEP,QAAS;MAC1BQ,YAAY,EAAEN,SAAU;MACxBvB,oBAAoB,EAAEA,oBAAqB;MAC3CE,aAAa,EAAEA;IAAc,CAC9B,CAAC;EAAA,CACF,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useEffect, useMemo } from 'react';
|
|
5
|
+
import { View, Animated, StyleSheet, Platform } from 'react-native';
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const ThreeDotsLoader = ({
|
|
8
|
+
dotsCount = 3,
|
|
9
|
+
animationDuration = 250,
|
|
10
|
+
backgroundColor = '#55ABE0'
|
|
11
|
+
}) => {
|
|
12
|
+
const isWeb = Platform.OS === 'web';
|
|
13
|
+
const animations = useMemo(() => [...Array(dotsCount)].map(() => new Animated.Value(0)), [dotsCount]);
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const animationsArray = animations.map((anim, index) => Animated.sequence([Animated.timing(anim, {
|
|
16
|
+
toValue: 1,
|
|
17
|
+
duration: animationDuration,
|
|
18
|
+
useNativeDriver: !isWeb,
|
|
19
|
+
delay: index * (animationDuration / dotsCount)
|
|
20
|
+
}), Animated.timing(anim, {
|
|
21
|
+
toValue: 0,
|
|
22
|
+
duration: animationDuration,
|
|
23
|
+
useNativeDriver: !isWeb
|
|
24
|
+
})]));
|
|
25
|
+
Animated.loop(Animated.parallel(animationsArray)).start();
|
|
26
|
+
}, [animations, animationDuration]);
|
|
27
|
+
return /*#__PURE__*/_jsx(View, {
|
|
28
|
+
style: styles.container,
|
|
29
|
+
children: animations.map((anim, index) => {
|
|
30
|
+
const translateY = anim.interpolate({
|
|
31
|
+
inputRange: [0, 1],
|
|
32
|
+
outputRange: [-6, 0]
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
35
|
+
style: [styles.dot, {
|
|
36
|
+
transform: [{
|
|
37
|
+
translateY
|
|
38
|
+
}]
|
|
39
|
+
}, {
|
|
40
|
+
backgroundColor
|
|
41
|
+
}]
|
|
42
|
+
}, index);
|
|
43
|
+
})
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const styles = StyleSheet.create({
|
|
47
|
+
container: {
|
|
48
|
+
flexDirection: 'row',
|
|
49
|
+
justifyContent: 'center',
|
|
50
|
+
alignItems: 'center'
|
|
51
|
+
},
|
|
52
|
+
dot: {
|
|
53
|
+
borderRadius: 6,
|
|
54
|
+
height: 12,
|
|
55
|
+
width: 12,
|
|
56
|
+
marginHorizontal: 3
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=ThreeDotsLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useMemo","View","Animated","StyleSheet","Platform","jsx","_jsx","ThreeDotsLoader","dotsCount","animationDuration","backgroundColor","isWeb","OS","animations","Array","map","Value","animationsArray","anim","index","sequence","timing","toValue","duration","useNativeDriver","delay","loop","parallel","start","style","styles","container","children","translateY","interpolate","inputRange","outputRange","dot","transform","create","flexDirection","justifyContent","alignItems","borderRadius","height","width","marginHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC1C,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAQnE,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,SAAS,GAAG,CAAC;EACbC,iBAAiB,GAAG,GAAG;EACvBC,eAAe,GAAG;AACH,CAAC,KAAK;EACrB,MAAMC,KAAK,GAAGP,QAAQ,CAACQ,EAAE,KAAK,KAAK;EACnC,MAAMC,UAAU,GAAGb,OAAO,CACxB,MAAM,CAAC,GAAGc,KAAK,CAACN,SAAS,CAAC,CAAC,CAACO,GAAG,CAAC,MAAM,IAAIb,QAAQ,CAACc,KAAK,CAAC,CAAC,CAAC,CAAC,EAC5D,CAACR,SAAS,CACZ,CAAC;EAEDT,SAAS,CAAC,MAAM;IACd,MAAMkB,eAAe,GAAGJ,UAAU,CAACE,GAAG,CAAC,CAACG,IAAI,EAAEC,KAAK,KACjDjB,QAAQ,CAACkB,QAAQ,CAAC,CAChBlB,QAAQ,CAACmB,MAAM,CAACH,IAAI,EAAE;MACpBI,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAEd,iBAAiB;MAC3Be,eAAe,EAAE,CAACb,KAAK;MACvBc,KAAK,EAAEN,KAAK,IAAIV,iBAAiB,GAAGD,SAAS;IAC/C,CAAC,CAAC,EACFN,QAAQ,CAACmB,MAAM,CAACH,IAAI,EAAE;MACpBI,OAAO,EAAE,CAAC;MACVC,QAAQ,EAAEd,iBAAi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 'LINEAR16',
|
|
6
|
+
pitch: 0,
|
|
7
|
+
speakingRate: 0.8
|
|
8
|
+
};
|
|
9
|
+
export const DEFAULT_VOICE = {
|
|
10
|
+
languageCode: 'en-US',
|
|
11
|
+
name: 'en-US-Wavenet-C'
|
|
12
|
+
};
|
|
13
|
+
export const TEXT_TO_SPEECH_CONFIG = Platform.OS === 'ios' ? {
|
|
14
|
+
audioConfig: {
|
|
15
|
+
audioEncoding: 'MP3',
|
|
16
|
+
pitch: 0.8,
|
|
17
|
+
speakingRate: 0.8
|
|
18
|
+
},
|
|
19
|
+
voice: {
|
|
20
|
+
languageCode: 'en-US',
|
|
21
|
+
name: 'en-US-Wavenet-C'
|
|
22
|
+
}
|
|
23
|
+
} : {
|
|
24
|
+
audioConfig: AUDIO_CONFIG,
|
|
25
|
+
voice: DEFAULT_VOICE
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","AUDIO_CONFIG","audioEncoding","pitch","speakingRate","DEFAULT_VOICE","languageCode","name","TEXT_TO_SPEECH_CONFIG","OS","audioConfig","voice"],"sourceRoot":"../../../../src","sources":["features/chatbot/constants.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AAEvC,OAAO,MAAMC,YAAY,GAAG;EACxBC,aAAa,EAAE,UAAU;EACzBC,KAAK,EAAE,CAAC;EACRC,YAAY,EAAE;AAClB,CAAC;AAED,OAAO,MAAMC,aAAa,GAAG;EACzBC,YAAY,EAAE,OAAO;EACrBC,IAAI,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAC9BR,QAAQ,CAACS,EAAE,KAAK,KAAK,GACf;EACIC,WAAW,EAAE;IACTR,aAAa,EAAE,KAAK;IACpBC,KAAK,EAAE,GAAG;IACVC,YAAY,EAAE;EAClB,CAAC;EACDO,KAAK,EAAE;IACHL,YAAY,EAAE,OAAO;IACrBC,IAAI,EAAE;EACV;AACJ,CAAC,GACD;EACIG,WAAW,EAAET,YAAY;EACzBU,KAAK,EAAEN;AACX,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["decodeHTMLEntities","input","replace"],"sourceRoot":"../../../../src","sources":["features/chatbot/helpers.ts"],"mappings":";;AAAA;AACA,OAAO,MAAMA,kBAAkB,GAAIC,KAAa,IAAK;EACjD,OAAOA,KAAK,CAACC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;AACvC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export { Chatbot } from "./components/Chatbot.js";
|
|
4
|
+
export { ChatbotModel } from "./model/model.js";
|
|
5
|
+
export { AudioStatus } from "./types/t2s.types.js";
|
|
6
|
+
export { MessageVariant } from "./types/model.types.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Chatbot","ChatbotModel","AudioStatus","MessageVariant"],"sourceRoot":"../../../../src","sources":["features/chatbot/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,yBAAsB;AAC9C,SAASC,YAAY,QAAQ,kBAAe;AAC5C,SAASC,WAAW,QAA4B,sBAAmB;AACnE,SAASC,cAAc,QAAwD,wBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { createEffect } from 'effector';
|
|
4
|
+
import { createControllerEffect } from "../../../lib/effector/index.js";
|
|
5
|
+
export class ChatbotAPI {
|
|
6
|
+
constructor(api) {
|
|
7
|
+
this.postMessageFx = createControllerEffect(api.postMessage);
|
|
8
|
+
this.getAlternativesFx = createEffect(api.getAlternatives);
|
|
9
|
+
this.translateTextFx = createEffect(api.postTranslateText);
|
|
10
|
+
this.textToSpeechTextFx = createEffect(api.postTextToSpeech);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffect","createControllerEffect","ChatbotAPI","constructor","api","postMessageFx","postMessage","getAlternativesFx","getAlternatives","translateTextFx","postTranslateText","textToSpeechTextFx","postTextToSpeech"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/api.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAgB,UAAU;AAE/C,SAASC,sBAAsB,QAAQ,gCAAuB;AAa9D,OAAO,MAAMC,UAAU,CAAC;EAMpBC,WAAWA,CAACC,GAA6B,EAAE;IACvC,IAAI,CAACC,aAAa,GAAGJ,sBAAsB,CAACG,GAAG,CAACE,WAAW,CAAC;IAC5D,IAAI,CAACC,iBAAiB,GAAGP,YAAY,CAACI,GAAG,CAACI,eAAe,CAAC;IAC1D,IAAI,CAACC,eAAe,GAAGT,YAAY,CAACI,GAAG,CAACM,iBAAiB,CAAC;IAC1D,IAAI,CAACC,kBAAkB,GAAGX,YAAY,CAACI,GAAG,CAACQ,gBAAgB,CAAC;EAChE;AACJ","ignoreList":[]}
|