@magmamath/students-features 1.8.4-rc.8 → 1.8.4

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 (274) hide show
  1. package/dist/commonjs/features/pmProgress/shared/TreeNormalizer.js +5 -1
  2. package/dist/commonjs/features/pmProgress/shared/TreeNormalizer.js.map +1 -1
  3. package/dist/commonjs/features/uiMode/index.js +7 -0
  4. package/dist/commonjs/features/uiMode/index.js.map +1 -1
  5. package/dist/commonjs/features/uiMode/uiMode.helpers.js +7 -2
  6. package/dist/commonjs/features/uiMode/uiMode.helpers.js.map +1 -1
  7. package/dist/commonjs/index.js +0 -12
  8. package/dist/commonjs/index.js.map +1 -1
  9. package/dist/module/features/pmProgress/shared/TreeNormalizer.js +5 -1
  10. package/dist/module/features/pmProgress/shared/TreeNormalizer.js.map +1 -1
  11. package/dist/module/features/uiMode/index.js +1 -0
  12. package/dist/module/features/uiMode/index.js.map +1 -1
  13. package/dist/module/features/uiMode/uiMode.helpers.js +6 -1
  14. package/dist/module/features/uiMode/uiMode.helpers.js.map +1 -1
  15. package/dist/module/index.js +0 -1
  16. package/dist/module/index.js.map +1 -1
  17. package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
  18. package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
  19. package/dist/typescript/commonjs/features/uiMode/index.d.ts +1 -0
  20. package/dist/typescript/commonjs/features/uiMode/index.d.ts.map +1 -1
  21. package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts +2 -0
  22. package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts.map +1 -1
  23. package/dist/typescript/commonjs/index.d.ts +0 -1
  24. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  25. package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
  26. package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
  27. package/dist/typescript/module/features/uiMode/index.d.ts +1 -0
  28. package/dist/typescript/module/features/uiMode/index.d.ts.map +1 -1
  29. package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts +2 -0
  30. package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts.map +1 -1
  31. package/dist/typescript/module/index.d.ts +0 -1
  32. package/dist/typescript/module/index.d.ts.map +1 -1
  33. package/package.json +2 -5
  34. package/src/features/pmProgress/shared/TreeNormalizer.ts +5 -1
  35. package/src/features/uiMode/__tests__/getUIMode.test.ts +64 -0
  36. package/src/features/uiMode/index.ts +1 -0
  37. package/src/features/uiMode/uiMode.helpers.ts +16 -1
  38. package/src/i18n/.generated/schema.json +1 -9
  39. package/src/index.ts +0 -1
  40. package/dist/commonjs/features/profile/Profile.js +0 -90
  41. package/dist/commonjs/features/profile/Profile.js.map +0 -1
  42. package/dist/commonjs/features/profile/components/actions/ProfileActions.js +0 -67
  43. package/dist/commonjs/features/profile/components/actions/ProfileActions.js.map +0 -1
  44. package/dist/commonjs/features/profile/components/cards/ProfileCard.js +0 -57
  45. package/dist/commonjs/features/profile/components/cards/ProfileCard.js.map +0 -1
  46. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js +0 -90
  47. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js.map +0 -1
  48. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js +0 -154
  49. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js.map +0 -1
  50. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js +0 -61
  51. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
  52. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js +0 -126
  53. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
  54. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js +0 -22
  55. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
  56. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js +0 -70
  57. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js.map +0 -1
  58. package/dist/commonjs/features/profile/components/settings/SettingRow.js +0 -48
  59. package/dist/commonjs/features/profile/components/settings/SettingRow.js.map +0 -1
  60. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js +0 -74
  61. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js.map +0 -1
  62. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js +0 -116
  63. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js.map +0 -1
  64. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js +0 -35
  65. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
  66. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js +0 -60
  67. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
  68. package/dist/commonjs/features/profile/context/ProfileContext.js +0 -18
  69. package/dist/commonjs/features/profile/context/ProfileContext.js.map +0 -1
  70. package/dist/commonjs/features/profile/index.js +0 -80
  71. package/dist/commonjs/features/profile/index.js.map +0 -1
  72. package/dist/commonjs/features/profile/model/ProfileApi.js +0 -15
  73. package/dist/commonjs/features/profile/model/ProfileApi.js.map +0 -1
  74. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js +0 -60
  75. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js.map +0 -1
  76. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js +0 -30
  77. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js.map +0 -1
  78. package/dist/commonjs/features/profile/model/ProfileModel.js +0 -53
  79. package/dist/commonjs/features/profile/model/ProfileModel.js.map +0 -1
  80. package/dist/commonjs/features/profile/model/profileModal.types.js +0 -6
  81. package/dist/commonjs/features/profile/model/profileModal.types.js.map +0 -1
  82. package/dist/commonjs/features/profile/shared/JoinClassError.js +0 -16
  83. package/dist/commonjs/features/profile/shared/JoinClassError.js.map +0 -1
  84. package/dist/commonjs/features/profile/shared/profile.constants.js +0 -29
  85. package/dist/commonjs/features/profile/shared/profile.constants.js.map +0 -1
  86. package/dist/commonjs/features/profile/shared/profile.helpers.js +0 -40
  87. package/dist/commonjs/features/profile/shared/profile.helpers.js.map +0 -1
  88. package/dist/commonjs/features/profile/shared/profile.types.js +0 -6
  89. package/dist/commonjs/features/profile/shared/profile.types.js.map +0 -1
  90. package/dist/module/features/profile/Profile.js +0 -84
  91. package/dist/module/features/profile/Profile.js.map +0 -1
  92. package/dist/module/features/profile/components/actions/ProfileActions.js +0 -61
  93. package/dist/module/features/profile/components/actions/ProfileActions.js.map +0 -1
  94. package/dist/module/features/profile/components/cards/ProfileCard.js +0 -51
  95. package/dist/module/features/profile/components/cards/ProfileCard.js.map +0 -1
  96. package/dist/module/features/profile/components/info/AccountInfoCard.js +0 -84
  97. package/dist/module/features/profile/components/info/AccountInfoCard.js.map +0 -1
  98. package/dist/module/features/profile/components/modals/JoinClassModal.js +0 -147
  99. package/dist/module/features/profile/components/modals/JoinClassModal.js.map +0 -1
  100. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js +0 -55
  101. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
  102. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js +0 -120
  103. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
  104. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js +0 -16
  105. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
  106. package/dist/module/features/profile/components/settings/PreferencesCard.js +0 -64
  107. package/dist/module/features/profile/components/settings/PreferencesCard.js.map +0 -1
  108. package/dist/module/features/profile/components/settings/SettingRow.js +0 -42
  109. package/dist/module/features/profile/components/settings/SettingRow.js.map +0 -1
  110. package/dist/module/features/profile/components/settings/TextSettingsCard.js +0 -68
  111. package/dist/module/features/profile/components/settings/TextSettingsCard.js.map +0 -1
  112. package/dist/module/features/profile/components/settings/TextSizeSlider.js +0 -109
  113. package/dist/module/features/profile/components/settings/TextSizeSlider.js.map +0 -1
  114. package/dist/module/features/profile/components/settings/TextToSpeechRow.js +0 -29
  115. package/dist/module/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
  116. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js +0 -54
  117. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
  118. package/dist/module/features/profile/context/ProfileContext.js +0 -13
  119. package/dist/module/features/profile/context/ProfileContext.js.map +0 -1
  120. package/dist/module/features/profile/index.js +0 -11
  121. package/dist/module/features/profile/index.js.map +0 -1
  122. package/dist/module/features/profile/model/ProfileApi.js +0 -10
  123. package/dist/module/features/profile/model/ProfileApi.js.map +0 -1
  124. package/dist/module/features/profile/model/ProfileJoinClassModel.js +0 -55
  125. package/dist/module/features/profile/model/ProfileJoinClassModel.js.map +0 -1
  126. package/dist/module/features/profile/model/ProfileLanguageModel.js +0 -25
  127. package/dist/module/features/profile/model/ProfileLanguageModel.js.map +0 -1
  128. package/dist/module/features/profile/model/ProfileModel.js +0 -48
  129. package/dist/module/features/profile/model/ProfileModel.js.map +0 -1
  130. package/dist/module/features/profile/model/profileModal.types.js +0 -4
  131. package/dist/module/features/profile/model/profileModal.types.js.map +0 -1
  132. package/dist/module/features/profile/shared/JoinClassError.js +0 -11
  133. package/dist/module/features/profile/shared/JoinClassError.js.map +0 -1
  134. package/dist/module/features/profile/shared/profile.constants.js +0 -25
  135. package/dist/module/features/profile/shared/profile.constants.js.map +0 -1
  136. package/dist/module/features/profile/shared/profile.helpers.js +0 -32
  137. package/dist/module/features/profile/shared/profile.helpers.js.map +0 -1
  138. package/dist/module/features/profile/shared/profile.types.js +0 -4
  139. package/dist/module/features/profile/shared/profile.types.js.map +0 -1
  140. package/dist/typescript/commonjs/features/profile/Profile.d.ts +0 -6
  141. package/dist/typescript/commonjs/features/profile/Profile.d.ts.map +0 -1
  142. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
  143. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
  144. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
  145. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
  146. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts +0 -3
  147. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
  148. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts +0 -10
  149. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
  150. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts +0 -3
  151. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
  152. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts +0 -4
  153. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
  154. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
  155. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
  156. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
  157. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
  158. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
  159. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
  160. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts +0 -3
  161. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
  162. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts +0 -11
  163. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts.map +0 -1
  164. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
  165. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
  166. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
  167. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
  168. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
  169. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
  170. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
  171. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
  172. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts +0 -13
  173. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts.map +0 -1
  174. package/dist/typescript/commonjs/features/profile/index.d.ts +0 -12
  175. package/dist/typescript/commonjs/features/profile/index.d.ts.map +0 -1
  176. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts +0 -11
  177. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts.map +0 -1
  178. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
  179. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
  180. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts +0 -13
  181. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
  182. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts +0 -26
  183. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts.map +0 -1
  184. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts +0 -14
  185. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts.map +0 -1
  186. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts +0 -5
  187. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts.map +0 -1
  188. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts +0 -20
  189. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts.map +0 -1
  190. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts +0 -6
  191. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts.map +0 -1
  192. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts +0 -27
  193. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts.map +0 -1
  194. package/dist/typescript/module/features/profile/Profile.d.ts +0 -6
  195. package/dist/typescript/module/features/profile/Profile.d.ts.map +0 -1
  196. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
  197. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
  198. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
  199. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
  200. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts +0 -3
  201. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
  202. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts +0 -10
  203. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
  204. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts +0 -3
  205. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
  206. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts +0 -4
  207. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
  208. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
  209. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
  210. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
  211. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
  212. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
  213. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
  214. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts +0 -3
  215. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
  216. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts +0 -11
  217. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts.map +0 -1
  218. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
  219. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
  220. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
  221. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
  222. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
  223. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
  224. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
  225. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
  226. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts +0 -13
  227. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts.map +0 -1
  228. package/dist/typescript/module/features/profile/index.d.ts +0 -12
  229. package/dist/typescript/module/features/profile/index.d.ts.map +0 -1
  230. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts +0 -11
  231. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts.map +0 -1
  232. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
  233. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
  234. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts +0 -13
  235. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
  236. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts +0 -26
  237. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts.map +0 -1
  238. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts +0 -14
  239. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts.map +0 -1
  240. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts +0 -5
  241. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts.map +0 -1
  242. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts +0 -20
  243. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts.map +0 -1
  244. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts +0 -6
  245. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts.map +0 -1
  246. package/dist/typescript/module/features/profile/shared/profile.types.d.ts +0 -27
  247. package/dist/typescript/module/features/profile/shared/profile.types.d.ts.map +0 -1
  248. package/src/features/profile/Profile.tsx +0 -83
  249. package/src/features/profile/__tests__/ProfileModel.test.ts +0 -99
  250. package/src/features/profile/__tests__/profile.helpers.test.ts +0 -57
  251. package/src/features/profile/components/actions/ProfileActions.tsx +0 -65
  252. package/src/features/profile/components/cards/ProfileCard.tsx +0 -53
  253. package/src/features/profile/components/info/AccountInfoCard.tsx +0 -73
  254. package/src/features/profile/components/modals/JoinClassModal.tsx +0 -145
  255. package/src/features/profile/components/modals/LogoutConfirmModal.tsx +0 -64
  256. package/src/features/profile/components/modals/TranslationLanguageModal.tsx +0 -124
  257. package/src/features/profile/components/settings/LanguageSettingsCard.tsx +0 -16
  258. package/src/features/profile/components/settings/PreferencesCard.tsx +0 -68
  259. package/src/features/profile/components/settings/SettingRow.tsx +0 -42
  260. package/src/features/profile/components/settings/TextSettingsCard.tsx +0 -61
  261. package/src/features/profile/components/settings/TextSizeSlider.tsx +0 -110
  262. package/src/features/profile/components/settings/TextToSpeechRow.tsx +0 -24
  263. package/src/features/profile/components/settings/TranslationLanguageRow.tsx +0 -58
  264. package/src/features/profile/context/ProfileContext.tsx +0 -24
  265. package/src/features/profile/index.ts +0 -11
  266. package/src/features/profile/model/ProfileApi.ts +0 -23
  267. package/src/features/profile/model/ProfileJoinClassModel.ts +0 -58
  268. package/src/features/profile/model/ProfileLanguageModel.ts +0 -26
  269. package/src/features/profile/model/ProfileModel.ts +0 -57
  270. package/src/features/profile/model/profileModal.types.ts +0 -16
  271. package/src/features/profile/shared/JoinClassError.ts +0 -7
  272. package/src/features/profile/shared/profile.constants.ts +0 -23
  273. package/src/features/profile/shared/profile.helpers.ts +0 -36
  274. package/src/features/profile/shared/profile.types.ts +0 -34
@@ -1,58 +0,0 @@
1
- import React from 'react'
2
- import { useUnit } from 'effector-react'
3
- import { StyleSheet } from 'react-native'
4
- import {
5
- COLORS,
6
- FilterDropdown,
7
- FilterDropdownSize,
8
- FilterDropdownVariant,
9
- GlobeIcon,
10
- } from '@magmamath/react-native-ui'
11
-
12
- import { useText } from '../../../../i18n/i18n'
13
- import { useProfile } from '../../context/ProfileContext'
14
- import { SettingRow } from './SettingRow'
15
-
16
- const ICON_SIZE = 20
17
-
18
- export const TranslationLanguageRow = () => {
19
- const t = useText()
20
- const { model, onOpenTranslationModal } = useProfile()
21
- const settings = useUnit(model.$settings)
22
-
23
- return (
24
- <SettingRow
25
- icon={<GlobeIcon size={ICON_SIZE} color={COLORS.NEUTRAL_7} />}
26
- label={t('profile.translationLanguage')}
27
- style={styles.settingRow}
28
- >
29
- <FilterDropdown
30
- variant={FilterDropdownVariant.SECONDARY}
31
- size={FilterDropdownSize.MEDIUM}
32
- value={settings.translationLanguage ?? undefined}
33
- placeholder={t('profile.selectLanguage')}
34
- disabled={settings.isTranslationLocked}
35
- onPress={onOpenTranslationModal}
36
- accessibilityLabel={t('profile.translationLanguage')}
37
- style={{
38
- text: styles.filterLabel,
39
- container: styles.filterContainer,
40
- }}
41
- />
42
- </SettingRow>
43
- )
44
- }
45
-
46
- const styles = StyleSheet.create({
47
- settingRow: {
48
- paddingVertical: 0,
49
- },
50
- filterLabel: {
51
- color: COLORS.NEUTRAL_7,
52
- fontSize: 16,
53
- fontWeight: '400',
54
- },
55
- filterContainer: {
56
- maxWidth: 231,
57
- },
58
- })
@@ -1,24 +0,0 @@
1
- import { createContext, useContext, type ReactNode } from 'react'
2
-
3
- import type { ProfileModel } from '../model/ProfileModel'
4
-
5
- export type ProfileContextValue = {
6
- model: ProfileModel
7
- onLogout: () => void
8
- onOpenTranslationModal: () => void
9
- onOpenJoinClass: () => void
10
- showSolveMode?: boolean
11
- versionInfo?: ReactNode
12
- }
13
-
14
- const ProfileContext = createContext<ProfileContextValue | null>(null)
15
-
16
- export function useProfile(): ProfileContextValue {
17
- const value = useContext(ProfileContext)
18
- if (!value) {
19
- throw new Error('useProfile must be used within ProfileProvider')
20
- }
21
- return value
22
- }
23
-
24
- export const ProfileProvider = ProfileContext.Provider
@@ -1,11 +0,0 @@
1
- export { Profile } from './Profile'
2
- export { ProfileModel } from './model/ProfileModel'
3
- export type { ProfileApiProps } from './model/ProfileApi'
4
- export type { ProfileContextValue } from './context/ProfileContext'
5
- export { TranslationLanguageModal } from './components/modals/TranslationLanguageModal'
6
- export { JoinClassModal } from './components/modals/JoinClassModal'
7
- export { LogoutConfirmModal } from './components/modals/LogoutConfirmModal'
8
- export type { ProfileModalParams, LogoutModalParams } from './model/profileModal.types'
9
- export { JoinClassError } from './shared/JoinClassError'
10
- export * from './shared/profile.types'
11
- export * from './shared/profile.constants'
@@ -1,23 +0,0 @@
1
- import { createEffect } from 'effector'
2
-
3
- import type {
4
- JoinClassPayload,
5
- JoinClassResult,
6
- ProfileSettingsUpdate,
7
- } from '../shared/profile.types'
8
-
9
- export type ProfileApiProps = {
10
- // `=> void` (not a Promise union) lets consumers wire an effector event or effect directly.
11
- updateSettings: (payload: ProfileSettingsUpdate) => void
12
- joinClass: (payload: JoinClassPayload) => Promise<JoinClassResult>
13
- }
14
-
15
- export class ProfileApi {
16
- public readonly updateSettingsFx
17
- public readonly joinClassFx
18
-
19
- constructor(props: ProfileApiProps) {
20
- this.updateSettingsFx = createEffect(props.updateSettings)
21
- this.joinClassFx = createEffect(props.joinClass)
22
- }
23
- }
@@ -1,58 +0,0 @@
1
- import { createEffect, createEvent, restore, sample } from 'effector'
2
-
3
- import { JoinClassError } from '../shared/JoinClassError'
4
- import { CLASS_CODE_LENGTH, JoinClassStatus } from '../shared/profile.constants'
5
- import { getJoinClassErrorMessage, getJoinClassSuccessMessage } from '../shared/profile.helpers'
6
- import type { NotifyJoinClass } from '../shared/profile.types'
7
- import type { ProfileApi } from './ProfileApi'
8
-
9
- export class ProfileJoinClassModel {
10
- public readonly reset = createEvent()
11
- public readonly setCode = createEvent<string>()
12
- public readonly submit = createEvent()
13
-
14
- public readonly $code = restore(this.setCode, '').reset(this.reset)
15
- public readonly $isComplete = this.$code.map((code) => code.length === CLASS_CODE_LENGTH)
16
-
17
- constructor(
18
- private readonly api: ProfileApi,
19
- private readonly notify: NotifyJoinClass
20
- ) {
21
- this.init()
22
- }
23
-
24
- private init() {
25
- const notifyFx = createEffect(this.notify)
26
-
27
- sample({
28
- clock: this.submit,
29
- source: this.$code,
30
- filter: (code) => code.length === CLASS_CODE_LENGTH,
31
- fn: (classCode) => ({ classCode }),
32
- target: this.api.joinClassFx,
33
- })
34
-
35
- sample({
36
- clock: this.api.joinClassFx.done,
37
- fn: ({ result }) => ({
38
- status: JoinClassStatus.SUCCESS,
39
- message: getJoinClassSuccessMessage(result.name),
40
- }),
41
- target: notifyFx,
42
- })
43
-
44
- sample({
45
- clock: this.api.joinClassFx.fail,
46
- fn: ({ error }) => ({
47
- status: JoinClassStatus.ERROR,
48
- message: getJoinClassErrorMessage(error instanceof JoinClassError ? error.code : null),
49
- }),
50
- target: notifyFx,
51
- })
52
-
53
- sample({
54
- clock: this.api.joinClassFx.done,
55
- target: this.reset,
56
- })
57
- }
58
- }
@@ -1,26 +0,0 @@
1
- import { createEvent, restore, sample } from 'effector'
2
- import type { Language } from '@magmamath/frontend-config'
3
-
4
- import { getAvailableLanguages } from '../shared/profile.helpers'
5
- import type { ProfileApi } from './ProfileApi'
6
-
7
- export class ProfileLanguageModel {
8
- public readonly reset = createEvent()
9
- public readonly setSearch = createEvent<string>()
10
- public readonly selectLanguage = createEvent<Language | null>()
11
-
12
- public readonly $search = restore(this.setSearch, '').reset(this.reset)
13
- public readonly $languages = this.$search.map((search) => getAvailableLanguages(search))
14
-
15
- constructor(private readonly api: ProfileApi) {
16
- this.init()
17
- }
18
-
19
- private init() {
20
- sample({
21
- clock: this.selectLanguage,
22
- fn: (translationLanguage) => ({ translationLanguage }),
23
- target: this.api.updateSettingsFx,
24
- })
25
- }
26
- }
@@ -1,57 +0,0 @@
1
- import { createEvent, sample, type Store } from 'effector'
2
-
3
- import type { ProfileCanvasType } from '../shared/profile.constants'
4
- import type { NotifyJoinClass, ProfileSettings, ProfileUser } from '../shared/profile.types'
5
- import { ProfileApi, type ProfileApiProps } from './ProfileApi'
6
- import { ProfileJoinClassModel } from './ProfileJoinClassModel'
7
- import { ProfileLanguageModel } from './ProfileLanguageModel'
8
-
9
- type ProfileModelProps = {
10
- api: ProfileApiProps
11
- notify: NotifyJoinClass
12
- $user: Store<ProfileUser | null>
13
- $settings: Store<ProfileSettings>
14
- }
15
-
16
- export class ProfileModel {
17
- public readonly api: ProfileApi
18
- public readonly joinClass: ProfileJoinClassModel
19
- public readonly language: ProfileLanguageModel
20
-
21
- public readonly setTextToSpeech = createEvent<boolean>()
22
- public readonly setTextSize = createEvent<number>()
23
- public readonly setCanvasType = createEvent<ProfileCanvasType>()
24
-
25
- public readonly $user: Store<ProfileUser | null>
26
- public readonly $settings: Store<ProfileSettings>
27
-
28
- constructor({ api, notify, $user, $settings }: ProfileModelProps) {
29
- this.api = new ProfileApi(api)
30
- this.joinClass = new ProfileJoinClassModel(this.api, notify)
31
- this.language = new ProfileLanguageModel(this.api)
32
- this.$user = $user
33
- this.$settings = $settings
34
-
35
- this.init()
36
- }
37
-
38
- private init() {
39
- sample({
40
- clock: this.setTextToSpeech,
41
- fn: (textToSpeech) => ({ textToSpeech }),
42
- target: this.api.updateSettingsFx,
43
- })
44
-
45
- sample({
46
- clock: this.setTextSize,
47
- fn: (textSize) => ({ textSize }),
48
- target: this.api.updateSettingsFx,
49
- })
50
-
51
- sample({
52
- clock: this.setCanvasType,
53
- fn: (canvasType) => ({ canvasType }),
54
- target: this.api.updateSettingsFx,
55
- })
56
- }
57
- }
@@ -1,16 +0,0 @@
1
- import type { ProfileModel } from './ProfileModel'
2
-
3
- export type ProfileModalParams = {
4
- model: ProfileModel
5
- }
6
-
7
- export type LogoutModalParams = {
8
- onConfirm: () => void
9
- }
10
-
11
- export type ProfileModalProps<Params = ProfileModalParams> = {
12
- modal: {
13
- closeModal: () => void
14
- params: Params
15
- }
16
- }
@@ -1,7 +0,0 @@
1
- // Carries the backend error code so the library can map it to a message without parsing HTTP errors.
2
- export class JoinClassError extends Error {
3
- constructor(public readonly code: number | null) {
4
- super(code === null ? 'Join class failed' : `Join class failed (code ${code})`)
5
- this.name = 'JoinClassError'
6
- }
7
- }
@@ -1,23 +0,0 @@
1
- export enum ProfileCanvasType {
2
- DRAWING = 1,
3
- SPREADSHEET = 2,
4
- }
5
-
6
- export const TEXT_SIZE = {
7
- MIN: 16,
8
- MAX: 32,
9
- STEP: 4,
10
- } as const
11
-
12
- export const CLASS_CODE_LENGTH = 6
13
-
14
- export enum JoinClassStatus {
15
- SUCCESS = 'success',
16
- ERROR = 'error',
17
- }
18
-
19
- export enum JoinClassErrorCode {
20
- CLASS_NOT_FOUND = 1021,
21
- ALREADY_JOINED = 1030,
22
- OTHER_DISTRICT = 1035,
23
- }
@@ -1,36 +0,0 @@
1
- import { Language, LANGUAGES_CONFIG, PRIORITY_LANGUAGES } from '@magmamath/frontend-config'
2
-
3
- import { getText, type TranslationKey } from '../../../i18n/i18n'
4
- import { JoinClassErrorCode, TEXT_SIZE } from './profile.constants'
5
-
6
- export const getAvailableLanguages = (search?: string): Language[] => {
7
- const prioritySet = new Set<Language>(PRIORITY_LANGUAGES)
8
-
9
- const otherLanguages = Object.values(Language).filter(
10
- (language) => !LANGUAGES_CONFIG[language]?.baseName && !prioritySet.has(language)
11
- )
12
-
13
- const allLanguages = [...PRIORITY_LANGUAGES, ...otherLanguages]
14
- if (!search) return allLanguages
15
-
16
- const query = search.toLowerCase()
17
- return allLanguages.filter((language) => language.toLowerCase().includes(query))
18
- }
19
-
20
- export const snapTextSize = (value: number): number => {
21
- const { MIN, MAX, STEP } = TEXT_SIZE
22
- const clamped = Math.min(MAX, Math.max(MIN, value))
23
- return Math.round((clamped - MIN) / STEP) * STEP + MIN
24
- }
25
-
26
- const JOIN_CLASS_ERROR_KEYS: Record<number, TranslationKey> = {
27
- [JoinClassErrorCode.CLASS_NOT_FOUND]: 'profile.joinClassErrorNotFound',
28
- [JoinClassErrorCode.ALREADY_JOINED]: 'profile.joinClassErrorAlreadyJoined',
29
- [JoinClassErrorCode.OTHER_DISTRICT]: 'profile.joinClassErrorOtherDistrict',
30
- }
31
-
32
- export const getJoinClassSuccessMessage = (className: string): string =>
33
- getText('profile.joinClassSuccess', { className })
34
-
35
- export const getJoinClassErrorMessage = (code: number | null): string =>
36
- getText((code !== null && JOIN_CLASS_ERROR_KEYS[code]) || 'profile.joinClassErrorDefault')
@@ -1,34 +0,0 @@
1
- import type { Language } from '@magmamath/frontend-config'
2
-
3
- import type { JoinClassStatus, ProfileCanvasType } from './profile.constants'
4
-
5
- export type ProfileUser = {
6
- fullName: string
7
- username: string
8
- schoolName: string
9
- }
10
-
11
- export type ProfileSettings = {
12
- textToSpeech: boolean
13
- textSize: number
14
- translationLanguage: Language | null
15
- canvasType: ProfileCanvasType
16
- isTranslationLocked: boolean
17
- }
18
-
19
- export type ProfileSettingsUpdate = Partial<ProfileSettings>
20
-
21
- export type JoinClassPayload = {
22
- classCode: string
23
- }
24
-
25
- export type JoinClassResult = {
26
- name: string
27
- }
28
-
29
- export type JoinClassNotification = {
30
- status: JoinClassStatus
31
- message: string
32
- }
33
-
34
- export type NotifyJoinClass = (notification: JoinClassNotification) => void