@magmamath/students-features 1.8.4-rc.9 → 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 (277) 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/module/shared/icons/ArrowRightIcon.js.map +1 -0
  18. package/dist/module/shared/icons/CloseIcon.js.map +1 -0
  19. package/dist/module/shared/icons/ExcitedLavaIcon.js.map +1 -0
  20. package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
  21. package/dist/typescript/commonjs/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
  22. package/dist/typescript/commonjs/features/uiMode/index.d.ts +1 -0
  23. package/dist/typescript/commonjs/features/uiMode/index.d.ts.map +1 -1
  24. package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts +2 -0
  25. package/dist/typescript/commonjs/features/uiMode/uiMode.helpers.d.ts.map +1 -1
  26. package/dist/typescript/commonjs/index.d.ts +0 -1
  27. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  28. package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts +4 -0
  29. package/dist/typescript/module/features/pmProgress/shared/TreeNormalizer.d.ts.map +1 -1
  30. package/dist/typescript/module/features/uiMode/index.d.ts +1 -0
  31. package/dist/typescript/module/features/uiMode/index.d.ts.map +1 -1
  32. package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts +2 -0
  33. package/dist/typescript/module/features/uiMode/uiMode.helpers.d.ts.map +1 -1
  34. package/dist/typescript/module/index.d.ts +0 -1
  35. package/dist/typescript/module/index.d.ts.map +1 -1
  36. package/package.json +2 -5
  37. package/src/features/pmProgress/shared/TreeNormalizer.ts +5 -1
  38. package/src/features/uiMode/__tests__/getUIMode.test.ts +64 -0
  39. package/src/features/uiMode/index.ts +1 -0
  40. package/src/features/uiMode/uiMode.helpers.ts +16 -1
  41. package/src/i18n/.generated/schema.json +1 -9
  42. package/src/index.ts +0 -1
  43. package/dist/commonjs/features/profile/Profile.js +0 -90
  44. package/dist/commonjs/features/profile/Profile.js.map +0 -1
  45. package/dist/commonjs/features/profile/components/actions/ProfileActions.js +0 -67
  46. package/dist/commonjs/features/profile/components/actions/ProfileActions.js.map +0 -1
  47. package/dist/commonjs/features/profile/components/cards/ProfileCard.js +0 -57
  48. package/dist/commonjs/features/profile/components/cards/ProfileCard.js.map +0 -1
  49. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js +0 -90
  50. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js.map +0 -1
  51. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js +0 -154
  52. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js.map +0 -1
  53. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js +0 -61
  54. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
  55. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js +0 -126
  56. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
  57. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js +0 -22
  58. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
  59. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js +0 -70
  60. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js.map +0 -1
  61. package/dist/commonjs/features/profile/components/settings/SettingRow.js +0 -48
  62. package/dist/commonjs/features/profile/components/settings/SettingRow.js.map +0 -1
  63. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js +0 -74
  64. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js.map +0 -1
  65. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js +0 -116
  66. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js.map +0 -1
  67. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js +0 -35
  68. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
  69. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js +0 -60
  70. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
  71. package/dist/commonjs/features/profile/context/ProfileContext.js +0 -18
  72. package/dist/commonjs/features/profile/context/ProfileContext.js.map +0 -1
  73. package/dist/commonjs/features/profile/index.js +0 -80
  74. package/dist/commonjs/features/profile/index.js.map +0 -1
  75. package/dist/commonjs/features/profile/model/ProfileApi.js +0 -15
  76. package/dist/commonjs/features/profile/model/ProfileApi.js.map +0 -1
  77. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js +0 -60
  78. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js.map +0 -1
  79. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js +0 -30
  80. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js.map +0 -1
  81. package/dist/commonjs/features/profile/model/ProfileModel.js +0 -53
  82. package/dist/commonjs/features/profile/model/ProfileModel.js.map +0 -1
  83. package/dist/commonjs/features/profile/model/profileModal.types.js +0 -6
  84. package/dist/commonjs/features/profile/model/profileModal.types.js.map +0 -1
  85. package/dist/commonjs/features/profile/shared/JoinClassError.js +0 -16
  86. package/dist/commonjs/features/profile/shared/JoinClassError.js.map +0 -1
  87. package/dist/commonjs/features/profile/shared/profile.constants.js +0 -29
  88. package/dist/commonjs/features/profile/shared/profile.constants.js.map +0 -1
  89. package/dist/commonjs/features/profile/shared/profile.helpers.js +0 -40
  90. package/dist/commonjs/features/profile/shared/profile.helpers.js.map +0 -1
  91. package/dist/commonjs/features/profile/shared/profile.types.js +0 -6
  92. package/dist/commonjs/features/profile/shared/profile.types.js.map +0 -1
  93. package/dist/module/features/profile/Profile.js +0 -84
  94. package/dist/module/features/profile/Profile.js.map +0 -1
  95. package/dist/module/features/profile/components/actions/ProfileActions.js +0 -61
  96. package/dist/module/features/profile/components/actions/ProfileActions.js.map +0 -1
  97. package/dist/module/features/profile/components/cards/ProfileCard.js +0 -51
  98. package/dist/module/features/profile/components/cards/ProfileCard.js.map +0 -1
  99. package/dist/module/features/profile/components/info/AccountInfoCard.js +0 -84
  100. package/dist/module/features/profile/components/info/AccountInfoCard.js.map +0 -1
  101. package/dist/module/features/profile/components/modals/JoinClassModal.js +0 -147
  102. package/dist/module/features/profile/components/modals/JoinClassModal.js.map +0 -1
  103. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js +0 -55
  104. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js.map +0 -1
  105. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js +0 -120
  106. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js.map +0 -1
  107. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js +0 -16
  108. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js.map +0 -1
  109. package/dist/module/features/profile/components/settings/PreferencesCard.js +0 -64
  110. package/dist/module/features/profile/components/settings/PreferencesCard.js.map +0 -1
  111. package/dist/module/features/profile/components/settings/SettingRow.js +0 -42
  112. package/dist/module/features/profile/components/settings/SettingRow.js.map +0 -1
  113. package/dist/module/features/profile/components/settings/TextSettingsCard.js +0 -68
  114. package/dist/module/features/profile/components/settings/TextSettingsCard.js.map +0 -1
  115. package/dist/module/features/profile/components/settings/TextSizeSlider.js +0 -109
  116. package/dist/module/features/profile/components/settings/TextSizeSlider.js.map +0 -1
  117. package/dist/module/features/profile/components/settings/TextToSpeechRow.js +0 -29
  118. package/dist/module/features/profile/components/settings/TextToSpeechRow.js.map +0 -1
  119. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js +0 -54
  120. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js.map +0 -1
  121. package/dist/module/features/profile/context/ProfileContext.js +0 -13
  122. package/dist/module/features/profile/context/ProfileContext.js.map +0 -1
  123. package/dist/module/features/profile/index.js +0 -11
  124. package/dist/module/features/profile/index.js.map +0 -1
  125. package/dist/module/features/profile/model/ProfileApi.js +0 -10
  126. package/dist/module/features/profile/model/ProfileApi.js.map +0 -1
  127. package/dist/module/features/profile/model/ProfileJoinClassModel.js +0 -55
  128. package/dist/module/features/profile/model/ProfileJoinClassModel.js.map +0 -1
  129. package/dist/module/features/profile/model/ProfileLanguageModel.js +0 -25
  130. package/dist/module/features/profile/model/ProfileLanguageModel.js.map +0 -1
  131. package/dist/module/features/profile/model/ProfileModel.js +0 -48
  132. package/dist/module/features/profile/model/ProfileModel.js.map +0 -1
  133. package/dist/module/features/profile/model/profileModal.types.js +0 -4
  134. package/dist/module/features/profile/model/profileModal.types.js.map +0 -1
  135. package/dist/module/features/profile/shared/JoinClassError.js +0 -11
  136. package/dist/module/features/profile/shared/JoinClassError.js.map +0 -1
  137. package/dist/module/features/profile/shared/profile.constants.js +0 -25
  138. package/dist/module/features/profile/shared/profile.constants.js.map +0 -1
  139. package/dist/module/features/profile/shared/profile.helpers.js +0 -32
  140. package/dist/module/features/profile/shared/profile.helpers.js.map +0 -1
  141. package/dist/module/features/profile/shared/profile.types.js +0 -4
  142. package/dist/module/features/profile/shared/profile.types.js.map +0 -1
  143. package/dist/typescript/commonjs/features/profile/Profile.d.ts +0 -6
  144. package/dist/typescript/commonjs/features/profile/Profile.d.ts.map +0 -1
  145. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
  146. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
  147. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
  148. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
  149. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts +0 -3
  150. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
  151. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts +0 -10
  152. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
  153. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts +0 -3
  154. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
  155. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts +0 -4
  156. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
  157. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
  158. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
  159. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
  160. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
  161. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
  162. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
  163. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts +0 -3
  164. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
  165. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts +0 -11
  166. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts.map +0 -1
  167. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
  168. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
  169. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
  170. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
  171. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
  172. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
  173. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
  174. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
  175. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts +0 -13
  176. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts.map +0 -1
  177. package/dist/typescript/commonjs/features/profile/index.d.ts +0 -12
  178. package/dist/typescript/commonjs/features/profile/index.d.ts.map +0 -1
  179. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts +0 -11
  180. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts.map +0 -1
  181. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
  182. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
  183. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts +0 -13
  184. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
  185. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts +0 -26
  186. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts.map +0 -1
  187. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts +0 -14
  188. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts.map +0 -1
  189. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts +0 -5
  190. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts.map +0 -1
  191. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts +0 -20
  192. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts.map +0 -1
  193. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts +0 -6
  194. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts.map +0 -1
  195. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts +0 -27
  196. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts.map +0 -1
  197. package/dist/typescript/module/features/profile/Profile.d.ts +0 -6
  198. package/dist/typescript/module/features/profile/Profile.d.ts.map +0 -1
  199. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts +0 -2
  200. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts.map +0 -1
  201. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts +0 -2
  202. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts.map +0 -1
  203. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts +0 -3
  204. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts.map +0 -1
  205. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts +0 -10
  206. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts.map +0 -1
  207. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts +0 -3
  208. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts.map +0 -1
  209. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts +0 -4
  210. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts.map +0 -1
  211. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts +0 -4
  212. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts.map +0 -1
  213. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts +0 -4
  214. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts.map +0 -1
  215. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts +0 -3
  216. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts.map +0 -1
  217. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts +0 -3
  218. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts.map +0 -1
  219. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts +0 -11
  220. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts.map +0 -1
  221. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts +0 -3
  222. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts.map +0 -1
  223. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts +0 -8
  224. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts.map +0 -1
  225. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts +0 -3
  226. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts.map +0 -1
  227. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts +0 -3
  228. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts.map +0 -1
  229. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts +0 -13
  230. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts.map +0 -1
  231. package/dist/typescript/module/features/profile/index.d.ts +0 -12
  232. package/dist/typescript/module/features/profile/index.d.ts.map +0 -1
  233. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts +0 -11
  234. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts.map +0 -1
  235. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts +0 -14
  236. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts.map +0 -1
  237. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts +0 -13
  238. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts.map +0 -1
  239. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts +0 -26
  240. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts.map +0 -1
  241. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts +0 -14
  242. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts.map +0 -1
  243. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts +0 -5
  244. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts.map +0 -1
  245. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts +0 -20
  246. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts.map +0 -1
  247. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts +0 -6
  248. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts.map +0 -1
  249. package/dist/typescript/module/features/profile/shared/profile.types.d.ts +0 -27
  250. package/dist/typescript/module/features/profile/shared/profile.types.d.ts.map +0 -1
  251. package/src/features/profile/Profile.tsx +0 -83
  252. package/src/features/profile/__tests__/ProfileModel.test.ts +0 -99
  253. package/src/features/profile/__tests__/profile.helpers.test.ts +0 -57
  254. package/src/features/profile/components/actions/ProfileActions.tsx +0 -65
  255. package/src/features/profile/components/cards/ProfileCard.tsx +0 -53
  256. package/src/features/profile/components/info/AccountInfoCard.tsx +0 -73
  257. package/src/features/profile/components/modals/JoinClassModal.tsx +0 -145
  258. package/src/features/profile/components/modals/LogoutConfirmModal.tsx +0 -64
  259. package/src/features/profile/components/modals/TranslationLanguageModal.tsx +0 -124
  260. package/src/features/profile/components/settings/LanguageSettingsCard.tsx +0 -16
  261. package/src/features/profile/components/settings/PreferencesCard.tsx +0 -68
  262. package/src/features/profile/components/settings/SettingRow.tsx +0 -42
  263. package/src/features/profile/components/settings/TextSettingsCard.tsx +0 -61
  264. package/src/features/profile/components/settings/TextSizeSlider.tsx +0 -110
  265. package/src/features/profile/components/settings/TextToSpeechRow.tsx +0 -24
  266. package/src/features/profile/components/settings/TranslationLanguageRow.tsx +0 -58
  267. package/src/features/profile/context/ProfileContext.tsx +0 -24
  268. package/src/features/profile/index.ts +0 -11
  269. package/src/features/profile/model/ProfileApi.ts +0 -23
  270. package/src/features/profile/model/ProfileJoinClassModel.ts +0 -58
  271. package/src/features/profile/model/ProfileLanguageModel.ts +0 -26
  272. package/src/features/profile/model/ProfileModel.ts +0 -57
  273. package/src/features/profile/model/profileModal.types.ts +0 -16
  274. package/src/features/profile/shared/JoinClassError.ts +0 -7
  275. package/src/features/profile/shared/profile.constants.ts +0 -23
  276. package/src/features/profile/shared/profile.helpers.ts +0 -36
  277. package/src/features/profile/shared/profile.types.ts +0 -34
@@ -1,145 +0,0 @@
1
- import React, { useEffect } from 'react'
2
- import { StyleSheet, Text, useWindowDimensions, View } from 'react-native'
3
- import { useUnit } from 'effector-react'
4
- import { CodeField, Cursor, useClearByFocusCell } from 'react-native-confirmation-code-field'
5
- import {
6
- BaseModal,
7
- ButtonColor,
8
- ButtonSize,
9
- ButtonVariant,
10
- COLORS,
11
- FONT_FAMILY,
12
- ReanimatedButton,
13
- SPACING,
14
- } from '@magmamath/react-native-ui'
15
-
16
- import { useText } from '../../../../i18n/i18n'
17
- import { CLASS_CODE_LENGTH } from '../../shared/profile.constants'
18
- import type { ProfileModalProps } from '../../model/profileModal.types'
19
-
20
- const CODE_PLACEHOLDER = '0'
21
- const MAX_MODAL_WIDTH = 1044
22
- const SCREEN_MARGIN = 48
23
- const CELL_GAP = SPACING['400']
24
- const MODAL_H_PADDING = SPACING['800']
25
- const CELL_ASPECT = 0.95
26
- const CELL_RADIUS_RATIO = 0.24 // 36 / 150 in the design
27
- const CELL_FONT_RATIO = 0.42 // 64 / 150 in the design
28
- const MAX_CELL_RADIUS = 36
29
-
30
- export const JoinClassModal = ({ modal: { closeModal, params } }: ProfileModalProps) => {
31
- const t = useText()
32
- const { model } = params
33
- const { width } = useWindowDimensions()
34
- const { code, isComplete, isPending } = useUnit({
35
- code: model.joinClass.$code,
36
- isComplete: model.joinClass.$isComplete,
37
- isPending: model.api.joinClassFx.pending,
38
- })
39
-
40
- const modalWidth = Math.min(MAX_MODAL_WIDTH, width - SCREEN_MARGIN)
41
- const cellSize =
42
- (modalWidth - MODAL_H_PADDING * 2 - CELL_GAP * (CLASS_CODE_LENGTH - 1)) / CLASS_CODE_LENGTH
43
- const cellRadius = Math.min(MAX_CELL_RADIUS, cellSize * CELL_RADIUS_RATIO)
44
- const cellFontSize = cellSize * CELL_FONT_RATIO
45
-
46
- const setCode = (value: string) => model.joinClass.setCode(value.toUpperCase())
47
- const [cellProps, getCellOnLayoutHandler] = useClearByFocusCell({ value: code, setValue: setCode })
48
-
49
- useEffect(() => {
50
- const subscription = model.api.joinClassFx.finally.watch(() => {
51
- model.joinClass.reset()
52
- closeModal()
53
- })
54
- return () => subscription.unsubscribe()
55
- }, [model, closeModal])
56
-
57
- const closeAndReset = () => {
58
- model.joinClass.reset()
59
- closeModal()
60
- }
61
-
62
- return (
63
- <BaseModal
64
- onClose={closeAndReset}
65
- style={{ container: [styles.modal, { width: modalWidth }] }}
66
- header={t('profile.joinClassTitle')}
67
- content={
68
- <CodeField
69
- {...cellProps}
70
- nativeID="join-class-code"
71
- value={code}
72
- onChangeText={setCode}
73
- cellCount={CLASS_CODE_LENGTH}
74
- rootStyle={styles.codeRoot}
75
- autoFocus
76
- autoComplete="off"
77
- textContentType="oneTimeCode"
78
- keyboardType="default"
79
- renderCell={({ index, symbol, isFocused }) => {
80
- const isPlaceholder = !symbol && !isFocused
81
- return (
82
- <View
83
- key={index}
84
- style={[styles.cell, { borderRadius: cellRadius, width: cellSize }]}
85
- onLayout={getCellOnLayoutHandler(index)}
86
- >
87
- <Text
88
- style={[styles.cellText, { fontSize: cellFontSize }, isPlaceholder && styles.cellPlaceholder]}
89
- >
90
- {symbol || (isFocused ? <Cursor /> : CODE_PLACEHOLDER)}
91
- </Text>
92
- </View>
93
- )
94
- }}
95
- />
96
- }
97
- footer={
98
- <ReanimatedButton
99
- variant={ButtonVariant.PRIMARY}
100
- colorScheme={ButtonColor.ORANGE}
101
- size={ButtonSize.LARGE}
102
- onPress={() => model.joinClass.submit()}
103
- disabled={!isComplete || isPending}
104
- isLoading={isPending}
105
- style={buttonStyle}
106
- >
107
- {t('profile.joinClassButton')}
108
- </ReanimatedButton>
109
- }
110
- />
111
- )
112
- }
113
-
114
- const styles = StyleSheet.create({
115
- modal: {
116
- gap: SPACING['800'],
117
- paddingHorizontal: MODAL_H_PADDING,
118
- },
119
- codeRoot: {
120
- flexDirection: 'row',
121
- gap: CELL_GAP,
122
- justifyContent: 'center',
123
- },
124
- cell: {
125
- alignItems: 'center',
126
- aspectRatio: CELL_ASPECT,
127
- backgroundColor: COLORS.NEUTRAL_1,
128
- borderColor: COLORS.NEUTRAL_5,
129
- borderWidth: 3,
130
- justifyContent: 'center',
131
- },
132
- cellText: {
133
- color: COLORS.NEUTRAL_9,
134
- fontFamily: FONT_FAMILY.buenosAiresSemiBold,
135
- textAlign: 'center',
136
- },
137
- cellPlaceholder: {
138
- color: COLORS.NEUTRAL_5,
139
- },
140
- text: {
141
- textTransform: 'uppercase',
142
- },
143
- })
144
-
145
- const buttonStyle = { text: styles.text }
@@ -1,64 +0,0 @@
1
- import React from 'react'
2
- import { StyleSheet } from 'react-native'
3
- import {
4
- BaseModal,
5
- Button,
6
- ButtonColor,
7
- ButtonSize,
8
- ButtonVariant,
9
- } from '@magmamath/react-native-ui'
10
-
11
- import { useText } from '../../../../i18n/i18n'
12
- import type { LogoutModalParams, ProfileModalProps } from '../../model/profileModal.types'
13
-
14
- export const LogoutConfirmModal = ({
15
- modal: { closeModal, params },
16
- }: ProfileModalProps<LogoutModalParams>) => {
17
- const t = useText()
18
-
19
- const confirm = () => {
20
- closeModal()
21
- params.onConfirm()
22
- }
23
-
24
- return (
25
- <BaseModal
26
- onClose={closeModal}
27
- style={modalStyle}
28
- header={t('profile.logOut')}
29
- content={t('profile.logOutConfirmMessage')}
30
- footer={
31
- <>
32
- <Button
33
- variant={ButtonVariant.TERTIARY}
34
- size={ButtonSize.LARGE}
35
- onPress={closeModal}
36
- style={buttonTextStyle}
37
- >
38
- {t('profile.cancel')}
39
- </Button>
40
- <Button
41
- colorScheme={ButtonColor.ORANGE}
42
- size={ButtonSize.LARGE}
43
- onPress={confirm}
44
- style={buttonTextStyle}
45
- >
46
- {t('profile.yes')}
47
- </Button>
48
- </>
49
- }
50
- />
51
- )
52
- }
53
-
54
- const styles = StyleSheet.create({
55
- modal: {
56
- width: 530,
57
- },
58
- uppercase: {
59
- textTransform: 'uppercase',
60
- },
61
- })
62
-
63
- const modalStyle = { container: styles.modal }
64
- const buttonTextStyle = { text: styles.uppercase }
@@ -1,124 +0,0 @@
1
- import React from 'react'
2
- import { StyleSheet, View } from 'react-native'
3
- import { useUnit } from 'effector-react'
4
- import type { Language } from '@magmamath/frontend-config'
5
- import {
6
- BaseModal,
7
- Checkbox,
8
- CheckboxColor,
9
- CheckboxGroup,
10
- COLORS,
11
- HeadingVariants,
12
- Search,
13
- SPACING,
14
- Typography,
15
- } from '@magmamath/react-native-ui'
16
-
17
- import { useText } from '../../../../i18n/i18n'
18
- import type { ProfileModalProps } from '../../model/profileModal.types'
19
-
20
- const LIST_HEIGHT = 360
21
-
22
- export const TranslationLanguageModal = ({ modal: { closeModal, params } }: ProfileModalProps) => {
23
- const t = useText()
24
- const { model } = params
25
- const { search, languages, settings } = useUnit({
26
- search: model.language.$search,
27
- languages: model.language.$languages,
28
- settings: model.$settings,
29
- })
30
-
31
- const closeAndReset = () => {
32
- model.language.reset()
33
- closeModal()
34
- }
35
-
36
- const selectLanguage = (language: Language | null) => {
37
- model.language.selectLanguage(language)
38
- closeAndReset()
39
- }
40
-
41
- const items = languages.map((language) => ({
42
- id: language,
43
- label: language,
44
- radio: true,
45
- color: CheckboxColor.ORANGE,
46
- }))
47
- const selectedItems = items.filter((item) => item.id === settings.translationLanguage)
48
-
49
- return (
50
- <BaseModal
51
- onClose={closeAndReset}
52
- style={modalStyle}
53
- header={
54
- <View style={styles.header}>
55
- <Typography variant={HeadingVariants.H2} align="center" style={styles.title}>
56
- {t('profile.translationModalTitle')}
57
- </Typography>
58
- <Search
59
- nativeID="translation-language-search"
60
- value={search}
61
- onChangeText={model.language.setSearch}
62
- placeholder={t('profile.search')}
63
- containerStyle={styles.search}
64
- />
65
- </View>
66
- }
67
- content={
68
- <View style={styles.content}>
69
- <Checkbox
70
- radio
71
- label={t('profile.noLanguage')}
72
- checked={!settings.translationLanguage}
73
- color={CheckboxColor.ORANGE}
74
- style={noLanguageStyle}
75
- onPress={() => selectLanguage(null)}
76
- />
77
- <View style={styles.divider} />
78
- <CheckboxGroup
79
- items={items}
80
- selectedItems={selectedItems}
81
- initialNumToRender={items.length}
82
- style={listStyle}
83
- onPress={(item) =>
84
- selectLanguage(languages.find((language) => language === item.id) ?? null)
85
- }
86
- />
87
- </View>
88
- }
89
- />
90
- )
91
- }
92
-
93
- const styles = StyleSheet.create({
94
- modal: {
95
- width: 530,
96
- },
97
- header: {
98
- gap: SPACING['500'],
99
- },
100
- title: {
101
- color: COLORS.NEUTRAL_9,
102
- },
103
- search: {
104
- width: '100%',
105
- },
106
- content: {
107
- gap: SPACING['300'],
108
- },
109
- noLanguage: {
110
- paddingLeft: SPACING['200'],
111
- },
112
- divider: {
113
- backgroundColor: COLORS.NEUTRAL_3,
114
- height: 1,
115
- },
116
- list: {
117
- height: LIST_HEIGHT,
118
- width: '100%',
119
- },
120
- })
121
-
122
- const modalStyle = { container: styles.modal }
123
- const noLanguageStyle = { container: styles.noLanguage }
124
- const listStyle = { container: styles.list }
@@ -1,16 +0,0 @@
1
- import React from 'react'
2
- import { useText } from '../../../../i18n/i18n'
3
- import { ProfileCard } from '../cards/ProfileCard'
4
- import { TextToSpeechRow } from './TextToSpeechRow'
5
- import { TranslationLanguageRow } from './TranslationLanguageRow'
6
-
7
- export const LanguageSettingsCard = () => {
8
- const t = useText()
9
-
10
- return (
11
- <ProfileCard title={t('profile.languageSettings')}>
12
- <TextToSpeechRow />
13
- <TranslationLanguageRow />
14
- </ProfileCard>
15
- )
16
- }
@@ -1,68 +0,0 @@
1
- import React from 'react'
2
- import { StyleSheet, View } from 'react-native'
3
- import { useUnit } from 'effector-react'
4
- import {
5
- CalculatorIcon,
6
- COLORS,
7
- PencilIcon,
8
- SelectGroup,
9
- SelectOptionColor,
10
- SelectOptionProps,
11
- } from '@magmamath/react-native-ui'
12
-
13
- import { useText } from '../../../../i18n/i18n'
14
- import { useProfile } from '../../context/ProfileContext'
15
- import { ProfileCanvasType } from '../../shared/profile.constants'
16
- import { ProfileCard } from '../cards/ProfileCard'
17
- import { SettingRow } from './SettingRow'
18
-
19
- const ICON_SIZE = 22
20
- const CONTROL_MAX_WIDTH = 248
21
-
22
- // Pass the glyph via `title` (children), not `icon`: an icon-only Button locks to a fixed
23
- // square and collapses the SelectOption's flex stretch.
24
- // TODO: replace CalculatorIcon with a dedicated KeyboardIcon once rn-ui ships one.
25
- const CANVAS_OPTIONS: SelectOptionProps[] = [
26
- {
27
- key: String(ProfileCanvasType.DRAWING),
28
- title: <PencilIcon size={ICON_SIZE} color={COLORS.NEUTRAL_9} />,
29
- },
30
- {
31
- key: String(ProfileCanvasType.SPREADSHEET),
32
- title: <CalculatorIcon size={ICON_SIZE} color={COLORS.NEUTRAL_9} />,
33
- },
34
- ]
35
-
36
- export const PreferencesCard = () => {
37
- const t = useText()
38
- const { model } = useProfile()
39
- const settings = useUnit(model.$settings)
40
-
41
- return (
42
- <ProfileCard title={t('profile.preferences')}>
43
- <SettingRow label={t('profile.solveMode')}>
44
- <View style={styles.control}>
45
- <SelectGroup
46
- color={SelectOptionColor.GREY}
47
- options={CANVAS_OPTIONS}
48
- selectedOptions={CANVAS_OPTIONS.filter(({ key }) => key === String(settings.canvasType))}
49
- onOptionChange={({ key }) =>
50
- model.setCanvasType(
51
- key === String(ProfileCanvasType.SPREADSHEET)
52
- ? ProfileCanvasType.SPREADSHEET
53
- : ProfileCanvasType.DRAWING,
54
- )
55
- }
56
- />
57
- </View>
58
- </SettingRow>
59
- </ProfileCard>
60
- )
61
- }
62
-
63
- const styles = StyleSheet.create({
64
- control: {
65
- flex: 1,
66
- maxWidth: CONTROL_MAX_WIDTH,
67
- },
68
- })
@@ -1,42 +0,0 @@
1
- import React, { ReactNode } from 'react'
2
- import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
3
- import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui'
4
-
5
- type SettingRowProps = {
6
- label: string
7
- children: ReactNode
8
- style?: StyleProp<ViewStyle>
9
- icon?: ReactNode
10
- }
11
-
12
- export const SettingRow = ({ icon, label, children, style }: SettingRowProps) => (
13
- <View style={[styles.row, style]}>
14
- <View style={styles.labelGroup}>
15
- {icon}
16
- <Typography variant={HeadingVariants.H8} style={styles.label}>
17
- {label}
18
- </Typography>
19
- </View>
20
- {children}
21
- </View>
22
- )
23
-
24
- const styles = StyleSheet.create({
25
- row: {
26
- alignItems: 'center',
27
- flexDirection: 'row',
28
- gap: SPACING['400'],
29
- justifyContent: 'space-between',
30
- padding: SPACING['200'],
31
- },
32
- labelGroup: {
33
- alignItems: 'center',
34
- flexDirection: 'row',
35
- flexShrink: 1,
36
- gap: SPACING['200'],
37
- },
38
- label: {
39
- color: COLORS.NEUTRAL_9,
40
- flexShrink: 1,
41
- },
42
- })
@@ -1,61 +0,0 @@
1
- import React from 'react'
2
- import { useUnit } from 'effector-react'
3
- import { StyleSheet, View } from 'react-native'
4
- import {
5
- COLORS,
6
- HeadingVariants,
7
- ParagraphVariants,
8
- SPACING,
9
- Typography,
10
- } from '@magmamath/react-native-ui'
11
-
12
- import { useText } from '../../../../i18n/i18n'
13
- import { useProfile } from '../../context/ProfileContext'
14
- import { TextSizeSlider } from './TextSizeSlider'
15
- import { ProfileCard } from '../cards/ProfileCard'
16
-
17
- export const TextSettingsCard = () => {
18
- const t = useText()
19
- const { model } = useProfile()
20
- const settings = useUnit(model.$settings)
21
-
22
- return (
23
- <ProfileCard title={t('profile.textSettings')}>
24
- <Typography variant={HeadingVariants.H8} style={styles.label}>
25
- {t('profile.textSize')}
26
- </Typography>
27
- <View style={styles.sliderWrap}>
28
- <TextSizeSlider value={settings.textSize} onSlidingComplete={model.setTextSize} />
29
- <View style={styles.markers}>
30
- <Typography variant={ParagraphVariants.XS} style={styles.marker} selectable={false}>
31
- A
32
- </Typography>
33
- <Typography variant={ParagraphVariants.MEDIUM} style={styles.marker} selectable={false}>
34
- A
35
- </Typography>
36
- <Typography variant={ParagraphVariants.XL} style={styles.marker} selectable={false}>
37
- A
38
- </Typography>
39
- </View>
40
- </View>
41
- </ProfileCard>
42
- )
43
- }
44
-
45
- const styles = StyleSheet.create({
46
- label: {
47
- color: COLORS.NEUTRAL_9,
48
- },
49
- sliderWrap: {
50
- gap: SPACING['200'],
51
- },
52
- markers: {
53
- alignItems: 'flex-end',
54
- flexDirection: 'row',
55
- justifyContent: 'space-between',
56
- },
57
- marker: {
58
- color: COLORS.NEUTRAL_7,
59
- fontWeight: '700',
60
- },
61
- })
@@ -1,110 +0,0 @@
1
- import React, { useRef, useState } from 'react'
2
- import { LayoutChangeEvent, PanResponder, StyleSheet, View } from 'react-native'
3
- import { COLORS } from '@magmamath/react-native-ui'
4
-
5
- import { TEXT_SIZE } from '../../shared/profile.constants'
6
- import { snapTextSize } from '../../shared/profile.helpers'
7
-
8
- type TextSizeSliderProps = {
9
- value: number
10
- onSlidingComplete: (value: number) => void
11
- }
12
-
13
- const THUMB_SIZE = 20
14
- const DOT_SIZE = 6
15
- const TRACK_HEIGHT = 10
16
- const TRACK_RADIUS = 5
17
- const STEPS = (TEXT_SIZE.MAX - TEXT_SIZE.MIN) / TEXT_SIZE.STEP + 1
18
- const RANGE = TEXT_SIZE.MAX - TEXT_SIZE.MIN
19
- const TRACK_PADDING = THUMB_SIZE / 2 - DOT_SIZE / 2
20
-
21
- export const TextSizeSlider = ({ value, onSlidingComplete }: TextSizeSliderProps) => {
22
- const [trackWidth, setTrackWidth] = useState(0)
23
- const [dragValue, setDragValue] = useState<number | null>(null)
24
- const widthRef = useRef(0)
25
- const onCompleteRef = useRef(onSlidingComplete)
26
- onCompleteRef.current = onSlidingComplete
27
-
28
- const currentValue = dragValue ?? value
29
- const fraction = RANGE === 0 ? 0 : (currentValue - TEXT_SIZE.MIN) / RANGE
30
- const travel = Math.max(0, trackWidth - THUMB_SIZE)
31
-
32
- const measureTrack = (event: LayoutChangeEvent) => {
33
- const width = event.nativeEvent.layout.width
34
- widthRef.current = width
35
- setTrackWidth(width)
36
- }
37
-
38
- const valueFromX = (x: number) => {
39
- const width = widthRef.current
40
- if (width <= 0) return TEXT_SIZE.MIN
41
- const ratio = Math.min(1, Math.max(0, x / width))
42
- return snapTextSize(TEXT_SIZE.MIN + ratio * RANGE)
43
- }
44
-
45
- const panResponder = useRef(
46
- PanResponder.create({
47
- onStartShouldSetPanResponder: () => true,
48
- onMoveShouldSetPanResponder: () => true,
49
- onPanResponderGrant: (event) => setDragValue(valueFromX(event.nativeEvent.locationX)),
50
- onPanResponderMove: (event) => setDragValue(valueFromX(event.nativeEvent.locationX)),
51
- onPanResponderRelease: (event) => {
52
- const next = valueFromX(event.nativeEvent.locationX)
53
- setDragValue(null)
54
- onCompleteRef.current(next)
55
- },
56
- onPanResponderTerminate: () => setDragValue(null),
57
- })
58
- ).current
59
-
60
- return (
61
- <View style={styles.container} onLayout={measureTrack} {...panResponder.panHandlers}>
62
- <View style={styles.track}>
63
- {Array.from({ length: STEPS }, (_, index) => {
64
- const isEdge = index === 0 || index === STEPS - 1
65
- return <View key={index} style={[styles.dot, isEdge && styles.dotHidden]} />
66
- })}
67
- </View>
68
- <View style={[styles.thumb, { left: fraction * travel }]} />
69
- </View>
70
- )
71
- }
72
-
73
- const styles = StyleSheet.create({
74
- container: {
75
- height: THUMB_SIZE,
76
- justifyContent: 'center',
77
- width: '100%',
78
- },
79
- track: {
80
- alignItems: 'center',
81
- backgroundColor: COLORS.NEUTRAL_3,
82
- borderColor: COLORS.NEUTRAL_4,
83
- borderRadius: TRACK_RADIUS,
84
- borderWidth: 0.5,
85
- boxShadow:
86
- 'inset -3px -3px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.12)',
87
- flexDirection: 'row',
88
- height: TRACK_HEIGHT,
89
- justifyContent: 'space-between',
90
- paddingHorizontal: TRACK_PADDING,
91
- width: '100%',
92
- },
93
- dot: {
94
- backgroundColor: COLORS.NEUTRAL_5,
95
- borderRadius: DOT_SIZE / 2,
96
- height: DOT_SIZE,
97
- width: DOT_SIZE,
98
- },
99
- dotHidden: {
100
- opacity: 0,
101
- },
102
- thumb: {
103
- backgroundColor: COLORS.NEUTRAL_1,
104
- borderRadius: THUMB_SIZE / 2,
105
- boxShadow: '0px 2px 6px rgba(0, 0, 0, 0.2)',
106
- height: THUMB_SIZE,
107
- position: 'absolute',
108
- width: THUMB_SIZE,
109
- },
110
- })
@@ -1,24 +0,0 @@
1
- import React from 'react'
2
- import { useUnit } from 'effector-react'
3
- import { COLORS, SpeakerIcon, Toggle } from '@magmamath/react-native-ui'
4
-
5
- import { useText } from '../../../../i18n/i18n'
6
- import { useProfile } from '../../context/ProfileContext'
7
- import { SettingRow } from './SettingRow'
8
-
9
- const ICON_SIZE = 20
10
-
11
- export const TextToSpeechRow = () => {
12
- const t = useText()
13
- const { model } = useProfile()
14
- const settings = useUnit(model.$settings)
15
-
16
- return (
17
- <SettingRow
18
- icon={<SpeakerIcon size={ICON_SIZE} color={COLORS.NEUTRAL_7} />}
19
- label={t('profile.textToSpeech')}
20
- >
21
- <Toggle value={settings.textToSpeech} onValueChange={model.setTextToSpeech} />
22
- </SettingRow>
23
- )
24
- }