@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.
Files changed (338) hide show
  1. package/.editorconfig +15 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc +22 -0
  4. package/.gitattributes +3 -0
  5. package/.github/actions/setup/action.yml +37 -0
  6. package/.github/workflows/ci.yml +73 -0
  7. package/.gitignore +84 -0
  8. package/.idea/.gitignore +8 -0
  9. package/.idea/codeStyles/Project.xml +62 -0
  10. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  11. package/.idea/copilot.data.migration.agent.xml +6 -0
  12. package/.idea/copilot.data.migration.ask.xml +6 -0
  13. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  14. package/.idea/copilot.data.migration.edit.xml +6 -0
  15. package/.idea/inspectionProfiles/Project_Default.xml +8 -0
  16. package/.idea/jsLinters/eslint.xml +6 -0
  17. package/.idea/modules.xml +8 -0
  18. package/.idea/prettier.xml +7 -0
  19. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025,_13_10_[Changes]/shelved.patch +18 -0
  20. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025,_13_11_[Changes]/shelved.patch +19 -0
  21. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025__13_10__Changes_.xml +4 -0
  22. package/.idea/shelf/Uncommitted_changes_before_Checkout_at_29_12_2025__13_11__Changes_.xml +4 -0
  23. package/.idea/students-features.iml +12 -0
  24. package/.idea/vcs.xml +6 -0
  25. package/.idea/workspace.xml +643 -0
  26. package/.nvmrc +1 -0
  27. package/.prettierrc +11 -0
  28. package/.release-it.json +17 -0
  29. package/.watchmanconfig +1 -0
  30. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  31. package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
  32. package/.yarn/releases/yarn-3.6.1.cjs +874 -0
  33. package/babel.config.js +5 -0
  34. package/bob.config.js +25 -0
  35. package/dist/commonjs/features/celebrations/helpers.js +4 -1
  36. package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
  37. package/dist/commonjs/features/chatbot/components/Chatbot.js +2 -2
  38. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  39. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +8 -6
  40. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  41. package/dist/commonjs/features/chatbot/model/t2s.js +4 -3
  42. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
  43. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  44. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js +3 -2
  45. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
  46. package/dist/commonjs/features/feedback/model/model.js.map +1 -1
  47. package/dist/commonjs/features/feedback/model/sockets.js +8 -5
  48. package/dist/commonjs/features/feedback/model/sockets.js.map +1 -1
  49. package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.js +5 -1
  50. package/dist/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.js.map +1 -1
  51. package/dist/commonjs/features/keyboard/components/Keyboard.js +24 -9
  52. package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
  53. package/dist/commonjs/features/keyboard/components/{MainLayout.js → MainLayout/MainLayout.js} +9 -7
  54. package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js.map +1 -0
  55. package/dist/commonjs/features/keyboard/components/{constants.js → MainLayout/constants.js} +7 -2
  56. package/dist/commonjs/features/keyboard/components/MainLayout/constants.js.map +1 -0
  57. package/dist/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js +3 -2
  58. package/dist/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js.map +1 -1
  59. package/dist/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.js +2 -1
  60. package/dist/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.js.map +1 -1
  61. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js +2 -1
  62. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  63. package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js +3 -1
  64. package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
  65. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +26 -6
  66. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  67. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  68. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  69. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +1 -0
  70. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  71. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js +22 -1
  72. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  73. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +7 -0
  74. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  75. package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -30
  76. package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
  77. package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js +27 -0
  78. package/dist/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
  79. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +18 -3
  80. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  81. package/dist/commonjs/features/keyboard/types/keyboardGroupIds.js +1 -0
  82. package/dist/commonjs/features/keyboard/types/keyboardGroupIds.js.map +1 -1
  83. package/dist/commonjs/lib/helpers/helpers.js +28 -5
  84. package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
  85. package/dist/commonjs/lib/types/requests.js +2 -0
  86. package/dist/commonjs/lib/types/requests.js.map +1 -0
  87. package/dist/commonjs/shared/icons/TimeIcon.js +37 -0
  88. package/dist/commonjs/shared/icons/TimeIcon.js.map +1 -0
  89. package/dist/commonjs/shared/translation/constants.js +3 -1
  90. package/dist/commonjs/shared/translation/constants.js.map +1 -1
  91. package/dist/commonjs/shared/translation/localization/ca.json +7 -6
  92. package/dist/commonjs/shared/translation/localization/de.json +43 -0
  93. package/dist/commonjs/shared/translation/localization/en.json +7 -6
  94. package/dist/commonjs/shared/translation/localization/gb.json +7 -6
  95. package/dist/commonjs/shared/translation/localization/sct.json +7 -6
  96. package/dist/commonjs/shared/translation/localization/sw.json +7 -6
  97. package/dist/commonjs/shared/translation/types.js +1 -0
  98. package/dist/commonjs/shared/translation/types.js.map +1 -1
  99. package/dist/module/features/celebrations/helpers.js +4 -1
  100. package/dist/module/features/celebrations/helpers.js.map +1 -1
  101. package/dist/module/features/chatbot/components/Chatbot.js +2 -2
  102. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  103. package/dist/module/features/chatbot/model/ChatBotModel.js +8 -6
  104. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  105. package/dist/module/features/chatbot/model/t2s.js +4 -3
  106. package/dist/module/features/chatbot/model/t2s.js.map +1 -1
  107. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  108. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js +3 -2
  109. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
  110. package/dist/module/features/feedback/model/model.js.map +1 -1
  111. package/dist/module/features/feedback/model/sockets.js +8 -5
  112. package/dist/module/features/feedback/model/sockets.js.map +1 -1
  113. package/dist/module/features/keyboard/components/BasicLayout/keyboardGroups.js +4 -0
  114. package/dist/module/features/keyboard/components/BasicLayout/keyboardGroups.js.map +1 -1
  115. package/dist/module/features/keyboard/components/Keyboard.js +23 -8
  116. package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
  117. package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  118. package/dist/module/features/keyboard/components/{MainLayout.js → MainLayout/MainLayout.js} +9 -7
  119. package/dist/module/features/keyboard/components/MainLayout/MainLayout.js.map +1 -0
  120. package/dist/module/features/keyboard/components/{constants.js → MainLayout/constants.js} +6 -1
  121. package/dist/module/features/keyboard/components/MainLayout/constants.js.map +1 -0
  122. package/dist/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js +3 -2
  123. package/dist/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.js.map +1 -1
  124. package/dist/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.js +2 -1
  125. package/dist/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.js.map +1 -1
  126. package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js +2 -1
  127. package/dist/module/features/keyboard/components/UnitsLayout/UnitsLayout.js.map +1 -1
  128. package/dist/module/features/keyboard/components/UnitsLayout/helpers.js +2 -1
  129. package/dist/module/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
  130. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +26 -6
  131. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  132. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  133. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  134. package/dist/module/features/keyboard/components/UnitsLayout/types.js +1 -0
  135. package/dist/module/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  136. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js +24 -3
  137. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  138. package/dist/module/features/keyboard/constants/keyboardLayouts.js +6 -0
  139. package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  140. package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js +3 -30
  141. package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
  142. package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js +27 -0
  143. package/dist/module/features/keyboard/types/MathKeysGroups/specialOperators.js.map +1 -1
  144. package/dist/module/features/keyboard/types/MathKeysGroups/units.js +18 -3
  145. package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  146. package/dist/module/features/keyboard/types/keyboardGroupIds.js +1 -0
  147. package/dist/module/features/keyboard/types/keyboardGroupIds.js.map +1 -1
  148. package/dist/module/lib/helpers/helpers.js +28 -5
  149. package/dist/module/lib/helpers/helpers.js.map +1 -1
  150. package/dist/module/lib/types/requests.js +2 -0
  151. package/dist/module/lib/types/requests.js.map +1 -0
  152. package/dist/module/shared/icons/TimeIcon.js +29 -0
  153. package/dist/module/shared/icons/TimeIcon.js.map +1 -0
  154. package/dist/module/shared/translation/constants.js +3 -1
  155. package/dist/module/shared/translation/constants.js.map +1 -1
  156. package/dist/module/shared/translation/localization/ca.json +7 -6
  157. package/dist/module/shared/translation/localization/de.json +43 -0
  158. package/dist/module/shared/translation/localization/en.json +7 -6
  159. package/dist/module/shared/translation/localization/gb.json +7 -6
  160. package/dist/module/shared/translation/localization/sct.json +7 -6
  161. package/dist/module/shared/translation/localization/sw.json +7 -6
  162. package/dist/module/shared/translation/types.js +1 -0
  163. package/dist/module/shared/translation/types.js.map +1 -1
  164. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +8 -7
  166. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts +2 -2
  168. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
  169. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
  170. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +11 -1
  171. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  172. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +8 -5
  173. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  174. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
  175. package/dist/typescript/commonjs/features/feedback/model/model.d.ts +4 -1
  176. package/dist/typescript/commonjs/features/feedback/model/model.d.ts.map +1 -1
  177. package/dist/typescript/commonjs/features/feedback/model/sockets.d.ts.map +1 -1
  178. package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.d.ts +1 -0
  179. package/dist/typescript/commonjs/features/keyboard/components/BasicLayout/keyboardGroups.d.ts.map +1 -1
  180. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +3 -2
  181. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
  182. package/dist/typescript/commonjs/features/keyboard/components/{MainLayout.d.ts → MainLayout/MainLayout.d.ts} +1 -1
  183. package/dist/typescript/commonjs/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -0
  184. package/dist/typescript/{module/features/keyboard/components → commonjs/features/keyboard/components/MainLayout}/constants.d.ts +5 -0
  185. package/dist/typescript/commonjs/features/keyboard/components/MainLayout/constants.d.ts.map +1 -0
  186. package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts +5 -1
  187. package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts.map +1 -1
  188. package/dist/typescript/commonjs/features/keyboard/components/UnderlinedLayout/keyboardGroups.d.ts.map +1 -1
  189. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
  190. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
  191. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
  192. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  193. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  194. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  195. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
  196. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  197. package/dist/typescript/commonjs/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  198. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +1 -0
  199. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  200. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -18
  201. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
  202. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.d.ts +18 -0
  203. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/specialOperators.d.ts.map +1 -1
  204. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
  205. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  206. package/dist/typescript/commonjs/features/keyboard/types/keyboardGroupIds.d.ts +1 -0
  207. package/dist/typescript/commonjs/features/keyboard/types/keyboardGroupIds.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/lib/helpers/helpers.d.ts.map +1 -1
  209. package/dist/typescript/commonjs/lib/types/requests.d.ts +4 -0
  210. package/dist/typescript/commonjs/lib/types/requests.d.ts.map +1 -0
  211. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +4 -0
  212. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +1 -0
  213. package/dist/typescript/commonjs/shared/translation/constants.d.ts +48 -0
  214. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  215. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  216. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  217. package/dist/typescript/commonjs/shared/translation/types.d.ts +2 -1
  218. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
  219. package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -1
  220. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +8 -7
  221. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  222. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts +2 -2
  223. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +1 -1
  224. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
  225. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +11 -1
  226. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  227. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +8 -5
  228. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  229. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
  230. package/dist/typescript/module/features/feedback/model/model.d.ts +4 -1
  231. package/dist/typescript/module/features/feedback/model/model.d.ts.map +1 -1
  232. package/dist/typescript/module/features/feedback/model/sockets.d.ts.map +1 -1
  233. package/dist/typescript/module/features/keyboard/components/BasicLayout/keyboardGroups.d.ts +1 -0
  234. package/dist/typescript/module/features/keyboard/components/BasicLayout/keyboardGroups.d.ts.map +1 -1
  235. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +3 -2
  236. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
  237. package/dist/typescript/module/features/keyboard/components/{MainLayout.d.ts → MainLayout/MainLayout.d.ts} +1 -1
  238. package/dist/typescript/module/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -0
  239. package/dist/typescript/{commonjs/features/keyboard/components → module/features/keyboard/components/MainLayout}/constants.d.ts +5 -0
  240. package/dist/typescript/module/features/keyboard/components/MainLayout/constants.d.ts.map +1 -0
  241. package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts +5 -1
  242. package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.d.ts.map +1 -1
  243. package/dist/typescript/module/features/keyboard/components/UnderlinedLayout/keyboardGroups.d.ts.map +1 -1
  244. package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
  245. package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
  246. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
  247. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  248. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  249. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  250. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
  251. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  252. package/dist/typescript/module/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  253. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +1 -0
  254. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  255. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +0 -18
  256. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
  257. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/specialOperators.d.ts +18 -0
  258. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/specialOperators.d.ts.map +1 -1
  259. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +15 -0
  260. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  261. package/dist/typescript/module/features/keyboard/types/keyboardGroupIds.d.ts +1 -0
  262. package/dist/typescript/module/features/keyboard/types/keyboardGroupIds.d.ts.map +1 -1
  263. package/dist/typescript/module/lib/helpers/helpers.d.ts.map +1 -1
  264. package/dist/typescript/module/lib/types/requests.d.ts +4 -0
  265. package/dist/typescript/module/lib/types/requests.d.ts.map +1 -0
  266. package/dist/typescript/module/shared/icons/TimeIcon.d.ts +4 -0
  267. package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +1 -0
  268. package/dist/typescript/module/shared/translation/constants.d.ts +48 -0
  269. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  270. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  271. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  272. package/dist/typescript/module/shared/translation/types.d.ts +2 -1
  273. package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
  274. package/example/.expo/README.md +8 -0
  275. package/example/.expo/devices.json +3 -0
  276. package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
  277. package/example/app.json +30 -0
  278. package/example/assets/adaptive-icon.png +0 -0
  279. package/example/assets/favicon.png +0 -0
  280. package/example/assets/icon.png +0 -0
  281. package/example/assets/splash-icon.png +0 -0
  282. package/example/babel.config.js +28 -0
  283. package/example/index.js +8 -0
  284. package/example/metro.config.js +18 -0
  285. package/example/package.json +25 -0
  286. package/example/src/App.tsx +8 -0
  287. package/example/tsconfig.json +6 -0
  288. package/example/yarn.lock +6552 -0
  289. package/package.json +1 -1
  290. package/src/features/celebrations/helpers.ts +35 -33
  291. package/src/features/chatbot/components/Chatbot.tsx +2 -2
  292. package/src/features/chatbot/model/ChatBotModel.ts +10 -5
  293. package/src/features/chatbot/model/t2s.ts +3 -2
  294. package/src/features/chatbot/types/api.types.ts +14 -1
  295. package/src/features/chatbot/types/model.types.ts +12 -5
  296. package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +4 -3
  297. package/src/features/feedback/model/model.ts +4 -1
  298. package/src/features/feedback/model/sockets.ts +8 -6
  299. package/src/features/keyboard/components/BasicLayout/keyboardGroups.ts +4 -0
  300. package/src/features/keyboard/components/Keyboard.tsx +44 -11
  301. package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -1
  302. package/src/features/keyboard/components/{MainLayout.tsx → MainLayout/MainLayout.tsx} +6 -7
  303. package/src/features/keyboard/components/{constants.ts → MainLayout/constants.ts} +6 -1
  304. package/src/features/keyboard/components/UnderlinedLayout/UnderlinedLayout.tsx +7 -2
  305. package/src/features/keyboard/components/UnderlinedLayout/keyboardGroups.ts +5 -3
  306. package/src/features/keyboard/components/UnitsLayout/UnitsLayout.tsx +1 -0
  307. package/src/features/keyboard/components/UnitsLayout/helpers.tsx +3 -0
  308. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +32 -21
  309. package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +11 -0
  310. package/src/features/keyboard/components/UnitsLayout/types.ts +7 -0
  311. package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +23 -0
  312. package/src/features/keyboard/constants/keyboardLayouts.ts +11 -0
  313. package/src/features/keyboard/types/MathKeysGroups/basicOperators.tsx +3 -24
  314. package/src/features/keyboard/types/MathKeysGroups/specialOperators.tsx +21 -0
  315. package/src/features/keyboard/types/MathKeysGroups/units.tsx +15 -0
  316. package/src/features/keyboard/types/keyboardGroupIds.ts +1 -0
  317. package/src/lib/helpers/helpers.ts +23 -8
  318. package/src/lib/types/requests.ts +1 -0
  319. package/src/shared/icons/TimeIcon.tsx +23 -0
  320. package/src/shared/translation/constants.ts +2 -0
  321. package/src/shared/translation/localization/ca.json +7 -6
  322. package/src/shared/translation/localization/de.json +43 -0
  323. package/src/shared/translation/localization/en.json +7 -6
  324. package/src/shared/translation/localization/gb.json +7 -6
  325. package/src/shared/translation/localization/sct.json +7 -6
  326. package/src/shared/translation/localization/sw.json +7 -6
  327. package/src/shared/translation/types.ts +4 -0
  328. package/tsconfig.build.json +4 -0
  329. package/tsconfig.json +34 -0
  330. package/yarn.lock +8623 -0
  331. package/dist/commonjs/features/keyboard/components/MainLayout.js.map +0 -1
  332. package/dist/commonjs/features/keyboard/components/constants.js.map +0 -1
  333. package/dist/module/features/keyboard/components/MainLayout.js.map +0 -1
  334. package/dist/module/features/keyboard/components/constants.js.map +0 -1
  335. package/dist/typescript/commonjs/features/keyboard/components/MainLayout.d.ts.map +0 -1
  336. package/dist/typescript/commonjs/features/keyboard/components/constants.d.ts.map +0 -1
  337. package/dist/typescript/module/features/keyboard/components/MainLayout.d.ts.map +0 -1
  338. package/dist/typescript/module/features/keyboard/components/constants.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.9.9",
3
+ "version": "0.9.14-rc.10",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -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
- return currentDate >= startDate && currentDate <= endDate;
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 alternatives = useUnit(model.$alternatives)
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 || alternatives?.chatAccess === false) {
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, alternatives: this.$alternatives },
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, alternatives, initOnly }: StartConversationFxData) => {
159
+ ({ currentChatData, initOnly, chatAccess }: StartConversationFxData) => {
155
160
  const { key, messages } = currentChatData
156
161
 
157
- if (!alternatives?.chatAccess) return
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?.chatAccess && alternatives?.isOpenChatEnabled && IS_WEB) {
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 GoogleText2SpeechResponse = string | undefined | { audioContent?: string }
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: (props: GoogleTranslatePayload) => Promise<GoogleTranslateResponse>
33
- postTextToSpeech: (props: GoogleText2SpeechPayload) => Promise<GoogleText2SpeechResponse>
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(1000, withTiming(1, { duration: 500 }))
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(1000).duration(500).easing(Easing.ease)
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
- socket: any
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
- this.socket = socket
10
+ if (socket) {
11
+ this.socket = socket
12
+ }
11
13
  }
12
14
 
13
15
  connect() {
14
- this.socket.on(FeedbackSocketEvents.COMMENT_ADDED, this.commentAdded)
15
- this.socket.on(FeedbackSocketEvents.COMMENT_DELETED, this.commentDeleted)
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.off(FeedbackSocketEvents.COMMENT_ADDED, this.commentAdded)
20
- this.socket.off(FeedbackSocketEvents.COMMENT_DELETED, this.commentDeleted)
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/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 = ({ style, characterType, ...props }: KeyboardProps) => {
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={[styles.container, style]}
32
- entering={SlideInDown.damping(40).stiffness(320)}
55
+ style={[
56
+ styles.container,
57
+ style,
58
+ {
59
+ transform: [{ translateY: slideAnim }],
60
+ },
61
+ ]}
33
62
  >
34
- <MainLayout {...props} characterType={characterType} />
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,5 +1,5 @@
1
1
  import React, { useMemo } from 'react'
2
- import { StyleProp, StyleSheet, ViewStyle } from 'react-native'
2
+ import { StyleSheet } from 'react-native'
3
3
  import {
4
4
  ButtonStyle,
5
5
  SelectGroup,
@@ -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 '../constants/keyboardLayouts'
5
- import { KeyboardKey, KeyboardKeyValue } from '../types/types'
6
- import { UnderlinedLayout } from './UnderlinedLayout/UnderlinedLayout'
7
- import { MOBILE_LAYOUT_WIDTH } from '../constants/constants'
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 '../constants/keyboardLayouts'
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
- export const UnderlinedLayout = (props: KeyboardLayoutProps) => {
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={keysGroup.keys} numOfRows={keysGroup.keys.length} {...props} />
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
- MATH_BASIC_OPERATORS.UNDERLINED_TEN,
9
- MATH_BASIC_OPERATORS.UNDERLINED_ONE,
10
- MATH_BASIC_OPERATORS.UNDERLINED_U,
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
  }
@@ -62,6 +62,7 @@ const styles = StyleSheet.create({
62
62
  flexDirection: IS_MOBILE ? 'column' : 'row',
63
63
  gap: 16,
64
64
  paddingRight: 16,
65
+ flex: 1,
65
66
  },
66
67
  option: {
67
68
  flexBasis: 45,
@@ -50,3 +50,6 @@ export const getSelectOptions = ({
50
50
  ]
51
51
  }
52
52
  }
53
+
54
+ export const isKeyboardUnitsGroupType = (k: string): k is KeyboardUnitsGroupType =>
55
+ (Object.values(KeyboardUnitsGroupType) as string[]).includes(k)
@@ -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 tabs = useMemo(
10
+ const { width } = useWindowDimensions()
11
+
12
+ const allTabs = useMemo<UnitTab[]>(
10
13
  () => [
11
- {
12
- title: t('keyboard.length'),
13
- key: KeyboardUnitsGroupType.LENGTH,
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
- const [activeTab, setActiveTab] = useState<TabOptionProps>(tabs[0])
31
- return { tabs, activeTab, setActiveTab }
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
  }