@magmamath/students-features 1.3.3-rc.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/.claude/settings.local.json +25 -0
  2. package/.editorconfig +15 -0
  3. package/.eslintignore +2 -0
  4. package/.eslintrc +22 -0
  5. package/.gitattributes +3 -0
  6. package/.github/actions/setup/action.yml +37 -0
  7. package/.github/workflows/ci.yml +73 -0
  8. package/.gitignore +84 -0
  9. package/.idea/.gitignore +8 -0
  10. package/.idea/codeStyles/Project.xml +62 -0
  11. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  12. package/.idea/copilot.data.migration.agent.xml +6 -0
  13. package/.idea/copilot.data.migration.ask.xml +6 -0
  14. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  15. package/.idea/copilot.data.migration.edit.xml +6 -0
  16. package/.idea/inspectionProfiles/Project_Default.xml +8 -0
  17. package/.idea/jsLinters/eslint.xml +6 -0
  18. package/.idea/modules.xml +8 -0
  19. package/.idea/prettier.xml +7 -0
  20. package/.idea/students-features.iml +12 -0
  21. package/.idea/vcs.xml +6 -0
  22. package/.idea/workspace.xml +667 -0
  23. package/.nvmrc +1 -0
  24. package/.prettierrc +11 -0
  25. package/.release-it.json +17 -0
  26. package/.watchmanconfig +1 -0
  27. package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +541 -0
  28. package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +28 -0
  29. package/.yarn/releases/yarn-3.6.1.cjs +874 -0
  30. package/babel.config.js +5 -0
  31. package/bob.config.js +25 -0
  32. package/dist/commonjs/features/chatbot/helpers.js +5 -1
  33. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  35. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +7 -6
  36. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  37. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +2 -1
  38. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  39. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +2 -4
  40. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  41. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +3 -2
  42. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  43. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +8 -4
  44. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  45. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +20 -72
  46. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  47. package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js +33 -0
  48. package/dist/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -0
  49. package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +94 -0
  50. package/dist/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -0
  51. package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js +25 -0
  52. package/dist/commonjs/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -0
  53. package/dist/commonjs/features/keyboard/components/{AlgebraLayout → SwitchableLayout}/types.js +1 -1
  54. package/dist/commonjs/features/keyboard/components/SwitchableLayout/types.js.map +1 -0
  55. package/dist/commonjs/features/keyboard/constants/groups/geometry.constants.js +11 -0
  56. package/dist/commonjs/features/keyboard/constants/groups/geometry.constants.js.map +1 -0
  57. package/dist/commonjs/features/keyboard/constants/groups/index.js +11 -0
  58. package/dist/commonjs/features/keyboard/constants/groups/index.js.map +1 -1
  59. package/dist/commonjs/features/keyboard/constants/keyboard.constants.js +6 -1
  60. package/dist/commonjs/features/keyboard/constants/keyboard.constants.js.map +1 -1
  61. package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js +2 -0
  62. package/dist/commonjs/features/keyboard/constants/keyboard.helpers.js.map +1 -1
  63. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +18 -8
  64. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  65. package/dist/commonjs/features/keyboard/constants/keys/geometry.constants.js +86 -1
  66. package/dist/commonjs/features/keyboard/constants/keys/geometry.constants.js.map +1 -1
  67. package/dist/commonjs/features/keyboard/constants/keys/text.constants.js +9 -9
  68. package/dist/commonjs/features/keyboard/constants/keys/units.constants.js +2 -1
  69. package/dist/commonjs/features/keyboard/constants/keys/units.constants.js.map +1 -1
  70. package/dist/commonjs/features/keyboard/types/types.js +1 -0
  71. package/dist/commonjs/features/keyboard/types/types.js.map +1 -1
  72. package/dist/commonjs/index.js +38 -23
  73. package/dist/commonjs/index.js.map +1 -1
  74. package/dist/commonjs/lib/types/keys.js +2 -0
  75. package/dist/commonjs/lib/types/keys.js.map +1 -0
  76. package/dist/commonjs/shared/icons/GeometryIcon.js +32 -0
  77. package/dist/commonjs/shared/icons/GeometryIcon.js.map +1 -0
  78. package/dist/commonjs/shared/icons/keyboard/AngleIcon.js +4 -3
  79. package/dist/commonjs/shared/icons/keyboard/AngleIcon.js.map +1 -1
  80. package/dist/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.js +12 -8
  81. package/dist/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.js.map +1 -1
  82. package/dist/commonjs/shared/icons/keyboard/ImpliesIcon.js +30 -0
  83. package/dist/commonjs/shared/icons/keyboard/ImpliesIcon.js.map +1 -0
  84. package/dist/commonjs/shared/icons/keyboard/LetterAIcon.js +29 -0
  85. package/dist/commonjs/shared/icons/keyboard/LetterAIcon.js.map +1 -0
  86. package/dist/commonjs/shared/icons/keyboard/LetterBIcon.js +29 -0
  87. package/dist/commonjs/shared/icons/keyboard/LetterBIcon.js.map +1 -0
  88. package/dist/commonjs/shared/icons/keyboard/LetterCIcon.js +29 -0
  89. package/dist/commonjs/shared/icons/keyboard/LetterCIcon.js.map +1 -0
  90. package/dist/commonjs/shared/icons/keyboard/LineSegmentIcon.js +11 -6
  91. package/dist/commonjs/shared/icons/keyboard/LineSegmentIcon.js.map +1 -1
  92. package/dist/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.js +12 -8
  93. package/dist/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.js.map +1 -1
  94. package/dist/commonjs/shared/icons/keyboard/ThereforeIcon.js +42 -0
  95. package/dist/commonjs/shared/icons/keyboard/ThereforeIcon.js.map +1 -0
  96. package/dist/commonjs/shared/icons/keyboard/TriangleIcon.js +32 -0
  97. package/dist/commonjs/shared/icons/keyboard/TriangleIcon.js.map +1 -0
  98. package/dist/commonjs/shared/translation/constants.js +17 -2
  99. package/dist/commonjs/shared/translation/constants.js.map +1 -1
  100. package/dist/commonjs/shared/translation/helpers.js +38 -8
  101. package/dist/commonjs/shared/translation/helpers.js.map +1 -1
  102. package/dist/commonjs/shared/translation/hooks.js +15 -7
  103. package/dist/commonjs/shared/translation/hooks.js.map +1 -1
  104. package/dist/commonjs/shared/translation/index.js +25 -0
  105. package/dist/commonjs/shared/translation/index.js.map +1 -1
  106. package/dist/commonjs/shared/translation/localization/ca.json +61 -0
  107. package/dist/commonjs/shared/translation/localization/de.json +61 -0
  108. package/{src/shared/translation/schema.json → dist/commonjs/shared/translation/localization/en.json} +38 -43
  109. package/dist/commonjs/shared/translation/localization/gb.json +61 -0
  110. package/dist/commonjs/shared/translation/localization/sct.json +61 -0
  111. package/dist/commonjs/shared/translation/localization/sw.json +61 -0
  112. package/dist/commonjs/shared/translation/model.js +15 -0
  113. package/dist/commonjs/shared/translation/model.js.map +1 -0
  114. package/dist/commonjs/shared/translation/validation.types.js +6 -0
  115. package/dist/commonjs/shared/translation/validation.types.js.map +1 -0
  116. package/dist/module/features/chatbot/helpers.js +5 -1
  117. package/dist/module/features/chatbot/helpers.js.map +1 -1
  118. package/dist/module/features/chatbot/index.js.map +1 -1
  119. package/dist/module/features/chatbot/model/ChatBotModel.js +7 -6
  120. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  121. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +2 -1
  122. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  123. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +2 -3
  124. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  125. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +4 -3
  126. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  127. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +9 -5
  128. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  129. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +21 -72
  130. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  131. package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js +27 -0
  132. package/dist/module/features/keyboard/components/GeometryLayout/GeometryLayout.js.map +1 -0
  133. package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js +87 -0
  134. package/dist/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.js.map +1 -0
  135. package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js +21 -0
  136. package/dist/module/features/keyboard/components/SwitchableLayout/helpers.js.map +1 -0
  137. package/dist/module/features/keyboard/components/{AlgebraLayout → SwitchableLayout}/types.js +1 -1
  138. package/dist/module/features/keyboard/components/SwitchableLayout/types.js.map +1 -0
  139. package/dist/module/features/keyboard/constants/groups/geometry.constants.js +7 -0
  140. package/dist/module/features/keyboard/constants/groups/geometry.constants.js.map +1 -0
  141. package/dist/module/features/keyboard/constants/groups/index.js +1 -0
  142. package/dist/module/features/keyboard/constants/groups/index.js.map +1 -1
  143. package/dist/module/features/keyboard/constants/keyboard.constants.js +5 -0
  144. package/dist/module/features/keyboard/constants/keyboard.constants.js.map +1 -1
  145. package/dist/module/features/keyboard/constants/keyboard.helpers.js +3 -1
  146. package/dist/module/features/keyboard/constants/keyboard.helpers.js.map +1 -1
  147. package/dist/module/features/keyboard/constants/keyboardLayouts.js +19 -9
  148. package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  149. package/dist/module/features/keyboard/constants/keys/geometry.constants.js +86 -1
  150. package/dist/module/features/keyboard/constants/keys/geometry.constants.js.map +1 -1
  151. package/dist/module/features/keyboard/constants/keys/text.constants.js +9 -9
  152. package/dist/module/features/keyboard/constants/keys/units.constants.js +2 -1
  153. package/dist/module/features/keyboard/constants/keys/units.constants.js.map +1 -1
  154. package/dist/module/features/keyboard/types/types.js +1 -0
  155. package/dist/module/features/keyboard/types/types.js.map +1 -1
  156. package/dist/module/index.js +1 -0
  157. package/dist/module/index.js.map +1 -1
  158. package/dist/module/lib/types/keys.js +2 -0
  159. package/dist/module/lib/types/keys.js.map +1 -0
  160. package/dist/module/shared/icons/GeometryIcon.js +24 -0
  161. package/dist/module/shared/icons/GeometryIcon.js.map +1 -0
  162. package/dist/module/shared/icons/keyboard/AngleIcon.js +4 -3
  163. package/dist/module/shared/icons/keyboard/AngleIcon.js.map +1 -1
  164. package/dist/module/shared/icons/keyboard/BidirectionalSegmentIcon.js +13 -9
  165. package/dist/module/shared/icons/keyboard/BidirectionalSegmentIcon.js.map +1 -1
  166. package/dist/module/shared/icons/keyboard/ImpliesIcon.js +22 -0
  167. package/dist/module/shared/icons/keyboard/ImpliesIcon.js.map +1 -0
  168. package/dist/module/shared/icons/keyboard/LetterAIcon.js +21 -0
  169. package/dist/module/shared/icons/keyboard/LetterAIcon.js.map +1 -0
  170. package/dist/module/shared/icons/keyboard/LetterBIcon.js +21 -0
  171. package/dist/module/shared/icons/keyboard/LetterBIcon.js.map +1 -0
  172. package/dist/module/shared/icons/keyboard/LetterCIcon.js +21 -0
  173. package/dist/module/shared/icons/keyboard/LetterCIcon.js.map +1 -0
  174. package/dist/module/shared/icons/keyboard/LineSegmentIcon.js +12 -7
  175. package/dist/module/shared/icons/keyboard/LineSegmentIcon.js.map +1 -1
  176. package/dist/module/shared/icons/keyboard/RightDirectedSegmentIcon.js +13 -9
  177. package/dist/module/shared/icons/keyboard/RightDirectedSegmentIcon.js.map +1 -1
  178. package/dist/module/shared/icons/keyboard/ThereforeIcon.js +34 -0
  179. package/dist/module/shared/icons/keyboard/ThereforeIcon.js.map +1 -0
  180. package/dist/module/shared/icons/keyboard/TriangleIcon.js +24 -0
  181. package/dist/module/shared/icons/keyboard/TriangleIcon.js.map +1 -0
  182. package/dist/module/shared/translation/constants.js +15 -1
  183. package/dist/module/shared/translation/constants.js.map +1 -1
  184. package/dist/module/shared/translation/helpers.js +33 -6
  185. package/dist/module/shared/translation/helpers.js.map +1 -1
  186. package/dist/module/shared/translation/hooks.js +14 -7
  187. package/dist/module/shared/translation/hooks.js.map +1 -1
  188. package/dist/module/shared/translation/index.js +3 -2
  189. package/dist/module/shared/translation/index.js.map +1 -1
  190. package/dist/module/shared/translation/localization/ca.json +61 -0
  191. package/dist/module/shared/translation/localization/de.json +61 -0
  192. package/dist/{commonjs/shared/translation/schema.json → module/shared/translation/localization/en.json} +38 -43
  193. package/dist/module/shared/translation/localization/gb.json +61 -0
  194. package/dist/module/shared/translation/localization/sct.json +61 -0
  195. package/dist/module/shared/translation/localization/sw.json +61 -0
  196. package/dist/module/shared/translation/model.js +11 -0
  197. package/dist/module/shared/translation/model.js.map +1 -0
  198. package/dist/module/shared/translation/validation.types.js +4 -0
  199. package/dist/module/shared/translation/validation.types.js.map +1 -0
  200. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  201. package/dist/typescript/commonjs/features/chatbot/index.d.ts +1 -1
  202. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  203. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  204. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
  205. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  206. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
  207. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  208. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +8 -6
  209. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  210. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  211. package/dist/typescript/commonjs/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
  212. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts +1 -1
  213. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  214. package/dist/typescript/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts +4 -0
  215. package/dist/typescript/commonjs/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -0
  216. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +4 -0
  217. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -0
  218. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/helpers.d.ts +12 -0
  219. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -0
  220. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts +21 -0
  221. package/dist/typescript/commonjs/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -0
  222. package/dist/typescript/commonjs/features/keyboard/constants/groups/geometry.constants.d.ts +3 -0
  223. package/dist/typescript/commonjs/features/keyboard/constants/groups/geometry.constants.d.ts.map +1 -0
  224. package/dist/typescript/commonjs/features/keyboard/constants/groups/index.d.ts +1 -0
  225. package/dist/typescript/commonjs/features/keyboard/constants/groups/index.d.ts.map +1 -1
  226. package/dist/typescript/commonjs/features/keyboard/constants/keyboard.constants.d.ts +5 -0
  227. package/dist/typescript/commonjs/features/keyboard/constants/keyboard.constants.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
  229. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +13 -4
  230. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/features/keyboard/constants/keys/geometry.constants.d.ts.map +1 -1
  232. package/dist/typescript/commonjs/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/features/keyboard/types/types.d.ts +1 -0
  234. package/dist/typescript/commonjs/features/keyboard/types/types.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/index.d.ts +1 -0
  236. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  237. package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +1 -1
  238. package/dist/typescript/commonjs/lib/types/keys.d.ts +8 -0
  239. package/dist/typescript/commonjs/lib/types/keys.d.ts.map +1 -0
  240. package/dist/typescript/commonjs/shared/icons/GeometryIcon.d.ts +4 -0
  241. package/dist/typescript/commonjs/shared/icons/GeometryIcon.d.ts.map +1 -0
  242. package/dist/typescript/commonjs/shared/icons/keyboard/AngleIcon.d.ts.map +1 -1
  243. package/dist/typescript/commonjs/shared/icons/keyboard/BidirectionalSegmentIcon.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/shared/icons/keyboard/ImpliesIcon.d.ts +4 -0
  245. package/dist/typescript/commonjs/shared/icons/keyboard/ImpliesIcon.d.ts.map +1 -0
  246. package/dist/typescript/commonjs/shared/icons/keyboard/LetterAIcon.d.ts +4 -0
  247. package/dist/typescript/commonjs/shared/icons/keyboard/LetterAIcon.d.ts.map +1 -0
  248. package/dist/typescript/commonjs/shared/icons/keyboard/LetterBIcon.d.ts +4 -0
  249. package/dist/typescript/commonjs/shared/icons/keyboard/LetterBIcon.d.ts.map +1 -0
  250. package/dist/typescript/commonjs/shared/icons/keyboard/LetterCIcon.d.ts +4 -0
  251. package/dist/typescript/commonjs/shared/icons/keyboard/LetterCIcon.d.ts.map +1 -0
  252. package/dist/typescript/commonjs/shared/icons/keyboard/LineSegmentIcon.d.ts.map +1 -1
  253. package/dist/typescript/commonjs/shared/icons/keyboard/RightDirectedSegmentIcon.d.ts.map +1 -1
  254. package/dist/typescript/commonjs/shared/icons/keyboard/ThereforeIcon.d.ts +4 -0
  255. package/dist/typescript/commonjs/shared/icons/keyboard/ThereforeIcon.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/shared/icons/keyboard/TriangleIcon.d.ts +4 -0
  257. package/dist/typescript/commonjs/shared/icons/keyboard/TriangleIcon.d.ts.map +1 -0
  258. package/dist/typescript/commonjs/shared/translation/constants.d.ts +368 -1
  259. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  260. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +5 -1
  261. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -1
  262. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +3 -1
  263. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -1
  264. package/dist/typescript/commonjs/shared/translation/index.d.ts +3 -3
  265. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -1
  266. package/dist/typescript/commonjs/shared/translation/model.d.ts +125 -0
  267. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -0
  268. package/dist/typescript/commonjs/shared/translation/types.d.ts +4 -3
  269. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
  270. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +21 -0
  271. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +1 -0
  272. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  273. package/dist/typescript/module/features/chatbot/index.d.ts +1 -1
  274. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  275. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  276. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +1 -1
  277. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  278. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +2 -1
  279. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  280. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +8 -6
  281. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  282. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  283. package/dist/typescript/module/features/exampleSolution/model/ExampleSolutionApi.d.ts.map +1 -1
  284. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts +1 -1
  285. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  286. package/dist/typescript/module/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts +4 -0
  287. package/dist/typescript/module/features/keyboard/components/GeometryLayout/GeometryLayout.d.ts.map +1 -0
  288. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts +4 -0
  289. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/SwitchableLayout.d.ts.map +1 -0
  290. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/helpers.d.ts +12 -0
  291. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/helpers.d.ts.map +1 -0
  292. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts +21 -0
  293. package/dist/typescript/module/features/keyboard/components/SwitchableLayout/types.d.ts.map +1 -0
  294. package/dist/typescript/module/features/keyboard/constants/groups/geometry.constants.d.ts +3 -0
  295. package/dist/typescript/module/features/keyboard/constants/groups/geometry.constants.d.ts.map +1 -0
  296. package/dist/typescript/module/features/keyboard/constants/groups/index.d.ts +1 -0
  297. package/dist/typescript/module/features/keyboard/constants/groups/index.d.ts.map +1 -1
  298. package/dist/typescript/module/features/keyboard/constants/keyboard.constants.d.ts +5 -0
  299. package/dist/typescript/module/features/keyboard/constants/keyboard.constants.d.ts.map +1 -1
  300. package/dist/typescript/module/features/keyboard/constants/keyboard.helpers.d.ts.map +1 -1
  301. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +13 -4
  302. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  303. package/dist/typescript/module/features/keyboard/constants/keys/geometry.constants.d.ts.map +1 -1
  304. package/dist/typescript/module/features/keyboard/constants/keys/units.constants.d.ts.map +1 -1
  305. package/dist/typescript/module/features/keyboard/types/types.d.ts +1 -0
  306. package/dist/typescript/module/features/keyboard/types/types.d.ts.map +1 -1
  307. package/dist/typescript/module/index.d.ts +1 -0
  308. package/dist/typescript/module/index.d.ts.map +1 -1
  309. package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +1 -1
  310. package/dist/typescript/module/lib/types/keys.d.ts +8 -0
  311. package/dist/typescript/module/lib/types/keys.d.ts.map +1 -0
  312. package/dist/typescript/module/shared/icons/GeometryIcon.d.ts +4 -0
  313. package/dist/typescript/module/shared/icons/GeometryIcon.d.ts.map +1 -0
  314. package/dist/typescript/module/shared/icons/keyboard/AngleIcon.d.ts.map +1 -1
  315. package/dist/typescript/module/shared/icons/keyboard/BidirectionalSegmentIcon.d.ts.map +1 -1
  316. package/dist/typescript/module/shared/icons/keyboard/ImpliesIcon.d.ts +4 -0
  317. package/dist/typescript/module/shared/icons/keyboard/ImpliesIcon.d.ts.map +1 -0
  318. package/dist/typescript/module/shared/icons/keyboard/LetterAIcon.d.ts +4 -0
  319. package/dist/typescript/module/shared/icons/keyboard/LetterAIcon.d.ts.map +1 -0
  320. package/dist/typescript/module/shared/icons/keyboard/LetterBIcon.d.ts +4 -0
  321. package/dist/typescript/module/shared/icons/keyboard/LetterBIcon.d.ts.map +1 -0
  322. package/dist/typescript/module/shared/icons/keyboard/LetterCIcon.d.ts +4 -0
  323. package/dist/typescript/module/shared/icons/keyboard/LetterCIcon.d.ts.map +1 -0
  324. package/dist/typescript/module/shared/icons/keyboard/LineSegmentIcon.d.ts.map +1 -1
  325. package/dist/typescript/module/shared/icons/keyboard/RightDirectedSegmentIcon.d.ts.map +1 -1
  326. package/dist/typescript/module/shared/icons/keyboard/ThereforeIcon.d.ts +4 -0
  327. package/dist/typescript/module/shared/icons/keyboard/ThereforeIcon.d.ts.map +1 -0
  328. package/dist/typescript/module/shared/icons/keyboard/TriangleIcon.d.ts +4 -0
  329. package/dist/typescript/module/shared/icons/keyboard/TriangleIcon.d.ts.map +1 -0
  330. package/dist/typescript/module/shared/translation/constants.d.ts +368 -1
  331. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  332. package/dist/typescript/module/shared/translation/helpers.d.ts +5 -1
  333. package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -1
  334. package/dist/typescript/module/shared/translation/hooks.d.ts +3 -1
  335. package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -1
  336. package/dist/typescript/module/shared/translation/index.d.ts +3 -3
  337. package/dist/typescript/module/shared/translation/index.d.ts.map +1 -1
  338. package/dist/typescript/module/shared/translation/model.d.ts +125 -0
  339. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -0
  340. package/dist/typescript/module/shared/translation/types.d.ts +4 -3
  341. package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
  342. package/dist/typescript/module/shared/translation/validation.types.d.ts +21 -0
  343. package/dist/typescript/module/shared/translation/validation.types.d.ts.map +1 -0
  344. package/example/.expo/README.md +8 -0
  345. package/example/.expo/devices.json +3 -0
  346. package/example/.expo/web/cache/production/images/favicon/favicon-24272cdaeff82cc5facdaccd982a6f05b60c4504704bbf94c19a6388659880bb-contain-transparent/favicon-48.png +0 -0
  347. package/example/app.json +30 -0
  348. package/example/assets/adaptive-icon.png +0 -0
  349. package/example/assets/favicon.png +0 -0
  350. package/example/assets/icon.png +0 -0
  351. package/example/assets/splash-icon.png +0 -0
  352. package/example/babel.config.js +28 -0
  353. package/example/index.js +8 -0
  354. package/example/metro.config.js +18 -0
  355. package/example/package.json +25 -0
  356. package/example/src/App.tsx +8 -0
  357. package/example/tsconfig.json +6 -0
  358. package/package.json +4 -9
  359. package/src/features/chatbot/helpers.ts +2 -0
  360. package/src/features/chatbot/index.ts +9 -1
  361. package/src/features/chatbot/model/ChatBotModel.ts +7 -10
  362. package/src/features/chatbot/model/ChatBoxTextManager.ts +3 -2
  363. package/src/features/chatbot/model/DefaultMessageCreator.ts +3 -3
  364. package/src/features/chatbot/types/api.types.ts +11 -6
  365. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +4 -3
  366. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +9 -5
  367. package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +17 -73
  368. package/src/features/keyboard/components/GeometryLayout/GeometryLayout.tsx +21 -0
  369. package/src/features/keyboard/components/SwitchableLayout/SwitchableLayout.tsx +100 -0
  370. package/src/features/keyboard/components/SwitchableLayout/helpers.tsx +31 -0
  371. package/src/features/keyboard/components/SwitchableLayout/types.ts +24 -0
  372. package/src/features/keyboard/constants/groups/geometry.constants.ts +25 -0
  373. package/src/features/keyboard/constants/groups/index.ts +1 -0
  374. package/src/features/keyboard/constants/keyboard.constants.ts +6 -0
  375. package/src/features/keyboard/constants/keyboard.helpers.ts +3 -0
  376. package/src/features/keyboard/constants/keyboardLayouts.ts +15 -5
  377. package/src/features/keyboard/constants/keys/geometry.constants.tsx +61 -1
  378. package/src/features/keyboard/constants/keys/text.constants.tsx +9 -9
  379. package/src/features/keyboard/constants/keys/units.constants.tsx +1 -0
  380. package/src/features/keyboard/types/types.ts +1 -0
  381. package/src/index.ts +1 -0
  382. package/src/lib/types/keys.ts +18 -0
  383. package/src/shared/icons/GeometryIcon.tsx +18 -0
  384. package/src/shared/icons/keyboard/AngleIcon.tsx +4 -2
  385. package/src/shared/icons/keyboard/BidirectionalSegmentIcon.tsx +5 -8
  386. package/src/shared/icons/keyboard/ImpliesIcon.tsx +16 -0
  387. package/src/shared/icons/keyboard/LetterAIcon.tsx +14 -0
  388. package/src/shared/icons/keyboard/LetterBIcon.tsx +14 -0
  389. package/src/shared/icons/keyboard/LetterCIcon.tsx +14 -0
  390. package/src/shared/icons/keyboard/LineSegmentIcon.tsx +6 -7
  391. package/src/shared/icons/keyboard/RightDirectedSegmentIcon.tsx +5 -8
  392. package/src/shared/icons/keyboard/ThereforeIcon.tsx +15 -0
  393. package/src/shared/icons/keyboard/TriangleIcon.tsx +18 -0
  394. package/src/shared/translation/constants.ts +16 -1
  395. package/src/shared/translation/helpers.ts +45 -5
  396. package/src/shared/translation/hooks.ts +22 -6
  397. package/src/shared/translation/index.ts +3 -3
  398. package/src/shared/translation/localization/ca.json +61 -0
  399. package/src/shared/translation/localization/de.json +61 -0
  400. package/{dist/module/shared/translation/schema.json → src/shared/translation/localization/en.json} +38 -43
  401. package/src/shared/translation/localization/gb.json +61 -0
  402. package/src/shared/translation/localization/sct.json +61 -0
  403. package/src/shared/translation/localization/sw.json +61 -0
  404. package/src/shared/translation/model.ts +16 -0
  405. package/src/shared/translation/types.ts +19 -3
  406. package/src/shared/translation/validation.types.ts +34 -0
  407. package/tsconfig.build.json +4 -0
  408. package/tsconfig.json +34 -0
  409. package/yarn.lock +10957 -0
  410. package/dist/commonjs/features/keyboard/components/AlgebraLayout/helpers.js +0 -41
  411. package/dist/commonjs/features/keyboard/components/AlgebraLayout/helpers.js.map +0 -1
  412. package/dist/commonjs/features/keyboard/components/AlgebraLayout/types.js.map +0 -1
  413. package/dist/commonjs/shared/translation/react-i18next.d.js +0 -5
  414. package/dist/commonjs/shared/translation/react-i18next.d.js.map +0 -1
  415. package/dist/module/features/keyboard/components/AlgebraLayout/helpers.js +0 -36
  416. package/dist/module/features/keyboard/components/AlgebraLayout/helpers.js.map +0 -1
  417. package/dist/module/features/keyboard/components/AlgebraLayout/types.js.map +0 -1
  418. package/dist/module/shared/translation/react-i18next.d.js +0 -5
  419. package/dist/module/shared/translation/react-i18next.d.js.map +0 -1
  420. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/helpers.d.ts +0 -15
  421. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/helpers.d.ts.map +0 -1
  422. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/types.d.ts +0 -5
  423. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/types.d.ts.map +0 -1
  424. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/helpers.d.ts +0 -15
  425. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/helpers.d.ts.map +0 -1
  426. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/types.d.ts +0 -5
  427. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/types.d.ts.map +0 -1
  428. package/src/features/keyboard/components/AlgebraLayout/helpers.tsx +0 -52
  429. package/src/features/keyboard/components/AlgebraLayout/types.ts +0 -4
  430. package/src/shared/translation/react-i18next.d.ts +0 -21
@@ -1,7 +1,47 @@
1
- import i18next from 'i18next'
2
- import { NAMESPACE } from './constants'
3
- import { GetText } from './types'
1
+ import { LOCALIZATION_CONFIGS } from './constants'
2
+ import { $localization, setLocalization } from './model'
3
+ import { GetText, TranslationKeys, Translations } from './types'
4
4
 
5
- export const getText: GetText = (key, args = null) => {
6
- return i18next.t(key, { ns: NAMESPACE, ...(args || {}) }) as string
5
+ export function getTranslation(config: Translations, key: TranslationKeys) {
6
+ const rawTranslation = config?.[key as keyof Translations]
7
+ if (typeof rawTranslation === 'string' || !key.includes('.')) {
8
+ return rawTranslation as string
9
+ }
10
+ const keys = key.split('.')
11
+ let translation = config
12
+ for (const k of keys) {
13
+ if (translation[k as keyof Translations] === undefined) return key
14
+ translation = translation[k as keyof Translations] as any
15
+ }
16
+ if (typeof translation === 'string') {
17
+ return translation
18
+ }
19
+ return key
20
+ }
21
+
22
+ export const getSubstitutedString = (str: string, substitutions: Record<string, string> = {}) => {
23
+ const substitutionsArray = Object.entries(substitutions)
24
+ let result = str
25
+
26
+ if (!substitutionsArray.length) return result
27
+
28
+ substitutionsArray.forEach(([key, value]) => {
29
+ result = result.replace(`{{${key}}}`, value)
30
+ })
31
+
32
+ return result
33
+ }
34
+
35
+ export const getText: GetText = (key: TranslationKeys, args = null) => {
36
+ const config = $localization.getState()
37
+
38
+ const translation = getTranslation(config, key)
39
+ if (args) return getSubstitutedString(translation, args)
40
+ return translation
41
+ }
42
+
43
+ export const setFeaturesLocalization = (
44
+ generator: ((config: typeof LOCALIZATION_CONFIGS) => Translations) | Translations,
45
+ ) => {
46
+ setLocalization(generator)
7
47
  }
@@ -1,9 +1,25 @@
1
- import { useCallback } from 'react'
2
- import { useTranslation } from 'react-i18next'
3
- import { NAMESPACE } from './constants'
4
- import { GetText } from './types'
1
+ import { useUnit } from 'effector-react'
2
+ import { $localization, setLocalization } from './model'
3
+ import { GetText, Translations } from './types'
4
+ import { useCallback, useEffect } from 'react'
5
+ import { LOCALIZATION_CONFIGS } from './constants'
6
+ import { getSubstitutedString, getTranslation } from './helpers'
5
7
 
6
8
  export const useText = (): GetText => {
7
- const { t } = useTranslation(NAMESPACE)
8
- return useCallback<GetText>((key, args = null) => t(key, args ?? undefined) as string, [t])
9
+ const config = useUnit($localization)
10
+ return useCallback<GetText>(
11
+ (key, args = null) => {
12
+ const translation = getTranslation(config, key)
13
+ return args ? getSubstitutedString(translation, args) : translation
14
+ },
15
+ [config],
16
+ )
17
+ }
18
+
19
+ export const useFeaturesLocalization = (
20
+ generator: ((config: typeof LOCALIZATION_CONFIGS) => Translations) | Translations,
21
+ ) => {
22
+ useEffect(() => {
23
+ setLocalization(generator)
24
+ }, [generator])
9
25
  }
@@ -1,3 +1,3 @@
1
- export { useText } from './hooks'
2
- export { getText as t } from './helpers'
3
- export type { TranslationKeys, GetText } from './types'
1
+ export { useFeaturesLocalization, useText } from './hooks'
2
+ export { setFeaturesLocalization, getText as t } from './helpers'
3
+ export { $localization, setLocalization } from './model'
@@ -0,0 +1,61 @@
1
+ {
2
+ "locale": "en-CA",
3
+ "teacherFeedback.noComments": "No comments yet",
4
+ "time.justNow": "just now",
5
+ "time.minuteAgo": "minute ago",
6
+ "time.minutesAgo": "{{count}} minutes ago",
7
+ "time.hourAgo": "hour ago",
8
+ "time.hoursAgo": "{{count}} hours ago",
9
+ "time.dayAgo": "day ago",
10
+ "time.daysAgo": "{{count}} days ago",
11
+ "time.monthAgo": "month ago",
12
+ "time.monthsAgo": "{{count}} months ago",
13
+ "time.yearAgo": "year ago",
14
+ "time.yearsAgo": "{{count}} years ago",
15
+ "chat": {
16
+ "anotherHint": "Give me another hint",
17
+ "getHint": "Get a hint",
18
+ "needHint": "I need a hint",
19
+ "giveHintOpenChat": "I need a hint",
20
+ "answerAgain": "Answer again to get another hint!",
21
+ "errorMessage": "Something went wrong! Try again",
22
+ "howCanIHelp": "Hi! Do you want help?",
23
+ "showError": "Show error",
24
+ "inputPlaceholder": "Type..."
25
+ },
26
+ "gifCelebrations": {
27
+ "greatStart": "Great start!",
28
+ "onTheWay": "On the way!",
29
+ "almostThere": "Almost there"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Example solution",
33
+ "letMeThink": "Let me think...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Something went wrong with generating an example solution"
36
+ },
37
+ "keyboard": {
38
+ "length": "Length",
39
+ "area": "Area",
40
+ "volume": "Volume",
41
+ "weight": "Weight",
42
+ "time": "Time"
43
+ },
44
+ "voice": {
45
+ "deleteRecording": "Delete recording?",
46
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
47
+ "recordingDeleted": "Recording successfully deleted.",
48
+ "delete": "Delete",
49
+ "cancel": "Cancel",
50
+ "noMicrophoneAccess": "No microphone access.",
51
+ "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
52
+ "noMicrophoneFound": "No microphone found.",
53
+ "uploadFailed": "Upload failed. Please try again.",
54
+ "redoRecording": "Redo recording?",
55
+ "redo": "Redo",
56
+ "thisWillRemoveRecording": "This will remove your previous recording.",
57
+ "transcriptions": "Transcriptions",
58
+ "attempt": "Attempt {{number}}",
59
+ "transcriptNotAvailable": "Transcript not available"
60
+ }
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "locale": "de-DE",
3
+ "teacherFeedback.noComments": "Noch keine Kommentare",
4
+ "time.justNow": "gerade eben",
5
+ "time.minuteAgo": "vor einer Minute",
6
+ "time.minutesAgo": "vor {{count}} Minuten",
7
+ "time.hourAgo": "vor einer Stunde",
8
+ "time.hoursAgo": "vor {{count}} Stunden",
9
+ "time.dayAgo": "vor einem Tag",
10
+ "time.daysAgo": "vor {{count}} Tagen",
11
+ "time.monthAgo": "vor einem Monat",
12
+ "time.monthsAgo": "vor {{count}} Monaten",
13
+ "time.yearAgo": "vor einem Jahr",
14
+ "time.yearsAgo": "vor {{count}} Jahren",
15
+ "chat": {
16
+ "anotherHint": "Gib mir noch einen Hinweis",
17
+ "getHint": "Einen Hinweis erhalten",
18
+ "needHint": "Ich brauche einen Hinweis",
19
+ "giveHintOpenChat": "Ich brauche einen Hinweis",
20
+ "answerAgain": "Noch einmal antworten, um einen weiteren Hinweis zu bekommen!",
21
+ "errorMessage": "Etwas ist schiefgelaufen! Versuch es erneut",
22
+ "howCanIHelp": "Hi! Möchtest du Hilfe?",
23
+ "showError": "Fehler anzeigen",
24
+ "inputPlaceholder": "Tippe..."
25
+ },
26
+ "gifCelebrations": {
27
+ "greatStart": "Toller Start!",
28
+ "onTheWay": "Auf dem Weg!",
29
+ "almostThere": "Fast geschafft"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Beispiellösung",
33
+ "letMeThink": "Lass mich nachdenken...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Beim Erstellen einer Beispiellösung ist etwas schiefgelaufen"
36
+ },
37
+ "keyboard": {
38
+ "length": "Länge",
39
+ "area": "Fläche",
40
+ "volume": "Volumen",
41
+ "weight": "Gewicht",
42
+ "time": "Zeit"
43
+ },
44
+ "voice": {
45
+ "deleteRecording": "Aufnahme löschen?",
46
+ "youWontBeAbleToRecover": "Du kannst die Datei nicht wiederherstellen, wenn sie einmal gelöscht ist.",
47
+ "recordingDeleted": "Aufnahme gelöscht.",
48
+ "delete": "Löschen",
49
+ "cancel": "Abbrechen",
50
+ "noMicrophoneAccess": "Kein Mikrofon-Zugriff.",
51
+ "noMicrophoneAccessBySystem": "Mikrofonzugriff durch Systemeinstellungen verweigert.",
52
+ "noMicrophoneFound": "Kein Mikrofon gefunden.",
53
+ "uploadFailed": "Hochladen fehlgeschlagen. Bitte versuche es erneut.",
54
+ "redoRecording": "Aufnahme erneut aufnehmen?",
55
+ "redo": "Wiederholen",
56
+ "thisWillRemoveRecording": "Dadurch wird die Aufnahme entfernt.",
57
+ "transcriptions": "Transkriptionen",
58
+ "attempt": "Versuch {{number}}",
59
+ "transcriptNotAvailable": "Transkript nicht verfügbar"
60
+ }
61
+ }
@@ -1,66 +1,61 @@
1
1
  {
2
+ "locale": "en-SE",
3
+ "teacherFeedback.noComments": "No comments yet",
4
+ "time.justNow": "just now",
5
+ "time.minuteAgo": "minute ago",
6
+ "time.minutesAgo": "{{count}} minutes ago",
7
+ "time.hourAgo": "hour ago",
8
+ "time.hoursAgo": "{{count}} hours ago",
9
+ "time.dayAgo": "day ago",
10
+ "time.daysAgo": "{{count}} days ago",
11
+ "time.monthAgo": "month ago",
12
+ "time.monthsAgo": "{{count}} months ago",
13
+ "time.yearAgo": "year ago",
14
+ "time.yearsAgo": "{{count}} years ago",
2
15
  "chat": {
3
16
  "anotherHint": "Give me another hint",
4
- "answerAgain": "Answer again to get another hint!",
5
- "errorMessage": "Something went wrong! Try again",
6
17
  "getHint": "Get a hint",
7
- "giveHint": "I need a hint",
18
+ "needHint": "I need a hint",
8
19
  "giveHintOpenChat": "I need a hint",
20
+ "answerAgain": "Answer again to get another hint!",
21
+ "errorMessage": "Something went wrong! Try again",
9
22
  "howCanIHelp": "Hi! Do you want help?",
10
- "inputPlaceholder": "Type...",
11
- "needHint": "I need a hint",
12
- "showError": "Show error"
13
- },
14
- "exampleSolution": {
15
- "aha": "Aha!",
16
- "errorMessage": "Something went wrong with generating an example solution",
17
- "exampleSolution": "Example solution",
18
- "letMeThink": "Let me think..."
23
+ "showError": "Show error",
24
+ "inputPlaceholder": "Type..."
19
25
  },
20
26
  "gifCelebrations": {
21
- "almostThere": "Almost there",
22
27
  "greatStart": "Great start!",
23
- "onTheWay": "On the way!"
28
+ "onTheWay": "On the way!",
29
+ "almostThere": "Almost there"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Example solution",
33
+ "letMeThink": "Let me think...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Something went wrong with generating an example solution"
24
36
  },
25
37
  "keyboard": {
26
- "area": "Area",
27
38
  "length": "Length",
28
- "time": "Time",
39
+ "area": "Area",
29
40
  "volume": "Volume",
30
- "weight": "Weight"
31
- },
32
- "locale": "en-SE",
33
- "teacherFeedback": {
34
- "noComments": "No comments yet"
35
- },
36
- "time": {
37
- "dayAgo": "day ago",
38
- "daysAgo": "{{count}} days ago",
39
- "hourAgo": "hour ago",
40
- "hoursAgo": "{{count}} hours ago",
41
- "justNow": "just now",
42
- "minuteAgo": "minute ago",
43
- "minutesAgo": "{{count}} minutes ago",
44
- "monthAgo": "month ago",
45
- "monthsAgo": "{{count}} months ago",
46
- "yearAgo": "year ago",
47
- "yearsAgo": "{{count}} years ago"
41
+ "weight": "Weight",
42
+ "time": "Time"
48
43
  },
49
44
  "voice": {
50
- "attempt": "Attempt '{{'number'}}'",
51
- "cancel": "Cancel",
52
- "delete": "Delete",
53
45
  "deleteRecording": "Delete recording?",
46
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
47
+ "recordingDeleted": "Recording successfully deleted.",
48
+ "delete": "Delete",
49
+ "cancel": "Cancel",
54
50
  "noMicrophoneAccess": "No microphone access.",
55
51
  "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
56
52
  "noMicrophoneFound": "No microphone found.",
57
- "recordingDeleted": "Recording successfully deleted.",
58
- "redo": "Redo",
53
+ "uploadFailed": "Upload failed. Please try again.",
59
54
  "redoRecording": "Redo recording?",
55
+ "redo": "Redo",
60
56
  "thisWillRemoveRecording": "This will remove your previous recording.",
61
57
  "transcriptions": "Transcriptions",
62
- "transcriptNotAvailable": "Transcript not available",
63
- "uploadFailed": "Upload failed. Please try again.",
64
- "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone."
58
+ "attempt": "Attempt {{number}}",
59
+ "transcriptNotAvailable": "Transcript not available"
65
60
  }
66
- }
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "locale": "en-GB",
3
+ "teacherFeedback.noComments": "No comments yet",
4
+ "time.justNow": "just now",
5
+ "time.minuteAgo": "minute ago",
6
+ "time.minutesAgo": "{{count}} minutes ago",
7
+ "time.hourAgo": "hour ago",
8
+ "time.hoursAgo": "{{count}} hours ago",
9
+ "time.dayAgo": "day ago",
10
+ "time.daysAgo": "{{count}} days ago",
11
+ "time.monthAgo": "month ago",
12
+ "time.monthsAgo": "{{count}} months ago",
13
+ "time.yearAgo": "year ago",
14
+ "time.yearsAgo": "{{count}} years ago",
15
+ "chat": {
16
+ "anotherHint": "Give me another hint",
17
+ "getHint": "Get a hint",
18
+ "needHint": "I need a hint",
19
+ "giveHintOpenChat": "I need a hint",
20
+ "answerAgain": "Answer again to get another hint!",
21
+ "errorMessage": "Something went wrong! Try again",
22
+ "howCanIHelp": "Hi! Do you want help?",
23
+ "showError": "Show error",
24
+ "inputPlaceholder": "Type..."
25
+ },
26
+ "gifCelebrations": {
27
+ "greatStart": "Great start!",
28
+ "onTheWay": "On the way!",
29
+ "almostThere": "Almost there"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Example solution",
33
+ "letMeThink": "Let me think...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Something went wrong with generating an example solution"
36
+ },
37
+ "keyboard": {
38
+ "length": "Length",
39
+ "area": "Area",
40
+ "volume": "Volume",
41
+ "weight": "Weight",
42
+ "time": "Time"
43
+ },
44
+ "voice": {
45
+ "deleteRecording": "Delete recording?",
46
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
47
+ "recordingDeleted": "Recording successfully deleted.",
48
+ "delete": "Delete",
49
+ "cancel": "Cancel",
50
+ "noMicrophoneAccess": "No microphone access.",
51
+ "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
52
+ "noMicrophoneFound": "No microphone found.",
53
+ "uploadFailed": "Upload failed. Please try again.",
54
+ "redoRecording": "Redo recording?",
55
+ "redo": "Redo",
56
+ "thisWillRemoveRecording": "This will remove your previous recording.",
57
+ "transcriptions": "Transcriptions",
58
+ "attempt": "Attempt {{number}}",
59
+ "transcriptNotAvailable": "Transcript not available"
60
+ }
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "locale": "en-SCT",
3
+ "teacherFeedback.noComments": "No comments yet",
4
+ "time.justNow": "just now",
5
+ "time.minuteAgo": "minute ago",
6
+ "time.minutesAgo": "{{count}} minutes ago",
7
+ "time.hourAgo": "hour ago",
8
+ "time.hoursAgo": "{{count}} hours ago",
9
+ "time.dayAgo": "day ago",
10
+ "time.daysAgo": "{{count}} days ago",
11
+ "time.monthAgo": "month ago",
12
+ "time.monthsAgo": "{{count}} months ago",
13
+ "time.yearAgo": "year ago",
14
+ "time.yearsAgo": "{{count}} years ago",
15
+ "chat": {
16
+ "anotherHint": "Give me another hint",
17
+ "getHint": "Get a hint",
18
+ "needHint": "I need a hint",
19
+ "giveHintOpenChat": "I need a hint",
20
+ "answerAgain": "Answer again to get another hint!",
21
+ "errorMessage": "Something went wrong! Try again",
22
+ "howCanIHelp": "Hi! Do you want help?",
23
+ "showError": "Show error",
24
+ "inputPlaceholder": "Type..."
25
+ },
26
+ "gifCelebrations": {
27
+ "greatStart": "Great start!",
28
+ "onTheWay": "On the way!",
29
+ "almostThere": "Almost there"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Example solution",
33
+ "letMeThink": "Let me think...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Something went wrong with generating an example solution"
36
+ },
37
+ "keyboard": {
38
+ "length": "Length",
39
+ "area": "Area",
40
+ "volume": "Volume",
41
+ "weight": "Weight",
42
+ "time": "Time"
43
+ },
44
+ "voice": {
45
+ "deleteRecording": "Delete recording?",
46
+ "youWontBeAbleToRecover": "You won't be able to recover this file once it's gone.",
47
+ "recordingDeleted": "Recording successfully deleted.",
48
+ "delete": "Delete",
49
+ "cancel": "Cancel",
50
+ "noMicrophoneAccess": "No microphone access.",
51
+ "noMicrophoneAccessBySystem": "Microphone access denied by system settings.",
52
+ "noMicrophoneFound": "No microphone found.",
53
+ "uploadFailed": "Upload failed. Please try again.",
54
+ "redoRecording": "Redo recording?",
55
+ "redo": "Redo",
56
+ "thisWillRemoveRecording": "This will remove your previous recording.",
57
+ "transcriptions": "Transcriptions",
58
+ "attempt": "Attempt {{number}}",
59
+ "transcriptNotAvailable": "Transcript not available"
60
+ }
61
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "locale": "sv-SE",
3
+ "teacherFeedback.noComments": "Inga kommentarer än",
4
+ "time.justNow": "alldeles nyss",
5
+ "time.minuteAgo": "minut sedan",
6
+ "time.minutesAgo": "{{count}} minuter sedan",
7
+ "time.hourAgo": "timme sedan",
8
+ "time.hoursAgo": "{{count}} timmar sedan",
9
+ "time.dayAgo": "dag sedan",
10
+ "time.daysAgo": "{{count}} dagar sedan",
11
+ "time.monthAgo": "månad sedan",
12
+ "time.monthsAgo": "{{count}} månader sedan",
13
+ "time.yearAgo": "år sedan",
14
+ "time.yearsAgo": "{{count}} år sedan",
15
+ "chat": {
16
+ "anotherHint": "Ge mig en till ledtråd",
17
+ "getHint": "Få en ledtråd",
18
+ "needHint": "Ge mig en ledtråd",
19
+ "giveHintOpenChat": "Ge ledtråd",
20
+ "answerAgain": "Svara igen för att få en till ledtråd!",
21
+ "errorMessage": "Något gick snett! Försök igen",
22
+ "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
23
+ "showError": "Visa fel",
24
+ "inputPlaceholder": "Skriv..."
25
+ },
26
+ "gifCelebrations": {
27
+ "greatStart": "Bra start!",
28
+ "onTheWay": "På god väg!",
29
+ "almostThere": "Nästan där"
30
+ },
31
+ "exampleSolution": {
32
+ "exampleSolution": "Lösningsexempel",
33
+ "letMeThink": "Låt mig tänka...",
34
+ "aha": "Aha!",
35
+ "errorMessage": "Något gick snett med att generera en exempellösning"
36
+ },
37
+ "keyboard": {
38
+ "length": "Längd",
39
+ "area": "Area",
40
+ "volume": "Volym",
41
+ "weight": "Vikt",
42
+ "time": "Tid"
43
+ },
44
+ "voice": {
45
+ "deleteRecording": "Radera inspelningen?",
46
+ "youWontBeAbleToRecover": "Du kommer inte att kunna återställa filen när den väl är borta.",
47
+ "recordingDeleted": "Inspelningen raderad.",
48
+ "delete": "Radera",
49
+ "cancel": "Avbryt",
50
+ "noMicrophoneAccess": "Ingen mikrofonåtkomst.",
51
+ "noMicrophoneAccessBySystem": "Mikrofonåtkomst nekad av systeminställningar.",
52
+ "noMicrophoneFound": "Ingen mikrofon hittades.",
53
+ "uploadFailed": "Uppladdning misslyckades. Försök igen.",
54
+ "redoRecording": "Spela in igen?",
55
+ "redo": "Gör om",
56
+ "thisWillRemoveRecording": "Detta tar bort inspelningen.",
57
+ "transcriptions": "Transkriptioner",
58
+ "attempt": "Försök {{number}}",
59
+ "transcriptNotAvailable": "Transkript inte tillgängligt"
60
+ }
61
+ }
@@ -0,0 +1,16 @@
1
+ import { createEvent, createStore } from 'effector'
2
+ import { Translations } from './types'
3
+ import { LOCALIZATION_CONFIGS } from './constants'
4
+ import { Locale } from '@magmamath/frontend-config'
5
+
6
+ export const setLocalization = createEvent<
7
+ Translations | ((config: typeof LOCALIZATION_CONFIGS) => Translations)
8
+ >()
9
+
10
+ export const $localization = createStore<Translations>(LOCALIZATION_CONFIGS[Locale.US]).on(
11
+ setLocalization,
12
+ (state, payload) => {
13
+ if (typeof payload === 'function') return payload(LOCALIZATION_CONFIGS)
14
+ return payload
15
+ },
16
+ )
@@ -1,5 +1,21 @@
1
- import { TFuncKey } from 'i18next'
2
- import { NAMESPACE } from './constants'
1
+ import enTranslations from './localization/en.json'
2
+ import swTranslations from './localization/sw.json'
3
+ import gbTranslations from './localization/gb.json'
4
+ import caTranslations from './localization/ca.json'
5
+ import sctTranslations from './localization/sct.json'
6
+ import deTranslations from './localization/de.json'
3
7
 
4
- export type TranslationKeys = TFuncKey<typeof NAMESPACE>
8
+ import { RetrieveKeys } from '../../lib/types/keys'
9
+ import { ISValidTranslation } from './validation.types'
10
+
11
+ export type Translations = typeof enTranslations
12
+ export type TranslationKeys = RetrieveKeys<Translations>
5
13
  export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string
14
+
15
+ // Validation of translations, do not remove
16
+ type ISValidEN = ISValidTranslation<Translations>
17
+ type ISValidSW = ISValidTranslation<typeof swTranslations>
18
+ type ISValidGB = ISValidTranslation<typeof gbTranslations>
19
+ type ISValidCA = ISValidTranslation<typeof caTranslations>
20
+ type ISValidSCT = ISValidTranslation<typeof sctTranslations>
21
+ type ISValidDE = ISValidTranslation<typeof deTranslations>
@@ -0,0 +1,34 @@
1
+ import enTranslations from './localization/en.json'
2
+ import swTranslations from './localization/sw.json'
3
+ import gbTranslations from './localization/gb.json'
4
+ import caTranslations from './localization/ca.json'
5
+ import sctTranslations from './localization/sct.json'
6
+
7
+ type Extends<T, U> = T extends U ? true : false
8
+
9
+ type ExtendsAll<Candidate, Types extends unknown[]> = Types extends [infer Head, ...infer Tail]
10
+ ? Extends<Candidate, Head> extends true
11
+ ? ExtendsAll<Candidate, Tail>
12
+ : false
13
+ : true
14
+
15
+ type FindDominantType<Types extends unknown[]> = Types extends [
16
+ infer First,
17
+ ...infer Rest extends unknown[],
18
+ ]
19
+ ? ExtendsAll<First, Rest> extends true
20
+ ? First
21
+ : FindDominantType<Rest>
22
+ : never
23
+
24
+ type DominantTranslation = FindDominantType<
25
+ [
26
+ typeof enTranslations,
27
+ typeof swTranslations,
28
+ typeof gbTranslations,
29
+ typeof caTranslations,
30
+ typeof sctTranslations,
31
+ ]
32
+ >
33
+
34
+ export type ISValidTranslation<T extends DominantTranslation> = T
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig",
3
+ "exclude": ["example", "dist"]
4
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@magmamath/students-features": ["./src/index"]
5
+ },
6
+ "target": "esnext",
7
+ "baseUrl": "./",
8
+ "lib": [
9
+ "dom",
10
+ "dom.iterable",
11
+ "esnext"
12
+ ],
13
+ "declaration": true,
14
+ "allowJs": true,
15
+ "skipLibCheck": true,
16
+ "esModuleInterop": true,
17
+ "allowSyntheticDefaultImports": true,
18
+ "strict": true,
19
+ "forceConsistentCasingInFileNames": true,
20
+ "module": "esnext",
21
+ "moduleResolution": "node",
22
+ "resolveJsonModule": true,
23
+ "isolatedModules": true,
24
+ "jsx": "react",
25
+ "experimentalDecorators": true
26
+ },
27
+ "include": [
28
+ "src"
29
+ ],
30
+ "exclude": [
31
+ "node_modules",
32
+ "example"
33
+ ]
34
+ }