@magmamath/students-features 0.5.0 → 0.5.1-rc-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 (407) hide show
  1. package/dist/commonjs/features/celebrations/config.js +4 -4
  2. package/dist/commonjs/features/celebrations/config.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js +1 -2
  4. package/dist/commonjs/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  5. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  6. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +47 -30
  7. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  8. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +42 -22
  9. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +14 -11
  11. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js +32 -17
  13. package/dist/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  14. package/dist/commonjs/features/chatbot/components/Chatbot.js +7 -5
  15. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  16. package/dist/commonjs/features/chatbot/index.js +7 -0
  17. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  18. package/dist/commonjs/features/chatbot/model/{ChatBotThreadManager.js → ChatBotMessageHandler.js} +22 -44
  19. package/dist/commonjs/features/chatbot/model/ChatBotMessageHandler.js.map +1 -0
  20. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +125 -146
  21. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  22. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js +12 -12
  23. package/dist/commonjs/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  24. package/dist/commonjs/features/chatbot/model/ThreadItem.js +8 -16
  25. package/dist/commonjs/features/chatbot/model/ThreadItem.js.map +1 -1
  26. package/dist/commonjs/features/chatbot/model/{ChatbotApi.js → api.js} +1 -2
  27. package/dist/commonjs/features/chatbot/model/api.js.map +1 -0
  28. package/dist/commonjs/features/chatbot/model/constants.js.map +1 -1
  29. package/dist/commonjs/features/chatbot/model/messagesHelper.js +7 -7
  30. package/dist/commonjs/features/chatbot/model/messagesHelper.js.map +1 -1
  31. package/dist/commonjs/features/chatbot/model/t2s.js +13 -18
  32. package/dist/commonjs/features/chatbot/model/t2s.js.map +1 -1
  33. package/dist/commonjs/features/chatbot/model/translation.helpers.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/model/translation.js +19 -28
  35. package/dist/commonjs/features/chatbot/model/translation.js.map +1 -1
  36. package/dist/commonjs/features/chatbot/types/api.types.js +0 -4
  37. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  38. package/dist/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
  39. package/dist/commonjs/index.js.map +1 -1
  40. package/dist/commonjs/lib/effector/createEntityFieldStore.js +0 -4
  41. package/dist/commonjs/lib/effector/createEntityFieldStore.js.map +1 -1
  42. package/{src/shared/translation → dist/commonjs/lib}/localization/en.json +1 -8
  43. package/dist/{module/shared/translation → commonjs/lib}/localization/gb.json +1 -8
  44. package/dist/commonjs/{shared/translation → lib}/localization/sw.json +1 -8
  45. package/dist/commonjs/shared/icons/icon.types.js +0 -4
  46. package/dist/commonjs/shared/translation/constants.js +3 -3
  47. package/dist/commonjs/shared/translation/constants.js.map +1 -1
  48. package/dist/commonjs/shared/translation/helpers.js +6 -22
  49. package/dist/commonjs/shared/translation/helpers.js.map +1 -1
  50. package/dist/commonjs/shared/translation/hooks.js +5 -3
  51. package/dist/commonjs/shared/translation/hooks.js.map +1 -1
  52. package/dist/commonjs/shared/translation/model.js +1 -1
  53. package/dist/commonjs/shared/translation/model.js.map +1 -1
  54. package/dist/commonjs/shared/translation/types.js +1 -1
  55. package/dist/commonjs/shared/translation/types.js.map +1 -1
  56. package/dist/module/features/celebrations/config.js +4 -4
  57. package/dist/module/features/celebrations/config.js.map +1 -1
  58. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js +1 -2
  59. package/dist/module/features/chatbot/components/Alternatives/Alternatives.js.map +1 -1
  60. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  61. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js +48 -31
  62. package/dist/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.js.map +1 -1
  63. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +43 -23
  64. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  65. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +13 -11
  66. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js.map +1 -1
  67. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js +32 -17
  68. package/dist/module/features/chatbot/components/ChatMessages/ChatbotMessages.js.map +1 -1
  69. package/dist/module/features/chatbot/components/Chatbot.js +8 -6
  70. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  71. package/dist/module/features/chatbot/index.js +1 -0
  72. package/dist/module/features/chatbot/index.js.map +1 -1
  73. package/dist/module/features/chatbot/model/{ChatBotThreadManager.js → ChatBotMessageHandler.js} +20 -42
  74. package/dist/module/features/chatbot/model/ChatBotMessageHandler.js.map +1 -0
  75. package/dist/module/features/chatbot/model/ChatBotModel.js +126 -147
  76. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  77. package/dist/module/features/chatbot/model/DefaultMessageCreator.js +12 -12
  78. package/dist/module/features/chatbot/model/DefaultMessageCreator.js.map +1 -1
  79. package/dist/module/features/chatbot/model/ThreadItem.js +8 -16
  80. package/dist/module/features/chatbot/model/ThreadItem.js.map +1 -1
  81. package/dist/module/features/chatbot/model/{ChatbotApi.js → api.js} +1 -2
  82. package/dist/module/features/chatbot/model/api.js.map +1 -0
  83. package/dist/module/features/chatbot/model/constants.js.map +1 -1
  84. package/dist/module/features/chatbot/model/messagesHelper.js +7 -7
  85. package/dist/module/features/chatbot/model/messagesHelper.js.map +1 -1
  86. package/dist/module/features/chatbot/model/t2s.js +14 -19
  87. package/dist/module/features/chatbot/model/t2s.js.map +1 -1
  88. package/dist/module/features/chatbot/model/translation.helpers.js.map +1 -1
  89. package/dist/module/features/chatbot/model/translation.js +19 -28
  90. package/dist/module/features/chatbot/model/translation.js.map +1 -1
  91. package/dist/module/features/chatbot/types/api.types.js +0 -2
  92. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  93. package/dist/module/features/endOfAssignment/ui/PracticeButtonGroup.js.map +1 -1
  94. package/dist/module/index.js.map +1 -1
  95. package/dist/module/lib/effector/createEntityFieldStore.js +0 -4
  96. package/dist/module/lib/effector/createEntityFieldStore.js.map +1 -1
  97. package/dist/module/{shared/translation → lib}/localization/en.json +1 -8
  98. package/dist/{commonjs/shared/translation → module/lib}/localization/gb.json +1 -8
  99. package/dist/module/{shared/translation → lib}/localization/sw.json +1 -8
  100. package/dist/module/shared/icons/icon.types.js +0 -2
  101. package/dist/module/shared/translation/constants.js +3 -3
  102. package/dist/module/shared/translation/constants.js.map +1 -1
  103. package/dist/module/shared/translation/helpers.js +5 -19
  104. package/dist/module/shared/translation/helpers.js.map +1 -1
  105. package/dist/module/shared/translation/hooks.js +6 -4
  106. package/dist/module/shared/translation/hooks.js.map +1 -1
  107. package/dist/module/shared/translation/model.js +1 -1
  108. package/dist/module/shared/translation/model.js.map +1 -1
  109. package/dist/module/shared/translation/types.js +0 -2
  110. package/dist/module/shared/translation/types.js.map +1 -1
  111. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
  112. package/dist/typescript/commonjs/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  113. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +10 -7
  114. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  115. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +7 -5
  116. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  117. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  118. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  119. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
  120. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
  121. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +10 -2
  122. package/dist/typescript/commonjs/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  123. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +5 -2
  124. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  125. package/dist/typescript/commonjs/features/chatbot/index.d.ts +3 -4
  126. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  127. package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts +31 -0
  128. package/dist/typescript/commonjs/features/chatbot/model/ChatBotMessageHandler.d.ts.map +1 -0
  129. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +18 -24
  130. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  131. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts +3 -5
  132. package/dist/typescript/commonjs/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  133. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts +7 -13
  134. package/dist/typescript/commonjs/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  135. package/dist/typescript/commonjs/features/chatbot/model/{ChatbotApi.d.ts → api.d.ts} +3 -4
  136. package/dist/typescript/commonjs/features/chatbot/model/api.d.ts.map +1 -0
  137. package/dist/typescript/commonjs/features/chatbot/model/constants.d.ts.map +1 -1
  138. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts +5 -7
  139. package/dist/typescript/commonjs/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  140. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +6 -16
  141. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +1 -1
  142. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts +9 -8
  143. package/dist/typescript/commonjs/features/chatbot/model/translation.d.ts.map +1 -1
  144. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts +1 -2
  145. package/dist/typescript/commonjs/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  146. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +11 -12
  147. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  148. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +24 -19
  149. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  150. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +7 -9
  151. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -1
  152. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts +2 -3
  153. package/dist/typescript/commonjs/features/chatbot/types/translation.types.d.ts.map +1 -1
  154. package/dist/typescript/commonjs/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
  155. package/dist/typescript/commonjs/index.d.ts +1 -0
  156. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  157. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts +0 -2
  158. package/dist/typescript/commonjs/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  159. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts +0 -2
  160. package/dist/typescript/commonjs/shared/icons/icon.types.d.ts.map +1 -1
  161. package/dist/typescript/commonjs/shared/translation/constants.d.ts +0 -21
  162. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  163. package/dist/typescript/commonjs/shared/translation/helpers.d.ts +2 -3
  164. package/dist/typescript/commonjs/shared/translation/helpers.d.ts.map +1 -1
  165. package/dist/typescript/commonjs/shared/translation/hooks.d.ts +2 -2
  166. package/dist/typescript/commonjs/shared/translation/hooks.d.ts.map +1 -1
  167. package/dist/typescript/commonjs/shared/translation/index.d.ts +1 -0
  168. package/dist/typescript/commonjs/shared/translation/index.d.ts.map +1 -1
  169. package/dist/typescript/commonjs/shared/translation/model.d.ts +3 -43
  170. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  171. package/dist/typescript/commonjs/shared/translation/types.d.ts +4 -4
  172. package/dist/typescript/commonjs/shared/translation/types.d.ts.map +1 -1
  173. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts +3 -1
  174. package/dist/typescript/module/features/chatbot/components/Alternatives/Alternatives.d.ts.map +1 -1
  175. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +10 -7
  176. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  177. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts +7 -5
  178. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageTextToSpeech.d.ts.map +1 -1
  179. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  180. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  181. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts +1 -1
  182. package/dist/typescript/module/features/chatbot/components/ChatMessage/SentMessage.d.ts.map +1 -1
  183. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts +10 -2
  184. package/dist/typescript/module/features/chatbot/components/ChatMessages/ChatbotMessages.d.ts.map +1 -1
  185. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +5 -2
  186. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  187. package/dist/typescript/module/features/chatbot/index.d.ts +3 -4
  188. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  189. package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts +31 -0
  190. package/dist/typescript/module/features/chatbot/model/ChatBotMessageHandler.d.ts.map +1 -0
  191. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +18 -24
  192. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  193. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts +3 -5
  194. package/dist/typescript/module/features/chatbot/model/DefaultMessageCreator.d.ts.map +1 -1
  195. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts +7 -13
  196. package/dist/typescript/module/features/chatbot/model/ThreadItem.d.ts.map +1 -1
  197. package/dist/typescript/module/features/chatbot/model/{ChatbotApi.d.ts → api.d.ts} +3 -4
  198. package/dist/typescript/module/features/chatbot/model/api.d.ts.map +1 -0
  199. package/dist/typescript/module/features/chatbot/model/constants.d.ts.map +1 -1
  200. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts +5 -7
  201. package/dist/typescript/module/features/chatbot/model/messagesHelper.d.ts.map +1 -1
  202. package/dist/typescript/module/features/chatbot/model/t2s.d.ts +6 -16
  203. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +1 -1
  204. package/dist/typescript/module/features/chatbot/model/translation.d.ts +9 -8
  205. package/dist/typescript/module/features/chatbot/model/translation.d.ts.map +1 -1
  206. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts +1 -2
  207. package/dist/typescript/module/features/chatbot/model/translation.helpers.d.ts.map +1 -1
  208. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +11 -12
  209. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  210. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +24 -19
  211. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  212. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +7 -9
  213. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -1
  214. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts +2 -3
  215. package/dist/typescript/module/features/chatbot/types/translation.types.d.ts.map +1 -1
  216. package/dist/typescript/module/features/endOfAssignment/ui/PracticeButtonGroup.d.ts.map +1 -1
  217. package/dist/typescript/module/index.d.ts +1 -0
  218. package/dist/typescript/module/index.d.ts.map +1 -1
  219. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts +0 -2
  220. package/dist/typescript/module/lib/effector/createEntityFieldStore.d.ts.map +1 -1
  221. package/dist/typescript/module/shared/icons/icon.types.d.ts +0 -2
  222. package/dist/typescript/module/shared/icons/icon.types.d.ts.map +1 -1
  223. package/dist/typescript/module/shared/translation/constants.d.ts +0 -21
  224. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  225. package/dist/typescript/module/shared/translation/helpers.d.ts +2 -3
  226. package/dist/typescript/module/shared/translation/helpers.d.ts.map +1 -1
  227. package/dist/typescript/module/shared/translation/hooks.d.ts +2 -2
  228. package/dist/typescript/module/shared/translation/hooks.d.ts.map +1 -1
  229. package/dist/typescript/module/shared/translation/index.d.ts +1 -0
  230. package/dist/typescript/module/shared/translation/index.d.ts.map +1 -1
  231. package/dist/typescript/module/shared/translation/model.d.ts +3 -43
  232. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  233. package/dist/typescript/module/shared/translation/types.d.ts +4 -4
  234. package/dist/typescript/module/shared/translation/types.d.ts.map +1 -1
  235. package/package.json +2 -2
  236. package/src/features/celebrations/config.ts +4 -4
  237. package/src/features/chatbot/components/Alternatives/Alternatives.tsx +4 -2
  238. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +10 -7
  239. package/src/features/chatbot/components/ChatMessage/MessageTextToSpeech.tsx +51 -34
  240. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +40 -15
  241. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +10 -9
  242. package/src/features/chatbot/components/ChatMessages/ChatbotMessages.tsx +34 -17
  243. package/src/features/chatbot/components/Chatbot.tsx +11 -5
  244. package/src/features/chatbot/index.ts +4 -3
  245. package/src/features/chatbot/model/{ChatBotThreadManager.ts → ChatBotMessageHandler.ts} +27 -53
  246. package/src/features/chatbot/model/ChatBotModel.ts +149 -151
  247. package/src/features/chatbot/model/DefaultMessageCreator.ts +16 -17
  248. package/src/features/chatbot/model/ThreadItem.ts +10 -15
  249. package/src/features/chatbot/model/{ChatbotApi.ts → api.ts} +2 -5
  250. package/src/features/chatbot/model/constants.ts +0 -2
  251. package/src/features/chatbot/model/messagesHelper.ts +7 -12
  252. package/src/features/chatbot/model/t2s.ts +13 -28
  253. package/src/features/chatbot/model/translation.helpers.ts +1 -2
  254. package/src/features/chatbot/model/translation.ts +24 -34
  255. package/src/features/chatbot/types/api.types.ts +12 -12
  256. package/src/features/chatbot/types/model.types.ts +32 -31
  257. package/src/features/chatbot/types/t2s.types.ts +15 -18
  258. package/src/features/chatbot/types/translation.types.ts +2 -3
  259. package/src/features/endOfAssignment/ui/PracticeButtonGroup.tsx +1 -0
  260. package/src/index.ts +1 -0
  261. package/src/lib/effector/createEntityFieldStore.ts +1 -9
  262. package/{dist/commonjs/shared/translation → src/lib}/localization/en.json +1 -8
  263. package/src/{shared/translation → lib}/localization/gb.json +1 -8
  264. package/src/{shared/translation → lib}/localization/sw.json +1 -8
  265. package/src/shared/icons/icon.types.ts +6 -9
  266. package/src/shared/translation/constants.ts +3 -3
  267. package/src/shared/translation/helpers.ts +9 -22
  268. package/src/shared/translation/hooks.ts +16 -12
  269. package/src/shared/translation/index.ts +1 -0
  270. package/src/shared/translation/model.ts +8 -8
  271. package/src/shared/translation/types.ts +8 -11
  272. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +0 -44
  273. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +0 -1
  274. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +0 -62
  275. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +0 -1
  276. package/dist/commonjs/features/chatbot/components/ChatMessage/helpers.js +0 -13
  277. package/dist/commonjs/features/chatbot/components/ChatMessage/helpers.js.map +0 -1
  278. package/dist/commonjs/features/chatbot/context/ChatBotModelContext.js +0 -17
  279. package/dist/commonjs/features/chatbot/context/ChatBotModelContext.js.map +0 -1
  280. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js +0 -57
  281. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +0 -1
  282. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js +0 -130
  283. package/dist/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +0 -1
  284. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +0 -1
  285. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js +0 -22
  286. package/dist/commonjs/features/chatbot/model/ChatBoxTextManager.js.map +0 -1
  287. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +0 -1
  288. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +0 -110
  289. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +0 -1
  290. package/dist/commonjs/features/chatbot/types/units.types.js +0 -2
  291. package/dist/commonjs/features/chatbot/types/units.types.js.map +0 -1
  292. package/dist/commonjs/lib/effector/withEvent.js +0 -13
  293. package/dist/commonjs/lib/effector/withEvent.js.map +0 -1
  294. package/dist/commonjs/lib/types/keys.js +0 -2
  295. package/dist/commonjs/lib/types/keys.js.map +0 -1
  296. package/dist/commonjs/shared/icons/HighlighterIcon.js +0 -36
  297. package/dist/commonjs/shared/icons/HighlighterIcon.js.map +0 -1
  298. package/dist/commonjs/shared/icons/StopIcon.js +0 -33
  299. package/dist/commonjs/shared/icons/StopIcon.js.map +0 -1
  300. package/dist/commonjs/shared/translation/validation.types.js +0 -6
  301. package/dist/commonjs/shared/translation/validation.types.js.map +0 -1
  302. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js +0 -38
  303. package/dist/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.js.map +0 -1
  304. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +0 -57
  305. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +0 -1
  306. package/dist/module/features/chatbot/components/ChatMessage/helpers.js +0 -9
  307. package/dist/module/features/chatbot/components/ChatMessage/helpers.js.map +0 -1
  308. package/dist/module/features/chatbot/context/ChatBotModelContext.js +0 -12
  309. package/dist/module/features/chatbot/context/ChatBotModelContext.js.map +0 -1
  310. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js +0 -51
  311. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingButton.js.map +0 -1
  312. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js +0 -125
  313. package/dist/module/features/chatbot/errorSpotting/ErrorSpottingModel.js.map +0 -1
  314. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +0 -1
  315. package/dist/module/features/chatbot/model/ChatBoxTextManager.js +0 -17
  316. package/dist/module/features/chatbot/model/ChatBoxTextManager.js.map +0 -1
  317. package/dist/module/features/chatbot/model/ChatbotApi.js.map +0 -1
  318. package/dist/module/features/chatbot/model/ChatsCacheModel.js +0 -104
  319. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +0 -1
  320. package/dist/module/features/chatbot/types/units.types.js +0 -2
  321. package/dist/module/features/chatbot/types/units.types.js.map +0 -1
  322. package/dist/module/lib/effector/withEvent.js +0 -9
  323. package/dist/module/lib/effector/withEvent.js.map +0 -1
  324. package/dist/module/lib/types/keys.js +0 -2
  325. package/dist/module/lib/types/keys.js.map +0 -1
  326. package/dist/module/shared/icons/HighlighterIcon.js +0 -29
  327. package/dist/module/shared/icons/HighlighterIcon.js.map +0 -1
  328. package/dist/module/shared/icons/StopIcon.js +0 -26
  329. package/dist/module/shared/icons/StopIcon.js.map +0 -1
  330. package/dist/module/shared/translation/validation.types.js +0 -4
  331. package/dist/module/shared/translation/validation.types.js.map +0 -1
  332. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +0 -10
  333. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +0 -1
  334. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts +0 -11
  335. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +0 -1
  336. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/helpers.d.ts +0 -4
  337. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/helpers.d.ts.map +0 -1
  338. package/dist/typescript/commonjs/features/chatbot/context/ChatBotModelContext.d.ts +0 -4
  339. package/dist/typescript/commonjs/features/chatbot/context/ChatBotModelContext.d.ts.map +0 -1
  340. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +0 -8
  341. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +0 -1
  342. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +0 -35
  343. package/dist/typescript/commonjs/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +0 -1
  344. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +0 -33
  345. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +0 -1
  346. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts +0 -6
  347. package/dist/typescript/commonjs/features/chatbot/model/ChatBoxTextManager.d.ts.map +0 -1
  348. package/dist/typescript/commonjs/features/chatbot/model/ChatbotApi.d.ts.map +0 -1
  349. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +0 -27
  350. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +0 -1
  351. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +0 -34
  352. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +0 -1
  353. package/dist/typescript/commonjs/lib/effector/withEvent.d.ts +0 -2
  354. package/dist/typescript/commonjs/lib/effector/withEvent.d.ts.map +0 -1
  355. package/dist/typescript/commonjs/lib/types/keys.d.ts +0 -8
  356. package/dist/typescript/commonjs/lib/types/keys.d.ts.map +0 -1
  357. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts +0 -4
  358. package/dist/typescript/commonjs/shared/icons/HighlighterIcon.d.ts.map +0 -1
  359. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts +0 -4
  360. package/dist/typescript/commonjs/shared/icons/StopIcon.d.ts.map +0 -1
  361. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts +0 -17
  362. package/dist/typescript/commonjs/shared/translation/validation.types.d.ts.map +0 -1
  363. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts +0 -10
  364. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageButtonsBlock.d.ts.map +0 -1
  365. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts +0 -11
  366. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +0 -1
  367. package/dist/typescript/module/features/chatbot/components/ChatMessage/helpers.d.ts +0 -4
  368. package/dist/typescript/module/features/chatbot/components/ChatMessage/helpers.d.ts.map +0 -1
  369. package/dist/typescript/module/features/chatbot/context/ChatBotModelContext.d.ts +0 -4
  370. package/dist/typescript/module/features/chatbot/context/ChatBotModelContext.d.ts.map +0 -1
  371. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts +0 -8
  372. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingButton.d.ts.map +0 -1
  373. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts +0 -35
  374. package/dist/typescript/module/features/chatbot/errorSpotting/ErrorSpottingModel.d.ts.map +0 -1
  375. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +0 -33
  376. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +0 -1
  377. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts +0 -6
  378. package/dist/typescript/module/features/chatbot/model/ChatBoxTextManager.d.ts.map +0 -1
  379. package/dist/typescript/module/features/chatbot/model/ChatbotApi.d.ts.map +0 -1
  380. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +0 -27
  381. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +0 -1
  382. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +0 -34
  383. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +0 -1
  384. package/dist/typescript/module/lib/effector/withEvent.d.ts +0 -2
  385. package/dist/typescript/module/lib/effector/withEvent.d.ts.map +0 -1
  386. package/dist/typescript/module/lib/types/keys.d.ts +0 -8
  387. package/dist/typescript/module/lib/types/keys.d.ts.map +0 -1
  388. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts +0 -4
  389. package/dist/typescript/module/shared/icons/HighlighterIcon.d.ts.map +0 -1
  390. package/dist/typescript/module/shared/icons/StopIcon.d.ts +0 -4
  391. package/dist/typescript/module/shared/icons/StopIcon.d.ts.map +0 -1
  392. package/dist/typescript/module/shared/translation/validation.types.d.ts +0 -17
  393. package/dist/typescript/module/shared/translation/validation.types.d.ts.map +0 -1
  394. package/src/features/chatbot/components/ChatMessage/MessageButtonsBlock.tsx +0 -38
  395. package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +0 -52
  396. package/src/features/chatbot/components/ChatMessage/helpers.ts +0 -9
  397. package/src/features/chatbot/context/ChatBotModelContext.ts +0 -14
  398. package/src/features/chatbot/errorSpotting/ErrorSpottingButton.tsx +0 -53
  399. package/src/features/chatbot/errorSpotting/ErrorSpottingModel.ts +0 -150
  400. package/src/features/chatbot/model/ChatBoxTextManager.ts +0 -18
  401. package/src/features/chatbot/model/ChatsCacheModel.ts +0 -95
  402. package/src/features/chatbot/types/units.types.ts +0 -37
  403. package/src/lib/effector/withEvent.ts +0 -7
  404. package/src/lib/types/keys.ts +0 -18
  405. package/src/shared/icons/HighlighterIcon.tsx +0 -21
  406. package/src/shared/icons/StopIcon.tsx +0 -17
  407. package/src/shared/translation/validation.types.ts +0 -26
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC/F,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA"}
@@ -1,4 +1,3 @@
1
- import { Event } from 'effector';
2
1
  type UpdateField<T> = {
3
2
  key: string;
4
3
  } & ({
@@ -12,7 +11,6 @@ export declare class EntityFieldStore<T> {
12
11
  readonly setField: import("effector").EventCallable<UpdateField<T>>;
13
12
  readonly reset: import("effector").EventCallable<void>;
14
13
  readonly $state: import("effector").StoreWritable<Record<string, T>>;
15
- on<EV>(event: Event<EV>, fn: (state: Record<string, T>, payload: EV) => Record<string, T> | void): this;
16
14
  }
17
15
  export declare function createEntityFieldStore<T>(): EntityFieldStore<T>;
18
16
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"createEntityFieldStore.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createEntityFieldStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,EAAE,MAAM,UAAU,CAAA;AAE1D,KAAK,WAAW,CAAC,CAAC,IAAI;IACpB,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,CAAC;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAEnF,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,SAAgB,QAAQ,mDAAgC;IACxD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,MAAM,sDAUF;IAEb,EAAE,CAAC,EAAE,EACV,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAChB,EAAE,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,IAAI;CAK1E;AAED,wBAAgB,sBAAsB,CAAC,CAAC,yBAEvC"}
1
+ {"version":3,"file":"createEntityFieldStore.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createEntityFieldStore.ts"],"names":[],"mappings":"AAEA,KAAK,WAAW,CAAC,CAAC,IAAI;IACpB,GAAG,EAAE,MAAM,CAAA;CACZ,GAAG,CAAC;IAAE,IAAI,EAAE,CAAC,CAAC;IAAC,EAAE,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,KAAK,CAAC,GAAG,IAAI,CAAA;CAAE,CAAC,CAAA;AAEnF,qBAAa,gBAAgB,CAAC,CAAC;IAC7B,SAAgB,QAAQ,mDAAgC;IACxD,SAAgB,KAAK,yCAAgB;IAErC,SAAgB,MAAM,sDAUF;CACrB;AAED,wBAAgB,sBAAsB,CAAC,CAAC,yBAEvC"}
@@ -1,4 +1,3 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
1
  export type IconProps = {
3
2
  color?: string;
4
3
  className?: string;
@@ -6,6 +5,5 @@ export type IconProps = {
6
5
  strokeWidth?: string;
7
6
  width?: number;
8
7
  height?: number;
9
- style?: StyleProp<ViewStyle>;
10
8
  };
11
9
  //# sourceMappingURL=icon.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icon.types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B,CAAA"}
1
+ {"version":3,"file":"icon.types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/icon.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA"}
@@ -12,13 +12,6 @@ export declare const LOCALIZATION_CONFIGS: {
12
12
  "time.monthsAgo": string;
13
13
  "time.yearAgo": string;
14
14
  "time.yearsAgo": string;
15
- chat: {
16
- anotherHint: string;
17
- answerAgain: string;
18
- errorMessage: string;
19
- howCanIHelp: string;
20
- showError: string;
21
- };
22
15
  };
23
16
  "en-GB": {
24
17
  "teacherFeedback.noComments": string;
@@ -33,13 +26,6 @@ export declare const LOCALIZATION_CONFIGS: {
33
26
  "time.monthsAgo": string;
34
27
  "time.yearAgo": string;
35
28
  "time.yearsAgo": string;
36
- chat: {
37
- anotherHint: string;
38
- answerAgain: string;
39
- errorMessage: string;
40
- howCanIHelp: string;
41
- showError: string;
42
- };
43
29
  };
44
30
  "sv-SE": {
45
31
  "teacherFeedback.noComments": string;
@@ -54,13 +40,6 @@ export declare const LOCALIZATION_CONFIGS: {
54
40
  "time.monthsAgo": string;
55
41
  "time.yearAgo": string;
56
42
  "time.yearsAgo": string;
57
- chat: {
58
- anotherHint: string;
59
- answerAgain: string;
60
- errorMessage: string;
61
- howCanIHelp: string;
62
- showError: string;
63
- };
64
43
  };
65
44
  };
66
45
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhC,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIhC,CAAA"}
@@ -1,7 +1,6 @@
1
1
  import { LOCALIZATION_CONFIGS } from './constants';
2
- import { GetText, TranslationKeys, Translations } from './types';
3
- export declare function getTranslation(config: Translations, key: TranslationKeys): string;
2
+ import { GetText, LocalizationConfig } from './types';
4
3
  export declare const getSubstitutedString: (str: string, substitutions?: Record<string, string>) => string;
5
4
  export declare const getText: GetText;
6
- export declare const setFeaturesLocalization: (generator: ((config: typeof LOCALIZATION_CONFIGS) => Translations) | Translations) => void;
5
+ export declare const setFeaturesLocalization: (generator: ((config: typeof LOCALIZATION_CONFIGS) => LocalizationConfig) | LocalizationConfig) => void;
7
6
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEhE,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,UAexE;AAED,eAAO,MAAM,oBAAoB,QAAS,MAAM,kBAAiB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAWtF,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,OAMrB,CAAA;AAED,eAAO,MAAM,uBAAuB,cACvB,CAAC,CAAC,MAAM,EAAE,OAAO,oBAAoB,KAAK,YAAY,CAAC,GAAG,YAAY,SAGlF,CAAA"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAmB,MAAM,SAAS,CAAA;AAEtE,eAAO,MAAM,oBAAoB,QAAS,MAAM,kBAAiB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,WAWtF,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,OAUrB,CAAA;AAED,eAAO,MAAM,uBAAuB,cACvB,CAAC,CAAC,MAAM,EAAE,OAAO,oBAAoB,KAAK,kBAAkB,CAAC,GAAG,kBAAkB,SAG9F,CAAA"}
@@ -1,5 +1,5 @@
1
- import { GetText, Translations } from './types';
1
+ import { GetText, LocalizationConfig } from './types';
2
2
  import { LOCALIZATION_CONFIGS } from './constants';
3
3
  export declare const useText: () => GetText;
4
- export declare const useFeaturesLocalization: (generator: ((config: typeof LOCALIZATION_CONFIGS) => Translations) | Translations) => void;
4
+ export declare const useFeaturesLocalization: (generator: ((config: typeof LOCALIZATION_CONFIGS) => LocalizationConfig) | LocalizationConfig) => void;
5
5
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,OAAO,QAAO,OAQ1B,CAAA;AAED,eAAO,MAAM,uBAAuB,cACvB,CAAC,CAAC,MAAM,EAAE,OAAO,oBAAoB,KAAK,YAAY,CAAC,GAAG,YAAY,SAKlF,CAAA"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/hooks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAGlD,eAAO,MAAM,OAAO,QAAO,OAY1B,CAAA;AAED,eAAO,MAAM,uBAAuB,cACrB,CAAC,CAAC,MAAM,EAAE,OAAO,oBAAoB,KAAK,kBAAkB,CAAC,GAAG,kBAAkB,SAKhG,CAAA"}
@@ -2,4 +2,5 @@ export { useFeaturesLocalization, useText } from './hooks';
2
2
  export { setFeaturesLocalization, getText as t } from './helpers';
3
3
  export { $localization, setLocalization } from './model';
4
4
  export { Locale } from './types';
5
+ export type { LocalizationConfig } from './types';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC1D,OAAO,EAAE,uBAAuB,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA"}
@@ -1,45 +1,5 @@
1
- import { Translations } from './types';
1
+ import { LocalizationConfig } from './types';
2
2
  import { LOCALIZATION_CONFIGS } from './constants';
3
- export declare const setLocalization: import("effector").EventCallable<{
4
- "teacherFeedback.noComments": string;
5
- "time.justNow": string;
6
- "time.minuteAgo": string;
7
- "time.minutesAgo": string;
8
- "time.hourAgo": string;
9
- "time.hoursAgo": string;
10
- "time.dayAgo": string;
11
- "time.daysAgo": string;
12
- "time.monthAgo": string;
13
- "time.monthsAgo": string;
14
- "time.yearAgo": string;
15
- "time.yearsAgo": string;
16
- chat: {
17
- anotherHint: string;
18
- answerAgain: string;
19
- errorMessage: string;
20
- howCanIHelp: string;
21
- showError: string;
22
- };
23
- } | ((config: typeof LOCALIZATION_CONFIGS) => Translations)>;
24
- export declare const $localization: import("effector").StoreWritable<{
25
- "teacherFeedback.noComments": string;
26
- "time.justNow": string;
27
- "time.minuteAgo": string;
28
- "time.minutesAgo": string;
29
- "time.hourAgo": string;
30
- "time.hoursAgo": string;
31
- "time.dayAgo": string;
32
- "time.daysAgo": string;
33
- "time.monthAgo": string;
34
- "time.monthsAgo": string;
35
- "time.yearAgo": string;
36
- "time.yearsAgo": string;
37
- chat: {
38
- anotherHint: string;
39
- answerAgain: string;
40
- errorMessage: string;
41
- howCanIHelp: string;
42
- showError: string;
43
- };
44
- }>;
3
+ export declare const setLocalization: import("effector").EventCallable<LocalizationConfig | ((config: typeof LOCALIZATION_CONFIGS) => LocalizationConfig)>;
4
+ export declare const $localization: import("effector").StoreWritable<LocalizationConfig>;
45
5
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,YAAY,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;cACD,OAAO,oBAAoB,KAAK,YAAY,EACpE,CAAA;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;EAMzB,CAAA"}
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/model.ts"],"names":[],"mappings":"AACA,OAAO,EAAU,kBAAkB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe,kEACO,OAAO,oBAAoB,KAAK,kBAAkB,EAClF,CAAA;AAEH,eAAO,MAAM,aAAa,sDAMzB,CAAA"}
@@ -1,11 +1,11 @@
1
- import enTranslations from './localization/en.json';
2
- import { RetrieveKeys } from '../../lib/types/keys';
1
+ import enTranslations from '../../lib/localization/en.json';
3
2
  export type Translations = typeof enTranslations;
4
- export type TranslationKeys = RetrieveKeys<Translations>;
5
- export type GetText = (key: TranslationKeys, args?: Record<string, string> | null) => string;
3
+ export type TranslationKeys = keyof Translations;
4
+ export type GetText = <T extends TranslationKeys>(key: T, args?: Record<string, string> | null) => Translations[T];
6
5
  export declare enum Locale {
7
6
  EN = "en-SE",
8
7
  SW = "sv-SE",
9
8
  GB = "en-GB"
10
9
  }
10
+ export type LocalizationConfig = Record<string, string>;
11
11
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,wBAAwB,CAAA;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAA;AAChD,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAAK,MAAM,CAAA;AAE5F,oBAAY,MAAM;IAChB,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/types.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,gCAAgC,CAAA;AAE3D,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAA;AAChD,MAAM,MAAM,eAAe,GAAG,MAAM,YAAY,CAAA;AAEhD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,SAAS,eAAe,EAC9C,GAAG,EAAE,CAAC,EACN,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KACjC,YAAY,CAAC,CAAC,CAAC,CAAA;AAEpB,oBAAY,MAAM;IAChB,EAAE,UAAU;IACZ,EAAE,UAAU;IACZ,EAAE,UAAU;CACb;AAED,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.5.0",
3
+ "version": "0.5.1-rc-1",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -29,7 +29,7 @@
29
29
  "react-native-svg": "^15.10.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@magmamath/react-native-ui": "0.4.0",
32
+ "@magmamath/react-native-ui": "0.3.22",
33
33
  "@react-native/eslint-config": "^0.73.1",
34
34
  "@release-it/conventional-changelog": "^9.0.2",
35
35
  "@types/jest": "^29.5.5",
@@ -181,10 +181,10 @@ export const CELEBRATION_VARIANTS = {
181
181
  },
182
182
  speedRange: {
183
183
  spark: [14, 28],
184
- main: [6, 18],
184
+ main: [12, 24],
185
185
  },
186
186
  life: 100,
187
- gravity: 0.1,
187
+ gravity: 0.19,
188
188
  },
189
189
  [CelebrationVariant.CORRECT_FINISH_ASSIGNMENT]: {
190
190
  color: COLORS.PRIMARY_GREEN,
@@ -216,9 +216,9 @@ export const CELEBRATION_VARIANTS = {
216
216
  },
217
217
  speedRange: {
218
218
  spark: [14, 28],
219
- main: [6, 18],
219
+ main: [12, 24],
220
220
  },
221
221
  life: 100,
222
- gravity: 0.1,
222
+ gravity: 0.19,
223
223
  },
224
224
  }
@@ -1,21 +1,23 @@
1
1
  import React from 'react'
2
2
  import { StyleSheet, View } from 'react-native'
3
3
  import { useStoreMap, useUnit } from 'effector-react'
4
+
5
+ import { ChatbotModel } from '../../model/ChatBotModel'
4
6
  import { HelpRequestOption } from './HelpRequestOption'
5
- import { useChatModel } from '../../context/ChatBotModelContext'
6
7
 
7
8
  type AlternativesProps = {
9
+ model: ChatbotModel
8
10
  onPressAlternative: (message: string, translatedMessage?: string) => void
9
11
  hasMessages: boolean
10
12
  isHintFeedback: boolean
11
13
  }
12
14
 
13
15
  export const Alternatives = ({
16
+ model,
14
17
  onPressAlternative,
15
18
  hasMessages,
16
19
  isHintFeedback,
17
20
  }: AlternativesProps) => {
18
- const model = useChatModel()
19
21
  const isTranslated = useUnit(model.translation.$isTranslated)
20
22
  const alternatives = useUnit(model.$alternatives)
21
23
  const isTranslationPending = useUnit(model.translation.translateAllMessagesFx.pending)
@@ -1,15 +1,18 @@
1
- import React, { ComponentType } from 'react'
1
+ import React, { ComponentType, ReactNode } from 'react'
2
2
  import { ReceivedMessage } from './ReceivedMessage'
3
3
  import { SentMessage } from './SentMessage'
4
- import { T2SState } from '../../types/t2s.types'
5
- import { MessageVariant } from '../../types/model.types'
6
- import { ConversationMessage } from '../../types/units.types'
4
+ import { AudioStatus } from '../../types/t2s.types'
5
+ import { MessageVariant, ChatbotRenderer } from '../../types/model.types'
7
6
 
8
7
  type ChatMessageProps = {
9
8
  variant: MessageVariant
10
- message: ConversationMessage
11
- isTranslated?: boolean
12
- t2sState: T2SState
9
+ message: string
10
+ onPressTextToSpeech: () => void
11
+ isTextToSpeechPending: boolean
12
+ isActive: boolean
13
+ withTextToSpeech?: boolean
14
+ audioStatus: AudioStatus
15
+ renderer?: (props: ChatbotRenderer) => ReactNode
13
16
  }
14
17
 
15
18
  export type VariantProps = Omit<ChatMessageProps, 'variant'>
@@ -1,12 +1,9 @@
1
1
  import React from 'react'
2
- import { ActivityIndicator } from 'react-native'
2
+ import { ActivityIndicator, Pressable, StyleSheet, TouchableOpacity } from 'react-native'
3
3
  import { SpeakerIcon } from '../../../../shared/icons/SpeakerIcon'
4
4
  import { PlayIcon } from '../../../../shared/icons/PlayIcon'
5
5
  import { PauseIcon } from '../../../../shared/icons/PauseIcon'
6
- import { AudioStatus, T2SState } from '../../types/t2s.types'
7
- import { useChatModel } from '../../context/ChatBotModelContext'
8
- import { ConversationMessage } from '../../types/units.types'
9
- import { Button, COLORS } from '@magmamath/react-native-ui'
6
+ import { AudioStatus } from '../../types/t2s.types'
10
7
 
11
8
  type TextToSpeechIconProps = {
12
9
  status: AudioStatus
@@ -20,41 +17,61 @@ const TextToSpeechIcon = ({ status, isActive, isLoading }: TextToSpeechIconProps
20
17
  }
21
18
 
22
19
  if (!isActive) {
23
- return <SpeakerIcon color={isActive ? COLORS.PRIMARY_BLUE : undefined} />
20
+ return <SpeakerIcon color={isActive ? '#55ABE0' : undefined} />
24
21
  }
25
22
 
26
- if (status === 'playing') return <PauseIcon color={COLORS.NEUTRAL_1} />
27
- if (status === 'paused') return <PlayIcon color={COLORS.NEUTRAL_1} />
28
- return <SpeakerIcon color={isActive ? COLORS.PRIMARY_BLUE : undefined} />
23
+ if (status === 'playing') return <PauseIcon color="#FFF" />
24
+ if (status === 'paused') return <PlayIcon color="#FFF" />
25
+ return <SpeakerIcon color={isActive ? '#55ABE0' : undefined} />
29
26
  }
30
27
 
31
28
  type MessageTextToSpeechProps = {
32
- state: T2SState
33
- message: ConversationMessage
29
+ status: AudioStatus
30
+ disabled: boolean
31
+ isActive: boolean
32
+ isLoading: boolean
33
+ onPress: () => void
34
34
  }
35
35
 
36
36
  export const MessageTextToSpeech = ({
37
- state: { status, disabled, isActive, isLoading },
38
- message,
39
- }: MessageTextToSpeechProps) => {
40
- const model = useChatModel()
41
-
42
- function play() {
43
- void model.t2s.play({
44
- isTranslated: model.translation.$isTranslated.getState(),
45
- message,
46
- })
47
- }
48
-
49
- return (
50
- <Button
37
+ status,
38
+ disabled,
39
+ isActive,
40
+ isLoading,
41
+ onPress,
42
+ }: MessageTextToSpeechProps) => (
43
+ <TouchableOpacity style={styles.container} onPress={onPress}>
44
+ <Pressable
51
45
  disabled={disabled}
52
- isActive={isActive}
53
- variant={'secondary'}
54
- colorScheme={'blue'}
55
- size={'small'}
56
- onPress={play}
57
- icon={<TextToSpeechIcon isActive={isActive} isLoading={isLoading} status={status} />}
58
- />
59
- )
60
- }
46
+ onPress={onPress}
47
+ style={[styles.button, { backgroundColor: isActive && !isLoading ? '#55ABE0' : '#FFF' }]}
48
+ >
49
+ <TextToSpeechIcon isActive={isActive} isLoading={isLoading} status={status} />
50
+ </Pressable>
51
+ </TouchableOpacity>
52
+ )
53
+
54
+ const styles = StyleSheet.create({
55
+ container: {
56
+ alignSelf: 'stretch',
57
+ justifyContent: 'flex-end',
58
+ width: 45,
59
+ },
60
+ button: {
61
+ alignItems: 'center',
62
+ justifyContent: 'center',
63
+ width: 28,
64
+ height: 28,
65
+ padding: 1,
66
+ marginLeft: 'auto',
67
+ shadowColor: '#333',
68
+ shadowOffset: { width: 0, height: 1 },
69
+ shadowOpacity: 0.25,
70
+ shadowRadius: 3,
71
+ elevation: 3,
72
+ borderRadius: 6,
73
+ borderColor: '#F2F2F4',
74
+ borderWidth: 0.5,
75
+ backgroundColor: '#FFF',
76
+ },
77
+ })
@@ -1,24 +1,42 @@
1
1
  import React from 'react'
2
- import { StyleSheet, View } from 'react-native'
2
+ import { StyleSheet, Text, View } from 'react-native'
3
3
  import { VariantProps } from './ChatMessage'
4
4
  import { ChatbotIcon } from '../../../../shared/icons/ChatbotIcon'
5
- import { MessageContent } from './MessageContent'
5
+ import { MessageTextToSpeech } from './MessageTextToSpeech'
6
+ import { MessageVariant } from '../../types/model.types'
6
7
 
7
- export const ReceivedMessage = ({ message, isTranslated, t2sState }: VariantProps) => {
8
- const text = isTranslated ? message.translatedMessage : message.message
9
-
10
- return (
11
- <View style={styles.container}>
12
- <View style={styles.icon}>
13
- <ChatbotIcon width={60} height={80} />
14
- </View>
8
+ export const ReceivedMessage = ({
9
+ message,
10
+ onPressTextToSpeech,
11
+ isTextToSpeechPending,
12
+ isActive,
13
+ audioStatus,
14
+ renderer,
15
+ withTextToSpeech = true,
16
+ }: VariantProps) => (
17
+ <View style={styles.container}>
18
+ <View style={styles.icon}>
19
+ <ChatbotIcon width={60} height={80} />
20
+ </View>
15
21
 
16
- <View style={styles.message}>
17
- <MessageContent message={message} t2sState={t2sState} text={text ?? ''} />
18
- </View>
22
+ <View style={styles.message}>
23
+ <Text style={[styles.messageText, { width: withTextToSpeech ? 240 : 305 }]}>
24
+ {renderer
25
+ ? renderer({ message, variant: MessageVariant.RECEIVED, withTextToSpeech })
26
+ : message}
27
+ </Text>
28
+ {withTextToSpeech && (
29
+ <MessageTextToSpeech
30
+ isActive={isActive}
31
+ isLoading={isTextToSpeechPending}
32
+ onPress={onPressTextToSpeech}
33
+ disabled={isTextToSpeechPending}
34
+ status={audioStatus}
35
+ />
36
+ )}
19
37
  </View>
20
- )
21
- }
38
+ </View>
39
+ )
22
40
 
23
41
  const styles = StyleSheet.create({
24
42
  container: {
@@ -46,4 +64,11 @@ const styles = StyleSheet.create({
46
64
  borderBottomLeftRadius: 0,
47
65
  backgroundColor: '#F2F2F4',
48
66
  },
67
+ messageText: {
68
+ flex: 1,
69
+ fontSize: 20,
70
+ fontWeight: 400,
71
+ fontFamily: 'Buenos Aires',
72
+ color: '#33334D',
73
+ },
49
74
  })
@@ -1,16 +1,17 @@
1
1
  import React from 'react'
2
2
  import { StyleSheet, Text, View } from 'react-native'
3
3
  import { VariantProps } from './ChatMessage'
4
+ import { MessageVariant } from '../../types/model.types'
4
5
 
5
- export const SentMessage = React.memo(({ message, isTranslated }: VariantProps) => {
6
- const text = isTranslated ? message.translatedMessage : message.message
7
-
8
- return (
9
- <View style={styles.container}>
10
- <Text style={styles.text}>{text}</Text>
11
- </View>
12
- )
13
- })
6
+ export const SentMessage = ({ message, renderer }: VariantProps) => (
7
+ <View style={styles.container}>
8
+ <Text style={styles.text}>
9
+ {renderer
10
+ ? renderer({ message, variant: MessageVariant.SENT, withTextToSpeech: false })
11
+ : message}
12
+ </Text>
13
+ </View>
14
+ )
14
15
 
15
16
  const styles = StyleSheet.create({
16
17
  container: {
@@ -1,16 +1,23 @@
1
- import React, { useRef } from 'react'
1
+ import React, { ReactNode, useRef } from 'react'
2
2
  import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native'
3
3
  import { useStoreMap, useUnit } from 'effector-react'
4
4
  import { ChatbotModel } from '../../model/ChatBotModel'
5
5
  import { ChatMessage } from '../ChatMessage/ChatMessage'
6
6
  import { MessageLoader } from '../ChatMessage/MessageLoader'
7
7
  import { Alternatives } from '../Alternatives/Alternatives'
8
- import { MessageVariant } from '../../types/model.types'
8
+ import { AUDIO_CONFIG, DEFAULT_VOICE, TEXT_TO_SPEECH_CONFIG } from '../../constants'
9
+ import { MessageVariant, ChatbotRenderer } from '../../types/model.types'
9
10
 
10
11
  type ChatbotMessagesProps = {
11
12
  model: ChatbotModel
12
13
  isHintFeedback: boolean
14
+ sanitizeSpeechInput: (speech: string) => string
13
15
  isTextToSpeechEnabled: boolean
16
+ textToSpeechConfig?: {
17
+ voice: typeof DEFAULT_VOICE
18
+ audioConfig: typeof AUDIO_CONFIG
19
+ }
20
+ renderer?: (props: ChatbotRenderer) => ReactNode
14
21
  }
15
22
 
16
23
  const TOOLBAR_HEIGHT = 140
@@ -22,7 +29,10 @@ const BOTTOM_OFFSET = Platform.select({
22
29
  export const ChatbotMessages = ({
23
30
  model,
24
31
  isHintFeedback,
32
+ sanitizeSpeechInput,
25
33
  isTextToSpeechEnabled,
34
+ textToSpeechConfig,
35
+ renderer,
26
36
  }: ChatbotMessagesProps) => {
27
37
  const dimensions = useWindowDimensions()
28
38
  const ref = useRef<ScrollView>(null)
@@ -39,6 +49,16 @@ export const ChatbotMessages = ({
39
49
 
40
50
  const messages = useStoreMap(model.$currentChatData, ({ messages }) => messages)
41
51
 
52
+ const playTextToSpeech = (id: string, message: string, translatedMessage?: string) => {
53
+ const text = isTranslated ? (translatedMessage as string) : message
54
+ void model.t2s.play({
55
+ text: sanitizeSpeechInput(text),
56
+ messageId: id,
57
+ isTranslated,
58
+ config: textToSpeechConfig ?? TEXT_TO_SPEECH_CONFIG,
59
+ })
60
+ }
61
+
42
62
  const askChatForHelp = (message: string, translatedMessage?: string) => {
43
63
  void model.sendHelpRequestFx({ message, translatedMessage })
44
64
  }
@@ -47,7 +67,6 @@ export const ChatbotMessages = ({
47
67
  <View style={[styles.container, { maxHeight: MAX_HEIGHT }]}>
48
68
  <ScrollView
49
69
  ref={ref}
50
- bounces={false}
51
70
  contentContainerStyle={styles.list}
52
71
  onContentSizeChange={(_, height) => {
53
72
  ref.current?.scrollToEnd()
@@ -59,19 +78,17 @@ export const ChatbotMessages = ({
59
78
  >
60
79
  {isOpen && (
61
80
  <View style={styles.gap}>
62
- {messages.map((message) => (
81
+ {messages.map(({ id, message, translatedMessage, isOwnMessage }) => (
63
82
  <ChatMessage
64
- key={message.id}
65
- isTranslated={isTranslated}
66
- message={message}
67
- variant={message.isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED}
68
- t2sState={{
69
- isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
70
- isActive: message.id === currentPlayingId,
71
- isLoading: isTextToSpeechPending,
72
- status: audioStatus,
73
- disabled: isTextToSpeechPending,
74
- }}
83
+ key={id}
84
+ message={isTranslated ? (translatedMessage as string) : message}
85
+ renderer={renderer}
86
+ audioStatus={audioStatus}
87
+ onPressTextToSpeech={() => playTextToSpeech(id, message, translatedMessage)}
88
+ isActive={id === currentPlayingId}
89
+ isTextToSpeechPending={isTextToSpeechPending}
90
+ variant={isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED}
91
+ withTextToSpeech={isTextToSpeechEnabled && !isOwnMessage}
75
92
  />
76
93
  ))}
77
94
 
@@ -81,6 +98,7 @@ export const ChatbotMessages = ({
81
98
 
82
99
  {!isHelpRequestPending && isOpen && (
83
100
  <Alternatives
101
+ model={model}
84
102
  onPressAlternative={askChatForHelp}
85
103
  hasMessages={messages.length > 1}
86
104
  isHintFeedback={isHintFeedback}
@@ -95,13 +113,12 @@ const styles = StyleSheet.create({
95
113
  container: {
96
114
  flex: 1,
97
115
  alignItems: 'flex-end',
98
- width: 378,
116
+ width: 372,
99
117
  height: '100%',
100
118
  },
101
119
  list: {
102
120
  alignItems: 'flex-end',
103
121
  paddingVertical: 2,
104
- paddingRight: 6,
105
122
  },
106
123
  gap: {
107
124
  flex: 1,