@magmamath/students-features 1.3.3-rc.1 → 1.3.3-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +2 -2
  2. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +2 -2
  4. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/helpers.js +3 -3
  6. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +2 -2
  8. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  9. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js +2 -2
  10. package/dist/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  11. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js +2 -2
  12. package/dist/commonjs/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  13. package/dist/commonjs/features/feedback/components/EmptyComment.js +2 -2
  14. package/dist/commonjs/features/feedback/components/EmptyComment.js.map +1 -1
  15. package/dist/commonjs/features/feedback/model/comments.js +2 -2
  16. package/dist/commonjs/features/feedback/model/comments.js.map +1 -1
  17. package/dist/commonjs/features/gifCelebrations/components/Gif.js +2 -2
  18. package/dist/commonjs/features/gifCelebrations/components/Gif.js.map +1 -1
  19. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js +2 -2
  20. package/dist/commonjs/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  21. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +2 -2
  22. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  23. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +2 -2
  24. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
  25. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +2 -2
  26. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
  27. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +2 -2
  28. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
  29. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +2 -2
  30. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
  31. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +2 -2
  32. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
  33. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +2 -2
  34. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
  35. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +7 -7
  36. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
  37. package/dist/commonjs/lib/helpers/helpers.js +12 -12
  38. package/dist/commonjs/lib/helpers/helpers.js.map +1 -1
  39. package/dist/commonjs/shared/translation/i18n.d.js +5 -0
  40. package/dist/commonjs/shared/translation/i18n.d.js.map +1 -0
  41. package/dist/commonjs/shared/translation/i18n.js +26 -0
  42. package/dist/commonjs/shared/translation/i18n.js.map +1 -0
  43. package/dist/commonjs/shared/translation/react-i18next.d.js +5 -0
  44. package/dist/commonjs/shared/translation/react-i18next.d.js.map +1 -0
  45. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js +1 -1
  46. package/dist/module/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.js.map +1 -1
  47. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +1 -1
  48. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +1 -1
  49. package/dist/module/features/chatbot/helpers.js +1 -1
  50. package/dist/module/features/chatbot/helpers.js.map +1 -1
  51. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -1
  52. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  53. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js +1 -1
  54. package/dist/module/features/exampleSolution/components/ExampleSolutionModalContent.js.map +1 -1
  55. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js +1 -1
  56. package/dist/module/features/exampleSolution/model/ExampleSolutionApi.js.map +1 -1
  57. package/dist/module/features/feedback/components/EmptyComment.js +1 -1
  58. package/dist/module/features/feedback/components/EmptyComment.js.map +1 -1
  59. package/dist/module/features/feedback/model/comments.js +1 -1
  60. package/dist/module/features/feedback/model/comments.js.map +1 -1
  61. package/dist/module/features/gifCelebrations/components/Gif.js +1 -1
  62. package/dist/module/features/gifCelebrations/components/Gif.js.map +1 -1
  63. package/dist/module/features/keyboard/components/Numpad/Numpad.js +1 -1
  64. package/dist/module/features/keyboard/components/Numpad/Numpad.js.map +1 -1
  65. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +1 -1
  66. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  67. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +1 -1
  68. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -1
  69. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +1 -1
  70. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -1
  71. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +1 -1
  72. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -1
  73. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +1 -1
  74. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -1
  75. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +1 -1
  76. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -1
  77. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +1 -1
  78. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -1
  79. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +1 -1
  80. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -1
  81. package/dist/module/lib/helpers/helpers.js +1 -1
  82. package/dist/module/lib/helpers/helpers.js.map +1 -1
  83. package/dist/module/shared/translation/i18n.d.js +5 -0
  84. package/dist/module/shared/translation/i18n.d.js.map +1 -0
  85. package/dist/module/shared/translation/{hooks.js → i18n.js} +10 -3
  86. package/dist/module/shared/translation/i18n.js.map +1 -0
  87. package/dist/module/shared/translation/react-i18next.d.js +5 -0
  88. package/dist/module/shared/translation/react-i18next.d.js.map +1 -0
  89. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +2 -1
  90. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  91. package/dist/typescript/commonjs/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  92. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts +1 -1
  93. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  94. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
  95. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
  96. package/dist/typescript/commonjs/shared/translation/i18n.d.ts +7 -0
  97. package/dist/typescript/commonjs/shared/translation/i18n.d.ts.map +1 -0
  98. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +2 -1
  99. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  100. package/dist/typescript/module/features/exampleSolution/components/ExampleSolutionModalContent.d.ts.map +1 -1
  101. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts +1 -1
  102. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  103. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +1 -1
  104. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -1
  105. package/dist/typescript/module/shared/translation/i18n.d.ts +7 -0
  106. package/dist/typescript/module/shared/translation/i18n.d.ts.map +1 -0
  107. package/package.json +16 -16
  108. package/src/features/chatbot/components/ChatInput/FreeText/FreeTextInputBlock.tsx +1 -1
  109. package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +1 -1
  110. package/src/features/chatbot/helpers.ts +1 -1
  111. package/src/features/chatbot/model/ChatBoxTextManager.ts +3 -3
  112. package/src/features/exampleSolution/components/ExampleSolutionModalContent.tsx +1 -1
  113. package/src/features/exampleSolution/model/ExampleSolutionApi.ts +1 -1
  114. package/src/features/feedback/components/EmptyComment.tsx +1 -1
  115. package/src/features/feedback/model/comments.ts +1 -1
  116. package/src/features/gifCelebrations/components/Gif.tsx +1 -1
  117. package/src/features/gifCelebrations/helpers.ts +1 -1
  118. package/src/features/keyboard/components/Numpad/Numpad.tsx +1 -1
  119. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +1 -1
  120. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +1 -1
  121. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +1 -1
  122. package/src/features/voice/recording/components/VoiceRecordButton.tsx +1 -1
  123. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +2 -2
  124. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +1 -1
  125. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +1 -1
  126. package/src/features/voice/recording/model/VoiceRecord.model.ts +1 -1
  127. package/src/lib/helpers/helpers.ts +1 -1
  128. package/src/shared/translation/i18n.d.ts +21 -0
  129. package/src/shared/translation/i18n.ts +17 -0
  130. package/src/shared/translation/react-i18next.d.ts +21 -0
  131. package/dist/commonjs/locales/schema.json +0 -1
  132. package/dist/commonjs/shared/translation/constants.js +0 -8
  133. package/dist/commonjs/shared/translation/constants.js.map +0 -1
  134. package/dist/commonjs/shared/translation/helpers.js +0 -17
  135. package/dist/commonjs/shared/translation/helpers.js.map +0 -1
  136. package/dist/commonjs/shared/translation/hooks.js +0 -17
  137. package/dist/commonjs/shared/translation/hooks.js.map +0 -1
  138. package/dist/commonjs/shared/translation/index.js +0 -20
  139. package/dist/commonjs/shared/translation/index.js.map +0 -1
  140. package/dist/commonjs/shared/translation/types.js +0 -2
  141. package/dist/commonjs/shared/translation/types.js.map +0 -1
  142. package/dist/module/locales/schema.json +0 -1
  143. package/dist/module/shared/translation/constants.js +0 -4
  144. package/dist/module/shared/translation/constants.js.map +0 -1
  145. package/dist/module/shared/translation/helpers.js +0 -11
  146. package/dist/module/shared/translation/helpers.js.map +0 -1
  147. package/dist/module/shared/translation/hooks.js.map +0 -1
  148. package/dist/module/shared/translation/index.js +0 -5
  149. package/dist/module/shared/translation/index.js.map +0 -1
  150. package/dist/module/shared/translation/types.js +0 -2
  151. package/dist/module/shared/translation/types.js.map +0 -1
  152. package/dist/typescript/commonjs/shared/translation/constants.d.ts +0 -2
  153. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +0 -1
  154. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +0 -3
  155. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +0 -1
  156. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +0 -3
  157. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +0 -1
  158. package/dist/typescript/commonjs/shared/translation/index.d.ts +0 -4
  159. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +0 -1
  160. package/dist/typescript/commonjs/shared/translation/types.d.ts +0 -3
  161. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +0 -1
  162. package/dist/typescript/module/shared/translation/constants.d.ts +0 -2
  163. package/dist/typescript/module/shared/translation/constants.d.ts.map +0 -1
  164. package/dist/typescript/module/shared/translation/helpers.d.ts +0 -3
  165. package/dist/typescript/module/shared/translation/helpers.d.ts.map +0 -1
  166. package/dist/typescript/module/shared/translation/hooks.d.ts +0 -3
  167. package/dist/typescript/module/shared/translation/hooks.d.ts.map +0 -1
  168. package/dist/typescript/module/shared/translation/index.d.ts +0 -4
  169. package/dist/typescript/module/shared/translation/index.d.ts.map +0 -1
  170. package/dist/typescript/module/shared/translation/types.d.ts +0 -3
  171. package/dist/typescript/module/shared/translation/types.d.ts.map +0 -1
  172. package/src/locales/schema.json +0 -1
  173. package/src/shared/translation/constants.ts +0 -1
  174. package/src/shared/translation/helpers.ts +0 -7
  175. package/src/shared/translation/hooks.ts +0 -9
  176. package/src/shared/translation/index.ts +0 -3
  177. package/src/shared/translation/types.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "1.3.3-rc.1",
3
+ "version": "1.3.3-rc.3",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -21,31 +21,29 @@
21
21
  "peerDependencies": {
22
22
  "@magmamath/frontend-config": "1.1.0",
23
23
  "@magmamath/react-native-ui": "*",
24
- "@react-native-masked-view/masked-view": "*",
25
24
  "effector": "^23.2.3",
26
25
  "effector-react": "^23.2.1",
27
- "expo": ">=52.0.47",
28
- "expo-audio": "^1.1.1",
29
- "i18next": ">=22",
30
26
  "patronum": "^2.3.0",
31
27
  "react": "*",
32
- "react-i18next": ">=11",
33
28
  "react-native": "*",
34
29
  "react-native-gesture-handler": "*",
35
- "react-native-linear-gradient": "*",
36
30
  "react-native-modalfy": "*",
37
31
  "react-native-reanimated": ">=0.3.16",
38
- "react-native-svg": "^15.10.0"
32
+ "react-native-svg": "^15.10.0",
33
+ "expo-audio": "^1.1.1",
34
+ "expo": ">=52.0.47",
35
+ "@react-native-masked-view/masked-view": "*",
36
+ "react-native-linear-gradient": "*",
37
+ "i18next": ">=22",
38
+ "react-i18next": ">=11"
39
39
  },
40
40
  "devDependencies": {
41
- "@magmamath/frontend-config": "1.1.0",
42
41
  "@magmamath/react-native-ui": "0.4.83",
43
- "@react-native-masked-view/masked-view": "^0.3.2",
42
+ "@magmamath/frontend-config": "1.1.0",
44
43
  "@react-native/eslint-config": "^0.73.1",
45
44
  "@release-it/conventional-changelog": "^9.0.2",
46
45
  "@types/jest": "^29.5.5",
47
46
  "@types/react": "^18.2.44",
48
- "axios": "^1.13.5",
49
47
  "del-cli": "^5.1.0",
50
48
  "effector": "^23.2.3",
51
49
  "effector-react": "^23.2.1",
@@ -54,21 +52,23 @@
54
52
  "eslint-plugin-prettier": "^5.0.1",
55
53
  "expo": "^52.0.47",
56
54
  "expo-audio": "^1.1.1",
57
- "i18next": "^22.5.1",
58
55
  "jest": "^29.7.0",
59
- "patronum": "^2.3.0",
60
56
  "prettier": "^3.0.3",
57
+ "patronum": "^2.3.0",
61
58
  "react": "18.3.1",
62
- "react-i18next": "^11.3.4",
63
59
  "react-native": "0.76.3",
64
60
  "react-native-builder-bob": "^0.33.3",
65
61
  "react-native-gesture-handler": "^2.28.0",
66
- "react-native-linear-gradient": "^2.8.3",
67
62
  "react-native-modalfy": "^3.7.0",
68
63
  "react-native-reanimated": "^3.17.2",
69
64
  "react-native-svg": "^15.10.0",
70
65
  "release-it": "^17.10.0",
71
- "typescript": "^5.2.2"
66
+ "typescript": "^5.2.2",
67
+ "axios": "^1.13.5",
68
+ "@react-native-masked-view/masked-view": "^0.3.2",
69
+ "react-native-linear-gradient": "^2.8.3",
70
+ "i18next": "^22.5.1",
71
+ "react-i18next": "^11.3.4"
72
72
  },
73
73
  "resolutions": {
74
74
  "@types/react": "^18.2.44"
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'
4
4
  import { ColorScheme } from '../../../types/style.types'
5
5
  import { HintButtonVariant, RequestHintButton } from '../RequestHintButton'
6
6
  import { useChatModel } from '../../../context/ChatBotModelContext'
7
- import { t } from '../../../../../shared/translation'
7
+ import { getText as t } from '../../../../../shared/translation/i18n'
8
8
  import { ChatTextInput } from './ChatTextInput'
9
9
 
10
10
  type FreeTextInputBlockProps = {
@@ -5,7 +5,7 @@ import { useStoreMap, useUnit } from 'effector-react'
5
5
  import { StyleSheet } from 'react-native'
6
6
  import { HighlighterIcon } from '../../../shared/icons/HighlighterIcon'
7
7
  import { ConversationMessage } from '../types/units.types'
8
- import { useText } from '../../../shared/translation'
8
+ import { useText } from '../../../shared/translation/i18n'
9
9
 
10
10
  type ErrorSpottingButtonProps = {
11
11
  contextMessage: ConversationMessage
@@ -2,7 +2,7 @@ import { IS_WEB } from '@magmamath/react-native-ui'
2
2
  // https://stackoverflow.com/questions/56575859/google-translate-api-does-not-return-apostrophe-as-apostrophe-in-python
3
3
  import { KATEX_REPLACEMENTS, KATEX_REPLACEMENTS_REVERSE } from './constants'
4
4
  import { GetAlternativesResponse, PostMessagePayload } from './types/api.types'
5
- import { t } from '../../shared/translation'
5
+ import { getText as t } from '../../shared/translation/i18n'
6
6
  import { ThreadItem } from './model/ThreadItem'
7
7
  import { ChatRequestPayload, ChatRequestType } from './types/model.types'
8
8
 
@@ -1,9 +1,9 @@
1
1
  import { DefaultMessagesCreator } from './DefaultMessageCreator'
2
- import { getText } from '../../../shared/translation/helpers'
3
2
  import { ChatbotMessages } from '../types/model.types'
3
+ import { getText, TranslationKeys } from '../../../shared/translation/i18n'
4
4
 
5
5
  export class ChatBotTextManager {
6
- private readonly messagesCreator = new DefaultMessagesCreator<string>({
6
+ private readonly messagesCreator = new DefaultMessagesCreator<TranslationKeys>({
7
7
  textGetter: getText,
8
8
  }).bindToLanguageChanged()
9
9
 
@@ -19,7 +19,7 @@ export class ChatBotTextManager {
19
19
  private readonly defaultMessages = { ...this.messages }
20
20
 
21
21
  public update(
22
- cb: (manager: DefaultMessagesCreator<string>) => Partial<ChatbotMessages>,
22
+ cb: (manager: DefaultMessagesCreator<TranslationKeys>) => Partial<ChatbotMessages>,
23
23
  ) {
24
24
  Object.assign(this.messages, cb(this.messagesCreator))
25
25
  }
@@ -1,11 +1,11 @@
1
1
  import { StyleSheet, View } from 'react-native'
2
2
  import React from 'react'
3
3
  import { COLORS, HeadingVariants, IS_WEB, SPACING, Typography } from '@magmamath/react-native-ui'
4
- import { useText } from '../../../shared/translation'
5
4
  import { ExampleSolutionModalParams } from '../types'
6
5
  import { QuestionSection } from './QuestionSection'
7
6
  import { SolutionSection } from './SolutionSection'
8
7
  import { useExampleSolution } from '../hooks/useExampleSolution'
8
+ import { useText } from '../../../shared/translation/i18n'
9
9
 
10
10
  type ExampleSolutionModalContentProps = {
11
11
  params: ExampleSolutionModalParams
@@ -1,7 +1,7 @@
1
1
  import { createControllerEffect } from './../../../lib/effector/createControllerEffect'
2
2
  import { ExampleSolutionApiRequests, ExampleSolutionErrorHandler } from '../types'
3
- import { getText } from '../../../shared/translation/helpers'
4
3
  import { createEffect, sample } from 'effector'
4
+ import { getText } from '../../../shared/translation/i18n'
5
5
 
6
6
  type ExampleSolutionApiProps = {
7
7
  api: ExampleSolutionApiRequests
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import { StyleSheet, Text, View } from 'react-native'
3
3
  import { COLORS } from '@magmamath/react-native-ui'
4
4
  import { BUENOS_AIRES_FONT } from '../constants'
5
- import { useText } from '../../../shared/translation'
5
+ import { useText } from '../../../shared/translation/i18n'
6
6
 
7
7
  export const EmptyComment = () => {
8
8
  const t = useText()
@@ -2,7 +2,7 @@ import { createEvent, restore, sample, Store } from 'effector'
2
2
  import { AddCommentProps, CommentsMap, Credits, DeleteCommentProps, TeacherComment } from '../types'
3
3
  import { TeacherFeedbackAPI } from './api'
4
4
  import { updateCommentsState } from '../helpers'
5
- import { getText } from '../../../shared/translation/helpers'
5
+ import { getText } from '../../../shared/translation/i18n'
6
6
  import { EMPTY_COMMENT } from '@magmamath/students-features'
7
7
 
8
8
  type TeacherCommentsModelProps = {
@@ -3,7 +3,7 @@ import React, { useLayoutEffect, useState } from 'react'
3
3
  import { BORDER_RADIUS, COLORS, IS_WEB, SPACING } from '@magmamath/react-native-ui'
4
4
  import { CustomGetCachePathMethod, GifObject, TextComponentType } from '../types/model.types'
5
5
  import { MAX_GIF_SIZE, MIN_GIF_SIZE } from '../constants'
6
- import { useText } from '../../../shared/translation'
6
+ import { useText } from '../../../shared/translation/i18n'
7
7
  import { constrainDimension, getGifLabel, getImagePath } from '../helpers'
8
8
  import gifFallback from '../assets/gifFallback.gif'
9
9
  import { Size } from '../../../types/common.types'
@@ -1,4 +1,4 @@
1
- import { TranslationKeys } from 'src/shared/translation/types'
1
+ import { TranslationKeys } from 'src/shared/translation/i18n'
2
2
  import {
3
3
  CustomGetCachePathMethod,
4
4
  GifsGroups,
@@ -3,7 +3,7 @@ import { KeysList } from '../KeysList/KeysList'
3
3
  import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native'
4
4
  import { SPACING } from '@magmamath/react-native-ui'
5
5
  import { KeyboardLayoutProps, KeyboardType } from '../../types/types'
6
- import { useText } from '../../../../shared/translation'
6
+ import { useText } from '../../../../shared/translation/i18n'
7
7
  import { getMainKeyboardGroup } from '../../helpers'
8
8
 
9
9
  type NumpadProps = {
@@ -1,4 +1,4 @@
1
- import { useText } from '../../../../../shared/translation'
1
+ import { useText } from '../../../../../shared/translation/i18n'
2
2
  import { useMemo, useState } from 'react'
3
3
  import { KeyboardUnitsGroupType, UnitTab } from '../types'
4
4
  import { useWindowDimensions } from 'react-native'
@@ -24,7 +24,7 @@ import { useVoiceTranscriptionsDropdown } from '../hooks/useVoiceTranscriptionsD
24
24
  import { VoicePlayerModel, PlayerState } from '../model'
25
25
  import { VoiceTranscriptionsDropdownItem } from './VoiceTranscriptionsDropdownItem'
26
26
  import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from '../../constants'
27
- import { useText } from '../../../../shared/translation'
27
+ import { useText } from '../../../../shared/translation/i18n'
28
28
  import { PlayButton } from '../../../../shared/components/PlayButton'
29
29
  import { getActiveAttempt, getAudioStatus } from '../../helpers'
30
30
 
@@ -12,7 +12,7 @@ import {
12
12
  } from '@magmamath/react-native-ui'
13
13
  import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated'
14
14
  import { useVoiceTranscriptionsDropdownItemAnimation } from '../hooks/useVoiceTranscriptionsDropdownItemAnimation'
15
- import { useText } from '../../../../shared/translation'
15
+ import { useText } from '../../../../shared/translation/i18n'
16
16
 
17
17
  type VoiceTranscriptionsDropdownItemProps = {
18
18
  attempt: number
@@ -12,7 +12,7 @@ import { MicrophoneIcon, CheckIcon } from '@magmamath/react-native-ui'
12
12
  import { VoiceRecordModel } from '../model/VoiceRecord.model'
13
13
  import { useUnit } from 'effector-react'
14
14
  import { VoiceRecorderState } from '../../constants'
15
- import { useText } from '../../../../shared/translation'
15
+ import { useText } from '../../../../shared/translation/i18n'
16
16
 
17
17
  type VoiceRecordButtonProps = {
18
18
  style?: ButtonStyle
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
2
  import { Button, ButtonColor, ButtonSize, ButtonVariant, SPACING } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet, View } from 'react-native'
4
- import { useText } from '../../../../shared/translation'
5
- import { TranslationKeys } from '../../../../shared/translation/types'
4
+ import { useText } from '../../../../shared/translation/i18n'
5
+ import { TranslationKeys } from '../../../../shared/translation/i18n'
6
6
 
7
7
  type ModalFooterButtonsProps = {
8
8
  onCancel: () => void
@@ -3,7 +3,7 @@ import { BaseModal, ButtonColor } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet } from 'react-native'
4
4
  import { useUnit } from 'effector-react'
5
5
  import { VoiceRecorderState } from '../../constants'
6
- import { useText } from '../../../../shared/translation'
6
+ import { useText } from '../../../../shared/translation/i18n'
7
7
  import { ModalFooterButtons } from './ModalFooterButtons'
8
8
  import { VoiceRecordModalParams } from '../../types'
9
9
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import { BaseModal } from '@magmamath/react-native-ui'
3
3
  import { StyleSheet } from 'react-native'
4
- import { useText } from '../../../../shared/translation'
4
+ import { useText } from '../../../../shared/translation/i18n'
5
5
  import { ModalFooterButtons } from './ModalFooterButtons'
6
6
  import { VoiceRecordModalParams } from '../../types'
7
7
 
@@ -10,7 +10,7 @@ import {
10
10
  } from '../../types'
11
11
  import { ensureRecordingPermissions, getAvailableInputs } from '../../helpers'
12
12
  import { VOICE_RECORDER_MIN_DURATION_MS } from '../../constants'
13
- import { t } from '../../../../shared/translation'
13
+ import { getText as t } from '../../../../shared/translation/i18n'
14
14
 
15
15
  type VoiceRecordModelParams = {
16
16
  api: VoiceRecorderApi
@@ -1,4 +1,4 @@
1
- import { getText } from '../../shared/translation/helpers'
1
+ import { getText } from '../../shared/translation/i18n'
2
2
 
3
3
  export const noop = () => {}
4
4
 
@@ -0,0 +1,21 @@
1
+ import 'i18next'
2
+ import 'react-i18next'
3
+ import schema from './schema.json'
4
+
5
+ declare module 'i18next' {
6
+ interface CustomTypeOptions {
7
+ defaultNS: 'students-features'
8
+ resources: {
9
+ ['students-features']: typeof schema
10
+ }
11
+ }
12
+ }
13
+
14
+ declare module 'react-i18next' {
15
+ interface CustomTypeOptions {
16
+ defaultNS: 'students-features'
17
+ resources: {
18
+ ['students-features']: typeof schema
19
+ }
20
+ }
21
+ }
@@ -0,0 +1,17 @@
1
+ import i18next, { TFuncKey } from 'i18next'
2
+ import { useTranslation } from 'react-i18next'
3
+ import { useCallback } from 'react'
4
+
5
+ export const NAMESPACE = 'students-features'
6
+
7
+ export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string
8
+ export type TranslationKeys = TFuncKey<typeof NAMESPACE>
9
+
10
+ export const getText: GetText = (key, args = null) => {
11
+ return i18next.t(key, { ns: NAMESPACE, ...(args || {}) }) as string
12
+ }
13
+
14
+ export const useText = (): GetText => {
15
+ const { t } = useTranslation(NAMESPACE)
16
+ return useCallback<GetText>((key, args = null) => t(key, args ?? undefined) as string, [t])
17
+ }
@@ -0,0 +1,21 @@
1
+ import 'i18next'
2
+ import 'react-i18next'
3
+ import schema from './schema.json'
4
+
5
+ declare module 'i18next' {
6
+ interface CustomTypeOptions {
7
+ defaultNS: 'students-features'
8
+ resources: {
9
+ ['students-features']: typeof schema
10
+ }
11
+ }
12
+ }
13
+
14
+ declare module 'react-i18next' {
15
+ interface CustomTypeOptions {
16
+ defaultNS: 'students-features'
17
+ resources: {
18
+ ['students-features']: typeof schema
19
+ }
20
+ }
21
+ }
@@ -1 +0,0 @@
1
- {}
@@ -1,8 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.NAMESPACE = void 0;
7
- const NAMESPACE = exports.NAMESPACE = 'students-features';
8
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NAMESPACE","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,SAAS,GAAAC,OAAA,CAAAD,SAAA,GAAG,mBAAmB","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getText = void 0;
7
- var _i18next = _interopRequireDefault(require("i18next"));
8
- var _constants = require("./constants.js");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- const getText = (key, args = null) => {
11
- return _i18next.default.t(key, {
12
- ns: _constants.NAMESPACE,
13
- ...(args || {})
14
- });
15
- };
16
- exports.getText = getText;
17
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_i18next","_interopRequireDefault","require","_constants","e","__esModule","default","getText","key","args","i18next","t","ns","NAMESPACE","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAuC,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhC,MAAMG,OAAgB,GAAGA,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;EACpD,OAAOC,gBAAO,CAACC,CAAC,CAACH,GAAG,EAAE;IAAEI,EAAE,EAAEC,oBAAS;IAAE,IAAIJ,IAAI,IAAI,CAAC,CAAC;EAAE,CAAC,CAAC;AAC3D,CAAC;AAAAK,OAAA,CAAAP,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useText = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _constants = require("./constants.js");
10
- const useText = () => {
11
- const {
12
- t
13
- } = (0, _reactI18next.useTranslation)(_constants.NAMESPACE);
14
- return (0, _react.useCallback)((key, args = null) => t(key, args ?? undefined), [t]);
15
- };
16
- exports.useText = useText;
17
- //# sourceMappingURL=hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactI18next","_constants","useText","t","useTranslation","NAMESPACE","useCallback","key","args","undefined","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAGO,MAAMG,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAG,IAAAC,4BAAc,EAACC,oBAAS,CAAC;EACvC,OAAO,IAAAC,kBAAW,EAAU,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKL,CAAC,CAACI,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAC,EAAE,CAACN,CAAC,CAAC,CAAC;AACnF,CAAC;AAAAO,OAAA,CAAAR,OAAA,GAAAA,OAAA","ignoreList":[]}
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "t", {
7
- enumerable: true,
8
- get: function () {
9
- return _helpers.getText;
10
- }
11
- });
12
- Object.defineProperty(exports, "useText", {
13
- enumerable: true,
14
- get: function () {
15
- return _hooks.useText;
16
- }
17
- });
18
- var _hooks = require("./hooks.js");
19
- var _helpers = require("./helpers.js");
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_hooks","require","_helpers"],"sourceRoot":"../../../../src","sources":["shared/translation/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export const NAMESPACE = 'students-features';
4
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NAMESPACE"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;AAAA,OAAO,MAAMA,SAAS,GAAG,mBAAmB","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- import i18next from 'i18next';
4
- import { NAMESPACE } from "./constants.js";
5
- export const getText = (key, args = null) => {
6
- return i18next.t(key, {
7
- ns: NAMESPACE,
8
- ...(args || {})
9
- });
10
- };
11
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["i18next","NAMESPACE","getText","key","args","t","ns"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;AAAA,OAAOA,OAAO,MAAM,SAAS;AAC7B,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAgB,GAAGA,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;EACpD,OAAOJ,OAAO,CAACK,CAAC,CAACF,GAAG,EAAE;IAAEG,EAAE,EAAEL,SAAS;IAAE,IAAIG,IAAI,IAAI,CAAC,CAAC;EAAE,CAAC,CAAC;AAC3D,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["useCallback","useTranslation","NAMESPACE","useText","t","key","args","undefined"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,SAAS,QAAQ,gBAAa;AAGvC,OAAO,MAAMC,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAM;IAAEC;EAAE,CAAC,GAAGH,cAAc,CAACC,SAAS,CAAC;EACvC,OAAOF,WAAW,CAAU,CAACK,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAKF,CAAC,CAACC,GAAG,EAAEC,IAAI,IAAIC,SAAS,CAAC,EAAE,CAACH,CAAC,CAAC,CAAC;AACnF,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- export { useText } from "./hooks.js";
4
- export { getText as t } from "./helpers.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useText","getText","t"],"sourceRoot":"../../../../src","sources":["shared/translation/index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,YAAS;AACjC,SAASC,OAAO,IAAIC,CAAC,QAAQ,cAAW","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare const NAMESPACE = "students-features";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sBAAsB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const getText: GetText;
3
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,EAAE,OAErB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const useText: () => GetText;
3
- //# sourceMappingURL=hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,QAAO,OAG1B,CAAA"}
@@ -1,4 +0,0 @@
1
- export { useText } from './hooks';
2
- export { getText as t } from './helpers';
3
- export type { TranslationKeys, GetText } from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1,3 +0,0 @@
1
- export type TranslationKeys = string;
2
- export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAA;AACpC,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const NAMESPACE = "students-features";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,sBAAsB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const getText: GetText;
3
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,EAAE,OAErB,CAAA"}
@@ -1,3 +0,0 @@
1
- import { GetText } from './types';
2
- export declare const useText: () => GetText;
3
- //# sourceMappingURL=hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEjC,eAAO,MAAM,OAAO,QAAO,OAG1B,CAAA"}
@@ -1,4 +0,0 @@
1
- export { useText } from './hooks';
2
- export { getText as t } from './helpers';
3
- export type { TranslationKeys, GetText } from './types';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACxC,YAAY,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA"}
@@ -1,3 +0,0 @@
1
- export type TranslationKeys = string;
2
- export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAA;AACpC,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA"}
@@ -1 +0,0 @@
1
- {}
@@ -1 +0,0 @@
1
- export const NAMESPACE = 'students-features'
@@ -1,7 +0,0 @@
1
- import i18next from 'i18next'
2
- import { NAMESPACE } from './constants'
3
- import { GetText } from './types'
4
-
5
- export const getText: GetText = (key, args = null) => {
6
- return i18next.t(key, { ns: NAMESPACE, ...(args || {}) })
7
- }