@magmamath/students-features 0.6.14-rc.2 → 0.6.14-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/features/chatbot/components/{ChatMessages/ChatbotMessages.js → Chat/Chat.js} +8 -15
- package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +74 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js +144 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.js +135 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js +77 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/{Alternatives/InputButton.js → ChatInput/freeText/SendMessageButton.js} +26 -17
- package/dist/commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.js.map +1 -0
- package/dist/commonjs/features/chatbot/components/Chatbot.js +2 -2
- package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/commonjs/features/chatbot/constants.js +2 -1
- package/dist/commonjs/features/chatbot/constants.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 +44 -8
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotTextInput.js +16 -0
- package/dist/commonjs/features/chatbot/model/ChatBotTextInput.js.map +1 -0
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +44 -11
- package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/types.js +2 -0
- package/dist/commonjs/features/chatbot/types/types.js.map +1 -0
- package/dist/commonjs/features/chatbot/types/units.types.js +10 -0
- package/dist/commonjs/features/chatbot/types/units.types.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js +1 -3
- package/dist/commonjs/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/assets/grid.webp +0 -0
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +18 -11
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js +7 -7
- package/dist/commonjs/features/exampleSolution/components/QuestionSection.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js +55 -29
- package/dist/commonjs/features/exampleSolution/components/SolutionSection.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js +3 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolution.model.js.map +1 -1
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js +5 -4
- package/dist/commonjs/features/formulaSheet/components/FormulaSheet.js.map +1 -1
- package/dist/commonjs/shared/hooks/useKeyDownListener.js +3 -2
- package/dist/commonjs/shared/hooks/useKeyDownListener.js.map +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +2 -1
- package/dist/commonjs/shared/translation/localization/en.json +3 -2
- package/dist/commonjs/shared/translation/localization/gb.json +2 -1
- package/dist/commonjs/shared/translation/localization/sct.json +2 -1
- package/dist/commonjs/shared/translation/localization/sw.json +3 -2
- package/dist/module/features/chatbot/components/{ChatMessages/ChatbotMessages.js → Chat/Chat.js} +6 -13
- package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +67 -0
- package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js +138 -0
- package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.js +128 -0
- package/dist/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js +71 -0
- package/dist/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.js.map +1 -0
- package/dist/module/features/chatbot/components/{Alternatives/InputButton.js → ChatInput/freeText/SendMessageButton.js} +25 -16
- package/dist/module/features/chatbot/components/ChatInput/freeText/SendMessageButton.js.map +1 -0
- package/dist/module/features/chatbot/components/Chatbot.js +2 -2
- package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
- package/dist/module/features/chatbot/constants.js +1 -0
- package/dist/module/features/chatbot/constants.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 +44 -8
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotTextInput.js +11 -0
- package/dist/module/features/chatbot/model/ChatBotTextInput.js.map +1 -0
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js +44 -11
- package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/chatbot/types/types.js +2 -0
- package/dist/module/features/chatbot/types/types.js.map +1 -0
- package/dist/module/features/chatbot/types/units.types.js +6 -0
- package/dist/module/features/chatbot/types/units.types.js.map +1 -1
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js +1 -3
- package/dist/module/features/exampleSolution/ExampleSolutionModal.js.map +1 -1
- package/dist/module/features/exampleSolution/assets/grid.webp +0 -0
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +19 -12
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/module/features/exampleSolution/components/QuestionSection.js +9 -9
- package/dist/module/features/exampleSolution/components/QuestionSection.js.map +1 -1
- package/dist/module/features/exampleSolution/components/SolutionSection.js +57 -31
- package/dist/module/features/exampleSolution/components/SolutionSection.js.map +1 -1
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js +3 -1
- package/dist/module/features/exampleSolution/model/ExampleSolution.model.js.map +1 -1
- package/dist/module/features/formulaSheet/components/FormulaSheet.js +5 -4
- package/dist/module/features/formulaSheet/components/FormulaSheet.js.map +1 -1
- package/dist/module/shared/hooks/useKeyDownListener.js +3 -2
- package/dist/module/shared/hooks/useKeyDownListener.js.map +1 -1
- package/dist/module/shared/translation/localization/ca.json +2 -1
- package/dist/module/shared/translation/localization/en.json +3 -2
- package/dist/module/shared/translation/localization/gb.json +2 -1
- package/dist/module/shared/translation/localization/sct.json +2 -1
- package/dist/module/shared/translation/localization/sw.json +3 -2
- package/dist/typescript/commonjs/features/chatbot/components/{ChatMessages/ChatbotMessages.d.ts → Chat/Chat.d.ts} +3 -3
- package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts +9 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts +16 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts +16 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts +11 -0
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts.map +1 -0
- package/dist/typescript/{module/features/chatbot/components/Alternatives/InputButton.d.ts → commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts} +2 -2
- package/dist/typescript/commonjs/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +2 -0
- package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/constants.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/constants.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 +5 -6
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotTextInput.d.ts +8 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotTextInput.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +3 -2
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +23 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +11 -2
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/types.d.ts +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +5 -0
- package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +5 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts +2 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/QuestionSection.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/SolutionSection.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts +3 -2
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts +2 -1
- package/dist/typescript/commonjs/features/exampleSolution/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyDownListener.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/commonjs/shared/hooks/useKeyboard.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +5 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/components/{ChatMessages/ChatbotMessages.d.ts → Chat/Chat.d.ts} +3 -3
- package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts +9 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts +16 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts +16 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/ChatTextInput.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts +11 -0
- package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/chatbot/components/Alternatives/InputButton.d.ts → module/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts} +2 -2
- package/dist/typescript/module/features/chatbot/components/ChatInput/freeText/SendMessageButton.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +2 -0
- package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/constants.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/constants.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 +5 -6
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotTextInput.d.ts +8 -0
- package/dist/typescript/module/features/chatbot/model/ChatBotTextInput.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +3 -2
- package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +23 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts +11 -2
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/types.d.ts +1 -0
- package/dist/typescript/module/features/chatbot/types/types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts +5 -0
- package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/ExampleSolutionModal.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts +5 -1
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts +2 -1
- package/dist/typescript/module/features/exampleSolution/components/QuestionSection.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/SolutionSection.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts +3 -2
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolution.model.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/types.d.ts +2 -1
- package/dist/typescript/module/features/exampleSolution/types.d.ts.map +1 -1
- package/dist/typescript/module/features/formulaSheet/components/FormulaSheet.d.ts.map +1 -1
- package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyDownListener.d.ts.map +1 -1
- package/dist/typescript/module/shared/hooks/useKeyboard.d.ts +1 -1
- package/dist/typescript/module/shared/hooks/useKeyboard.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/constants.d.ts +5 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
- package/dist/typescript/module/shared/translation/model.d.ts +2 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/features/chatbot/components/{ChatMessages/ChatbotMessages.tsx → Chat/Chat.tsx} +12 -17
- package/src/features/chatbot/components/ChatInput/ChatInput.tsx +83 -0
- package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +156 -0
- package/src/features/chatbot/components/ChatInput/freeText/ChatTextInput.tsx +153 -0
- package/src/features/chatbot/components/ChatInput/freeText/FreeTextInputBlock.tsx +83 -0
- package/src/features/chatbot/components/{Alternatives/InputButton.tsx → ChatInput/freeText/SendMessageButton.tsx} +37 -16
- package/src/features/chatbot/components/Chatbot.tsx +4 -2
- package/src/features/chatbot/constants.ts +3 -0
- package/src/features/chatbot/index.ts +2 -0
- package/src/features/chatbot/model/ChatBotModel.ts +67 -33
- package/src/features/chatbot/model/ChatBotTextInput.ts +10 -0
- package/src/features/chatbot/model/ChatBotThreadManager.ts +35 -9
- package/src/features/chatbot/model/translation.ts +1 -1
- package/src/features/chatbot/types/api.types.ts +25 -1
- package/src/features/chatbot/types/model.types.ts +16 -1
- package/src/features/chatbot/types/types.ts +0 -0
- package/src/features/chatbot/types/units.types.ts +6 -0
- package/src/features/exampleSolution/ExampleSolutionModal.tsx +1 -7
- package/src/features/exampleSolution/assets/grid.webp +0 -0
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +24 -12
- package/src/features/exampleSolution/components/QuestionSection.tsx +11 -7
- package/src/features/exampleSolution/components/SolutionSection.tsx +72 -29
- package/src/features/exampleSolution/model/ExampleSolution.model.ts +5 -2
- package/src/features/exampleSolution/types.ts +2 -1
- package/src/features/formulaSheet/components/FormulaSheet.tsx +6 -4
- package/src/shared/hooks/useKeyDownListener.ts +3 -1
- package/src/shared/translation/localization/ca.json +2 -1
- package/src/shared/translation/localization/en.json +3 -2
- package/src/shared/translation/localization/gb.json +2 -1
- package/src/shared/translation/localization/sct.json +2 -1
- package/src/shared/translation/localization/sw.json +3 -2
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +0 -111
- package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js +0 -208
- package/dist/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/InputButton.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js +0 -157
- package/dist/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.js.map +0 -1
- package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +0 -1
- package/dist/commonjs/features/exampleSolution/assets/grid.png +0 -0
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +0 -105
- package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +0 -1
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js +0 -200
- package/dist/module/features/chatbot/components/Alternatives/HelpRequestOption.js.map +0 -1
- package/dist/module/features/chatbot/components/Alternatives/InputButton.js.map +0 -1
- package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js +0 -150
- package/dist/module/features/chatbot/components/Alternatives/InputWithHintRow.js.map +0 -1
- package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +0 -1
- package/dist/module/features/exampleSolution/assets/grid.png +0 -0
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +0 -11
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +0 -13
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +0 -11
- package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +0 -11
- package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts +0 -13
- package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts +0 -11
- package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map +0 -1
- package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +0 -1
- package/src/features/chatbot/components/Alternatives/Alternatives.tsx +0 -135
- package/src/features/chatbot/components/Alternatives/HelpRequestOption.tsx +0 -214
- package/src/features/chatbot/components/Alternatives/InputWithHintRow.tsx +0 -160
- package/src/features/exampleSolution/assets/grid.png +0 -0
|
@@ -16,10 +16,13 @@ var _SolutionSection = require("./SolutionSection.js");
|
|
|
16
16
|
var _useExampleSolution = require("../hooks/useExampleSolution.js");
|
|
17
17
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const CONTAINER_HEIGHT = 593;
|
|
19
20
|
const ExampleSolutionModalContent = ({
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
params: {
|
|
22
|
+
model,
|
|
23
|
+
payload,
|
|
24
|
+
cacheKey
|
|
25
|
+
}
|
|
23
26
|
}) => {
|
|
24
27
|
const {
|
|
25
28
|
result,
|
|
@@ -31,7 +34,11 @@ const ExampleSolutionModalContent = ({
|
|
|
31
34
|
});
|
|
32
35
|
const localization = (0, _effectorReact.useUnit)(_index.$localization);
|
|
33
36
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
34
|
-
style: styles.container,
|
|
37
|
+
style: [styles.container, _reactNativeUi.IS_WEB ? {
|
|
38
|
+
maxHeight: CONTAINER_HEIGHT
|
|
39
|
+
} : {
|
|
40
|
+
height: CONTAINER_HEIGHT
|
|
41
|
+
}],
|
|
35
42
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
|
|
36
43
|
align: "center",
|
|
37
44
|
variant: _reactNativeUi.HeadingVariants.H2,
|
|
@@ -43,7 +50,8 @@ const ExampleSolutionModalContent = ({
|
|
|
43
50
|
style: styles.content,
|
|
44
51
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_QuestionSection.QuestionSection, {
|
|
45
52
|
status: status,
|
|
46
|
-
question: result?.question
|
|
53
|
+
question: result?.question,
|
|
54
|
+
renderKatexComponent: model.renderKatexComponent
|
|
47
55
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_SolutionSection.SolutionSection, {
|
|
48
56
|
status: status,
|
|
49
57
|
answer: result?.answer
|
|
@@ -60,8 +68,7 @@ const ExampleSolutionModalContent = ({
|
|
|
60
68
|
exports.ExampleSolutionModalContent = ExampleSolutionModalContent;
|
|
61
69
|
const styles = _reactNative.StyleSheet.create({
|
|
62
70
|
container: {
|
|
63
|
-
width: 880
|
|
64
|
-
height: 593
|
|
71
|
+
width: 880
|
|
65
72
|
},
|
|
66
73
|
content: {
|
|
67
74
|
flex: 1,
|
|
@@ -78,8 +85,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
78
85
|
},
|
|
79
86
|
lavaIconContainer: {
|
|
80
87
|
position: 'absolute',
|
|
81
|
-
bottom: -
|
|
82
|
-
right: -
|
|
88
|
+
bottom: -24,
|
|
89
|
+
right: -26
|
|
83
90
|
},
|
|
84
91
|
loaderContainer: {
|
|
85
92
|
paddingTop: 34,
|
|
@@ -90,8 +97,8 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
90
97
|
},
|
|
91
98
|
messageBlock: {
|
|
92
99
|
position: 'absolute',
|
|
93
|
-
right:
|
|
94
|
-
bottom: -
|
|
100
|
+
right: 58,
|
|
101
|
+
bottom: -12
|
|
95
102
|
}
|
|
96
103
|
});
|
|
97
104
|
//# sourceMappingURL=ExampleSolutionModalContent.js.map
|
package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_MessageBlock","_LavaIcon","_QuestionSection","_SolutionSection","_useExampleSolution","_jsxRuntime","e","__esModule","default","ExampleSolutionModalContent","model","payload","cacheKey","result","status","useExampleSolution","localization","useUnit","$localization","jsxs","View","style","styles","container","children","jsx","Typography","align","variant","HeadingVariants","H2","color","COLORS","NEUTRAL_9","exampleSolution","content","QuestionSection","question","SolutionSection","answer","MessageBlock","messageBlock","LavaIcon","lavaIconContainer","exports","StyleSheet","create","width","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_effectorReact","_index","_MessageBlock","_LavaIcon","_QuestionSection","_SolutionSection","_useExampleSolution","_jsxRuntime","e","__esModule","default","CONTAINER_HEIGHT","ExampleSolutionModalContent","params","model","payload","cacheKey","result","status","useExampleSolution","localization","useUnit","$localization","jsxs","View","style","styles","container","IS_WEB","maxHeight","height","children","jsx","Typography","align","variant","HeadingVariants","H2","color","COLORS","NEUTRAL_9","exampleSolution","content","QuestionSection","question","renderKatexComponent","SolutionSection","answer","MessageBlock","messageBlock","LavaIcon","lavaIconContainer","exports","StyleSheet","create","width","flex","flexDirection","marginTop","SPACING","gap","solutionContainer","overflow","borderRadius","borderWidth","borderColor","NEUTRAL_5","position","bottom","right","loaderContainer","paddingTop","backgroundColor","NEUTRAL_1"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/ExampleSolutionModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH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f,iBAAiB,EAAE;IACjBgB,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC,EAAE;IACXC,KAAK,EAAE,CAAC;EACV,CAAC;EACDC,eAAe,EAAE;IACfC,UAAU,EAAE,EAAE;IACdJ,QAAQ,EAAE,UAAU;IACpBZ,KAAK,EAAE,MAAM;IACbzB,MAAM,EAAE,MAAM;IACd0C,eAAe,EAAEjC,qBAAM,CAACkC;EAC1B,CAAC;EACDxB,YAAY,EAAE;IACZkB,QAAQ,EAAE,UAAU;IACpBE,KAAK,EAAE,EAAE;IACTD,MAAM,EAAE,CAAC;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -15,15 +15,14 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
const QuestionSection = ({
|
|
17
17
|
question,
|
|
18
|
-
status
|
|
18
|
+
status,
|
|
19
|
+
renderKatexComponent
|
|
19
20
|
}) => {
|
|
20
21
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
21
22
|
style: styles.container,
|
|
22
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.
|
|
23
|
-
style: styles.
|
|
24
|
-
children:
|
|
25
|
-
children: question
|
|
26
|
-
})
|
|
23
|
+
children: [question && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
24
|
+
style: styles.katexContainer,
|
|
25
|
+
children: renderKatexComponent(question)
|
|
27
26
|
}), status === _constants.ExampleSolutionStatuses.LOADING && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
|
|
28
27
|
exiting: _reactNativeReanimated.FadeOut,
|
|
29
28
|
style: styles.loaderContainer,
|
|
@@ -39,12 +38,13 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
39
38
|
container: {
|
|
40
39
|
flex: 1
|
|
41
40
|
},
|
|
42
|
-
|
|
41
|
+
katexContainer: {
|
|
43
42
|
flex: 1
|
|
44
43
|
},
|
|
45
44
|
loaderContainer: {
|
|
46
45
|
paddingTop: 34,
|
|
47
46
|
position: 'absolute',
|
|
47
|
+
zIndex: 100,
|
|
48
48
|
width: '100%',
|
|
49
49
|
height: '100%',
|
|
50
50
|
backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
|
|
@@ -1 +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","QuestionSection","question","status","jsxs","View","style","styles","container","children","jsx","
|
|
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","QuestionSection","question","status","renderKatexComponent","jsxs","View","style","styles","container","children","jsx","katexContainer","ExampleSolutionStatuses","LOADING","exiting","FadeOut","loaderContainer","Loader","size","color","LoaderColor","BLUE","exports","StyleSheet","create","flex","paddingTop","position","zIndex","width","height","backgroundColor","COLORS","NEUTRAL_1","justifyContent","alignItems","errorContainer","padding","SPACING","errorText","PRIMARY_RED","textAlign"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/QuestionSection.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;AAAsD,IAAAO,WAAA,GAA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,EAAE,MAAM;IACdC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBE,OAAO,EAAEC,sBAAO,CAAC,GAAG;EACtB,CAAC;EACDC,SAAS,EAAE;IACTpB,KAAK,EAAEa,qBAAM,CAACQ,WAAW;IACzBC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -9,67 +9,93 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _reactNativeUi = require("@magmamath/react-native-ui");
|
|
10
10
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
11
11
|
var _constants = require("../constants.js");
|
|
12
|
-
var _grid = _interopRequireDefault(require("../assets/grid.
|
|
12
|
+
var _grid = _interopRequireDefault(require("../assets/grid.webp"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
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
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
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
const CONTAINER_SIZES = {
|
|
18
|
+
width: 489,
|
|
19
|
+
height: 543
|
|
20
|
+
};
|
|
21
|
+
const BORDER_WIDTH = 1;
|
|
22
|
+
const CONTAINER_HEIGHT_OFFSET = 160;
|
|
17
23
|
const gridImagePath = !_reactNativeUi.IS_WEB ? _reactNative.Image.resolveAssetSource(_grid.default).uri : _grid.default;
|
|
18
24
|
const SolutionSection = ({
|
|
19
25
|
answer,
|
|
20
26
|
status
|
|
21
27
|
}) => {
|
|
28
|
+
const {
|
|
29
|
+
height
|
|
30
|
+
} = (0, _reactNative.useWindowDimensions)();
|
|
22
31
|
const shouldShowAnswer = answer && (status === _constants.ExampleSolutionStatuses.DONE_DATA || status === _constants.ExampleSolutionStatuses.CACHE);
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.
|
|
24
|
-
style: styles.container,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
style: [styles.gridImage, _reactNativeUi.IS_WEB && styles.gridImageWeb]
|
|
30
|
-
}), shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.ScrollView, {
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
33
|
+
style: [styles.container, _reactNativeUi.IS_WEB && {
|
|
34
|
+
maxHeight: height - CONTAINER_HEIGHT_OFFSET
|
|
35
|
+
}],
|
|
36
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
|
|
31
37
|
style: styles.solutionScroll,
|
|
32
38
|
contentContainerStyle: styles.solutionScrollContent,
|
|
33
|
-
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
bounces: true,
|
|
40
|
+
children: _reactNativeUi.IS_WEB ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
|
41
|
+
resizeMode: "repeat",
|
|
42
|
+
style: [styles.gridImageWeb],
|
|
43
|
+
source: {
|
|
44
|
+
uri: gridImagePath
|
|
45
|
+
},
|
|
46
|
+
children: shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
|
|
47
|
+
entering: status === 'cache' ? undefined : _reactNativeReanimated.FadeIn.delay(1000).duration(500),
|
|
48
|
+
style: styles.solutionText,
|
|
49
|
+
children: answer
|
|
50
|
+
})
|
|
51
|
+
}) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
52
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ImageBackground, {
|
|
53
|
+
resizeMode: "repeat",
|
|
54
|
+
style: styles.gridImageRn,
|
|
55
|
+
source: {
|
|
56
|
+
uri: gridImagePath
|
|
57
|
+
}
|
|
58
|
+
}), shouldShowAnswer && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.Text, {
|
|
59
|
+
entering: status === 'cache' ? undefined : _reactNativeReanimated.FadeIn.delay(1000).duration(500),
|
|
60
|
+
style: styles.solutionText,
|
|
61
|
+
children: answer
|
|
62
|
+
})]
|
|
37
63
|
})
|
|
38
|
-
})
|
|
64
|
+
})
|
|
39
65
|
});
|
|
40
66
|
};
|
|
41
67
|
exports.SolutionSection = SolutionSection;
|
|
42
68
|
const styles = _reactNative.StyleSheet.create({
|
|
43
69
|
container: {
|
|
44
|
-
width:
|
|
70
|
+
width: CONTAINER_SIZES.width,
|
|
71
|
+
height: CONTAINER_SIZES.height,
|
|
45
72
|
overflow: 'hidden',
|
|
46
73
|
borderRadius: 8,
|
|
47
|
-
borderWidth:
|
|
74
|
+
borderWidth: BORDER_WIDTH,
|
|
48
75
|
borderColor: _reactNativeUi.COLORS.NEUTRAL_5
|
|
49
76
|
},
|
|
50
|
-
|
|
77
|
+
gridImageRn: {
|
|
78
|
+
top: -327,
|
|
51
79
|
width: '100%',
|
|
52
|
-
height: '
|
|
53
|
-
|
|
54
|
-
aspectRatio: 28 / 8
|
|
80
|
+
height: '150%',
|
|
81
|
+
position: 'absolute'
|
|
55
82
|
},
|
|
56
83
|
gridImageWeb: {
|
|
57
|
-
transform: [{
|
|
58
|
-
scale: 3.5
|
|
59
|
-
}]
|
|
60
|
-
},
|
|
61
|
-
solutionScroll: {
|
|
62
|
-
position: 'absolute',
|
|
63
84
|
width: '100%',
|
|
64
85
|
height: '100%'
|
|
65
86
|
},
|
|
87
|
+
solutionScroll: {
|
|
88
|
+
flex: 1
|
|
89
|
+
},
|
|
66
90
|
solutionScrollContent: {
|
|
67
|
-
|
|
68
|
-
|
|
91
|
+
minHeight: CONTAINER_SIZES.height - BORDER_WIDTH * 2,
|
|
92
|
+
width: '100%'
|
|
69
93
|
},
|
|
70
94
|
solutionText: {
|
|
71
95
|
fontFamily: 'PlaypenSans-Light',
|
|
72
|
-
fontSize:
|
|
96
|
+
fontSize: 28,
|
|
97
|
+
marginHorizontal: _reactNativeUi.SPACING[800],
|
|
98
|
+
marginVertical: _reactNativeUi.SPACING[400]
|
|
73
99
|
}
|
|
74
100
|
});
|
|
75
101
|
//# sourceMappingURL=SolutionSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_grid","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","gridImagePath","IS_WEB","Image","resolveAssetSource","gridImage","uri","SolutionSection","answer","status","shouldShowAnswer","ExampleSolutionStatuses","DONE_DATA","CACHE","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_reactNativeReanimated","_interopRequireWildcard","_constants","_grid","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CONTAINER_SIZES","width","height","BORDER_WIDTH","CONTAINER_HEIGHT_OFFSET","gridImagePath","IS_WEB","Image","resolveAssetSource","gridImage","uri","SolutionSection","answer","status","useWindowDimensions","shouldShowAnswer","ExampleSolutionStatuses","DONE_DATA","CACHE","jsx","View","style","styles","container","maxHeight","children","ScrollView","solutionScroll","contentContainerStyle","solutionScrollContent","bounces","ImageBackground","resizeMode","gridImageWeb","source","Text","entering","undefined","FadeIn","delay","duration","solutionText","jsxs","Fragment","gridImageRn","exports","StyleSheet","create","overflow","borderRadius","borderWidth","borderColor","COLORS","NEUTRAL_5","top","position","flex","minHeight","fontFamily","fontSize","marginHorizontal","SPACING","marginVertical"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/components/SolutionSection.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,sBAAA,GAAAC,uBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,KAAA,GAAAL,sBAAA,CAAAF,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAAA,SAAAS,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,SAAAL,wBAAAK,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,I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AS,GAAGC,6BAAM,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,QAAQ,CAAC,GAAG,CAAE;UAC5EnB,KAAK,EAAEC,MAAM,CAACmB,YAAa;UAAAhB,QAAA,EAE1Bb;QAAM,CACM,CAChB;MAAA,CACD;IACH,CACS;EAAC,CACT,CAAC;AAEX,CAAC;AAAAiC,OAAA,CAAAlC,eAAA,GAAAA,eAAA;AAED,MAAMW,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/BxB,SAAS,EAAE;IACTtB,KAAK,EAAED,eAAe,CAACC,KAAK;IAC5BC,MAAM,EAAEF,eAAe,CAACE,MAAM;IAC9B8C,QAAQ,EAAE,QAAQ;IAClBC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE/C,YAAY;IACzBgD,WAAW,EAAEC,qBAAM,CAACC;EACtB,CAAC;EACDT,WAAW,EAAE;IACXU,GAAG,EAAE,CAAC,GAAG;IACTrD,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE,MAAM;IACdqD,QAAQ,EAAE;EACZ,CAAC;EACDtB,YAAY,EAAE;IACZhC,KAAK,EAAE,MAAM;IACbC,MAAM,EAAE;EACV,CAAC;EACDyB,cAAc,EAAE;IACd6B,IAAI,EAAE;EACR,CAAC;EACD3B,qBAAqB,EAAE;IACrB4B,SAAS,EAAEzD,eAAe,CAACE,MAAM,GAAGC,YAAY,GAAG,CAAC;IACpDF,KAAK,EAAE;EACT,CAAC;EACDwC,YAAY,EAAE;IACZiB,UAAU,EAAE,mBAAmB;IAC/BC,QAAQ,EAAE,EAAE;IACZC,gBAAgB,EAAEC,sBAAO,CAAC,GAAG,CAAC;IAC9BC,cAAc,EAAED,sBAAO,CAAC,GAAG;EAC7B;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -10,12 +10,14 @@ class ExampleSolutionModel {
|
|
|
10
10
|
cache = new _ExampleSolutionCache.ExampleSolutionCache();
|
|
11
11
|
constructor({
|
|
12
12
|
api,
|
|
13
|
-
errorHandler
|
|
13
|
+
errorHandler,
|
|
14
|
+
renderKatexComponent
|
|
14
15
|
}) {
|
|
15
16
|
this.api = new _ExampleSolutionApi.ExampleSolutionsApi({
|
|
16
17
|
api,
|
|
17
18
|
errorHandler
|
|
18
19
|
});
|
|
20
|
+
this.renderKatexComponent = renderKatexComponent;
|
|
19
21
|
}
|
|
20
22
|
}
|
|
21
23
|
exports.ExampleSolutionModel = ExampleSolutionModel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_ExampleSolutionApi","require","_ExampleSolutionCache","ExampleSolutionModel","cache","ExampleSolutionCache","constructor","api","errorHandler","ExampleSolutionsApi","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolution.model.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,CAAC;EAEhBC,KAAK,GAAG,IAAIC,0CAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["_ExampleSolutionApi","require","_ExampleSolutionCache","ExampleSolutionModel","cache","ExampleSolutionCache","constructor","api","errorHandler","renderKatexComponent","ExampleSolutionsApi","exports"],"sourceRoot":"../../../../../src","sources":["features/exampleSolution/model/ExampleSolution.model.ts"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAEO,MAAME,oBAAoB,CAAC;EAEhBC,KAAK,GAAG,IAAIC,0CAAoB,CAAC,CAAC;EAIlDC,WAAWA,CAAC;IAAEC,GAAG;IAAEC,YAAY;IAAEC;EAAgD,CAAC,EAAE;IAClF,IAAI,CAACF,GAAG,GAAG,IAAIG,uCAAmB,CAAC;MAAEH,GAAG;MAAEC;IAAa,CAAC,CAAC;IACzD,IAAI,CAACC,oBAAoB,GAAGA,oBAAoB;EAClD;AACF;AAACE,OAAA,CAAAR,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -24,6 +24,10 @@ const FormulaSheet = exports.FormulaSheet = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
24
24
|
const isOpen = (0, _effectorReact.useUnit)(model.modal.$isOpen);
|
|
25
25
|
const sheetFileBlob = (0, _effectorReact.useUnit)(model.file.$blob);
|
|
26
26
|
const isRequestPending = (0, _effectorReact.useUnit)(model.api.getPDFFileBlobFx.pending);
|
|
27
|
+
const onPressHandler = () => {
|
|
28
|
+
model.modal.toggle();
|
|
29
|
+
onPress?.();
|
|
30
|
+
};
|
|
27
31
|
(0, _react.useEffect)(() => {
|
|
28
32
|
model.file.setId(fileId ?? null);
|
|
29
33
|
}, [fileId]);
|
|
@@ -34,10 +38,7 @@ const FormulaSheet = exports.FormulaSheet = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
34
38
|
variant: _reactNativeUi.ButtonVariant.SECONDARY,
|
|
35
39
|
colorScheme: buttonColor,
|
|
36
40
|
isActive: isOpen,
|
|
37
|
-
onPress: () =>
|
|
38
|
-
model.modal.toggle();
|
|
39
|
-
onPress?.();
|
|
40
|
-
},
|
|
41
|
+
onPress: () => onPressHandler(),
|
|
41
42
|
icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.TheoryIcon, {
|
|
42
43
|
color: isOpen ? _reactNativeUi.COLORS.NEUTRAL_1 : undefined,
|
|
43
44
|
size: 20
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_effectorReact","_reactNativeUi","_FormulaSheetModal","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FormulaSheet","exports","forwardRef","model","fileId","renderer","buttonSize","ButtonSize","MEDIUM","buttonColor","ButtonColor","BLUE","loaderColor","LoaderColor","onPress","style","ref","isOpen","useUnit","modal","$isOpen","sheetFileBlob","file","$blob","isRequestPending","api","getPDFFileBlobFx","pending","useEffect","setId","jsxs","Fragment","children","jsx","Button","size","variant","ButtonVariant","SECONDARY","colorScheme","isActive","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_effectorReact","_reactNativeUi","_FormulaSheetModal","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FormulaSheet","exports","forwardRef","model","fileId","renderer","buttonSize","ButtonSize","MEDIUM","buttonColor","ButtonColor","BLUE","loaderColor","LoaderColor","onPress","style","ref","isOpen","useUnit","modal","$isOpen","sheetFileBlob","file","$blob","isRequestPending","api","getPDFFileBlobFx","pending","onPressHandler","toggle","useEffect","setId","jsxs","Fragment","children","jsx","Button","size","variant","ButtonVariant","SECONDARY","colorScheme","isActive","icon","TheoryIcon","color","COLORS","NEUTRAL_1","undefined","FormulaSheetModal","isLoading","onClose","setIsOpen"],"sourceRoot":"../../../../../src","sources":["features/formulaSheet/components/FormulaSheet.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAYA,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,CAA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Module", {
|
|
|
6
6
|
exports.useKeyDownListener = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _constants = require("../../lib/constants.js");
|
|
9
|
-
const useKeyDownListener = (callback, overrideKeys = [_constants.KeyboardKeys.ENTER]) => {
|
|
9
|
+
const useKeyDownListener = (callback, enabled = true, overrideKeys = [_constants.KeyboardKeys.ENTER]) => {
|
|
10
10
|
const callbackRef = (0, _react.useRef)(callback);
|
|
11
11
|
callbackRef.current = callback;
|
|
12
12
|
(0, _react.useEffect)(() => {
|
|
13
|
+
if (!enabled) return;
|
|
13
14
|
const eventHandler = event => {
|
|
14
15
|
if (overrideKeys.includes(event.key)) {
|
|
15
16
|
event.preventDefault();
|
|
@@ -21,7 +22,7 @@ const useKeyDownListener = (callback, overrideKeys = [_constants.KeyboardKeys.EN
|
|
|
21
22
|
return () => {
|
|
22
23
|
document.removeEventListener('keydown', eventHandler, true);
|
|
23
24
|
};
|
|
24
|
-
}, []);
|
|
25
|
+
}, [enabled]);
|
|
25
26
|
};
|
|
26
27
|
exports.useKeyDownListener = useKeyDownListener;
|
|
27
28
|
//# sourceMappingURL=useKeyDownListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_constants","useKeyDownListener","callback","overrideKeys","KeyboardKeys","ENTER","callbackRef","useRef","current","useEffect","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../../src","sources":["shared/hooks/useKeyDownListener.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,YAAY,GAAG,CAACC,uBAAY,CAACC,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAG,IAAAC,aAAM,
|
|
1
|
+
{"version":3,"names":["_react","require","_constants","useKeyDownListener","callback","enabled","overrideKeys","KeyboardKeys","ENTER","callbackRef","useRef","current","useEffect","eventHandler","event","includes","key","preventDefault","stopPropagation","document","addEventListener","removeEventListener","exports"],"sourceRoot":"../../../../src","sources":["shared/hooks/useKeyDownListener.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEO,MAAME,kBAAkB,GAAGA,CAChCC,QAAwC,EACxCC,OAAO,GAAG,IAAI,EACdC,YAAY,GAAG,CAACC,uBAAY,CAACC,KAAK,CAAC,KAChC;EACH,MAAMC,WAAW,GAAG,IAAAC,aAAM,EAACN,QAAQ,CAAC;EACpCK,WAAW,CAACE,OAAO,GAAGP,QAAQ;EAE9B,IAAAQ,gBAAS,EAAC,MAAM;IACd,IAAI,CAACP,OAAO,EAAE;IACd,MAAMQ,YAAY,GAAIC,KAAoB,IAAK;MAC7C,IAAIR,YAAY,CAACS,QAAQ,CAACD,KAAK,CAACE,GAAmB,CAAC,EAAE;QACpDF,KAAK,CAACG,cAAc,CAAC,CAAC;QACtBH,KAAK,CAACI,eAAe,CAAC,CAAC;MACzB;MAEAT,WAAW,CAACE,OAAO,CAACG,KAAK,CAAC;IAC5B,CAAC;IAEDK,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,YAAY,EAAE,IAAI,CAAC;IACxD,OAAO,MAAM;MACXM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,YAAY,EAAE,IAAI,CAAC;IAC7D,CAAC;EACH,CAAC,EAAE,CAACR,OAAO,CAAC,CAAC;AACf,CAAC;AAAAiB,OAAA,CAAAnB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"answerAgain": "Answer again to get another hint!",
|
|
18
18
|
"errorMessage": "Something went wrong! Try again",
|
|
19
19
|
"howCanIHelp": "Hi! Do you want help?",
|
|
20
|
-
"showError": "Show error"
|
|
20
|
+
"showError": "Show error",
|
|
21
|
+
"inputPlaceholder": "Type..."
|
|
21
22
|
},
|
|
22
23
|
"gifCelebrations": {
|
|
23
24
|
"greatStart": "Great start!",
|
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
"time.yearAgo": "year ago",
|
|
13
13
|
"time.yearsAgo": "years ago",
|
|
14
14
|
"chat": {
|
|
15
|
-
"anotherHint": "
|
|
15
|
+
"anotherHint": "Give me another hint",
|
|
16
16
|
"giveHint": "I need a hint",
|
|
17
17
|
"answerAgain": "Answer again to get another hint!",
|
|
18
18
|
"errorMessage": "Something went wrong! Try again",
|
|
19
19
|
"howCanIHelp": "Hi! Do you want help?",
|
|
20
|
-
"showError": "Show error"
|
|
20
|
+
"showError": "Show error",
|
|
21
|
+
"inputPlaceholder": "Type..."
|
|
21
22
|
},
|
|
22
23
|
"gifCelebrations": {
|
|
23
24
|
"greatStart": "Great start!",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"answerAgain": "Answer again to get another hint!",
|
|
18
18
|
"errorMessage": "Something went wrong! Try again",
|
|
19
19
|
"howCanIHelp": "Hi! Do you want help?",
|
|
20
|
-
"showError": "Show error"
|
|
20
|
+
"showError": "Show error",
|
|
21
|
+
"inputPlaceholder": "Type..."
|
|
21
22
|
},
|
|
22
23
|
"gifCelebrations": {
|
|
23
24
|
"greatStart": "Great start!",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"answerAgain": "Answer again to get another hint!",
|
|
18
18
|
"errorMessage": "Something went wrong! Try again",
|
|
19
19
|
"howCanIHelp": "Hi! Do you want help?",
|
|
20
|
-
"showError": "Show error"
|
|
20
|
+
"showError": "Show error",
|
|
21
|
+
"inputPlaceholder": "Type..."
|
|
21
22
|
},
|
|
22
23
|
"gifCelebrations": {
|
|
23
24
|
"greatStart": "Great start!",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"answerAgain": "Svara igen för att få en till ledtråd!",
|
|
18
18
|
"errorMessage": "Något gick snett! Försök igen",
|
|
19
19
|
"howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
|
|
20
|
-
"showError": "Visa fel"
|
|
20
|
+
"showError": "Visa fel",
|
|
21
|
+
"inputPlaceholder": "Skriv..."
|
|
21
22
|
},
|
|
22
23
|
"gifCelebrations": {
|
|
23
24
|
"greatStart": "Bra start!",
|
|
@@ -25,7 +26,7 @@
|
|
|
25
26
|
"almostThere": "Nästan där"
|
|
26
27
|
},
|
|
27
28
|
"exampleSolution": {
|
|
28
|
-
"exampleSolution": "
|
|
29
|
+
"exampleSolution": "Lösningsexempel",
|
|
29
30
|
"letMeThink": "Låt mig tänka...",
|
|
30
31
|
"aha": "Aha!",
|
|
31
32
|
"errorMessage": "Något gick snett med att generera en exempellösning"
|
package/dist/module/features/chatbot/components/{ChatMessages/ChatbotMessages.js → Chat/Chat.js}
RENAMED
|
@@ -5,7 +5,7 @@ import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'rea
|
|
|
5
5
|
import { useStoreMap, useUnit } from 'effector-react';
|
|
6
6
|
import { ChatMessage } from "../ChatMessage/ChatMessage.js";
|
|
7
7
|
import { MessageLoader } from "../ChatMessage/MessageLoader.js";
|
|
8
|
-
import {
|
|
8
|
+
import { ChatInput } from "../ChatInput/ChatInput.js";
|
|
9
9
|
import { MessageVariant } from "../../types/model.types.js";
|
|
10
10
|
import { ColorScheme } from "../../types/style.types.js";
|
|
11
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@ const BOTTOM_OFFSET = Platform.select({
|
|
|
14
14
|
web: 265,
|
|
15
15
|
default: 294
|
|
16
16
|
});
|
|
17
|
-
export const
|
|
17
|
+
export const Chat = ({
|
|
18
18
|
model,
|
|
19
19
|
isHintFeedback,
|
|
20
20
|
isTextToSpeechEnabled,
|
|
@@ -34,12 +34,6 @@ export const ChatbotMessages = ({
|
|
|
34
34
|
}) => messages);
|
|
35
35
|
const lastMessageId = messages.at(-1)?.id;
|
|
36
36
|
const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET;
|
|
37
|
-
const askChatForHelp = (message, translatedMessage) => {
|
|
38
|
-
void model.sendHelpRequestFx({
|
|
39
|
-
message,
|
|
40
|
-
translatedMessage
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
37
|
return /*#__PURE__*/_jsx(View, {
|
|
44
38
|
style: [styles.container, {
|
|
45
39
|
maxHeight: MAX_HEIGHT
|
|
@@ -73,11 +67,10 @@ export const ChatbotMessages = ({
|
|
|
73
67
|
}, message.id)), isHelpRequestPending && /*#__PURE__*/_jsx(MessageLoader, {
|
|
74
68
|
colorScheme: colorScheme
|
|
75
69
|
})]
|
|
76
|
-
}), isOpen && /*#__PURE__*/_jsx(
|
|
77
|
-
onPressAlternative: askChatForHelp,
|
|
78
|
-
hasMessages: messages.length > 1,
|
|
70
|
+
}), isOpen && /*#__PURE__*/_jsx(ChatInput, {
|
|
79
71
|
isHintFeedback: isHintFeedback,
|
|
80
|
-
colorScheme: colorScheme
|
|
72
|
+
colorScheme: colorScheme,
|
|
73
|
+
hasMessages: messages.length > 1
|
|
81
74
|
})]
|
|
82
75
|
})
|
|
83
76
|
});
|
|
@@ -99,4 +92,4 @@ const styles = StyleSheet.create({
|
|
|
99
92
|
gap: 8
|
|
100
93
|
}
|
|
101
94
|
});
|
|
102
|
-
//# sourceMappingURL=
|
|
95
|
+
//# sourceMappingURL=Chat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useRef","Platform","ScrollView","StyleSheet","useWindowDimensions","View","useStoreMap","useUnit","ChatMessage","MessageLoader","ChatInput","MessageVariant","ColorScheme","jsx","_jsx","jsxs","_jsxs","TOOLBAR_HEIGHT","BOTTOM_OFFSET","select","web","default","Chat","model","isHintFeedback","isTextToSpeechEnabled","colorScheme","Blue","dimensions","ref","isOpen","$isOpen","isHelpRequestPending","sendHelpRequestFx","pending","isTextToSpeechPending","api","textToSpeechTextFx","currentPlayingId","t2s","$currentPlayingId","isTranslated","translation","$isTranslated","audioStatus","$status","errorSpottingEnabled","errorSpotting","$isEnabled","messages","$currentChatData","lastMessageId","at","id","MAX_HEIGHT","height","style","styles","container","maxHeight","children","bounces","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","message","withIcon","isOwnMessage","variant","SENT","RECEIVED","withErrorSpotting","t2sState","isEnabled","isActive","isLoading","status","disabled","hasMessages","length","create","flex","alignItems","width","paddingVertical","paddingRight"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Chat/Chat.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,MAAM,QAAQ,OAAO;AACrC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,mBAAmB,EAAEC,IAAI,QAAQ,cAAc;AAC1F,SAASC,WAAW,EAAEC,OAAO,QAAQ,gBAAgB;AAGrD,SAASC,WAAW,QAAQ,+BAA4B;AACxD,SAASC,aAAa,QAAQ,iCAA8B;AAC5D,SAASC,SAAS,QAAQ,2BAAwB;AAClD,SAASC,cAAc,QAAQ,4BAAyB;AACxD,SAASC,WAAW,QAAQ,4BAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAErD,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,aAAa,GAAGjB,QAAQ,CAACkB,MAAM,CAAC;EACpCC,GAAG,EAAE,GAAG;EACRC,OAAO,EAAE;AACX,CAAC,CAAC;AASF,OAAO,MAAMC,IAAI,GAAGA,CAAC;EACnBC,KAAK;EACLC,cAAc;EACdC,qBAAqB;EACrBC,WAAW,GAAGd,WAAW,CAACe;AACd,CAAC,KAAK;EAClB,MAAMC,UAAU,GAAGxB,mBAAmB,CAAC,CAAC;EACxC,MAAMyB,GAAG,GAAG7B,MAAM,CAAa,IAAI,CAAC;EACpC,MAAM8B,MAAM,GAAGvB,OAAO,CAACgB,KAAK,CAACQ,OAAO,CAAC;EAErC,MAAMC,oBAAoB,GAAGzB,OAAO,CAACgB,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AE;IACJyB,UAAU,EAAE,UAAU;IACtBE,eAAe,EAAE,CAAC;IAClBC,YAAY,EAAE;EAChB,CAAC;EACDtB,GAAG,EAAE;IACHkB,IAAI,EAAE,CAAC;IACPlB,GAAG,EAAE;EACP;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback } from 'react';
|
|
4
|
+
import { IS_WEB } from '@magmamath/react-native-ui';
|
|
5
|
+
import { StyleSheet, View } from 'react-native';
|
|
6
|
+
import { useStoreMap, useUnit } from 'effector-react';
|
|
7
|
+
import { useChatModel } from "../../context/ChatBotModelContext.js";
|
|
8
|
+
import { ColorScheme } from "../../types/style.types.js";
|
|
9
|
+
import { HintButtonVariant, RequestHintButton } from "./RequestHintButton.js";
|
|
10
|
+
import { FreeTextInputBlock } from "./freeText/FreeTextInputBlock.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export const ChatInput = ({
|
|
13
|
+
isHintFeedback,
|
|
14
|
+
hasMessages,
|
|
15
|
+
colorScheme = ColorScheme.Blue
|
|
16
|
+
}) => {
|
|
17
|
+
const model = useChatModel();
|
|
18
|
+
const alternatives = useUnit(model.$alternatives);
|
|
19
|
+
const isTranslated = useUnit(model.translation.$isTranslated);
|
|
20
|
+
const isTranslationPending = useUnit(model.translation.translateAllMessagesFx.pending);
|
|
21
|
+
const isHelpRequestPending = useUnit(model.sendHelpRequestFx.pending);
|
|
22
|
+
const lastMessageOptions = useStoreMap(model.$currentChatData, ({
|
|
23
|
+
messages
|
|
24
|
+
}) => {
|
|
25
|
+
const lastMessage = messages.at(-1);
|
|
26
|
+
return lastMessage?.options ?? [];
|
|
27
|
+
});
|
|
28
|
+
const option = (() => {
|
|
29
|
+
if (hasMessages && lastMessageOptions.length) return lastMessageOptions[0];
|
|
30
|
+
if (isHintFeedback && alternatives?.options.hints) return alternatives?.options.hints[0];
|
|
31
|
+
return alternatives?.options.default[0] ?? null;
|
|
32
|
+
})();
|
|
33
|
+
const optionLabel = (isTranslated && !isTranslationPending ? option?.translatedText : option?.text) ?? '';
|
|
34
|
+
if (!option) return null;
|
|
35
|
+
const sendMessage = useCallback(() => {
|
|
36
|
+
void model.sendHelpRequestFx({
|
|
37
|
+
message: option.text,
|
|
38
|
+
translatedMessage: option.translatedText
|
|
39
|
+
});
|
|
40
|
+
}, []);
|
|
41
|
+
const shouldDisableInput = isHelpRequestPending || hasMessages && lastMessageOptions.length === 0;
|
|
42
|
+
return /*#__PURE__*/_jsx(View, {
|
|
43
|
+
style: styles.container,
|
|
44
|
+
children: IS_WEB && alternatives?.isOpenChatEnabled ? /*#__PURE__*/_jsx(FreeTextInputBlock, {
|
|
45
|
+
optionLabel: optionLabel,
|
|
46
|
+
onOptionPress: sendMessage,
|
|
47
|
+
disabled: shouldDisableInput,
|
|
48
|
+
colorScheme: colorScheme
|
|
49
|
+
}) : /*#__PURE__*/_jsx(RequestHintButton, {
|
|
50
|
+
onPress: sendMessage,
|
|
51
|
+
label: optionLabel,
|
|
52
|
+
disabled: shouldDisableInput,
|
|
53
|
+
colorScheme: colorScheme,
|
|
54
|
+
variant: HintButtonVariant.Default
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
const styles = StyleSheet.create({
|
|
59
|
+
container: {
|
|
60
|
+
flex: 1,
|
|
61
|
+
width: 305,
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
marginVertical: 8
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=ChatInput.js.map
|