@magmamath/students-features 0.11.0-rc.8 → 1.0.0

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 (500) hide show
  1. package/dist/commonjs/features/chatbot/components/Chat/Chat.js +49 -139
  2. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +58 -43
  4. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -3
  6. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  7. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  8. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  9. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  10. package/dist/commonjs/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  11. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  13. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +36 -11
  14. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  15. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +8 -48
  16. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  17. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +20 -14
  18. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  19. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  20. package/dist/commonjs/features/chatbot/components/Chatbot.js +12 -22
  21. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  22. package/dist/commonjs/features/chatbot/constants.js +4 -4
  23. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  24. package/dist/commonjs/features/chatbot/helpers.js +1 -8
  25. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  27. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +10 -46
  28. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  29. package/dist/commonjs/features/chatbot/model/ChatbotApi.js +1 -1
  30. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
  31. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -9
  32. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  33. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  34. package/dist/commonjs/features/gifCelebrations/helpers.js +1 -0
  35. package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -1
  36. package/dist/commonjs/features/voice/constants.js +23 -0
  37. package/dist/commonjs/features/voice/constants.js.map +1 -0
  38. package/dist/commonjs/features/voice/helpers.js +208 -0
  39. package/dist/commonjs/features/voice/helpers.js.map +1 -0
  40. package/dist/commonjs/features/voice/index.js +105 -0
  41. package/dist/commonjs/features/voice/index.js.map +1 -0
  42. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +49 -0
  43. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -0
  44. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +215 -0
  45. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  46. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +108 -0
  47. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  48. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +50 -0
  49. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  50. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
  51. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  52. package/dist/commonjs/features/voice/playing/model/Player.model.js +98 -0
  53. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -0
  54. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
  55. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  56. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +39 -0
  57. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  58. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +223 -0
  59. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  60. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js +41 -0
  61. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  62. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +15 -0
  63. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  64. package/dist/commonjs/features/voice/playing/model/index.js +20 -0
  65. package/dist/commonjs/features/voice/playing/model/index.js.map +1 -0
  66. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +74 -0
  67. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -0
  68. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +63 -0
  69. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  70. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +35 -0
  71. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  72. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +27 -0
  73. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  74. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js +50 -0
  75. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  76. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +59 -0
  77. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  78. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +22 -0
  79. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  80. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +53 -0
  81. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  82. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +78 -0
  83. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  84. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +51 -0
  85. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  86. package/dist/commonjs/features/voice/recording/model/Recorder.model.js +55 -0
  87. package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -0
  88. package/dist/commonjs/features/voice/recording/model/Uploader.model.js +44 -0
  89. package/dist/commonjs/features/voice/recording/model/Uploader.model.js.map +1 -0
  90. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +248 -0
  91. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  92. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js +30 -0
  93. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  94. package/dist/commonjs/features/voice/types.js +6 -0
  95. package/dist/commonjs/features/voice/types.js.map +1 -0
  96. package/dist/commonjs/index.js +12 -0
  97. package/dist/commonjs/index.js.map +1 -1
  98. package/dist/commonjs/shared/components/PlayButton.js +70 -0
  99. package/dist/commonjs/shared/components/PlayButton.js.map +1 -0
  100. package/dist/commonjs/shared/translation/localization/ca.json +17 -0
  101. package/dist/commonjs/shared/translation/localization/de.json +17 -0
  102. package/dist/commonjs/shared/translation/localization/en.json +17 -0
  103. package/dist/commonjs/shared/translation/localization/gb.json +17 -0
  104. package/dist/commonjs/shared/translation/localization/sct.json +17 -0
  105. package/dist/commonjs/shared/translation/localization/sw.json +17 -0
  106. package/dist/module/features/chatbot/components/Chat/Chat.js +51 -141
  107. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
  108. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +59 -45
  109. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  110. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -3
  111. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  112. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  113. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  114. package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  115. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  116. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  117. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  118. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +38 -14
  119. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  120. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +9 -49
  121. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  122. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +21 -15
  123. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  124. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  125. package/dist/module/features/chatbot/components/Chatbot.js +11 -20
  126. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  127. package/dist/module/features/chatbot/constants.js +5 -5
  128. package/dist/module/features/chatbot/constants.js.map +1 -1
  129. package/dist/module/features/chatbot/helpers.js +1 -8
  130. package/dist/module/features/chatbot/helpers.js.map +1 -1
  131. package/dist/module/features/chatbot/index.js.map +1 -1
  132. package/dist/module/features/chatbot/model/ChatBotModel.js +10 -46
  133. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  134. package/dist/module/features/chatbot/model/ChatbotApi.js +1 -1
  135. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
  136. package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -9
  137. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  138. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  139. package/dist/module/features/gifCelebrations/helpers.js +1 -0
  140. package/dist/module/features/gifCelebrations/helpers.js.map +1 -1
  141. package/dist/module/features/voice/constants.js +19 -0
  142. package/dist/module/features/voice/constants.js.map +1 -0
  143. package/dist/module/features/voice/helpers.js +191 -0
  144. package/dist/module/features/voice/helpers.js.map +1 -0
  145. package/dist/module/features/voice/index.js +12 -0
  146. package/dist/module/features/voice/index.js.map +1 -0
  147. package/dist/module/features/voice/playing/components/VoiceIcon.js +41 -0
  148. package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -0
  149. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +208 -0
  150. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  151. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +102 -0
  152. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  153. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +45 -0
  154. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  155. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
  156. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  157. package/dist/module/features/voice/playing/model/Player.model.js +93 -0
  158. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -0
  159. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
  160. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  161. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +34 -0
  162. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  163. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +218 -0
  164. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  165. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js +36 -0
  166. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  167. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +10 -0
  168. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  169. package/dist/module/features/voice/playing/model/index.js +5 -0
  170. package/dist/module/features/voice/playing/model/index.js.map +1 -0
  171. package/dist/module/features/voice/recording/components/VoiceRecord.js +67 -0
  172. package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -0
  173. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +57 -0
  174. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  175. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +29 -0
  176. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  177. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +21 -0
  178. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  179. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js +44 -0
  180. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  181. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +54 -0
  182. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  183. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +17 -0
  184. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  185. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +47 -0
  186. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  187. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +71 -0
  188. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  189. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +45 -0
  190. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  191. package/dist/module/features/voice/recording/model/Recorder.model.js +50 -0
  192. package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -0
  193. package/dist/module/features/voice/recording/model/Uploader.model.js +39 -0
  194. package/dist/module/features/voice/recording/model/Uploader.model.js.map +1 -0
  195. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +244 -0
  196. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  197. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js +25 -0
  198. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  199. package/dist/module/features/voice/types.js +4 -0
  200. package/dist/module/features/voice/types.js.map +1 -0
  201. package/dist/module/index.js +1 -0
  202. package/dist/module/index.js.map +1 -1
  203. package/dist/module/shared/components/PlayButton.js +64 -0
  204. package/dist/module/shared/components/PlayButton.js.map +1 -0
  205. package/dist/module/shared/translation/localization/ca.json +17 -0
  206. package/dist/module/shared/translation/localization/de.json +17 -0
  207. package/dist/module/shared/translation/localization/en.json +17 -0
  208. package/dist/module/shared/translation/localization/gb.json +17 -0
  209. package/dist/module/shared/translation/localization/sct.json +17 -0
  210. package/dist/module/shared/translation/localization/sw.json +17 -0
  211. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +1 -2
  212. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  213. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  214. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  215. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  216. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  217. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  218. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  220. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
  221. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  223. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  224. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  225. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  226. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +1 -2
  227. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +5 -5
  229. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  230. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/features/chatbot/index.d.ts +2 -2
  232. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +1 -2
  234. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  236. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  237. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +17 -19
  238. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  239. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +13 -7
  240. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  241. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -1
  242. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  243. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/features/voice/constants.d.ts +16 -0
  245. package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -0
  246. package/dist/typescript/commonjs/features/voice/helpers.d.ts +46 -0
  247. package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -0
  248. package/dist/typescript/commonjs/features/voice/index.d.ts +10 -0
  249. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -0
  250. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  251. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  252. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  253. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  254. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  255. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  257. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  258. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  259. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  260. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +23 -0
  261. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -0
  262. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  263. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  264. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  265. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  266. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  267. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  268. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  269. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  270. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  271. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  272. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts +3 -0
  273. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts.map +1 -0
  274. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  275. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  276. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  277. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  278. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  279. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  280. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  281. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  282. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  283. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  284. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  285. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  286. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  287. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  288. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  289. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  290. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  291. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  292. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  293. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  294. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +19 -0
  295. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  296. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts +18 -0
  297. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  298. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  299. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  300. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  301. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  302. package/dist/typescript/commonjs/features/voice/types.d.ts +72 -0
  303. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -0
  304. package/dist/typescript/commonjs/index.d.ts +1 -0
  305. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  306. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts +18 -0
  307. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts.map +1 -0
  308. package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -0
  309. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  310. package/dist/typescript/commonjs/shared/translation/model.d.ts +34 -0
  311. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  312. package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
  313. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  314. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +1 -2
  315. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  316. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  317. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  318. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  319. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  320. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -0
  321. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  322. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  323. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +6 -1
  324. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  325. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  326. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  327. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  328. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  329. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +1 -2
  330. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  331. package/dist/typescript/module/features/chatbot/constants.d.ts +5 -5
  332. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  333. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  334. package/dist/typescript/module/features/chatbot/index.d.ts +2 -2
  335. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  336. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +1 -2
  337. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  338. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  339. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  340. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +17 -19
  341. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  342. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +13 -7
  343. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  344. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -1
  345. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  346. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  347. package/dist/typescript/module/features/voice/constants.d.ts +16 -0
  348. package/dist/typescript/module/features/voice/constants.d.ts.map +1 -0
  349. package/dist/typescript/module/features/voice/helpers.d.ts +46 -0
  350. package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -0
  351. package/dist/typescript/module/features/voice/index.d.ts +10 -0
  352. package/dist/typescript/module/features/voice/index.d.ts.map +1 -0
  353. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  354. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  355. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  356. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  357. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  358. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  359. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  360. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  361. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  362. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  363. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +23 -0
  364. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -0
  365. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  366. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  367. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  368. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  369. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  370. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  371. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  372. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  373. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  374. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  375. package/dist/typescript/module/features/voice/playing/model/index.d.ts +3 -0
  376. package/dist/typescript/module/features/voice/playing/model/index.d.ts.map +1 -0
  377. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  378. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  379. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  380. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  381. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  382. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  383. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  384. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  385. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  386. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  387. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  388. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  389. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  390. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  391. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  392. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  393. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  394. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  395. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  396. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  397. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +19 -0
  398. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  399. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts +18 -0
  400. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  401. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  402. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  403. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  404. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  405. package/dist/typescript/module/features/voice/types.d.ts +72 -0
  406. package/dist/typescript/module/features/voice/types.d.ts.map +1 -0
  407. package/dist/typescript/module/index.d.ts +1 -0
  408. package/dist/typescript/module/index.d.ts.map +1 -1
  409. package/dist/typescript/module/shared/components/PlayButton.d.ts +18 -0
  410. package/dist/typescript/module/shared/components/PlayButton.d.ts.map +1 -0
  411. package/dist/typescript/module/shared/translation/constants.d.ts +102 -0
  412. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  413. package/dist/typescript/module/shared/translation/model.d.ts +34 -0
  414. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  415. package/dist/typescript/module/types/common.types.d.ts +3 -0
  416. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  417. package/package.json +11 -4
  418. package/src/features/chatbot/components/Chat/Chat.tsx +69 -192
  419. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +66 -44
  420. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +1 -3
  421. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +2 -2
  422. package/src/features/chatbot/components/ChatInput/FreeText/SendMessageButton.tsx +1 -1
  423. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +0 -1
  424. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -0
  425. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +1 -1
  426. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +35 -11
  427. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +9 -51
  428. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +17 -11
  429. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
  430. package/src/features/chatbot/components/Chatbot.tsx +11 -21
  431. package/src/features/chatbot/constants.ts +4 -4
  432. package/src/features/chatbot/helpers.ts +0 -3
  433. package/src/features/chatbot/index.ts +2 -16
  434. package/src/features/chatbot/model/ChatBotModel.ts +8 -51
  435. package/src/features/chatbot/model/ChatbotApi.ts +1 -1
  436. package/src/features/chatbot/model/ChatsCacheModel.ts +0 -7
  437. package/src/features/chatbot/types/api.types.ts +17 -17
  438. package/src/features/chatbot/types/model.types.ts +15 -7
  439. package/src/features/chatbot/types/units.types.ts +0 -1
  440. package/src/features/gifCelebrations/helpers.ts +1 -0
  441. package/src/features/voice/constants.ts +15 -0
  442. package/src/features/voice/helpers.ts +251 -0
  443. package/src/features/voice/index.ts +11 -0
  444. package/src/features/voice/playing/components/VoiceIcon.tsx +38 -0
  445. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +251 -0
  446. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +127 -0
  447. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts +54 -0
  448. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
  449. package/src/features/voice/playing/model/Player.model.ts +104 -0
  450. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
  451. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +42 -0
  452. package/src/features/voice/playing/model/VoicePlayer.model.ts +255 -0
  453. package/src/features/voice/playing/model/VoiceTranscriptionsCollection.ts +40 -0
  454. package/src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts +11 -0
  455. package/src/features/voice/playing/model/index.ts +2 -0
  456. package/src/features/voice/recording/components/VoiceRecord.tsx +65 -0
  457. package/src/features/voice/recording/components/VoiceRecordButton.tsx +64 -0
  458. package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +25 -0
  459. package/src/features/voice/recording/components/VoiceRecordDivider.tsx +17 -0
  460. package/src/features/voice/recording/components/VoiceRecordTimer.tsx +49 -0
  461. package/src/features/voice/recording/hooks/useVoiceRecorder.ts +62 -0
  462. package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +19 -0
  463. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +54 -0
  464. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +82 -0
  465. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +50 -0
  466. package/src/features/voice/recording/model/Recorder.model.ts +63 -0
  467. package/src/features/voice/recording/model/Uploader.model.ts +48 -0
  468. package/src/features/voice/recording/model/VoiceRecord.model.ts +302 -0
  469. package/src/features/voice/recording/model/VoiceRecordCollection.ts +26 -0
  470. package/src/features/voice/types.ts +84 -0
  471. package/src/index.ts +1 -0
  472. package/src/shared/components/PlayButton.tsx +84 -0
  473. package/src/shared/translation/localization/ca.json +17 -0
  474. package/src/shared/translation/localization/de.json +17 -0
  475. package/src/shared/translation/localization/en.json +17 -0
  476. package/src/shared/translation/localization/gb.json +17 -0
  477. package/src/shared/translation/localization/sct.json +17 -0
  478. package/src/shared/translation/localization/sw.json +17 -0
  479. package/src/types/common.types.ts +1 -0
  480. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  481. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +0 -39
  482. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  483. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -43
  484. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  485. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  486. package/dist/module/features/chatbot/components/Chat/CloseButton.js +0 -33
  487. package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  488. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -40
  489. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  490. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  491. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  492. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  493. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  494. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  495. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  496. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  497. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  498. package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  499. package/src/features/chatbot/components/Chat/CloseButton.tsx +0 -31
  500. package/src/features/chatbot/components/ChatMessage/AnimatedMessage.tsx +0 -38
@@ -0,0 +1,215 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscriptionsDropdown = void 0;
7
+ var _reactNativeUi = require("@magmamath/react-native-ui");
8
+ var _effectorReact = require("effector-react");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactNative = require("react-native");
11
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
12
+ var _useVoiceTranscriptionsDropdown = require("../hooks/useVoiceTranscriptionsDropdown.js");
13
+ var _index = require("../model/index.js");
14
+ var _VoiceTranscriptionsDropdownItem = require("./VoiceTranscriptionsDropdownItem.js");
15
+ var _constants = require("../../constants.js");
16
+ var _index2 = require("../../../../shared/translation/index.js");
17
+ var _PlayButton = require("../../../../shared/components/PlayButton.js");
18
+ var _helpers = require("../../helpers.js");
19
+ var _jsxRuntime = require("react/jsx-runtime");
20
+ 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); }
21
+ 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; }
22
+ const AnimatedTouchableOpacity = _reactNativeReanimated.default.createAnimatedComponent(_reactNative.TouchableOpacity);
23
+ const VoiceTranscriptionsDropdown = ({
24
+ style,
25
+ model,
26
+ answers,
27
+ attemptOffset,
28
+ onAttemptOffsetChange,
29
+ attemptsCount,
30
+ problemId
31
+ }) => {
32
+ const [attempts, setAttempts] = (0, _react.useState)([]);
33
+ const scrollRef = (0, _react.useRef)(null);
34
+ const answersRef = (0, _react.useRef)(answers);
35
+ answersRef.current = answers;
36
+ const t = (0, _index2.useText)();
37
+ const [currentAttempt, transcriptsLoaded, playerState] = (0, _effectorReact.useUnit)([model.$currentAttempt, model.loader.$transcriptsLoaded, model.$playerState]);
38
+ const activeAttempt = (0, _helpers.getActiveAttempt)(attemptOffset, attemptsCount);
39
+ const answersKey = (0, _react.useMemo)(() => answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(','), [answers]);
40
+ const hasActiveTranscript = activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined;
41
+ const playButtonState = {
42
+ isActive: playerState !== _index.PlayerState.IDLE,
43
+ isLoading: playerState === _index.PlayerState.LOADING,
44
+ status: (0, _helpers.getAudioStatus)(playerState)
45
+ };
46
+ const {
47
+ listAnimatedStyle,
48
+ iconAnimatedStyle,
49
+ onListLayout
50
+ } = (0, _useVoiceTranscriptionsDropdown.useVoiceTranscriptionsDropdown)(model.dropdown);
51
+ const scrollToAttempt = (0, _react.useCallback)(attemptNumber => {
52
+ const index = attempts.findIndex(item => item.attemptNumber === attemptNumber);
53
+ if (index !== -1) {
54
+ scrollRef.current?.scrollToIndex({
55
+ index,
56
+ animated: true,
57
+ viewPosition: 0
58
+ });
59
+ }
60
+ }, [attempts]);
61
+ const handleItemToggle = (0, _react.useCallback)(attempt => {
62
+ if (onAttemptOffsetChange && attemptsCount !== undefined) {
63
+ onAttemptOffsetChange(attemptsCount - attempt);
64
+ }
65
+ }, [onAttemptOffsetChange, attemptsCount]);
66
+ const handlePlayPress = (0, _react.useCallback)(() => {
67
+ if (activeAttempt) {
68
+ model.togglePlayPause(activeAttempt);
69
+ }
70
+ }, [model, activeAttempt]);
71
+ const handleScrollToIndexFailed = (0, _react.useCallback)(info => {
72
+ setTimeout(() => {
73
+ scrollRef.current?.scrollToIndex({
74
+ index: info.index,
75
+ animated: true,
76
+ viewPosition: 0
77
+ });
78
+ }, 100);
79
+ }, []);
80
+ (0, _react.useEffect)(() => {
81
+ model.reinitializePlayer();
82
+ return () => model.cleanup();
83
+ }, [model]);
84
+ (0, _react.useEffect)(() => {
85
+ const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing;
86
+ if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
87
+ model.dropdown.setExpanded(true);
88
+ } else {
89
+ model.dropdown.setExpanded(false);
90
+ }
91
+ model.resetPlayer();
92
+ }, [problemId]);
93
+ (0, _react.useEffect)(() => {
94
+ if (answersRef.current.some(answer => answer.audioFileId)) {
95
+ model.initializeWithAudios(answersRef.current);
96
+ model.loader.loadAllTranscripts();
97
+ }
98
+ }, [model, answersKey]);
99
+ (0, _react.useEffect)(() => {
100
+ model.stopAudio();
101
+ }, [activeAttempt]);
102
+ (0, _react.useEffect)(() => {
103
+ const allAttempts = model.getAllAttempts();
104
+ const validAttempts = allAttempts.filter(item => typeof item.attemptNumber === 'number');
105
+ setAttempts(validAttempts);
106
+ }, [answersKey, transcriptsLoaded, currentAttempt, model]);
107
+ (0, _react.useEffect)(() => {
108
+ if (activeAttempt !== null) {
109
+ scrollToAttempt(activeAttempt);
110
+ }
111
+ }, [activeAttempt, hasActiveTranscript, scrollToAttempt, model]);
112
+ const renderItem = (0, _react.useCallback)(({
113
+ item
114
+ }) => {
115
+ const isLoading = model.loader.isTranscriptLoading(item.attemptNumber);
116
+ const transcript = model.loader.getTranscript(item.attemptNumber);
117
+ const isActive = activeAttempt === item.attemptNumber;
118
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceTranscriptionsDropdownItem.VoiceTranscriptionsDropdownItem, {
119
+ isLoading: isActive && isLoading,
120
+ attempt: item.attemptNumber,
121
+ content: transcript && transcript !== _constants.NO_AUDIO_BE_MESSAGE ? transcript : t('voice.transcriptNotAvailable'),
122
+ isActive: isActive,
123
+ onToggle: handleItemToggle,
124
+ scrollToAttempt: scrollToAttempt
125
+ });
126
+ }, [model, activeAttempt, t, handleItemToggle, scrollToAttempt]);
127
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
128
+ style: [styles.container, style],
129
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
130
+ style: styles.header,
131
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
132
+ style: styles.title,
133
+ variant: "h7",
134
+ children: t('voice.transcriptions')
135
+ }), hasActiveTranscript && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
136
+ entering: _reactNativeReanimated.FadeIn.duration(120),
137
+ exiting: _reactNativeReanimated.FadeOut.duration(120),
138
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_PlayButton.PlayButton, {
139
+ state: playButtonState,
140
+ onPress: handlePlayPress,
141
+ activityIndicatorColor: _reactNativeUi.COLORS.NEUTRAL_1
142
+ })
143
+ })]
144
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
145
+ style: [listAnimatedStyle, {
146
+ overflow: 'hidden'
147
+ }],
148
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
149
+ onLayout: onListLayout,
150
+ style: styles.listContainer,
151
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.ScrollableList, {
152
+ bounces: false,
153
+ ref: scrollRef,
154
+ hideShadow: true,
155
+ data: attempts,
156
+ keyExtractor: item => item._id,
157
+ onScrollToIndexFailed: handleScrollToIndexFailed,
158
+ renderItem: renderItem,
159
+ style: _reactNativeUi.IS_WEB && styles.list,
160
+ contentContainerStyle: styles.listContent
161
+ })
162
+ })
163
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(AnimatedTouchableOpacity, {
164
+ style: [styles.expandButton, iconAnimatedStyle],
165
+ onPress: () => model.dropdown.toggleExpand(),
166
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.CaretDownIcon, {
167
+ size: 22
168
+ })
169
+ })]
170
+ });
171
+ };
172
+ exports.VoiceTranscriptionsDropdown = VoiceTranscriptionsDropdown;
173
+ const styles = _reactNative.StyleSheet.create({
174
+ container: {
175
+ position: 'absolute',
176
+ top: 56,
177
+ left: 8,
178
+ width: 222,
179
+ maxHeight: 405,
180
+ minHeight: 51,
181
+ padding: 4,
182
+ boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
183
+ borderRadius: 12,
184
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_1,
185
+ overflow: 'hidden'
186
+ },
187
+ header: {
188
+ flexDirection: 'row',
189
+ justifyContent: 'space-between',
190
+ alignItems: 'center',
191
+ padding: 4,
192
+ marginBottom: 4,
193
+ height: 32
194
+ },
195
+ title: {
196
+ color: _reactNativeUi.COLORS.NEUTRAL_9,
197
+ marginLeft: 4
198
+ },
199
+ list: {
200
+ flex: 1
201
+ },
202
+ expandButton: {
203
+ justifyContent: 'center',
204
+ alignItems: 'center'
205
+ },
206
+ listContainer: {
207
+ position: 'absolute',
208
+ maxHeight: _constants.DROPDOWN_MAX_CONTENT_HEIGHT,
209
+ width: '100%'
210
+ },
211
+ listContent: {
212
+ paddingHorizontal: 4
213
+ }
214
+ });
215
+ //# sourceMappingURL=VoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNativeUi","require","_effectorReact","_react","_interopRequireWildcard","_reactNative","_reactNativeReanimated","_useVoiceTranscriptionsDropdown","_index","_VoiceTranscriptionsDropdownItem","_constants","_index2","_PlayButton","_helpers","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AnimatedTouchableOpacity","Animated","createAnimatedComponent","TouchableOpacity","VoiceTranscriptionsDropdown","style","model","answers","attemptOffset","onAttemptOffsetChange","attemptsCount","problemId","attempts","setAttempts","useState","scrollRef","useRef","answersRef","current","useText","currentAttempt","transcriptsLoaded","playerState","useUnit","$currentAttempt","loader","$transcriptsLoaded","$playerState","activeAttempt","getActiveAttempt","answersKey","useMemo","map","_id","audioFileId","join","hasActiveTranscript","undefined","playButtonState","isActive","PlayerState","IDLE","isLoading","LOADING","status","getAudioStatus","listAnimatedStyle","iconAnimatedStyle","onListLayout","useVoiceTranscriptionsDropdown","dropdown","scrollToAttempt","useCallback","attemptNumber","index","findIndex","item","scrollToIndex","animated","viewPosition","handleItemToggle","attempt","handlePlayPress","togglePlayPause","handleScrollToIndexFailed","info","setTimeout","useEffect","reinitializePlayer","cleanup","isLastAttemptsWithoutDrowing","length","drawing","setExpanded","resetPlayer","some","answer","initializeWithAudios","loadAllTranscripts","stopAudio","allAttempts","getAllAttempts","validAttempts","filter","renderItem","isTranscriptLoading","transcript","getTranscript","jsx","VoiceTranscriptionsDropdownItem","content","NO_AUDIO_BE_MESSAGE","onToggle","jsxs","View","styles","container","children","header","Typography","title","variant","entering","FadeIn","duration","exiting","FadeOut","PlayButton","state","onPress","activityIndicatorColor","COLORS","NEUTRAL_1","overflow","onLayout","listContainer","ScrollableList","bounces","ref","hideShadow","data","keyExtractor","onScrollToIndexFailed","IS_WEB","list","contentContainerStyle","listContent","expandButton","toggleExpand","CaretDownIcon","size","exports","StyleSheet","create","position","top","left","width","maxHeight","minHeight","padding","boxShadow","borderRadius","backgroundColor","flexDirection","justifyContent","alignItems","marginBottom","height","color","NEUTRAL_9","marginLeft","flex","DROPDOWN_MAX_CONTENT_HEIGHT","paddingHorizontal"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/components/VoiceTranscriptionsDropdown.tsx"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAOA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,uBAAA,CAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,sBAAA,GAAAF,uBAAA,CAAAH,OAAA;AAEA,IAAAM,+BAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;A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EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,UAAU,EAAE,QAAQ;IACpBN,OAAO,EAAE,CAAC;IACVO,YAAY,EAAE,CAAC;IACfC,MAAM,EAAE;EACV,CAAC;EACDhD,KAAK,EAAE;IACLiD,KAAK,EAAEtC,qBAAM,CAACuC,SAAS;IACvBC,UAAU,EAAE;EACd,CAAC;EACD3B,IAAI,EAAE;IAAE4B,IAAI,EAAE;EAAE,CAAC;EACjBzB,YAAY,EAAE;IACZkB,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd,CAAC;EACD/B,aAAa,EAAE;IACbmB,QAAQ,EAAE,UAAU;IACpBI,SAAS,EAAEe,sCAA2B;IACtChB,KAAK,EAAE;EACT,CAAC;EACDX,WAAW,EAAE;IACX4B,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,108 @@
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 _index = require("../../../../shared/translation/index.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, _index.useText)();
25
+ const {
26
+ contentAnimatedStyle,
27
+ onLayout,
28
+ progress
29
+ } = (0, _useVoiceTranscriptionsDropdownItemAnimation.useVoiceTranscriptionsDropdownItemAnimation)(isActive);
30
+ const handleScrollToAttempt = (0, _react.useCallback)(attemptNumber => {
31
+ setTimeout(() => {
32
+ scrollToAttempt(attemptNumber);
33
+ }, 300);
34
+ }, [scrollToAttempt]);
35
+ (0, _reactNativeReanimated.useAnimatedReaction)(() => progress.value, progress => {
36
+ if (progress === 1 && isActive) {
37
+ (0, _reactNativeReanimated.runOnJS)(handleScrollToAttempt)(attempt);
38
+ }
39
+ }, [progress, attempt, isActive]);
40
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
41
+ style: styles.container,
42
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
43
+ disabled: isActive,
44
+ style: styles.itemHeader,
45
+ onPress: () => onToggle(attempt),
46
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
47
+ onPress: () => !isActive && onToggle(attempt),
48
+ size: _reactNativeUi.ButtonSize.SMALL,
49
+ variant: _reactNativeUi.ButtonVariant.TERTIARY,
50
+ style: {
51
+ text: {
52
+ textTransform: 'uppercase',
53
+ color: isActive ? _reactNativeUi.COLORS.NEUTRAL_9 : _reactNativeUi.COLORS.NEUTRAL_7
54
+ }
55
+ },
56
+ children: t('voice.attempt', {
57
+ number: String(attempt)
58
+ })
59
+ })
60
+ }), isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
61
+ style: styles.loaderContainer,
62
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Loader, {
63
+ size: _reactNativeUi.LoaderSize.SMALL,
64
+ color: _reactNativeUi.LoaderColor.BLUE
65
+ })
66
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeReanimated.default.View, {
67
+ style: contentAnimatedStyle,
68
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
69
+ onLayout: onLayout,
70
+ style: styles.contentWrapper,
71
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Typography, {
72
+ variant: "h8",
73
+ style: [styles.itemContent, {
74
+ color: isActive ? _reactNativeUi.COLORS.NEUTRAL_9 : _reactNativeUi.COLORS.NEUTRAL_7
75
+ }],
76
+ children: content
77
+ })
78
+ })
79
+ })]
80
+ });
81
+ });
82
+ const styles = _reactNative.StyleSheet.create({
83
+ container: {
84
+ borderTopWidth: 1,
85
+ borderColor: _reactNativeUi.COLORS.NEUTRAL_3
86
+ },
87
+ itemHeader: {
88
+ flexDirection: 'row',
89
+ justifyContent: 'space-between',
90
+ alignItems: 'center',
91
+ width: '100%',
92
+ paddingVertical: 8
93
+ },
94
+ itemContent: {
95
+ paddingHorizontal: 8
96
+ },
97
+ contentWrapper: {
98
+ width: '100%',
99
+ position: 'absolute'
100
+ },
101
+ loaderContainer: {
102
+ justifyContent: 'center',
103
+ alignItems: 'center',
104
+ paddingTop: 4,
105
+ paddingBottom: 8
106
+ }
107
+ });
108
+ //# sourceMappingURL=VoiceTranscriptionsDropdownItem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireWildcard","_reactNativeUi","_reactNativeReanimated","_useVoiceTranscriptionsDropdownItemAnimation","_index","_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","contentAnimatedStyle","onLayout","progress","useVoiceTranscriptionsDropdownItemAnimation","handleScrollToAttempt","useCallback","attemptNumber","setTimeout","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,MAAA,GAAAN,OAAA;AAAwD,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,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,w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EAAE,CAAC;IACbC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useVoiceTranscriptionsDropdown = void 0;
7
+ var _react = require("react");
8
+ var _effectorReact = require("effector-react");
9
+ var _reactNativeReanimated = require("react-native-reanimated");
10
+ var _constants = require("../../constants.js");
11
+ const useVoiceTranscriptionsDropdown = model => {
12
+ const isExpanded = (0, _effectorReact.useUnit)(model.$isExpanded);
13
+ const contentHeight = (0, _reactNativeReanimated.useSharedValue)(0);
14
+ const animationProgress = (0, _reactNativeReanimated.useSharedValue)(isExpanded ? 1 : 0);
15
+ const onListLayout = event => {
16
+ const measuredHeight = event.nativeEvent.layout.height;
17
+ if (measuredHeight > 0) {
18
+ contentHeight.value = measuredHeight;
19
+ }
20
+ };
21
+ const listAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
22
+ const height = (0, _reactNativeReanimated.interpolate)(animationProgress.value, [0, 1], [0, contentHeight.value || _constants.DROPDOWN_MAX_CONTENT_HEIGHT]);
23
+ const opacity = (0, _reactNativeReanimated.interpolate)(animationProgress.value, [0, 0.3, 1], [0, 0, 1]);
24
+ return {
25
+ height,
26
+ opacity
27
+ };
28
+ }, [animationProgress, contentHeight]);
29
+ const iconAnimatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => {
30
+ const rotation = (0, _reactNativeReanimated.interpolate)(animationProgress.value, [0, 1], [0, 180]);
31
+ return {
32
+ transform: [{
33
+ rotate: `${rotation}deg`
34
+ }]
35
+ };
36
+ }, [animationProgress]);
37
+ (0, _react.useEffect)(() => {
38
+ animationProgress.value = (0, _reactNativeReanimated.withTiming)(isExpanded ? 1 : 0, {
39
+ duration: 300
40
+ });
41
+ }, [isExpanded, animationProgress]);
42
+ return {
43
+ isExpanded,
44
+ listAnimatedStyle,
45
+ iconAnimatedStyle,
46
+ onListLayout
47
+ };
48
+ };
49
+ exports.useVoiceTranscriptionsDropdown = useVoiceTranscriptionsDropdown;
50
+ //# sourceMappingURL=useVoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
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,cAAc;IACtC;EACF,CAAC;EAED,MAAMK,iBAAiB,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAC/C,MAAMH,MAAM,GAAG,IAAAI,kCAAW,EACxBV,iBAAiB,CAACO,KAAK,EACvB,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,CAAC,CAAC,EAAET,aAAa,CAACS,KAAK,IAAII,sCAA2B,CACxD,CAAC;IAED,MAAMC,OAAO,GAAG,IAAAF,kCAAW,EAACV,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE5E,OAAO;MACLD,MAAM;MACNM;IACF,CAAC;EACH,CAAC,EAAE,CAACZ,iBAAiB,EAAEF,aAAa,CAAC,CAAC;EAEtC,MAAMe,iBAAiB,GAAG,IAAAJ,uCAAgB,EAAC,MAAM;IAC/C,MAAMK,QAAQ,GAAG,IAAAJ,kCAAW,EAACV,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEvE,OAAO;MACLQ,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAE,GAAGF,QAAQ;MAAM,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACd,iBAAiB,CAAC,CAAC;EAEvB,IAAAiB,gBAAS,EAAC,MAAM;IACdjB,iBAAiB,CAACO,KAAK,GAAG,IAAAW,iCAAU,EAACvB,UAAU,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEwB,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACxB,UAAU,EAAEK,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLL,UAAU;IACVa,iBAAiB;IACjBK,iBAAiB;IACjBZ;EACF,CAAC;AACH,CAAC;AAAAmB,OAAA,CAAA3B,8BAAA,GAAAA,8BAAA","ignoreList":[]}
@@ -0,0 +1,34 @@
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
@@ -0,0 +1 @@
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,2CAA2C,GAAIC,UAAmB,IAAK;EAClF,MAAMC,MAAM,GAAG,IAAAC,qCAAc,EAAC,CAAC,CAAC;EAChC,MAAMC,QAAQ,GAAG,IAAAD,qCAAc,EAACF,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAEnD,IAAAI,gBAAS,EAAC,MAAM;IACdD,QAAQ,CAACE,KAAK,GAAG,IAAAC,iCAAU,EAACN,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EACjD,CAAC,EAAE,CAACA,UAAU,EAAEG,QAAQ,CAAC,CAAC;EAE1B,MAAMI,aAAa,GAAG,IAAAC,sCAAe,EAAC,MAAMP,MAAM,CAACI,KAAK,GAAGF,QAAQ,CAACE,KAAK,EAAE,CAACJ,MAAM,EAAEE,QAAQ,CAAC,CAAC;EAE9F,MAAMM,oBAAoB,GAAG,IAAAC,uCAAgB,EAAC,MAAM;IAClD,MAAMC,OAAO,GAAG,IAAAC,kCAAW,EAACT,QAAQ,CAACE,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,OAAO;MACLJ,MAAM,EAAEM,aAAa,CAACF,KAAK;MAC3BM,OAAO;MACPE,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,EAAE,CAACV,QAAQ,EAAEI,aAAa,CAAC,CAAC;EAE7B,MAAMO,QAAQ,GAAIC,KAAwB,IAAK;IAC7Cd,MAAM,CAACI,KAAK,GAAGU,KAAK,CAACC,WAAW,CAACC,MAAM,CAAChB,MAAM;EAChD,CAAC;EAED,OAAO;IACLQ,oBAAoB;IACpBK,QAAQ;IACRX;EACF,CAAC;AACH,CAAC;AAAAe,OAAA,CAAAnB,2CAAA,GAAAA,2CAAA","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PlayerState = exports.PlayerModel = void 0;
7
+ var _effector = require("effector");
8
+ var _expoAudio = require("expo-audio");
9
+ let PlayerState = exports.PlayerState = /*#__PURE__*/function (PlayerState) {
10
+ PlayerState["PLAYING"] = "playing";
11
+ PlayerState["PAUSED"] = "paused";
12
+ PlayerState["LOADING"] = "loading";
13
+ PlayerState["IDLE"] = "idle";
14
+ return PlayerState;
15
+ }({});
16
+ class PlayerModel {
17
+ player = (0, _expoAudio.createAudioPlayer)();
18
+ stopped = false;
19
+ reset = (0, _effector.createEvent)();
20
+ setPlayerState = (0, _effector.createEvent)();
21
+ playbackFinished = (0, _effector.createEvent)();
22
+ $playerState = (0, _effector.restore)(this.setPlayerState, PlayerState.IDLE).reset(this.reset);
23
+ setupAudioMode = (0, _effector.createEffect)(async () => {
24
+ await (0, _expoAudio.setAudioModeAsync)({
25
+ playsInSilentMode: true,
26
+ shouldPlayInBackground: false,
27
+ interruptionMode: 'doNotMix'
28
+ });
29
+ });
30
+ pause = (0, _effector.createEffect)(() => {
31
+ if (this.player) {
32
+ this.player.pause();
33
+ this.setPlayerState(PlayerState.PAUSED);
34
+ } else {
35
+ console.warn('Cannot pause: audio player not initialized');
36
+ }
37
+ });
38
+ stop = (0, _effector.createEffect)(() => {
39
+ this.stopped = true;
40
+ if (this.player) {
41
+ this.player.replace('');
42
+ this.setPlayerState(PlayerState.IDLE);
43
+ } else {
44
+ console.warn('Cannot stop: audio player not initialized');
45
+ }
46
+ });
47
+ resume = (0, _effector.createEffect)(() => {
48
+ if (this.player) {
49
+ this.player.play();
50
+ this.setPlayerState(PlayerState.PLAYING);
51
+ } else {
52
+ console.warn('Cannot resume: audio player not initialized');
53
+ }
54
+ });
55
+ play = (0, _effector.createEffect)(async uri => {
56
+ if (!this.player) {
57
+ console.warn('Audio player not initialized');
58
+ return;
59
+ }
60
+ this.stopped = false;
61
+ this.player.replace(uri);
62
+ const waitForLoad = () => {
63
+ if (this.stopped) return;
64
+ if (this.player && this.player.isLoaded) {
65
+ const unsubscribe = this.player.addListener('playbackStatusUpdate', status => {
66
+ if (status.didJustFinish) {
67
+ this.playbackFinished();
68
+ unsubscribe?.remove?.();
69
+ this.setPlayerState(PlayerState.IDLE);
70
+ }
71
+ });
72
+ this.player.play();
73
+ this.setPlayerState(PlayerState.PLAYING);
74
+ } else {
75
+ setTimeout(waitForLoad, 10);
76
+ }
77
+ };
78
+ waitForLoad();
79
+ });
80
+ reinitialize() {
81
+ if (!this.player) {
82
+ this.player = (0, _expoAudio.createAudioPlayer)();
83
+ }
84
+ }
85
+ release() {
86
+ if (this.player) {
87
+ try {
88
+ this.stop();
89
+ this.player.remove();
90
+ } catch (error) {}
91
+ this.player.release();
92
+ this.player = null;
93
+ }
94
+ this.reset();
95
+ }
96
+ }
97
+ exports.PlayerModel = PlayerModel;
98
+ //# sourceMappingURL=Player.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_expoAudio","PlayerState","exports","PlayerModel","player","createAudioPlayer","stopped","reset","createEvent","setPlayerState","playbackFinished","$playerState","restore","IDLE","setupAudioMode","createEffect","setAudioModeAsync","playsInSilentMode","shouldPlayInBackground","interruptionMode","pause","PAUSED","console","warn","stop","replace","resume","play","PLAYING","uri","waitForLoad","isLoaded","unsubscribe","addListener","status","didJustFinish","remove","setTimeout","reinitialize","release","error"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/Player.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAA8E,IAE5DE,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAOtB,MAAME,WAAW,CAAC;EAChBC,MAAM,GAAuB,IAAAC,4BAAiB,EAAC,CAAC;EAC/CC,OAAO,GAAG,KAAK;EAEPC,KAAK,GAAG,IAAAC,qBAAW,EAAC,CAAC;EACrBC,cAAc,GAAG,IAAAD,qBAAW,EAAc,CAAC;EAC3CE,gBAAgB,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAEhCG,YAAY,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,cAAc,EAAER,WAAW,CAAC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,IAAI;IACpB;IACA,IAAI,CAACG,KAAK,CAAC,CAAC;EACd;AACF;AAACL,OAAA,CAAAC,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TranscriptionsDownloaderModel = void 0;
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
@@ -0,0 +1 @@
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,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