@magmamath/students-features 0.9.9 → 0.9.14-rc.10
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/.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/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025,_13_10_[Changes]/shelved.patch +18 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025,_13_11_[Changes]/shelved.patch +19 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025__13_10__Changes_.xml +4 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025__13_11__Changes_.xml +4 -0
- package/.idea/students-features.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +643 -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/celebrations/helpers.js +4 -1
- package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
- 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/model/ChatBotModel.js +8 -6
- package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/commonjs/features/chatbot/model/t2s.js +4 -3
- package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
- package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +3 -2
- package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/commonjs/features/feedback/model/model.js.map +1 -1
- package/dist/commonjs/features/feedback/model/sockets.js +8 -5
- package/dist/commonjs/features/feedback/model/sockets.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.js +5 -1
- package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/Keyboard.js +24 -9
- package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/{MainLayout.js → MainLayout/MainLayout.js} +9 -7
- package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/{constants.js → MainLayout/constants.js} +7 -2
- package/dist/commonjs/features/keyboard/components/MainLayout/constants.js.map +1 -0
- package/dist/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js +3 -2
- package/dist/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.js +2 -1
- package/dist/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js +2 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js +3 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +26 -6
- package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +1 -0
- package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js +22 -1
- package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +7 -0
- package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -30
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js +27 -0
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -3
- package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/commonjs/features/keyboard/types/keyboardGroupIds.js +1 -0
- package/dist/commonjs/features/keyboard/types/keyboardGroupIds.js.map +1 -1
- package/dist/commonjs/lib/helpers/helpers.js +28 -5
- package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
- package/dist/commonjs/lib/types/requests.js +2 -0
- package/dist/commonjs/lib/types/requests.js.map +1 -0
- package/dist/commonjs/shared/icons/TimeIcon.js +37 -0
- package/dist/commonjs/shared/icons/TimeIcon.js.map +1 -0
- package/dist/commonjs/shared/translation/constants.js +3 -1
- package/dist/commonjs/shared/translation/constants.js.map +1 -1
- package/dist/commonjs/shared/translation/localization/ca.json +7 -6
- package/dist/commonjs/shared/translation/localization/de.json +43 -0
- package/dist/commonjs/shared/translation/localization/en.json +7 -6
- package/dist/commonjs/shared/translation/localization/gb.json +7 -6
- package/dist/commonjs/shared/translation/localization/sct.json +7 -6
- package/dist/commonjs/shared/translation/localization/sw.json +7 -6
- package/dist/commonjs/shared/translation/types.js +1 -0
- package/dist/commonjs/shared/translation/types.js.map +1 -1
- package/dist/module/features/celebrations/helpers.js +4 -1
- package/dist/module/features/celebrations/helpers.js.map +1 -1
- 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/model/ChatBotModel.js +8 -6
- package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
- package/dist/module/features/chatbot/model/t2s.js +4 -3
- package/dist/module/features/chatbot/model/t2s.js.map +1 -1
- package/dist/module/features/chatbot/types/model.types.js.map +1 -1
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +3 -2
- package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
- package/dist/module/features/feedback/model/model.js.map +1 -1
- package/dist/module/features/feedback/model/sockets.js +8 -5
- package/dist/module/features/feedback/model/sockets.js.map +1 -1
- package/dist/module/features/keyboard/components/BasicLayout/keyboardGroups.js +4 -0
- package/dist/module/features/keyboard/components/BasicLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/Keyboard.js +23 -8
- package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
- package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
- package/dist/module/features/keyboard/components/{MainLayout.js → MainLayout/MainLayout.js} +9 -7
- package/dist/module/features/keyboard/components/MainLayout/MainLayout.js.map +1 -0
- package/dist/module/features/keyboard/components/{constants.js → MainLayout/constants.js} +6 -1
- package/dist/module/features/keyboard/components/MainLayout/constants.js.map +1 -0
- package/dist/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js +3 -2
- package/dist/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.js +2 -1
- package/dist/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js +2 -1
- package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/helpers.js +2 -1
- package/dist/module/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +26 -6
- package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
- package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
- package/dist/module/features/keyboard/components/UnitsLayout/types.js +1 -0
- package/dist/module/features/keyboard/components/UnitsLayout/types.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js +24 -3
- package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
- package/dist/module/features/keyboard/constants/keyboardLayouts.js +6 -0
- package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -30
- package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js +27 -0
- package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js +18 -3
- package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
- package/dist/module/features/keyboard/types/keyboardGroupIds.js +1 -0
- package/dist/module/features/keyboard/types/keyboardGroupIds.js.map +1 -1
- package/dist/module/lib/helpers/helpers.js +28 -5
- package/dist/module/lib/helpers/helpers.js.map +1 -1
- package/dist/module/lib/types/requests.js +2 -0
- package/dist/module/lib/types/requests.js.map +1 -0
- package/dist/module/shared/icons/TimeIcon.js +29 -0
- package/dist/module/shared/icons/TimeIcon.js.map +1 -0
- package/dist/module/shared/translation/constants.js +3 -1
- package/dist/module/shared/translation/constants.js.map +1 -1
- package/dist/module/shared/translation/localization/ca.json +7 -6
- package/dist/module/shared/translation/localization/de.json +43 -0
- package/dist/module/shared/translation/localization/en.json +7 -6
- package/dist/module/shared/translation/localization/gb.json +7 -6
- package/dist/module/shared/translation/localization/sct.json +7 -6
- package/dist/module/shared/translation/localization/sw.json +7 -6
- package/dist/module/shared/translation/types.js +1 -0
- package/dist/module/shared/translation/types.js.map +1 -1
- package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +8 -7
- package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts +2 -2
- package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +11 -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 +8 -5
- package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts +4 -1
- package/dist/typescript/commonjs/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/feedback/model/sockets.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +3 -2
- package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/{MainLayout.d.ts → MainLayout/MainLayout.d.ts} +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -0
- package/dist/typescript/{module/features/keyboard/components → commonjs/features/keyboard/components/MainLayout}/constants.d.ts +5 -0
- package/dist/typescript/commonjs/features/keyboard/components/MainLayout/constants.d.ts.map +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts +5 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
- package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -18
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.d.ts +18 -0
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
- package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/commonjs/features/keyboard/types/keyboardGroupIds.d.ts +1 -0
- package/dist/typescript/commonjs/features/keyboard/types/keyboardGroupIds.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/commonjs/lib/types/requests.d.ts +4 -0
- package/dist/typescript/commonjs/lib/types/requests.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +4 -0
- package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +1 -0
- package/dist/typescript/commonjs/shared/translation/constants.d.ts +48 -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/commonjs/shared/translation/types.d.ts +2 -1
- package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
- package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +8 -7
- package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts +2 -2
- package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
- package/dist/typescript/module/features/chatbot/types/api.types.d.ts +11 -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 +8 -5
- package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
- package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts +4 -1
- package/dist/typescript/module/features/feedback/model/model.d.ts.map +1 -1
- package/dist/typescript/module/features/feedback/model/sockets.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/BasicLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/components/BasicLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +3 -2
- package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/{MainLayout.d.ts → MainLayout/MainLayout.d.ts} +1 -1
- package/dist/typescript/module/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -0
- package/dist/typescript/{commonjs/features/keyboard/components → module/features/keyboard/components/MainLayout}/constants.d.ts +5 -0
- package/dist/typescript/module/features/keyboard/components/MainLayout/constants.d.ts.map +1 -0
- package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts +5 -1
- package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
- package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -18
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/specialOperators.d.ts +18 -0
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/specialOperators.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
- package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
- package/dist/typescript/module/features/keyboard/types/keyboardGroupIds.d.ts +1 -0
- package/dist/typescript/module/features/keyboard/types/keyboardGroupIds.d.ts.map +1 -1
- package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
- package/dist/typescript/module/lib/types/requests.d.ts +4 -0
- package/dist/typescript/module/lib/types/requests.d.ts.map +1 -0
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts +4 -0
- package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +1 -0
- package/dist/typescript/module/shared/translation/constants.d.ts +48 -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/dist/typescript/module/shared/translation/types.d.ts +2 -1
- package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
- 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/example/yarn.lock +6552 -0
- package/package.json +1 -1
- package/src/features/celebrations/helpers.ts +35 -33
- package/src/features/chatbot/components/Chatbot.tsx +2 -2
- package/src/features/chatbot/model/ChatBotModel.ts +10 -5
- package/src/features/chatbot/model/t2s.ts +3 -2
- package/src/features/chatbot/types/api.types.ts +14 -1
- package/src/features/chatbot/types/model.types.ts +12 -5
- package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +4 -3
- package/src/features/feedback/model/model.ts +4 -1
- package/src/features/feedback/model/sockets.ts +8 -6
- package/src/features/keyboard/components/BasicLayout/keyboardGroups.ts +4 -0
- package/src/features/keyboard/components/Keyboard.tsx +44 -11
- package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -1
- package/src/features/keyboard/components/{MainLayout.tsx → MainLayout/MainLayout.tsx} +6 -7
- package/src/features/keyboard/components/{constants.ts → MainLayout/constants.ts} +6 -1
- package/src/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.tsx +7 -2
- package/src/features/keyboard/components/UnderlinedLayout/keyboardGroups.ts +5 -3
- package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +1 -0
- package/src/features/keyboard/components/UnitsLayout/helpers.tsx +3 -0
- package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +32 -21
- package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +11 -0
- package/src/features/keyboard/components/UnitsLayout/types.ts +7 -0
- package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +23 -0
- package/src/features/keyboard/constants/keyboardLayouts.ts +11 -0
- package/src/features/keyboard/types/MathKeysGroups/basicOperators.tsx +3 -24
- package/src/features/keyboard/types/MathKeysGroups/specialOperators.tsx +21 -0
- package/src/features/keyboard/types/MathKeysGroups/units.tsx +15 -0
- package/src/features/keyboard/types/keyboardGroupIds.ts +1 -0
- package/src/lib/helpers/helpers.ts +23 -8
- package/src/lib/types/requests.ts +1 -0
- package/src/shared/icons/TimeIcon.tsx +23 -0
- package/src/shared/translation/constants.ts +2 -0
- package/src/shared/translation/localization/ca.json +7 -6
- package/src/shared/translation/localization/de.json +43 -0
- package/src/shared/translation/localization/en.json +7 -6
- package/src/shared/translation/localization/gb.json +7 -6
- package/src/shared/translation/localization/sct.json +7 -6
- package/src/shared/translation/localization/sw.json +7 -6
- package/src/shared/translation/types.ts +4 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +34 -0
- package/yarn.lock +8623 -0
- package/dist/commonjs/features/keyboard/components/MainLayout.js.map +0 -1
- package/dist/commonjs/features/keyboard/components/constants.js.map +0 -1
- package/dist/module/features/keyboard/components/MainLayout.js.map +0 -1
- package/dist/module/features/keyboard/components/constants.js.map +0 -1
- package/dist/typescript/commonjs/features/keyboard/components/MainLayout.d.ts.map +0 -1
- package/dist/typescript/commonjs/features/keyboard/components/constants.d.ts.map +0 -1
- package/dist/typescript/module/features/keyboard/components/MainLayout.d.ts.map +0 -1
- package/dist/typescript/module/features/keyboard/components/constants.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import { ParticlesBatch } from './components/ParticleBatch'
|
|
2
|
-
import { Spark } from './components/Spark'
|
|
3
|
-
import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config'
|
|
4
|
-
import { CelebrationVariant } from './types'
|
|
1
|
+
import { ParticlesBatch } from './components/ParticleBatch'
|
|
2
|
+
import { Spark } from './components/Spark'
|
|
3
|
+
import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config'
|
|
4
|
+
import { CelebrationVariant } from './types'
|
|
5
5
|
|
|
6
|
-
export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min
|
|
6
|
+
export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min
|
|
7
7
|
|
|
8
8
|
const isDateInRange = (currentDate: Date, startDateStr: string, endDateStr: string) => {
|
|
9
|
-
const [startDay, startMonth] = startDateStr.split('-').map(Number)
|
|
10
|
-
const [endDay, endMonth] = endDateStr.split('-').map(Number)
|
|
9
|
+
const [startDay, startMonth] = startDateStr.split('-').map(Number)
|
|
10
|
+
const [endDay, endMonth] = endDateStr.split('-').map(Number)
|
|
11
11
|
|
|
12
|
-
const currentYear = currentDate.getFullYear()
|
|
13
|
-
const startDate = new Date(currentYear, startMonth - 1, startDay)
|
|
14
|
-
const endDate = new Date(currentYear, endMonth - 1, endDay + 1);
|
|
12
|
+
const currentYear = currentDate.getFullYear()
|
|
13
|
+
const startDate = new Date(currentYear, startMonth - 1, startDay)
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
// If end month is earlier than start month, it spans to next year
|
|
16
|
+
const endYear = endMonth < startMonth ? currentYear + 1 : currentYear
|
|
17
|
+
const endDate = new Date(endYear, endMonth - 1, endDay + 1)
|
|
18
|
+
|
|
19
|
+
return currentDate >= startDate && currentDate <= endDate
|
|
20
|
+
}
|
|
18
21
|
|
|
19
22
|
export const getIconForCurrentDate = () => {
|
|
20
|
-
const currentDate = new Date()
|
|
23
|
+
const currentDate = new Date()
|
|
21
24
|
|
|
22
25
|
for (const celebration of CELEBRATION_ICON_CONFIG) {
|
|
23
26
|
if (celebration.activePeriod) {
|
|
24
|
-
const { start, end } = celebration.activePeriod
|
|
27
|
+
const { start, end } = celebration.activePeriod
|
|
25
28
|
if (isDateInRange(currentDate, start, end)) {
|
|
26
|
-
return celebration.Icon
|
|
29
|
+
return celebration.Icon
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
return CELEBRATION_ICON_CONFIG[0].Icon
|
|
32
|
-
}
|
|
34
|
+
return CELEBRATION_ICON_CONFIG[0].Icon
|
|
35
|
+
}
|
|
33
36
|
|
|
34
|
-
const MainIcon = getIconForCurrentDate()
|
|
35
|
-
export const generateParticle = (variant: CelebrationVariant
|
|
36
|
-
) => {
|
|
37
|
+
const MainIcon = getIconForCurrentDate()
|
|
38
|
+
export const generateParticle = (variant: CelebrationVariant) => {
|
|
37
39
|
const {
|
|
38
40
|
elementsCount,
|
|
39
41
|
angle,
|
|
@@ -44,20 +46,20 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
44
46
|
friction,
|
|
45
47
|
life,
|
|
46
48
|
angularAcceleration,
|
|
47
|
-
speedRange
|
|
48
|
-
} = CELEBRATION_VARIANTS[variant]
|
|
49
|
+
speedRange,
|
|
50
|
+
} = CELEBRATION_VARIANTS[variant]
|
|
49
51
|
|
|
50
52
|
const sparkSpeedMin = speedRange?.spark?.[0]
|
|
51
53
|
const sparkSpeedMax = speedRange?.spark?.[1]
|
|
52
54
|
const mainSpeedMin = speedRange?.main?.[0]
|
|
53
55
|
const mainSpeedMax = speedRange?.main?.[1]
|
|
54
56
|
|
|
55
|
-
const particles: ParticlesBatch[] = []
|
|
57
|
+
const particles: ParticlesBatch[] = []
|
|
56
58
|
|
|
57
59
|
for (let i = 0; i < elementsCount.spark; i++) {
|
|
58
|
-
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
59
|
-
const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax)
|
|
60
|
-
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
60
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
61
|
+
const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax)
|
|
62
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
61
63
|
|
|
62
64
|
particles.push({
|
|
63
65
|
id: Math.random(),
|
|
@@ -74,12 +76,12 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
74
76
|
friction,
|
|
75
77
|
Component: Spark,
|
|
76
78
|
life,
|
|
77
|
-
})
|
|
79
|
+
})
|
|
78
80
|
}
|
|
79
81
|
for (let i = 0; i < elementsCount.star; i++) {
|
|
80
|
-
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
81
|
-
const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax)
|
|
82
|
-
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
82
|
+
const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
|
|
83
|
+
const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax)
|
|
84
|
+
const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
|
|
83
85
|
|
|
84
86
|
particles.push({
|
|
85
87
|
id: Math.random(),
|
|
@@ -96,8 +98,8 @@ export const generateParticle = (variant: CelebrationVariant
|
|
|
96
98
|
friction,
|
|
97
99
|
Component: MainIcon,
|
|
98
100
|
life,
|
|
99
|
-
})
|
|
101
|
+
})
|
|
100
102
|
}
|
|
101
103
|
|
|
102
|
-
return particles
|
|
103
|
-
}
|
|
104
|
+
return particles
|
|
105
|
+
}
|
|
@@ -30,14 +30,14 @@ export const Chatbot = ({
|
|
|
30
30
|
iconSize,
|
|
31
31
|
colorScheme = ColorScheme.Blue,
|
|
32
32
|
}: ChatbotProps) => {
|
|
33
|
-
const
|
|
33
|
+
const isChatAllowed = useUnit(model.$chatAccess)
|
|
34
34
|
const isAvailable = useStoreMap(model.$currentChatData, ({ isAvailable }) => isAvailable)
|
|
35
35
|
model.t2s.setAudioConfig(textToSpeechConfig ?? null)
|
|
36
36
|
|
|
37
37
|
const openChat = () => model.setIsOpen(true)
|
|
38
38
|
const closeChat = () => model.setIsOpen(false)
|
|
39
39
|
|
|
40
|
-
if (!isAvailable ||
|
|
40
|
+
if (!isAvailable || !isChatAllowed) {
|
|
41
41
|
return null
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
restore,
|
|
8
8
|
sample,
|
|
9
9
|
type Store,
|
|
10
|
+
StoreWritable
|
|
10
11
|
} from 'effector'
|
|
11
12
|
import {
|
|
12
13
|
ChatbotContext,
|
|
@@ -74,14 +75,18 @@ export class ChatbotModel {
|
|
|
74
75
|
|
|
75
76
|
private readonly cache = new ChatsCacheModel()
|
|
76
77
|
|
|
78
|
+
public readonly $chatAccess: StoreWritable<boolean>
|
|
79
|
+
|
|
77
80
|
public readonly $currentChatData = combine(
|
|
78
81
|
{ data: this.cache.$data, key: this.$currentKey },
|
|
79
82
|
({ data, key }) => (data[key] ? { ...data[key], key } : { ...defaultChatData(), key }),
|
|
80
83
|
)
|
|
81
84
|
|
|
82
|
-
constructor({ api, $key, threadMessagesLimit, settings = {} }: ChatbotModelProps) {
|
|
85
|
+
constructor({ api, $key, threadMessagesLimit, settings = {}, chatAccess }: ChatbotModelProps) {
|
|
83
86
|
this.api = new ChatbotAPI({ ...api, postMessage: this.threadManager.postMessage })
|
|
84
87
|
|
|
88
|
+
this.$chatAccess = chatAccess
|
|
89
|
+
|
|
85
90
|
this.threadManager.setApi({ getHint: api.requestHint, sendMessage: api.sendMessage })
|
|
86
91
|
if (threadMessagesLimit) {
|
|
87
92
|
this.threadManager.setMessagesLimit(threadMessagesLimit)
|
|
@@ -145,16 +150,16 @@ export class ChatbotModel {
|
|
|
145
150
|
}
|
|
146
151
|
|
|
147
152
|
this.startConversation = attach({
|
|
148
|
-
source: { currentChatData: this.$currentChatData,
|
|
153
|
+
source: { currentChatData: this.$currentChatData, chatAccess: this.$chatAccess },
|
|
149
154
|
mapParams: (props: StartConversationProps | void, source) => ({
|
|
150
155
|
...props,
|
|
151
156
|
...source,
|
|
152
157
|
}),
|
|
153
158
|
effect: createEffect(
|
|
154
|
-
({ currentChatData,
|
|
159
|
+
({ currentChatData, initOnly, chatAccess }: StartConversationFxData) => {
|
|
155
160
|
const { key, messages } = currentChatData
|
|
156
161
|
|
|
157
|
-
if (!
|
|
162
|
+
if (!chatAccess) return
|
|
158
163
|
|
|
159
164
|
if (messages.length) {
|
|
160
165
|
if (initOnly) return
|
|
@@ -171,7 +176,7 @@ export class ChatbotModel {
|
|
|
171
176
|
|
|
172
177
|
this.api.getAlternativesFx.doneData.watch((alternatives) => {
|
|
173
178
|
// Use short text for another hint option if openChatEnabled
|
|
174
|
-
if (alternatives?.
|
|
179
|
+
if (alternatives?.isOpenChatEnabled && IS_WEB) {
|
|
175
180
|
this.textManager.update((creator) => ({
|
|
176
181
|
anotherHintOption: creator.createOption('chat.giveHintOpenChat'),
|
|
177
182
|
}))
|
|
@@ -86,11 +86,12 @@ export class ChatTextToSpeechModel {
|
|
|
86
86
|
input: { text },
|
|
87
87
|
voice: config?.voice ?? DEFAULT_VOICE,
|
|
88
88
|
audioConfig: config?.audioConfig ?? AUDIO_CONFIG,
|
|
89
|
+
enableTimePointing: [],
|
|
89
90
|
})
|
|
90
91
|
|
|
91
92
|
// Response might be different type based on provided AUDIO_CONFIG
|
|
92
|
-
if (typeof response === 'string') {
|
|
93
|
-
audioPath = `data:audio/mpeg;base64,${response}`
|
|
93
|
+
if (typeof response.audioContent === 'string') {
|
|
94
|
+
audioPath = `data:audio/mpeg;base64,${response.audioContent}`
|
|
94
95
|
} else {
|
|
95
96
|
audioPath = response?.audioContent ?? ''
|
|
96
97
|
}
|
|
@@ -11,6 +11,9 @@ export type AlternativesOptions = {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export type GetAlternativesResponse = {
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated chatAccess depends on assignment.lavaChat or class grade
|
|
16
|
+
*/
|
|
14
17
|
chatAccess?: boolean
|
|
15
18
|
isOpenChatEnabled?: boolean
|
|
16
19
|
version: string
|
|
@@ -56,6 +59,7 @@ export type PostMessageResponse = {
|
|
|
56
59
|
export type GoogleTranslatePayload = {
|
|
57
60
|
text: string[]
|
|
58
61
|
targetLanguage: string
|
|
62
|
+
sourceLanguage?: string
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
export type GoogleTranslateResponse = {
|
|
@@ -77,9 +81,18 @@ export type GoogleText2SpeechPayload = {
|
|
|
77
81
|
pitch: number
|
|
78
82
|
speakingRate: number
|
|
79
83
|
}
|
|
84
|
+
enableTimePointing?: string[]
|
|
80
85
|
}
|
|
81
86
|
|
|
82
|
-
export type
|
|
87
|
+
export type Timepoint = {
|
|
88
|
+
markName: string
|
|
89
|
+
timeSeconds: number
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type GoogleText2SpeechResponse = {
|
|
93
|
+
audioContent?: string
|
|
94
|
+
timepoints?: Timepoint[]
|
|
95
|
+
}
|
|
83
96
|
|
|
84
97
|
export type ChatHintPayload = {
|
|
85
98
|
problemDescription: string
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Store } from 'effector'
|
|
1
|
+
import type { Store, StoreWritable } from 'effector'
|
|
2
2
|
import {
|
|
3
3
|
ChatHintPayload,
|
|
4
4
|
ChatHintResponse,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from './api.types'
|
|
18
18
|
import { ExtendWithOptional } from '../../../lib/helpers/types'
|
|
19
19
|
import { ChatAnswer, ChatItem, ConversationMessage, FullStrokeData } from './units.types'
|
|
20
|
+
import { WithAbortSignal } from '../../../lib/types/requests'
|
|
20
21
|
|
|
21
22
|
export type ChatbotMessages = {
|
|
22
23
|
error: ConversationMessage
|
|
@@ -27,10 +28,14 @@ export type ChatbotMessages = {
|
|
|
27
28
|
|
|
28
29
|
export type ChatbotApiRequests = {
|
|
29
30
|
getAlternatives: (props: GetAlternativesPayload) => Promise<GetAlternativesResponse>
|
|
30
|
-
sendMessage: (props: SendMessagePayload) => Promise<SendMessageResponse>
|
|
31
|
-
postMessage: (props: PostMessagePayload) => Promise<PostMessageResponse>
|
|
32
|
-
postTranslateText: (
|
|
33
|
-
|
|
31
|
+
sendMessage: (props: WithAbortSignal<SendMessagePayload>) => Promise<SendMessageResponse>
|
|
32
|
+
postMessage: (props: WithAbortSignal<PostMessagePayload>) => Promise<PostMessageResponse>
|
|
33
|
+
postTranslateText: (
|
|
34
|
+
props: WithAbortSignal<GoogleTranslatePayload>,
|
|
35
|
+
) => Promise<GoogleTranslateResponse>
|
|
36
|
+
postTextToSpeech: (
|
|
37
|
+
props: WithAbortSignal<GoogleText2SpeechPayload>,
|
|
38
|
+
) => Promise<GoogleText2SpeechResponse>
|
|
34
39
|
/**
|
|
35
40
|
* @deprecated merged with hint
|
|
36
41
|
*/
|
|
@@ -47,6 +52,7 @@ export type ChatbotModelProps = {
|
|
|
47
52
|
requestHint: (props: ChatHintPayload) => Promise<ChatHintResponse>
|
|
48
53
|
}
|
|
49
54
|
threadMessagesLimit?: number
|
|
55
|
+
chatAccess: StoreWritable<boolean>
|
|
50
56
|
settings?: ChatbotSettings
|
|
51
57
|
}
|
|
52
58
|
|
|
@@ -77,6 +83,7 @@ export type StartConversationFxData = {
|
|
|
77
83
|
messages: ConversationMessage[]
|
|
78
84
|
}
|
|
79
85
|
alternatives?: GetAlternativesResponse | null
|
|
86
|
+
chatAccess: boolean
|
|
80
87
|
} & StartConversationProps
|
|
81
88
|
|
|
82
89
|
export enum MessageVariant {
|
|
@@ -11,7 +11,6 @@ import Animated, {
|
|
|
11
11
|
import { ButtonVariant, SPACING, Button, ButtonSize, ButtonColor } from '@magmamath/react-native-ui'
|
|
12
12
|
|
|
13
13
|
import { PracticeButton } from './PracticeButton'
|
|
14
|
-
import { getEoaButtonColor } from '../helpers'
|
|
15
14
|
|
|
16
15
|
type PracticeButtonGroupProps = {
|
|
17
16
|
textContent: { leftButtonText?: string; rightButtonText?: string }
|
|
@@ -21,6 +20,8 @@ type PracticeButtonGroupProps = {
|
|
|
21
20
|
buttonColor?: ButtonColor
|
|
22
21
|
}
|
|
23
22
|
|
|
23
|
+
const APPEARANCE_DELAY = 1600
|
|
24
|
+
|
|
24
25
|
export const PracticeButtonGroup = ({
|
|
25
26
|
textContent,
|
|
26
27
|
isPracticeButtonVisible,
|
|
@@ -31,7 +32,7 @@ export const PracticeButtonGroup = ({
|
|
|
31
32
|
const buttonsContainerOpacity = useSharedValue(0)
|
|
32
33
|
|
|
33
34
|
useEffect(() => {
|
|
34
|
-
buttonsContainerOpacity.value = withDelay(
|
|
35
|
+
buttonsContainerOpacity.value = withDelay(APPEARANCE_DELAY, withTiming(1, { duration: 500 }))
|
|
35
36
|
}, [])
|
|
36
37
|
|
|
37
38
|
return (
|
|
@@ -39,7 +40,7 @@ export const PracticeButtonGroup = ({
|
|
|
39
40
|
<Animated.View
|
|
40
41
|
entering={
|
|
41
42
|
isPracticeButtonVisible
|
|
42
|
-
? FadeInRight.delay(
|
|
43
|
+
? FadeInRight.delay(APPEARANCE_DELAY).duration(500).easing(Easing.ease)
|
|
43
44
|
: FadeInUp.duration(500)
|
|
44
45
|
}
|
|
45
46
|
>
|
|
@@ -11,7 +11,10 @@ export type TeacherFeedbackModelProps = {
|
|
|
11
11
|
getComments: (props: GetCommentsPayload) => Promise<GetCommentsResponse>
|
|
12
12
|
updateCommentStatusSeen: (props: UpdateCommentStatusSeenPayload) => Promise<void>
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated - use socket and events directly in the client
|
|
16
|
+
*/
|
|
17
|
+
socket?: any
|
|
15
18
|
credits: {
|
|
16
19
|
$assignmentId: Store<string>
|
|
17
20
|
$problemId: Store<string>
|
|
@@ -2,21 +2,23 @@ import { createEvent } from 'effector'
|
|
|
2
2
|
import { TeacherComment, FeedbackSocketEvents } from '../types'
|
|
3
3
|
|
|
4
4
|
export class TeacherFeedbackSockets {
|
|
5
|
-
private readonly socket: any
|
|
5
|
+
private readonly socket: any = null
|
|
6
6
|
public readonly commentAdded = createEvent<TeacherComment>()
|
|
7
7
|
public readonly commentDeleted = createEvent<TeacherComment>()
|
|
8
8
|
|
|
9
9
|
constructor(socket: any) {
|
|
10
|
-
|
|
10
|
+
if (socket) {
|
|
11
|
+
this.socket = socket
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
connect() {
|
|
14
|
-
this.socket
|
|
15
|
-
this.socket
|
|
16
|
+
this.socket?.on(FeedbackSocketEvents.COMMENT_ADDED, this.commentAdded)
|
|
17
|
+
this.socket?.on(FeedbackSocketEvents.COMMENT_DELETED, this.commentDeleted)
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
off() {
|
|
19
|
-
this.socket
|
|
20
|
-
this.socket
|
|
21
|
+
this.socket?.off(FeedbackSocketEvents.COMMENT_ADDED, this.commentAdded)
|
|
22
|
+
this.socket?.off(FeedbackSocketEvents.COMMENT_DELETED, this.commentDeleted)
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -58,3 +58,7 @@ export const MATH_CURRENCY_US_KEYBOARD_GROUP: KeyboardGroup = {
|
|
|
58
58
|
id: MathEntryKeyboardGroupId.CURRENCY_US,
|
|
59
59
|
keys: [MATH_CURRENCY_UNITS.DOLLAR, MATH_CURRENCY_UNITS.CENT],
|
|
60
60
|
}
|
|
61
|
+
export const MATH_CURRENCY_DE_KEYBOARD_GROUP: KeyboardGroup = {
|
|
62
|
+
id: MathEntryKeyboardGroupId.CURRENCY_DE,
|
|
63
|
+
keys: [MATH_CURRENCY_UNITS.EURO, MATH_CURRENCY_UNITS.DOLLAR, MATH_CURRENCY_UNITS.POUND],
|
|
64
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import React, { useMemo } from 'react'
|
|
2
|
-
import { StyleProp, StyleSheet, useWindowDimensions, ViewStyle } from 'react-native'
|
|
3
|
-
import { COLORS, IS_MOBILE, SelectOptionColor, SHADOWS } from '@magmamath/react-native-ui'
|
|
4
|
-
import { KeyboardKey, KeyboardKeyValue } from '../types
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react'
|
|
2
|
+
import { Animated, StyleProp, StyleSheet, useWindowDimensions, ViewStyle } from 'react-native'
|
|
3
|
+
import { COLORS, IS_MOBILE, IS_WEB, SelectOptionColor, SHADOWS } from '@magmamath/react-native-ui'
|
|
4
|
+
import { KeyboardKey, KeyboardKeyValue } from '../types'
|
|
5
5
|
import { Numpad } from './Numpad/Numpad'
|
|
6
|
+
import { MainLayout } from './MainLayout/MainLayout'
|
|
7
|
+
import {
|
|
8
|
+
getLayoutConfigStyles,
|
|
9
|
+
KEYBOARD_SLIDE_DISTANCE,
|
|
10
|
+
slideInAnimationSettings,
|
|
11
|
+
} from './MainLayout/constants'
|
|
6
12
|
import { MOBILE_LAYOUT_WIDTH } from '../constants/constants'
|
|
7
|
-
import { getLayoutConfigStyles } from './constants'
|
|
8
|
-
import { MainLayout } from './MainLayout'
|
|
9
|
-
import Animated, { SlideInDown } from 'react-native-reanimated'
|
|
10
13
|
|
|
11
14
|
type KeyboardProps = {
|
|
12
15
|
onKeyPress: (key: KeyboardKeyValue) => void
|
|
@@ -14,11 +17,19 @@ type KeyboardProps = {
|
|
|
14
17
|
style?: StyleProp<ViewStyle>
|
|
15
18
|
color?: SelectOptionColor
|
|
16
19
|
isDisabled?: boolean
|
|
20
|
+
isMainLayoutDisabled?: boolean
|
|
17
21
|
showUnderlinedKeys?: boolean
|
|
18
22
|
disabledKeys?: KeyboardKey[]
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
export const Keyboard = ({
|
|
25
|
+
export const Keyboard = ({
|
|
26
|
+
style,
|
|
27
|
+
characterType,
|
|
28
|
+
isMainLayoutDisabled,
|
|
29
|
+
...props
|
|
30
|
+
}: KeyboardProps) => {
|
|
31
|
+
const slideAnim = useRef(new Animated.Value(KEYBOARD_SLIDE_DISTANCE)).current
|
|
32
|
+
|
|
22
33
|
const { width } = useWindowDimensions()
|
|
23
34
|
const isMobile = width <= MOBILE_LAYOUT_WIDTH || IS_MOBILE
|
|
24
35
|
const mobileStyles = useMemo(
|
|
@@ -26,12 +37,34 @@ export const Keyboard = ({ style, characterType, ...props }: KeyboardProps) => {
|
|
|
26
37
|
[characterType, isMobile],
|
|
27
38
|
)
|
|
28
39
|
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const anim = Animated.spring(slideAnim, {
|
|
42
|
+
...slideInAnimationSettings,
|
|
43
|
+
mass: 1,
|
|
44
|
+
velocity: 0,
|
|
45
|
+
useNativeDriver: !IS_WEB,
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
anim.start()
|
|
49
|
+
|
|
50
|
+
return () => anim.stop()
|
|
51
|
+
}, [])
|
|
52
|
+
|
|
29
53
|
return (
|
|
30
54
|
<Animated.View
|
|
31
|
-
style={[
|
|
32
|
-
|
|
55
|
+
style={[
|
|
56
|
+
styles.container,
|
|
57
|
+
style,
|
|
58
|
+
{
|
|
59
|
+
transform: [{ translateY: slideAnim }],
|
|
60
|
+
},
|
|
61
|
+
]}
|
|
33
62
|
>
|
|
34
|
-
<MainLayout
|
|
63
|
+
<MainLayout
|
|
64
|
+
{...props}
|
|
65
|
+
isDisabled={isMainLayoutDisabled || props.isDisabled}
|
|
66
|
+
characterType={characterType}
|
|
67
|
+
/>
|
|
35
68
|
<Numpad {...props} style={mobileStyles} />
|
|
36
69
|
</Animated.View>
|
|
37
70
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef, useState, useCallback } from 'react'
|
|
2
2
|
import { Animated, StyleSheet, useWindowDimensions, View } from 'react-native'
|
|
3
3
|
import { SelectOptionColor, IS_MOBILE, IS_WEB } from '@magmamath/react-native-ui'
|
|
4
|
-
import { getLayoutByCharType } from '
|
|
5
|
-
import { KeyboardKey, KeyboardKeyValue } from '
|
|
6
|
-
import { UnderlinedLayout } from '
|
|
7
|
-
import { MOBILE_LAYOUT_WIDTH } from '
|
|
4
|
+
import { getLayoutByCharType, isBasicPlusPlusLayout } from '../../constants/keyboardLayouts'
|
|
5
|
+
import { KeyboardKey, KeyboardKeyValue } from '../../types/types'
|
|
6
|
+
import { UnderlinedLayout } from '../UnderlinedLayout/UnderlinedLayout'
|
|
7
|
+
import { MOBILE_LAYOUT_WIDTH } from '../../constants/constants'
|
|
8
8
|
|
|
9
9
|
type LayoutProps = {
|
|
10
10
|
onKeyPress: (key: KeyboardKeyValue) => void
|
|
@@ -60,11 +60,11 @@ export const MainLayout = ({
|
|
|
60
60
|
}, [showUnderlinedKeys, animateFade])
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
|
-
<View style={styles.container}>
|
|
63
|
+
<View style={[styles.container, IS_MOBILE && { flex: 1 }]}>
|
|
64
64
|
<Layout {...props} onLayoutChange={setIsSecondaryLayoutSelected} />
|
|
65
65
|
{isUnderlinedLayoutVisible && (
|
|
66
66
|
<Animated.View style={{ opacity: fadeAnim }}>
|
|
67
|
-
<UnderlinedLayout {...props} />
|
|
67
|
+
<UnderlinedLayout {...props} showSlashKey={!isBasicPlusPlusLayout(characterType)} />
|
|
68
68
|
</Animated.View>
|
|
69
69
|
)}
|
|
70
70
|
</View>
|
|
@@ -74,6 +74,5 @@ export const MainLayout = ({
|
|
|
74
74
|
const styles = StyleSheet.create({
|
|
75
75
|
container: {
|
|
76
76
|
flexDirection: 'row',
|
|
77
|
-
flex: 1,
|
|
78
77
|
},
|
|
79
78
|
})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { COLORS, SPACING } from '@magmamath/react-native-ui'
|
|
2
|
-
import { KEYBOARD_LAYOUTS } from '
|
|
2
|
+
import { KEYBOARD_LAYOUTS } from '../../constants/keyboardLayouts'
|
|
3
3
|
|
|
4
4
|
export const KEYBOARD_SLIDE_DISTANCE = 600
|
|
5
5
|
|
|
@@ -20,3 +20,8 @@ export const getLayoutConfigStyles = (characterType?: number, isMobile?: boolean
|
|
|
20
20
|
|
|
21
21
|
return LAYOUT_STYLES_CONFIG.DEFAULT
|
|
22
22
|
}
|
|
23
|
+
export const slideInAnimationSettings = {
|
|
24
|
+
toValue: 0,
|
|
25
|
+
stiffness: 320,
|
|
26
|
+
damping: 40,
|
|
27
|
+
}
|
|
@@ -4,9 +4,14 @@ import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
|
|
|
4
4
|
import { Locale, useText } from '../../../../shared/translation'
|
|
5
5
|
import { getKeyboardGroup } from '../../helpers'
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
type UnderlinedLayoutProps = {
|
|
8
|
+
showSlashKey?: boolean
|
|
9
|
+
} & KeyboardLayoutProps
|
|
10
|
+
|
|
11
|
+
export const UnderlinedLayout = (props: UnderlinedLayoutProps) => {
|
|
8
12
|
const t = useText()
|
|
9
13
|
const keysGroup = getKeyboardGroup(t('locale') as Locale, KeyboardType.Underlined)
|
|
14
|
+
const keys = props.showSlashKey ? keysGroup.keys : keysGroup.keys.slice(0, -1)
|
|
10
15
|
|
|
11
|
-
return <KeysList keys={
|
|
16
|
+
return <KeysList keys={keys} numOfRows={props.showSlashKey ? 2 : keys.length} {...props} />
|
|
12
17
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { KeyboardGroup } from '../../types/types'
|
|
2
2
|
import { MathEntryKeyboardGroupId } from '../../types/keyboardGroupIds'
|
|
3
3
|
import { MATH_BASIC_OPERATORS } from '../../types/MathKeysGroups/basicOperators'
|
|
4
|
+
import { MATH_SPECIAL_OPERATORS } from '../../types/MathKeysGroups/specialOperators'
|
|
4
5
|
|
|
5
6
|
export const MATH_ENTRY_UNDERLINED_KEYBOARD_GROUP: KeyboardGroup = {
|
|
6
7
|
id: MathEntryKeyboardGroupId.UNDERLINED,
|
|
7
8
|
keys: [
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
MATH_SPECIAL_OPERATORS.UNDERLINED_TEN,
|
|
10
|
+
MATH_SPECIAL_OPERATORS.UNDERLINED_U,
|
|
11
|
+
MATH_SPECIAL_OPERATORS.UNDERLINED_ONE,
|
|
12
|
+
MATH_BASIC_OPERATORS.SLASH,
|
|
11
13
|
],
|
|
12
14
|
}
|
|
@@ -1,32 +1,43 @@
|
|
|
1
1
|
import { useText } from '../../../../../shared/translation'
|
|
2
2
|
import { useMemo, useState } from 'react'
|
|
3
|
+
import { KeyboardUnitsGroupType, UnitTab } from '../types'
|
|
4
|
+
import { useWindowDimensions } from 'react-native'
|
|
3
5
|
import { TabOptionProps } from '@magmamath/react-native-ui'
|
|
4
|
-
|
|
5
|
-
import { KeyboardUnitsGroupType } from '../types'
|
|
6
|
+
import { isKeyboardUnitsGroupType } from '../helpers'
|
|
6
7
|
|
|
7
8
|
export const useUnitTabs = () => {
|
|
8
9
|
const t = useText()
|
|
9
|
-
const
|
|
10
|
+
const { width } = useWindowDimensions()
|
|
11
|
+
|
|
12
|
+
const allTabs = useMemo<UnitTab[]>(
|
|
10
13
|
() => [
|
|
11
|
-
{
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: t('keyboard.area'),
|
|
17
|
-
key: KeyboardUnitsGroupType.AREA,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: t('keyboard.volume'),
|
|
21
|
-
key: KeyboardUnitsGroupType.VOLUME,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
title: t('keyboard.weight'),
|
|
25
|
-
key: KeyboardUnitsGroupType.WEIGHT,
|
|
26
|
-
},
|
|
14
|
+
{ title: t('keyboard.length'), key: KeyboardUnitsGroupType.LENGTH },
|
|
15
|
+
{ title: t('keyboard.area'), key: KeyboardUnitsGroupType.AREA, minWidth: 1005 },
|
|
16
|
+
{ title: t('keyboard.volume'), key: KeyboardUnitsGroupType.VOLUME, minWidth: 1060 },
|
|
17
|
+
{ title: t('keyboard.weight'), key: KeyboardUnitsGroupType.WEIGHT, minWidth: 1060 },
|
|
18
|
+
{ title: t('keyboard.time'), key: KeyboardUnitsGroupType.TIME, minWidth: 1125 },
|
|
27
19
|
],
|
|
28
20
|
[t],
|
|
29
21
|
)
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
|
|
23
|
+
const tabs = useMemo(
|
|
24
|
+
() => allTabs.filter((tab) => tab.minWidth === undefined || width >= tab.minWidth),
|
|
25
|
+
[allTabs, width],
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
const [activeKey, setActiveKey] = useState<KeyboardUnitsGroupType | undefined>(() => tabs[0]?.key)
|
|
29
|
+
|
|
30
|
+
const activeTab = useMemo(() => {
|
|
31
|
+
return tabs.find((t) => t?.key && t.key === activeKey) ?? tabs[0]
|
|
32
|
+
}, [tabs, activeKey])
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
tabs,
|
|
36
|
+
activeTab,
|
|
37
|
+
setActiveTab: (tab: TabOptionProps) => {
|
|
38
|
+
if (isKeyboardUnitsGroupType(tab.key)) {
|
|
39
|
+
setActiveKey(tab.key)
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
}
|
|
32
43
|
}
|