@magmamath/students-features 0.6.0 → 0.6.1-2.rc-2
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 +14 -5
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +6 -2
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +27 -24
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +9 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +18 -5
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +10 -3
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +16 -12
- package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -4
- package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +14 -8
- package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +14 -4
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/Chatbot.js +5 -2
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +2 -1
- package/dist/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +36 -1
- package/dist/commonjs/features/chatbot/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +8 -0
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/index.js +7 -0
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +67 -39
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +3 -8
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +12 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +4 -2
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/translation.js +9 -1
- package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/style.types.js +12 -0
- package/dist/commonjs/features/chatbot/types/style.types.js.map +1 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js +2 -0
- package/dist/commonjs/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +31 -0
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +97 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js +43 -0
- package/dist/commonjs/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js +61 -0
- package/dist/commonjs/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +68 -0
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +75 -0
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/components/index.js +2 -0
- package/dist/commonjs/features/exampleSolution/components/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/constants.js +13 -0
- package/dist/commonjs/features/exampleSolution/constants.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js +54 -0
- package/dist/commonjs/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/index.js +39 -0
- package/dist/commonjs/features/exampleSolution/index.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +22 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +24 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js +19 -0
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/commonjs/features/exampleSolution/types.js +6 -0
- package/dist/commonjs/features/exampleSolution/types.js.map +1 -0
- package/dist/commonjs/features/feedback/model/comments.js +5 -3
- package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
- package/dist/commonjs/features/feedback/model/model.js +7 -9
- package/dist/commonjs/features/feedback/model/model.js.map +1 -1
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js +62 -0
- package/dist/commonjs/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/commonjs/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js +44 -0
- package/dist/commonjs/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js +46 -0
- package/dist/commonjs/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js +90 -0
- package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js +96 -0
- package/dist/commonjs/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/constants.js +34 -0
- package/dist/commonjs/features/gifCelebrations/constants.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js +114 -0
- package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/index.js +20 -0
- package/dist/commonjs/features/gifCelebrations/index.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js +136 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js +27 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsCache.js +30 -0
- package/dist/commonjs/features/gifCelebrations/model/GifCelebrationsCache.js.map +1 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js +6 -0
- package/dist/commonjs/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js +12 -9
- package/dist/commonjs/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/commonjs/features/problemSelector/constants.js +3 -6
- package/dist/commonjs/features/problemSelector/constants.js.map +1 -1
- package/dist/commonjs/index.js +36 -0
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/effector/ControlledSample.js +40 -0
- package/dist/commonjs/lib/effector/ControlledSample.js.map +1 -0
- package/dist/commonjs/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/react-app-env.d.js +2 -0
- package/dist/commonjs/react-app-env.d.js.map +1 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js +681 -0
- package/dist/commonjs/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js +616 -0
- package/dist/commonjs/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/commonjs/shared/icons/index.js +204 -0
- package/dist/commonjs/shared/icons/index.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +5 -1
- package/dist/commonjs/shared/translation/constants.js.map +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +33 -0
- package/dist/commonjs/shared/translation/localization/en.json +13 -1
- package/dist/commonjs/shared/translation/localization/gb.json +13 -1
- package/dist/commonjs/shared/translation/localization/sct.json +33 -0
- package/dist/commonjs/shared/translation/localization/sw.json +13 -1
- package/dist/commonjs/shared/translation/types.js +2 -0
- package/dist/commonjs/shared/translation/types.js.map +1 -1
- package/dist/commonjs/types/common.types.js +2 -0
- package/dist/commonjs/types/common.types.js.map +1 -0
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +6 -2
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +29 -27
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +9 -4
- package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +18 -5
- package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +10 -3
- package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +16 -12
- package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -4
- package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +14 -8
- package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +14 -4
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
- package/dist/module/features/chatbot/components/Chatbot.js +5 -2
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js +3 -3
- package/dist/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +35 -0
- package/dist/module/features/chatbot/constants.js.map +1 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +9 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +1 -1
- package/dist/module/features/chatbot/index.js +1 -0
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotModel.js +68 -40
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js +3 -8
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +12 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +4 -2
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/chatbot/model/constants.js.map +1 -1
- package/dist/module/features/chatbot/model/translation.js +9 -1
- package/dist/module/features/chatbot/model/translation.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/chatbot/types/style.types.js +8 -0
- package/dist/module/features/chatbot/types/style.types.js.map +1 -0
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js +3 -1
- package/dist/module/features/endOfAssignment/components/Modal/Modal.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +25 -0
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -0
- package/dist/module/features/exampleSolution/assets/grid.png +0 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +91 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js +35 -0
- package/dist/module/features/exampleSolution/components/LavaIcon.js.map +1 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js +53 -0
- package/dist/module/features/exampleSolution/components/MessageBlock.js.map +1 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js +60 -0
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js +67 -0
- package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -0
- package/dist/module/features/exampleSolution/components/index.js +2 -0
- package/dist/module/features/exampleSolution/components/index.js.map +1 -0
- package/dist/module/features/exampleSolution/constants.js +9 -0
- package/dist/module/features/exampleSolution/constants.js.map +1 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js +49 -0
- package/dist/module/features/exampleSolution/hooks/useExampleSolution.js.map +1 -0
- package/dist/module/features/exampleSolution/index.js +6 -0
- package/dist/module/features/exampleSolution/index.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +17 -0
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +19 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js +14 -0
- package/dist/module/features/exampleSolution/model/ExampleSolutionCache.js.map +1 -0
- package/dist/module/features/exampleSolution/types.js +4 -0
- package/dist/module/features/exampleSolution/types.js.map +1 -0
- package/dist/module/features/feedback/model/comments.js +5 -3
- package/dist/module/features/feedback/model/comments.js.map +1 -1
- package/dist/module/features/feedback/model/model.js +7 -9
- package/dist/module/features/feedback/model/model.js.map +1 -1
- package/dist/module/features/gifCelebrations/GifCelebrations.js +55 -0
- package/dist/module/features/gifCelebrations/GifCelebrations.js.map +1 -0
- package/dist/module/features/gifCelebrations/assets/confetti.webp +0 -0
- package/dist/module/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js +36 -0
- package/dist/module/features/gifCelebrations/components/Backdrop.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js +38 -0
- package/dist/module/features/gifCelebrations/components/ContentContainer.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Gif.js +82 -0
- package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -0
- package/dist/module/features/gifCelebrations/components/Progress.js +88 -0
- package/dist/module/features/gifCelebrations/components/Progress.js.map +1 -0
- package/dist/module/features/gifCelebrations/constants.js +30 -0
- package/dist/module/features/gifCelebrations/constants.js.map +1 -0
- package/dist/module/features/gifCelebrations/helpers.js +103 -0
- package/dist/module/features/gifCelebrations/helpers.js.map +1 -0
- package/dist/module/features/gifCelebrations/index.js +5 -0
- package/dist/module/features/gifCelebrations/index.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js +131 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrations.model.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js +22 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsApi.js.map +1 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsCache.js +25 -0
- package/dist/module/features/gifCelebrations/model/GifCelebrationsCache.js.map +1 -0
- package/dist/module/features/gifCelebrations/types/model.types.js +4 -0
- package/dist/module/features/gifCelebrations/types/model.types.js.map +1 -0
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js +13 -10
- package/dist/module/features/problemSelector/components/ProblemSelectorButton.js.map +1 -1
- package/dist/module/features/problemSelector/constants.js +2 -5
- package/dist/module/features/problemSelector/constants.js.map +1 -1
- package/dist/module/index.js +3 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/effector/ControlledSample.js +35 -0
- package/dist/module/lib/effector/ControlledSample.js.map +1 -0
- package/dist/module/lib/effector/createControllerEffect.js.map +1 -1
- package/dist/module/react-app-env.d.js +2 -0
- package/dist/module/react-app-env.d.js.map +1 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js +673 -0
- package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js +608 -0
- package/dist/module/shared/icons/LavaIconInGlasses.js.map +1 -0
- package/dist/module/shared/icons/index.js +21 -0
- package/dist/module/shared/icons/index.js.map +1 -0
- package/dist/module/shared/translation/constants.js +5 -1
- package/dist/module/shared/translation/constants.js.map +1 -1
- package/dist/module/shared/translation/localization/ca.json +33 -0
- package/dist/module/shared/translation/localization/en.json +13 -1
- package/dist/module/shared/translation/localization/gb.json +13 -1
- package/dist/module/shared/translation/localization/sct.json +33 -0
- package/dist/module/shared/translation/localization/sw.json +13 -1
- package/dist/module/shared/translation/types.js +2 -0
- package/dist/module/shared/translation/types.js.map +1 -1
- package/dist/module/types/common.types.js +2 -0
- package/dist/module/types/common.types.js.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +6 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts +7 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +5 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +3 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +4 -3
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +33 -0
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +4 -0
- package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +7 -2
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +1 -3
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +5 -2
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/style.types.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/types/style.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/components/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/commonjs/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts +15 -0
- package/dist/typescript/commonjs/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/commonjs/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts +11 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts +12 -0
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +25 -0
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/commonjs/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/commonjs/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/commonjs/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsCache.d.ts +18 -0
- package/dist/typescript/commonjs/features/gifCelebrations/model/GifCelebrationsCache.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/commonjs/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts +2 -5
- package/dist/typescript/commonjs/features/problemSelector/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +3 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/effector/ControlledSample.d.ts +17 -0
- package/dist/typescript/commonjs/lib/effector/ControlledSample.d.ts.map +1 -0
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts +19 -0
- package/dist/typescript/commonjs/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +24 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts +3 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +5 -1
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/types/common.types.d.ts +5 -0
- package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +5 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +6 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts +7 -2
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +5 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +3 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +4 -3
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +33 -0
- package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +4 -0
- package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +7 -2
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +1 -3
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +5 -2
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/style.types.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/types/style.types.d.ts.map +1 -0
- package/dist/typescript/module/features/endOfAssignment/components/Modal/Modal.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/LavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts +10 -0
- package/dist/typescript/module/features/exampleSolution/components/MessageBlock.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts +1 -0
- package/dist/typescript/module/features/exampleSolution/components/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts +6 -0
- package/dist/typescript/module/features/exampleSolution/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts +15 -0
- package/dist/typescript/module/features/exampleSolution/hooks/useExampleSolution.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts +4 -0
- package/dist/typescript/module/features/exampleSolution/index.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +9 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts +11 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts +12 -0
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionCache.d.ts.map +1 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts +25 -0
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/GifCelebrations.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Backdrop.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/ContentContainer.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Gif.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts +10 -0
- package/dist/typescript/module/features/gifCelebrations/components/Progress.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts +26 -0
- package/dist/typescript/module/features/gifCelebrations/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +29 -0
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts +3 -0
- package/dist/typescript/module/features/gifCelebrations/index.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts +25 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrations.model.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts +7 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsApi.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsCache.d.ts +18 -0
- package/dist/typescript/module/features/gifCelebrations/model/GifCelebrationsCache.d.ts.map +1 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts +45 -0
- package/dist/typescript/module/features/gifCelebrations/types/model.types.d.ts.map +1 -0
- package/dist/typescript/module/features/problemSelector/components/ProblemSelectorButton.d.ts.map +1 -1
- package/dist/typescript/module/features/problemSelector/constants.d.ts +2 -5
- package/dist/typescript/module/features/problemSelector/constants.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +3 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/effector/ControlledSample.d.ts +17 -0
- package/dist/typescript/module/lib/effector/ControlledSample.d.ts.map +1 -0
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +1 -1
- package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/ExcitedLavaIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts +4 -0
- package/dist/typescript/module/shared/icons/LavaIconInGlasses.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/index.d.ts +19 -0
- package/dist/typescript/module/shared/icons/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +102 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +24 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/types.d.ts +3 -1
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/validation.types.d.ts +5 -1
- package/dist/typescript/module/shared/translation/validation.types.d.ts.map +1 -1
- package/dist/typescript/module/types/common.types.d.ts +5 -0
- package/dist/typescript/module/types/common.types.d.ts.map +1 -0
- package/package.json +11 -7
- package/src/features/chatbot/components/Alternatives/Alternatives.tsx +6 -0
- package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +28 -29
- package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +6 -1
- package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +24 -4
- package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +39 -6
- package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +11 -3
- package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +28 -7
- package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +25 -5
- package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +24 -13
- package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +13 -3
- package/src/features/chatbot/components/Chatbot.tsx +6 -2
- package/src/features/chatbot/components/ThreeDotsLoader/ThreeDotsLoader.tsx +7 -10
- package/src/features/chatbot/constants.ts +37 -0
- package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +11 -1
- package/src/features/chatbot/index.ts +1 -0
- package/src/features/chatbot/model/ChatBotModel.ts +66 -42
- package/src/features/chatbot/model/ChatBotThreadManager.ts +4 -10
- package/src/features/chatbot/model/ChatBoxTextManager.ts +14 -1
- package/src/features/chatbot/model/DefaultMessageCreator.ts +4 -2
- package/src/features/chatbot/model/constants.ts +0 -2
- package/src/features/chatbot/model/translation.ts +11 -1
- package/src/features/chatbot/types/model.types.ts +5 -2
- package/src/features/chatbot/types/style.types.ts +4 -0
- package/src/features/endOfAssignment/components/Modal/Modal.tsx +3 -0
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +29 -0
- package/src/features/exampleSolution/assets/grid.png +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +78 -0
- package/src/features/exampleSolution/components/LavaIcon.tsx +33 -0
- package/src/features/exampleSolution/components/MessageBlock.tsx +67 -0
- package/src/features/exampleSolution/components/QuestionSection.tsx +56 -0
- package/src/features/exampleSolution/components/SolutionSection.tsx +69 -0
- package/src/features/exampleSolution/components/index.ts +0 -0
- package/src/features/exampleSolution/constants.ts +5 -0
- package/src/features/exampleSolution/hooks/useExampleSolution.ts +64 -0
- package/src/features/exampleSolution/index.ts +3 -0
- package/src/features/exampleSolution/model/ExampleSolution.model.ts +12 -0
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +23 -0
- package/src/features/exampleSolution/model/ExampleSolutionCache.ts +20 -0
- package/src/features/exampleSolution/types.ts +25 -0
- package/src/features/feedback/model/comments.ts +7 -7
- package/src/features/feedback/model/model.ts +6 -6
- package/src/features/gifCelebrations/GifCelebrations.tsx +75 -0
- package/src/features/gifCelebrations/assets/confetti.webp +0 -0
- package/src/features/gifCelebrations/assets/gifFallback.gif +0 -0
- package/src/features/gifCelebrations/components/Backdrop.tsx +41 -0
- package/src/features/gifCelebrations/components/ContentContainer.tsx +44 -0
- package/src/features/gifCelebrations/components/Gif.tsx +88 -0
- package/src/features/gifCelebrations/components/Progress.tsx +106 -0
- package/src/features/gifCelebrations/constants.ts +32 -0
- package/src/features/gifCelebrations/helpers.ts +144 -0
- package/src/features/gifCelebrations/index.ts +2 -0
- package/src/features/gifCelebrations/model/GifCelebrations.model.ts +167 -0
- package/src/features/gifCelebrations/model/GifCelebrationsApi.ts +26 -0
- package/src/features/gifCelebrations/model/GifCelebrationsCache.ts +41 -0
- package/src/features/gifCelebrations/types/model.types.ts +53 -0
- package/src/features/problemSelector/components/ProblemSelectorButton.tsx +17 -10
- package/src/features/problemSelector/constants.ts +3 -2
- package/src/index.ts +3 -0
- package/src/lib/effector/ControlledSample.ts +40 -0
- package/src/lib/effector/createControllerEffect.ts +41 -41
- package/src/lib/helpers/helpers.ts +1 -1
- package/src/react-app-env.d.ts +6 -0
- package/src/shared/icons/ExcitedLavaIcon.tsx +541 -0
- package/src/shared/icons/LavaIconInGlasses.tsx +489 -0
- package/src/shared/icons/index.ts +18 -0
- package/src/shared/translation/constants.ts +4 -0
- package/src/shared/translation/localization/ca.json +33 -0
- package/src/shared/translation/localization/en.json +13 -1
- package/src/shared/translation/localization/gb.json +13 -1
- package/src/shared/translation/localization/sct.json +33 -0
- package/src/shared/translation/localization/sw.json +13 -1
- package/src/shared/translation/types.ts +6 -0
- package/src/shared/translation/validation.types.ts +9 -1
- package/src/types/common.types.ts +4 -0
- package/dist/commonjs/shared/icons/LockIcon.js +0 -31
- package/dist/commonjs/shared/icons/LockIcon.js.map +0 -1
- package/dist/module/shared/icons/LockIcon.js +0 -23
- package/dist/module/shared/icons/LockIcon.js.map +0 -1
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/commonjs/shared/icons/LockIcon.d.ts.map +0 -1
- package/dist/typescript/module/shared/icons/LockIcon.d.ts +0 -4
- package/dist/typescript/module/shared/icons/LockIcon.d.ts.map +0 -1
- package/src/shared/icons/LockIcon.tsx +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ContentContainer","children","progress","width","useWindowDimensions","RIGHT_POSITION","CONTENT_CONTAINER","CONTAINER_WIDTH","ROTATION_PADDING","LEFT_POSITION","animatedStyles","useAnimatedStyle","transform","translateX","interpolate","value","rotate","ANGLE","jsx","View","style","styles","container","exports","StyleSheet","create","alignItems","gap","SPACING","position"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/components/ContentContainer.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAAgD,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAA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
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Gif = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _constants = require("../constants.js");
|
|
11
|
+
var _index = require("../../../shared/translation/index.js");
|
|
12
|
+
var _helpers = require("../helpers.js");
|
|
13
|
+
var _gifFallback = _interopRequireDefault(require("../assets/gifFallback.gif"));
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
+
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; }
|
|
18
|
+
const Gif = ({
|
|
19
|
+
gifObject,
|
|
20
|
+
getCachePathMethod,
|
|
21
|
+
TextComponent
|
|
22
|
+
}) => {
|
|
23
|
+
const [size, setSize] = (0, _react.useState)(null);
|
|
24
|
+
const [pathOrUri, setPathOrUri] = (0, _react.useState)('');
|
|
25
|
+
const t = (0, _index.useText)();
|
|
26
|
+
const gifGroupNumber = Number(gifObject.group.replace('group', ''));
|
|
27
|
+
const gifLabel = (0, _helpers.getGifLabel)(gifGroupNumber);
|
|
28
|
+
(0, _react.useLayoutEffect)(() => {
|
|
29
|
+
const loadImageSize = async () => {
|
|
30
|
+
let localPath;
|
|
31
|
+
try {
|
|
32
|
+
localPath = await (0, _helpers.getImagePath)(gifObject.url, getCachePathMethod);
|
|
33
|
+
} catch (error) {
|
|
34
|
+
localPath = _reactNativeUi.IS_WEB ? _gifFallback.default : _reactNative.Image.resolveAssetSource(_gifFallback.default).uri;
|
|
35
|
+
console.error('Error fetching image from cache:', error);
|
|
36
|
+
}
|
|
37
|
+
_reactNative.Image.getSize(localPath, (width, height) => {
|
|
38
|
+
setSize({
|
|
39
|
+
width: (0, _helpers.constrainDimension)(width, _constants.MIN_GIF_SIZE, _constants.MAX_GIF_SIZE.WIDTH),
|
|
40
|
+
height: (0, _helpers.constrainDimension)(height, _constants.MIN_GIF_SIZE, _constants.MAX_GIF_SIZE.HEIGHT)
|
|
41
|
+
});
|
|
42
|
+
setPathOrUri(localPath);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
loadImageSize();
|
|
46
|
+
}, [gifObject.url]);
|
|
47
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
48
|
+
style: styles.backgroundContainer,
|
|
49
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
50
|
+
style: styles.container,
|
|
51
|
+
children: [size && pathOrUri && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
52
|
+
alt: "Funny celebration animated image",
|
|
53
|
+
source: {
|
|
54
|
+
uri: pathOrUri
|
|
55
|
+
},
|
|
56
|
+
width: size.width,
|
|
57
|
+
height: size.height,
|
|
58
|
+
style: [styles.image, {
|
|
59
|
+
width: size.width,
|
|
60
|
+
height: size.height
|
|
61
|
+
}] //this sizes duplication is needed for compatibility with web and rn
|
|
62
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
style: styles.textContainer,
|
|
64
|
+
children: TextComponent(t(gifLabel))
|
|
65
|
+
})]
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
exports.Gif = Gif;
|
|
70
|
+
const styles = _reactNative.StyleSheet.create({
|
|
71
|
+
backgroundContainer: {
|
|
72
|
+
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
73
|
+
borderRadius: 23,
|
|
74
|
+
padding: _reactNativeUi.SPACING[200]
|
|
75
|
+
},
|
|
76
|
+
container: {
|
|
77
|
+
padding: _reactNativeUi.SPACING[1600],
|
|
78
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[400],
|
|
79
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1
|
|
80
|
+
},
|
|
81
|
+
image: {
|
|
82
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[100]
|
|
83
|
+
},
|
|
84
|
+
textContainer: {
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
bottom: 74,
|
|
87
|
+
alignSelf: 'center'
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
//# sourceMappingURL=Gif.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeUi","_constants","_index","_helpers","_gifFallback","_interopRequireDefault","_jsxRuntime","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Gif","gifObject","getCachePathMethod","TextComponent","size","setSize","useState","pathOrUri","setPathOrUri","useText","gifGroupNumber","Number","group","replace","gifLabel","getGifLabel","useLayoutEffect","loadImageSize","localPath","getImagePath","url","error","IS_WEB","gifFallback","Image","resolveAssetSource","uri","console","getSize","width","height","constrainDimension","MIN_GIF_SIZE","MAX_GIF_SIZE","WIDTH","HEIGHT","jsx","View","style","styles","backgroundContainer","children","jsxs","container","alt","source","image","textContainer","exports","StyleSheet","create","backgroundColor","borderRadius","padding","SPACING","BORDER_RADIUS","COLORS","NEUTRAL_1","position","bottom","alignSelf"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/components/Gif.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAC,sBAAA,CAAAR,OAAA;AAAmD,IAAAS,WAAA,GAAAT,OAAA;AAAA,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAA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N,QAAA,EAAEtC,aAAa,CAACjB,CAAC,CAAC4B,QAAQ,CAAC;MAAC,CAAO,CAAC;IAAA,CAClE;EAAC,CACH,CAAC;AAEX,CAAC;AAAAkC,OAAA,CAAAhD,GAAA,GAAAA,GAAA;AAED,MAAMuC,MAAM,GAAGU,uBAAU,CAACC,MAAM,CAAC;EAC/BV,mBAAmB,EAAE;IACnBW,eAAe,EAAE,0BAA0B;IAC3CC,YAAY,EAAE,EAAE;IAChBC,OAAO,EAAEC,sBAAO,CAAC,GAAG;EACtB,CAAC;EACDX,SAAS,EAAE;IACTU,OAAO,EAAEC,sBAAO,CAAC,IAAI,CAAC;IACtBF,YAAY,EAAEG,4BAAa,CAAC,GAAG,CAAC;IAChCJ,eAAe,EAAEK,qBAAM,CAACC;EAC1B,CAAC;EACDX,KAAK,EAAE;IACLM,YAAY,EAAEG,4BAAa,CAAC,GAAG;EACjC,CAAC;EACDR,aAAa,EAAE;IACbW,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,EAAE;IACVC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Progress = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
|
+
var _confetti = _interopRequireDefault(require("../assets/confetti.webp"));
|
|
12
|
+
var _helpers = require("../helpers.js");
|
|
13
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
+
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); }
|
|
15
|
+
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; }
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const Progress = ({
|
|
18
|
+
progress,
|
|
19
|
+
completedPercent
|
|
20
|
+
}) => {
|
|
21
|
+
const progressLineWidth = (0, _helpers.getProgressLineWidth)(completedPercent);
|
|
22
|
+
const animatedStyles = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
23
|
+
width: `${(0, _reactNativeReanimated.interpolate)(progress.value, [0, 1, 2], [0, progressLineWidth, progressLineWidth])}%`
|
|
24
|
+
}), [progress, progressLineWidth]);
|
|
25
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
26
|
+
style: styles.backgroundContainer,
|
|
27
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
28
|
+
style: styles.container,
|
|
29
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
30
|
+
style: styles.progressContainer,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
32
|
+
style: [styles.progress, animatedStyles],
|
|
33
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
34
|
+
variant: _reactNativeUi.HeadingVariants.H1,
|
|
35
|
+
style: styles.percent,
|
|
36
|
+
children: `${completedPercent}%`
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Image, {
|
|
40
|
+
source: _reactNativeUi.IS_WEB ? {
|
|
41
|
+
uri: _confetti.default
|
|
42
|
+
} : require('../assets/confetti.webp'),
|
|
43
|
+
style: styles.confetti
|
|
44
|
+
})]
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.Progress = Progress;
|
|
49
|
+
const styles = _reactNative.StyleSheet.create({
|
|
50
|
+
backgroundContainer: {
|
|
51
|
+
backgroundColor: 'rgba(255, 255, 255, 0.6)',
|
|
52
|
+
borderRadius: 23,
|
|
53
|
+
padding: _reactNativeUi.SPACING[200],
|
|
54
|
+
width: '100%'
|
|
55
|
+
},
|
|
56
|
+
container: {
|
|
57
|
+
width: '100%',
|
|
58
|
+
height: 116,
|
|
59
|
+
flexDirection: 'row',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[400],
|
|
62
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
63
|
+
paddingLeft: _reactNativeUi.SPACING[400],
|
|
64
|
+
paddingRight: _reactNativeUi.SPACING[200],
|
|
65
|
+
gap: _reactNativeUi.SPACING[100]
|
|
66
|
+
},
|
|
67
|
+
progressContainer: {
|
|
68
|
+
height: 50,
|
|
69
|
+
flexGrow: 1,
|
|
70
|
+
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_5,
|
|
71
|
+
borderRadius: 90,
|
|
72
|
+
overflow: 'hidden'
|
|
73
|
+
},
|
|
74
|
+
progress: {
|
|
75
|
+
position: 'absolute',
|
|
76
|
+
height: '100%',
|
|
77
|
+
backgroundColor: _reactNativeUi.COLORS.PRIMARY_BLUE,
|
|
78
|
+
borderRadius: _reactNativeUi.BORDER_RADIUS[200],
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
alignItems: 'flex-end',
|
|
81
|
+
paddingRight: 10.6,
|
|
82
|
+
overflow: 'hidden'
|
|
83
|
+
},
|
|
84
|
+
confetti: {
|
|
85
|
+
width: 75,
|
|
86
|
+
height: 70,
|
|
87
|
+
marginHorizontal: _reactNativeUi.SPACING[200]
|
|
88
|
+
},
|
|
89
|
+
percent: {
|
|
90
|
+
position: 'absolute',
|
|
91
|
+
paddingRight: 10,
|
|
92
|
+
color: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
93
|
+
fontWeight: '700'
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=Progress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_confetti","_helpers","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","Progress","progress","completedPercent","progressLineWidth","getProgressLineWidth","animatedStyles","useAnimatedStyle","width","interpolate","value","jsx","View","style","styles","backgroundContainer","children","jsxs","container","progressContainer","Typography","variant","HeadingVariants","H1","percent","Image","source","IS_WEB","uri","confettiImage","confetti","exports","StyleSheet","create","backgroundColor","borderRadius","padding","SPACING","height","flexDirection","alignItems","BORDER_RADIUS","COLORS","NEUTRAL_1","paddingLeft","paddingRight","gap","flexGrow","NEUTRAL_5","overflow","position","PRIMARY_BLUE","justifyContent","marginHorizontal","color","fontWeight"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/components/Progress.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAQA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,SAAA,GAAAJ,sBAAA,CAAAF,OAAA;AAEA,IAAAO,QAAA,GAAAP,OAAA;AAAiD,IAAAQ,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M,EAAE,EAAE;IACVe,gBAAgB,EAAEhB,sBAAO,CAAC,GAAG;EAC/B,CAAC;EACDb,OAAO,EAAE;IACP0B,QAAQ,EAAE,UAAU;IACpBL,YAAY,EAAE,EAAE;IAChBS,KAAK,EAAEZ,qBAAM,CAACC,SAAS;IACvBY,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.MIN_WIDTH_FOR_TWO_DIGITS = exports.MIN_WIDTH_FOR_ONE_DIGIT = exports.MIN_PROBLEMS_TO_SHOW_GIF = exports.MIN_GIF_SIZE = exports.MAX_GIF_SIZE = exports.GROUPS_PERCENTAGES = exports.GIFS_FETCHED_KEY = exports.GET_GIFS_TIMEOUT = exports.CONTENT_CONTAINER = exports.BACKDROP_COLOR = exports.ANIMATION_DURATION = void 0;
|
|
7
|
+
const BACKDROP_COLOR = exports.BACKDROP_COLOR = {
|
|
8
|
+
INITIAL: 'rgba(51, 51, 51, 0)',
|
|
9
|
+
FINAL: 'rgba(51, 51, 51, 0.66)'
|
|
10
|
+
};
|
|
11
|
+
const CONTENT_CONTAINER = exports.CONTENT_CONTAINER = {
|
|
12
|
+
ANGLE: 5,
|
|
13
|
+
CONTAINER_WIDTH: 769,
|
|
14
|
+
ROTATION_PADDING: 44 // to be sure that the content is not cut off on the edges because of rotate transform
|
|
15
|
+
};
|
|
16
|
+
const ANIMATION_DURATION = exports.ANIMATION_DURATION = 1750;
|
|
17
|
+
const MIN_PROBLEMS_TO_SHOW_GIF = exports.MIN_PROBLEMS_TO_SHOW_GIF = 7;
|
|
18
|
+
const MAX_GIF_SIZE = exports.MAX_GIF_SIZE = {
|
|
19
|
+
WIDTH: 480,
|
|
20
|
+
HEIGHT: 300
|
|
21
|
+
};
|
|
22
|
+
const MIN_GIF_SIZE = exports.MIN_GIF_SIZE = 300;
|
|
23
|
+
const GROUPS_PERCENTAGES = exports.GROUPS_PERCENTAGES = {
|
|
24
|
+
group1: [15, 20, 25, 30],
|
|
25
|
+
// Early celebrations
|
|
26
|
+
group2: [33, 40, 45, 50],
|
|
27
|
+
// Mid celebrations
|
|
28
|
+
group3: [60, 66, 75, 80] // Party
|
|
29
|
+
};
|
|
30
|
+
const MIN_WIDTH_FOR_ONE_DIGIT = exports.MIN_WIDTH_FOR_ONE_DIGIT = 12;
|
|
31
|
+
const MIN_WIDTH_FOR_TWO_DIGITS = exports.MIN_WIDTH_FOR_TWO_DIGITS = 15;
|
|
32
|
+
const GET_GIFS_TIMEOUT = exports.GET_GIFS_TIMEOUT = 5000;
|
|
33
|
+
const GIFS_FETCHED_KEY = exports.GIFS_FETCHED_KEY = 'gifsFetchedTimestamp';
|
|
34
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BACKDROP_COLOR","exports","INITIAL","FINAL","CONTENT_CONTAINER","ANGLE","CONTAINER_WIDTH","ROTATION_PADDING","ANIMATION_DURATION","MIN_PROBLEMS_TO_SHOW_GIF","MAX_GIF_SIZE","WIDTH","HEIGHT","MIN_GIF_SIZE","GROUPS_PERCENTAGES","group1","group2","group3","MIN_WIDTH_FOR_ONE_DIGIT","MIN_WIDTH_FOR_TWO_DIGITS","GET_GIFS_TIMEOUT","GIFS_FETCHED_KEY"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC5BE,OAAO,EAAE,qBAAqB;EAC9BC,KAAK,EAAE;AACT,CAAC;AAEM,MAAMC,iBAAiB,GAAAH,OAAA,CAAAG,iBAAA,GAAG;EAC/BC,KAAK,EAAE,CAAC;EACRC,eAAe,EAAE,GAAG;EACpBC,gBAAgB,EAAE,EAAE,CAAE;AACxB,CAAC;AAEM,MAAMC,kBAAkB,GAAAP,OAAA,CAAAO,kBAAA,GAAG,IAAI;AAC/B,MAAMC,wBAAwB,GAAAR,OAAA,CAAAQ,wBAAA,GAAG,CAAC;AAElC,MAAMC,YAAY,GAAAT,OAAA,CAAAS,YAAA,GAAG;EAC1BC,KAAK,EAAE,GAAG;EACVC,MAAM,EAAE;AACV,CAAC;AACM,MAAMC,YAAY,GAAAZ,OAAA,CAAAY,YAAA,GAAG,GAAG;AAExB,MAAMC,kBAAkB,GAAAb,OAAA,CAAAa,kBAAA,GAAG;EAChCC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EAAE;EAC1BC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;EAAE;EAC1BC,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAE;AAC5B,CAAC;AAEM,MAAMC,uBAAuB,GAAAjB,OAAA,CAAAiB,uBAAA,GAAG,EAAE;AAClC,MAAMC,wBAAwB,GAAAlB,OAAA,CAAAkB,wBAAA,GAAG,EAAE;AAEnC,MAAMC,gBAAgB,GAAAnB,OAAA,CAAAmB,gBAAA,GAAG,IAAI;AAE7B,MAAMC,gBAAgB,GAAApB,OAAA,CAAAoB,gBAAA,GAAG,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.shouldRefreshGifs = exports.getProgressLineWidth = exports.getImagePath = exports.getGifLabel = exports.generateProblemsGifsTable = exports.generateGifsStructure = exports.findGroupForPercentage = exports.constrainDimension = void 0;
|
|
7
|
+
var _constants = require("./constants.js");
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
/**
|
|
10
|
+
* Number of problems When we show gif
|
|
11
|
+
* <6 Never
|
|
12
|
+
* 7-12 50% completion
|
|
13
|
+
* 13-18 33%, 66% completion
|
|
14
|
+
* 19-24 25%, 50%, 75 completion
|
|
15
|
+
* 25-30 20%, 40%, 60%, 80% completion
|
|
16
|
+
* .>30 15%, 30%, 45%, 60%, 75% completion
|
|
17
|
+
*
|
|
18
|
+
* We are also going to have different buckets with different gifs. The logic is as follows:
|
|
19
|
+
* Group 1: 15%, 20%, 25%, 30% - Early celebrations
|
|
20
|
+
* Group 2: 33%, 40%, 45%, 50% - Mid celebrations
|
|
21
|
+
* Group 3: 60%, 66%, 75%, 80% - Party
|
|
22
|
+
* or
|
|
23
|
+
* Group 1: <=30% - Early celebrations
|
|
24
|
+
* Group 2: >30% <60% - Mid celebrations
|
|
25
|
+
* Group 3: >=60% - Party
|
|
26
|
+
*/
|
|
27
|
+
const generateProblemsGifsTable = (problemsAmount, resolvedProblems, gifs) => {
|
|
28
|
+
const percentageMilestones = getPercentageMilestones(problemsAmount);
|
|
29
|
+
const result = {};
|
|
30
|
+
for (const percentage of percentageMilestones) {
|
|
31
|
+
const problemNumber = Math.ceil(problemsAmount * (percentage / 100));
|
|
32
|
+
if (problemNumber <= resolvedProblems) continue;
|
|
33
|
+
const groupKey = findGroupForPercentage(percentage);
|
|
34
|
+
const gifsInGroup = gifs[groupKey];
|
|
35
|
+
if (!gifsInGroup || gifsInGroup.length === 0) continue;
|
|
36
|
+
const unshownGif = gifsInGroup.find(gif => !gif.isShown);
|
|
37
|
+
const selectedGif = unshownGif || gifsInGroup[0];
|
|
38
|
+
if (selectedGif) {
|
|
39
|
+
result[problemNumber] = {
|
|
40
|
+
url: selectedGif.url,
|
|
41
|
+
group: groupKey
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
exports.generateProblemsGifsTable = generateProblemsGifsTable;
|
|
48
|
+
const getPercentageMilestones = problemsAmount => {
|
|
49
|
+
if (problemsAmount <= 12) return [50];
|
|
50
|
+
if (problemsAmount <= 18) return [33, 66];
|
|
51
|
+
if (problemsAmount <= 24) return [25, 50, 75];
|
|
52
|
+
if (problemsAmount <= 30) return [20, 40, 60, 80];
|
|
53
|
+
return [15, 30, 45, 60, 75];
|
|
54
|
+
};
|
|
55
|
+
const generateGifsStructure = gifs => Object.fromEntries(Object.entries(gifs).map(([key, value]) => [key, value.map(url => ({
|
|
56
|
+
url,
|
|
57
|
+
isShown: false,
|
|
58
|
+
group: key
|
|
59
|
+
}))]));
|
|
60
|
+
exports.generateGifsStructure = generateGifsStructure;
|
|
61
|
+
const getGifLabel = relatedGroup => {
|
|
62
|
+
if (relatedGroup === 2) {
|
|
63
|
+
return 'gifCelebrations.onTheWay';
|
|
64
|
+
}
|
|
65
|
+
if (relatedGroup === 3) {
|
|
66
|
+
return 'gifCelebrations.almostThere';
|
|
67
|
+
}
|
|
68
|
+
return 'gifCelebrations.greatStart';
|
|
69
|
+
};
|
|
70
|
+
exports.getGifLabel = getGifLabel;
|
|
71
|
+
const getProgressLineWidth = completedPercent => {
|
|
72
|
+
if (completedPercent <= 9) {
|
|
73
|
+
return _constants.MIN_WIDTH_FOR_ONE_DIGIT;
|
|
74
|
+
}
|
|
75
|
+
if (completedPercent <= 15) {
|
|
76
|
+
return _constants.MIN_WIDTH_FOR_TWO_DIGITS;
|
|
77
|
+
}
|
|
78
|
+
return completedPercent;
|
|
79
|
+
};
|
|
80
|
+
exports.getProgressLineWidth = getProgressLineWidth;
|
|
81
|
+
const findGroupForPercentage = percentage => {
|
|
82
|
+
if (percentage <= 30) {
|
|
83
|
+
return 'group1';
|
|
84
|
+
}
|
|
85
|
+
if (percentage < 60) {
|
|
86
|
+
return 'group2';
|
|
87
|
+
}
|
|
88
|
+
return 'group3';
|
|
89
|
+
};
|
|
90
|
+
exports.findGroupForPercentage = findGroupForPercentage;
|
|
91
|
+
const getImagePath = async (url, cacheMethod) => {
|
|
92
|
+
if (cacheMethod) {
|
|
93
|
+
const path = await cacheMethod(url);
|
|
94
|
+
if (path) return path;
|
|
95
|
+
} else {
|
|
96
|
+
// @ts-ignore
|
|
97
|
+
const isImagesStored = await _reactNative.Image.queryCache([url]).then(images => !!images[url]);
|
|
98
|
+
if (isImagesStored) return url;
|
|
99
|
+
}
|
|
100
|
+
throw new Error('Image not found in cache');
|
|
101
|
+
};
|
|
102
|
+
exports.getImagePath = getImagePath;
|
|
103
|
+
const constrainDimension = (value, min, max) => Math.max(min, Math.min(max, value));
|
|
104
|
+
exports.constrainDimension = constrainDimension;
|
|
105
|
+
const shouldRefreshGifs = timestamp => {
|
|
106
|
+
if (!timestamp) return true;
|
|
107
|
+
const REFRESH_INTERVAL_HOURS = 24;
|
|
108
|
+
const lastFetchedDate = new Date(timestamp);
|
|
109
|
+
const currentDate = new Date();
|
|
110
|
+
const diffInHours = (currentDate.getTime() - lastFetchedDate.getTime()) / (1000 * 60 * 60);
|
|
111
|
+
return diffInHours > REFRESH_INTERVAL_HOURS;
|
|
112
|
+
};
|
|
113
|
+
exports.shouldRefreshGifs = shouldRefreshGifs;
|
|
114
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_constants","require","_reactNative","generateProblemsGifsTable","problemsAmount","resolvedProblems","gifs","percentageMilestones","getPercentageMilestones","result","percentage","problemNumber","Math","ceil","groupKey","findGroupForPercentage","gifsInGroup","length","unshownGif","find","gif","isShown","selectedGif","url","group","exports","generateGifsStructure","Object","fromEntries","entries","map","key","value","getGifLabel","relatedGroup","getProgressLineWidth","completedPercent","MIN_WIDTH_FOR_ONE_DIGIT","MIN_WIDTH_FOR_TWO_DIGITS","getImagePath","cacheMethod","path","isImagesStored","Image","queryCache","then","images","Error","constrainDimension","min","max","shouldRefreshGifs","timestamp","REFRESH_INTERVAL_HOURS","lastFetchedDate","Date","currentDate","diffInHours","getTime"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/helpers.ts"],"mappings":";;;;;;A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E,GAAG,EAAE,CAAC;EAE1F,OAAOD,WAAW,GAAGJ,sBAAsB;AAC7C,CAAC;AAAA5B,OAAA,CAAA0B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "GifCelebrations", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _GifCelebrations.GifCelebrations;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "GifCelebrationsModel", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _GifCelebrationsModel.GifCelebrationsModel;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _GifCelebrations = require("./GifCelebrations.js");
|
|
19
|
+
var _GifCelebrationsModel = require("./model/GifCelebrations.model.js");
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_GifCelebrations","require","_GifCelebrationsModel"],"sourceRoot":"../../../../src","sources":["features/gifCelebrations/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GifCelebrationsModel = void 0;
|
|
7
|
+
var _effector = require("effector");
|
|
8
|
+
var _GifCelebrationsApi = require("./GifCelebrationsApi.js");
|
|
9
|
+
var _GifCelebrationsCache = require("./GifCelebrationsCache.js");
|
|
10
|
+
var _helpers = require("../helpers.js");
|
|
11
|
+
var _constants = require("../constants.js");
|
|
12
|
+
class GifCelebrationsModel {
|
|
13
|
+
play = (0, _effector.createEvent)();
|
|
14
|
+
stop = (0, _effector.createEvent)();
|
|
15
|
+
resetGifTriggerable = (0, _effector.createEvent)();
|
|
16
|
+
setGifTriggerable = (0, _effector.createEvent)();
|
|
17
|
+
$isGifTriggerable = (0, _effector.createStore)(false).reset(this.resetGifTriggerable).reset(this.stop).on(this.setGifTriggerable, (_, isGifCelebrationMayBeTriggered) => isGifCelebrationMayBeTriggered);
|
|
18
|
+
resetProblemsGifsTable = (0, _effector.createEvent)();
|
|
19
|
+
$problemsGifsTable = (0, _effector.createStore)(null).reset(this.resetProblemsGifsTable);
|
|
20
|
+
setActiveGif = (0, _effector.createEvent)();
|
|
21
|
+
$activeGif = (0, _effector.createStore)(null).reset(this.stop).reset(this.resetGifTriggerable).on(this.setActiveGif, (_, gif) => gif);
|
|
22
|
+
initialize = (0, _effector.createEvent)();
|
|
23
|
+
constructor({
|
|
24
|
+
api,
|
|
25
|
+
problemsAmount,
|
|
26
|
+
resolvedProblemsAmount,
|
|
27
|
+
customLocalStorage,
|
|
28
|
+
customGetCachePathMethod,
|
|
29
|
+
customPrefetchMethod
|
|
30
|
+
}) {
|
|
31
|
+
this.api = new _GifCelebrationsApi.GifCelebrationsApi(api);
|
|
32
|
+
this.cache = new _GifCelebrationsCache.GifCelebrationsCache({
|
|
33
|
+
customGetCachePathMethod,
|
|
34
|
+
customPrefetchMethod
|
|
35
|
+
});
|
|
36
|
+
this.$problemsAmount = problemsAmount;
|
|
37
|
+
this.$resolvedProblemsAmount = resolvedProblemsAmount;
|
|
38
|
+
this.localStorage = customLocalStorage || localStorage;
|
|
39
|
+
this.setupEventHandlers();
|
|
40
|
+
}
|
|
41
|
+
setupEventHandlers() {
|
|
42
|
+
(0, _effector.sample)({
|
|
43
|
+
clock: this.initialize,
|
|
44
|
+
source: this.cache.$gifs,
|
|
45
|
+
filter: gifs => {
|
|
46
|
+
if (!gifs) return true;
|
|
47
|
+
const gifsFetchedTimestamp = this.localStorage.getItem(_constants.GIFS_FETCHED_KEY);
|
|
48
|
+
return (0, _helpers.shouldRefreshGifs)(gifsFetchedTimestamp);
|
|
49
|
+
},
|
|
50
|
+
target: this.api.getGifsFx
|
|
51
|
+
});
|
|
52
|
+
(0, _effector.sample)({
|
|
53
|
+
source: this.api.getGifsFx.doneData,
|
|
54
|
+
filter: response => response.ok,
|
|
55
|
+
fn: response => response.data,
|
|
56
|
+
target: this.cache.initialSet
|
|
57
|
+
});
|
|
58
|
+
(0, _effector.sample)({
|
|
59
|
+
source: this.api.getGifsFx.doneData,
|
|
60
|
+
filter: response => response.ok,
|
|
61
|
+
target: (0, _effector.createEffect)(() => {
|
|
62
|
+
this.localStorage.setItem(_constants.GIFS_FETCHED_KEY, new Date().toISOString());
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
(0, _effector.sample)({
|
|
66
|
+
clock: [this.initialize, this.api.getGifsFx.doneData],
|
|
67
|
+
source: {
|
|
68
|
+
gifs: this.cache.$gifs,
|
|
69
|
+
problemsAmount: this.$problemsAmount,
|
|
70
|
+
resolvedProblemsAmount: this.$resolvedProblemsAmount
|
|
71
|
+
},
|
|
72
|
+
filter: ({
|
|
73
|
+
gifs
|
|
74
|
+
}) => !!gifs,
|
|
75
|
+
fn: ({
|
|
76
|
+
problemsAmount,
|
|
77
|
+
resolvedProblemsAmount,
|
|
78
|
+
gifs
|
|
79
|
+
}) => {
|
|
80
|
+
if (!gifs || problemsAmount < _constants.MIN_PROBLEMS_TO_SHOW_GIF) return null;
|
|
81
|
+
return (0, _helpers.generateProblemsGifsTable)(problemsAmount, resolvedProblemsAmount, gifs);
|
|
82
|
+
},
|
|
83
|
+
target: this.$problemsGifsTable
|
|
84
|
+
});
|
|
85
|
+
(0, _effector.sample)({
|
|
86
|
+
source: this.$problemsGifsTable,
|
|
87
|
+
filter: problemsGifsTable => !!problemsGifsTable,
|
|
88
|
+
fn: problemsGifsTable => {
|
|
89
|
+
if (!problemsGifsTable) return [];
|
|
90
|
+
return Object.values(problemsGifsTable).map(gif => gif.url);
|
|
91
|
+
},
|
|
92
|
+
target: this.cache.prefetchGifs
|
|
93
|
+
});
|
|
94
|
+
(0, _effector.sample)({
|
|
95
|
+
clock: this.play,
|
|
96
|
+
source: {
|
|
97
|
+
isGifCelebrationMayBeTriggered: this.$isGifTriggerable,
|
|
98
|
+
gifsGroups: this.cache.$gifs,
|
|
99
|
+
resolvedProblemsAmount: this.$resolvedProblemsAmount,
|
|
100
|
+
problemsGifsTable: this.$problemsGifsTable
|
|
101
|
+
},
|
|
102
|
+
filter: ({
|
|
103
|
+
isGifCelebrationMayBeTriggered,
|
|
104
|
+
gifsGroups,
|
|
105
|
+
problemsGifsTable
|
|
106
|
+
}) => !!(isGifCelebrationMayBeTriggered && gifsGroups && problemsGifsTable),
|
|
107
|
+
fn: sources => sources,
|
|
108
|
+
target: this.updateGifShownStatus
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
updateGifShownStatus = (0, _effector.createEffect)(({
|
|
112
|
+
gifsGroups,
|
|
113
|
+
resolvedProblemsAmount,
|
|
114
|
+
problemsGifsTable
|
|
115
|
+
}) => {
|
|
116
|
+
const gifToShow = problemsGifsTable[resolvedProblemsAmount];
|
|
117
|
+
const groupName = gifToShow.group;
|
|
118
|
+
const gifsInGroup = gifsGroups[groupName];
|
|
119
|
+
const selectedGifIndex = gifsInGroup?.findIndex(gif => gif.url === gifToShow.url);
|
|
120
|
+
if (!gifsInGroup || selectedGifIndex === -1) {
|
|
121
|
+
console.warn(`Gif with URL ${gifToShow.url} not found in group ${groupName}`);
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
const updatedGifsInGroup = gifsInGroup.map((gif, index) => ({
|
|
125
|
+
...gif,
|
|
126
|
+
isShown: index === selectedGifIndex ? true : gif.isShown
|
|
127
|
+
}));
|
|
128
|
+
this.cache.set({
|
|
129
|
+
...gifsGroups,
|
|
130
|
+
[groupName]: updatedGifsInGroup
|
|
131
|
+
});
|
|
132
|
+
this.setActiveGif(gifToShow);
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
exports.GifCelebrationsModel = GifCelebrationsModel;
|
|
136
|
+
//# sourceMappingURL=GifCelebrations.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","_GifCelebrationsApi","_GifCelebrationsCache","_helpers","_constants","GifCelebrationsModel","play","createEvent","stop","resetGifTriggerable","setGifTriggerable","$isGifTriggerable","createStore","reset","on","_","isGifCelebrationMayBeTriggered","resetProblemsGifsTable","$problemsGifsTable","setActiveGif","$activeGif","gif","initialize","constructor","api","problemsAmount","resolvedProblemsAmount","customLocalStorage","customGetCachePathMethod","customPrefetchMethod","GifCelebrationsApi","cache","GifCelebrationsCache","$problemsAmount","$resolvedProblemsAmount","localStorage","setupEventHandlers","sample","clock","source","$gifs","filter","gifs","gifsFetchedTimestamp","getItem","GIFS_FETCHED_KEY","shouldRefreshGifs","target","getGifsFx","doneData","response","ok","fn","data","initialSet","createEffect","setItem","Date","toISOString","MIN_PROBLEMS_TO_SHOW_GIF","generateProblemsGifsTable","problemsGifsTable","Object","values","map","url","prefetchGifs","gifsGroups","sources","updateGifShownStatus","gifToShow","groupName","group","gifsInGroup","selectedGifIndex","findIndex","console","warn","updatedGifsInGroup","index","isShown","set","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrations.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAD,OAAA;AAQA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAQO,MAAMK,oBAAoB,CAAC;EAOhBC,IAAI,GAAG,IAAAC,qBAAW,EAAC,CAAC;EACpBC,IAAI,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAEpBE,mBAAmB,GAAG,IAAAF,qB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6
|
+
exports.GifCelebrationsApi = void 0;
|
|
7
|
+
var _createControllerEffect = require("./../../../lib/effector/createControllerEffect.js");
|
|
8
|
+
var _constants = require("../constants.js");
|
|
9
|
+
class GifCelebrationsApi {
|
|
10
|
+
failedGetGifxTimeout = null;
|
|
11
|
+
constructor(api) {
|
|
12
|
+
this.getGifsFx = (0, _createControllerEffect.createControllerEffect)(() => api.getGifs());
|
|
13
|
+
this.getGifsFx.fail.watch(() => {
|
|
14
|
+
this.failedGetGifxTimeout = setTimeout(() => {
|
|
15
|
+
this.getGifsFx();
|
|
16
|
+
}, _constants.GET_GIFS_TIMEOUT);
|
|
17
|
+
});
|
|
18
|
+
this.getGifsFx.done.watch(() => {
|
|
19
|
+
if (this.failedGetGifxTimeout) {
|
|
20
|
+
clearTimeout(this.failedGetGifxTimeout);
|
|
21
|
+
this.failedGetGifxTimeout = null;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.GifCelebrationsApi = GifCelebrationsApi;
|
|
27
|
+
//# sourceMappingURL=GifCelebrationsApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_createControllerEffect","require","_constants","GifCelebrationsApi","failedGetGifxTimeout","constructor","api","getGifsFx","createControllerEffect","getGifs","fail","watch","setTimeout","GET_GIFS_TIMEOUT","done","clearTimeout","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrationsApi.ts"],"mappings":";;;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,CAAC;EAGtBC,oBAAoB,GAA0B,IAAI;EAE1DC,WAAWA,CAACC,GAA8B,EAAE;IAC1C,IAAI,CAACC,SAAS,GAAG,IAAAC,8CAAsB,EAAC,MAAMF,GAAG,CAACG,OAAO,CAAC,CAAC,CAAC;IAE5D,IAAI,CAACF,SAAS,CAACG,IAAI,CAACC,KAAK,CAAC,MAAM;MAC9B,IAAI,CAACP,oBAAoB,GAAGQ,UAAU,CAAC,MAAM;QAC3C,IAAI,CAACL,SAAS,CAAC,CAAC;MAClB,CAAC,EAAEM,2BAAgB,CAAC;IACtB,CAAC,CAAC;IAEF,IAAI,CAACN,SAAS,CAACO,IAAI,CAACH,KAAK,CAAC,MAAM;MAC9B,IAAI,IAAI,CAACP,oBAAoB,EAAE;QAC7BW,YAAY,CAAC,IAAI,CAACX,oBAAoB,CAAC;QACvC,IAAI,CAACA,oBAAoB,GAAG,IAAI;MAClC;IACF,CAAC,CAAC;EACJ;AACF;AAACY,OAAA,CAAAb,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GifCelebrationsCache = void 0;
|
|
7
|
+
var _effector = require("effector");
|
|
8
|
+
var _helpers = require("../helpers.js");
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
class GifCelebrationsCache {
|
|
11
|
+
initialSet = (0, _effector.createEvent)();
|
|
12
|
+
set = (0, _effector.createEvent)();
|
|
13
|
+
reset = (0, _effector.createEvent)();
|
|
14
|
+
prefetchGifs = (0, _effector.createEffect)(gifs => {
|
|
15
|
+
if (!gifs || gifs.length === 0) return;
|
|
16
|
+
gifs.forEach(gifUrl => {
|
|
17
|
+
this.prefetchMethod(gifUrl);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
$gifs = (0, _effector.createStore)(null).reset(this.reset).on(this.initialSet, (_, gifs) => (0, _helpers.generateGifsStructure)(gifs)).on(this.set, (_, gifs) => gifs);
|
|
21
|
+
constructor({
|
|
22
|
+
customGetCachePathMethod,
|
|
23
|
+
customPrefetchMethod
|
|
24
|
+
}) {
|
|
25
|
+
this.prefetchMethod = customPrefetchMethod || _reactNative.Image.prefetch;
|
|
26
|
+
this.getCachePathMethod = customGetCachePathMethod;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.GifCelebrationsCache = GifCelebrationsCache;
|
|
30
|
+
//# sourceMappingURL=GifCelebrationsCache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_effector","require","_helpers","_reactNative","GifCelebrationsCache","initialSet","createEvent","set","reset","prefetchGifs","createEffect","gifs","length","forEach","gifUrl","prefetchMethod","$gifs","createStore","on","_","generateGifsStructure","constructor","customGetCachePathMethod","customPrefetchMethod","Image","prefetch","getCachePathMethod","exports"],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/model/GifCelebrationsCache.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAOA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAOO,MAAMG,oBAAoB,CAAC;EAChBC,UAAU,GAAG,IAAAC,qBAAW,EAAa,CAAC;EACtCC,GAAG,GAAG,IAAAD,qBAAW,EAAgB,CAAC;EAClCE,KAAK,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAKrBG,YAAY,GAAG,IAAAC,sBAAY,EAAkBC,IAAI,IAAK;IACpE,IAAI,CAACA,IAAI,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;IAEhCD,IAAI,CAACE,OAAO,CAAEC,MAAM,IAAK;MACvB,IAAI,CAACC,cAAc,CAACD,MAAM,CAAC;IAC7B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEcE,KAAK,GAAG,IAAAC,qBAAW,EAAuB,IAAI,CAAC,CAC5DT,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC,CACjBU,EAAE,CAAC,IAAI,CAACb,UAAU,EAAE,CAACc,CAAC,EAAER,IAAI,KAAK,IAAAS,8BAAqB,EAACT,IAAI,CAAC,CAAC,CAC7DO,EAAE,CAAC,IAAI,CAACX,GAAG,EAAE,CAACY,CAAC,EAAER,IAAI,KAAKA,IAAI,CAAC;EAElCU,WAAWA,CAAC;IAAEC,wBAAwB;IAAEC;EAAgD,CAAC,EAAE;IACzF,IAAI,CAACR,cAAc,GAAGQ,oBAAoB,IAAIC,kBAAK,CAACC,QAAQ;IAC5D,IAAI,CAACC,kBAAkB,GAAGJ,wBAAwB;EACpD;AACF;AAACK,OAAA,CAAAvB,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["features/gifCelebrations/types/model.types.ts"],"mappings":"","ignoreList":[]}
|