@magmamath/students-features 1.3.23-rc.2 → 1.3.23-rc.21

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 (306) hide show
  1. package/dist/commonjs/features/translation/constants.js +11 -0
  2. package/dist/commonjs/features/translation/constants.js.map +1 -0
  3. package/dist/commonjs/features/translation/helpers.js +60 -0
  4. package/dist/commonjs/features/translation/helpers.js.map +1 -0
  5. package/dist/commonjs/features/translation/index.js +105 -0
  6. package/dist/commonjs/features/translation/index.js.map +1 -0
  7. package/dist/commonjs/features/translation/model/TranslationModel.js +122 -0
  8. package/dist/commonjs/features/translation/model/TranslationModel.js.map +1 -0
  9. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js +142 -0
  10. package/dist/commonjs/features/translation/model/TranslationPreprocessor.js.map +1 -0
  11. package/dist/commonjs/features/translation/model/TranslationService.js +112 -0
  12. package/dist/commonjs/features/translation/model/TranslationService.js.map +1 -0
  13. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js +314 -0
  14. package/dist/commonjs/features/translation/preserve/wordsToPreserve.js.map +1 -0
  15. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js +50 -0
  16. package/dist/commonjs/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
  17. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js +230 -0
  18. package/dist/commonjs/features/translation/providers/google/supportedLanguages.js.map +1 -0
  19. package/dist/commonjs/features/translation/providers/google.types.js +2 -0
  20. package/dist/commonjs/features/translation/providers/google.types.js.map +1 -0
  21. package/dist/commonjs/features/translation/providers/translation.interface.js +49 -0
  22. package/dist/commonjs/features/translation/providers/translation.interface.js.map +1 -0
  23. package/dist/commonjs/features/translation/types.js +2 -0
  24. package/dist/commonjs/features/translation/types.js.map +1 -0
  25. package/dist/commonjs/features/voice/index.js +4 -4
  26. package/dist/commonjs/features/voice/index.js.map +1 -1
  27. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js +44 -0
  28. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
  29. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js +107 -0
  30. package/dist/commonjs/features/voice/playing/components/VoiceTranscription.js.map +1 -0
  31. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js +66 -0
  32. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
  33. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +58 -0
  34. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
  35. package/dist/commonjs/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +8 -7
  36. package/dist/commonjs/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
  37. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js +128 -0
  38. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
  39. package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +4 -4
  40. package/dist/commonjs/features/voice/playing/model/Dropdown.model.js.map +1 -0
  41. package/dist/commonjs/features/voice/playing/model/PlaybackController.js +183 -0
  42. package/dist/commonjs/features/voice/playing/model/PlaybackController.js.map +1 -0
  43. package/dist/commonjs/features/voice/playing/model/Player.model.js +24 -1
  44. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -1
  45. package/dist/commonjs/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +4 -4
  46. package/dist/commonjs/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
  47. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js +82 -0
  48. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
  49. package/dist/commonjs/features/voice/playing/model/Translation.model.js +62 -0
  50. package/dist/commonjs/features/voice/playing/model/Translation.model.js.map +1 -0
  51. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  52. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  53. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +46 -172
  54. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  55. package/dist/commonjs/features/voice/types.js.map +1 -1
  56. package/dist/commonjs/index.js +12 -0
  57. package/dist/commonjs/index.js.map +1 -1
  58. package/dist/module/features/translation/constants.js +7 -0
  59. package/dist/module/features/translation/constants.js.map +1 -0
  60. package/dist/module/features/translation/helpers.js +53 -0
  61. package/dist/module/features/translation/helpers.js.map +1 -0
  62. package/dist/module/features/translation/index.js +12 -0
  63. package/dist/module/features/translation/index.js.map +1 -0
  64. package/dist/module/features/translation/model/TranslationModel.js +117 -0
  65. package/dist/module/features/translation/model/TranslationModel.js.map +1 -0
  66. package/dist/module/features/translation/model/TranslationPreprocessor.js +137 -0
  67. package/dist/module/features/translation/model/TranslationPreprocessor.js.map +1 -0
  68. package/dist/module/features/translation/model/TranslationService.js +107 -0
  69. package/dist/module/features/translation/model/TranslationService.js.map +1 -0
  70. package/dist/module/features/translation/preserve/wordsToPreserve.js +310 -0
  71. package/dist/module/features/translation/preserve/wordsToPreserve.js.map +1 -0
  72. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js +45 -0
  73. package/dist/module/features/translation/providers/google/GoogleTranslationProvider.js.map +1 -0
  74. package/dist/module/features/translation/providers/google/supportedLanguages.js +225 -0
  75. package/dist/module/features/translation/providers/google/supportedLanguages.js.map +1 -0
  76. package/dist/module/features/translation/providers/google.types.js +2 -0
  77. package/dist/module/features/translation/providers/google.types.js.map +1 -0
  78. package/dist/module/features/translation/providers/translation.interface.js +44 -0
  79. package/dist/module/features/translation/providers/translation.interface.js.map +1 -0
  80. package/dist/module/features/translation/types.js +2 -0
  81. package/dist/module/features/translation/types.js.map +1 -0
  82. package/dist/module/features/voice/index.js +1 -1
  83. package/dist/module/features/voice/index.js.map +1 -1
  84. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js +38 -0
  85. package/dist/module/features/voice/playing/components/VoiceTranscriptContent.js.map +1 -0
  86. package/dist/module/features/voice/playing/components/VoiceTranscription.js +101 -0
  87. package/dist/module/features/voice/playing/components/VoiceTranscription.js.map +1 -0
  88. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js +58 -0
  89. package/dist/module/features/voice/playing/components/VoiceTranscriptionCollapsible.js.map +1 -0
  90. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js +52 -0
  91. package/dist/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.js.map +1 -0
  92. package/dist/module/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.js → useDropdownAnimation.js} +6 -5
  93. package/dist/module/features/voice/playing/hooks/useDropdownAnimation.js.map +1 -0
  94. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js +123 -0
  95. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionController.js.map +1 -0
  96. package/dist/module/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.js → Dropdown.model.js} +2 -2
  97. package/dist/module/features/voice/playing/model/Dropdown.model.js.map +1 -0
  98. package/dist/module/features/voice/playing/model/PlaybackController.js +178 -0
  99. package/dist/module/features/voice/playing/model/PlaybackController.js.map +1 -0
  100. package/dist/module/features/voice/playing/model/Player.model.js +24 -1
  101. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -1
  102. package/dist/module/features/voice/playing/model/{VoiceTranscriptionsCollection.js → TranscriptionsCollection.js} +2 -2
  103. package/dist/module/features/voice/playing/model/TranscriptionsCollection.js.map +1 -0
  104. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js +77 -0
  105. package/dist/module/features/voice/playing/model/TranscriptionsDownloader.model.js.map +1 -0
  106. package/dist/module/features/voice/playing/model/Translation.model.js +57 -0
  107. package/dist/module/features/voice/playing/model/Translation.model.js.map +1 -0
  108. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +2 -2
  109. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -1
  110. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +48 -174
  111. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -1
  112. package/dist/module/features/voice/types.js.map +1 -1
  113. package/dist/module/index.js +1 -0
  114. package/dist/module/index.js.map +1 -1
  115. package/dist/typescript/commonjs/features/translation/constants.d.ts +5 -0
  116. package/dist/typescript/commonjs/features/translation/constants.d.ts.map +1 -0
  117. package/dist/typescript/commonjs/features/translation/helpers.d.ts +9 -0
  118. package/dist/typescript/commonjs/features/translation/helpers.d.ts.map +1 -0
  119. package/dist/typescript/commonjs/features/translation/index.d.ts +12 -0
  120. package/dist/typescript/commonjs/features/translation/index.d.ts.map +1 -0
  121. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts +33 -0
  122. package/dist/typescript/commonjs/features/translation/model/TranslationModel.d.ts.map +1 -0
  123. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts +34 -0
  124. package/dist/typescript/commonjs/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
  125. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts +40 -0
  126. package/dist/typescript/commonjs/features/translation/model/TranslationService.d.ts.map +1 -0
  127. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts +3 -0
  128. package/dist/typescript/commonjs/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
  129. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
  130. package/dist/typescript/commonjs/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
  131. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts +209 -0
  132. package/dist/typescript/commonjs/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
  133. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts +15 -0
  134. package/dist/typescript/commonjs/features/translation/providers/google.types.d.ts.map +1 -0
  135. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts +30 -0
  136. package/dist/typescript/commonjs/features/translation/providers/translation.interface.d.ts.map +1 -0
  137. package/dist/typescript/commonjs/features/translation/types.d.ts +27 -0
  138. package/dist/typescript/commonjs/features/translation/types.d.ts.map +1 -0
  139. package/dist/typescript/commonjs/features/voice/index.d.ts +2 -1
  140. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -1
  141. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
  142. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
  143. package/dist/typescript/{module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
  144. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
  145. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
  146. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
  147. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
  148. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
  149. package/dist/typescript/{module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
  150. package/dist/typescript/commonjs/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
  151. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
  152. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
  153. package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → commonjs/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
  154. package/dist/typescript/commonjs/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
  155. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts +28 -0
  156. package/dist/typescript/commonjs/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
  157. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +3 -0
  158. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -1
  159. package/dist/typescript/{module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
  160. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
  161. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
  162. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
  163. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts +25 -0
  164. package/dist/typescript/commonjs/features/voice/playing/model/Translation.model.d.ts.map +1 -0
  165. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  166. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +18 -18
  168. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  169. package/dist/typescript/commonjs/features/voice/types.d.ts +5 -1
  170. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -1
  171. package/dist/typescript/commonjs/index.d.ts +1 -0
  172. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  173. package/dist/typescript/module/features/translation/constants.d.ts +5 -0
  174. package/dist/typescript/module/features/translation/constants.d.ts.map +1 -0
  175. package/dist/typescript/module/features/translation/helpers.d.ts +9 -0
  176. package/dist/typescript/module/features/translation/helpers.d.ts.map +1 -0
  177. package/dist/typescript/module/features/translation/index.d.ts +12 -0
  178. package/dist/typescript/module/features/translation/index.d.ts.map +1 -0
  179. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts +33 -0
  180. package/dist/typescript/module/features/translation/model/TranslationModel.d.ts.map +1 -0
  181. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts +34 -0
  182. package/dist/typescript/module/features/translation/model/TranslationPreprocessor.d.ts.map +1 -0
  183. package/dist/typescript/module/features/translation/model/TranslationService.d.ts +40 -0
  184. package/dist/typescript/module/features/translation/model/TranslationService.d.ts.map +1 -0
  185. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts +3 -0
  186. package/dist/typescript/module/features/translation/preserve/wordsToPreserve.d.ts.map +1 -0
  187. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts +17 -0
  188. package/dist/typescript/module/features/translation/providers/google/GoogleTranslationProvider.d.ts.map +1 -0
  189. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts +209 -0
  190. package/dist/typescript/module/features/translation/providers/google/supportedLanguages.d.ts.map +1 -0
  191. package/dist/typescript/module/features/translation/providers/google.types.d.ts +15 -0
  192. package/dist/typescript/module/features/translation/providers/google.types.d.ts.map +1 -0
  193. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts +30 -0
  194. package/dist/typescript/module/features/translation/providers/translation.interface.d.ts.map +1 -0
  195. package/dist/typescript/module/features/translation/types.d.ts +27 -0
  196. package/dist/typescript/module/features/translation/types.d.ts.map +1 -0
  197. package/dist/typescript/module/features/voice/index.d.ts +2 -1
  198. package/dist/typescript/module/features/voice/index.d.ts.map +1 -1
  199. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts +8 -0
  200. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptContent.d.ts.map +1 -0
  201. package/dist/typescript/{commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/components/VoiceTranscription.d.ts} +3 -4
  202. package/dist/typescript/module/features/voice/playing/components/VoiceTranscription.d.ts.map +1 -0
  203. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts +10 -0
  204. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionCollapsible.d.ts.map +1 -0
  205. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts +12 -0
  206. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionHeaderActions.d.ts.map +1 -0
  207. package/dist/typescript/{commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts → module/features/voice/playing/hooks/useDropdownAnimation.d.ts} +3 -3
  208. package/dist/typescript/module/features/voice/playing/hooks/useDropdownAnimation.d.ts.map +1 -0
  209. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts +30 -0
  210. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionController.d.ts.map +1 -0
  211. package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts → module/features/voice/playing/model/Dropdown.model.d.ts} +2 -2
  212. package/dist/typescript/module/features/voice/playing/model/Dropdown.model.d.ts.map +1 -0
  213. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts +28 -0
  214. package/dist/typescript/module/features/voice/playing/model/PlaybackController.d.ts.map +1 -0
  215. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +3 -0
  216. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -1
  217. package/dist/typescript/{commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts → module/features/voice/playing/model/TranscriptionsCollection.d.ts} +2 -2
  218. package/dist/typescript/module/features/voice/playing/model/TranscriptionsCollection.d.ts.map +1 -0
  219. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts +19 -0
  220. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloader.model.d.ts.map +1 -0
  221. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts +25 -0
  222. package/dist/typescript/module/features/voice/playing/model/Translation.model.d.ts.map +1 -0
  223. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +2 -2
  224. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -1
  225. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +18 -18
  226. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -1
  227. package/dist/typescript/module/features/voice/types.d.ts +5 -1
  228. package/dist/typescript/module/features/voice/types.d.ts.map +1 -1
  229. package/dist/typescript/module/index.d.ts +1 -0
  230. package/dist/typescript/module/index.d.ts.map +1 -1
  231. package/package.json +28 -1
  232. package/src/features/translation/constants.ts +4 -0
  233. package/src/features/translation/helpers.ts +63 -0
  234. package/src/features/translation/index.ts +30 -0
  235. package/src/features/translation/model/TranslationModel.ts +174 -0
  236. package/src/features/translation/model/TranslationPreprocessor.ts +171 -0
  237. package/src/features/translation/model/TranslationService.ts +148 -0
  238. package/src/features/translation/preserve/wordsToPreserve.ts +87 -0
  239. package/src/features/translation/providers/google/GoogleTranslationProvider.ts +50 -0
  240. package/src/features/translation/providers/google/supportedLanguages.ts +229 -0
  241. package/src/features/translation/providers/google.types.ts +16 -0
  242. package/src/features/translation/providers/translation.interface.ts +63 -0
  243. package/src/features/translation/types.ts +30 -0
  244. package/src/features/voice/index.ts +2 -1
  245. package/src/features/voice/playing/components/VoiceTranscriptContent.tsx +37 -0
  246. package/src/features/voice/playing/components/VoiceTranscription.tsx +117 -0
  247. package/src/features/voice/playing/components/VoiceTranscriptionCollapsible.tsx +59 -0
  248. package/src/features/voice/playing/components/VoiceTranscriptionHeaderActions.tsx +61 -0
  249. package/src/features/voice/playing/hooks/{useVoiceTranscriptionsDropdown.ts → useDropdownAnimation.ts} +5 -5
  250. package/src/features/voice/playing/hooks/useVoiceTranscriptionController.ts +171 -0
  251. package/src/features/voice/playing/model/{VoiceTranscriptionsDropdown.model.ts → Dropdown.model.ts} +2 -2
  252. package/src/features/voice/playing/model/PlaybackController.ts +213 -0
  253. package/src/features/voice/playing/model/Player.model.ts +26 -1
  254. package/src/features/voice/playing/model/{VoiceTranscriptionsCollection.ts → TranscriptionsCollection.ts} +1 -1
  255. package/src/features/voice/playing/model/TranscriptionsDownloader.model.ts +88 -0
  256. package/src/features/voice/playing/model/Translation.model.ts +75 -0
  257. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +2 -2
  258. package/src/features/voice/playing/model/VoicePlayer.model.ts +57 -194
  259. package/src/features/voice/types.ts +10 -0
  260. package/src/index.ts +1 -0
  261. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -251
  262. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
  263. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -109
  264. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
  265. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
  266. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -34
  267. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
  268. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -66
  269. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
  270. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
  271. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
  272. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +0 -244
  273. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +0 -1
  274. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +0 -103
  275. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +0 -1
  276. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +0 -1
  277. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +0 -29
  278. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +0 -1
  279. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +0 -61
  280. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +0 -1
  281. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +0 -1
  282. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +0 -1
  283. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
  284. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
  285. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
  286. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
  287. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
  288. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
  289. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
  290. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
  291. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
  292. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
  293. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +0 -1
  294. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +0 -12
  295. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +0 -1
  296. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +0 -1
  297. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +0 -11
  298. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +0 -1
  299. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +0 -15
  300. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +0 -1
  301. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +0 -1
  302. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +0 -1
  303. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +0 -302
  304. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +0 -128
  305. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +0 -40
  306. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +0 -80
@@ -1,109 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.VoiceTranscriptionsDropdownItem = void 0;
7
- var _reactNative = require("react-native");
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _reactNativeUi = require("@magmamath/react-native-ui");
10
- var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
11
- var _useVoiceTranscriptionsDropdownItemAnimation = require("../hooks/useVoiceTranscriptionsDropdownItemAnimation.js");
12
- var _i18n = require("../../../../i18n/i18n.js");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- const VoiceTranscriptionsDropdownItem = exports.VoiceTranscriptionsDropdownItem = /*#__PURE__*/(0, _react.memo)(({
17
- attempt,
18
- content,
19
- isActive,
20
- isLoading,
21
- onToggle,
22
- scrollToAttempt
23
- }) => {
24
- const t = (0, _i18n.useText)();
25
- const isActiveRef = (0, _react.useRef)(isActive);
26
- isActiveRef.current = isActive;
27
- const {
28
- contentAnimatedStyle,
29
- onLayout,
30
- progress
31
- } = (0, _useVoiceTranscriptionsDropdownItemAnimation.useVoiceTranscriptionsDropdownItemAnimation)(isActive);
32
- const handleScrollToAttempt = (0, _react.useCallback)(attemptNumber => {
33
- if (!isActiveRef.current) return;
34
- scrollToAttempt(attemptNumber);
35
- }, [scrollToAttempt]);
36
- (0, _reactNativeReanimated.useAnimatedReaction)(() => progress.value, progress => {
37
- if (progress === 1 && isActive) {
38
- (0, _reactNativeReanimated.runOnJS)(handleScrollToAttempt)(attempt);
39
- }
40
- }, [progress, attempt, isActive]);
41
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
42
- style: styles.container,
43
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
44
- disabled: isActive,
45
- style: styles.itemHeader,
46
- onPress: () => onToggle(attempt),
47
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
48
- onPress: () => !isActive && onToggle(attempt),
49
- size: _reactNativeUi.ButtonSize.SMALL,
50
- variant: _reactNativeUi.ButtonVariant.TERTIARY,
51
- style: {
52
- text: {
53
- textTransform: 'uppercase',
54
- color: isActive ? _reactNativeUi.COLORS.NEUTRAL_9 : _reactNativeUi.COLORS.NEUTRAL_7
55
- }
56
- },
57
- children: t('voice.attempt', {
58
- number: String(attempt)
59
- })
60
- })
61
- }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
62
- style: styles.loaderContainer,
63
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Loader, {
64
- size: _reactNativeUi.LoaderSize.SMALL,
65
- color: _reactNativeUi.LoaderColor.BLUE
66
- })
67
- }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
68
- style: contentAnimatedStyle,
69
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
70
- onLayout: onLayout,
71
- style: styles.contentWrapper,
72
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
73
- variant: "h8",
74
- style: [styles.itemContent, {
75
- color: isActive ? _reactNativeUi.COLORS.NEUTRAL_9 : _reactNativeUi.COLORS.NEUTRAL_7
76
- }],
77
- children: content
78
- })
79
- })
80
- })]
81
- });
82
- });
83
- const styles = _reactNative.StyleSheet.create({
84
- container: {
85
- borderTopWidth: 1,
86
- borderColor: _reactNativeUi.COLORS.NEUTRAL_3
87
- },
88
- itemHeader: {
89
- flexDirection: 'row',
90
- justifyContent: 'space-between',
91
- alignItems: 'center',
92
- width: '100%',
93
- paddingVertical: 8
94
- },
95
- itemContent: {
96
- paddingHorizontal: 8
97
- },
98
- contentWrapper: {
99
- width: '100%',
100
- position: 'absolute'
101
- },
102
- loaderContainer: {
103
- justifyContent: 'center',
104
- alignItems: 'center',
105
- paddingTop: 4,
106
- paddingBottom: 8
107
- }
108
- });
109
- //# sourceMappingURL=VoiceTranscriptionsDropdownItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeUi","_reactNativeReanimated","_useVoiceTranscriptionsDropdownItemAnimation","_i18n","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VoiceTranscriptionsDropdownItem","exports","memo","attempt","content","isActive","isLoading","onToggle","scrollToAttempt","useText","isActiveRef","useRef","current","contentAnimatedStyle","onLayout","progress","useVoiceTranscriptionsDropdownItemAnimation","handleScrollToAttempt","useCallback","attemptNumber","useAnimatedReaction","value","runOnJS","jsxs","View","style","styles","container","children","jsx","Pressable","disabled","itemHeader","onPress","Button","size","ButtonSize","SMALL","variant","ButtonVariant","TERTIARY","text","textTransform","color","COLORS","NEUTRAL_9","NEUTRAL_7","number","String","loaderContainer","Loader","LoaderSize","LoaderColor","BLUE","contentWrapper","Typography","itemContent","StyleSheet","create","borderTopWidth","borderColor","NEUTRAL_3","flexDirection","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","position","paddingTop","paddingBottom"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAUA,IAAAI,sBAAA,GAAAF,uBAAA,CAAAF,OAAA;AACA,IAAAK,4CAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAA+C,IAAAO,WAAA,GAAAP,OAAA;AAAA,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAE,CAAA,SAAAA,CAA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MAAM;IACbC,eAAe,EAAE;EACnB,CAAC;EACDV,WAAW,EAAE;IACXW,iBAAiB,EAAE;EACrB,CAAC;EACDb,cAAc,EAAE;IACdW,KAAK,EAAE,MAAM;IACbG,QAAQ,EAAE;EACZ,CAAC;EACDnB,eAAe,EAAE;IACfc,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBK,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_effectorReact","_reactNativeReanimated","_constants","useVoiceTranscriptionsDropdown","model","isExpanded","useUnit","$isExpanded","contentHeight","useSharedValue","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","listAnimatedStyle","useAnimatedStyle","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","opacity","iconAnimatedStyle","rotation","transform","rotate","useEffect","withTiming","duration","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAGO,MAAMI,8BAA8B,GAAIC,KAAuC,IAAK;EACzF,MAAMC,UAAU,GAAG,IAAAC,sBAAO,EAACF,KAAK,CAACG,WAAW,CAAC;EAE7C,MAAMC,aAAa,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EACvC,MAAMC,iBAAiB,GAAG,IAAAD,qCAAc,EAACJ,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAE5D,MAAMM,YAAY,GAAIC,KAAwB,IAAK;IACjD,MAAMC,cAAc,GAAGD,KAAK,CAACE,WAAW,CAACC,MAAM,CAACC,MAAM;IACtD,IAAIH,cAAc,GAAG,CAAC,EAAE;MACtBL,aAAa,CAACS,KAAK,GAAGJ,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@ -1,34 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useVoiceTranscriptionsDropdownItemAnimation = void 0;
7
- var _react = require("react");
8
- var _reactNativeReanimated = require("react-native-reanimated");
9
- const useVoiceTranscriptionsDropdownItemAnimation = isExpanded => {
10
- const height = (0, _reactNativeReanimated.useSharedValue)(0);
11
- const progress = (0, _reactNativeReanimated.useSharedValue)(isExpanded ? 1 : 0);
12
- (0, _react.useEffect)(() => {
13
- progress.value = (0, _reactNativeReanimated.withTiming)(isExpanded ? 1 : 0);
14
- }, [isExpanded, progress]);
15
- const derivedHeight = (0, _reactNativeReanimated.useDerivedValue)(() => height.value * progress.value, [height, progress]);
16
- const contentAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
17
- const opacity = (0, _reactNativeReanimated.interpolate)(progress.value, [0, 0.3, 1], [0, 0, 1]);
18
- return {
19
- height: derivedHeight.value,
20
- opacity,
21
- overflow: 'hidden'
22
- };
23
- }, [progress, derivedHeight]);
24
- const onLayout = event => {
25
- height.value = event.nativeEvent.layout.height;
26
- };
27
- return {
28
- contentAnimatedStyle,
29
- onLayout,
30
- progress
31
- };
32
- };
33
- exports.useVoiceTranscriptionsDropdownItemAnimation = useVoiceTranscriptionsDropdownItemAnimation;
34
- //# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","require","_reactNativeReanimated","useVoiceTranscriptionsDropdownItemAnimation","isExpanded","height","useSharedValue","progress","useEffect","value","withTiming","derivedHeight","useDerivedValue","contentAnimatedStyle","useAnimatedStyle","opacity","interpolate","overflow","onLayout","event","nativeEvent","layout","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,sBAAA,GAAAD,OAAA;AAQO,MAAME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;
7
- var _effector = require("effector");
8
- var _constants = require("../../constants.js");
9
- class TranscriptionsDownloaderModel {
10
- setTranscriptsLoaded = (0, _effector.createEvent)();
11
- reset = (0, _effector.createEvent)();
12
- $transcriptsLoaded = (0, _effector.restore)(this.setTranscriptsLoaded, false).reset(this.reset);
13
- constructor(collection, api) {
14
- this.collection = collection;
15
- this.api = api;
16
- }
17
- async fetchTranscriptWithRetry(audioFileId) {
18
- for (let attempt = 0; attempt < _constants.TRANSCRIPT_MAX_RETRIES; attempt++) {
19
- const response = await this.api.getAudioFileTranscript(audioFileId);
20
- if (response.status === 'completed') {
21
- return response.text;
22
- }
23
- if (response.status === 'failed') {
24
- return _constants.NO_AUDIO_BE_MESSAGE;
25
- }
26
- if (attempt < _constants.TRANSCRIPT_MAX_RETRIES - 1) {
27
- await new Promise(resolve => setTimeout(resolve, _constants.TRANSCRIPT_RETRY_INTERVAL_MS));
28
- }
29
- }
30
- return _constants.NO_AUDIO_BE_MESSAGE;
31
- }
32
- loadAllTranscripts = (0, _effector.createEffect)(async () => {
33
- const attempts = this.collection.getAll();
34
- const transcriptPromises = attempts.map(async item => {
35
- if (this.collection.hasTranscript(item.attemptNumber)) {
36
- return;
37
- }
38
- this.collection.update(item.attemptNumber, {
39
- transcriptLoading: true
40
- });
41
- try {
42
- const text = await this.fetchTranscriptWithRetry(item.audioFileId);
43
- this.collection.update(item.attemptNumber, {
44
- transcript: text,
45
- transcriptLoading: false,
46
- transcriptError: undefined
47
- });
48
- } catch (error) {
49
- this.collection.update(item.attemptNumber, {
50
- transcriptLoading: false,
51
- transcriptError: error instanceof Error ? error.message : 'Failed to load transcript'
52
- });
53
- }
54
- });
55
- await Promise.all(transcriptPromises);
56
- this.setTranscriptsLoaded(true);
57
- });
58
- getTranscript(attemptNumber) {
59
- return this.collection.get(attemptNumber)?.transcript;
60
- }
61
- isTranscriptLoading(attemptNumber) {
62
- return this.collection.get(attemptNumber)?.transcriptLoading || false;
63
- }
64
- }
65
- exports.TranscriptionsDownloaderModel = TranscriptionsDownloaderModel;
66
- //# sourceMappingURL=TranscriptionsDownloaderModel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_effector","require","_constants","TranscriptionsDownloaderModel","setTranscriptsLoaded","createEvent","reset","$transcriptsLoaded","restore","constructor","collection","api","fetchTranscriptWithRetry","audioFileId","attempt","TRANSCRIPT_MAX_RETRIES","response","getAudioFileTranscript","status","text","NO_AUDIO_BE_MESSAGE","Promise","resolve","setTimeout","TRANSCRIPT_RETRY_INTERVAL_MS","loadAllTranscripts","createEffect","attempts","getAll","transcriptPromises","map","item","hasTranscript","attemptNumber","update","transcriptLoading","transcript","transcriptError","undefined","error","Error","message","all","getTranscript","get","isTranscriptLoading","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAGA,IAAAC,UAAA,GAAAD,OAAA;AAMO,MAAME,6BAA6B,CAAC;EAIzBC,oBAAoB,GAAG,IAAAC,qBAAW,EAAU,CAAC;EAC7CC,KAAK,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAErBE,kBAAkB,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACJ,oBAAoB,EAAE,KAAK,CAAC,CAACE,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAEhGG,WAAWA,CAACC,UAAyC,EAAEC,GAAmB,EAAE;IAC1E,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,GAAG,GAAGA,GAAG;EAChB;EAEA,MAAcC,wBAAwBA,CAACC,WAAmB,EAAmB;IAC3E,KAAK,IAAIC,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAGC,iCAAsB,EAAED,OAAO,EAAE,EAAE;MACjE,MAAME,QAAQ,GAAG,MAAM,IAAI,CAACL,GAAG,CAACM,sBAAsB,CAACJ,WAAW,CAAC;MAEnE,IAAIG,QAAQ,CAACE,MAAM,KAAK,WAAW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,CAACqB,GAAG,CAACb,kBAAkB,CAAC;IACrC,IAAI,CAACzB,oBAAoB,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;EAEKuC,aAAaA,CAACV,aAAqB,EAAsB;IAC9D,OAAO,IAAI,CAACvB,UAAU,CAACkC,GAAG,CAACX,aAAa,CAAC,EAAEG,UAAU;EACvD;EAEOS,mBAAmBA,CAACZ,aAAqB,EAAW;IACzD,OAAO,IAAI,CAACvB,UAAU,CAACkC,GAAG,CAACX,aAAa,CAAC,EAAEE,iBAAiB,IAAI,KAAK;EACvE;AACF;AAACW,OAAA,CAAA3C,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["VoiceTranscriptionsCollection","collection","Map","add","attemptNumber","item","set","update","existingItem","get","delete","getAll","Array","from","values","clear","hasTranscript","transcript","hasAudio","audioUri","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"mappings":";;;;;;AAEO,MAAMA,6BAA6B,CAAC;EACzBC,UAAU,GAAwC,IAAIC,GAAG,CAAC,CAAC;EAEpEC,GAAGA,CAACC,aAAqB,EAAEC,IAA4B,EAAE;IAC9D,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,aAAa,EAAEC,IAAI,CAAC;EAC1C;EAEOE,MAAMA,CAACH,aAAqB,EAAEC,IAAqC,EAAE;IAC1E,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC,IAAK,CAAC,CAA4B;IACzF,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,aAAa,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EAClE;EAEOK,MAAMA,CAACN,aAAqB,EAAE;IACnC,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,aAAa,CAAC;EACvC;EAEOK,GAAGA,CAACL,aAAqB,EAAE;IAChC,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;EAC3C;EAEOO,MAAMA,CAAA,EAAG;IACd,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACZ,UAAU,CAACa,MAAM,CAAC,CAAC,CAAC;EAC7C;EAEOC,KAAKA,CAAA,EAAG;IACb,IAAI,CAACd,UAAU,CAACc,KAAK,CAAC,CAAC;EACzB;EAEOC,aAAaA,CAACZ,aAAqB,EAAE;IAC1C,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEY,UAAU;EAC3B;EAEOC,QAAQA,CAACd,aAAqB,EAAE;IACrC,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEc,QAAQ;EACzB;AACF;AAACC,OAAA,CAAApB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["_effector","require","VoiceTranscriptionsDropdownModel","toggleExpand","createEvent","setExpanded","reset","$isExpanded","restore","on","state","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,gCAAgC,CAAC;EAC5BC,YAAY,GAAG,IAAAC,qBAAW,EAAC,CAAC;EAC5BC,WAAW,GAAG,IAAAD,qBAAW,EAAU,CAAC;EACpCE,KAAK,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAErBG,WAAW,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,WAAW,EAAE,KAAK,CAAC,CAC3DI,EAAE,CAAC,IAAI,CAACN,YAAY,EAAGO,KAAK,IAAK,CAACA,KAAK,CAAC,CACxCJ,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB;AAACK,OAAA,CAAAT,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -1,244 +0,0 @@
1
- "use strict";
2
-
3
- import { Typography, ScrollableList, CaretDownIcon, COLORS, IS_WEB, ScrollableListScrollView } from '@magmamath/react-native-ui';
4
- import { useUnit } from 'effector-react';
5
- import React, { useRef, useEffect, useState, useCallback, useMemo } from 'react';
6
- import { TouchableOpacity, View, StyleSheet } from 'react-native';
7
- import Animated, { FadeIn, FadeOut } from 'react-native-reanimated';
8
- import { VoiceTranscriptionVariant } from "../../types.js";
9
- import { useVoiceTranscriptionsDropdown } from "../hooks/useVoiceTranscriptionsDropdown.js";
10
- import { PlayerState } from "../model/index.js";
11
- import { VoiceTranscriptionsDropdownItem } from "./VoiceTranscriptionsDropdownItem.js";
12
- import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from "../../constants.js";
13
- import { useText } from "../../../../i18n/i18n.js";
14
- import { PlayButton } from "../../../../shared/components/PlayButton.js";
15
- import { getActiveAttempt, getAudioStatus } from "../../helpers.js";
16
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
17
- const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
18
- export const VoiceTranscriptionsDropdown = ({
19
- style,
20
- model,
21
- answers,
22
- attemptOffset,
23
- onAttemptOffsetChange,
24
- attemptsCount,
25
- problemId,
26
- variant = VoiceTranscriptionVariant.SMALL
27
- }) => {
28
- const [attempts, setAttempts] = useState([]);
29
- const scrollRef = useRef(null);
30
- const scrollViewRef = useRef(null);
31
- const itemLayoutsRef = useRef(new Map());
32
- const answersRef = useRef(answers);
33
- answersRef.current = answers;
34
- const t = useText();
35
- const [currentAttempt, transcriptsLoaded, playerState, isDropdownExpanded] = useUnit([model.$currentAttempt, model.loader.$transcriptsLoaded, model.$playerState, model.dropdown.$isExpanded]);
36
- const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount);
37
- const answersKey = useMemo(() => answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(','), [answers]);
38
- const hasActiveTranscript = activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined;
39
- const playButtonState = {
40
- isActive: playerState !== PlayerState.IDLE,
41
- isLoading: playerState === PlayerState.LOADING,
42
- status: getAudioStatus(playerState)
43
- };
44
- const {
45
- listAnimatedStyle,
46
- iconAnimatedStyle,
47
- onListLayout
48
- } = useVoiceTranscriptionsDropdown(model.dropdown);
49
- const handleItemLayout = useCallback((id, event) => {
50
- itemLayoutsRef.current.set(id, event.nativeEvent.layout.y);
51
- }, []);
52
- const scrollToAttempt = useCallback(attemptNumber => {
53
- if (IS_WEB) {
54
- const item = attempts.find(item => item.attemptNumber === attemptNumber);
55
- if (item) {
56
- const y = itemLayoutsRef.current.get(item._id);
57
- if (y !== undefined) {
58
- scrollViewRef.current?.scrollTo({
59
- y,
60
- animated: true
61
- });
62
- }
63
- }
64
- return;
65
- }
66
- const index = attempts.findIndex(item => item.attemptNumber === attemptNumber);
67
- if (index !== -1) {
68
- scrollRef.current?.scrollToIndex({
69
- index,
70
- animated: true,
71
- viewPosition: 0
72
- });
73
- }
74
- }, [attempts]);
75
- const handleItemToggle = useCallback(attempt => {
76
- if (onAttemptOffsetChange && attemptsCount !== undefined) {
77
- onAttemptOffsetChange(attemptsCount - attempt);
78
- }
79
- }, [onAttemptOffsetChange, attemptsCount]);
80
- const handlePlayPress = useCallback(() => {
81
- if (activeAttempt) {
82
- model.togglePlayPause(activeAttempt);
83
- }
84
- }, [model, activeAttempt]);
85
- const handleScrollToIndexFailed = useCallback(info => {
86
- setTimeout(() => {
87
- scrollRef.current?.scrollToIndex({
88
- index: info.index,
89
- animated: true,
90
- viewPosition: 0
91
- });
92
- }, 100);
93
- }, []);
94
- useEffect(() => {
95
- model.reinitializePlayer();
96
- return () => model.cleanup();
97
- }, [model]);
98
- useEffect(() => {
99
- const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing;
100
- if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
101
- model.dropdown.setExpanded(true);
102
- } else {
103
- model.dropdown.setExpanded(false);
104
- }
105
- model.resetPlayer();
106
- }, [problemId]);
107
- useEffect(() => {
108
- if (answersRef.current.some(answer => answer.audioFileId)) {
109
- model.initializeWithAudios(answersRef.current);
110
- model.loader.loadAllTranscripts();
111
- }
112
- }, [model, answersKey]);
113
- useEffect(() => {
114
- model.stopAudio();
115
- }, [activeAttempt]);
116
- useEffect(() => {
117
- const allAttempts = model.getAllAttempts();
118
- setAttempts(allAttempts);
119
- }, [answersKey, transcriptsLoaded, currentAttempt, model]);
120
- useEffect(() => {
121
- if (isDropdownExpanded && activeAttempt !== null) {
122
- setTimeout(() => {
123
- scrollToAttempt(activeAttempt);
124
- }, 500);
125
- }
126
- }, [isDropdownExpanded, answersKey]);
127
- const renderItem = useCallback(({
128
- item
129
- }) => {
130
- const isLoading = model.loader.isTranscriptLoading(item.attemptNumber);
131
- const transcript = model.loader.getTranscript(item.attemptNumber);
132
- const isActive = activeAttempt === item.attemptNumber;
133
- return /*#__PURE__*/_jsx(VoiceTranscriptionsDropdownItem, {
134
- isLoading: isActive && isLoading,
135
- attempt: item.attemptNumber,
136
- content: transcript && transcript !== NO_AUDIO_BE_MESSAGE ? transcript : t('voice.transcriptNotAvailable'),
137
- isActive: isActive,
138
- onToggle: handleItemToggle,
139
- scrollToAttempt: scrollToAttempt
140
- });
141
- }, [model, activeAttempt, t, handleItemToggle, scrollToAttempt]);
142
- return /*#__PURE__*/_jsxs(Animated.View, {
143
- style: [styles.container, style],
144
- children: [/*#__PURE__*/_jsxs(View, {
145
- style: styles.header,
146
- children: [/*#__PURE__*/_jsx(Typography, {
147
- style: styles.title,
148
- variant: "h7",
149
- children: t('voice.transcriptions')
150
- }), hasActiveTranscript && /*#__PURE__*/_jsx(Animated.View, {
151
- entering: FadeIn.duration(120),
152
- exiting: FadeOut.duration(120),
153
- children: /*#__PURE__*/_jsx(PlayButton, {
154
- state: playButtonState,
155
- onPress: handlePlayPress,
156
- activityIndicatorColor: COLORS.NEUTRAL_1
157
- })
158
- })]
159
- }), /*#__PURE__*/_jsx(Animated.View, {
160
- style: [listAnimatedStyle, {
161
- overflow: 'hidden'
162
- }],
163
- children: /*#__PURE__*/_jsx(View, {
164
- onLayout: onListLayout,
165
- style: styles.listContainer,
166
- children: IS_WEB ? /*#__PURE__*/_jsx(ScrollableListScrollView, {
167
- bounces: false,
168
- ref: scrollViewRef,
169
- hideShadow: true,
170
- style: styles.list,
171
- contentContainerStyle: styles.listContent,
172
- children: attempts.map(item => /*#__PURE__*/_jsx(View, {
173
- onLayout: e => handleItemLayout(item._id, e),
174
- children: renderItem({
175
- item
176
- })
177
- }, item._id))
178
- }) : /*#__PURE__*/_jsx(ScrollableList, {
179
- bounces: false,
180
- ref: scrollRef,
181
- hideShadow: true,
182
- data: attempts,
183
- keyExtractor: item => item._id,
184
- onScrollToIndexFailed: handleScrollToIndexFailed,
185
- renderItem: renderItem,
186
- contentContainerStyle: styles.listContent
187
- })
188
- })
189
- }), /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
190
- style: [styles.expandButton, iconAnimatedStyle],
191
- onPress: () => model.dropdown.toggleExpand(),
192
- children: /*#__PURE__*/_jsx(CaretDownIcon, {
193
- size: 22
194
- })
195
- })]
196
- });
197
- };
198
- const styles = StyleSheet.create({
199
- container: {
200
- position: 'absolute',
201
- top: 56,
202
- left: 8,
203
- width: 222,
204
- maxHeight: 405,
205
- minHeight: 51,
206
- padding: 4,
207
- boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
208
- borderRadius: 12,
209
- backgroundColor: COLORS.NEUTRAL_1,
210
- overflow: 'hidden'
211
- },
212
- // hugeContainer: {
213
- // width: '98%',
214
- // height: '100%',
215
- // },
216
- header: {
217
- flexDirection: 'row',
218
- justifyContent: 'space-between',
219
- alignItems: 'center',
220
- padding: 4,
221
- marginBottom: 4,
222
- height: 32
223
- },
224
- title: {
225
- color: COLORS.NEUTRAL_9,
226
- marginLeft: 4
227
- },
228
- list: {
229
- flex: 1
230
- },
231
- expandButton: {
232
- justifyContent: 'center',
233
- alignItems: 'center'
234
- },
235
- listContainer: {
236
- position: 'absolute',
237
- maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
238
- width: '100%'
239
- },
240
- listContent: {
241
- paddingHorizontal: 4
242
- }
243
- });
244
- //# sourceMappingURL=VoiceTranscriptionsDropdown.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Typography","ScrollableList","CaretDownIcon","COLORS","IS_WEB","ScrollableListScrollView","useUnit","React","useRef","useEffect","useState","useCallback","useMemo","TouchableOpacity","View","StyleSheet","Animated","FadeIn","FadeOut","VoiceTranscriptionVariant","useVoiceTranscriptionsDropdown","PlayerState","VoiceTranscriptionsDropdownItem","DROPDOWN_MAX_CONTENT_HEIGHT","NO_AUDIO_BE_MESSAGE","useText","PlayButton","getActiveAttempt","getAudioStatus","jsx","_jsx","jsxs","_jsxs","AnimatedTouchableOpacity","createAnimatedComponent","VoiceTranscriptionsDropdown","style","model","answers","attemptOffset","onAttemptOffsetChange","attemptsCount","problemId","variant","SMALL","attempts","setAttempts","scrollRef","scrollViewRef","itemLayoutsRef","Map","answersRef","current","t","currentAttempt","transcriptsLoaded","playerState","isDropdownExpanded","$currentAttempt","loader","$transcriptsLoaded","$playerState","dropdown","$isExpanded","activeAttempt","answersKey","map","a","_id","audioFileId","join","hasActiveTranscript","undefined","playButtonState","isActive","IDLE","isLoading","LOADING","status","listAnimatedStyle","iconAnimatedStyle","onListLayout","handleItemLayout","id","event","set","nativeEvent","layout","y","scrollToAttempt","attemptNumber","item","find","get","scrollTo","animated","index","findIndex","scrollToIndex","viewPosition","handleItemToggle","attempt","handlePlayPress","togglePlayPause","handleScrollToIndexFailed","info","setTimeout","reinitializePlayer","cleanup","isLastAttemptsWithoutDrowing","length","drawing","setExpanded","resetPlayer","some","answer","initializeWithAudios","loadAllTranscripts","stopAudio","allAttempts","getAllAttempts","renderItem","isTranscriptLoading","transcript","getTranscript","content","onToggle","styles","container","children","header","title","entering","duration","exiting","state","onPress","activityIndicatorColor","NEUTRAL_1","overflow","onLayout","listContainer","bounces","ref","hideShadow","list","contentContainerStyle","listContent","e","data","keyExtractor","onScrollToIndexFailed","expandButton","toggleExpand","size","create","position","top","left","width","maxHeight","minHeight","padding","boxShadow","borderRadius","backgroundColor","flexDirection","justifyContent","alignItems","marginBottom","height","color","NEUTRAL_9","marginLeft","flex","paddingHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,cAAc,EACdC,aAAa,EACbC,MAAM,EACNC,MAAM,EACNC,wBAAwB,QACnB,4BAA4B;AACnC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAChF,SACEC,gBAAgB,EAMhBC,IAAI,EACJC,UAAU,QACL,cAAc;AACrB,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACnE,SAA8CC,yBAAyB,QAAQ,gBAAa;AAC5F,SAASC,8BAA8B,QAAQ,4CAAyC;AACxF,SAA2BC,WAAW,QAAQ,mBAAU;AACxD,SAASC,+BAA+B,QAAQ,sCAAmC;AACnF,SAASC,2BAA2B,EAAEC,mBAAmB,QAAQ,oBAAiB;AAClF,SAASC,OAAO,QAAQ,0BAAuB;AAC/C,SAASC,UAAU,QAAQ,6CAA0C;AACrE,SAASC,gBAAgB,EAAEC,cAAc,QAAQ,kBAAe;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEhE,MAAMC,wBAAwB,GAAGjB,QAAQ,CAACkB,uBAAuB,CAACrB,gBAAgB,CAAC;AAanF,OAAO,MAAMsB,2BAA2B,GAAGA,CAAC;EAC1CC,KAAK;EACLC,KAAK;EACLC,OAAO;E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AAE;MAAG,CAAE;IAAC,CACH,CAAC;EAAA,CACd,CAAC;AAEpB,CAAC;AAED,MAAM3B,MAAM,GAAGhH,UAAU,CAAC4I,MAAM,CAAC;EAC/B3B,SAAS,EAAE;IACT4B,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,EAAE;IACPC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,GAAG;IACVC,SAAS,EAAE,GAAG;IACdC,SAAS,EAAE,EAAE;IACbC,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE,wCAAwC;IACnDC,YAAY,EAAE,EAAE;IAChBC,eAAe,EAAElK,MAAM,CAACuI,SAAS;IACjCC,QAAQ,EAAE;EACZ,CAAC;EACD;EACA;EACA;EACA;EACAT,MAAM,EAAE;IACNoC,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBN,OAAO,EAAE,CAAC;IACVO,YAAY,EAAE,CAAC;IACfC,MAAM,EAAE;EACV,CAAC;EACDvC,KAAK,EAAE;IACLwC,KAAK,EAAExK,MAAM,CAACyK,SAAS;IACvBC,UAAU,EAAE;EACd,CAAC;EACD5B,IAAI,EAAE;IAAE6B,IAAI,EAAE;EAAE,CAAC;EACjBtB,YAAY,EAAE;IACZe,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACD3B,aAAa,EAAE;IACbe,QAAQ,EAAE,UAAU;IACpBI,SAAS,EAAEzI,2BAA2B;IACtCwI,KAAK,EAAE;EACT,CAAC;EACDZ,WAAW,EAAE;IACX4B,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- import { Pressable, StyleSheet, View } from 'react-native';
4
- import React, { memo, useCallback, useRef } from 'react';
5
- import { Button, ButtonSize, ButtonVariant, COLORS, Loader, LoaderColor, LoaderSize, Typography } from '@magmamath/react-native-ui';
6
- import Animated, { runOnJS, useAnimatedReaction } from 'react-native-reanimated';
7
- import { useVoiceTranscriptionsDropdownItemAnimation } from "../hooks/useVoiceTranscriptionsDropdownItemAnimation.js";
8
- import { useText } from "../../../../i18n/i18n.js";
9
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
10
- export const VoiceTranscriptionsDropdownItem = /*#__PURE__*/memo(({
11
- attempt,
12
- content,
13
- isActive,
14
- isLoading,
15
- onToggle,
16
- scrollToAttempt
17
- }) => {
18
- const t = useText();
19
- const isActiveRef = useRef(isActive);
20
- isActiveRef.current = isActive;
21
- const {
22
- contentAnimatedStyle,
23
- onLayout,
24
- progress
25
- } = useVoiceTranscriptionsDropdownItemAnimation(isActive);
26
- const handleScrollToAttempt = useCallback(attemptNumber => {
27
- if (!isActiveRef.current) return;
28
- scrollToAttempt(attemptNumber);
29
- }, [scrollToAttempt]);
30
- useAnimatedReaction(() => progress.value, progress => {
31
- if (progress === 1 && isActive) {
32
- runOnJS(handleScrollToAttempt)(attempt);
33
- }
34
- }, [progress, attempt, isActive]);
35
- return /*#__PURE__*/_jsxs(View, {
36
- style: styles.container,
37
- children: [/*#__PURE__*/_jsx(Pressable, {
38
- disabled: isActive,
39
- style: styles.itemHeader,
40
- onPress: () => onToggle(attempt),
41
- children: /*#__PURE__*/_jsx(Button, {
42
- onPress: () => !isActive && onToggle(attempt),
43
- size: ButtonSize.SMALL,
44
- variant: ButtonVariant.TERTIARY,
45
- style: {
46
- text: {
47
- textTransform: 'uppercase',
48
- color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
49
- }
50
- },
51
- children: t('voice.attempt', {
52
- number: String(attempt)
53
- })
54
- })
55
- }), isLoading ? /*#__PURE__*/_jsx(View, {
56
- style: styles.loaderContainer,
57
- children: /*#__PURE__*/_jsx(Loader, {
58
- size: LoaderSize.SMALL,
59
- color: LoaderColor.BLUE
60
- })
61
- }) : /*#__PURE__*/_jsx(Animated.View, {
62
- style: contentAnimatedStyle,
63
- children: /*#__PURE__*/_jsx(View, {
64
- onLayout: onLayout,
65
- style: styles.contentWrapper,
66
- children: /*#__PURE__*/_jsx(Typography, {
67
- variant: "h8",
68
- style: [styles.itemContent, {
69
- color: isActive ? COLORS.NEUTRAL_9 : COLORS.NEUTRAL_7
70
- }],
71
- children: content
72
- })
73
- })
74
- })]
75
- });
76
- });
77
- const styles = StyleSheet.create({
78
- container: {
79
- borderTopWidth: 1,
80
- borderColor: COLORS.NEUTRAL_3
81
- },
82
- itemHeader: {
83
- flexDirection: 'row',
84
- justifyContent: 'space-between',
85
- alignItems: 'center',
86
- width: '100%',
87
- paddingVertical: 8
88
- },
89
- itemContent: {
90
- paddingHorizontal: 8
91
- },
92
- contentWrapper: {
93
- width: '100%',
94
- position: 'absolute'
95
- },
96
- loaderContainer: {
97
- justifyContent: 'center',
98
- alignItems: 'center',
99
- paddingTop: 4,
100
- paddingBottom: 8
101
- }
102
- });
103
- //# sourceMappingURL=VoiceTranscriptionsDropdownItem.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Pressable","StyleSheet","View","React","memo","useCallback","useRef","Button","ButtonSize","ButtonVariant","COLORS","Loader","LoaderColor","LoaderSize","Typography","Animated","runOnJS","useAnimatedReaction","useVoiceTranscriptionsDropdownItemAnimation","useText","jsx","_jsx","jsxs","_jsxs","VoiceTranscriptionsDropdownItem","attempt","content","isActive","isLoading","onToggle","scrollToAttempt","t","isActiveRef","current","contentAnimatedStyle","onLayout","progress","handleScrollToAttempt","attemptNumber","value","style","styles","container","children","disabled","itemHeader","onPress","size","SMALL","variant","TERTIARY","text","textTransform","color","NEUTRAL_9","NEUTRAL_7","number","String","loaderContainer","BLUE","contentWrapper","itemContent","create","borderTopWidth","borderColor","NEUTRAL_3","flexDirection","justifyContent","alignItems","width","paddingVertical","paddingHorizontal","position","paddingTop","paddingBottom"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,UAAU,EAAE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,EAClB;YACER,KAAK,EAAE1B,QAAQ,GAAGjB,MAAM,CAAC4C,SAAS,GAAG5C,MAAM,CAAC6C;UAC9C,CAAC,CACD;UAAAZ,QAAA,EAEDjB;QAAO,CACE;MAAC,CACT;IAAC,CACM,CAChB;EAAA,CACG,CAAC;AAEX,CACF,CAAC;AAED,MAAMe,MAAM,GAAGxC,UAAU,CAAC6D,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACTqB,cAAc,EAAE,CAAC;IACjBC,WAAW,EAAEtD,MAAM,CAACuD;EACtB,CAAC;EACDpB,UAAU,EAAE;IACVqB,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBC,KAAK,EAAE,MAAM;IACbC,eAAe,EAAE;EACnB,CAAC;EACDT,WAAW,EAAE;IACXU,iBAAiB,EAAE;EACrB,CAAC;EACDX,cAAc,EAAE;IACdS,KAAK,EAAE,MAAM;IACbG,QAAQ,EAAE;EACZ,CAAC;EACDd,eAAe,EAAE;IACfS,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBK,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["useEffect","useUnit","useAnimatedStyle","useSharedValue","withTiming","interpolate","DROPDOWN_MAX_CONTENT_HEIGHT","useVoiceTranscriptionsDropdown","model","isExpanded","$isExpanded","contentHeight","animationProgress","onListLayout","event","measuredHeight","nativeEvent","layout","height","value","listAnimatedStyle","opacity","iconAnimatedStyle","rotation","transform","rotate","duration"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,UAAU,EAAEC,WAAW,QAAQ,yBAAyB;AAEn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