@magmamath/students-features 1.3.3-rc.3 → 1.3.3
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/.claude/settings.local.json +25 -0
- package/.editorconfig +15 -0
- package/.eslintignore +2 -0
- package/.eslintrc +22 -0
- package/.gitattributes +3 -0
- package/.github/actions/setup/action.yml +37 -0
- package/.github/workflows/ci.yml +73 -0
- package/.gitignore +84 -0
- package/.idea/.gitignore +8 -0
- package/.idea/codeStyles/Project.xml +62 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.agent.xml +6 -0
- package/.idea/copilot.data.migration.ask.xml +6 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/copilot.data.migration.edit.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +8 -0
- package/.idea/jsLinters/eslint.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +7 -0
- package/.idea/students-features.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +667 -0
- package/.nvmrc +1 -0
- package/.prettierrc +11 -0
- package/.release-it.json +17 -0
- package/.watchmanconfig +1 -0
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
- package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
- package/.yarn/releases/yarn-3.6.1.cjs +874 -0
- package/babel.config.js +5 -0
- package/bob.config.js +25 -0
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +2 -2
- package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +2 -2
- package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
- package/dist/commonjs/features/chatbot/helpers.js +8 -4
- package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
- package/dist/commonjs/features/chatbot/index.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js +7 -6
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +4 -3
- package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +2 -4
- package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +4 -3
- package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +8 -4
- package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/commonjs/features/feedback/components/EmptyComment.js +2 -2
- package/dist/commonjs/features/feedback/components/EmptyComment.js.map +1 -1
- package/dist/commonjs/features/feedback/model/comments.js +2 -2
- package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
- package/dist/commonjs/features/gifCelebrations/components/Gif.js +2 -2
- package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +20 -72
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js +33 -0
- package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +2 -2
- package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +94 -0
- package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js +25 -0
- package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/{AlgebraLayout → SwitchableLayout}/types.js +1 -1
- package/dist/commonjs/features/keyboard/components/SwitchableLayout/types.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +2 -2
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/groups/geometry.constants.js +11 -0
- package/dist/commonjs/features/keyboard/constants/groups/geometry.constants.js.map +1 -0
- package/dist/commonjs/features/keyboard/constants/groups/index.js +11 -0
- package/dist/commonjs/features/keyboard/constants/groups/index.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboard.constants.js +6 -1
- package/dist/commonjs/features/keyboard/constants/keyboard.constants.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js +2 -0
- package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +18 -8
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keys/geometry.constants.js +86 -1
- package/dist/commonjs/features/keyboard/constants/keys/geometry.constants.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keys/text.constants.js +9 -9
- package/dist/commonjs/features/keyboard/constants/keys/units.constants.js +2 -1
- package/dist/commonjs/features/keyboard/constants/keys/units.constants.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/types.js +1 -0
- package/dist/commonjs/features/keyboard/types/types.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +2 -2
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +2 -2
- package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +2 -2
- package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
- package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +2 -2
- package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +2 -2
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +2 -2
- package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +7 -7
- package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
- package/dist/commonjs/index.js +38 -23
- package/dist/commonjs/index.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js +12 -12
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/lib/types/keys.js +2 -0
- package/dist/commonjs/lib/types/keys.js.map +1 -0
- package/dist/commonjs/shared/icons/GeometryIcon.js +32 -0
- package/dist/commonjs/shared/icons/GeometryIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/AngleIcon.js +4 -3
- package/dist/commonjs/shared/icons/keyboard/AngleIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.js +12 -8
- package/dist/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/keyboard/ImpliesIcon.js +30 -0
- package/dist/commonjs/shared/icons/keyboard/ImpliesIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/LetterAIcon.js +29 -0
- package/dist/commonjs/shared/icons/keyboard/LetterAIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/LetterBIcon.js +29 -0
- package/dist/commonjs/shared/icons/keyboard/LetterBIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/LetterCIcon.js +29 -0
- package/dist/commonjs/shared/icons/keyboard/LetterCIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/LineSegmentIcon.js +11 -6
- package/dist/commonjs/shared/icons/keyboard/LineSegmentIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.js +12 -8
- package/dist/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.js.map +1 -1
- package/dist/commonjs/shared/icons/keyboard/ThereforeIcon.js +42 -0
- package/dist/commonjs/shared/icons/keyboard/ThereforeIcon.js.map +1 -0
- package/dist/commonjs/shared/icons/keyboard/TriangleIcon.js +32 -0
- package/dist/commonjs/shared/icons/keyboard/TriangleIcon.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +23 -0
- package/dist/commonjs/shared/translation/constants.js.map +1 -0
- package/dist/commonjs/shared/translation/helpers.js +47 -0
- package/dist/commonjs/shared/translation/helpers.js.map +1 -0
- package/dist/commonjs/shared/translation/hooks.js +25 -0
- package/dist/commonjs/shared/translation/hooks.js.map +1 -0
- package/dist/commonjs/shared/translation/index.js +45 -0
- package/dist/commonjs/shared/translation/index.js.map +1 -0
- package/dist/commonjs/shared/translation/localization/ca.json +61 -0
- package/dist/commonjs/shared/translation/localization/de.json +61 -0
- package/dist/commonjs/shared/translation/localization/en.json +61 -0
- package/dist/commonjs/shared/translation/localization/gb.json +61 -0
- package/dist/commonjs/shared/translation/localization/sct.json +61 -0
- package/dist/commonjs/shared/translation/localization/sw.json +61 -0
- package/dist/commonjs/shared/translation/model.js +15 -0
- package/dist/commonjs/shared/translation/model.js.map +1 -0
- package/dist/commonjs/shared/translation/types.js +6 -0
- package/dist/commonjs/shared/translation/types.js.map +1 -0
- package/dist/commonjs/shared/translation/validation.types.js +6 -0
- package/dist/commonjs/shared/translation/validation.types.js.map +1 -0
- package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +1 -1
- package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +1 -1
- package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
- package/dist/module/features/chatbot/helpers.js +6 -2
- package/dist/module/features/chatbot/helpers.js.map +1 -1
- package/dist/module/features/chatbot/index.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBotModel.js +7 -6
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js +3 -2
- package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js +2 -3
- package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +4 -3
- package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +9 -5
- package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
- package/dist/module/features/feedback/components/EmptyComment.js +1 -1
- package/dist/module/features/feedback/components/EmptyComment.js.map +1 -1
- package/dist/module/features/feedback/model/comments.js +1 -1
- package/dist/module/features/feedback/model/comments.js.map +1 -1
- package/dist/module/features/gifCelebrations/components/Gif.js +1 -1
- package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -1
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +21 -72
- package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js +27 -0
- package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -0
- package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -1
- package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
- package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +87 -0
- package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -0
- package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js +21 -0
- package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -0
- package/dist/module/features/keyboard/components/{AlgebraLayout → SwitchableLayout}/types.js +1 -1
- package/dist/module/features/keyboard/components/SwitchableLayout/types.js.map +1 -0
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/constants/groups/geometry.constants.js +7 -0
- package/dist/module/features/keyboard/constants/groups/geometry.constants.js.map +1 -0
- package/dist/module/features/keyboard/constants/groups/index.js +1 -0
- package/dist/module/features/keyboard/constants/groups/index.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboard.constants.js +5 -0
- package/dist/module/features/keyboard/constants/keyboard.constants.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboard.helpers.js +3 -1
- package/dist/module/features/keyboard/constants/keyboard.helpers.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboardLayouts.js +19 -9
- package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/module/features/keyboard/constants/keys/geometry.constants.js +86 -1
- package/dist/module/features/keyboard/constants/keys/geometry.constants.js.map +1 -1
- package/dist/module/features/keyboard/constants/keys/text.constants.js +9 -9
- package/dist/module/features/keyboard/constants/keys/units.constants.js +2 -1
- package/dist/module/features/keyboard/constants/keys/units.constants.js.map +1 -1
- package/dist/module/features/keyboard/types/types.js +1 -0
- package/dist/module/features/keyboard/types/types.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +1 -1
- package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js +1 -1
- package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
- package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +1 -1
- package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
- package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +1 -1
- package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
- package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +1 -1
- package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js +1 -1
- package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
- package/dist/module/index.js +1 -0
- package/dist/module/index.js.map +1 -1
- package/dist/module/lib/helpers/helpers.js +1 -1
- package/dist/module/lib/helpers/helpers.js.map +1 -1
- package/dist/module/lib/types/keys.js +2 -0
- package/dist/module/lib/types/keys.js.map +1 -0
- package/dist/module/shared/icons/GeometryIcon.js +24 -0
- package/dist/module/shared/icons/GeometryIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/AngleIcon.js +4 -3
- package/dist/module/shared/icons/keyboard/AngleIcon.js.map +1 -1
- package/dist/module/shared/icons/keyboard/BidirectionalSegmentIcon.js +13 -9
- package/dist/module/shared/icons/keyboard/BidirectionalSegmentIcon.js.map +1 -1
- package/dist/module/shared/icons/keyboard/ImpliesIcon.js +22 -0
- package/dist/module/shared/icons/keyboard/ImpliesIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/LetterAIcon.js +21 -0
- package/dist/module/shared/icons/keyboard/LetterAIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/LetterBIcon.js +21 -0
- package/dist/module/shared/icons/keyboard/LetterBIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/LetterCIcon.js +21 -0
- package/dist/module/shared/icons/keyboard/LetterCIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/LineSegmentIcon.js +12 -7
- package/dist/module/shared/icons/keyboard/LineSegmentIcon.js.map +1 -1
- package/dist/module/shared/icons/keyboard/RightDirectedSegmentIcon.js +13 -9
- package/dist/module/shared/icons/keyboard/RightDirectedSegmentIcon.js.map +1 -1
- package/dist/module/shared/icons/keyboard/ThereforeIcon.js +34 -0
- package/dist/module/shared/icons/keyboard/ThereforeIcon.js.map +1 -0
- package/dist/module/shared/icons/keyboard/TriangleIcon.js +24 -0
- package/dist/module/shared/icons/keyboard/TriangleIcon.js.map +1 -0
- package/dist/module/shared/translation/constants.js +18 -0
- package/dist/module/shared/translation/constants.js.map +1 -0
- package/dist/module/shared/translation/helpers.js +38 -0
- package/dist/module/shared/translation/helpers.js.map +1 -0
- package/dist/module/shared/translation/hooks.js +19 -0
- package/dist/module/shared/translation/hooks.js.map +1 -0
- package/dist/module/shared/translation/index.js +6 -0
- package/dist/module/shared/translation/index.js.map +1 -0
- package/dist/module/shared/translation/localization/ca.json +61 -0
- package/dist/module/shared/translation/localization/de.json +61 -0
- package/dist/module/shared/translation/localization/en.json +61 -0
- package/dist/module/shared/translation/localization/gb.json +61 -0
- package/dist/module/shared/translation/localization/sct.json +61 -0
- package/dist/module/shared/translation/localization/sw.json +61 -0
- package/dist/module/shared/translation/model.js +11 -0
- package/dist/module/shared/translation/model.js.map +1 -0
- package/dist/module/shared/translation/types.js +4 -0
- package/dist/module/shared/translation/types.js.map +1 -0
- package/dist/module/shared/translation/validation.types.js +4 -0
- package/dist/module/shared/translation/validation.types.js.map +1 -0
- package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +8 -6
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +1 -1
- package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts +4 -0
- package/dist/typescript/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +4 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/helpers.d.ts +12 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts +21 -0
- package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/constants/groups/geometry.constants.d.ts +3 -0
- package/dist/typescript/commonjs/features/keyboard/constants/groups/geometry.constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/constants/groups/index.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/constants/groups/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboard.constants.d.ts +5 -0
- package/dist/typescript/commonjs/features/keyboard/constants/keyboard.constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +13 -4
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keys/geometry.constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/types.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/types/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
- package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
- package/dist/typescript/commonjs/index.d.ts +1 -0
- package/dist/typescript/commonjs/index.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +1 -1
- package/dist/typescript/commonjs/lib/types/keys.d.ts +8 -0
- package/dist/typescript/commonjs/lib/types/keys.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/GeometryIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/GeometryIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/AngleIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/ImpliesIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/ImpliesIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterAIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterAIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterBIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterBIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterCIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LetterCIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/LineSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/commonjs/shared/icons/keyboard/ThereforeIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/ThereforeIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/TriangleIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/keyboard/TriangleIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +369 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts +7 -0
- package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts +5 -0
- package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/index.d.ts +4 -0
- package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts +125 -0
- package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/types.d.ts +6 -0
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +21 -0
- package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +1 -0
- package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
- package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +8 -6
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
- package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +1 -1
- package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts +1 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts +4 -0
- package/dist/typescript/module/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +4 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/helpers.d.ts +12 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts +21 -0
- package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/constants/groups/geometry.constants.d.ts +3 -0
- package/dist/typescript/module/features/keyboard/constants/groups/geometry.constants.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/constants/groups/index.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/constants/groups/index.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboard.constants.d.ts +5 -0
- package/dist/typescript/module/features/keyboard/constants/keyboard.constants.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +13 -4
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keys/geometry.constants.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/types.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/types/types.d.ts.map +1 -1
- package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
- package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
- package/dist/typescript/module/index.d.ts +1 -0
- package/dist/typescript/module/index.d.ts.map +1 -1
- package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +1 -1
- package/dist/typescript/module/lib/types/keys.d.ts +8 -0
- package/dist/typescript/module/lib/types/keys.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/GeometryIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/GeometryIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/AngleIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/keyboard/BidirectionalSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/keyboard/ImpliesIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/ImpliesIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterAIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterAIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterBIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterBIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterCIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/LetterCIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/LineSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/keyboard/RightDirectedSegmentIcon.d.ts.map +1 -1
- package/dist/typescript/module/shared/icons/keyboard/ThereforeIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/ThereforeIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/keyboard/TriangleIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/keyboard/TriangleIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +369 -0
- package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/helpers.d.ts +7 -0
- package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/hooks.d.ts +5 -0
- package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/index.d.ts +4 -0
- package/dist/typescript/module/shared/translation/index.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/model.d.ts +125 -0
- package/dist/typescript/module/shared/translation/model.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/types.d.ts +6 -0
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/validation.types.d.ts +21 -0
- package/dist/typescript/module/shared/translation/validation.types.d.ts.map +1 -0
- package/example/.expo/README.md +8 -0
- package/example/.expo/devices.json +3 -0
- package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
- package/example/app.json +30 -0
- package/example/assets/adaptive-icon.png +0 -0
- package/example/assets/favicon.png +0 -0
- package/example/assets/icon.png +0 -0
- package/example/assets/splash-icon.png +0 -0
- package/example/babel.config.js +28 -0
- package/example/index.js +8 -0
- package/example/metro.config.js +18 -0
- package/example/package.json +25 -0
- package/example/src/App.tsx +8 -0
- package/example/tsconfig.json +6 -0
- package/package.json +4 -9
- package/src/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.tsx +1 -1
- package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +1 -1
- package/src/features/chatbot/helpers.ts +3 -1
- package/src/features/chatbot/index.ts +9 -1
- package/src/features/chatbot/model/ChatBotModel.ts +7 -10
- package/src/features/chatbot/model/ChatBoxTextManager.ts +4 -2
- package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
- package/src/features/chatbot/types/api.types.ts +11 -6
- package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +4 -3
- package/src/features/exampleSolution/model/ExampleSolutionApi.ts +9 -5
- package/src/features/feedback/components/EmptyComment.tsx +1 -1
- package/src/features/feedback/model/comments.ts +1 -1
- package/src/features/gifCelebrations/components/Gif.tsx +1 -1
- package/src/features/gifCelebrations/helpers.ts +1 -1
- package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +17 -73
- package/src/features/keyboard/components/GeometryLayout/GeometryLayout.tsx +21 -0
- package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -1
- package/src/features/keyboard/components/SwitchableLayout/SwitchableLayout.tsx +100 -0
- package/src/features/keyboard/components/SwitchableLayout/helpers.tsx +31 -0
- package/src/features/keyboard/components/SwitchableLayout/types.ts +24 -0
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +1 -1
- package/src/features/keyboard/constants/groups/geometry.constants.ts +25 -0
- package/src/features/keyboard/constants/groups/index.ts +1 -0
- package/src/features/keyboard/constants/keyboard.constants.ts +6 -0
- package/src/features/keyboard/constants/keyboard.helpers.ts +3 -0
- package/src/features/keyboard/constants/keyboardLayouts.ts +15 -5
- package/src/features/keyboard/constants/keys/geometry.constants.tsx +61 -1
- package/src/features/keyboard/constants/keys/text.constants.tsx +9 -9
- package/src/features/keyboard/constants/keys/units.constants.tsx +1 -0
- package/src/features/keyboard/types/types.ts +1 -0
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +1 -1
- package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +1 -1
- package/src/features/voice/recording/components/VoiceRecordButton.tsx +1 -1
- package/src/features/voice/recording/modal/ModalFooterButtons.tsx +2 -2
- package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +1 -1
- package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +1 -1
- package/src/features/voice/recording/model/VoiceRecord.model.ts +1 -1
- package/src/index.ts +1 -0
- package/src/lib/helpers/helpers.ts +1 -1
- package/src/lib/types/keys.ts +18 -0
- package/src/shared/icons/GeometryIcon.tsx +18 -0
- package/src/shared/icons/keyboard/AngleIcon.tsx +4 -2
- package/src/shared/icons/keyboard/BidirectionalSegmentIcon.tsx +5 -8
- package/src/shared/icons/keyboard/ImpliesIcon.tsx +16 -0
- package/src/shared/icons/keyboard/LetterAIcon.tsx +14 -0
- package/src/shared/icons/keyboard/LetterBIcon.tsx +14 -0
- package/src/shared/icons/keyboard/LetterCIcon.tsx +14 -0
- package/src/shared/icons/keyboard/LineSegmentIcon.tsx +6 -7
- package/src/shared/icons/keyboard/RightDirectedSegmentIcon.tsx +5 -8
- package/src/shared/icons/keyboard/ThereforeIcon.tsx +15 -0
- package/src/shared/icons/keyboard/TriangleIcon.tsx +18 -0
- package/src/shared/translation/constants.ts +16 -0
- package/src/shared/translation/helpers.ts +47 -0
- package/src/shared/translation/hooks.ts +25 -0
- package/src/shared/translation/index.ts +3 -0
- package/src/shared/translation/localization/ca.json +61 -0
- package/src/shared/translation/localization/de.json +61 -0
- package/src/shared/translation/localization/en.json +61 -0
- package/src/shared/translation/localization/gb.json +61 -0
- package/src/shared/translation/localization/sct.json +61 -0
- package/src/shared/translation/localization/sw.json +61 -0
- package/src/shared/translation/model.ts +16 -0
- package/src/shared/translation/types.ts +21 -0
- package/src/shared/translation/validation.types.ts +34 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +34 -0
- package/yarn.lock +10957 -0
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/helpers.js +0 -41
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/helpers.js.map +0 -1
- package/dist/commonjs/features/keyboard/components/AlgebraLayout/types.js.map +0 -1
- package/dist/commonjs/shared/translation/i18n.d.js +0 -5
- package/dist/commonjs/shared/translation/i18n.d.js.map +0 -1
- package/dist/commonjs/shared/translation/i18n.js +0 -26
- package/dist/commonjs/shared/translation/i18n.js.map +0 -1
- package/dist/commonjs/shared/translation/react-i18next.d.js +0 -5
- package/dist/commonjs/shared/translation/react-i18next.d.js.map +0 -1
- package/dist/module/features/keyboard/components/AlgebraLayout/helpers.js +0 -36
- package/dist/module/features/keyboard/components/AlgebraLayout/helpers.js.map +0 -1
- package/dist/module/features/keyboard/components/AlgebraLayout/types.js.map +0 -1
- package/dist/module/shared/translation/i18n.d.js +0 -5
- package/dist/module/shared/translation/i18n.d.js.map +0 -1
- package/dist/module/shared/translation/i18n.js +0 -19
- package/dist/module/shared/translation/i18n.js.map +0 -1
- package/dist/module/shared/translation/react-i18next.d.js +0 -5
- package/dist/module/shared/translation/react-i18next.d.js.map +0 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/helpers.d.ts +0 -15
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/helpers.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/types.d.ts +0 -5
- package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/types.d.ts.map +0 -1
- package/dist/typescript/commonjs/shared/translation/i18n.d.ts +0 -7
- package/dist/typescript/commonjs/shared/translation/i18n.d.ts.map +0 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/helpers.d.ts +0 -15
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/helpers.d.ts.map +0 -1
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/types.d.ts +0 -5
- package/dist/typescript/module/features/keyboard/components/AlgebraLayout/types.d.ts.map +0 -1
- package/dist/typescript/module/shared/translation/i18n.d.ts +0 -7
- package/dist/typescript/module/shared/translation/i18n.d.ts.map +0 -1
- package/src/features/keyboard/components/AlgebraLayout/helpers.tsx +0 -52
- package/src/features/keyboard/components/AlgebraLayout/types.ts +0 -4
- package/src/shared/translation/i18n.d.ts +0 -21
- package/src/shared/translation/i18n.ts +0 -17
- package/src/shared/translation/react-i18next.d.ts +0 -21
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const { getDefaultConfig } = require('@expo/metro-config');
|
|
3
|
+
const { getConfig } = require('react-native-builder-bob/metro-config');
|
|
4
|
+
const pkg = require('../package.json');
|
|
5
|
+
|
|
6
|
+
const root = path.resolve(__dirname, '..');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Metro configuration
|
|
10
|
+
* https://facebook.github.io/metro/docs/configuration
|
|
11
|
+
*
|
|
12
|
+
* @type {import('metro-config').MetroConfig}
|
|
13
|
+
*/
|
|
14
|
+
module.exports = getConfig(getDefaultConfig(__dirname), {
|
|
15
|
+
root,
|
|
16
|
+
pkg,
|
|
17
|
+
project: __dirname,
|
|
18
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@magmamath/students-features-example",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "expo start",
|
|
7
|
+
"android": "expo start --android",
|
|
8
|
+
"ios": "expo start --ios",
|
|
9
|
+
"web": "expo start --web"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@expo/metro-runtime": "~4.0.0",
|
|
13
|
+
"expo": "~52.0.11",
|
|
14
|
+
"expo-status-bar": "~2.0.0",
|
|
15
|
+
"react": "18.3.1",
|
|
16
|
+
"react-dom": "18.3.1",
|
|
17
|
+
"react-native": "0.76.3",
|
|
18
|
+
"react-native-web": "~0.19.13"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@babel/core": "^7.20.0",
|
|
22
|
+
"react-native-builder-bob": "^0.33.3"
|
|
23
|
+
},
|
|
24
|
+
"private": true
|
|
25
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magmamath/students-features",
|
|
3
|
-
"version": "1.3.3
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Magmamath features library",
|
|
5
5
|
"source": "src/index.ts",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"clean": "del-cli dist",
|
|
17
17
|
"prepare": "bob build",
|
|
18
|
-
"release": "release-it"
|
|
19
|
-
"pull-translations": "node scripts/pullTranslations.mjs"
|
|
18
|
+
"release": "release-it"
|
|
20
19
|
},
|
|
21
20
|
"peerDependencies": {
|
|
22
21
|
"@magmamath/frontend-config": "1.1.0",
|
|
@@ -33,9 +32,7 @@
|
|
|
33
32
|
"expo-audio": "^1.1.1",
|
|
34
33
|
"expo": ">=52.0.47",
|
|
35
34
|
"@react-native-masked-view/masked-view": "*",
|
|
36
|
-
"react-native-linear-gradient": "*"
|
|
37
|
-
"i18next": ">=22",
|
|
38
|
-
"react-i18next": ">=11"
|
|
35
|
+
"react-native-linear-gradient": "*"
|
|
39
36
|
},
|
|
40
37
|
"devDependencies": {
|
|
41
38
|
"@magmamath/react-native-ui": "0.4.83",
|
|
@@ -66,9 +63,7 @@
|
|
|
66
63
|
"typescript": "^5.2.2",
|
|
67
64
|
"axios": "^1.13.5",
|
|
68
65
|
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
69
|
-
"react-native-linear-gradient": "^2.8.3"
|
|
70
|
-
"i18next": "^22.5.1",
|
|
71
|
-
"react-i18next": "^11.3.4"
|
|
66
|
+
"react-native-linear-gradient": "^2.8.3"
|
|
72
67
|
},
|
|
73
68
|
"resolutions": {
|
|
74
69
|
"@types/react": "^18.2.44"
|
|
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'
|
|
|
4
4
|
import { ColorScheme } from '../../../types/style.types'
|
|
5
5
|
import { HintButtonVariant, RequestHintButton } from '../RequestHintButton'
|
|
6
6
|
import { useChatModel } from '../../../context/ChatBotModelContext'
|
|
7
|
-
import {
|
|
7
|
+
import { t } from '../../../../../shared/translation'
|
|
8
8
|
import { ChatTextInput } from './ChatTextInput'
|
|
9
9
|
|
|
10
10
|
type FreeTextInputBlockProps = {
|
|
@@ -5,7 +5,7 @@ import { useStoreMap, useUnit } from 'effector-react'
|
|
|
5
5
|
import { StyleSheet } from 'react-native'
|
|
6
6
|
import { HighlighterIcon } from '../../../shared/icons/HighlighterIcon'
|
|
7
7
|
import { ConversationMessage } from '../types/units.types'
|
|
8
|
-
import { useText } from '../../../shared/translation
|
|
8
|
+
import { useText } from '../../../shared/translation'
|
|
9
9
|
|
|
10
10
|
type ErrorSpottingButtonProps = {
|
|
11
11
|
contextMessage: ConversationMessage
|
|
@@ -2,7 +2,7 @@ import { IS_WEB } from '@magmamath/react-native-ui'
|
|
|
2
2
|
// https://stackoverflow.com/questions/56575859/google-translate-api-does-not-return-apostrophe-as-apostrophe-in-python
|
|
3
3
|
import { KATEX_REPLACEMENTS, KATEX_REPLACEMENTS_REVERSE } from './constants'
|
|
4
4
|
import { GetAlternativesResponse, PostMessagePayload } from './types/api.types'
|
|
5
|
-
import {
|
|
5
|
+
import { t } from '../../shared/translation'
|
|
6
6
|
import { ThreadItem } from './model/ThreadItem'
|
|
7
7
|
import { ChatRequestPayload, ChatRequestType } from './types/model.types'
|
|
8
8
|
|
|
@@ -65,6 +65,7 @@ export function prepareChatRequestPayload(
|
|
|
65
65
|
imageAltText,
|
|
66
66
|
answerOptions,
|
|
67
67
|
answer,
|
|
68
|
+
chatHistory,
|
|
68
69
|
} = payload
|
|
69
70
|
|
|
70
71
|
if (freeTextMessage) {
|
|
@@ -86,6 +87,7 @@ export function prepareChatRequestPayload(
|
|
|
86
87
|
language,
|
|
87
88
|
...(imageCdnId && { imageCdnId }),
|
|
88
89
|
...(imageAltText && { altText: imageAltText }),
|
|
90
|
+
...(chatHistory && { chatHistory }),
|
|
89
91
|
...(!!problemStandards?.length && { problemStandards }),
|
|
90
92
|
...(!!answerOptions?.length && { answerOptions }),
|
|
91
93
|
},
|
|
@@ -7,7 +7,15 @@ export {
|
|
|
7
7
|
type IChatDrawBoardAdapter,
|
|
8
8
|
} from './types/model.types'
|
|
9
9
|
export type { RequestOptionalConfig } from '../../lib/effector/createControllerEffect'
|
|
10
|
-
export type {
|
|
10
|
+
export type {
|
|
11
|
+
PostMessageResponse,
|
|
12
|
+
ChatHintPayload,
|
|
13
|
+
ChatHintResponse,
|
|
14
|
+
GetAlternativesPayload,
|
|
15
|
+
GetAlternativesResponse,
|
|
16
|
+
SendMessagePayload,
|
|
17
|
+
SendMessageResponse,
|
|
18
|
+
} from './types/api.types'
|
|
11
19
|
export { DefaultMessagesCreator } from './model/DefaultMessageCreator'
|
|
12
20
|
export type { ChatAnswer } from './types/units.types'
|
|
13
21
|
export type { ConversationMessage } from './types/units.types'
|
|
@@ -234,15 +234,6 @@ export class ChatbotModel {
|
|
|
234
234
|
messages: [messagesHelper.createOwn({ message, translatedMessage })],
|
|
235
235
|
})
|
|
236
236
|
|
|
237
|
-
const chatHistory =
|
|
238
|
-
context.assignmentId && context.problemId
|
|
239
|
-
? {
|
|
240
|
-
exerciseId: context.assignmentId,
|
|
241
|
-
problemId: context.problemId,
|
|
242
|
-
chatVersion: alternatives?.version,
|
|
243
|
-
}
|
|
244
|
-
: undefined
|
|
245
|
-
|
|
246
237
|
// Request is overridden by ThreadManager.postMessage (delegates to sendMessage/getHint)
|
|
247
238
|
const response = await this.api.postMessageFx({
|
|
248
239
|
answer: context.answer,
|
|
@@ -254,8 +245,14 @@ export class ChatbotModel {
|
|
|
254
245
|
imageAltText: context.imageDescription,
|
|
255
246
|
imageCdnId: context.imageCdnId,
|
|
256
247
|
conversationId: cache[key].conversationId,
|
|
257
|
-
chatHistory,
|
|
258
248
|
...(isFreeText && { freeTextMessage: message }),
|
|
249
|
+
...(context.assignmentId && {
|
|
250
|
+
chatHistory: {
|
|
251
|
+
exerciseId: context.assignmentId,
|
|
252
|
+
problemId: context.problemId,
|
|
253
|
+
chatVersion: alternatives?.version,
|
|
254
|
+
},
|
|
255
|
+
}),
|
|
259
256
|
})
|
|
260
257
|
|
|
261
258
|
const thread = this.threadManager.get(key)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { DefaultMessagesCreator } from './DefaultMessageCreator'
|
|
2
|
+
import { TranslationKeys } from '../../../shared/translation/types'
|
|
3
|
+
import { getText } from '../../../shared/translation/helpers'
|
|
2
4
|
import { ChatbotMessages } from '../types/model.types'
|
|
3
|
-
import {
|
|
5
|
+
import { $localization } from '../../../shared/translation'
|
|
4
6
|
|
|
5
7
|
export class ChatBotTextManager {
|
|
6
8
|
private readonly messagesCreator = new DefaultMessagesCreator<TranslationKeys>({
|
|
7
9
|
textGetter: getText,
|
|
8
|
-
}).bindToLanguageChanged()
|
|
10
|
+
}).bindToLanguageChanged($localization.updates)
|
|
9
11
|
|
|
10
12
|
public readonly messages: ChatbotMessages = {
|
|
11
13
|
error: this.messagesCreator.createMessage('chat.errorMessage', {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import i18next from 'i18next'
|
|
2
1
|
import { PostMessageResponse } from '../types/api.types'
|
|
2
|
+
import { Event } from 'effector'
|
|
3
3
|
import { ChatAnswer } from '../types/units.types'
|
|
4
4
|
|
|
5
5
|
type ChatMessage = Omit<PostMessageResponse, 'threadId'> & {
|
|
@@ -45,8 +45,8 @@ export class DefaultMessagesCreator<K extends string> {
|
|
|
45
45
|
return option
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
public bindToLanguageChanged() {
|
|
49
|
-
|
|
48
|
+
public bindToLanguageChanged(event: Event<unknown>) {
|
|
49
|
+
event.watch(() => {
|
|
50
50
|
this.list.forEach((key, chatMessage) => {
|
|
51
51
|
if ('message' in chatMessage) {
|
|
52
52
|
chatMessage.message = this.getter(key)
|
|
@@ -30,14 +30,15 @@ export type GetAlternativesResponse = {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export type SendMessagePayload = {
|
|
33
|
+
message: string
|
|
33
34
|
problemDescription?: string
|
|
34
35
|
problemStandards?: ProblemStandard[]
|
|
35
36
|
correctAnswer?: string | string[]
|
|
36
37
|
answerOptions?: string[]
|
|
37
38
|
altText?: string
|
|
38
39
|
language?: string
|
|
39
|
-
message: string
|
|
40
40
|
conversationId?: string
|
|
41
|
+
chatHistory?: ChatHistory
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
export type SendMessageResponse = {
|
|
@@ -45,6 +46,12 @@ export type SendMessageResponse = {
|
|
|
45
46
|
conversationId?: string | null
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
export type ChatHistory = {
|
|
50
|
+
exerciseId: string
|
|
51
|
+
problemId?: string
|
|
52
|
+
chatVersion?: string
|
|
53
|
+
}
|
|
54
|
+
|
|
48
55
|
export type PostMessagePayload = {
|
|
49
56
|
language: string
|
|
50
57
|
problemAnswer: string[]
|
|
@@ -56,11 +63,7 @@ export type PostMessagePayload = {
|
|
|
56
63
|
imageCdnId?: string
|
|
57
64
|
freeTextMessage?: string
|
|
58
65
|
conversationId?: string | null
|
|
59
|
-
chatHistory?:
|
|
60
|
-
exerciseId: string
|
|
61
|
-
problemId: string
|
|
62
|
-
chatVersion?: string
|
|
63
|
-
}
|
|
66
|
+
chatHistory?: ChatHistory
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
export type PostMessageResponse = {
|
|
@@ -134,6 +137,7 @@ export type ChatHintResponse = {
|
|
|
134
137
|
errorCellIds?: string[]
|
|
135
138
|
errorChars?: ErrorChar[]
|
|
136
139
|
}
|
|
140
|
+
|
|
137
141
|
export type ErrorSpottingPayload = {
|
|
138
142
|
strokes: FullStrokeData[]
|
|
139
143
|
problemDescription: string
|
|
@@ -141,6 +145,7 @@ export type ErrorSpottingPayload = {
|
|
|
141
145
|
userAnswer: string | string[]
|
|
142
146
|
hint: string
|
|
143
147
|
}
|
|
148
|
+
|
|
144
149
|
export type ErrorSpottingResponse = {
|
|
145
150
|
highlightedStrokeIds: string[]
|
|
146
151
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { StyleSheet, View } from 'react-native'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { COLORS, HeadingVariants, IS_WEB, SPACING, Typography } from '@magmamath/react-native-ui'
|
|
4
|
+
import { useUnit } from 'effector-react'
|
|
5
|
+
import { $localization } from '../../../shared/translation'
|
|
4
6
|
import { ExampleSolutionModalParams } from '../types'
|
|
5
7
|
import { QuestionSection } from './QuestionSection'
|
|
6
8
|
import { SolutionSection } from './SolutionSection'
|
|
7
9
|
import { useExampleSolution } from '../hooks/useExampleSolution'
|
|
8
|
-
import { useText } from '../../../shared/translation/i18n'
|
|
9
10
|
|
|
10
11
|
type ExampleSolutionModalContentProps = {
|
|
11
12
|
params: ExampleSolutionModalParams
|
|
@@ -17,7 +18,7 @@ export const ExampleSolutionModalContent = ({
|
|
|
17
18
|
params: { model, payload, cacheKey },
|
|
18
19
|
}: ExampleSolutionModalContentProps) => {
|
|
19
20
|
const { result, status } = useExampleSolution({ model, payload, cacheKey })
|
|
20
|
-
const
|
|
21
|
+
const localization = useUnit($localization)
|
|
21
22
|
|
|
22
23
|
return (
|
|
23
24
|
<View
|
|
@@ -27,7 +28,7 @@ export const ExampleSolutionModalContent = ({
|
|
|
27
28
|
]}
|
|
28
29
|
>
|
|
29
30
|
<Typography align="center" variant={HeadingVariants.H2} style={{ color: COLORS.NEUTRAL_9 }}>
|
|
30
|
-
{
|
|
31
|
+
{localization.exampleSolution.exampleSolution}
|
|
31
32
|
</Typography>
|
|
32
33
|
<View style={styles.content}>
|
|
33
34
|
<QuestionSection
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createControllerEffect } from './../../../lib/effector/createControllerEffect'
|
|
2
2
|
import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { $localization } from '../../../shared/translation'
|
|
4
|
+
import { createEffect, sample, attach, StoreValue } from 'effector'
|
|
5
5
|
|
|
6
6
|
type ExampleSolutionApiProps = {
|
|
7
7
|
api: ExampleSolutionApiRequests
|
|
@@ -12,9 +12,13 @@ export class ExampleSolutionsApi {
|
|
|
12
12
|
public readonly generateExampleSolutionFx
|
|
13
13
|
public readonly errorHandlerFx?: ExampleSolutionErrorHandler
|
|
14
14
|
|
|
15
|
-
public readonly errorHandlingFx =
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
public readonly errorHandlingFx = attach({
|
|
16
|
+
source: $localization,
|
|
17
|
+
effect: createEffect((localization: StoreValue<typeof $localization>) => {
|
|
18
|
+
if (!this.errorHandlerFx) return
|
|
19
|
+
const errorMessage = localization.exampleSolution.errorMessage
|
|
20
|
+
this.errorHandlerFx(errorMessage)
|
|
21
|
+
}),
|
|
18
22
|
})
|
|
19
23
|
|
|
20
24
|
constructor({ api, errorHandler }: ExampleSolutionApiProps) {
|
|
@@ -2,7 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import { StyleSheet, Text, View } from 'react-native'
|
|
3
3
|
import { COLORS } from '@magmamath/react-native-ui'
|
|
4
4
|
import { BUENOS_AIRES_FONT } from '../constants'
|
|
5
|
-
import { useText } from '../../../shared/translation
|
|
5
|
+
import { useText } from '../../../shared/translation'
|
|
6
6
|
|
|
7
7
|
export const EmptyComment = () => {
|
|
8
8
|
const t = useText()
|
|
@@ -2,7 +2,7 @@ import { createEvent, restore, sample, Store } from 'effector'
|
|
|
2
2
|
import { AddCommentProps, CommentsMap, Credits, DeleteCommentProps, TeacherComment } from '../types'
|
|
3
3
|
import { TeacherFeedbackAPI } from './api'
|
|
4
4
|
import { updateCommentsState } from '../helpers'
|
|
5
|
-
import { getText } from '../../../shared/translation/
|
|
5
|
+
import { getText } from '../../../shared/translation/helpers'
|
|
6
6
|
import { EMPTY_COMMENT } from '@magmamath/students-features'
|
|
7
7
|
|
|
8
8
|
type TeacherCommentsModelProps = {
|
|
@@ -3,7 +3,7 @@ import React, { useLayoutEffect, useState } from 'react'
|
|
|
3
3
|
import { BORDER_RADIUS, COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui'
|
|
4
4
|
import { CustomGetCachePathMethod, GifObject, TextComponentType } from '../types/model.types'
|
|
5
5
|
import { MAX_GIF_SIZE, MIN_GIF_SIZE } from '../constants'
|
|
6
|
-
import { useText } from '../../../shared/translation
|
|
6
|
+
import { useText } from '../../../shared/translation'
|
|
7
7
|
import { constrainDimension, getGifLabel, getImagePath } from '../helpers'
|
|
8
8
|
import gifFallback from '../assets/gifFallback.gif'
|
|
9
9
|
import { Size } from '../../../types/common.types'
|
|
@@ -1,77 +1,21 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
3
|
-
import { StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
4
|
-
import { COLORS, IS_MOBILE, SelectGroup, SelectOptionSize } from '@magmamath/react-native-ui'
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
5
3
|
import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
4
|
+
import { AlgebraIcon } from '../../../../shared/icons/AlgebraIcon'
|
|
5
|
+
import { IntegralABIcon } from '../../../../shared/icons/IntegralABIcon'
|
|
6
|
+
import { SwitchableLayout } from '../SwitchableLayout/SwitchableLayout'
|
|
7
|
+
import { SwitchableLayoutConfig } from '../SwitchableLayout/types'
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const algebra = getMainKeyboardGroup(keys, KeyboardType.AlgebraAdvanced)
|
|
20
|
-
const basic = getMainKeyboardGroup(
|
|
21
|
-
keys,
|
|
22
|
-
isDesktop ? KeyboardType.BasicPlusPlus : KeyboardType.BasicPlusPlusMobile,
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
return new Map([
|
|
26
|
-
[SelectedLayout.BASIC, basic],
|
|
27
|
-
[SelectedLayout.ALGEBRA, algebra],
|
|
28
|
-
])
|
|
29
|
-
}, [isDesktop, keys])
|
|
30
|
-
|
|
31
|
-
const currentKeys = keyboardGroups.get(selectedLayout)?.keys ?? []
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<View style={styles.container}>
|
|
35
|
-
{isDesktop && (
|
|
36
|
-
<SelectGroup
|
|
37
|
-
numOfRows={2}
|
|
38
|
-
options={selectOptions}
|
|
39
|
-
size={SelectOptionSize.SMALL}
|
|
40
|
-
style={{
|
|
41
|
-
container: styles.optionContainer,
|
|
42
|
-
option: { container: styles.option },
|
|
43
|
-
}}
|
|
44
|
-
color={props.color}
|
|
45
|
-
selectedOptions={[
|
|
46
|
-
selectedLayout === SelectedLayout.BASIC ? selectOptions[0] : selectOptions[1],
|
|
47
|
-
]}
|
|
48
|
-
/>
|
|
49
|
-
)}
|
|
50
|
-
<KeysList keys={currentKeys} numOfRows={3} {...props} />
|
|
51
|
-
</View>
|
|
52
|
-
)
|
|
9
|
+
const ALGEBRA_CONFIG: SwitchableLayoutConfig = {
|
|
10
|
+
secondaryKeyboardType: KeyboardType.AlgebraAdvanced,
|
|
11
|
+
BasicIcon: (isSelected) => (
|
|
12
|
+
<AlgebraIcon color={isSelected ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} size={22} />
|
|
13
|
+
),
|
|
14
|
+
SecondaryIcon: (isSelected) => (
|
|
15
|
+
<IntegralABIcon color={isSelected ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} size={25} />
|
|
16
|
+
),
|
|
53
17
|
}
|
|
54
18
|
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
flexDirection: 'row',
|
|
59
|
-
gap: 16,
|
|
60
|
-
paddingRight: 16,
|
|
61
|
-
},
|
|
62
|
-
optionContainer: {
|
|
63
|
-
flexGrow: 0,
|
|
64
|
-
flexShrink: 0,
|
|
65
|
-
flexBasis: IS_MOBILE ? 60 : 'auto',
|
|
66
|
-
width: 'auto',
|
|
67
|
-
paddingRight: 18,
|
|
68
|
-
borderRightWidth: 1,
|
|
69
|
-
borderRightColor: COLORS.NEUTRAL_3,
|
|
70
|
-
maxWidth: 65,
|
|
71
|
-
gap: 9,
|
|
72
|
-
},
|
|
73
|
-
option: {
|
|
74
|
-
flexBasis: 45,
|
|
75
|
-
width: 44,
|
|
76
|
-
},
|
|
77
|
-
})
|
|
19
|
+
export const AlgebraLayout = (props: KeyboardLayoutProps) => {
|
|
20
|
+
return <SwitchableLayout {...props} config={ALGEBRA_CONFIG} />
|
|
21
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { COLORS } from '@magmamath/react-native-ui'
|
|
3
|
+
import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
|
|
4
|
+
import { AlgebraIcon } from '../../../../shared/icons/AlgebraIcon'
|
|
5
|
+
import { GeometryIcon } from '../../../../shared/icons/GeometryIcon'
|
|
6
|
+
import { SwitchableLayout } from '../SwitchableLayout/SwitchableLayout'
|
|
7
|
+
import { SwitchableLayoutConfig } from '../SwitchableLayout/types'
|
|
8
|
+
|
|
9
|
+
const GEOMETRY_CONFIG: SwitchableLayoutConfig = {
|
|
10
|
+
secondaryKeyboardType: KeyboardType.Geometry,
|
|
11
|
+
BasicIcon: (isSelected) => (
|
|
12
|
+
<AlgebraIcon color={isSelected ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} size={22} />
|
|
13
|
+
),
|
|
14
|
+
SecondaryIcon: (isSelected) => (
|
|
15
|
+
<GeometryIcon color={isSelected ? COLORS.NEUTRAL_1 : COLORS.NEUTRAL_9} size={16} />
|
|
16
|
+
),
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const GeometryLayout = (props: KeyboardLayoutProps) => {
|
|
20
|
+
return <SwitchableLayout {...props} config={GEOMETRY_CONFIG} />
|
|
21
|
+
}
|
|
@@ -3,7 +3,7 @@ import { KeysList } from '../KeysList/KeysList'
|
|
|
3
3
|
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
|
|
4
4
|
import { SPACING } from '@magmamath/react-native-ui'
|
|
5
5
|
import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
|
|
6
|
-
import { useText } from '../../../../shared/translation
|
|
6
|
+
import { useText } from '../../../../shared/translation'
|
|
7
7
|
import { getMainKeyboardGroup } from '../../helpers'
|
|
8
8
|
|
|
9
9
|
type NumpadProps = {
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react'
|
|
2
|
+
import { KeysList } from '../KeysList/KeysList'
|
|
3
|
+
import { StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
4
|
+
import {
|
|
5
|
+
COLORS,
|
|
6
|
+
IS_MOBILE,
|
|
7
|
+
SelectGroup,
|
|
8
|
+
SelectOptionSize,
|
|
9
|
+
SPACING,
|
|
10
|
+
} from '@magmamath/react-native-ui'
|
|
11
|
+
import { KeyboardType } from '../../types/types'
|
|
12
|
+
import { SelectedLayout, SwitchableLayoutProps } from './types'
|
|
13
|
+
import { getMainKeyboardGroup } from '../../helpers'
|
|
14
|
+
import { getSelectOptions } from './helpers'
|
|
15
|
+
import { KEYBOARD_LAYOUTS } from '../../constants/keyboardLayouts'
|
|
16
|
+
|
|
17
|
+
export const SwitchableLayout = ({
|
|
18
|
+
onLayoutChange,
|
|
19
|
+
keys,
|
|
20
|
+
config,
|
|
21
|
+
...props
|
|
22
|
+
}: SwitchableLayoutProps) => {
|
|
23
|
+
const [selectedLayout, setSelectedLayout] = useState<SelectedLayout>(SelectedLayout.BASIC)
|
|
24
|
+
const { width } = useWindowDimensions()
|
|
25
|
+
const selectOptions = getSelectOptions({
|
|
26
|
+
selectedLayout,
|
|
27
|
+
onBasicPressIn: () => {
|
|
28
|
+
setSelectedLayout(SelectedLayout.BASIC)
|
|
29
|
+
onLayoutChange?.(false)
|
|
30
|
+
},
|
|
31
|
+
onSecondaryPressIn: () => {
|
|
32
|
+
setSelectedLayout(SelectedLayout.SECONDARY)
|
|
33
|
+
onLayoutChange?.(true)
|
|
34
|
+
},
|
|
35
|
+
BasicIcon: config.BasicIcon,
|
|
36
|
+
SecondaryIcon: config.SecondaryIcon,
|
|
37
|
+
})
|
|
38
|
+
const isDesktop =
|
|
39
|
+
width > KEYBOARD_LAYOUTS[config.secondaryKeyboardType].mobileBreakpoint && !IS_MOBILE
|
|
40
|
+
|
|
41
|
+
const keyboardGroups = useMemo(() => {
|
|
42
|
+
const secondary = getMainKeyboardGroup(keys, config.secondaryKeyboardType)
|
|
43
|
+
const basic = getMainKeyboardGroup(
|
|
44
|
+
keys,
|
|
45
|
+
isDesktop ? KeyboardType.BasicPlusPlus : KeyboardType.BasicPlusPlusMobile,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return new Map([
|
|
49
|
+
[SelectedLayout.BASIC, basic],
|
|
50
|
+
[SelectedLayout.SECONDARY, secondary],
|
|
51
|
+
])
|
|
52
|
+
}, [isDesktop, keys, config.secondaryKeyboardType])
|
|
53
|
+
|
|
54
|
+
const currentKeys = keyboardGroups.get(selectedLayout)?.keys ?? []
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<View style={styles.container}>
|
|
58
|
+
{isDesktop && (
|
|
59
|
+
<SelectGroup
|
|
60
|
+
numOfRows={2}
|
|
61
|
+
options={selectOptions}
|
|
62
|
+
size={SelectOptionSize.SMALL}
|
|
63
|
+
style={{
|
|
64
|
+
container: styles.optionContainer,
|
|
65
|
+
option: { container: styles.option },
|
|
66
|
+
}}
|
|
67
|
+
color={props.color}
|
|
68
|
+
selectedOptions={[
|
|
69
|
+
selectedLayout === SelectedLayout.BASIC ? selectOptions[0] : selectOptions[1],
|
|
70
|
+
]}
|
|
71
|
+
/>
|
|
72
|
+
)}
|
|
73
|
+
<KeysList keys={currentKeys} numOfRows={3} {...props} />
|
|
74
|
+
</View>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
container: {
|
|
80
|
+
display: 'flex',
|
|
81
|
+
flexDirection: 'row',
|
|
82
|
+
gap: SPACING[400],
|
|
83
|
+
paddingRight: SPACING[400],
|
|
84
|
+
},
|
|
85
|
+
optionContainer: {
|
|
86
|
+
flexGrow: 0,
|
|
87
|
+
flexShrink: 0,
|
|
88
|
+
flexBasis: IS_MOBILE ? 60 : 'auto',
|
|
89
|
+
width: 'auto',
|
|
90
|
+
paddingRight: 18,
|
|
91
|
+
borderRightWidth: 1,
|
|
92
|
+
borderRightColor: COLORS.NEUTRAL_3,
|
|
93
|
+
maxWidth: 65,
|
|
94
|
+
gap: 9,
|
|
95
|
+
},
|
|
96
|
+
option: {
|
|
97
|
+
flexBasis: 45,
|
|
98
|
+
width: 44,
|
|
99
|
+
},
|
|
100
|
+
})
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react'
|
|
2
|
+
import { SelectedLayout, LayoutOption } from './types'
|
|
3
|
+
|
|
4
|
+
type GetSelectOptionsProps = {
|
|
5
|
+
selectedLayout: SelectedLayout
|
|
6
|
+
onBasicPressIn: () => void
|
|
7
|
+
onSecondaryPressIn: () => void
|
|
8
|
+
BasicIcon: (isSelected: boolean) => ReactNode
|
|
9
|
+
SecondaryIcon: (isSelected: boolean) => ReactNode
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function getSelectOptions({
|
|
13
|
+
selectedLayout,
|
|
14
|
+
onBasicPressIn,
|
|
15
|
+
onSecondaryPressIn,
|
|
16
|
+
BasicIcon,
|
|
17
|
+
SecondaryIcon,
|
|
18
|
+
}: GetSelectOptionsProps): LayoutOption[] {
|
|
19
|
+
return [
|
|
20
|
+
{
|
|
21
|
+
key: SelectedLayout.BASIC,
|
|
22
|
+
title: BasicIcon(selectedLayout === SelectedLayout.BASIC),
|
|
23
|
+
onPressIn: onBasicPressIn,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: SelectedLayout.SECONDARY,
|
|
27
|
+
title: SecondaryIcon(selectedLayout === SelectedLayout.SECONDARY),
|
|
28
|
+
onPressIn: onSecondaryPressIn,
|
|
29
|
+
},
|
|
30
|
+
]
|
|
31
|
+
}
|