@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,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceFileDownloaderModel = void 0;
7
+ var _effector = require("effector");
8
+ var _helpers = require("../../helpers.js");
9
+ class VoiceFileDownloaderModel {
10
+ setApi = api => {
11
+ this.api = api;
12
+ };
13
+ download = (0, _effector.createEffect)(async ({
14
+ audioFileId,
15
+ attemptNumber
16
+ }) => {
17
+ const {
18
+ downloadAudio,
19
+ controller
20
+ } = (0, _helpers.downloadAudioFileRequestGenerator)(audioFileId, this.api);
21
+ const downloadPromise = downloadAudio();
22
+ const collectionItem = {
23
+ attemptNumber,
24
+ audioFileId,
25
+ audioLoading: true,
26
+ audioDownloadPromise: downloadPromise,
27
+ controller
28
+ };
29
+ return {
30
+ collectionItem,
31
+ downloadPromise
32
+ };
33
+ });
34
+ abortDownload = controller => {
35
+ controller?.abort();
36
+ };
37
+ }
38
+ exports.VoiceFileDownloaderModel = VoiceFileDownloaderModel;
39
+ //# sourceMappingURL=VoiceFileDownloader.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_helpers","VoiceFileDownloaderModel","setApi","api","download","createEffect","audioFileId","attemptNumber","downloadAudio","controller","downloadAudioFileRequestGenerator","downloadPromise","collectionItem","audioLoading","audioDownloadPromise","abortDownload","abort","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceFileDownloader.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAYO,MAAME,wBAAwB,CAAC;EAGpBC,MAAM,GAAIC,GAAmB,IAAK;IAChD,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB,CAAC;EAEeC,QAAQ,GAAG,IAAAC,sBAAY,EACrC,OAAO;IAAEC,WAAW;IAAEC;EAA8B,CAAC,KAA8B;IACjF,MAAM;MAAEC,aAAa;MAAEC;IAAW,CAAC,GAAG,IAAAC,0CAAiC,EAACJ,WAAW,EAAE,IAAI,CAACH,GAAG,CAAC;IAC9F,MAAMQ,eAAe,GAAGH,aAAa,CAAC,CAAC;IAEvC,MAAMI,cAA+C,GAAG;MACtDL,aAAa;MACbD,WAAW;MACXO,YAAY,EAAE,IAAI;MAClBC,oBAAoB,EAAEH,eAAe;MACrCF;IACF,CAAC;IAED,OAAO;MAAEG,cAAc;MAAED;IAAgB,CAAC;EAC5C,CACF,CAAC;EAEeI,aAAa,GAAIN,UAA4B,IAAK;IAChEA,UAAU,EAAEO,KAAK,CAAC,CAAC;EACrB,CAAC;AACH;AAACC,OAAA,CAAAhB,wBAAA,GAAAA,wBAAA","ignoreList":[]}
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoicePlayerModel = void 0;
7
+ var _effector = require("effector");
8
+ var _VoiceTranscriptionsCollection = require("./VoiceTranscriptionsCollection.js");
9
+ var _VoiceFileDownloaderModel = require("./VoiceFileDownloader.model.js");
10
+ var _VoiceTranscriptionsDropdownModel = require("./VoiceTranscriptionsDropdown.model.js");
11
+ var _PlayerModel = require("./Player.model.js");
12
+ var _TranscriptionsDownloaderModel = require("./TranscriptionsDownloaderModel.js");
13
+ class VoicePlayerModel {
14
+ collection = new _VoiceTranscriptionsCollection.VoiceTranscriptionsCollection();
15
+ downloader = new _VoiceFileDownloaderModel.VoiceFileDownloaderModel();
16
+ dropdown = new _VoiceTranscriptionsDropdownModel.VoiceTranscriptionsDropdownModel();
17
+ playerModel = new _PlayerModel.PlayerModel();
18
+ currentPlayingAttempt = null;
19
+ shouldPreventPlayback = false;
20
+ setCurrentAttempt = (0, _effector.createEvent)();
21
+ reset = (0, _effector.createEvent)();
22
+ $currentAttempt = (0, _effector.restore)(this.setCurrentAttempt, null).reset(this.reset);
23
+ $playerState = this.playerModel.$playerState;
24
+ pauseAudio = this.playerModel.pause;
25
+ stopAudio = () => {
26
+ this.shouldPreventPlayback = true;
27
+ this.abortAllDownloads();
28
+ this.playerModel.stop();
29
+ this.currentPlayingAttempt = null;
30
+ this.setCurrentAttempt(null);
31
+ };
32
+ resetPlayer = () => {
33
+ this.shouldPreventPlayback = true;
34
+ this.releaseCollectionResources();
35
+ this.playerModel.stop();
36
+ this.currentPlayingAttempt = null;
37
+ this.setCurrentAttempt(null);
38
+ this.collection.clear();
39
+ };
40
+ constructor(params) {
41
+ this.api = params.api;
42
+ this.loader = new _TranscriptionsDownloaderModel.TranscriptionsDownloaderModel(this.collection, params.api);
43
+ this.downloader.setApi(params.api);
44
+ this.playerModel.playbackFinished.watch(() => {
45
+ this.currentPlayingAttempt = null;
46
+ this.setCurrentAttempt(null);
47
+ });
48
+ if (params.audios) {
49
+ this.initializeCollectionFromAudios(params.audios);
50
+ }
51
+ this.playerModel.setupAudioMode();
52
+ }
53
+ initializeWithAudios(answerAudio) {
54
+ this.loader.setTranscriptsLoaded(false);
55
+ this.collection.clear();
56
+ this.initializeCollectionFromAudios(answerAudio);
57
+ }
58
+ initializeCollectionFromAudios(audios) {
59
+ if (!audios) {
60
+ console.warn('VoicePlayerModel: audios is not provided');
61
+ return;
62
+ }
63
+ audios.forEach((audio, index) => {
64
+ const attemptNumber = index + 1;
65
+ if (!audio.audioFileId) {
66
+ console.warn('VoicePlayerModel: audioFileId is missing for audio', audio);
67
+ return;
68
+ }
69
+ this.collection.add(attemptNumber, {
70
+ attemptNumber,
71
+ audioFileId: audio.audioFileId,
72
+ _id: audio._id,
73
+ hasDrawing: !!audio.drawing
74
+ });
75
+ });
76
+ }
77
+ releaseCollectionResources() {
78
+ this.collection.getAll().forEach(item => {
79
+ if (item.controller) {
80
+ this.downloader.abortDownload(item.controller);
81
+ }
82
+ if (item.audioUri?.startsWith('blob:')) {
83
+ try {
84
+ URL.revokeObjectURL(item.audioUri);
85
+ } catch (e) {}
86
+ }
87
+ });
88
+ }
89
+ abortAllDownloads() {
90
+ this.collection.getAll().forEach(item => {
91
+ if (item.controller && item.audioLoading) {
92
+ this.downloader.abortDownload(item.controller);
93
+ this.collection.update(item.attemptNumber, {
94
+ audioLoading: false,
95
+ controller: undefined,
96
+ audioDownloadPromise: undefined
97
+ });
98
+ }
99
+ });
100
+ }
101
+ handlePlayAttempt = (0, _effector.createEffect)(async attemptNumber => {
102
+ this.shouldPreventPlayback = false;
103
+ const item = this.collection.get(attemptNumber);
104
+ if (!item) return;
105
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
106
+ this.abortAllDownloads();
107
+ }
108
+ if (this.collection.hasAudio(attemptNumber)) {
109
+ this.playAudioFx(attemptNumber);
110
+ return;
111
+ }
112
+ try {
113
+ this.playerModel.setPlayerState(_PlayerModel.PlayerState.LOADING);
114
+ const {
115
+ collectionItem,
116
+ downloadPromise
117
+ } = await this.downloader.download({
118
+ audioFileId: item.audioFileId,
119
+ attemptNumber
120
+ });
121
+ if (this.shouldPreventPlayback) {
122
+ collectionItem.controller?.abort();
123
+ return;
124
+ }
125
+ this.collection.update(attemptNumber, collectionItem);
126
+ const result = await downloadPromise;
127
+ if (this.shouldPreventPlayback) {
128
+ if (result.uri?.startsWith('blob:')) {
129
+ URL.revokeObjectURL(result.uri);
130
+ }
131
+ return;
132
+ }
133
+ this.collection.update(attemptNumber, {
134
+ audioUri: result.uri,
135
+ audioLoading: false,
136
+ audioError: undefined,
137
+ controller: undefined,
138
+ audioDownloadPromise: undefined
139
+ });
140
+ this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
141
+ this.playAudioFx(attemptNumber);
142
+ } catch (error) {
143
+ console.error('Audio download error:', error);
144
+ if (error instanceof Error && error.name === 'AbortError') {
145
+ this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
146
+ return;
147
+ }
148
+ this.collection.update(attemptNumber, {
149
+ audioLoading: false,
150
+ audioError: error instanceof Error ? error.message : 'Failed to download audio',
151
+ controller: undefined,
152
+ audioDownloadPromise: undefined
153
+ });
154
+ }
155
+ });
156
+ playAudioFx = (0, _effector.createEffect)(async attemptNumber => {
157
+ if (this.shouldPreventPlayback) return;
158
+ const item = this.collection.get(attemptNumber);
159
+ if (!item?.audioUri) {
160
+ console.warn('No audio URI available for attempt:', attemptNumber);
161
+ return;
162
+ }
163
+ try {
164
+ if (this.currentPlayingAttempt !== null && this.currentPlayingAttempt !== attemptNumber) {
165
+ this.playerModel.player?.remove();
166
+ }
167
+ if (this.currentPlayingAttempt === attemptNumber && this.playerModel.player?.playing) {
168
+ this.playerModel.pause();
169
+ return;
170
+ }
171
+ if (this.currentPlayingAttempt === attemptNumber && !this.playerModel.player?.playing) {
172
+ this.playerModel.resume();
173
+ return;
174
+ }
175
+ this.currentPlayingAttempt = attemptNumber;
176
+ this.setCurrentAttempt(attemptNumber);
177
+ await this.playerModel.play(item.audioUri);
178
+ } catch (error) {
179
+ console.error('Error playing audio:', error);
180
+ this.playerModel.setPlayerState(_PlayerModel.PlayerState.IDLE);
181
+ this.collection.update(attemptNumber, {
182
+ audioError: error instanceof Error ? error.message : 'Failed to play audio'
183
+ });
184
+ }
185
+ });
186
+ isAudioLoading(attemptNumber) {
187
+ return this.collection.get(attemptNumber)?.audioLoading || false;
188
+ }
189
+ getAllAttempts() {
190
+ return this.collection.getAll();
191
+ }
192
+ reinitializePlayer() {
193
+ this.playerModel.reinitialize();
194
+ }
195
+ cleanup() {
196
+ this.releaseCollectionResources();
197
+ this.collection.clear();
198
+ this.currentPlayingAttempt = null;
199
+ this.reset();
200
+ this.loader.reset();
201
+ this.dropdown.reset();
202
+ this.playerModel.release();
203
+ }
204
+ togglePlayPause = (0, _effector.attach)({
205
+ source: this.playerModel.$playerState,
206
+ mapParams: (attemptNumber, playerState) => ({
207
+ attemptNumber,
208
+ playerState
209
+ }),
210
+ effect: (0, _effector.createEffect)(({
211
+ attemptNumber,
212
+ playerState
213
+ }) => {
214
+ if (this.currentPlayingAttempt === attemptNumber && playerState === _PlayerModel.PlayerState.PLAYING) {
215
+ this.pauseAudio();
216
+ } else {
217
+ this.handlePlayAttempt(attemptNumber);
218
+ }
219
+ })
220
+ });
221
+ }
222
+ exports.VoicePlayerModel = VoicePlayerModel;
223
+ //# sourceMappingURL=VoicePlayer.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_VoiceTranscriptionsCollection","_VoiceFileDownloaderModel","_VoiceTranscriptionsDropdownModel","_PlayerModel","_TranscriptionsDownloaderModel","VoicePlayerModel","collection","VoiceTranscriptionsCollection","downloader","VoiceFileDownloaderModel","dropdown","VoiceTranscriptionsDropdownModel","playerModel","PlayerModel","currentPlayingAttempt","shouldPreventPlayback","setCurrentAttempt","createEvent","reset","$currentAttempt","restore","$playerState","pauseAudio","pause","stopAudio","abortAllDownloads","stop","resetPlayer","releaseCollectionResources","clear","constructor","params","api","loader","TranscriptionsDownloaderModel","setApi","playbackFinished","watch","audios","initializeCollectionFromAudios","setupAudioMode","initializeWithAudios","answerAudio","setTranscriptsLoaded","console","warn","forEach","audio","index","attemptNumber","audioFileId","add","_id","hasDrawing","drawing","getAll","item","controller","abortDownload","audioUri","startsWith","URL","revokeObjectURL","e","audioLoading","update","undefined","audioDownloadPromise","handlePlayAttempt","createEffect","get","hasAudio","playAudioFx","setPlayerState","PlayerState","LOADING","collectionItem","downloadPromise","download","abort","result","uri","audioError","IDLE","error","Error","name","message","player","remove","playing","resume","play","isAudioLoading","getAllAttempts","reinitializePlayer","reinitialize","cleanup","release","togglePlayPause","attach","source","mapParams","playerState","effect","PLAYING","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoicePlayer.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,8BAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AACA,IAAAG,iCAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,8BAAA,GAAAL,OAAA;AAWO,MAAMM,gBAAgB,CAAC;EACZC,UAAU,GAAG,IAAIC,4DAA6B,CAAC,CAAC;EAChDC,UAAU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D,WAAW,MAAM;MAAEtD,aAAa;MAAEsD;IAAY,CAAC,CAAC;IACnFC,MAAM,EAAE,IAAAnC,sBAAY,EAAC,CAAC;MAAEpB,aAAa;MAAEsD;IAAmC,CAAC,KAAK;MAC9E,IAAI,IAAI,CAACzF,qBAAqB,KAAKmC,aAAa,IAAIsD,WAAW,KAAK7B,wBAAW,CAAC+B,OAAO,EAAE;QACvF,IAAI,CAACnF,UAAU,CAAC,CAAC;MACnB,CAAC,MAAM;QACL,IAAI,CAAC8C,iBAAiB,CAACnB,aAAa,CAAC;MACvC;IACF,CAAC;EACH,CAAC,CAAC;AACJ;AAACyD,OAAA,CAAArG,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscriptionsCollection = void 0;
7
+ class VoiceTranscriptionsCollection {
8
+ collection = new Map();
9
+ add(attemptNumber, item) {
10
+ this.collection.set(attemptNumber, item);
11
+ }
12
+ update(attemptNumber, item) {
13
+ const existingItem = this.collection.get(attemptNumber) || {};
14
+ this.collection.set(attemptNumber, {
15
+ ...existingItem,
16
+ ...item
17
+ });
18
+ }
19
+ delete(attemptNumber) {
20
+ this.collection.delete(attemptNumber);
21
+ }
22
+ get(attemptNumber) {
23
+ return this.collection.get(attemptNumber);
24
+ }
25
+ getAll() {
26
+ return Array.from(this.collection.values());
27
+ }
28
+ clear() {
29
+ this.collection.clear();
30
+ }
31
+ hasTranscript(attemptNumber) {
32
+ const item = this.collection.get(attemptNumber);
33
+ return !!item?.transcript;
34
+ }
35
+ hasAudio(attemptNumber) {
36
+ const item = this.collection.get(attemptNumber);
37
+ return !!item?.audioUri;
38
+ }
39
+ }
40
+ exports.VoiceTranscriptionsCollection = VoiceTranscriptionsCollection;
41
+ //# sourceMappingURL=VoiceTranscriptionsCollection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["VoiceTranscriptionsCollection","collection","Map","add","attemptNumber","item","set","update","existingItem","get","delete","getAll","Array","from","values","clear","hasTranscript","transcript","hasAudio","audioUri","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsCollection.ts"],"mappings":";;;;;;AAEO,MAAMA,6BAA6B,CAAC;EACzBC,UAAU,GAAwC,IAAIC,GAAG,CAAC,CAAC;EAEpEC,GAAGA,CAACC,aAAqB,EAAEC,IAA4B,EAAE;IAC9D,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,aAAa,EAAEC,IAAI,CAAC;EAC1C;EAEOE,MAAMA,CAACH,aAAqB,EAAEC,IAAqC,EAAE;IAC1E,MAAMG,YAAY,GAAG,IAAI,CAACP,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC,IAAK,CAAC,CAA4B;IACzF,IAAI,CAACH,UAAU,CAACK,GAAG,CAACF,aAAa,EAAE;MAAE,GAAGI,YAAY;MAAE,GAAGH;IAAK,CAAC,CAAC;EAClE;EAEOK,MAAMA,CAACN,aAAqB,EAAE;IACnC,IAAI,CAACH,UAAU,CAACS,MAAM,CAACN,aAAa,CAAC;EACvC;EAEOK,GAAGA,CAACL,aAAqB,EAAE;IAChC,OAAO,IAAI,CAACH,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;EAC3C;EAEOO,MAAMA,CAAA,EAAG;IACd,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACZ,UAAU,CAACa,MAAM,CAAC,CAAC,CAAC;EAC7C;EAEOC,KAAKA,CAAA,EAAG;IACb,IAAI,CAACd,UAAU,CAACc,KAAK,CAAC,CAAC;EACzB;EAEOC,aAAaA,CAACZ,aAAqB,EAAE;IAC1C,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEY,UAAU;EAC3B;EAEOC,QAAQA,CAACd,aAAqB,EAAE;IACrC,MAAMC,IAAI,GAAG,IAAI,CAACJ,UAAU,CAACQ,GAAG,CAACL,aAAa,CAAC;IAC/C,OAAO,CAAC,CAACC,IAAI,EAAEc,QAAQ;EACzB;AACF;AAACC,OAAA,CAAApB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceTranscriptionsDropdownModel = void 0;
7
+ var _effector = require("effector");
8
+ class VoiceTranscriptionsDropdownModel {
9
+ toggleExpand = (0, _effector.createEvent)();
10
+ setExpanded = (0, _effector.createEvent)();
11
+ reset = (0, _effector.createEvent)();
12
+ $isExpanded = (0, _effector.restore)(this.setExpanded, false).on(this.toggleExpand, state => !state).reset(this.reset);
13
+ }
14
+ exports.VoiceTranscriptionsDropdownModel = VoiceTranscriptionsDropdownModel;
15
+ //# sourceMappingURL=VoiceTranscriptionsDropdown.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","VoiceTranscriptionsDropdownModel","toggleExpand","createEvent","setExpanded","reset","$isExpanded","restore","on","state","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/VoiceTranscriptionsDropdown.model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEO,MAAMC,gCAAgC,CAAC;EAC5BC,YAAY,GAAG,IAAAC,qBAAW,EAAC,CAAC;EAC5BC,WAAW,GAAG,IAAAD,qBAAW,EAAU,CAAC;EACpCE,KAAK,GAAG,IAAAF,qBAAW,EAAC,CAAC;EAErBG,WAAW,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,WAAW,EAAE,KAAK,CAAC,CAC3DI,EAAE,CAAC,IAAI,CAACN,YAAY,EAAGO,KAAK,IAAK,CAACA,KAAK,CAAC,CACxCJ,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB;AAACK,OAAA,CAAAT,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "PlayerState", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _PlayerModel.PlayerState;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "VoicePlayerModel", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _VoicePlayerModel.VoicePlayerModel;
16
+ }
17
+ });
18
+ var _VoicePlayerModel = require("./VoicePlayer.model.js");
19
+ var _PlayerModel = require("./Player.model.js");
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_VoicePlayerModel","require","_PlayerModel"],"sourceRoot":"../../../../../../src","sources":["features/voice/playing/model/index.ts"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceRecord = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _VoiceRecordButton = require("./VoiceRecordButton.js");
9
+ var _react = _interopRequireWildcard(require("react"));
10
+ var _reactNativeUi = require("@magmamath/react-native-ui");
11
+ var _VoiceRecordDeleteButton = require("./VoiceRecordDeleteButton.js");
12
+ var _VoiceRecordDivider = require("./VoiceRecordDivider.js");
13
+ var _VoiceRecordTimer = require("./VoiceRecordTimer.js");
14
+ var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
15
+ var _useVoiceRecorder = require("../hooks/useVoiceRecorder.js");
16
+ var _useVoiceRecorderAnimation = require("../hooks/useVoiceRecorderAnimation.js");
17
+ var _effectorReact = require("effector-react");
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ 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); }
20
+ 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; }
21
+ const VoiceRecord = ({
22
+ style,
23
+ model
24
+ }) => {
25
+ const {
26
+ recorderState
27
+ } = (0, _useVoiceRecorder.useVoiceRecorder)(model);
28
+ const [isExpanded, isDisabled] = (0, _effectorReact.useUnit)([model.$isExpanded, model.$isButtonDisabled]);
29
+ const {
30
+ containerAnimatedStyle
31
+ } = (0, _useVoiceRecorderAnimation.useVoiceRecorderAnimation)(isExpanded);
32
+ (0, _react.useEffect)(() => {
33
+ return () => {
34
+ model.cleanup();
35
+ };
36
+ }, [model]);
37
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
38
+ style: [styles.container, style, containerAnimatedStyle],
39
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceRecordButton.VoiceRecordButton, {
40
+ model: model
41
+ }), isExpanded && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNativeReanimated.default.View, {
42
+ entering: _reactNativeReanimated.FadeIn,
43
+ exiting: _reactNativeReanimated.FadeOut,
44
+ style: styles.expendedContainer,
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceRecordTimer.VoiceRecordTimer, {
46
+ style: styles.timer,
47
+ model: model,
48
+ recordingFileDurationMs: recorderState.durationMillis
49
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceRecordDivider.VoiceRecordDivider, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_VoiceRecordDeleteButton.VoiceRecordDeleteButton, {
50
+ isDisabled: isDisabled,
51
+ onPress: model.events.deleteRecord
52
+ })]
53
+ })]
54
+ });
55
+ };
56
+ exports.VoiceRecord = VoiceRecord;
57
+ const styles = _reactNative.StyleSheet.create({
58
+ container: {
59
+ alignItems: 'center',
60
+ padding: 3,
61
+ paddingBottom: 6,
62
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_3,
63
+ borderRadius: 32,
64
+ boxShadow: '0 1px 3px 0 rgba(51, 51, 51, 0.10), 0 0 1px 0 rgba(51, 51, 51, 0.40)',
65
+ overflow: 'hidden'
66
+ },
67
+ timer: {
68
+ marginTop: _reactNativeUi.SPACING[400]
69
+ },
70
+ expendedContainer: {
71
+ alignItems: 'center'
72
+ }
73
+ });
74
+ //# sourceMappingURL=VoiceRecord.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_VoiceRecordButton","_react","_interopRequireWildcard","_reactNativeUi","_VoiceRecordDeleteButton","_VoiceRecordDivider","_VoiceRecordTimer","_reactNativeReanimated","_useVoiceRecorder","_useVoiceRecorderAnimation","_effectorReact","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VoiceRecord","style","model","recorderState","useVoiceRecorder","isExpanded","isDisabled","useUnit","$isExpanded","$isButtonDisabled","containerAnimatedStyle","useVoiceRecorderAnimation","useEffect","cleanup","jsxs","View","styles","container","children","jsx","VoiceRecordButton","entering","FadeIn","exiting","FadeOut","expendedContainer","VoiceRecordTimer","timer","recordingFileDurationMs","durationMillis","VoiceRecordDivider","VoiceRecordDeleteButton","onPress","events","deleteRecord","exports","StyleSheet","create","alignItems","padding","paddingBottom","backgroundColor","COLORS","NEUTRAL_3","borderRadius","boxShadow","overflow","marginTop","SPACING"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecord.tsx"],"mappings":";;;;;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AAA,gBACjF,IAAAvC,WAAA,CAAAwC,GAAA,EAAC7C,iBAAA,CAAAoD,gBAAgB;QACfzB,KAAK,EAAEe,MAAM,CAACW,KAAM;QACpBzB,KAAK,EAAEA,KAAM;QACb0B,uBAAuB,EAAEzB,aAAa,CAAC0B;MAAe,CACvD,CAAC,eACF,IAAAlD,WAAA,CAAAwC,GAAA,EAAC9C,mBAAA,CAAAyD,kBAAkB,IAAE,CAAC,eACtB,IAAAnD,WAAA,CAAAwC,GAAA,EAAC/C,wBAAA,CAAA2D,uBAAuB;QAACzB,UAAU,EAAEA,UAAW;QAAC0B,OAAO,EAAE9B,KAAK,CAAC+B,MAAM,CAACC;MAAa,CAAE,CAAC;IAAA,CAC1E,CAChB;EAAA,CACY,CAAC;AAEpB,CAAC;AAAAC,OAAA,CAAAnC,WAAA,GAAAA,WAAA;AAED,MAAMgB,MAAM,GAAGoB,uBAAU,CAACC,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACTqB,UAAU,EAAE,QAAQ;IACpBC,OAAO,EAAE,CAAC;IACVC,aAAa,EAAE,CAAC;IAChBC,eAAe,EAAEC,qBAAM,CAACC,SAAS;IACjCC,YAAY,EAAE,EAAE;IAChBC,SAAS,EAAE,sEAAsE;IACjFC,QAAQ,EAAE;EACZ,CAAC;EACDnB,KAAK,EAAE;IACLoB,SAAS,EAAEC,sBAAO,CAAC,GAAG;EACxB,CAAC;EACDvB,iBAAiB,EAAE;IACjBa,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceRecordButton = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNativeUi = require("@magmamath/react-native-ui");
9
+ var _reactNative = require("react-native");
10
+ var _effectorReact = require("effector-react");
11
+ var _constants = require("../../constants.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 VoiceRecordButton = ({
17
+ style,
18
+ model
19
+ }) => {
20
+ const t = (0, _index.useText)();
21
+ const availableInputs = (0, _effectorReact.useUnit)(model.recorderModel.$availableInputs);
22
+ const voiceRecordState = (0, _effectorReact.useUnit)(model.recorderModel.$voiceRecordState);
23
+ const isButtonDisabled = (0, _effectorReact.useUnit)(model.$isButtonDisabled);
24
+ const isInitializing = (0, _effectorReact.useUnit)(model.initializeRecording.pending);
25
+ const combinedStyles = (0, _react.useMemo)(() => {
26
+ return {
27
+ button: [{
28
+ width: 50,
29
+ height: 50
30
+ }, style?.button],
31
+ container: [style?.container],
32
+ text: [style?.text]
33
+ };
34
+ }, [style]);
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
36
+ onPressIn: e => {
37
+ if (availableInputs.length) return;
38
+ e.preventDefault();
39
+ model.notification.warning(t('voice.noMicrophoneFound'));
40
+ },
41
+ pointerEvents: !availableInputs.length || isInitializing ? 'box-only' : 'auto',
42
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.Button, {
43
+ disabled: isButtonDisabled || !availableInputs.length,
44
+ onPressIn: () => model.recorderButtonHandler(),
45
+ style: combinedStyles,
46
+ size: _reactNativeUi.ButtonSize.LARGE,
47
+ variant: _reactNativeUi.ButtonVariant.SECONDARY,
48
+ colorScheme: _reactNativeUi.ButtonColor.WHITE,
49
+ icon: voiceRecordState === _constants.VoiceRecorderState.RECORDING ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.CheckIcon, {
50
+ size: 25
51
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.MicrophoneIcon, {
52
+ style: _reactNativeUi.IS_WEB ? {
53
+ width: 19
54
+ } : {
55
+ minWidth: 23,
56
+ minHeight: 23
57
+ }
58
+ })
59
+ })
60
+ });
61
+ };
62
+ exports.VoiceRecordButton = VoiceRecordButton;
63
+ //# sourceMappingURL=VoiceRecordButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNativeUi","_reactNative","_effectorReact","_constants","_index","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","VoiceRecordButton","style","model","useText","availableInputs","useUnit","recorderModel","$availableInputs","voiceRecordState","$voiceRecordState","isButtonDisabled","$isButtonDisabled","isInitializing","initializeRecording","pending","combinedStyles","useMemo","button","width","height","container","text","jsx","Pressable","onPressIn","length","preventDefault","notification","warning","pointerEvents","children","Button","disabled","recorderButtonHandler","size","ButtonSize","LARGE","variant","ButtonVariant","SECONDARY","colorScheme","ButtonColor","WHITE","icon","VoiceRecorderState","RECORDING","CheckIcon","MicrophoneIcon","IS_WEB","minWidth","minHeight","exports"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAQA,IAAAE,YAAA,GAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,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,KAAK,CAAC+B,qBAAqB,CAAC,CAAE;MAC/ChC,KAAK,EAAEc,cAAe;MACtBmB,IAAI,EAAEC,yBAAU,CAACC,KAAM;MACvBC,OAAO,EAAEC,4BAAa,CAACC,SAAU;MACjCC,WAAW,EAAEC,0BAAW,CAACC,KAAM;MAC/BC,IAAI,EACFnC,gBAAgB,KAAKoC,6BAAkB,CAACC,SAAS,gBAC/C,IAAAlE,WAAA,CAAA2C,GAAA,EAAChD,cAAA,CAAAwE,SAAS;QAACZ,IAAI,EAAE;MAAG,CAAE,CAAC,gBAEvB,IAAAvD,WAAA,CAAA2C,GAAA,EAAChD,cAAA,CAAAyE,cAAc;QAAC9C,KAAK,EAAE+C,qBAAM,GAAG;UAAE9B,KAAK,EAAE;QAAG,CAAC,GAAG;UAAE+B,QAAQ,EAAE,EAAE;UAAEC,SAAS,EAAE;QAAG;MAAE,CAAE;IAErF,CACF;EAAC,CACO,CAAC;AAEhB,CAAC;AAAAC,OAAA,CAAAnD,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceRecordDeleteButton = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _reactNativeUi = require("@magmamath/react-native-ui");
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const VoiceRecordDeleteButton = ({
13
+ onPress,
14
+ isDisabled
15
+ }) => {
16
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
17
+ style: styles.container,
18
+ onPress: onPress,
19
+ disabled: isDisabled,
20
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeUi.TrashcanIcon, {
21
+ size: 20,
22
+ color: isDisabled ? _reactNativeUi.COLORS.NEUTRAL_5 : _reactNativeUi.COLORS.NEUTRAL_9
23
+ })
24
+ });
25
+ };
26
+ exports.VoiceRecordDeleteButton = VoiceRecordDeleteButton;
27
+ const styles = _reactNative.StyleSheet.create({
28
+ container: {
29
+ width: 36,
30
+ height: 36,
31
+ alignItems: 'center',
32
+ justifyContent: 'center'
33
+ }
34
+ });
35
+ //# sourceMappingURL=VoiceRecordDeleteButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_reactNativeUi","_react","_interopRequireDefault","_jsxRuntime","e","__esModule","default","VoiceRecordDeleteButton","onPress","isDisabled","jsx","TouchableOpacity","style","styles","container","disabled","children","TrashcanIcon","size","color","COLORS","NEUTRAL_5","NEUTRAL_9","exports","StyleSheet","create","width","height","alignItems","justifyContent"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordDeleteButton.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAyB,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAOlB,MAAMG,uBAAuB,GAAGA,CAAC;EAAEC,OAAO;EAAEC;AAAmC,CAAC,KAAK;EAC1F,oBACE,IAAAN,WAAA,CAAAO,GAAA,EAACZ,YAAA,CAAAa,gBAAgB;IAACC,KAAK,EAAEC,MAAM,CAACC,SAAU;IAACN,OAAO,EAAEA,OAAQ;IAACO,QAAQ,EAAEN,UAAW;IAAAO,QAAA,eAChF,IAAAb,WAAA,CAAAO,GAAA,EAACV,cAAA,CAAAiB,YAAY;MAACC,IAAI,EAAE,EAAG;MAACC,KAAK,EAAEV,UAAU,GAAGW,qBAAM,CAACC,SAAS,GAAGD,qBAAM,CAACE;IAAU,CAAE;EAAC,CACnE,CAAC;AAEvB,CAAC;AAAAC,OAAA,CAAAhB,uBAAA,GAAAA,uBAAA;AAED,MAAMM,MAAM,GAAGW,uBAAU,CAACC,MAAM,CAAC;EAC/BX,SAAS,EAAE;IACTY,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACVC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VoiceRecordDivider = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactNativeUi = require("@magmamath/react-native-ui");
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const VoiceRecordDivider = () => {
13
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
14
+ style: styles.container
15
+ });
16
+ };
17
+ exports.VoiceRecordDivider = VoiceRecordDivider;
18
+ const styles = _reactNative.StyleSheet.create({
19
+ container: {
20
+ height: 1,
21
+ borderRadius: 1,
22
+ width: 28,
23
+ margin: 8,
24
+ backgroundColor: _reactNativeUi.COLORS.NEUTRAL_6
25
+ }
26
+ });
27
+ //# sourceMappingURL=VoiceRecordDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_react","_interopRequireDefault","_reactNativeUi","_jsxRuntime","e","__esModule","default","VoiceRecordDivider","jsx","View","style","styles","container","exports","StyleSheet","create","height","borderRadius","width","margin","backgroundColor","COLORS","NEUTRAL_6"],"sourceRoot":"../../../../../../src","sources":["features/voice/recording/components/VoiceRecordDivider.tsx"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAAmD,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE5C,MAAMG,kBAAkB,GAAGA,CAAA,KAAM;EACtC,oBAAO,IAAAJ,WAAA,CAAAK,GAAA,EAACV,YAAA,CAAAW,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC;EAAU,CAAE,CAAC;AAC1C,CAAC;AAAAC,OAAA,CAAAN,kBAAA,GAAAA,kBAAA;AAED,MAAMI,MAAM,GAAGG,uBAAU,CAACC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,CAAC;IACTC,eAAe,EAAEC,qBAAM,CAACC;EAC1B;AACF,CAAC,CAAC","ignoreList":[]}