@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
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @magmamath/students-features
|
|
2
|
+
|
|
3
|
+
Magmamath features library
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install @magmamath/students-features
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
```js
|
|
15
|
+
import { multiply } from '@magmamath/students-features';
|
|
16
|
+
|
|
17
|
+
// ...
|
|
18
|
+
|
|
19
|
+
const result = await multiply(3, 7);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Contributing
|
|
24
|
+
|
|
25
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
26
|
+
|
|
27
|
+
## License
|
|
28
|
+
|
|
29
|
+
MIT
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Alternatives = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _effectorReact = require("effector-react");
|
|
10
|
+
var _HelpRequestOption = require("./HelpRequestOption.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const Alternatives = ({
|
|
15
|
+
model,
|
|
16
|
+
onPressAlternative,
|
|
17
|
+
hasMessages,
|
|
18
|
+
isHintFeedback
|
|
19
|
+
}) => {
|
|
20
|
+
const assignmentId = (0, _effectorReact.useUnit)(model.credits.$assignmentId);
|
|
21
|
+
const exerciseId = (0, _effectorReact.useUnit)(model.credits.$exerciseId);
|
|
22
|
+
const isTranslated = (0, _effectorReact.useUnit)(model.translation.$isTranslated);
|
|
23
|
+
const alternatives = (0, _effectorReact.useUnit)(model.$alternatives);
|
|
24
|
+
const isTranslationPending = (0, _effectorReact.useUnit)(model.translation.translateBatchFx.pending);
|
|
25
|
+
const lastMessageOptions = (0, _effectorReact.useStoreMap)({
|
|
26
|
+
store: model.messages.$state,
|
|
27
|
+
keys: [assignmentId, exerciseId],
|
|
28
|
+
fn: state => {
|
|
29
|
+
const lastMessage = state[assignmentId]?.[exerciseId]?.messages?.at(-1);
|
|
30
|
+
return lastMessage ? lastMessage.options : [];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const options = (0, _react.useMemo)(() => {
|
|
34
|
+
if (hasMessages) return lastMessageOptions ?? [];
|
|
35
|
+
if (isHintFeedback) return alternatives?.options.hints ?? [];
|
|
36
|
+
return alternatives?.options.default ?? [];
|
|
37
|
+
}, [hasMessages, lastMessageOptions, isHintFeedback, alternatives]);
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
39
|
+
style: styles.container,
|
|
40
|
+
children: options.map(({
|
|
41
|
+
text,
|
|
42
|
+
promptKey,
|
|
43
|
+
translatedText
|
|
44
|
+
}, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_HelpRequestOption.HelpRequestOption, {
|
|
45
|
+
onPress: () => onPressAlternative(text, promptKey, translatedText),
|
|
46
|
+
message: isTranslated ? translatedText : text,
|
|
47
|
+
disabled: isTranslationPending
|
|
48
|
+
}, index))
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
exports.Alternatives = Alternatives;
|
|
52
|
+
const styles = _reactNative.StyleSheet.create({
|
|
53
|
+
container: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
width: 305,
|
|
56
|
+
marginVertical: 8,
|
|
57
|
+
gap: 8
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=Alternatives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_effectorReact","_HelpRequestOption","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Alternatives","model","onPressAlternative","hasMessages","isHintFeedback","assignmentId","useUnit","credits","$assignmentId","exerciseId","$exerciseId","isTranslated","translation","$isTranslated","alternatives","$alternatives","isTranslationPending","translateBatchFx","pending","lastMessageOptions","useStoreMap","store","messages","$state","keys","fn","state","lastMessage","at","options","useMemo","hints","jsx","View","style","styles","container","children","map","text","promptKey","translatedText","index","HelpRequestOption","onPress","message","disabled","exports","StyleSheet","create","flex","width","marginVertical","gap"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Alternatives/Alternatives.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAGA,IAAAG,kBAAA,GAAAH,OAAA;AAAuD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAK,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,C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,EAAE,CAAC;IACjBC,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.HelpRequestOption = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _ArrowRightIcon = require("../../../../shared/icons/ArrowRightIcon.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
const transitionColor = (isHovered, value) => _reactNative.Animated.timing(value, {
|
|
14
|
+
toValue: isHovered ? 1 : 0,
|
|
15
|
+
duration: 200,
|
|
16
|
+
useNativeDriver: _reactNative.Platform.OS !== 'web'
|
|
17
|
+
}).start();
|
|
18
|
+
const HelpRequestOption = ({
|
|
19
|
+
onPress,
|
|
20
|
+
message,
|
|
21
|
+
disabled = false
|
|
22
|
+
}) => {
|
|
23
|
+
const [isHovered, setIsHovered] = (0, _react.useState)(false);
|
|
24
|
+
const backgroundColor = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
25
|
+
const backgroundInterpolation = backgroundColor.interpolate({
|
|
26
|
+
inputRange: [0, 1],
|
|
27
|
+
outputRange: ['#FFFFFF', '#55ABE0']
|
|
28
|
+
});
|
|
29
|
+
const textColor = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
30
|
+
const textInterpolation = textColor.interpolate({
|
|
31
|
+
inputRange: [0, 1],
|
|
32
|
+
outputRange: ['#33334D', '#FFFFFF']
|
|
33
|
+
});
|
|
34
|
+
(0, _react.useEffect)(() => {
|
|
35
|
+
transitionColor(isHovered, backgroundColor);
|
|
36
|
+
transitionColor(isHovered, textColor);
|
|
37
|
+
}, [isHovered]);
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
39
|
+
onHoverIn: () => setIsHovered(true),
|
|
40
|
+
onHoverOut: () => setIsHovered(false),
|
|
41
|
+
onPress: onPress,
|
|
42
|
+
style: styles.button,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
|
|
45
|
+
style: [styles.textWrapper, {
|
|
46
|
+
backgroundColor: backgroundInterpolation
|
|
47
|
+
}],
|
|
48
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.Text, {
|
|
49
|
+
numberOfLines: 1,
|
|
50
|
+
style: [styles.text, {
|
|
51
|
+
color: textInterpolation
|
|
52
|
+
}],
|
|
53
|
+
children: message
|
|
54
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ArrowRightIcon.ArrowRightIcon, {
|
|
55
|
+
color: isHovered ? '#FFFFFF' : '#33334D'
|
|
56
|
+
})]
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
exports.HelpRequestOption = HelpRequestOption;
|
|
61
|
+
const styles = _reactNative.StyleSheet.create({
|
|
62
|
+
button: {
|
|
63
|
+
flexDirection: 'row',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
justifyContent: 'space-between',
|
|
66
|
+
width: '100%'
|
|
67
|
+
},
|
|
68
|
+
text: {
|
|
69
|
+
fontSize: 20,
|
|
70
|
+
fontWeight: 400,
|
|
71
|
+
fontFamily: 'Buenos Aires',
|
|
72
|
+
color: '#33334D'
|
|
73
|
+
},
|
|
74
|
+
textWrapper: {
|
|
75
|
+
flex: 1,
|
|
76
|
+
flexDirection: 'row',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
justifyContent: 'space-between',
|
|
79
|
+
maxWidth: 305,
|
|
80
|
+
paddingHorizontal: 16,
|
|
81
|
+
paddingVertical: 8,
|
|
82
|
+
borderWidth: 1,
|
|
83
|
+
borderRadius: 48,
|
|
84
|
+
borderColor: '#55ABE0',
|
|
85
|
+
elevation: 3,
|
|
86
|
+
shadowColor: '#333',
|
|
87
|
+
shadowOffset: {
|
|
88
|
+
width: 0,
|
|
89
|
+
height: 1
|
|
90
|
+
},
|
|
91
|
+
shadowOpacity: 0.25,
|
|
92
|
+
shadowRadius: 3,
|
|
93
|
+
backgroundColor: '#FFFFFF'
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=HelpRequestOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_ArrowRightIcon","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","transitionColor","isHovered","value","Animated","timing","toValue","duration","useNativeDriver","Platform","OS","start","HelpRequestOption","onPress","message","disabled","setIsHovered","useState","backgroundColor","useRef","Value","current","backgroundInterpolation","interpolate","inputRange","outputRange","textColor","textInterpolation","useEffect","jsx","Pressable","onHoverIn","onHoverOut","style","styles","button","children","jsxs","View","textWrapper","Text","numberOfLines","text","color","ArrowRightIcon","exports","StyleSheet","create","flexDirection","alignItems","justifyContent","width","fontSize","fontWeight","fontFamily","flex","maxWidth","paddingHorizontal","paddingVertical","borderWidth","borderRadius","borderColor","elevation","shadowColor","shadowOffset","height","shadowOpacity","shadowRadius"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Alternatives/HelpRequestOption.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAAwE,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAA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ACZC,UAAU,EAAE,GAAG;IACfC,UAAU,EAAE,cAAc;IAC1BX,KAAK,EAAE;EACT,CAAC;EACDJ,WAAW,EAAE;IACXgB,IAAI,EAAE,CAAC;IACPP,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BM,QAAQ,EAAE,GAAG;IACbC,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,CAAC;IAClBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,SAAS;IACtBC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAEb,KAAK,EAAE,CAAC;MAAEc,MAAM,EAAE;IAAE,CAAC;IACrCC,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfjD,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChatControls = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _effectorReact = require("effector-react");
|
|
11
|
+
var _ChatbotIcon = require("../../../../shared/icons/ChatbotIcon.js");
|
|
12
|
+
var _GlobeIcon = require("../../../../shared/icons/GlobeIcon.js");
|
|
13
|
+
var _CloseIcon = require("../../../../shared/icons/CloseIcon.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const ChatControls = ({
|
|
17
|
+
model,
|
|
18
|
+
onPressTranslate,
|
|
19
|
+
onPressChatIcon,
|
|
20
|
+
onPressClose,
|
|
21
|
+
isTranslationEnabled,
|
|
22
|
+
ButtonWrapper
|
|
23
|
+
}) => {
|
|
24
|
+
const isOpen = (0, _effectorReact.useUnit)(model.$isOpen);
|
|
25
|
+
const isTranslated = (0, _effectorReact.useUnit)(model.translation.$isTranslated);
|
|
26
|
+
const isTranslationPending = (0, _effectorReact.useUnit)(model.translation.translateBatchFx.pending);
|
|
27
|
+
const isHelpRequestPending = (0, _effectorReact.useUnit)(model.sendHelpRequestFx.pending);
|
|
28
|
+
if (isOpen) {
|
|
29
|
+
const backgroundColor = isTranslated ? '#55ABE0' : '#FFF';
|
|
30
|
+
const fillColor = isTranslated ? '#FFF' : '#4D4D63';
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
32
|
+
style: styles.container,
|
|
33
|
+
children: [isTranslationEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
34
|
+
onPress: onPressTranslate,
|
|
35
|
+
disabled: isHelpRequestPending || isTranslationPending,
|
|
36
|
+
style: [styles.buttonTranslate, {
|
|
37
|
+
backgroundColor
|
|
38
|
+
}],
|
|
39
|
+
children: isTranslationPending ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_GlobeIcon.GlobeIcon, {
|
|
40
|
+
color: fillColor
|
|
41
|
+
})
|
|
42
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
|
|
43
|
+
onPress: onPressClose,
|
|
44
|
+
style: {
|
|
45
|
+
container: styles.buttonClose,
|
|
46
|
+
button: {
|
|
47
|
+
backgroundColor: '#FFF'
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
raiseLevel: 5,
|
|
51
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseIcon.CloseIcon, {})
|
|
52
|
+
})]
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
56
|
+
style: styles.container,
|
|
57
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ButtonWrapper, {
|
|
58
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
59
|
+
onPress: onPressChatIcon,
|
|
60
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotIcon.ChatbotIcon, {})
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
exports.ChatControls = ChatControls;
|
|
66
|
+
const styles = _reactNative.StyleSheet.create({
|
|
67
|
+
container: {
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'flex-end',
|
|
70
|
+
flexDirection: 'row',
|
|
71
|
+
height: 60,
|
|
72
|
+
gap: 8
|
|
73
|
+
},
|
|
74
|
+
buttonClose: {
|
|
75
|
+
width: 50,
|
|
76
|
+
height: 50
|
|
77
|
+
},
|
|
78
|
+
buttonTranslate: {
|
|
79
|
+
alignItems: 'center',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
width: 36,
|
|
82
|
+
height: 36,
|
|
83
|
+
borderRadius: 32,
|
|
84
|
+
borderWidth: 1,
|
|
85
|
+
borderColor: '#F2F2F4',
|
|
86
|
+
shadowColor: '#333333',
|
|
87
|
+
shadowOffset: {
|
|
88
|
+
width: 0,
|
|
89
|
+
height: 1
|
|
90
|
+
},
|
|
91
|
+
shadowOpacity: 0.25,
|
|
92
|
+
shadowRadius: 3,
|
|
93
|
+
elevation: 3,
|
|
94
|
+
backgroundColor: '#FFF'
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=ChatControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeUi","_effectorReact","_ChatbotIcon","_GlobeIcon","_CloseIcon","_jsxRuntime","e","__esModule","default","ChatControls","model","onPressTranslate","onPressChatIcon","onPressClose","isTranslationEnabled","ButtonWrapper","isOpen","useUnit","$isOpen","isTranslated","translation","$isTranslated","isTranslationPending","translateBatchFx","pending","isHelpRequestPending","sendHelpRequestFx","backgroundColor","fillColor","jsxs","View","style","styles","container","children","jsx","Pressable","onPress","disabled","buttonTranslate","ActivityIndicator","GlobeIcon","color","Button","buttonClose","button","raiseLevel","CloseIcon","ChatbotIcon","exports","StyleSheet","create","alignItems","justifyContent","flexDirection","height","gap","width","borderRadius","borderWidth","borderColor","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatControls/ChatControls.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAA8D,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAWvD,MAAMG,YAAY,GAAGA,CAAC;EAC3BC,KAAK;EACLC,gBAAgB;EAChBC,eAAe;EACfC,YAAY;EACZC,oBAAoB;EACpBC;AACiB,CAAC,KAAK;EACvB,MAAMC,MAAM,GAAG,IAAAC,sBAAO,EAACP,KAAK,CAACQ,OAAO,CAAC;EACrC,MAAMC,YAAY,GAAG,IAAAF,sBAAO,EAACP,KAAK,CAACU,WAAW,CAACC,aAAa,CAAC;EAC7D,MAAMC,oBAAoB,GAAG,IAAAL,sBAAO,EAACP,KAAK,CAACU,WAAW,CAACG,gBAAgB,CAACC,OAAO,CAAC;EAChF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+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _ReceivedMessage = require("./ReceivedMessage.js");
|
|
9
|
+
var _SentMessage = require("./SentMessage.js");
|
|
10
|
+
var _modelTypes = require("../../types/model.types.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const variantsMap = {
|
|
14
|
+
[_modelTypes.MessageVariant.SENT]: _SentMessage.SentMessage,
|
|
15
|
+
[_modelTypes.MessageVariant.RECEIVED]: _ReceivedMessage.ReceivedMessage
|
|
16
|
+
};
|
|
17
|
+
const ChatMessage = ({
|
|
18
|
+
variant,
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
const Component = variantsMap[variant];
|
|
22
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, {
|
|
23
|
+
...props
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
exports.ChatMessage = ChatMessage;
|
|
27
|
+
//# sourceMappingURL=ChatMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_ReceivedMessage","_SentMessage","_modelTypes","_jsxRuntime","e","__esModule","default","variantsMap","MessageVariant","SENT","SentMessage","RECEIVED","ReceivedMessage","ChatMessage","variant","props","Component","jsx","exports"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/ChatMessage.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AAAyE,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAezE,MAAMG,WAAgE,GAAG;EACvE,CAACC,0BAAc,CAACC,IAAI,GAAGC,wBAAW;EAClC,CAACF,0BAAc,CAACG,QAAQ,GAAGC;AAC7B,CAAC;AAEM,MAAMC,WAAW,GAAGA,CAAC;EAAEC,OAAO;EAAE,GAAGC;AAAwB,CAAC,KAAK;EACtE,MAAMC,SAAS,GAAGT,WAAW,CAACO,OAAO,CAAC;EACtC,oBAAO,IAAAX,WAAA,CAAAc,GAAA,EAACD,SAAS;IAAA,GAAKD;EAAK,CAAG,CAAC;AACjC,CAAC;AAAAG,OAAA,CAAAL,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageLoader = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _ChatbotIcon = require("../../../../shared/icons/ChatbotIcon.js");
|
|
10
|
+
var _ThreeDotsLoader = require("../ThreeDotsLoader/ThreeDotsLoader.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
const MessageLoader = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
14
|
+
style: styles.container,
|
|
15
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
16
|
+
style: styles.icon,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotIcon.ChatbotIcon, {
|
|
18
|
+
width: 38,
|
|
19
|
+
height: 38
|
|
20
|
+
})
|
|
21
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
22
|
+
style: styles.loader,
|
|
23
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ThreeDotsLoader.ThreeDotsLoader, {})
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
exports.MessageLoader = MessageLoader;
|
|
27
|
+
const styles = _reactNative.StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
width: 305
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
alignSelf: 'flex-end',
|
|
34
|
+
marginRight: 8
|
|
35
|
+
},
|
|
36
|
+
loader: {
|
|
37
|
+
flex: 1,
|
|
38
|
+
flexDirection: 'row',
|
|
39
|
+
alignItems: 'flex-start',
|
|
40
|
+
maxWidth: 70,
|
|
41
|
+
padding: 8,
|
|
42
|
+
paddingTop: 15,
|
|
43
|
+
shadowColor: '#333333',
|
|
44
|
+
shadowOffset: {
|
|
45
|
+
width: 0,
|
|
46
|
+
height: 1
|
|
47
|
+
},
|
|
48
|
+
shadowOpacity: 0.25,
|
|
49
|
+
shadowRadius: 3,
|
|
50
|
+
elevation: 3,
|
|
51
|
+
borderRadius: 8,
|
|
52
|
+
borderBottomLeftRadius: 0,
|
|
53
|
+
backgroundColor: '#F2F2F4'
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=MessageLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ChatbotIcon","_ThreeDotsLoader","_jsxRuntime","e","__esModule","default","MessageLoader","jsxs","View","style","styles","container","children","jsx","icon","ChatbotIcon","width","height","loader","ThreeDotsLoader","exports","StyleSheet","create","flexDirection","alignSelf","marginRight","flex","alignItems","maxWidth","padding","paddingTop","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderBottomLeftRadius","backgroundColor"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessage/MessageLoader.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,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ACdC,WAAW,EAAE,SAAS;IACtBC,YAAY,EAAE;MAAEhB,KAAK,EAAE,CAAC;MAAEC,MAAM,EAAE;IAAE,CAAC;IACrCgB,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE,CAAC;IACZC,YAAY,EAAE,CAAC;IACfC,sBAAsB,EAAE,CAAC;IACzBC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MessageTextToSpeech = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _SpeakerIcon = require("../../../../shared/icons/SpeakerIcon.js");
|
|
10
|
+
var _PlayIcon = require("../../../../shared/icons/PlayIcon.js");
|
|
11
|
+
var _PauseIcon = require("../../../../shared/icons/PauseIcon.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const TextToSpeechIcon = ({
|
|
15
|
+
status,
|
|
16
|
+
isActive,
|
|
17
|
+
isLoading
|
|
18
|
+
}) => {
|
|
19
|
+
if (isLoading && isActive) {
|
|
20
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {});
|
|
21
|
+
}
|
|
22
|
+
if (!isActive) {
|
|
23
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpeakerIcon.SpeakerIcon, {
|
|
24
|
+
color: isActive ? '#55ABE0' : undefined
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (status === 'playing') return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PauseIcon.PauseIcon, {
|
|
28
|
+
color: "#FFF"
|
|
29
|
+
});
|
|
30
|
+
if (status === 'paused') return /*#__PURE__*/(0, _jsxRuntime.jsx)(_PlayIcon.PlayIcon, {
|
|
31
|
+
color: "#FFF"
|
|
32
|
+
});
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpeakerIcon.SpeakerIcon, {
|
|
34
|
+
color: isActive ? '#55ABE0' : undefined
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const MessageTextToSpeech = ({
|
|
38
|
+
status,
|
|
39
|
+
disabled,
|
|
40
|
+
isActive,
|
|
41
|
+
isLoading,
|
|
42
|
+
onPress
|
|
43
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
44
|
+
style: styles.container,
|
|
45
|
+
onPress: onPress,
|
|
46
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
|
|
47
|
+
disabled: disabled,
|
|
48
|
+
onPress: onPress,
|
|
49
|
+
style: [styles.button, {
|
|
50
|
+
backgroundColor: isActive && !isLoading ? '#55ABE0' : '#FFF'
|
|
51
|
+
}],
|
|
52
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(TextToSpeechIcon, {
|
|
53
|
+
isActive: isActive,
|
|
54
|
+
isLoading: isLoading,
|
|
55
|
+
status: status
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
exports.MessageTextToSpeech = MessageTextToSpeech;
|
|
60
|
+
const styles = _reactNative.StyleSheet.create({
|
|
61
|
+
container: {
|
|
62
|
+
alignSelf: 'flex-end',
|
|
63
|
+
justifyContent: 'flex-end',
|
|
64
|
+
width: 45,
|
|
65
|
+
height: '100%'
|
|
66
|
+
},
|
|
67
|
+
button: {
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
justifyContent: 'center',
|
|
70
|
+
width: 28,
|
|
71
|
+
height: 28,
|
|
72
|
+
padding: 1,
|
|
73
|
+
marginLeft: 'auto',
|
|
74
|
+
shadowColor: '#333',
|
|
75
|
+
shadowOffset: {
|
|
76
|
+
width: 0,
|
|
77
|
+
height: 1
|
|
78
|
+
},
|
|
79
|
+
shadowOpacity: 0.25,
|
|
80
|
+
shadowRadius: 3,
|
|
81
|
+
elevation: 3,
|
|
82
|
+
borderRadius: 6,
|
|
83
|
+
borderColor: '#F2F2F4',
|
|
84
|
+
borderWidth: 0.5,
|
|
85
|
+
backgroundColor: '#FFF'
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=MessageTextToSpeech.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_SpeakerIcon","_PlayIcon","_PauseIcon","_jsxRuntime","e","__esModule","default","TextToSpeechIcon","status","isActive","isLoading","jsx","ActivityIndicator","SpeakerIcon","color","undefined","PauseIcon","PlayIcon","MessageTextToSpeech","disabled","onPress","TouchableOpacity","style","styles","container","children","Pressable","button","backgroundColor","exports","StyleSheet","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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAA8D,IAAAK,WAAA,GAAAL,OAAA;AAAA,SAAAD,uBAAAO,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAS9D,MAAMG,gBAAgB,GAAGA,CAAC;EAAEC,MAAM;EAAEC,QAAQ;EAAEC;AAAiC,CAAC,KAAK;EACnF,IAAIA,SAAS,IAAID,QAAQ,EA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AgB;MAACE,QAAQ,EAAEA,QAAS;MAACC,SAAS,EAAEA,SAAU;MAACF,MAAM,EAAEA;IAAO,CAAE;EAAC,CACrE;AAAC,CACI,CACnB;AAAAqB,OAAA,CAAAX,mBAAA,GAAAA,mBAAA;AAED,MAAMK,MAAM,GAAGO,uBAAU,CAACC,MAAM,CAAC;EAC/BP,SAAS,EAAE;IACTQ,SAAS,EAAE,UAAU;IACrBC,cAAc,EAAE,UAAU;IAC1BC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE;EACV,CAAC;EACDR,MAAM,EAAE;IACNS,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;IAChBlB,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ReceivedMessage = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _ChatbotIcon = require("../../../../shared/icons/ChatbotIcon.js");
|
|
10
|
+
var _MessageTextToSpeech = require("./MessageTextToSpeech.js");
|
|
11
|
+
var _modelTypes = require("../../types/model.types.js");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const ReceivedMessage = ({
|
|
15
|
+
message,
|
|
16
|
+
onPressTextToSpeech,
|
|
17
|
+
isTextToSpeechPending,
|
|
18
|
+
isActive,
|
|
19
|
+
audioStatus,
|
|
20
|
+
renderer,
|
|
21
|
+
withTextToSpeech = true
|
|
22
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
23
|
+
style: styles.container,
|
|
24
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
25
|
+
style: styles.icon,
|
|
26
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ChatbotIcon.ChatbotIcon, {
|
|
27
|
+
width: 38,
|
|
28
|
+
height: 38
|
|
29
|
+
})
|
|
30
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
31
|
+
style: styles.message,
|
|
32
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
33
|
+
style: [styles.messageText, {
|
|
34
|
+
width: withTextToSpeech ? 240 : 305
|
|
35
|
+
}],
|
|
36
|
+
children: renderer ? renderer({
|
|
37
|
+
message,
|
|
38
|
+
variant: _modelTypes.MessageVariant.RECEIVED,
|
|
39
|
+
withTextToSpeech
|
|
40
|
+
}) : message
|
|
41
|
+
}), withTextToSpeech && /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageTextToSpeech.MessageTextToSpeech, {
|
|
42
|
+
isActive: isActive,
|
|
43
|
+
isLoading: isTextToSpeechPending,
|
|
44
|
+
onPress: onPressTextToSpeech,
|
|
45
|
+
disabled: isTextToSpeechPending,
|
|
46
|
+
status: audioStatus
|
|
47
|
+
})]
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
50
|
+
exports.ReceivedMessage = ReceivedMessage;
|
|
51
|
+
const styles = _reactNative.StyleSheet.create({
|
|
52
|
+
container: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
flexDirection: 'row',
|
|
55
|
+
maxWidth: 350,
|
|
56
|
+
width: 350
|
|
57
|
+
},
|
|
58
|
+
icon: {
|
|
59
|
+
alignSelf: 'flex-end',
|
|
60
|
+
marginRight: 8
|
|
61
|
+
},
|
|
62
|
+
message: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
maxWidth: 305,
|
|
66
|
+
padding: 8,
|
|
67
|
+
shadowColor: '#333',
|
|
68
|
+
shadowOffset: {
|
|
69
|
+
width: 0,
|
|
70
|
+
height: 1
|
|
71
|
+
},
|
|
72
|
+
shadowOpacity: 0.25,
|
|
73
|
+
shadowRadius: 3,
|
|
74
|
+
elevation: 3,
|
|
75
|
+
borderRadius: 8,
|
|
76
|
+
borderBottomLeftRadius: 0,
|
|
77
|
+
backgroundColor: '#F2F2F4'
|
|
78
|
+
},
|
|
79
|
+
messageText: {
|
|
80
|
+
flex: 1,
|
|
81
|
+
fontSize: 20,
|
|
82
|
+
fontWeight: 400,
|
|
83
|
+
fontFamily: 'Buenos Aires',
|
|
84
|
+
color: '#33334D'
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=ReceivedMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_ChatbotIcon","_MessageTextToSpeech","_modelTypes","_jsxRuntime","e","__esModule","default","ReceivedMessage","message","onPressTextToSpeech","isTextToSpeechPending","isActive","audioStatus","renderer","withTextToSpeech","jsxs","View","style","styles","container","children","jsx","icon","ChatbotIcon","width","height","Text","messageText","variant","MessageVariant","RECEIVED","MessageTextToSpeech","isLoading","onPress","disabled","status","exports","StyleSheet","create","flex","flexDirection","maxWidth","alignSelf","marginRight","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","borderRadius","borderBottomLeftRadius","backgroundColor","fontSize","fontWeight","fontFamily","color"],"sourceRoot":"../../../../../../src","sources":["features/ch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
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SentMessage = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _modelTypes = require("../../types/model.types.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const SentMessage = ({
|
|
13
|
+
message,
|
|
14
|
+
renderer
|
|
15
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
16
|
+
style: styles.container,
|
|
17
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
18
|
+
style: styles.text,
|
|
19
|
+
children: renderer ? renderer({
|
|
20
|
+
message,
|
|
21
|
+
variant: _modelTypes.MessageVariant.SENT,
|
|
22
|
+
withTextToSpeech: false
|
|
23
|
+
}) : message
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
exports.SentMessage = SentMessage;
|
|
27
|
+
const styles = _reactNative.StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
alignSelf: 'flex-end',
|
|
30
|
+
maxWidth: 305,
|
|
31
|
+
padding: 8,
|
|
32
|
+
borderRadius: 8,
|
|
33
|
+
borderBottomRightRadius: 0,
|
|
34
|
+
backgroundColor: '#55ABE0'
|
|
35
|
+
},
|
|
36
|
+
text: {
|
|
37
|
+
fontSize: 20,
|
|
38
|
+
fontWeight: 400,
|
|
39
|
+
fontFamily: 'Buenos Aires',
|
|
40
|
+
color: '#FFF'
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=SentMessage.js.map
|