@magmamath/students-features 0.11.0-rc.9 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (517) hide show
  1. package/dist/commonjs/features/chatbot/components/Chat/Chat.js +59 -221
  2. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +58 -45
  4. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +1 -1
  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/MessageButtonsBlock.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +34 -14
  13. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  14. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +8 -48
  15. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  16. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -14
  17. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  18. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  19. package/dist/commonjs/features/chatbot/components/Chatbot.js +12 -22
  20. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  21. package/dist/commonjs/features/chatbot/constants.js +4 -4
  22. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  23. package/dist/commonjs/features/chatbot/helpers.js +1 -8
  24. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  25. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +10 -46
  27. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  28. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +1 -2
  29. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  30. package/dist/commonjs/features/chatbot/model/ChatbotApi.js +1 -1
  31. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
  32. package/dist/commonjs/features/chatbot/model/ChatbotTranslation.js +1 -1
  33. package/dist/commonjs/features/chatbot/model/ChatbotTranslation.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -9
  35. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  36. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  37. package/dist/commonjs/features/gifCelebrations/helpers.js +1 -0
  38. package/dist/commonjs/features/gifCelebrations/helpers.js.map +1 -1
  39. package/dist/commonjs/features/voice/constants.js +23 -0
  40. package/dist/commonjs/features/voice/constants.js.map +1 -0
  41. package/dist/commonjs/features/voice/helpers.js +208 -0
  42. package/dist/commonjs/features/voice/helpers.js.map +1 -0
  43. package/dist/commonjs/features/voice/index.js +105 -0
  44. package/dist/commonjs/features/voice/index.js.map +1 -0
  45. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js +49 -0
  46. package/dist/commonjs/features/voice/playing/components/VoiceIcon.js.map +1 -0
  47. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js +219 -0
  48. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  49. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +109 -0
  50. package/dist/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  51. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +50 -0
  52. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  53. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +34 -0
  54. package/dist/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  55. package/dist/commonjs/features/voice/playing/model/Player.model.js +98 -0
  56. package/dist/commonjs/features/voice/playing/model/Player.model.js.map +1 -0
  57. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js +66 -0
  58. package/dist/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  59. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js +39 -0
  60. package/dist/commonjs/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  61. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js +223 -0
  62. package/dist/commonjs/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  63. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js +41 -0
  64. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  65. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +15 -0
  66. package/dist/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  67. package/dist/commonjs/features/voice/playing/model/index.js +20 -0
  68. package/dist/commonjs/features/voice/playing/model/index.js.map +1 -0
  69. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js +74 -0
  70. package/dist/commonjs/features/voice/recording/components/VoiceRecord.js.map +1 -0
  71. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js +63 -0
  72. package/dist/commonjs/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  73. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js +35 -0
  74. package/dist/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  75. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js +27 -0
  76. package/dist/commonjs/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  77. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js +50 -0
  78. package/dist/commonjs/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  79. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js +59 -0
  80. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  81. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js +22 -0
  82. package/dist/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  83. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js +53 -0
  84. package/dist/commonjs/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  85. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js +78 -0
  86. package/dist/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  87. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js +51 -0
  88. package/dist/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  89. package/dist/commonjs/features/voice/recording/model/Recorder.model.js +55 -0
  90. package/dist/commonjs/features/voice/recording/model/Recorder.model.js.map +1 -0
  91. package/dist/commonjs/features/voice/recording/model/Uploader.model.js +44 -0
  92. package/dist/commonjs/features/voice/recording/model/Uploader.model.js.map +1 -0
  93. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js +248 -0
  94. package/dist/commonjs/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  95. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js +30 -0
  96. package/dist/commonjs/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  97. package/dist/commonjs/features/voice/types.js +6 -0
  98. package/dist/commonjs/features/voice/types.js.map +1 -0
  99. package/dist/commonjs/index.js +12 -0
  100. package/dist/commonjs/index.js.map +1 -1
  101. package/dist/commonjs/shared/components/PlayButton.js +70 -0
  102. package/dist/commonjs/shared/components/PlayButton.js.map +1 -0
  103. package/dist/commonjs/shared/translation/localization/ca.json +18 -2
  104. package/dist/commonjs/shared/translation/localization/de.json +18 -2
  105. package/dist/commonjs/shared/translation/localization/en.json +18 -2
  106. package/dist/commonjs/shared/translation/localization/gb.json +18 -2
  107. package/dist/commonjs/shared/translation/localization/sct.json +18 -2
  108. package/dist/commonjs/shared/translation/localization/sw.json +18 -2
  109. package/dist/module/features/chatbot/components/Chat/Chat.js +61 -223
  110. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
  111. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +59 -47
  112. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  113. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +1 -1
  114. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  115. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  116. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  117. package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  118. package/dist/module/features/chatbot/components/ChatInput/RequestHintButton.js.map +1 -1
  119. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +1 -1
  120. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +36 -17
  121. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  122. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +9 -49
  123. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  124. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +12 -13
  125. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  126. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  127. package/dist/module/features/chatbot/components/Chatbot.js +11 -20
  128. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  129. package/dist/module/features/chatbot/constants.js +5 -5
  130. package/dist/module/features/chatbot/constants.js.map +1 -1
  131. package/dist/module/features/chatbot/helpers.js +1 -8
  132. package/dist/module/features/chatbot/helpers.js.map +1 -1
  133. package/dist/module/features/chatbot/index.js.map +1 -1
  134. package/dist/module/features/chatbot/model/ChatBotModel.js +10 -46
  135. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  136. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +1 -2
  137. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +1 -1
  138. package/dist/module/features/chatbot/model/ChatbotApi.js +1 -1
  139. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
  140. package/dist/module/features/chatbot/model/ChatbotTranslation.js +1 -1
  141. package/dist/module/features/chatbot/model/ChatbotTranslation.js.map +1 -1
  142. package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -9
  143. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  144. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  145. package/dist/module/features/gifCelebrations/helpers.js +1 -0
  146. package/dist/module/features/gifCelebrations/helpers.js.map +1 -1
  147. package/dist/module/features/voice/constants.js +19 -0
  148. package/dist/module/features/voice/constants.js.map +1 -0
  149. package/dist/module/features/voice/helpers.js +191 -0
  150. package/dist/module/features/voice/helpers.js.map +1 -0
  151. package/dist/module/features/voice/index.js +12 -0
  152. package/dist/module/features/voice/index.js.map +1 -0
  153. package/dist/module/features/voice/playing/components/VoiceIcon.js +41 -0
  154. package/dist/module/features/voice/playing/components/VoiceIcon.js.map +1 -0
  155. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js +212 -0
  156. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdown.js.map +1 -0
  157. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js +103 -0
  158. package/dist/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.js.map +1 -0
  159. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js +45 -0
  160. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.js.map +1 -0
  161. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js +29 -0
  162. package/dist/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.js.map +1 -0
  163. package/dist/module/features/voice/playing/model/Player.model.js +93 -0
  164. package/dist/module/features/voice/playing/model/Player.model.js.map +1 -0
  165. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js +61 -0
  166. package/dist/module/features/voice/playing/model/TranscriptionsDownloaderModel.js.map +1 -0
  167. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js +34 -0
  168. package/dist/module/features/voice/playing/model/VoiceFileDownloader.model.js.map +1 -0
  169. package/dist/module/features/voice/playing/model/VoicePlayer.model.js +218 -0
  170. package/dist/module/features/voice/playing/model/VoicePlayer.model.js.map +1 -0
  171. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js +36 -0
  172. package/dist/module/features/voice/playing/model/VoiceTranscriptionsCollection.js.map +1 -0
  173. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js +10 -0
  174. package/dist/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.js.map +1 -0
  175. package/dist/module/features/voice/playing/model/index.js +5 -0
  176. package/dist/module/features/voice/playing/model/index.js.map +1 -0
  177. package/dist/module/features/voice/recording/components/VoiceRecord.js +67 -0
  178. package/dist/module/features/voice/recording/components/VoiceRecord.js.map +1 -0
  179. package/dist/module/features/voice/recording/components/VoiceRecordButton.js +57 -0
  180. package/dist/module/features/voice/recording/components/VoiceRecordButton.js.map +1 -0
  181. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js +29 -0
  182. package/dist/module/features/voice/recording/components/VoiceRecordDeleteButton.js.map +1 -0
  183. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js +21 -0
  184. package/dist/module/features/voice/recording/components/VoiceRecordDivider.js.map +1 -0
  185. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js +44 -0
  186. package/dist/module/features/voice/recording/components/VoiceRecordTimer.js.map +1 -0
  187. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js +54 -0
  188. package/dist/module/features/voice/recording/hooks/useVoiceRecorder.js.map +1 -0
  189. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js +17 -0
  190. package/dist/module/features/voice/recording/hooks/useVoiceRecorderAnimation.js.map +1 -0
  191. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js +47 -0
  192. package/dist/module/features/voice/recording/modal/ModalFooterButtons.js.map +1 -0
  193. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js +71 -0
  194. package/dist/module/features/voice/recording/modal/VoiceRecordDeleteModal.js.map +1 -0
  195. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js +45 -0
  196. package/dist/module/features/voice/recording/modal/VoiceRecordUndoModal.js.map +1 -0
  197. package/dist/module/features/voice/recording/model/Recorder.model.js +50 -0
  198. package/dist/module/features/voice/recording/model/Recorder.model.js.map +1 -0
  199. package/dist/module/features/voice/recording/model/Uploader.model.js +39 -0
  200. package/dist/module/features/voice/recording/model/Uploader.model.js.map +1 -0
  201. package/dist/module/features/voice/recording/model/VoiceRecord.model.js +244 -0
  202. package/dist/module/features/voice/recording/model/VoiceRecord.model.js.map +1 -0
  203. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js +25 -0
  204. package/dist/module/features/voice/recording/model/VoiceRecordCollection.js.map +1 -0
  205. package/dist/module/features/voice/types.js +4 -0
  206. package/dist/module/features/voice/types.js.map +1 -0
  207. package/dist/module/index.js +1 -0
  208. package/dist/module/index.js.map +1 -1
  209. package/dist/module/shared/components/PlayButton.js +64 -0
  210. package/dist/module/shared/components/PlayButton.js.map +1 -0
  211. package/dist/module/shared/translation/localization/ca.json +18 -2
  212. package/dist/module/shared/translation/localization/de.json +18 -2
  213. package/dist/module/shared/translation/localization/en.json +18 -2
  214. package/dist/module/shared/translation/localization/gb.json +18 -2
  215. package/dist/module/shared/translation/localization/sct.json +18 -2
  216. package/dist/module/shared/translation/localization/sw.json +18 -2
  217. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +1 -2
  218. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  219. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  220. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  221. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  222. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  223. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -1
  224. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  225. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  226. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -2
  227. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  228. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  229. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  230. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +1 -2
  232. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  233. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +5 -5
  234. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  236. package/dist/typescript/commonjs/features/chatbot/index.d.ts +2 -2
  237. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +1 -2
  239. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  240. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  241. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  242. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  243. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +17 -19
  244. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  245. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +13 -8
  246. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  247. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -1
  248. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  249. package/dist/typescript/commonjs/features/gifCelebrations/helpers.d.ts.map +1 -1
  250. package/dist/typescript/commonjs/features/voice/constants.d.ts +16 -0
  251. package/dist/typescript/commonjs/features/voice/constants.d.ts.map +1 -0
  252. package/dist/typescript/commonjs/features/voice/helpers.d.ts +46 -0
  253. package/dist/typescript/commonjs/features/voice/helpers.d.ts.map +1 -0
  254. package/dist/typescript/commonjs/features/voice/index.d.ts +10 -0
  255. package/dist/typescript/commonjs/features/voice/index.d.ts.map +1 -0
  256. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  257. package/dist/typescript/commonjs/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  258. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  259. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  260. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  261. package/dist/typescript/commonjs/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  262. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  263. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  264. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  265. package/dist/typescript/commonjs/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  266. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts +23 -0
  267. package/dist/typescript/commonjs/features/voice/playing/model/Player.model.d.ts.map +1 -0
  268. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  269. package/dist/typescript/commonjs/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  270. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  271. package/dist/typescript/commonjs/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  272. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  273. package/dist/typescript/commonjs/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  274. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  275. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  276. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  277. package/dist/typescript/commonjs/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  278. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts +3 -0
  279. package/dist/typescript/commonjs/features/voice/playing/model/index.d.ts.map +1 -0
  280. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  281. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  282. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  283. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  284. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  285. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  286. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  287. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  288. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  289. package/dist/typescript/commonjs/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  290. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  291. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  292. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  293. package/dist/typescript/commonjs/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  294. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  295. package/dist/typescript/commonjs/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  296. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  297. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  298. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  299. package/dist/typescript/commonjs/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  300. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts +19 -0
  301. package/dist/typescript/commonjs/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  302. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts +18 -0
  303. package/dist/typescript/commonjs/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  304. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  305. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  306. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  307. package/dist/typescript/commonjs/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  308. package/dist/typescript/commonjs/features/voice/types.d.ts +72 -0
  309. package/dist/typescript/commonjs/features/voice/types.d.ts.map +1 -0
  310. package/dist/typescript/commonjs/index.d.ts +1 -0
  311. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  312. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts +18 -0
  313. package/dist/typescript/commonjs/shared/components/PlayButton.d.ts.map +1 -0
  314. package/dist/typescript/commonjs/shared/translation/constants.d.ts +102 -6
  315. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  316. package/dist/typescript/commonjs/shared/translation/model.d.ts +34 -2
  317. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  318. package/dist/typescript/commonjs/types/common.types.d.ts +3 -0
  319. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  320. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +1 -2
  321. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  322. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -3
  323. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  324. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  325. package/dist/typescript/module/features/chatbot/components/ChatInput/RequestHintButton.d.ts.map +1 -1
  326. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +1 -1
  327. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  328. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +1 -1
  329. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +3 -2
  330. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  331. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +2 -2
  332. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  333. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  334. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +1 -2
  335. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  336. package/dist/typescript/module/features/chatbot/constants.d.ts +5 -5
  337. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  338. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  339. package/dist/typescript/module/features/chatbot/index.d.ts +2 -2
  340. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  341. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +1 -2
  342. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  343. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +1 -1
  344. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -1
  345. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  346. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +17 -19
  347. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  348. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +13 -8
  349. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  350. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -1
  351. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  352. package/dist/typescript/module/features/gifCelebrations/helpers.d.ts.map +1 -1
  353. package/dist/typescript/module/features/voice/constants.d.ts +16 -0
  354. package/dist/typescript/module/features/voice/constants.d.ts.map +1 -0
  355. package/dist/typescript/module/features/voice/helpers.d.ts +46 -0
  356. package/dist/typescript/module/features/voice/helpers.d.ts.map +1 -0
  357. package/dist/typescript/module/features/voice/index.d.ts +10 -0
  358. package/dist/typescript/module/features/voice/index.d.ts.map +1 -0
  359. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts +8 -0
  360. package/dist/typescript/module/features/voice/playing/components/VoiceIcon.d.ts.map +1 -0
  361. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts +16 -0
  362. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdown.d.ts.map +1 -0
  363. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts +12 -0
  364. package/dist/typescript/module/features/voice/playing/components/VoiceTranscriptionsDropdownItem.d.ts.map +1 -0
  365. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts +16 -0
  366. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.d.ts.map +1 -0
  367. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts +11 -0
  368. package/dist/typescript/module/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.d.ts.map +1 -0
  369. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts +23 -0
  370. package/dist/typescript/module/features/voice/playing/model/Player.model.d.ts.map +1 -0
  371. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts +15 -0
  372. package/dist/typescript/module/features/voice/playing/model/TranscriptionsDownloaderModel.d.ts.map +1 -0
  373. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts +17 -0
  374. package/dist/typescript/module/features/voice/playing/model/VoiceFileDownloader.model.d.ts.map +1 -0
  375. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts +41 -0
  376. package/dist/typescript/module/features/voice/playing/model/VoicePlayer.model.d.ts.map +1 -0
  377. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts +13 -0
  378. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsCollection.d.ts.map +1 -0
  379. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts +7 -0
  380. package/dist/typescript/module/features/voice/playing/model/VoiceTranscriptionsDropdown.model.d.ts.map +1 -0
  381. package/dist/typescript/module/features/voice/playing/model/index.d.ts +3 -0
  382. package/dist/typescript/module/features/voice/playing/model/index.d.ts.map +1 -0
  383. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts +10 -0
  384. package/dist/typescript/module/features/voice/recording/components/VoiceRecord.d.ts.map +1 -0
  385. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts +10 -0
  386. package/dist/typescript/module/features/voice/recording/components/VoiceRecordButton.d.ts.map +1 -0
  387. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts +8 -0
  388. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDeleteButton.d.ts.map +1 -0
  389. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts +3 -0
  390. package/dist/typescript/module/features/voice/recording/components/VoiceRecordDivider.d.ts.map +1 -0
  391. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts +11 -0
  392. package/dist/typescript/module/features/voice/recording/components/VoiceRecordTimer.d.ts.map +1 -0
  393. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts +5 -0
  394. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorder.d.ts.map +1 -0
  395. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts +6 -0
  396. package/dist/typescript/module/features/voice/recording/hooks/useVoiceRecorderAnimation.d.ts.map +1 -0
  397. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts +12 -0
  398. package/dist/typescript/module/features/voice/recording/modal/ModalFooterButtons.d.ts.map +1 -0
  399. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts +11 -0
  400. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordDeleteModal.d.ts.map +1 -0
  401. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts +11 -0
  402. package/dist/typescript/module/features/voice/recording/modal/VoiceRecordUndoModal.d.ts.map +1 -0
  403. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts +19 -0
  404. package/dist/typescript/module/features/voice/recording/model/Recorder.model.d.ts.map +1 -0
  405. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts +18 -0
  406. package/dist/typescript/module/features/voice/recording/model/Uploader.model.d.ts.map +1 -0
  407. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts +50 -0
  408. package/dist/typescript/module/features/voice/recording/model/VoiceRecord.model.d.ts.map +1 -0
  409. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts +10 -0
  410. package/dist/typescript/module/features/voice/recording/model/VoiceRecordCollection.d.ts.map +1 -0
  411. package/dist/typescript/module/features/voice/types.d.ts +72 -0
  412. package/dist/typescript/module/features/voice/types.d.ts.map +1 -0
  413. package/dist/typescript/module/index.d.ts +1 -0
  414. package/dist/typescript/module/index.d.ts.map +1 -1
  415. package/dist/typescript/module/shared/components/PlayButton.d.ts +18 -0
  416. package/dist/typescript/module/shared/components/PlayButton.d.ts.map +1 -0
  417. package/dist/typescript/module/shared/translation/constants.d.ts +102 -6
  418. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  419. package/dist/typescript/module/shared/translation/model.d.ts +34 -2
  420. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  421. package/dist/typescript/module/types/common.types.d.ts +3 -0
  422. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  423. package/package.json +11 -6
  424. package/src/features/chatbot/components/Chat/Chat.tsx +70 -288
  425. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +66 -46
  426. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +1 -2
  427. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +2 -2
  428. package/src/features/chatbot/components/ChatInput/FreeText/SendMessageButton.tsx +1 -1
  429. package/src/features/chatbot/components/ChatInput/RequestHintButton.tsx +0 -1
  430. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +1 -1
  431. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +1 -1
  432. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +33 -17
  433. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +9 -51
  434. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +12 -13
  435. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
  436. package/src/features/chatbot/components/Chatbot.tsx +11 -21
  437. package/src/features/chatbot/constants.ts +4 -4
  438. package/src/features/chatbot/helpers.ts +0 -3
  439. package/src/features/chatbot/index.ts +2 -16
  440. package/src/features/chatbot/model/ChatBotModel.ts +8 -51
  441. package/src/features/chatbot/model/ChatBoxTextManager.ts +0 -1
  442. package/src/features/chatbot/model/ChatbotApi.ts +1 -1
  443. package/src/features/chatbot/model/ChatbotTranslation.ts +1 -1
  444. package/src/features/chatbot/model/ChatsCacheModel.ts +0 -7
  445. package/src/features/chatbot/types/api.types.ts +17 -17
  446. package/src/features/chatbot/types/model.types.ts +15 -8
  447. package/src/features/chatbot/types/units.types.ts +0 -1
  448. package/src/features/gifCelebrations/helpers.ts +1 -0
  449. package/src/features/voice/constants.ts +15 -0
  450. package/src/features/voice/helpers.ts +251 -0
  451. package/src/features/voice/index.ts +11 -0
  452. package/src/features/voice/playing/components/VoiceIcon.tsx +38 -0
  453. package/src/features/voice/playing/components/VoiceTranscriptionsDropdown.tsx +256 -0
  454. package/src/features/voice/playing/components/VoiceTranscriptionsDropdownItem.tsx +128 -0
  455. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdown.ts +54 -0
  456. package/src/features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts +40 -0
  457. package/src/features/voice/playing/model/Player.model.ts +104 -0
  458. package/src/features/voice/playing/model/TranscriptionsDownloaderModel.ts +80 -0
  459. package/src/features/voice/playing/model/VoiceFileDownloader.model.ts +42 -0
  460. package/src/features/voice/playing/model/VoicePlayer.model.ts +255 -0
  461. package/src/features/voice/playing/model/VoiceTranscriptionsCollection.ts +40 -0
  462. package/src/features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts +11 -0
  463. package/src/features/voice/playing/model/index.ts +2 -0
  464. package/src/features/voice/recording/components/VoiceRecord.tsx +65 -0
  465. package/src/features/voice/recording/components/VoiceRecordButton.tsx +64 -0
  466. package/src/features/voice/recording/components/VoiceRecordDeleteButton.tsx +25 -0
  467. package/src/features/voice/recording/components/VoiceRecordDivider.tsx +17 -0
  468. package/src/features/voice/recording/components/VoiceRecordTimer.tsx +49 -0
  469. package/src/features/voice/recording/hooks/useVoiceRecorder.ts +62 -0
  470. package/src/features/voice/recording/hooks/useVoiceRecorderAnimation.ts +19 -0
  471. package/src/features/voice/recording/modal/ModalFooterButtons.tsx +54 -0
  472. package/src/features/voice/recording/modal/VoiceRecordDeleteModal.tsx +82 -0
  473. package/src/features/voice/recording/modal/VoiceRecordUndoModal.tsx +50 -0
  474. package/src/features/voice/recording/model/Recorder.model.ts +63 -0
  475. package/src/features/voice/recording/model/Uploader.model.ts +48 -0
  476. package/src/features/voice/recording/model/VoiceRecord.model.ts +302 -0
  477. package/src/features/voice/recording/model/VoiceRecordCollection.ts +26 -0
  478. package/src/features/voice/types.ts +84 -0
  479. package/src/index.ts +1 -0
  480. package/src/shared/components/PlayButton.tsx +84 -0
  481. package/src/shared/translation/localization/ca.json +18 -2
  482. package/src/shared/translation/localization/de.json +18 -2
  483. package/src/shared/translation/localization/en.json +18 -2
  484. package/src/shared/translation/localization/gb.json +18 -2
  485. package/src/shared/translation/localization/sct.json +18 -2
  486. package/src/shared/translation/localization/sw.json +18 -2
  487. package/src/types/common.types.ts +1 -0
  488. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  489. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +0 -39
  490. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  491. package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js +0 -44
  492. package/dist/commonjs/features/chatbot/components/Chat/GradientFade.js.map +0 -1
  493. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -41
  494. package/dist/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  495. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  496. package/dist/module/features/chatbot/components/Chat/CloseButton.js +0 -33
  497. package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +0 -1
  498. package/dist/module/features/chatbot/components/Chat/GradientFade.js +0 -39
  499. package/dist/module/features/chatbot/components/Chat/GradientFade.js.map +0 -1
  500. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js +0 -34
  501. package/dist/module/features/chatbot/components/ChatMessage/AnimatedMessage.js.map +0 -1
  502. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  503. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  504. package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts +0 -10
  505. package/dist/typescript/commonjs/features/chatbot/components/Chat/GradientFade.d.ts.map +0 -1
  506. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  507. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  508. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +0 -7
  509. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +0 -1
  510. package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts +0 -10
  511. package/dist/typescript/module/features/chatbot/components/Chat/GradientFade.d.ts.map +0 -1
  512. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts +0 -7
  513. package/dist/typescript/module/features/chatbot/components/ChatMessage/AnimatedMessage.d.ts.map +0 -1
  514. package/src/features/chatbot/TTS_HIGHLIGHTING.md +0 -120
  515. package/src/features/chatbot/components/Chat/CloseButton.tsx +0 -31
  516. package/src/features/chatbot/components/Chat/GradientFade.tsx +0 -43
  517. package/src/features/chatbot/components/ChatMessage/AnimatedMessage.tsx +0 -30
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+
3
+ import { Typography, ScrollableList, CaretDownIcon, COLORS, IS_WEB } 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 { useVoiceTranscriptionsDropdown } from "../hooks/useVoiceTranscriptionsDropdown.js";
9
+ import { PlayerState } from "../model/index.js";
10
+ import { VoiceTranscriptionsDropdownItem } from "./VoiceTranscriptionsDropdownItem.js";
11
+ import { DROPDOWN_MAX_CONTENT_HEIGHT, NO_AUDIO_BE_MESSAGE } from "../../constants.js";
12
+ import { useText } from "../../../../shared/translation/index.js";
13
+ import { PlayButton } from "../../../../shared/components/PlayButton.js";
14
+ import { getActiveAttempt, getAudioStatus } from "../../helpers.js";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ const AnimatedTouchableOpacity = Animated.createAnimatedComponent(TouchableOpacity);
17
+ export const VoiceTranscriptionsDropdown = ({
18
+ style,
19
+ model,
20
+ answers,
21
+ attemptOffset,
22
+ onAttemptOffsetChange,
23
+ attemptsCount,
24
+ problemId
25
+ }) => {
26
+ const [attempts, setAttempts] = useState([]);
27
+ const scrollRef = useRef(null);
28
+ const answersRef = useRef(answers);
29
+ answersRef.current = answers;
30
+ const t = useText();
31
+ const [currentAttempt, transcriptsLoaded, playerState, isDropdownExpanded] = useUnit([model.$currentAttempt, model.loader.$transcriptsLoaded, model.$playerState, model.dropdown.$isExpanded]);
32
+ const activeAttempt = getActiveAttempt(attemptOffset, attemptsCount);
33
+ const answersKey = useMemo(() => answers.map(a => `${a._id}:${a.audioFileId ?? ''}`).join(','), [answers]);
34
+ const hasActiveTranscript = activeAttempt !== null && answers?.[activeAttempt - 1]?.audioFileId !== undefined;
35
+ const playButtonState = {
36
+ isActive: playerState !== PlayerState.IDLE,
37
+ isLoading: playerState === PlayerState.LOADING,
38
+ status: getAudioStatus(playerState)
39
+ };
40
+ const {
41
+ listAnimatedStyle,
42
+ iconAnimatedStyle,
43
+ onListLayout
44
+ } = useVoiceTranscriptionsDropdown(model.dropdown);
45
+ const scrollToAttempt = useCallback(attemptNumber => {
46
+ const index = attempts.findIndex(item => item.attemptNumber === attemptNumber);
47
+ if (index !== -1) {
48
+ scrollRef.current?.scrollToIndex({
49
+ index,
50
+ animated: true,
51
+ viewPosition: 0
52
+ });
53
+ }
54
+ }, [attempts]);
55
+ const handleItemToggle = useCallback(attempt => {
56
+ if (onAttemptOffsetChange && attemptsCount !== undefined) {
57
+ onAttemptOffsetChange(attemptsCount - attempt);
58
+ }
59
+ }, [onAttemptOffsetChange, attemptsCount]);
60
+ const handlePlayPress = useCallback(() => {
61
+ if (activeAttempt) {
62
+ model.togglePlayPause(activeAttempt);
63
+ }
64
+ }, [model, activeAttempt]);
65
+ const handleScrollToIndexFailed = useCallback(info => {
66
+ setTimeout(() => {
67
+ scrollRef.current?.scrollToIndex({
68
+ index: info.index,
69
+ animated: true,
70
+ viewPosition: 0
71
+ });
72
+ }, 100);
73
+ }, []);
74
+ useEffect(() => {
75
+ model.reinitializePlayer();
76
+ return () => model.cleanup();
77
+ }, [model]);
78
+ useEffect(() => {
79
+ const isLastAttemptsWithoutDrowing = !answers[answers.length - 1].drawing;
80
+ if (answers.length > 0 && isLastAttemptsWithoutDrowing) {
81
+ model.dropdown.setExpanded(true);
82
+ } else {
83
+ model.dropdown.setExpanded(false);
84
+ }
85
+ model.resetPlayer();
86
+ }, [problemId]);
87
+ useEffect(() => {
88
+ if (answersRef.current.some(answer => answer.audioFileId)) {
89
+ model.initializeWithAudios(answersRef.current);
90
+ model.loader.loadAllTranscripts();
91
+ }
92
+ }, [model, answersKey]);
93
+ useEffect(() => {
94
+ model.stopAudio();
95
+ }, [activeAttempt]);
96
+ useEffect(() => {
97
+ const allAttempts = model.getAllAttempts();
98
+ setAttempts(allAttempts);
99
+ }, [answersKey, transcriptsLoaded, currentAttempt, model]);
100
+ useEffect(() => {
101
+ if (isDropdownExpanded && activeAttempt !== null) {
102
+ setTimeout(() => {
103
+ scrollToAttempt(activeAttempt);
104
+ }, 500);
105
+ }
106
+ }, [isDropdownExpanded, answersKey]);
107
+ const renderItem = useCallback(({
108
+ item
109
+ }) => {
110
+ const isLoading = model.loader.isTranscriptLoading(item.attemptNumber);
111
+ const transcript = model.loader.getTranscript(item.attemptNumber);
112
+ const isActive = activeAttempt === item.attemptNumber;
113
+ return /*#__PURE__*/_jsx(VoiceTranscriptionsDropdownItem, {
114
+ isLoading: isActive && isLoading,
115
+ attempt: item.attemptNumber,
116
+ content: transcript && transcript !== NO_AUDIO_BE_MESSAGE ? transcript : t('voice.transcriptNotAvailable'),
117
+ isActive: isActive,
118
+ onToggle: handleItemToggle,
119
+ scrollToAttempt: scrollToAttempt
120
+ });
121
+ }, [model, activeAttempt, t, handleItemToggle, scrollToAttempt]);
122
+ return /*#__PURE__*/_jsxs(Animated.View, {
123
+ style: [styles.container, style],
124
+ children: [/*#__PURE__*/_jsxs(View, {
125
+ style: styles.header,
126
+ children: [/*#__PURE__*/_jsx(Typography, {
127
+ style: styles.title,
128
+ variant: "h7",
129
+ children: t('voice.transcriptions')
130
+ }), hasActiveTranscript && /*#__PURE__*/_jsx(Animated.View, {
131
+ entering: FadeIn.duration(120),
132
+ exiting: FadeOut.duration(120),
133
+ children: /*#__PURE__*/_jsx(PlayButton, {
134
+ state: playButtonState,
135
+ onPress: handlePlayPress,
136
+ activityIndicatorColor: COLORS.NEUTRAL_1
137
+ })
138
+ })]
139
+ }), /*#__PURE__*/_jsx(Animated.View, {
140
+ style: [listAnimatedStyle, {
141
+ overflow: 'hidden'
142
+ }],
143
+ children: /*#__PURE__*/_jsx(View, {
144
+ onLayout: onListLayout,
145
+ style: styles.listContainer,
146
+ children: /*#__PURE__*/_jsx(ScrollableList, {
147
+ bounces: false,
148
+ ref: scrollRef,
149
+ hideShadow: true,
150
+ data: attempts,
151
+ keyExtractor: item => item._id,
152
+ onScrollToIndexFailed: handleScrollToIndexFailed,
153
+ renderItem: renderItem,
154
+ style: IS_WEB && styles.list,
155
+ contentContainerStyle: styles.listContent
156
+ //for some resons on web FlatList doesn't render last items in huge list, so we need to render them all at once
157
+ ,
158
+ initialNumToRender: IS_WEB ? 20 : undefined
159
+ })
160
+ })
161
+ }), /*#__PURE__*/_jsx(AnimatedTouchableOpacity, {
162
+ style: [styles.expandButton, iconAnimatedStyle],
163
+ onPress: () => model.dropdown.toggleExpand(),
164
+ children: /*#__PURE__*/_jsx(CaretDownIcon, {
165
+ size: 22
166
+ })
167
+ })]
168
+ });
169
+ };
170
+ const styles = StyleSheet.create({
171
+ container: {
172
+ position: 'absolute',
173
+ top: 56,
174
+ left: 8,
175
+ width: 222,
176
+ maxHeight: 405,
177
+ minHeight: 51,
178
+ padding: 4,
179
+ boxShadow: '0px 1px 3px 0px rgba(51, 51, 51, 0.25)',
180
+ borderRadius: 12,
181
+ backgroundColor: COLORS.NEUTRAL_1,
182
+ overflow: 'hidden'
183
+ },
184
+ header: {
185
+ flexDirection: 'row',
186
+ justifyContent: 'space-between',
187
+ alignItems: 'center',
188
+ padding: 4,
189
+ marginBottom: 4,
190
+ height: 32
191
+ },
192
+ title: {
193
+ color: COLORS.NEUTRAL_9,
194
+ marginLeft: 4
195
+ },
196
+ list: {
197
+ flex: 1
198
+ },
199
+ expandButton: {
200
+ justifyContent: 'center',
201
+ alignItems: 'center'
202
+ },
203
+ listContainer: {
204
+ position: 'absolute',
205
+ maxHeight: DROPDOWN_MAX_CONTENT_HEIGHT,
206
+ width: '100%'
207
+ },
208
+ listContent: {
209
+ paddingHorizontal: 4
210
+ }
211
+ });
212
+ //# sourceMappingURL=VoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Typography","ScrollableList","CaretDownIcon","COLORS","IS_WEB","useUnit","React","useRef","useEffect","useState","useCallback","useMemo","TouchableOpacity","View","StyleSheet","Animated","FadeIn","FadeOut","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","attempts","setAttempts","scrollRef","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","scrollToAttempt","attemptNumber","index","findIndex","item","scrollToIndex","animated","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","variant","entering","duration","exiting","state","onPress","activityIndicatorColor","NEUTRAL_1","overflow","onLayout","listContainer","bounces","ref","hideShadow","data","keyExtractor","onScrollToIndexFailed","list","contentContainerStyle","listContent","initialNumToRender","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,QACD,4BAA4B;AACnC,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,KAAK,IAAIC,MAAM,EAAEC,SAAS,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAChF,SAASC,gBAAgB,EAAkCC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AACjG,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AAEnE,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,yCAAgC;AACxD,SAASC,UAAU,QAAQ,6CAA0C;AACrE,SAASC,gBAAgB,EA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AC;EACDT,WAAW,EAAE;IACXyB,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,103 @@
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 "../../../../shared/translation/index.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
@@ -0,0 +1 @@
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,EAAEC,IAAI,QAAQ,cAAc;AAC1D,OAAOC,KAAK,IAAIC,IAAI,EAAEC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AACxD,SACEC,MAAM,EACNC,UAAU,EACVC,aAAa,EACbC,MAAM,EACNC,MAAM,EACNC,WAAW,EACXC,UAAU,EACVC,UAAU,QACL,4BAA4B;AACnC,OAAOC,QAAQ,IAAIC,OAAO,EAAEC,mBAAmB,QAAQ,yBAAyB;AAChF,SAASC,2CAA2C,QAAQ,yDAAsD;AAClH,SAASC,OAAO,QAAQ,yCAAgC;AAAA,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAWxD,OAAO,MAAMC,+BAA+B,gBAAGpB,IAAI,CACjD,CAAC;EACCqB,OAAO;EACPC,OAAO;EACPC,QAAQ;EACRC,SAAS;EACTC,QAAQ;EACRC;AACoC,CAAC,KAAK;EAC1C,MAAMC,CAAC,GAAGZ,OAAO,CAAC,CAAC;EACnB,MAAMa,WAAW,GAAG1B,MAAM,CAACqB,QAAQ,CAAC;EACpCK,WAAW,CAACC,OAAO,GAAGN,QAAQ;EAE9B,MAAM;IAAEO,oBAAoB;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAChDlB,2CAA2C,CAACS,QAAQ,CAAC;EAEvD,MAAMU,qBAAqB,GAAGhC,WAAW,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
4
+ import { useUnit } from 'effector-react';
5
+ import { useAnimatedStyle, useSharedValue, withTiming, interpolate } from 'react-native-reanimated';
6
+ import { DROPDOWN_MAX_CONTENT_HEIGHT } from "../../constants.js";
7
+ export const useVoiceTranscriptionsDropdown = model => {
8
+ const isExpanded = useUnit(model.$isExpanded);
9
+ const contentHeight = useSharedValue(0);
10
+ const animationProgress = useSharedValue(isExpanded ? 1 : 0);
11
+ const onListLayout = event => {
12
+ const measuredHeight = event.nativeEvent.layout.height;
13
+ if (measuredHeight > 0) {
14
+ contentHeight.value = measuredHeight;
15
+ }
16
+ };
17
+ const listAnimatedStyle = useAnimatedStyle(() => {
18
+ const height = interpolate(animationProgress.value, [0, 1], [0, contentHeight.value || DROPDOWN_MAX_CONTENT_HEIGHT]);
19
+ const opacity = interpolate(animationProgress.value, [0, 0.3, 1], [0, 0, 1]);
20
+ return {
21
+ height,
22
+ opacity
23
+ };
24
+ }, [animationProgress, contentHeight]);
25
+ const iconAnimatedStyle = useAnimatedStyle(() => {
26
+ const rotation = interpolate(animationProgress.value, [0, 1], [0, 180]);
27
+ return {
28
+ transform: [{
29
+ rotate: `${rotation}deg`
30
+ }]
31
+ };
32
+ }, [animationProgress]);
33
+ useEffect(() => {
34
+ animationProgress.value = withTiming(isExpanded ? 1 : 0, {
35
+ duration: 300
36
+ });
37
+ }, [isExpanded, animationProgress]);
38
+ return {
39
+ isExpanded,
40
+ listAnimatedStyle,
41
+ iconAnimatedStyle,
42
+ onListLayout
43
+ };
44
+ };
45
+ //# sourceMappingURL=useVoiceTranscriptionsDropdown.js.map
@@ -0,0 +1 @@
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":"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AAQ,GAAGlB,WAAW,CAACO,iBAAiB,CAACO,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAEvE,OAAO;MACLK,SAAS,EAAE,CAAC;QAAEC,MAAM,EAAE,GAAGF,QAAQ;MAAM,CAAC;IAC1C,CAAC;EACH,CAAC,EAAE,CAACX,iBAAiB,CAAC,CAAC;EAEvBZ,SAAS,CAAC,MAAM;IACdY,iBAAiB,CAACO,KAAK,GAAGf,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,EAAE;MAAEiB,QAAQ,EAAE;IAAI,CAAC,CAAC;EAC7E,CAAC,EAAE,CAACjB,UAAU,EAAEG,iBAAiB,CAAC,CAAC;EAEnC,OAAO;IACLH,UAAU;IACVW,iBAAiB;IACjBE,iBAAiB;IACjBT;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { useEffect } from 'react';
4
+ import { useSharedValue, withTiming, useDerivedValue, useAnimatedStyle, interpolate } from 'react-native-reanimated';
5
+ export const useVoiceTranscriptionsDropdownItemAnimation = isExpanded => {
6
+ const height = useSharedValue(0);
7
+ const progress = useSharedValue(isExpanded ? 1 : 0);
8
+ useEffect(() => {
9
+ progress.value = withTiming(isExpanded ? 1 : 0);
10
+ }, [isExpanded, progress]);
11
+ const derivedHeight = useDerivedValue(() => height.value * progress.value, [height, progress]);
12
+ const contentAnimatedStyle = useAnimatedStyle(() => {
13
+ const opacity = interpolate(progress.value, [0, 0.3, 1], [0, 0, 1]);
14
+ return {
15
+ height: derivedHeight.value,
16
+ opacity,
17
+ overflow: 'hidden'
18
+ };
19
+ }, [progress, derivedHeight]);
20
+ const onLayout = event => {
21
+ height.value = event.nativeEvent.layout.height;
22
+ };
23
+ return {
24
+ contentAnimatedStyle,
25
+ onLayout,
26
+ progress
27
+ };
28
+ };
29
+ //# sourceMappingURL=useVoiceTranscriptionsDropdownItemAnimation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useSharedValue","withTiming","useDerivedValue","useAnimatedStyle","interpolate","useVoiceTranscriptionsDropdownItemAnimation","isExpanded","height","progress","value","derivedHeight","contentAnimatedStyle","opacity","overflow","onLayout","event","nativeEvent","layout"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/hooks/useVoiceTranscriptionsDropdownItemAnimation.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,OAAO;AAEjC,SACEC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,gBAAgB,EAChBC,WAAW,QACN,yBAAyB;AAEhC,OAAO,MAAMC,2CAA2C,GAAIC,UAAmB,IAAK;EAClF,MAAMC,MAAM,GAAGP,cAAc,CAAC,CAAC,CAAC;EAChC,MAAMQ,QAAQ,GAAGR,cAAc,CAACM,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EAEnDP,SAAS,CAAC,MAAM;IACdS,QAAQ,CAACC,KAAK,GAAGR,UAAU,CAACK,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC;EACjD,CAAC,EAAE,CAACA,UAAU,EAAEE,QAAQ,CAAC,CAAC;EAE1B,MAAME,aAAa,GAAGR,eAAe,CAAC,MAAMK,MAAM,CAACE,KAAK,GAAGD,QAAQ,CAACC,KAAK,EAAE,CAACF,MAAM,EAAEC,QAAQ,CAAC,CAAC;EAE9F,MAAMG,oBAAoB,GAAGR,gBAAgB,CAAC,MAAM;IAClD,MAAMS,OAAO,GAAGR,WAAW,CAACI,QAAQ,CAACC,KAAK,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,OAAO;MACLF,MAAM,EAAEG,aAAa,CAACD,KAAK;MAC3BG,OAAO;MACPC,QAAQ,EAAE;IACZ,CAAC;EACH,CAAC,EAAE,CAACL,QAAQ,EAAEE,aAAa,CAAC,CAAC;EAE7B,MAAMI,QAAQ,GAAIC,KAAwB,IAAK;IAC7CR,MAAM,CAACE,KAAK,GAAGM,KAAK,CAACC,WAAW,CAACC,MAAM,CAACV,MAAM;EAChD,CAAC;EAED,OAAO;IACLI,oBAAoB;IACpBG,QAAQ;IACRN;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ import { createEffect, createEvent, restore } from 'effector';
4
+ import { createAudioPlayer, setAudioModeAsync } from 'expo-audio';
5
+ export let PlayerState = /*#__PURE__*/function (PlayerState) {
6
+ PlayerState["PLAYING"] = "playing";
7
+ PlayerState["PAUSED"] = "paused";
8
+ PlayerState["LOADING"] = "loading";
9
+ PlayerState["IDLE"] = "idle";
10
+ return PlayerState;
11
+ }({});
12
+ export class PlayerModel {
13
+ player = createAudioPlayer();
14
+ stopped = false;
15
+ reset = createEvent();
16
+ setPlayerState = createEvent();
17
+ playbackFinished = createEvent();
18
+ $playerState = restore(this.setPlayerState, PlayerState.IDLE).reset(this.reset);
19
+ setupAudioMode = createEffect(async () => {
20
+ await setAudioModeAsync({
21
+ playsInSilentMode: true,
22
+ shouldPlayInBackground: false,
23
+ interruptionMode: 'doNotMix'
24
+ });
25
+ });
26
+ pause = createEffect(() => {
27
+ if (this.player) {
28
+ this.player.pause();
29
+ this.setPlayerState(PlayerState.PAUSED);
30
+ } else {
31
+ console.warn('Cannot pause: audio player not initialized');
32
+ }
33
+ });
34
+ stop = createEffect(() => {
35
+ this.stopped = true;
36
+ if (this.player) {
37
+ this.player.replace('');
38
+ this.setPlayerState(PlayerState.IDLE);
39
+ } else {
40
+ console.warn('Cannot stop: audio player not initialized');
41
+ }
42
+ });
43
+ resume = createEffect(() => {
44
+ if (this.player) {
45
+ this.player.play();
46
+ this.setPlayerState(PlayerState.PLAYING);
47
+ } else {
48
+ console.warn('Cannot resume: audio player not initialized');
49
+ }
50
+ });
51
+ play = createEffect(async uri => {
52
+ if (!this.player) {
53
+ console.warn('Audio player not initialized');
54
+ return;
55
+ }
56
+ this.stopped = false;
57
+ this.player.replace(uri);
58
+ const waitForLoad = () => {
59
+ if (this.stopped) return;
60
+ if (this.player && this.player.isLoaded) {
61
+ const unsubscribe = this.player.addListener('playbackStatusUpdate', status => {
62
+ if (status.didJustFinish) {
63
+ this.playbackFinished();
64
+ unsubscribe?.remove?.();
65
+ this.setPlayerState(PlayerState.IDLE);
66
+ }
67
+ });
68
+ this.player.play();
69
+ this.setPlayerState(PlayerState.PLAYING);
70
+ } else {
71
+ setTimeout(waitForLoad, 10);
72
+ }
73
+ };
74
+ waitForLoad();
75
+ });
76
+ reinitialize() {
77
+ if (!this.player) {
78
+ this.player = createAudioPlayer();
79
+ }
80
+ }
81
+ release() {
82
+ if (this.player) {
83
+ try {
84
+ this.stop();
85
+ this.player.remove();
86
+ } catch (error) {}
87
+ this.player.release();
88
+ this.player = null;
89
+ }
90
+ this.reset();
91
+ }
92
+ }
93
+ //# sourceMappingURL=Player.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createEvent","restore","createAudioPlayer","setAudioModeAsync","PlayerState","PlayerModel","player","stopped","reset","setPlayerState","playbackFinished","$playerState","IDLE","setupAudioMode","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,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAC7D,SAAsBC,iBAAiB,EAAEC,iBAAiB,QAAQ,YAAY;AAE9E,WAAkBC,WAAW,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAO7B,OAAO,MAAMC,WAAW,CAAC;EAChBC,MAAM,GAAuBJ,iBAAiB,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AC;QACX,IAAI,CAACf,MAAM,CAAC2B,MAAM,CAAC,CAAC;MACtB,CAAC,CAAC,OAAOI,KAAK,EAAE,CAAC;MACjB,IAAI,CAAC/B,MAAM,CAAC8B,OAAO,CAAC,CAAC;MACrB,IAAI,CAAC9B,MAAM,GAAG,IAAI;IACpB;IACA,IAAI,CAACE,KAAK,CAAC,CAAC;EACd;AACF","ignoreList":[]}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ import { createEffect, createEvent, restore } from 'effector';
4
+ import { NO_AUDIO_BE_MESSAGE, TRANSCRIPT_MAX_RETRIES, TRANSCRIPT_RETRY_INTERVAL_MS } from "../../constants.js";
5
+ export class TranscriptionsDownloaderModel {
6
+ setTranscriptsLoaded = createEvent();
7
+ reset = createEvent();
8
+ $transcriptsLoaded = restore(this.setTranscriptsLoaded, false).reset(this.reset);
9
+ constructor(collection, api) {
10
+ this.collection = collection;
11
+ this.api = api;
12
+ }
13
+ async fetchTranscriptWithRetry(audioFileId) {
14
+ for (let attempt = 0; attempt < TRANSCRIPT_MAX_RETRIES; attempt++) {
15
+ const response = await this.api.getAudioFileTranscript(audioFileId);
16
+ if (response.status === 'completed') {
17
+ return response.text;
18
+ }
19
+ if (response.status === 'failed') {
20
+ return NO_AUDIO_BE_MESSAGE;
21
+ }
22
+ if (attempt < TRANSCRIPT_MAX_RETRIES - 1) {
23
+ await new Promise(resolve => setTimeout(resolve, TRANSCRIPT_RETRY_INTERVAL_MS));
24
+ }
25
+ }
26
+ return NO_AUDIO_BE_MESSAGE;
27
+ }
28
+ loadAllTranscripts = createEffect(async () => {
29
+ const attempts = this.collection.getAll();
30
+ const transcriptPromises = attempts.map(async item => {
31
+ if (this.collection.hasTranscript(item.attemptNumber)) {
32
+ return;
33
+ }
34
+ this.collection.update(item.attemptNumber, {
35
+ transcriptLoading: true
36
+ });
37
+ try {
38
+ const text = await this.fetchTranscriptWithRetry(item.audioFileId);
39
+ this.collection.update(item.attemptNumber, {
40
+ transcript: text,
41
+ transcriptLoading: false,
42
+ transcriptError: undefined
43
+ });
44
+ } catch (error) {
45
+ this.collection.update(item.attemptNumber, {
46
+ transcriptLoading: false,
47
+ transcriptError: error instanceof Error ? error.message : 'Failed to load transcript'
48
+ });
49
+ }
50
+ });
51
+ await Promise.all(transcriptPromises);
52
+ this.setTranscriptsLoaded(true);
53
+ });
54
+ getTranscript(attemptNumber) {
55
+ return this.collection.get(attemptNumber)?.transcript;
56
+ }
57
+ isTranscriptLoading(attemptNumber) {
58
+ return this.collection.get(attemptNumber)?.transcriptLoading || false;
59
+ }
60
+ }
61
+ //# sourceMappingURL=TranscriptionsDownloaderModel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","createEvent","restore","NO_AUDIO_BE_MESSAGE","TRANSCRIPT_MAX_RETRIES","TRANSCRIPT_RETRY_INTERVAL_MS","TranscriptionsDownloaderModel","setTranscriptsLoaded","reset","$transcriptsLoaded","constructor","collection","api","fetchTranscriptWithRetry","audioFileId","attempt","response","getAudioFileTranscript","status","text","Promise","resolve","setTimeout","loadAllTranscripts","attempts","getAll","transcriptPromises","map","item","hasTranscript","attemptNumber","update","transcriptLoading","transcript","transcriptError","undefined","error","Error","message","all","getTranscript","get","isTranscriptLoading"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/TranscriptionsDownloaderModel.ts"],"mappings":";;AAAA,SAASA,YAAY,EAAEC,WAAW,EAAEC,OAAO,QAAQ,UAAU;AAG7D,SACEC,mBAAmB,EACnBC,sBAAsB,EACtBC,4BAA4B,QACvB,oBAAiB;AAExB,OAAO,MAAMC,6BAA6B,CAAC;EAIzBC,oBAAoB,GAAGN,WAAW,CAAU,CAAC;EAC7CO,KAAK,GAAGP,WAAW,CAAC,CAAC;EAErBQ,kBAAkB,GAAGP,OAAO,CAAC,IAAI,CAACK,oBAAoB,EAAE,KAAK,CAAC,CAACC,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAEhGE,WAAWA,CAACC,UAAyC,EAA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G,UAAU,EAAEd,IAAI;UAChBa,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEC;QACnB,CAAC,CAAC;MACJ,CAAC,CAAC,OAAOC,KAAK,EAAE;QACd,IAAI,CAACzB,UAAU,CAACoB,MAAM,CAACH,IAAI,CAACE,aAAa,EAAE;UACzCE,iBAAiB,EAAE,KAAK;UACxBE,eAAe,EAAEE,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAG;QAC5D,CAAC,CAAC;MACJ;IACF,CAAC,CAAC;IAEF,MAAMlB,OAAO,CAACmB,GAAG,CAACb,kBAAkB,CAAC;IACrC,IAAI,CAACnB,oBAAoB,CAAC,IAAI,CAAC;EACjC,CAAC,CAAC;EAEKiC,aAAaA,CAACV,aAAqB,EAAsB;IAC9D,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEG,UAAU;EACvD;EAEOS,mBAAmBA,CAACZ,aAAqB,EAAW;IACzD,OAAO,IAAI,CAACnB,UAAU,CAAC8B,GAAG,CAACX,aAAa,CAAC,EAAEE,iBAAiB,IAAI,KAAK;EACvE;AACF","ignoreList":[]}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ import { createEffect } from 'effector';
4
+ import { downloadAudioFileRequestGenerator } from "../../helpers.js";
5
+ export class VoiceFileDownloaderModel {
6
+ setApi = api => {
7
+ this.api = api;
8
+ };
9
+ download = createEffect(async ({
10
+ audioFileId,
11
+ attemptNumber
12
+ }) => {
13
+ const {
14
+ downloadAudio,
15
+ controller
16
+ } = downloadAudioFileRequestGenerator(audioFileId, this.api);
17
+ const downloadPromise = downloadAudio();
18
+ const collectionItem = {
19
+ attemptNumber,
20
+ audioFileId,
21
+ audioLoading: true,
22
+ audioDownloadPromise: downloadPromise,
23
+ controller
24
+ };
25
+ return {
26
+ collectionItem,
27
+ downloadPromise
28
+ };
29
+ });
30
+ abortDownload = controller => {
31
+ controller?.abort();
32
+ };
33
+ }
34
+ //# sourceMappingURL=VoiceFileDownloader.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createEffect","downloadAudioFileRequestGenerator","VoiceFileDownloaderModel","setApi","api","download","audioFileId","attemptNumber","downloadAudio","controller","downloadPromise","collectionItem","audioLoading","audioDownloadPromise","abortDownload","abort"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceFileDownloader.model.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,UAAU;AAEvC,SAASC,iCAAiC,QAAQ,kBAAe;AAYjE,OAAO,MAAMC,wBAAwB,CAAC;EAGpBC,MAAM,GAAIC,GAAmB,IAAK;IAChD,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB,CAAC;EAEeC,QAAQ,GAAGL,YAAY,CACrC,OAAO;IAAEM,WAAW;IAAEC;EAA8B,CAAC,KAA8B;IACjF,MAAM;MAAEC,aAAa;MAAEC;IAAW,CAAC,GAAGR,iCAAiC,CAACK,WAAW,EAAE,IAAI,CAACF,GAAG,CAAC;IAC9F,MAAMM,eAAe,GAAGF,aAAa,CAAC,CAAC;IAEvC,MAAMG,cAA+C,GAAG;MACtDJ,aAAa;MACbD,WAAW;MACXM,YAAY,EAAE,IAAI;MAClBC,oBAAoB,EAAEH,eAAe;MACrCD;IACF,CAAC;IAED,OAAO;MAAEE,cAAc;MAAED;IAAgB,CAAC;EAC5C,CACF,CAAC;EAEeI,aAAa,GAAIL,UAA4B,IAAK;IAChEA,UAAU,EAAEM,KAAK,CAAC,CAAC;EACrB,CAAC;AACH","ignoreList":[]}