@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
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { Platform, StyleSheet, TextInput, View } from 'react-native';
|
|
5
|
-
import Animated, { useSharedValue, withTiming, useAnimatedStyle, useAnimatedReaction } from 'react-native-reanimated';
|
|
6
|
-
import { COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui';
|
|
7
|
-
import { HelpRequestOption } from "./HelpRequestOption.js";
|
|
8
|
-
import { InputButton } from "./InputButton.js";
|
|
9
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
-
const COMPACT_WIDTH = 134;
|
|
11
|
-
export const InputWithHintRow = ({
|
|
12
|
-
onPress,
|
|
13
|
-
message,
|
|
14
|
-
disabled,
|
|
15
|
-
colorScheme
|
|
16
|
-
}) => {
|
|
17
|
-
const [value, setValue] = useState('');
|
|
18
|
-
const widthSv = useSharedValue(COMPACT_WIDTH);
|
|
19
|
-
const arrowOpacitySv = useSharedValue(1);
|
|
20
|
-
const hintVisibleSv = useSharedValue(1);
|
|
21
|
-
const valueLengthSv = useSharedValue(0);
|
|
22
|
-
const shouldDisable = value.trim().length > 0;
|
|
23
|
-
const animatedInputStyle = useAnimatedStyle(() => ({
|
|
24
|
-
width: widthSv.value
|
|
25
|
-
}), [widthSv]);
|
|
26
|
-
const handleChangeText = text => {
|
|
27
|
-
setValue(text);
|
|
28
|
-
valueLengthSv.value = text.trim().length;
|
|
29
|
-
};
|
|
30
|
-
useAnimatedReaction(() => valueLengthSv.value, currentLength => {
|
|
31
|
-
if (currentLength > 0) {
|
|
32
|
-
widthSv.value = withTiming(305, {
|
|
33
|
-
duration: 200
|
|
34
|
-
});
|
|
35
|
-
arrowOpacitySv.value = withTiming(0, {
|
|
36
|
-
duration: 200
|
|
37
|
-
});
|
|
38
|
-
hintVisibleSv.value = withTiming(0, {
|
|
39
|
-
duration: 200
|
|
40
|
-
});
|
|
41
|
-
} else {
|
|
42
|
-
widthSv.value = withTiming(COMPACT_WIDTH, {
|
|
43
|
-
duration: 200
|
|
44
|
-
});
|
|
45
|
-
arrowOpacitySv.value = withTiming(1, {
|
|
46
|
-
duration: 200
|
|
47
|
-
});
|
|
48
|
-
hintVisibleSv.value = withTiming(1, {
|
|
49
|
-
duration: 200
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}, [valueLengthSv]);
|
|
53
|
-
|
|
54
|
-
// const handleFocus = () => {
|
|
55
|
-
// widthSv.value = withTiming(305, { duration: 200 }) // expand full width (container limits it)
|
|
56
|
-
// arrowOpacitySv.value = withTiming(0, { duration: 200 })
|
|
57
|
-
// hintVisibleSv.value = withTiming(0, { duration: 200 })
|
|
58
|
-
//
|
|
59
|
-
// // setIsFocused(true)
|
|
60
|
-
// }
|
|
61
|
-
//
|
|
62
|
-
// const handleBlur = () => {
|
|
63
|
-
// if (value.trim().length > 0) return
|
|
64
|
-
// widthSv.value = withTiming(COMPACT_WIDTH, { duration: 200 })
|
|
65
|
-
// arrowOpacitySv.value = withTiming(1, { duration: 200 })
|
|
66
|
-
// hintVisibleSv.value = withTiming(1, { duration: 200 })
|
|
67
|
-
// // setIsFocused(false)
|
|
68
|
-
// }
|
|
69
|
-
|
|
70
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
71
|
-
style: styles.container,
|
|
72
|
-
children: [/*#__PURE__*/_jsxs(Animated.View, {
|
|
73
|
-
style: [styles.inputWrapper, animatedInputStyle],
|
|
74
|
-
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
75
|
-
style: styles.input,
|
|
76
|
-
placeholder: "Type...",
|
|
77
|
-
placeholderTextColor: COLORS.NEUTRAL_6,
|
|
78
|
-
value: value,
|
|
79
|
-
onChangeText: handleChangeText
|
|
80
|
-
// onFocus={handleFocus}
|
|
81
|
-
// onBlur={handleBlur}
|
|
82
|
-
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
83
|
-
style: [styles.arrowWrapper],
|
|
84
|
-
children: /*#__PURE__*/_jsx(InputButton, {
|
|
85
|
-
onPress: () => {
|
|
86
|
-
onPress();
|
|
87
|
-
handleChangeText('');
|
|
88
|
-
},
|
|
89
|
-
disabled: value.trim().length < 1 || disabled,
|
|
90
|
-
colorScheme: colorScheme
|
|
91
|
-
})
|
|
92
|
-
})]
|
|
93
|
-
}), /*#__PURE__*/_jsx(HelpRequestOption, {
|
|
94
|
-
visibleSv: hintVisibleSv,
|
|
95
|
-
disabled: disabled || shouldDisable,
|
|
96
|
-
onPress: onPress,
|
|
97
|
-
message: message,
|
|
98
|
-
colorScheme: colorScheme
|
|
99
|
-
})]
|
|
100
|
-
});
|
|
101
|
-
};
|
|
102
|
-
const styles = StyleSheet.create({
|
|
103
|
-
container: {
|
|
104
|
-
position: 'relative',
|
|
105
|
-
width: '100%',
|
|
106
|
-
alignItems: 'flex-end',
|
|
107
|
-
height: 52,
|
|
108
|
-
justifyContent: 'center'
|
|
109
|
-
},
|
|
110
|
-
inputWrapper: {
|
|
111
|
-
position: 'absolute',
|
|
112
|
-
zIndex: 1,
|
|
113
|
-
right: SPACING[200],
|
|
114
|
-
left: 0,
|
|
115
|
-
flexDirection: 'row',
|
|
116
|
-
alignItems: 'center',
|
|
117
|
-
borderWidth: 1,
|
|
118
|
-
borderColor: COLORS.NEUTRAL_5,
|
|
119
|
-
borderRadius: 200,
|
|
120
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
121
|
-
paddingHorizontal: SPACING[100],
|
|
122
|
-
paddingVertical: SPACING[100],
|
|
123
|
-
overflow: 'hidden',
|
|
124
|
-
elevation: 3,
|
|
125
|
-
shadowColor: '#333',
|
|
126
|
-
shadowOffset: {
|
|
127
|
-
width: 0,
|
|
128
|
-
height: 1
|
|
129
|
-
},
|
|
130
|
-
shadowOpacity: 0.25,
|
|
131
|
-
shadowRadius: 3
|
|
132
|
-
},
|
|
133
|
-
input: {
|
|
134
|
-
flex: 1,
|
|
135
|
-
fontSize: 16,
|
|
136
|
-
minWidth: 60,
|
|
137
|
-
minHeight: 22,
|
|
138
|
-
fontWeight: '400',
|
|
139
|
-
fontFamily: FONT_FAMILY.buenosAires,
|
|
140
|
-
...(Platform.OS === 'web' && {
|
|
141
|
-
outlineStyle: 'none'
|
|
142
|
-
}),
|
|
143
|
-
paddingHorizontal: SPACING[100],
|
|
144
|
-
paddingVertical: SPACING[200]
|
|
145
|
-
},
|
|
146
|
-
arrowWrapper: {
|
|
147
|
-
marginLeft: SPACING[200]
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
//# sourceMappingURL=InputWithHintRow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","Platform","StyleSheet","TextInput","View","Animated","useSharedValue","withTiming","useAnimatedStyle","useAnimatedReaction","COLORS","FONT_FAMILY","SPACING","HelpRequestOption","InputButton","jsx","_jsx","jsxs","_jsxs","COMPACT_WIDTH","InputWithHintRow","onPress","message","disabled","colorScheme","value","setValue","widthSv","arrowOpacitySv","hintVisibleSv","valueLengthSv","shouldDisable","trim","length","animatedInputStyle","width","handleChangeText","text","currentLength","duration","style","styles","container","children","inputWrapper","input","placeholder","placeholderTextColor","NEUTRAL_6","onChangeText","arrowWrapper","visibleSv","create","position","alignItems","height","justifyContent","zIndex","right","left","flexDirection","borderWidth","borderColor","NEUTRAL_5","borderRadius","backgroundColor","NEUTRAL_1","paddingHorizontal","paddingVertical","overflow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","flex","fontSize","minWidth","minHeight","fontWeight","fontFamily","buenosAires","OS","outlineStyle","marginLeft"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/Alternatives/InputWithHintRow.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,QAAQ,EAAEC,UAAU,EAAEC,SAAS,EAAEC,IAAI,QAAQ,cAAc;AACpE,OAAOC,QAAQ,IACbC,cAAc,EACdC,UAAU,EACVC,gBAAgB,EAChBC,mBAAmB,QACd,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,EAAEC,OAAO,QAAQ,4BAA4B;AACzE,SAASC,iBAAiB,QAAQ,wBAAqB;AACvD,SAASC,WAAW,QAAQ,kBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG3C,MAAMC,aAAa,GAAG,GAAG;AASzB,OAAO,MAAMC,gBAAgB,GAAGA,CAAC;EAC/BC,OAAO;EACPC,OAAO;EACPC,QAAQ;EACRC;AACqB,CAAC,KAAK;EAC3B,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAG1B,QAAQ,CAAC,EAAE,CAAC;EAEtC,MAAM2B,OAAO,GAAGrB,cAAc,CAACa,aAAa,CAAC;EAC7C,MAAMS,cAAc,GAAGtB,cAAc,CAAC,CAAC,CAAC;EACxC,MAAMuB,aAAa,GAAGvB,cAAc,CAAC,CAAC,CAAC;EACvC,MAAMwB,aAAa,GAAGxB,cAAc,CAAC,CAAC,CAAC;EAE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AAE,UAAU;IACpBI,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE9C,OAAO,CAAC,GAAG,CAAC;IACnB+C,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,KAAK;IACpBN,UAAU,EAAE,QAAQ;IACpBO,WAAW,EAAE,CAAC;IACdC,WAAW,EAAEpD,MAAM,CAACqD,SAAS;IAC7BC,YAAY,EAAE,GAAG;IACjBC,eAAe,EAAEvD,MAAM,CAACwD,SAAS;IACjCC,iBAAiB,EAAEvD,OAAO,CAAC,GAAG,CAAC;IAC/BwD,eAAe,EAAExD,OAAO,CAAC,GAAG,CAAC;IAC7ByD,QAAQ,EAAE,QAAQ;IAClBC,SAAS,EAAE,CAAC;IACZC,WAAW,EAAE,MAAM;IACnBC,YAAY,EAAE;MAAErC,KAAK,EAAE,CAAC;MAAEoB,MAAM,EAAE;IAAE,CAAC;IACrCkB,aAAa,EAAE,IAAI;IACnBC,YAAY,EAAE;EAChB,CAAC;EACD7B,KAAK,EAAE;IACL8B,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,EAAE;IACZC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE,EAAE;IACbC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAErE,WAAW,CAACsE,WAAW;IACnC,IAAIhF,QAAQ,CAACiF,EAAE,KAAK,KAAK,IAAI;MAAEC,YAAY,EAAE;IAAO,CAAC,CAAC;IACtDhB,iBAAiB,EAAEvD,OAAO,CAAC,GAAG,CAAC;IAC/BwD,eAAe,EAAExD,OAAO,CAAC,GAAG;EAC9B,CAAC;EACDsC,YAAY,EAAE;IACZkC,UAAU,EAAExE,OAAO,CAAC,GAAG;EACzB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useRef","Platform","ScrollView","StyleSheet","useWindowDimensions","View","useStoreMap","useUnit","ChatMessage","MessageLoader","Alternatives","MessageVariant","ColorScheme","jsx","_jsx","jsxs","_jsxs","TOOLBAR_HEIGHT","BOTTOM_OFFSET","select","web","default","ChatbotMessages","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","askChatForHelp","message","translatedMessage","style","styles","container","maxHeight","children","bounces","contentContainerStyle","list","onContentSizeChange","_","current","scrollToEnd","setScrollActive","gap","map","withIcon","isOwnMessage","variant","SENT","RECEIVED","withErrorSpotting","t2sState","isEnabled","isActive","isLoading","status","disabled","onPressAlternative","hasMessages","length","create","flex","alignItems","width","paddingVertical","paddingRight"],"sourceRoot":"../../../../../../src","sources":["features/chatbot/components/ChatMessages/ChatbotMessages.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,YAAY,QAAQ,iCAA8B;AAC3D,SAASC,cAAc,QAAQ,4BAAyB;AACxD,SAASC,WAAW,QAAQ,4BAAyB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AASrD,MAAMC,cAAc,GAAG,GAAG;AAC1B,MAAMC,aAAa,GAAGjB,QAAQ,CAACkB,MAAM,CAAC;EACpCC,GAAG,EAAE,GAAG;EACRC,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,KAAK;EACLC,cAAc;EACdC,qBAAqB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AE,CAAC;MAAA,CAChE,CACP,EAEAI,MAAM,iBACLhB,IAAA,CAACJ,YAAY;QACX4E,kBAAkB,EAAE9B,cAAe;QACnC+B,WAAW,EAAEtC,QAAQ,CAACuC,MAAM,GAAG,CAAE;QACjChE,cAAc,EAAEA,cAAe;QAC/BE,WAAW,EAAEA;MAAY,CAC1B,CACF;IAAA,CACS;EAAC,CACT,CAAC;AAEX,CAAC;AAED,MAAMkC,MAAM,GAAGzD,UAAU,CAACsF,MAAM,CAAC;EAC/B5B,SAAS,EAAE;IACT6B,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE,UAAU;IACtBC,KAAK,EAAE,GAAG;IACVrC,MAAM,EAAE;EACV,CAAC;EACDW,IAAI,EAAE;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":[]}
|
|
Binary file
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ColorScheme } from '../../types/style.types';
|
|
3
|
-
type AlternativesProps = {
|
|
4
|
-
onPressAlternative: (message: string, translatedMessage?: string) => void;
|
|
5
|
-
hasMessages: boolean;
|
|
6
|
-
isHintFeedback: boolean;
|
|
7
|
-
colorScheme?: ColorScheme;
|
|
8
|
-
};
|
|
9
|
-
export declare const Alternatives: ({ onPressAlternative, hasMessages, isHintFeedback, colorScheme, }: AlternativesProps) => React.JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=Alternatives.d.ts.map
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alternatives.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/Alternatives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAA;AAKvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQrD,KAAK,iBAAiB,GAAG;IACvB,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAqED,eAAO,MAAM,YAAY,sEAKtB,iBAAiB,sBAgCnB,CAAA"}
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SharedValue } from 'react-native-reanimated';
|
|
3
|
-
import { ColorScheme } from '@magmamath/students-features';
|
|
4
|
-
type HelpRequestOptionProps = {
|
|
5
|
-
onPress: () => void;
|
|
6
|
-
message: string;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
colorScheme?: ColorScheme;
|
|
9
|
-
visibleSv?: SharedValue<number>;
|
|
10
|
-
};
|
|
11
|
-
export declare const HelpRequestOption: ({ onPress, message, disabled, colorScheme, visibleSv, }: HelpRequestOptionProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=HelpRequestOption.d.ts.map
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HelpRequestOption.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/HelpRequestOption.tsx"],"names":[],"mappings":"AA4FA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAiB,EAKf,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG1D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,iBAAiB,4DAM3B,sBAAsB,sBA+DxB,CAAA"}
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputButton.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/InputButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG1D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,wCAIrB,sBAAsB,sBAoCxB,CAAA"}
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ColorScheme } from '@magmamath/students-features';
|
|
3
|
-
type InputWithHintRowProps = {
|
|
4
|
-
onPress: () => void;
|
|
5
|
-
message: string;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
colorScheme?: ColorScheme;
|
|
8
|
-
};
|
|
9
|
-
export declare const InputWithHintRow: ({ onPress, message, disabled, colorScheme, }: InputWithHintRowProps) => React.JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=InputWithHintRow.d.ts.map
|
package/dist/typescript/commonjs/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputWithHintRow.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/InputWithHintRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAWvC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI1D,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,gBAAgB,iDAK1B,qBAAqB,sBAwFvB,CAAA"}
|
package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatbotMessages.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAIrC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAQD,eAAO,MAAM,eAAe,mEAKzB,oBAAoB,sBAwEtB,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ColorScheme } from '../../types/style.types';
|
|
3
|
-
type AlternativesProps = {
|
|
4
|
-
onPressAlternative: (message: string, translatedMessage?: string) => void;
|
|
5
|
-
hasMessages: boolean;
|
|
6
|
-
isHintFeedback: boolean;
|
|
7
|
-
colorScheme?: ColorScheme;
|
|
8
|
-
};
|
|
9
|
-
export declare const Alternatives: ({ onPressAlternative, hasMessages, isHintFeedback, colorScheme, }: AlternativesProps) => React.JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=Alternatives.d.ts.map
|
package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Alternatives.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/Alternatives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmC,MAAM,OAAO,CAAA;AAKvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAQrD,KAAK,iBAAiB,GAAG;IACvB,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,iBAAiB,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACzE,WAAW,EAAE,OAAO,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAqED,eAAO,MAAM,YAAY,sEAKtB,iBAAiB,sBAgCnB,CAAA"}
|
package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SharedValue } from 'react-native-reanimated';
|
|
3
|
-
import { ColorScheme } from '@magmamath/students-features';
|
|
4
|
-
type HelpRequestOptionProps = {
|
|
5
|
-
onPress: () => void;
|
|
6
|
-
message: string;
|
|
7
|
-
disabled: boolean;
|
|
8
|
-
colorScheme?: ColorScheme;
|
|
9
|
-
visibleSv?: SharedValue<number>;
|
|
10
|
-
};
|
|
11
|
-
export declare const HelpRequestOption: ({ onPress, message, disabled, colorScheme, visibleSv, }: HelpRequestOptionProps) => React.JSX.Element;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=HelpRequestOption.d.ts.map
|
package/dist/typescript/module/features/chatbot/components/Alternatives/HelpRequestOption.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HelpRequestOption.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/HelpRequestOption.tsx"],"names":[],"mappings":"AA4FA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAiB,EAKf,WAAW,EACZ,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG1D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,iBAAiB,4DAM3B,sBAAsB,sBA+DxB,CAAA"}
|
package/dist/typescript/module/features/chatbot/components/Alternatives/InputButton.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputButton.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/InputButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG1D,KAAK,sBAAsB,GAAG;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,wCAIrB,sBAAsB,sBAoCxB,CAAA"}
|
package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ColorScheme } from '@magmamath/students-features';
|
|
3
|
-
type InputWithHintRowProps = {
|
|
4
|
-
onPress: () => void;
|
|
5
|
-
message: string;
|
|
6
|
-
disabled: boolean;
|
|
7
|
-
colorScheme?: ColorScheme;
|
|
8
|
-
};
|
|
9
|
-
export declare const InputWithHintRow: ({ onPress, message, disabled, colorScheme, }: InputWithHintRowProps) => React.JSX.Element;
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=InputWithHintRow.d.ts.map
|
package/dist/typescript/module/features/chatbot/components/Alternatives/InputWithHintRow.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputWithHintRow.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/Alternatives/InputWithHintRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAWvC,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAI1D,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,gBAAgB,iDAK1B,qBAAqB,sBAwFvB,CAAA"}
|
package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatbotMessages.d.ts","sourceRoot":"","sources":["../../../../../../../src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiB,MAAM,OAAO,CAAA;AAIrC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAKvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAErD,KAAK,oBAAoB,GAAG;IAC1B,KAAK,EAAE,YAAY,CAAA;IACnB,cAAc,EAAE,OAAO,CAAA;IACvB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAQD,eAAO,MAAM,eAAe,mEAKzB,oBAAoB,sBAwEtB,CAAA"}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import React, { Component, ComponentType } from 'react'
|
|
2
|
-
import { StyleSheet, View } from 'react-native'
|
|
3
|
-
import { useStoreMap, useUnit } from 'effector-react'
|
|
4
|
-
|
|
5
|
-
import { useChatModel } from '../../context/ChatBotModelContext'
|
|
6
|
-
import { ColorScheme } from '../../types/style.types'
|
|
7
|
-
import { CONTROLS_COLORS_MAP } from '../../constants'
|
|
8
|
-
import { InputWithHintRow } from './InputWithHintRow'
|
|
9
|
-
import { useText } from '../../../../shared/translation'
|
|
10
|
-
import { HelpRequestOption } from './HelpRequestOption'
|
|
11
|
-
import { AlternativesOptions, GetAlternativesResponse } from '../../types/api.types'
|
|
12
|
-
import { ChatAnswer } from '@magmamath/students-features'
|
|
13
|
-
|
|
14
|
-
type AlternativesProps = {
|
|
15
|
-
onPressAlternative: (message: string, translatedMessage?: string) => void
|
|
16
|
-
hasMessages: boolean
|
|
17
|
-
isHintFeedback: boolean
|
|
18
|
-
colorScheme?: ColorScheme
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
enum ChatMode {
|
|
22
|
-
FREE_TEXT = 1,
|
|
23
|
-
CHOICE,
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type ChatOptionsInput = {
|
|
27
|
-
options: ChatAnswer[]
|
|
28
|
-
alternatives: GetAlternativesResponse | null
|
|
29
|
-
disabled: boolean
|
|
30
|
-
isTranslated: boolean
|
|
31
|
-
isTranslationPending: boolean
|
|
32
|
-
onPressAlternative: (message: string, translatedMessage?: string) => void
|
|
33
|
-
colorScheme: ColorScheme
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const FreeTextChatInput = ({
|
|
37
|
-
options,
|
|
38
|
-
alternatives,
|
|
39
|
-
isTranslated,
|
|
40
|
-
disabled,
|
|
41
|
-
onPressAlternative,
|
|
42
|
-
colorScheme,
|
|
43
|
-
}: ChatOptionsInput) => {
|
|
44
|
-
const isDisabled = options.length === 0
|
|
45
|
-
const choices = (isDisabled ? alternatives?.options.default : options) ?? []
|
|
46
|
-
const option = choices[0]
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<View style={styles.container}>
|
|
50
|
-
<InputWithHintRow
|
|
51
|
-
onPress={() => onPressAlternative(option.text, option.translatedText)}
|
|
52
|
-
message={isTranslated ? (option.translatedText as string) : option.text}
|
|
53
|
-
disabled={isDisabled || disabled}
|
|
54
|
-
colorScheme={colorScheme}
|
|
55
|
-
/>
|
|
56
|
-
</View>
|
|
57
|
-
)
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const OptionTextChatInput = ({
|
|
61
|
-
options,
|
|
62
|
-
alternatives,
|
|
63
|
-
onPressAlternative,
|
|
64
|
-
isTranslated,
|
|
65
|
-
colorScheme,
|
|
66
|
-
disabled
|
|
67
|
-
}: ChatOptionsInput) => {
|
|
68
|
-
return (
|
|
69
|
-
<View style={styles.container}>
|
|
70
|
-
{options.map(({ text, translatedText }, index) => (
|
|
71
|
-
<HelpRequestOption
|
|
72
|
-
key={index}
|
|
73
|
-
onPress={() => onPressAlternative(text, translatedText)}
|
|
74
|
-
message={isTranslated ? (translatedText as string) : text}
|
|
75
|
-
disabled={disabled}
|
|
76
|
-
colorScheme={colorScheme}
|
|
77
|
-
/>
|
|
78
|
-
))}
|
|
79
|
-
</View>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const alternativesVariant: Record<ChatMode, ComponentType<ChatOptionsInput>> = {
|
|
84
|
-
[ChatMode.FREE_TEXT]: FreeTextChatInput,
|
|
85
|
-
[ChatMode.CHOICE]: OptionTextChatInput,
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const Alternatives = ({
|
|
89
|
-
onPressAlternative,
|
|
90
|
-
hasMessages,
|
|
91
|
-
isHintFeedback,
|
|
92
|
-
colorScheme = ColorScheme.Blue,
|
|
93
|
-
}: AlternativesProps) => {
|
|
94
|
-
const model = useChatModel()
|
|
95
|
-
const isTranslated = useUnit(model.translation.$isTranslated)
|
|
96
|
-
const alternatives = useUnit(model.$alternatives)
|
|
97
|
-
const isTranslationPending = useUnit(model.translation.translateAllMessagesFx.pending)
|
|
98
|
-
const isHelpRequestPending = useUnit(model.sendHelpRequestFx.pending)
|
|
99
|
-
|
|
100
|
-
const lastMessageOptions = useStoreMap(model.$currentChatData, ({ messages }) => {
|
|
101
|
-
const lastMessage = messages.at(-1)
|
|
102
|
-
return lastMessage?.options ?? []
|
|
103
|
-
})
|
|
104
|
-
|
|
105
|
-
const options = (() => {
|
|
106
|
-
if (hasMessages) return lastMessageOptions
|
|
107
|
-
if (isHintFeedback) return alternatives?.options.hints ?? []
|
|
108
|
-
return alternatives?.options.default ?? []
|
|
109
|
-
})()
|
|
110
|
-
|
|
111
|
-
const variant = ChatMode.FREE_TEXT // props or even to model
|
|
112
|
-
const Component = alternativesVariant[variant]
|
|
113
|
-
|
|
114
|
-
return (
|
|
115
|
-
<Component
|
|
116
|
-
options={options}
|
|
117
|
-
alternatives={alternatives}
|
|
118
|
-
disabled={isHelpRequestPending}
|
|
119
|
-
isTranslated={isTranslated}
|
|
120
|
-
isTranslationPending={isTranslationPending}
|
|
121
|
-
onPressAlternative={onPressAlternative}
|
|
122
|
-
colorScheme={colorScheme}
|
|
123
|
-
/>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const styles = StyleSheet.create({
|
|
128
|
-
container: {
|
|
129
|
-
flex: 1,
|
|
130
|
-
width: 305,
|
|
131
|
-
alignItems: 'center',
|
|
132
|
-
justifyContent: 'center',
|
|
133
|
-
marginVertical: 8,
|
|
134
|
-
},
|
|
135
|
-
})
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
// import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
-
// import { Animated, Pressable, StyleSheet } from 'react-native'
|
|
3
|
-
// import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
|
|
4
|
-
//
|
|
5
|
-
// type HelpRequestOptionProps = {
|
|
6
|
-
// onPress: () => void
|
|
7
|
-
// message: string
|
|
8
|
-
// disabled: boolean
|
|
9
|
-
// hoverColor?: string
|
|
10
|
-
// }
|
|
11
|
-
//
|
|
12
|
-
// export const HelpRequestOption = ({
|
|
13
|
-
// onPress,
|
|
14
|
-
// message,
|
|
15
|
-
// disabled = false,
|
|
16
|
-
// hoverColor = COLORS.PRIMARY_BLUE,
|
|
17
|
-
// }: HelpRequestOptionProps) => {
|
|
18
|
-
// const [isHovered, setIsHovered] = useState(false)
|
|
19
|
-
// const hoverAnim = useRef(new Animated.Value(0)).current
|
|
20
|
-
//
|
|
21
|
-
// const backgroundColor = hoverAnim.interpolate({
|
|
22
|
-
// inputRange: [0, 1],
|
|
23
|
-
// outputRange: [COLORS.NEUTRAL_1, hoverColor],
|
|
24
|
-
// })
|
|
25
|
-
// const textColor = hoverAnim.interpolate({
|
|
26
|
-
// inputRange: [0, 1],
|
|
27
|
-
// outputRange: [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1],
|
|
28
|
-
// })
|
|
29
|
-
//
|
|
30
|
-
// useEffect(() => {
|
|
31
|
-
// Animated.timing(hoverAnim, {
|
|
32
|
-
// toValue: isHovered ? 1 : 0,
|
|
33
|
-
// duration: 200,
|
|
34
|
-
// useNativeDriver: false,
|
|
35
|
-
// }).start()
|
|
36
|
-
// }, [isHovered, hoverAnim])
|
|
37
|
-
//
|
|
38
|
-
// return (
|
|
39
|
-
// <Pressable
|
|
40
|
-
// onHoverIn={() => setIsHovered(true)}
|
|
41
|
-
// onHoverOut={() => setIsHovered(false)}
|
|
42
|
-
// onPress={onPress}
|
|
43
|
-
// style={styles.button}
|
|
44
|
-
// disabled={disabled}
|
|
45
|
-
// accessibilityState={{ disabled }}
|
|
46
|
-
// accessibilityRole="button"
|
|
47
|
-
// >
|
|
48
|
-
// <Animated.View
|
|
49
|
-
// style={[styles.textWrapper, { backgroundColor, borderColor: isHovered ? backgroundColor: COLORS.PRIMARY_BLUE }]}
|
|
50
|
-
// >
|
|
51
|
-
// <Animated.Text numberOfLines={1} style={[styles.text, { color: textColor }]}>
|
|
52
|
-
// I need a hint
|
|
53
|
-
// </Animated.Text>
|
|
54
|
-
// <ArrowUpIcon color={isHovered ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_10} />
|
|
55
|
-
// </Animated.View>
|
|
56
|
-
// </Pressable>
|
|
57
|
-
// )
|
|
58
|
-
// }
|
|
59
|
-
//
|
|
60
|
-
// const styles = StyleSheet.create({
|
|
61
|
-
// button: {
|
|
62
|
-
// flexDirection: 'row',
|
|
63
|
-
// alignItems: 'flex-end',
|
|
64
|
-
// justifyContent: 'space-between',
|
|
65
|
-
// width: '100%',
|
|
66
|
-
// },
|
|
67
|
-
// text: {
|
|
68
|
-
// fontSize: 18,
|
|
69
|
-
// fontWeight: 400,
|
|
70
|
-
// fontFamily: FONT_FAMILY.buenosAires,
|
|
71
|
-
// color: COLORS.NEUTRAL_10,
|
|
72
|
-
// },
|
|
73
|
-
// textWrapper: {
|
|
74
|
-
// flex: 1,
|
|
75
|
-
// flexDirection: 'row',
|
|
76
|
-
// alignItems: 'center',
|
|
77
|
-
// justifyContent: 'space-between',
|
|
78
|
-
// maxWidth: 163,
|
|
79
|
-
// paddingHorizontal: SPACING[400],
|
|
80
|
-
// paddingVertical: SPACING[200],
|
|
81
|
-
// borderWidth: 1,
|
|
82
|
-
// borderRadius: 48,
|
|
83
|
-
// elevation: 3,
|
|
84
|
-
// shadowColor: '#333',
|
|
85
|
-
// shadowOffset: { width: 0, height: 1 },
|
|
86
|
-
// shadowOpacity: 0.25,
|
|
87
|
-
// shadowRadius: 3,
|
|
88
|
-
// backgroundColor: COLORS.NEUTRAL_1,
|
|
89
|
-
// borderColor: COLORS.PRIMARY_BLUE,
|
|
90
|
-
// },
|
|
91
|
-
// })
|
|
92
|
-
|
|
93
|
-
import React from 'react'
|
|
94
|
-
import { Pressable, StyleSheet } from 'react-native'
|
|
95
|
-
import Animated, {
|
|
96
|
-
useSharedValue,
|
|
97
|
-
withTiming,
|
|
98
|
-
useAnimatedStyle,
|
|
99
|
-
interpolateColor,
|
|
100
|
-
SharedValue,
|
|
101
|
-
} from 'react-native-reanimated'
|
|
102
|
-
import { ArrowUpIcon, COLORS, FONT_FAMILY, SPACING } from '@magmamath/react-native-ui'
|
|
103
|
-
import { ColorScheme } from '@magmamath/students-features'
|
|
104
|
-
import { MESSAGE_COLORS_MAP } from '../../constants'
|
|
105
|
-
|
|
106
|
-
type HelpRequestOptionProps = {
|
|
107
|
-
onPress: () => void
|
|
108
|
-
message: string
|
|
109
|
-
disabled: boolean
|
|
110
|
-
colorScheme?: ColorScheme
|
|
111
|
-
visibleSv?: SharedValue<number>
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export const HelpRequestOption = ({
|
|
115
|
-
onPress,
|
|
116
|
-
message,
|
|
117
|
-
disabled = false,
|
|
118
|
-
colorScheme = ColorScheme.Blue,
|
|
119
|
-
visibleSv,
|
|
120
|
-
}: HelpRequestOptionProps) => {
|
|
121
|
-
const hoverSv = useSharedValue(0)
|
|
122
|
-
|
|
123
|
-
const onHoverIn = () => {
|
|
124
|
-
if (!disabled) hoverSv.value = withTiming(1, { duration: 200 })
|
|
125
|
-
}
|
|
126
|
-
const onHoverOut = () => {
|
|
127
|
-
if (!disabled) hoverSv.value = withTiming(0, { duration: 200 })
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const animatedWrapperStyle = useAnimatedStyle(() => {
|
|
131
|
-
const backgroundColor = interpolateColor(
|
|
132
|
-
hoverSv.value,
|
|
133
|
-
[0, 1],
|
|
134
|
-
[COLORS.NEUTRAL_1, MESSAGE_COLORS_MAP[colorScheme].sent.background],
|
|
135
|
-
)
|
|
136
|
-
const borderColor = interpolateColor(
|
|
137
|
-
hoverSv.value,
|
|
138
|
-
[0, 1],
|
|
139
|
-
[
|
|
140
|
-
MESSAGE_COLORS_MAP[colorScheme].sent.border,
|
|
141
|
-
MESSAGE_COLORS_MAP[colorScheme].sent.border,
|
|
142
|
-
],
|
|
143
|
-
)
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
backgroundColor: disabled ? COLORS.NEUTRAL_2 : backgroundColor,
|
|
147
|
-
borderColor: disabled ? COLORS.NEUTRAL_5 : borderColor,
|
|
148
|
-
}
|
|
149
|
-
}, [hoverSv, disabled, colorScheme])
|
|
150
|
-
|
|
151
|
-
const animatedTextStyle = useAnimatedStyle(() => {
|
|
152
|
-
const color = interpolateColor(hoverSv.value, [0, 1], [COLORS.NEUTRAL_10, COLORS.NEUTRAL_1])
|
|
153
|
-
return { color: disabled ? COLORS.NEUTRAL_5 : color }
|
|
154
|
-
}, [hoverSv, disabled])
|
|
155
|
-
|
|
156
|
-
const animatedVisibilityStyle = useAnimatedStyle(() => {
|
|
157
|
-
return {
|
|
158
|
-
opacity: visibleSv ? visibleSv.value : 1,
|
|
159
|
-
}
|
|
160
|
-
}, [visibleSv])
|
|
161
|
-
|
|
162
|
-
return (
|
|
163
|
-
<Pressable
|
|
164
|
-
onHoverIn={onHoverIn}
|
|
165
|
-
onHoverOut={onHoverOut}
|
|
166
|
-
onPress={onPress}
|
|
167
|
-
style={[styles.button, { cursor: disabled ? 'auto' : 'pointer' }]}
|
|
168
|
-
disabled={disabled}
|
|
169
|
-
accessibilityState={{ disabled }}
|
|
170
|
-
accessibilityRole="button"
|
|
171
|
-
>
|
|
172
|
-
<Animated.View style={[styles.textWrapper, animatedWrapperStyle, animatedVisibilityStyle]}>
|
|
173
|
-
<Animated.Text numberOfLines={1} style={[styles.text, animatedTextStyle]}>
|
|
174
|
-
{message}
|
|
175
|
-
</Animated.Text>
|
|
176
|
-
|
|
177
|
-
<Animated.Text style={animatedTextStyle}>
|
|
178
|
-
<ArrowUpIcon color={'currentColor'} size={16} />
|
|
179
|
-
</Animated.Text>
|
|
180
|
-
</Animated.View>
|
|
181
|
-
</Pressable>
|
|
182
|
-
)
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const styles = StyleSheet.create({
|
|
186
|
-
button: {
|
|
187
|
-
flexDirection: 'row',
|
|
188
|
-
justifyContent: 'flex-end',
|
|
189
|
-
},
|
|
190
|
-
text: {
|
|
191
|
-
fontSize: 18,
|
|
192
|
-
fontWeight: '400',
|
|
193
|
-
fontFamily: FONT_FAMILY.buenosAires,
|
|
194
|
-
color: COLORS.NEUTRAL_10,
|
|
195
|
-
},
|
|
196
|
-
textWrapper: {
|
|
197
|
-
flex: 1,
|
|
198
|
-
flexDirection: 'row',
|
|
199
|
-
alignItems: 'center',
|
|
200
|
-
justifyContent: 'space-between',
|
|
201
|
-
width: 163,
|
|
202
|
-
paddingHorizontal: SPACING[400],
|
|
203
|
-
paddingVertical: SPACING[200],
|
|
204
|
-
borderWidth: 1,
|
|
205
|
-
borderRadius: 48,
|
|
206
|
-
elevation: 3,
|
|
207
|
-
shadowColor: '#333',
|
|
208
|
-
shadowOffset: { width: 0, height: 1 },
|
|
209
|
-
shadowOpacity: 0.25,
|
|
210
|
-
shadowRadius: 3,
|
|
211
|
-
backgroundColor: COLORS.NEUTRAL_1,
|
|
212
|
-
borderColor: COLORS.PRIMARY_BLUE,
|
|
213
|
-
},
|
|
214
|
-
})
|