@magmamath/students-features 1.8.4 → 1.8.5-rc.1

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 (260) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  2. package/dist/commonjs/features/profile/Profile.js +90 -0
  3. package/dist/commonjs/features/profile/Profile.js.map +1 -0
  4. package/dist/commonjs/features/profile/components/actions/ProfileActions.js +70 -0
  5. package/dist/commonjs/features/profile/components/actions/ProfileActions.js.map +1 -0
  6. package/dist/commonjs/features/profile/components/cards/ProfileCard.js +57 -0
  7. package/dist/commonjs/features/profile/components/cards/ProfileCard.js.map +1 -0
  8. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js +91 -0
  9. package/dist/commonjs/features/profile/components/info/AccountInfoCard.js.map +1 -0
  10. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js +190 -0
  11. package/dist/commonjs/features/profile/components/modals/JoinClassModal.js.map +1 -0
  12. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js +61 -0
  13. package/dist/commonjs/features/profile/components/modals/LogoutConfirmModal.js.map +1 -0
  14. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js +128 -0
  15. package/dist/commonjs/features/profile/components/modals/TranslationLanguageModal.js.map +1 -0
  16. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js +22 -0
  17. package/dist/commonjs/features/profile/components/settings/LanguageSettingsCard.js.map +1 -0
  18. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js +69 -0
  19. package/dist/commonjs/features/profile/components/settings/PreferencesCard.js.map +1 -0
  20. package/dist/commonjs/features/profile/components/settings/SettingRow.js +48 -0
  21. package/dist/commonjs/features/profile/components/settings/SettingRow.js.map +1 -0
  22. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js +77 -0
  23. package/dist/commonjs/features/profile/components/settings/TextSettingsCard.js.map +1 -0
  24. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js +119 -0
  25. package/dist/commonjs/features/profile/components/settings/TextSizeSlider.js.map +1 -0
  26. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js +37 -0
  27. package/dist/commonjs/features/profile/components/settings/TextToSpeechRow.js.map +1 -0
  28. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js +62 -0
  29. package/dist/commonjs/features/profile/components/settings/TranslationLanguageRow.js.map +1 -0
  30. package/dist/commonjs/features/profile/context/ProfileContext.js +18 -0
  31. package/dist/commonjs/features/profile/context/ProfileContext.js.map +1 -0
  32. package/dist/commonjs/features/profile/index.js +80 -0
  33. package/dist/commonjs/features/profile/index.js.map +1 -0
  34. package/dist/commonjs/features/profile/model/ProfileApi.js +15 -0
  35. package/dist/commonjs/features/profile/model/ProfileApi.js.map +1 -0
  36. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js +60 -0
  37. package/dist/commonjs/features/profile/model/ProfileJoinClassModel.js.map +1 -0
  38. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js +30 -0
  39. package/dist/commonjs/features/profile/model/ProfileLanguageModel.js.map +1 -0
  40. package/dist/commonjs/features/profile/model/ProfileModel.js +53 -0
  41. package/dist/commonjs/features/profile/model/ProfileModel.js.map +1 -0
  42. package/dist/commonjs/features/profile/model/profileModal.types.js +6 -0
  43. package/dist/commonjs/features/profile/model/profileModal.types.js.map +1 -0
  44. package/dist/commonjs/features/profile/shared/JoinClassError.js +16 -0
  45. package/dist/commonjs/features/profile/shared/JoinClassError.js.map +1 -0
  46. package/dist/commonjs/features/profile/shared/profile.constants.js +29 -0
  47. package/dist/commonjs/features/profile/shared/profile.constants.js.map +1 -0
  48. package/dist/commonjs/features/profile/shared/profile.helpers.js +40 -0
  49. package/dist/commonjs/features/profile/shared/profile.helpers.js.map +1 -0
  50. package/dist/commonjs/features/profile/shared/profile.types.js +6 -0
  51. package/dist/commonjs/features/profile/shared/profile.types.js.map +1 -0
  52. package/dist/commonjs/index.js +12 -0
  53. package/dist/commonjs/index.js.map +1 -1
  54. package/dist/commonjs/shared/hooks/useKeyboardOffset.js +54 -0
  55. package/dist/commonjs/shared/hooks/useKeyboardOffset.js.map +1 -0
  56. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  57. package/dist/module/features/profile/Profile.js +84 -0
  58. package/dist/module/features/profile/Profile.js.map +1 -0
  59. package/dist/module/features/profile/components/actions/ProfileActions.js +64 -0
  60. package/dist/module/features/profile/components/actions/ProfileActions.js.map +1 -0
  61. package/dist/module/features/profile/components/cards/ProfileCard.js +51 -0
  62. package/dist/module/features/profile/components/cards/ProfileCard.js.map +1 -0
  63. package/dist/module/features/profile/components/info/AccountInfoCard.js +85 -0
  64. package/dist/module/features/profile/components/info/AccountInfoCard.js.map +1 -0
  65. package/dist/module/features/profile/components/modals/JoinClassModal.js +183 -0
  66. package/dist/module/features/profile/components/modals/JoinClassModal.js.map +1 -0
  67. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js +55 -0
  68. package/dist/module/features/profile/components/modals/LogoutConfirmModal.js.map +1 -0
  69. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js +122 -0
  70. package/dist/module/features/profile/components/modals/TranslationLanguageModal.js.map +1 -0
  71. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js +16 -0
  72. package/dist/module/features/profile/components/settings/LanguageSettingsCard.js.map +1 -0
  73. package/dist/module/features/profile/components/settings/PreferencesCard.js +63 -0
  74. package/dist/module/features/profile/components/settings/PreferencesCard.js.map +1 -0
  75. package/dist/module/features/profile/components/settings/SettingRow.js +42 -0
  76. package/dist/module/features/profile/components/settings/SettingRow.js.map +1 -0
  77. package/dist/module/features/profile/components/settings/TextSettingsCard.js +71 -0
  78. package/dist/module/features/profile/components/settings/TextSettingsCard.js.map +1 -0
  79. package/dist/module/features/profile/components/settings/TextSizeSlider.js +112 -0
  80. package/dist/module/features/profile/components/settings/TextSizeSlider.js.map +1 -0
  81. package/dist/module/features/profile/components/settings/TextToSpeechRow.js +31 -0
  82. package/dist/module/features/profile/components/settings/TextToSpeechRow.js.map +1 -0
  83. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js +56 -0
  84. package/dist/module/features/profile/components/settings/TranslationLanguageRow.js.map +1 -0
  85. package/dist/module/features/profile/context/ProfileContext.js +13 -0
  86. package/dist/module/features/profile/context/ProfileContext.js.map +1 -0
  87. package/dist/module/features/profile/index.js +11 -0
  88. package/dist/module/features/profile/index.js.map +1 -0
  89. package/dist/module/features/profile/model/ProfileApi.js +10 -0
  90. package/dist/module/features/profile/model/ProfileApi.js.map +1 -0
  91. package/dist/module/features/profile/model/ProfileJoinClassModel.js +55 -0
  92. package/dist/module/features/profile/model/ProfileJoinClassModel.js.map +1 -0
  93. package/dist/module/features/profile/model/ProfileLanguageModel.js +25 -0
  94. package/dist/module/features/profile/model/ProfileLanguageModel.js.map +1 -0
  95. package/dist/module/features/profile/model/ProfileModel.js +48 -0
  96. package/dist/module/features/profile/model/ProfileModel.js.map +1 -0
  97. package/dist/module/features/profile/model/profileModal.types.js +4 -0
  98. package/dist/module/features/profile/model/profileModal.types.js.map +1 -0
  99. package/dist/module/features/profile/shared/JoinClassError.js +11 -0
  100. package/dist/module/features/profile/shared/JoinClassError.js.map +1 -0
  101. package/dist/module/features/profile/shared/profile.constants.js +25 -0
  102. package/dist/module/features/profile/shared/profile.constants.js.map +1 -0
  103. package/dist/module/features/profile/shared/profile.helpers.js +32 -0
  104. package/dist/module/features/profile/shared/profile.helpers.js.map +1 -0
  105. package/dist/module/features/profile/shared/profile.types.js +4 -0
  106. package/dist/module/features/profile/shared/profile.types.js.map +1 -0
  107. package/dist/module/index.js +1 -0
  108. package/dist/module/index.js.map +1 -1
  109. package/dist/module/shared/hooks/useKeyboardOffset.js +49 -0
  110. package/dist/module/shared/hooks/useKeyboardOffset.js.map +1 -0
  111. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.d.ts.map +1 -1
  112. package/dist/typescript/commonjs/features/profile/Profile.d.ts +6 -0
  113. package/dist/typescript/commonjs/features/profile/Profile.d.ts.map +1 -0
  114. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts +2 -0
  115. package/dist/typescript/commonjs/features/profile/__tests__/ProfileModel.test.d.ts.map +1 -0
  116. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts +2 -0
  117. package/dist/typescript/commonjs/features/profile/__tests__/profile.helpers.test.d.ts.map +1 -0
  118. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts +3 -0
  119. package/dist/typescript/commonjs/features/profile/components/actions/ProfileActions.d.ts.map +1 -0
  120. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts +10 -0
  121. package/dist/typescript/commonjs/features/profile/components/cards/ProfileCard.d.ts.map +1 -0
  122. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts +3 -0
  123. package/dist/typescript/commonjs/features/profile/components/info/AccountInfoCard.d.ts.map +1 -0
  124. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts +4 -0
  125. package/dist/typescript/commonjs/features/profile/components/modals/JoinClassModal.d.ts.map +1 -0
  126. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts +4 -0
  127. package/dist/typescript/commonjs/features/profile/components/modals/LogoutConfirmModal.d.ts.map +1 -0
  128. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts +4 -0
  129. package/dist/typescript/commonjs/features/profile/components/modals/TranslationLanguageModal.d.ts.map +1 -0
  130. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts +3 -0
  131. package/dist/typescript/commonjs/features/profile/components/settings/LanguageSettingsCard.d.ts.map +1 -0
  132. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts +3 -0
  133. package/dist/typescript/commonjs/features/profile/components/settings/PreferencesCard.d.ts.map +1 -0
  134. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts +11 -0
  135. package/dist/typescript/commonjs/features/profile/components/settings/SettingRow.d.ts.map +1 -0
  136. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts +3 -0
  137. package/dist/typescript/commonjs/features/profile/components/settings/TextSettingsCard.d.ts.map +1 -0
  138. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts +8 -0
  139. package/dist/typescript/commonjs/features/profile/components/settings/TextSizeSlider.d.ts.map +1 -0
  140. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts +3 -0
  141. package/dist/typescript/commonjs/features/profile/components/settings/TextToSpeechRow.d.ts.map +1 -0
  142. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts +3 -0
  143. package/dist/typescript/commonjs/features/profile/components/settings/TranslationLanguageRow.d.ts.map +1 -0
  144. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts +13 -0
  145. package/dist/typescript/commonjs/features/profile/context/ProfileContext.d.ts.map +1 -0
  146. package/dist/typescript/commonjs/features/profile/index.d.ts +12 -0
  147. package/dist/typescript/commonjs/features/profile/index.d.ts.map +1 -0
  148. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts +11 -0
  149. package/dist/typescript/commonjs/features/profile/model/ProfileApi.d.ts.map +1 -0
  150. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts +14 -0
  151. package/dist/typescript/commonjs/features/profile/model/ProfileJoinClassModel.d.ts.map +1 -0
  152. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts +13 -0
  153. package/dist/typescript/commonjs/features/profile/model/ProfileLanguageModel.d.ts.map +1 -0
  154. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts +26 -0
  155. package/dist/typescript/commonjs/features/profile/model/ProfileModel.d.ts.map +1 -0
  156. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts +14 -0
  157. package/dist/typescript/commonjs/features/profile/model/profileModal.types.d.ts.map +1 -0
  158. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts +5 -0
  159. package/dist/typescript/commonjs/features/profile/shared/JoinClassError.d.ts.map +1 -0
  160. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts +20 -0
  161. package/dist/typescript/commonjs/features/profile/shared/profile.constants.d.ts.map +1 -0
  162. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts +6 -0
  163. package/dist/typescript/commonjs/features/profile/shared/profile.helpers.d.ts.map +1 -0
  164. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts +27 -0
  165. package/dist/typescript/commonjs/features/profile/shared/profile.types.d.ts.map +1 -0
  166. package/dist/typescript/commonjs/index.d.ts +1 -0
  167. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  168. package/dist/typescript/commonjs/shared/hooks/useKeyboardOffset.d.ts +11 -0
  169. package/dist/typescript/commonjs/shared/hooks/useKeyboardOffset.d.ts.map +1 -0
  170. package/dist/typescript/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.d.ts.map +1 -1
  171. package/dist/typescript/module/features/profile/Profile.d.ts +6 -0
  172. package/dist/typescript/module/features/profile/Profile.d.ts.map +1 -0
  173. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts +2 -0
  174. package/dist/typescript/module/features/profile/__tests__/ProfileModel.test.d.ts.map +1 -0
  175. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts +2 -0
  176. package/dist/typescript/module/features/profile/__tests__/profile.helpers.test.d.ts.map +1 -0
  177. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts +3 -0
  178. package/dist/typescript/module/features/profile/components/actions/ProfileActions.d.ts.map +1 -0
  179. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts +10 -0
  180. package/dist/typescript/module/features/profile/components/cards/ProfileCard.d.ts.map +1 -0
  181. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts +3 -0
  182. package/dist/typescript/module/features/profile/components/info/AccountInfoCard.d.ts.map +1 -0
  183. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts +4 -0
  184. package/dist/typescript/module/features/profile/components/modals/JoinClassModal.d.ts.map +1 -0
  185. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts +4 -0
  186. package/dist/typescript/module/features/profile/components/modals/LogoutConfirmModal.d.ts.map +1 -0
  187. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts +4 -0
  188. package/dist/typescript/module/features/profile/components/modals/TranslationLanguageModal.d.ts.map +1 -0
  189. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts +3 -0
  190. package/dist/typescript/module/features/profile/components/settings/LanguageSettingsCard.d.ts.map +1 -0
  191. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts +3 -0
  192. package/dist/typescript/module/features/profile/components/settings/PreferencesCard.d.ts.map +1 -0
  193. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts +11 -0
  194. package/dist/typescript/module/features/profile/components/settings/SettingRow.d.ts.map +1 -0
  195. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts +3 -0
  196. package/dist/typescript/module/features/profile/components/settings/TextSettingsCard.d.ts.map +1 -0
  197. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts +8 -0
  198. package/dist/typescript/module/features/profile/components/settings/TextSizeSlider.d.ts.map +1 -0
  199. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts +3 -0
  200. package/dist/typescript/module/features/profile/components/settings/TextToSpeechRow.d.ts.map +1 -0
  201. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts +3 -0
  202. package/dist/typescript/module/features/profile/components/settings/TranslationLanguageRow.d.ts.map +1 -0
  203. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts +13 -0
  204. package/dist/typescript/module/features/profile/context/ProfileContext.d.ts.map +1 -0
  205. package/dist/typescript/module/features/profile/index.d.ts +12 -0
  206. package/dist/typescript/module/features/profile/index.d.ts.map +1 -0
  207. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts +11 -0
  208. package/dist/typescript/module/features/profile/model/ProfileApi.d.ts.map +1 -0
  209. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts +14 -0
  210. package/dist/typescript/module/features/profile/model/ProfileJoinClassModel.d.ts.map +1 -0
  211. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts +13 -0
  212. package/dist/typescript/module/features/profile/model/ProfileLanguageModel.d.ts.map +1 -0
  213. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts +26 -0
  214. package/dist/typescript/module/features/profile/model/ProfileModel.d.ts.map +1 -0
  215. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts +14 -0
  216. package/dist/typescript/module/features/profile/model/profileModal.types.d.ts.map +1 -0
  217. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts +5 -0
  218. package/dist/typescript/module/features/profile/shared/JoinClassError.d.ts.map +1 -0
  219. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts +20 -0
  220. package/dist/typescript/module/features/profile/shared/profile.constants.d.ts.map +1 -0
  221. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts +6 -0
  222. package/dist/typescript/module/features/profile/shared/profile.helpers.d.ts.map +1 -0
  223. package/dist/typescript/module/features/profile/shared/profile.types.d.ts +27 -0
  224. package/dist/typescript/module/features/profile/shared/profile.types.d.ts.map +1 -0
  225. package/dist/typescript/module/index.d.ts +1 -0
  226. package/dist/typescript/module/index.d.ts.map +1 -1
  227. package/dist/typescript/module/shared/hooks/useKeyboardOffset.d.ts +11 -0
  228. package/dist/typescript/module/shared/hooks/useKeyboardOffset.d.ts.map +1 -0
  229. package/package.json +4 -2
  230. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +0 -1
  231. package/src/features/profile/Profile.tsx +83 -0
  232. package/src/features/profile/__tests__/ProfileModel.test.ts +99 -0
  233. package/src/features/profile/__tests__/profile.helpers.test.ts +57 -0
  234. package/src/features/profile/components/actions/ProfileActions.tsx +68 -0
  235. package/src/features/profile/components/cards/ProfileCard.tsx +53 -0
  236. package/src/features/profile/components/info/AccountInfoCard.tsx +74 -0
  237. package/src/features/profile/components/modals/JoinClassModal.tsx +180 -0
  238. package/src/features/profile/components/modals/LogoutConfirmModal.tsx +64 -0
  239. package/src/features/profile/components/modals/TranslationLanguageModal.tsx +126 -0
  240. package/src/features/profile/components/settings/LanguageSettingsCard.tsx +16 -0
  241. package/src/features/profile/components/settings/PreferencesCard.tsx +67 -0
  242. package/src/features/profile/components/settings/SettingRow.tsx +42 -0
  243. package/src/features/profile/components/settings/TextSettingsCard.tsx +64 -0
  244. package/src/features/profile/components/settings/TextSizeSlider.tsx +117 -0
  245. package/src/features/profile/components/settings/TextToSpeechRow.tsx +29 -0
  246. package/src/features/profile/components/settings/TranslationLanguageRow.tsx +60 -0
  247. package/src/features/profile/context/ProfileContext.tsx +24 -0
  248. package/src/features/profile/index.ts +11 -0
  249. package/src/features/profile/model/ProfileApi.ts +23 -0
  250. package/src/features/profile/model/ProfileJoinClassModel.ts +58 -0
  251. package/src/features/profile/model/ProfileLanguageModel.ts +26 -0
  252. package/src/features/profile/model/ProfileModel.ts +57 -0
  253. package/src/features/profile/model/profileModal.types.ts +16 -0
  254. package/src/features/profile/shared/JoinClassError.ts +7 -0
  255. package/src/features/profile/shared/profile.constants.ts +23 -0
  256. package/src/features/profile/shared/profile.helpers.ts +36 -0
  257. package/src/features/profile/shared/profile.types.ts +34 -0
  258. package/src/i18n/.generated/schema.json +9 -1
  259. package/src/index.ts +1 -0
  260. package/src/shared/hooks/useKeyboardOffset.ts +57 -0
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { useUnit } from 'effector-react';
6
+ import { BaseModal, Checkbox, CheckboxColor, CheckboxGroup, COLORS, HeadingVariants, Search, SPACING, Typography } from '@magmamath/react-native-ui';
7
+ import { TEST_IDS } from '@magmamath/students-qa';
8
+ import { useText } from "../../../../i18n/i18n.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const LIST_HEIGHT = 360;
11
+ export const TranslationLanguageModal = ({
12
+ modal: {
13
+ closeModal,
14
+ params
15
+ }
16
+ }) => {
17
+ const t = useText();
18
+ const {
19
+ model
20
+ } = params;
21
+ const {
22
+ search,
23
+ languages,
24
+ settings
25
+ } = useUnit({
26
+ search: model.language.$search,
27
+ languages: model.language.$languages,
28
+ settings: model.$settings
29
+ });
30
+ const closeAndReset = () => {
31
+ model.language.reset();
32
+ closeModal();
33
+ };
34
+ const selectLanguage = language => {
35
+ model.language.selectLanguage(language);
36
+ closeAndReset();
37
+ };
38
+ const items = languages.map(language => ({
39
+ id: language,
40
+ label: language,
41
+ radio: true,
42
+ color: CheckboxColor.ORANGE
43
+ }));
44
+ const selectedItems = items.filter(item => item.id === settings.translationLanguage);
45
+ return /*#__PURE__*/_jsx(BaseModal, {
46
+ onClose: closeAndReset,
47
+ style: modalStyle,
48
+ header: /*#__PURE__*/_jsxs(View, {
49
+ style: styles.header,
50
+ children: [/*#__PURE__*/_jsx(Typography, {
51
+ variant: HeadingVariants.H2,
52
+ align: "center",
53
+ style: styles.title,
54
+ children: t('profile.translationModalTitle')
55
+ }), /*#__PURE__*/_jsx(Search, {
56
+ nativeID: "translation-language-search",
57
+ value: search,
58
+ onChangeText: model.language.setSearch,
59
+ placeholder: t('profile.search'),
60
+ containerStyle: styles.search,
61
+ testID: TEST_IDS.LANGUAGE_SEARCH_INPUT
62
+ })]
63
+ }),
64
+ content: /*#__PURE__*/_jsxs(View, {
65
+ style: styles.content,
66
+ children: [/*#__PURE__*/_jsx(Checkbox, {
67
+ radio: true,
68
+ label: t('profile.noLanguage'),
69
+ checked: !settings.translationLanguage,
70
+ color: CheckboxColor.ORANGE,
71
+ style: noLanguageStyle,
72
+ onPress: () => selectLanguage(null)
73
+ }), /*#__PURE__*/_jsx(View, {
74
+ style: styles.divider
75
+ }), /*#__PURE__*/_jsx(CheckboxGroup, {
76
+ items: items,
77
+ selectedItems: selectedItems,
78
+ initialNumToRender: items.length,
79
+ style: listStyle,
80
+ onPress: item => selectLanguage(languages.find(language => language === item.id) ?? null)
81
+ })]
82
+ })
83
+ });
84
+ };
85
+ const styles = StyleSheet.create({
86
+ modal: {
87
+ width: 530
88
+ },
89
+ header: {
90
+ gap: SPACING['500']
91
+ },
92
+ title: {
93
+ color: COLORS.NEUTRAL_9
94
+ },
95
+ search: {
96
+ width: '100%'
97
+ },
98
+ content: {
99
+ gap: SPACING['300']
100
+ },
101
+ noLanguage: {
102
+ paddingLeft: SPACING['200']
103
+ },
104
+ divider: {
105
+ backgroundColor: COLORS.NEUTRAL_3,
106
+ height: 1
107
+ },
108
+ list: {
109
+ height: LIST_HEIGHT,
110
+ width: '100%'
111
+ }
112
+ });
113
+ const modalStyle = {
114
+ container: styles.modal
115
+ };
116
+ const noLanguageStyle = {
117
+ container: styles.noLanguage
118
+ };
119
+ const listStyle = {
120
+ container: styles.list
121
+ };
122
+ //# sourceMappingURL=TranslationLanguageModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","useUnit","BaseModal","Checkbox","CheckboxColor","CheckboxGroup","COLORS","HeadingVariants","Search","SPACING","Typography","TEST_IDS","useText","jsx","_jsx","jsxs","_jsxs","LIST_HEIGHT","TranslationLanguageModal","modal","closeModal","params","t","model","search","languages","settings","language","$search","$languages","$settings","closeAndReset","reset","selectLanguage","items","map","id","label","radio","color","ORANGE","selectedItems","filter","item","translationLanguage","onClose","style","modalStyle","header","styles","children","variant","H2","align","title","nativeID","value","onChangeText","setSearch","placeholder","containerStyle","testID","LANGUAGE_SEARCH_INPUT","content","checked","noLanguageStyle","onPress","divider","initialNumToRender","length","listStyle","find","create","width","gap","NEUTRAL_9","noLanguage","paddingLeft","backgroundColor","NEUTRAL_3","height","list","container"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/modals/TranslationLanguageModal.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,gBAAgB;AAExC,SACEC,SAAS,EACTC,QAAQ,EACRC,aAAa,EACbC,aAAa,EACbC,MAAM,EACNC,eAAe,EACfC,MAAM,EACNC,OAAO,EACPC,UAAU,QACL,4BAA4B;AACnC,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD,SAASC,OAAO,QAAQ,0BAAuB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAG/C,MAAMC,WAAW,GAAG,GAAG;AAEvB,OAAO,MAAMC,wBAAwB,GAAGA,CAAC;EAAEC,KAAK,EAAE;IAAEC,UAAU;IAAEC;EAAO;AAAqB,CAAC,KAAK;EAChG,MAAMC,CAAC,GAAGV,OAAO,CAAC,CAAC;EACnB,MAAM;IAAEW;EAAM,CAAC,GAAGF,MAAM;EACxB,MAAM;IAAEG,MAAM;IAAEC,SAAS;IAAEC;EAAS,CAAC,GAAGzB,OAAO,CAAC;IAC9CuB,MAAM,EAAED,KAAK,CAACI,QAAQ,CAACC,OAAO;IAC9BH,SAAS,EAAEF,KAAK,CAACI,QAAQ,CAACE,UAAU;IACpCH,QAAQ,EAAEH,KAAK,CAACO;EAClB,CAAC,CAAC;EAEF,MAAMC,aAAa,GAAGA,CAAA,KAAM;IAC1BR,KAAK,CAACI,QAAQ,CAACK,KAAK,CAAC,CAAC;IACtBZ,UAAU,CAAC,CAAC;EACd,CAAC;EAED,MAAMa,cAAc,GAAIN,QAAyB,IAAK;IACpDJ,KAAK,CAACI,QAAQ,CAACM,cAAc,CAACN,QAAQ,CAAC;IACvCI,aAAa,CAAC,CAAC;EACjB,CAAC;EAED,MAAMG,KAAK,GAAGT,SAAS,CAACU,GAAG,CAAER,QAAQ,KAAM;IACzCS,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2B;AAAW,CAAC;AACxD,MAAMN,SAAS,GAAG;EAAEY,SAAS,EAAEjC,MAAM,CAACgC;AAAK,CAAC","ignoreList":[]}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { useText } from "../../../../i18n/i18n.js";
5
+ import { ProfileCard } from "../cards/ProfileCard.js";
6
+ import { TextToSpeechRow } from "./TextToSpeechRow.js";
7
+ import { TranslationLanguageRow } from "./TranslationLanguageRow.js";
8
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
9
+ export const LanguageSettingsCard = () => {
10
+ const t = useText();
11
+ return /*#__PURE__*/_jsxs(ProfileCard, {
12
+ title: t('profile.languageSettings'),
13
+ children: [/*#__PURE__*/_jsx(TextToSpeechRow, {}), /*#__PURE__*/_jsx(TranslationLanguageRow, {})]
14
+ });
15
+ };
16
+ //# sourceMappingURL=LanguageSettingsCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useText","ProfileCard","TextToSpeechRow","TranslationLanguageRow","jsx","_jsx","jsxs","_jsxs","LanguageSettingsCard","t","title","children"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/LanguageSettingsCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,eAAe,QAAQ,sBAAmB;AACnD,SAASC,sBAAsB,QAAQ,6BAA0B;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjE,OAAO,MAAMC,oBAAoB,GAAGA,CAAA,KAAM;EACxC,MAAMC,CAAC,GAAGT,OAAO,CAAC,CAAC;EAEnB,oBACEO,KAAA,CAACN,WAAW;IAACS,KAAK,EAAED,CAAC,CAAC,0BAA0B,CAAE;IAAAE,QAAA,gBAChDN,IAAA,CAACH,eAAe,IAAE,CAAC,eACnBG,IAAA,CAACF,sBAAsB,IAAE,CAAC;EAAA,CACf,CAAC;AAElB,CAAC","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { useUnit } from 'effector-react';
6
+ import { COLORS, KeyboardIcon, PencilIcon, SelectGroup, SelectOptionColor } from '@magmamath/react-native-ui';
7
+ import { useText } from "../../../../i18n/i18n.js";
8
+ import { useProfile } from "../../context/ProfileContext.js";
9
+ import { ProfileCanvasType } from "../../shared/profile.constants.js";
10
+ import { ProfileCard } from "../cards/ProfileCard.js";
11
+ import { SettingRow } from "./SettingRow.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ const ICON_SIZE = 22;
14
+ const CONTROL_MAX_WIDTH = 248;
15
+
16
+ // Pass the glyph via `title` (children), not `icon`: an icon-only Button locks to a fixed
17
+ // square and collapses the SelectOption's flex stretch.
18
+ const CANVAS_OPTIONS = [{
19
+ key: String(ProfileCanvasType.DRAWING),
20
+ title: /*#__PURE__*/_jsx(PencilIcon, {
21
+ size: ICON_SIZE,
22
+ color: COLORS.NEUTRAL_9
23
+ })
24
+ }, {
25
+ key: String(ProfileCanvasType.SPREADSHEET),
26
+ title: /*#__PURE__*/_jsx(KeyboardIcon, {
27
+ size: ICON_SIZE,
28
+ color: COLORS.NEUTRAL_9
29
+ })
30
+ }];
31
+ export const PreferencesCard = () => {
32
+ const t = useText();
33
+ const {
34
+ model
35
+ } = useProfile();
36
+ const settings = useUnit(model.$settings);
37
+ return /*#__PURE__*/_jsx(ProfileCard, {
38
+ title: t('profile.preferences'),
39
+ children: /*#__PURE__*/_jsx(SettingRow, {
40
+ label: t('profile.solveMode'),
41
+ children: /*#__PURE__*/_jsx(View, {
42
+ style: styles.control,
43
+ children: /*#__PURE__*/_jsx(SelectGroup, {
44
+ color: SelectOptionColor.GREY,
45
+ options: CANVAS_OPTIONS,
46
+ selectedOptions: CANVAS_OPTIONS.filter(({
47
+ key
48
+ }) => key === String(settings.canvasType)),
49
+ onOptionChange: ({
50
+ key
51
+ }) => model.setCanvasType(key === String(ProfileCanvasType.SPREADSHEET) ? ProfileCanvasType.SPREADSHEET : ProfileCanvasType.DRAWING)
52
+ })
53
+ })
54
+ })
55
+ });
56
+ };
57
+ const styles = StyleSheet.create({
58
+ control: {
59
+ flex: 1,
60
+ maxWidth: CONTROL_MAX_WIDTH
61
+ }
62
+ });
63
+ //# sourceMappingURL=PreferencesCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","useUnit","COLORS","KeyboardIcon","PencilIcon","SelectGroup","SelectOptionColor","useText","useProfile","ProfileCanvasType","ProfileCard","SettingRow","jsx","_jsx","ICON_SIZE","CONTROL_MAX_WIDTH","CANVAS_OPTIONS","key","String","DRAWING","title","size","color","NEUTRAL_9","SPREADSHEET","PreferencesCard","t","model","settings","$settings","children","label","style","styles","control","GREY","options","selectedOptions","filter","canvasType","onOptionChange","setCanvasType","create","flex","maxWidth"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/PreferencesCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SACEC,MAAM,EACNC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,iBAAiB,QAEZ,4BAA4B;AAEnC,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,iCAA8B;AACzD,SAASC,iBAAiB,QAAQ,mCAAgC;AAClE,SAASC,WAAW,QAAQ,yBAAsB;AAClD,SAASC,UAAU,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEzC,MAAMC,SAAS,GAAG,EAAE;AACpB,MAAMC,iBAAiB,GAAG,GAAG;;AAE7B;AACA;AACA,MAAMC,cAAmC,GAAG,CAC1C;EACEC,GAAG,EAAEC,MAAM,CAACT,iBAAiB,CAACU,OAA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D,CACF;MAAC,CACE;IAAC,CACG;EAAC,CACF,CAAC;AAElB,CAAC;AAED,MAAMc,MAAM,GAAGlC,UAAU,CAAC2C,MAAM,CAAC;EAC/BR,OAAO,EAAE;IACPS,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE7B;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { StyleSheet, View } from 'react-native';
5
+ import { COLORS, HeadingVariants, SPACING, Typography } from '@magmamath/react-native-ui';
6
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
+ export const SettingRow = ({
8
+ icon,
9
+ label,
10
+ children,
11
+ style
12
+ }) => /*#__PURE__*/_jsxs(View, {
13
+ style: [styles.row, style],
14
+ children: [/*#__PURE__*/_jsxs(View, {
15
+ style: styles.labelGroup,
16
+ children: [icon, /*#__PURE__*/_jsx(Typography, {
17
+ variant: HeadingVariants.H8,
18
+ style: styles.label,
19
+ children: label
20
+ })]
21
+ }), children]
22
+ });
23
+ const styles = StyleSheet.create({
24
+ row: {
25
+ alignItems: 'center',
26
+ flexDirection: 'row',
27
+ gap: SPACING['400'],
28
+ justifyContent: 'space-between',
29
+ padding: SPACING['200']
30
+ },
31
+ labelGroup: {
32
+ alignItems: 'center',
33
+ flexDirection: 'row',
34
+ flexShrink: 1,
35
+ gap: SPACING['200']
36
+ },
37
+ label: {
38
+ color: COLORS.NEUTRAL_9,
39
+ flexShrink: 1
40
+ }
41
+ });
42
+ //# sourceMappingURL=SettingRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","StyleSheet","View","COLORS","HeadingVariants","SPACING","Typography","jsx","_jsx","jsxs","_jsxs","SettingRow","icon","label","children","style","styles","row","labelGroup","variant","H8","create","alignItems","flexDirection","gap","justifyContent","padding","flexShrink","color","NEUTRAL_9"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/SettingRow.tsx"],"mappings":";;AAAA,OAAO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'react';
4
+ import { useUnit } from 'effector-react';
5
+ import { StyleSheet, View } from 'react-native';
6
+ import { COLORS, HeadingVariants, ParagraphVariants, SPACING, Typography } from '@magmamath/react-native-ui';
7
+ import { useText } from "../../../../i18n/i18n.js";
8
+ import { useProfile } from "../../context/ProfileContext.js";
9
+ import { TextSizeSlider } from "./TextSizeSlider.js";
10
+ import { ProfileCard } from "../cards/ProfileCard.js";
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
+ export const TextSettingsCard = () => {
13
+ const t = useText();
14
+ const {
15
+ model
16
+ } = useProfile();
17
+ const settings = useUnit(model.$settings);
18
+ return /*#__PURE__*/_jsxs(ProfileCard, {
19
+ title: t('profile.textSettings'),
20
+ children: [/*#__PURE__*/_jsx(Typography, {
21
+ variant: HeadingVariants.H8,
22
+ style: styles.label,
23
+ children: t('profile.textSize')
24
+ }), /*#__PURE__*/_jsxs(View, {
25
+ style: styles.sliderWrap,
26
+ children: [/*#__PURE__*/_jsx(TextSizeSlider, {
27
+ value: settings.textSize,
28
+ onSlidingComplete: model.setTextSize
29
+ }), /*#__PURE__*/_jsxs(View, {
30
+ style: styles.markers,
31
+ children: [/*#__PURE__*/_jsx(Typography, {
32
+ variant: ParagraphVariants.XS,
33
+ style: styles.marker,
34
+ selectable: false,
35
+ children: "A"
36
+ }), /*#__PURE__*/_jsx(Typography, {
37
+ variant: ParagraphVariants.MEDIUM,
38
+ style: styles.marker,
39
+ selectable: false,
40
+ children: "A"
41
+ }), /*#__PURE__*/_jsx(Typography, {
42
+ variant: ParagraphVariants.XL,
43
+ style: styles.marker,
44
+ selectable: false,
45
+ children: "A"
46
+ })]
47
+ })]
48
+ })]
49
+ });
50
+ };
51
+ const styles = StyleSheet.create({
52
+ label: {
53
+ color: COLORS.NEUTRAL_9,
54
+ padding: SPACING['200']
55
+ },
56
+ sliderWrap: {
57
+ gap: SPACING['200'],
58
+ margin: SPACING['100']
59
+ },
60
+ markers: {
61
+ alignItems: 'center',
62
+ flexDirection: 'row',
63
+ justifyContent: 'space-between'
64
+ },
65
+ marker: {
66
+ color: COLORS.NEUTRAL_7,
67
+ fontWeight: '700',
68
+ width: 16
69
+ }
70
+ });
71
+ //# sourceMappingURL=TextSettingsCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useUnit","StyleSheet","View","COLORS","HeadingVariants","ParagraphVariants","SPACING","Typography","useText","useProfile","TextSizeSlider","ProfileCard","jsx","_jsx","jsxs","_jsxs","TextSettingsCard","t","model","settings","$settings","title","children","variant","H8","style","styles","label","sliderWrap","value","textSize","onSlidingComplete","setTextSize","markers","XS","marker","selectable","MEDIUM","XL","create","color","NEUTRAL_9","padding","gap","margin","alignItems","flexDirection","justifyContent","NEUTRAL_7","fontWeight","width"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/TextSettingsCard.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,MAAM,EACNC,eAAe,EACfC,iBAAiB,EACjBC,OAAO,EACPC,UAAU,QACL,4BAA4B;AAEnC,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,iCAA8B;AACzD,SAASC,cAAc,QAAQ,qBAAkB;AACjD,SAASC,WAAW,QAAQ,yBAAsB;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAElD,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EACpC,MAAMC,CAAC,GAAGT,OAAO,CAAC,CAAC;EACnB,MAAM;IAAEU;EAAM,CAAC,GAAGT,UAAU,CAAC,CAAC;EAC9B,MAAMU,QAAQ,GAAGnB,OAAO,CAACkB,KAAK,CAACE,SAAS,CAAC;EAEzC,oBACEL,KAAA,CAACJ,WAAW;IAACU,KAAK,EAAEJ,CAAC,CAAC,sBAAsB,CAAE;IAAAK,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CAAC;IACnBsC,MAAM,EAAEtC,OAAO,CAAC,KAAK;EACvB,CAAC;EACD2B,OAAO,EAAE;IACPY,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDZ,MAAM,EAAE;IACNK,KAAK,EAAErC,MAAM,CAAC6C,SAAS;IACvBC,UAAU,EAAE,KAAK;IACjBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ import React, { useRef, useState } from 'react';
4
+ import { PanResponder, StyleSheet, View } from 'react-native';
5
+ import { COLORS } from '@magmamath/react-native-ui';
6
+ import { TEST_IDS } from '@magmamath/students-qa';
7
+ import { TEXT_SIZE } from "../../shared/profile.constants.js";
8
+ import { snapTextSize } from "../../shared/profile.helpers.js";
9
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
+ const THUMB_SIZE = 20;
11
+ const DOT_SIZE = 6;
12
+ const TRACK_HEIGHT = 10;
13
+ const TRACK_RADIUS = 5;
14
+ const STEPS = (TEXT_SIZE.MAX - TEXT_SIZE.MIN) / TEXT_SIZE.STEP + 1;
15
+ const RANGE = TEXT_SIZE.MAX - TEXT_SIZE.MIN;
16
+ const TRACK_PADDING = THUMB_SIZE / 2 - DOT_SIZE / 2;
17
+ export const TextSizeSlider = ({
18
+ value,
19
+ onSlidingComplete
20
+ }) => {
21
+ const [trackWidth, setTrackWidth] = useState(0);
22
+ const [dragValue, setDragValue] = useState(null);
23
+ const widthRef = useRef(0);
24
+ const onCompleteRef = useRef(onSlidingComplete);
25
+ onCompleteRef.current = onSlidingComplete;
26
+ const currentValue = dragValue ?? value;
27
+ const fraction = RANGE === 0 ? 0 : (currentValue - TEXT_SIZE.MIN) / RANGE;
28
+ const travel = Math.max(0, trackWidth - THUMB_SIZE);
29
+ const measureTrack = event => {
30
+ const width = event.nativeEvent.layout.width;
31
+ widthRef.current = width;
32
+ setTrackWidth(width);
33
+ };
34
+ const valueFromX = x => {
35
+ const width = widthRef.current;
36
+ if (width <= 0) return TEXT_SIZE.MIN;
37
+ const ratio = Math.min(1, Math.max(0, x / width));
38
+ return snapTextSize(TEXT_SIZE.MIN + ratio * RANGE);
39
+ };
40
+ const panResponder = useRef(PanResponder.create({
41
+ onStartShouldSetPanResponder: () => true,
42
+ onMoveShouldSetPanResponder: () => true,
43
+ onPanResponderGrant: event => setDragValue(valueFromX(event.nativeEvent.locationX)),
44
+ onPanResponderMove: event => setDragValue(valueFromX(event.nativeEvent.locationX)),
45
+ onPanResponderRelease: event => {
46
+ const next = valueFromX(event.nativeEvent.locationX);
47
+ setDragValue(null);
48
+ onCompleteRef.current(next);
49
+ },
50
+ onPanResponderTerminate: () => setDragValue(null)
51
+ })).current;
52
+ return /*#__PURE__*/_jsxs(View, {
53
+ style: styles.container,
54
+ onLayout: measureTrack,
55
+ testID: TEST_IDS.TEXT_SIZE_SLIDER,
56
+ ...panResponder.panHandlers,
57
+ children: [/*#__PURE__*/_jsx(View, {
58
+ style: styles.track,
59
+ children: Array.from({
60
+ length: STEPS
61
+ }, (_, index) => {
62
+ const isEdge = index === 0 || index === STEPS - 1;
63
+ return /*#__PURE__*/_jsx(View, {
64
+ style: [styles.dot, isEdge && styles.dotHidden]
65
+ }, index);
66
+ })
67
+ }), /*#__PURE__*/_jsx(View, {
68
+ style: [styles.thumb, {
69
+ left: fraction * travel
70
+ }]
71
+ })]
72
+ });
73
+ };
74
+ const styles = StyleSheet.create({
75
+ container: {
76
+ cursor: 'pointer',
77
+ height: THUMB_SIZE,
78
+ justifyContent: 'center',
79
+ width: '100%'
80
+ },
81
+ track: {
82
+ alignItems: 'center',
83
+ backgroundColor: COLORS.NEUTRAL_3,
84
+ borderColor: COLORS.NEUTRAL_4,
85
+ borderRadius: TRACK_RADIUS,
86
+ borderWidth: 0.5,
87
+ boxShadow: 'inset -3px -3px 3px rgba(255, 255, 255, 0.6), inset 2px 2px 3px rgba(0, 0, 0, 0.12)',
88
+ flexDirection: 'row',
89
+ height: TRACK_HEIGHT,
90
+ justifyContent: 'space-between',
91
+ paddingHorizontal: TRACK_PADDING,
92
+ width: '100%'
93
+ },
94
+ dot: {
95
+ backgroundColor: COLORS.NEUTRAL_5,
96
+ borderRadius: DOT_SIZE / 2,
97
+ height: DOT_SIZE,
98
+ width: DOT_SIZE
99
+ },
100
+ dotHidden: {
101
+ opacity: 0
102
+ },
103
+ thumb: {
104
+ backgroundColor: COLORS.NEUTRAL_1,
105
+ borderRadius: THUMB_SIZE / 2,
106
+ boxShadow: '0px 2px 6px rgba(0, 0, 0, 0.2)',
107
+ height: THUMB_SIZE,
108
+ position: 'absolute',
109
+ width: THUMB_SIZE
110
+ }
111
+ });
112
+ //# sourceMappingURL=TextSizeSlider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useRef","useState","PanResponder","StyleSheet","View","COLORS","TEST_IDS","TEXT_SIZE","snapTextSize","jsx","_jsx","jsxs","_jsxs","THUMB_SIZE","DOT_SIZE","TRACK_HEIGHT","TRACK_RADIUS","STEPS","MAX","MIN","STEP","RANGE","TRACK_PADDING","TextSizeSlider","value","onSlidingComplete","trackWidth","setTrackWidth","dragValue","setDragValue","widthRef","onCompleteRef","current","currentValue","fraction","travel","Math","max","measureTrack","event","width","nativeEvent","layout","valueFromX","x","ratio","min","panResponder","create","onStartShouldSetPanResponder","onMoveShouldSetPanResponder","onPanResponderGrant","locationX","onPanResponderMove","onPanResponderRelease","next","onPanResponderTerminate","style","styles","container","onLayout","testID","TEXT_SIZE_SLIDER","panHandlers","children","track","Array","from","length","_","index","isEdge","dot","dotHidden","thumb","left","cursor","height","justifyContent","alignItems","backgroundColor","NEUTRAL_3","borderColor","NEUTRAL_4","borderRadius","borderWidth","boxShadow","flexDirection","paddingHorizontal","NEUTRAL_5","opacity","NEUTRAL_1","position"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/TextSizeSlider.tsx"],"mappings":";;AAAA,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YAAY,EAAEpE,YAAY;IAC1BqE,WAAW,EAAE,GAAG;IAChBC,SAAS,EACP,qFAAqF;IACvFC,aAAa,EAAE,KAAK;IACpBV,MAAM,EAAE9D,YAAY;IACpB+D,cAAc,EAAE,eAAe;IAC/BU,iBAAiB,EAAElE,aAAa;IAChCkB,KAAK,EAAE;EACT,CAAC;EACDgC,GAAG,EAAE;IACHQ,eAAe,EAAE3E,MAAM,CAACoF,SAAS;IACjCL,YAAY,EAAEtE,QAAQ,GAAG,CAAC;IAC1B+D,MAAM,EAAE/D,QAAQ;IAChB0B,KAAK,EAAE1B;EACT,CAAC;EACD2D,SAAS,EAAE;IACTiB,OAAO,EAAE;EACX,CAAC;EACDhB,KAAK,EAAE;IACLM,eAAe,EAAE3E,MAAM,CAACsF,SAAS;IACjCP,YAAY,EAAEvE,UAAU,GAAG,CAAC;IAC5ByE,SAAS,EAAE,gCAAgC;IAC3CT,MAAM,EAAEhE,UAAU;IAClB+E,QAAQ,EAAE,UAAU;IACpBpD,KAAK,EAAE3B;EACT;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { useUnit } from 'effector-react';
5
+ import { COLORS, SpeakerIcon, Toggle } from '@magmamath/react-native-ui';
6
+ import { TEST_IDS } from '@magmamath/students-qa';
7
+ import { useText } from "../../../../i18n/i18n.js";
8
+ import { useProfile } from "../../context/ProfileContext.js";
9
+ import { SettingRow } from "./SettingRow.js";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ const ICON_SIZE = 20;
12
+ export const TextToSpeechRow = () => {
13
+ const t = useText();
14
+ const {
15
+ model
16
+ } = useProfile();
17
+ const settings = useUnit(model.$settings);
18
+ return /*#__PURE__*/_jsx(SettingRow, {
19
+ icon: /*#__PURE__*/_jsx(SpeakerIcon, {
20
+ size: ICON_SIZE,
21
+ color: COLORS.NEUTRAL_7
22
+ }),
23
+ label: t('profile.textToSpeech'),
24
+ children: /*#__PURE__*/_jsx(Toggle, {
25
+ value: settings.textToSpeech,
26
+ onValueChange: model.setTextToSpeech,
27
+ testID: TEST_IDS.PROFILE_TTS_SWITCH
28
+ })
29
+ });
30
+ };
31
+ //# sourceMappingURL=TextToSpeechRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useUnit","COLORS","SpeakerIcon","Toggle","TEST_IDS","useText","useProfile","SettingRow","jsx","_jsx","ICON_SIZE","TextToSpeechRow","t","model","settings","$settings","icon","size","color","NEUTRAL_7","label","children","value","textToSpeech","onValueChange","setTextToSpeech","testID","PROFILE_TTS_SWITCH"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/TextToSpeechRow.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,MAAM,EAAEC,WAAW,EAAEC,MAAM,QAAQ,4BAA4B;AACxE,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,iCAA8B;AACzD,SAASC,UAAU,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEzC,MAAMC,SAAS,GAAG,EAAE;AAEpB,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACnC,MAAMC,CAAC,GAAGP,OAAO,CAAC,CAAC;EACnB,MAAM;IAAEQ;EAAM,CAAC,GAAGP,UAAU,CAAC,CAAC;EAC9B,MAAMQ,QAAQ,GAAGd,OAAO,CAACa,KAAK,CAACE,SAAS,CAAC;EAEzC,oBACEN,IAAA,CAACF,UAAU;IACTS,IAAI,eAAEP,IAAA,CAACP,WAAW;MAACe,IAAI,EAAEP,SAAU;MAACQ,KAAK,EAAEjB,MAAM,CAACkB;IAAU,CAAE,CAAE;IAChEC,KAAK,EAAER,CAAC,CAAC,sBAAsB,CAAE;IAAAS,QAAA,eAEjCZ,IAAA,CAACN,MAAM;MACLmB,KAAK,EAAER,QAAQ,CAACS,YAAa;MAC7BC,aAAa,EAAEX,KAAK,CAACY,eAAgB;MACrCC,MAAM,EAAEtB,QAAQ,CAACuB;IAAmB,CACrC;EAAC,CACQ,CAAC;AAEjB,CAAC","ignoreList":[]}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+
3
+ import React from 'react';
4
+ import { useUnit } from 'effector-react';
5
+ import { StyleSheet } from 'react-native';
6
+ import { COLORS, FilterDropdown, FilterDropdownSize, FilterDropdownVariant, GlobeIcon } from '@magmamath/react-native-ui';
7
+ import { TEST_IDS } from '@magmamath/students-qa';
8
+ import { useText } from "../../../../i18n/i18n.js";
9
+ import { useProfile } from "../../context/ProfileContext.js";
10
+ import { SettingRow } from "./SettingRow.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ const ICON_SIZE = 20;
13
+ export const TranslationLanguageRow = () => {
14
+ const t = useText();
15
+ const {
16
+ model,
17
+ onOpenTranslationModal
18
+ } = useProfile();
19
+ const settings = useUnit(model.$settings);
20
+ return /*#__PURE__*/_jsx(SettingRow, {
21
+ icon: /*#__PURE__*/_jsx(GlobeIcon, {
22
+ size: ICON_SIZE,
23
+ color: COLORS.NEUTRAL_7
24
+ }),
25
+ label: t('profile.translationLanguage'),
26
+ style: styles.settingRow,
27
+ children: /*#__PURE__*/_jsx(FilterDropdown, {
28
+ variant: FilterDropdownVariant.SECONDARY,
29
+ size: FilterDropdownSize.MEDIUM,
30
+ value: settings.translationLanguage ?? undefined,
31
+ placeholder: t('profile.selectLanguage'),
32
+ disabled: settings.isTranslationLocked,
33
+ onPress: onOpenTranslationModal,
34
+ accessibilityLabel: t('profile.translationLanguage'),
35
+ testID: TEST_IDS.PROFILE_LANGUAGE_SELECTOR,
36
+ style: {
37
+ text: styles.filterLabel,
38
+ container: styles.filterContainer
39
+ }
40
+ })
41
+ });
42
+ };
43
+ const styles = StyleSheet.create({
44
+ settingRow: {
45
+ paddingVertical: 0
46
+ },
47
+ filterLabel: {
48
+ color: COLORS.NEUTRAL_7,
49
+ fontSize: 16,
50
+ fontWeight: '400'
51
+ },
52
+ filterContainer: {
53
+ maxWidth: 231
54
+ }
55
+ });
56
+ //# sourceMappingURL=TranslationLanguageRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useUnit","StyleSheet","COLORS","FilterDropdown","FilterDropdownSize","FilterDropdownVariant","GlobeIcon","TEST_IDS","useText","useProfile","SettingRow","jsx","_jsx","ICON_SIZE","TranslationLanguageRow","t","model","onOpenTranslationModal","settings","$settings","icon","size","color","NEUTRAL_7","label","style","styles","settingRow","children","variant","SECONDARY","MEDIUM","value","translationLanguage","undefined","placeholder","disabled","isTranslationLocked","onPress","accessibilityLabel","testID","PROFILE_LANGUAGE_SELECTOR","text","filterLabel","container","filterContainer","create","paddingVertical","fontSize","fontWeight","maxWidth"],"sourceRoot":"../../../../../../src","sources":["features/profile/components/settings/TranslationLanguageRow.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,UAAU,QAAQ,cAAc;AACzC,SACEC,MAAM,EACNC,cAAc,EACdC,kBAAkB,EAClBC,qBAAqB,EACrBC,SAAS,QACJ,4BAA4B;AACnC,SAASC,QAAQ,QAAQ,wBAAwB;AAEjD,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,iCAA8B;AACzD,SAASC,UAAU,QAAQ,iBAAc;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEzC,MAAMC,SAAS,GAAG,EAAE;AAEpB,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EAC1C,MAAMC,CAAC,GAAGP,OAAO,CAAC,CAAC;EACnB,MAAM;IAAEQ,KAAK;IAAEC;EAAuB,CAAC,GAAGR,UAAU,CAAC,CAAC;EACtD,MAAMS,QAAQ,GAAGlB,OAAO,CAACgB,KAAK,CAACG,SAAS,CAAC;EAEzC,oBACEP,IAAA,CAACF,UAAU;IACTU,IAAI,eAAER,IAAA,CAACN,SAAS;MAACe,IAAI,EAAER,SAAU;MAACS,KAAK,EAAEpB,MAAM,CAACqB;IAAU,CAAE,CAAE;IAC9DC,KAAK,EAAET,CAAC,CAAC,6BAA6B,CAAE;IACxCU,KAAK,EAAEC,MAAM,CAACC,UAAW;IAAAC,QAAA,eAEzBhB,IAAA,CAACT,cAAc;MACb0B,OAAO,EAAExB,qBAAqB,CAACyB,SAAU;MACzCT,IAAI,EAAEjB,kBAAkB,CAAC2B,MAAO;MAChCC,KAAK,EAAEd,QAAQ,CAACe,mBAAmB,IAAIC,SAAU;MACjDC,WAAW,EAAEpB,CAAC,CAAC,wBAAwB,CAAE;MACzCqB,QAAQ,EAAElB,QAAQ,CAACmB,mBAAoB;MACvCC,OAAO,EAAErB,sBAAuB;MAChCsB,kBAAkB,EAAExB,CAAC,CAAC,6BAA6B,CAAE;MACrDyB,MAAM,EAAEjC,QAAQ,CAACkC,yBAA0B;MAC3ChB,KAAK,EAAE;QACLiB,IAAI,EAAEhB,MAAM,CAACiB,WAAW;QACxBC,SAAS,EAAElB,MAAM,CAACmB;MACpB;IAAE,CACH;EAAC,CACQ,CAAC;AAEjB,CAAC;AAED,MAAMnB,MAAM,GAAGzB,UAAU,CAAC6C,MAAM,CAAC;EAC/BnB,UAAU,EAAE;IACVoB,eAAe,EAAE;EACnB,CAAC;EACDJ,WAAW,EAAE;IACXrB,KAAK,EAAEpB,MAAM,CAACqB,SAAS;IACvByB,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDJ,eAAe,EAAE;IACfK,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ import { createContext, useContext } from 'react';
4
+ const ProfileContext = /*#__PURE__*/createContext(null);
5
+ export function useProfile() {
6
+ const value = useContext(ProfileContext);
7
+ if (!value) {
8
+ throw new Error('useProfile must be used within ProfileProvider');
9
+ }
10
+ return value;
11
+ }
12
+ export const ProfileProvider = ProfileContext.Provider;
13
+ //# sourceMappingURL=ProfileContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","useContext","ProfileContext","useProfile","value","Error","ProfileProvider","Provider"],"sourceRoot":"../../../../../src","sources":["features/profile/context/ProfileContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,EAAEC,UAAU,QAAwB,OAAO;AAajE,MAAMC,cAAc,gBAAGF,aAAa,CAA6B,IAAI,CAAC;AAEtE,OAAO,SAASG,UAAUA,CAAA,EAAwB;EAChD,MAAMC,KAAK,GAAGH,UAAU,CAACC,cAAc,CAAC;EACxC,IAAI,CAACE,KAAK,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,gDAAgD,CAAC;EACnE;EACA,OAAOD,KAAK;AACd;AAEA,OAAO,MAAME,eAAe,GAAGJ,cAAc,CAACK,QAAQ","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ export { Profile } from "./Profile.js";
4
+ export { ProfileModel } from "./model/ProfileModel.js";
5
+ export { TranslationLanguageModal } from "./components/modals/TranslationLanguageModal.js";
6
+ export { JoinClassModal } from "./components/modals/JoinClassModal.js";
7
+ export { LogoutConfirmModal } from "./components/modals/LogoutConfirmModal.js";
8
+ export { JoinClassError } from "./shared/JoinClassError.js";
9
+ export * from "./shared/profile.types.js";
10
+ export * from "./shared/profile.constants.js";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Profile","ProfileModel","TranslationLanguageModal","JoinClassModal","LogoutConfirmModal","JoinClassError"],"sourceRoot":"../../../../src","sources":["features/profile/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAW;AACnC,SAASC,YAAY,QAAQ,yBAAsB;AAGnD,SAASC,wBAAwB,QAAQ,iDAA8C;AACvF,SAASC,cAAc,QAAQ,uCAAoC;AACnE,SAASC,kBAAkB,QAAQ,2CAAwC;AAE3E,SAASC,cAAc,QAAQ,4BAAyB;AACxD,cAAc,2BAAwB;AACtC,cAAc,+BAA4B","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ import { createEffect } from 'effector';
4
+ export class ProfileApi {
5
+ constructor(props) {
6
+ this.updateSettingsFx = createEffect(props.updateSettings);
7
+ this.joinClassFx = createEffect(props.joinClass);
8
+ }
9
+ }
10
+ //# sourceMappingURL=ProfileApi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","ProfileApi","constructor","props","updateSettingsFx","updateSettings","joinClassFx","joinClass"],"sourceRoot":"../../../../../src","sources":["features/profile/model/ProfileApi.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AAcvC,OAAO,MAAMC,UAAU,CAAC;EAItBC,WAAWA,CAACC,KAAsB,EAAE;IAClC,IAAI,CAACC,gBAAgB,GAAGJ,YAAY,CAACG,KAAK,CAACE,cAAc,CAAC;IAC1D,IAAI,CAACC,WAAW,GAAGN,YAAY,CAACG,KAAK,CAACI,SAAS,CAAC;EAClD;AACF","ignoreList":[]}