@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
@@ -9,7 +9,6 @@ var _index = require("../../../lib/effector/index.js");
9
9
  var _helpers = require("../helpers.js");
10
10
  class ChatbotAPI {
11
11
  constructor(api) {
12
- this.spotErrorFx = (0, _index.createControllerEffect)(api.spotError);
13
12
  this.postMessageFx = (0, _index.createControllerEffect)(api.postMessage);
14
13
  this.getAlternativesFx = (0, _effector.createEffect)(api.getAlternatives);
15
14
  this.translateTextFx = (0, _effector.createEffect)(async payload => {
@@ -32,4 +31,4 @@ class ChatbotAPI {
32
31
  }
33
32
  }
34
33
  exports.ChatbotAPI = ChatbotAPI;
35
- //# sourceMappingURL=ChatbotApi.js.map
34
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_effector","require","_index","_helpers","ChatbotAPI","constructor","api","postMessageFx","createControllerEffect","postMessage","getAlternativesFx","createEffect","getAlternatives","translateTextFx","payload","response","postTranslateText","text","replaceKatexSyntax","data","translations","map","translation","translatedText","textToSpeechTextFx","postTextToSpeech","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/api.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AAEO,MAAMG,UAAU,CAAC;EAMtBC,WAAWA,CAACC,GAA6B,EAAE;IACzC,IAAI,CAACC,aAAa,GAAG,IAAAC,6BAAsB,EAACF,GAAG,CAACG,WAAW,CAAC;IAC5D,IAAI,CAACC,iBAAiB,GAAG,IAAAC,sBAAY,EAACL,GAAG,CAACM,eAAe,CAAC;IAC1D,IAAI,CAACC,eAAe,GAAG,IAAAF,sBAAY,EACjC,MAAOG,OAA+B,IAAuC;MAC3E,MAAMC,QAAQ,GAAG,MAAMT,GAAG,CAACU,iBAAiB,CAAC;QAC3C,GAAGF,OAAO;QACVG,IAAI,EAAE,IAAAC,2BAAkB,EAACJ,OAAO,CAACG,IAAI;MACvC,CAAC,CAAC;MAEF,OAAO;QACL,GAAGF,QAAQ;QACXI,IAAI,EAAE;UACJ,GAAGJ,QAAQ,CAACI,IAAI;UAChBC,YAAY,EAAEL,QAAQ,CAACI,IAAI,CAACC,YAAY,CAACC,GAAG,CAAEC,WAAW,KAAM;YAC7D,GAAGA,WAAW;YACdC,cAAc,EAAE,IAAAL,2BAAkB,EAAC,CAACI,WAAW,CAACC,cAAc,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;UAC1E,CAAC,CAAC;QACJ;MACF,CAAC;IACH,CACF,CAAC;IACD,IAAI,CAACC,kBAAkB,GAAG,IAAAb,sBAAY,EAACL,GAAG,CAACmB,gBAAgB,CAAC;EAC9D;AACF;AAACC,OAAA,CAAAtB,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["CHAT_BOT_MODEL_DEFAULTS","exports","THREAD_MESSAGES_LIMIT"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/constants.ts"],"mappings":";;;;;;AAEO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CHAT_BOT_MODEL_DEFAULTS","exports","THREAD_MESSAGES_LIMIT"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/constants.ts"],"mappings":";;;;;;AAAO,MAAMA,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG;EACrCE,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
@@ -6,17 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.messagesHelper = void 0;
7
7
  var _helpers = require("../../../lib/helpers/helpers.js");
8
8
  class messagesHelper {
9
- static createAnswer(data, {
10
- isInitial
11
- } = {}) {
9
+ static createAnswer(data) {
12
10
  return {
13
11
  id: (0, _helpers.generateRandomId)(),
14
12
  isOwnMessage: false,
15
13
  message: data.message,
16
- options: data.options,
17
14
  threadId: data.threadId,
18
- translatedMessage: data.translatedMessage,
19
- isInitial
15
+ options: data.options,
16
+ translatedMessage: data.translatedMessage
20
17
  };
21
18
  }
22
19
  static createLast(data) {
@@ -26,17 +23,20 @@ class messagesHelper {
26
23
  translatedMessage: data.translatedMessage,
27
24
  isOwnMessage: false,
28
25
  options: [],
26
+ threadId: '',
29
27
  endMessage: true
30
28
  };
31
29
  }
32
30
  static createOwn({
33
31
  message = '',
34
- translatedMessage
32
+ translatedMessage,
33
+ threadId
35
34
  }) {
36
35
  return {
37
36
  id: (0, _helpers.generateRandomId)(),
38
37
  message,
39
38
  translatedMessage,
39
+ threadId: threadId || '',
40
40
  isOwnMessage: true,
41
41
  options: []
42
42
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_helpers","require","messagesHelper","createAnswer","data","isInitial","id","generateRandomId","isOwnMessage","message","options","threadId","translatedMessage","createLast","endMessage","createOwn","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/messagesHelper.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAaO,MAAMC,cAAc,CAAC;EAC1B,OAAcC,YAAYA,CACxBC,IAA2B,EAC3B;IAAEC;EAAgC,CAAC,GAAG,CAAC,CAAC,EACnB;IACrB,OAAO;MACLC,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBC,YAAY,EAAE,KAAK;MACnBC,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBC,OAAO,EAAEN,IAAI,CAACM,OAAO;MACrBC,QAAQ,EAAEP,IAAI,CAACO,QAAQ;MACvBC,iBAAiB,EAAER,IAAI,CAACQ,iBAAiB;MACzCP;IACF,CAAC;EACH;EAEA,OAAcQ,UAAUA,CAACT,IAA2B,EAAE;IACpD,OAAO;MACLE,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBE,OAAO,EAAEL,IAAI,CAACK,OAAO;MACrBG,iBAAiB,EAAER,IAAI,CAACQ,iBAAiB;MACzCJ,YAAY,EAAE,KAAK;MACnBE,OAAO,EAAE,EAAE;MACXI,UAAU,EAAE;IACd,CAAC;EACH;EAEA,OAAcC,SAASA,CAAC;IACtBN,OAAO,GAAG,EAAE;IACZG;EACe,CAAC,EAAuB;IACvC,OAAO;MACLN,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBE,OAAO;MACPG,iBAAiB;MACjBJ,YAAY,EAAE,IAAI;MAClBE,OAAO,EAAE;IACX,CAAC;EACH;AACF;AAACM,OAAA,CAAAd,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_helpers","require","messagesHelper","createAnswer","data","id","generateRandomId","isOwnMessage","message","threadId","options","translatedMessage","createLast","endMessage","createOwn","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/messagesHelper.ts"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AASO,MAAMC,cAAc,CAAC;EAC1B,OAAcC,YAAYA,CAACC,IAA2B,EAAuB;IAC3E,OAAO;MACLC,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBC,YAAY,EAAE,KAAK;MACnBC,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBC,QAAQ,EAAEL,IAAI,CAACK,QAAQ;MACvBC,OAAO,EAAEN,IAAI,CAACM,OAAO;MACrBC,iBAAiB,EAAEP,IAAI,CAACO;IAC1B,CAAC;EACH;EAEA,OAAcC,UAAUA,CAACR,IAA2B,EAAE;IACpD,OAAO;MACLC,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBE,OAAO,EAAEJ,IAAI,CAACI,OAAO;MACrBG,iBAAiB,EAAEP,IAAI,CAACO,iBAAiB;MACzCJ,YAAY,EAAE,KAAK;MACnBG,OAAO,EAAE,EAAE;MACXD,QAAQ,EAAE,EAAE;MACZI,UAAU,EAAE;IACd,CAAC;EACH;EAEA,OAAcC,SAASA,CAAC;IACtBN,OAAO,GAAG,EAAE;IACZG,iBAAiB;IACjBF;EACe,CAAC,EAAuB;IACvC,OAAO;MACLJ,EAAE,EAAE,IAAAC,yBAAgB,EAAC,CAAC;MACtBE,OAAO;MACPG,iBAAiB;MACjBF,QAAQ,EAAEA,QAAQ,IAAI,EAAE;MACxBF,YAAY,EAAE,IAAI;MAClBG,OAAO,EAAE;IACX,CAAC;EACH;AACF;AAACK,OAAA,CAAAb,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -14,34 +14,30 @@ class ChatTextToSpeechModel {
14
14
  $currentPlayingId = (0, _effector.restore)(this.setCurrentPlayingId, null);
15
15
  setStatus = (0, _effector.createEvent)();
16
16
  $status = (0, _effector.restore)(this.setStatus, _t2sTypes.AudioStatus.STOPPED);
17
- audioConfig = null;
18
- textSanitizer = value => value;
19
17
  constructor({
18
+ $isOpen,
20
19
  api
21
20
  }) {
22
21
  this.api = api;
22
+ (0, _effector.sample)({
23
+ source: $isOpen.updates,
24
+ filter: isOpen => !isOpen,
25
+ target: this.reset
26
+ });
23
27
  }
24
- setAudioConfig(config) {
25
- this.audioConfig = config;
26
- }
27
- setConfig({
28
- audioProvider,
29
- textSanitizer
30
- }) {
31
- if (audioProvider) this.audioProvider = audioProvider;
32
- if (textSanitizer) this.textSanitizer = textSanitizer;
28
+ setAudioProvider(audioProvider) {
29
+ this.audioProvider = audioProvider;
33
30
  }
34
31
  getCacheKey = (messageId, isTranslated) => {
35
32
  return `${messageId}-${isTranslated ? 'translated' : 'original'}`;
36
33
  };
37
34
  async play({
38
- message,
39
- isTranslated
35
+ text,
36
+ messageId,
37
+ isTranslated,
38
+ config
40
39
  }) {
41
- if (!this.audioProvider) throw new Error('Audio provider is not set. Use setConfig.');
42
- const messageText = isTranslated ? message.translatedMessage : message.message;
43
- const messageId = message.id;
44
- const text = this.textSanitizer(messageText);
40
+ if (!this.audioProvider) throw new Error('Audio provider is not set. Use setAudioProvider.');
45
41
  try {
46
42
  const status = this.$status.getState();
47
43
  const playingId = this.$currentPlayingId.getState();
@@ -65,7 +61,6 @@ class ChatTextToSpeechModel {
65
61
  let audioPath = this.audioCache[cacheKey];
66
62
  this.setCurrentPlayingId(messageId);
67
63
  if (!audioPath) {
68
- const config = this.audioConfig;
69
64
  const response = await this.api.textToSpeechTextFx({
70
65
  input: {
71
66
  text
@@ -1 +1 @@
1
- {"version":3,"names":["_effector","require","_constants","_t2sTypes","ChatTextToSpeechModel","audioCache","audioProvider","setCurrentPlayingId","createEvent","$currentPlayingId","restore","setStatus","$status","AudioStatus","STOPPED","audioConfig","textSanitizer","value","constructor","api","setAudioConfig","config","setConfig","getCacheKey","messageId","isTranslated","play","message","Error","messageText","translatedMessage","id","text","status","getState","playingId","isPlaying","PLAYING","isPaused","PAUSED","isCurrentMessage","pause","resume","stop","cacheKey","audioPath","response","textToSpeechTextFx","input","voice","DEFAULT_VOICE","AUDIO_CONFIG","audioContent","error","reset","console","createEffect","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/t2s.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAiBO,MAAMG,qBAAqB,CAAC;EAEhBC,UAAU,GAA2B,CAAC,CAAC;EAChDC,aAAa,G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AAI,OAAOL,QAAQ,KAAK,QAAQ,EAAE;UAChCD,SAAS,GAAG,0BAA0BC,QAAQ,EAAE;QAClD,CAAC,MAAM;UACLD,SAAS,GAAGC,QAAQ,EAAEM,YAAY,IAAI,EAAE;QAC1C;QAEA,IAAI,CAAC/C,UAAU,CAACuC,QAAQ,CAAC,GAAGC,SAAS;MACvC;MAEA,IAAI,CAAClC,SAAS,CAACE,qBAAW,CAACwB,OAAO,CAAC;MACnC,MAAM,IAAI,CAAC/B,aAAa,CAACoB,IAAI,CAACmB,SAAS,EAAE,MAAM;QAC7C,IAAI,CAAClC,SAAS,CAACE,qBAAW,CAACC,OAAO,CAAC;QACnC,IAAI,CAACP,mBAAmB,CAAC,IAAI,CAAC;MAChC,CAAC,CAAC;IACJ,CAAC,CAAC,OAAO8C,KAAK,EAAE;MACd,IAAI,CAACC,KAAK,CAAC,CAAC;MACZC,OAAO,CAACF,KAAK,CAAC,gCAAgC,EAAEA,KAAK,CAAC;IACxD;EACF;EAEOV,IAAIA,CAAA,EAAG;IACZ,IAAI,CAAC,IAAI,CAACrC,aAAa,EAAE,MAAM,IAAIsB,KAAK,CAAC,kDAAkD,CAAC;IAC5F,IAAI,CAACtB,aAAa,CAACqC,IAAI,CAAC,CAAC;EAC3B;EAEgBW,KAAK,GAAG,IAAAE,sBAAY,EAAC,MAAM;IACzC,IAAI,CAACb,IAAI,CAAC,CAAC;IACX,IAAI,CAAChC,SAAS,CAACE,qBAAW,CAACC,OAAO,CAAC;IACnC,IAAI,CAACP,mBAAmB,CAAC,IAAI,CAAC;EAChC,CAAC,CAAC;AACJ;AAACkD,OAAA,CAAArD,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_effector","require","_constants","_t2sTypes","ChatTextToSpeechModel","audioCache","audioProvider","setCurrentPlayingId","createEvent","$currentPlayingId","restore","setStatus","$status","AudioStatus","STOPPED","constructor","$isOpen","api","sample","source","updates","filter","isOpen","target","reset","setAudioProvider","getCacheKey","messageId","isTranslated","play","text","config","Error","status","getState","playingId","isPlaying","PLAYING","isPaused","PAUSED","isCurrentMessage","pause","resume","stop","cacheKey","audioPath","response","textToSpeechTextFx","input","voice","DEFAULT_VOICE","audioConfig","AUDIO_CONFIG","audioContent","error","console","createEffect","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/t2s.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAQO,MAAMG,qBAAqB,CAAC;EAEhBC,UAAU,GAA2B,CAAC,CAAC;EAChDC,aAAa,GAAyB,IAAI;EAEzCC,mBAAmB,GAAG,IAAAC,qBAAW,EAAgB,CAAC;EAClDC,iBAAiB,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,mBAAmB,EAAE,IAAI,CAAC;EAC3DI,SAAS,GAAG,IAAAH,qBAAW,EAAc,CAAC;EACtCI,OAAO,GAAG,IAAAF,iBAAO,EAAC,IAAI,CAACC,SAAS,EAAEE,qBAAW,CAACC,OAAO,CAAC;EAE/DC,WAAWA,CAAC;IAAEC,OAAO;IAAEC;EAAgC,CAAC,EAAE;IACxD,IAAI,CAACA,GAAG,GAAGA,GAAG;IAEd,IAAAC,gBAAM,EAAC;MACLC,MAAM,EAAEH,OAAO,CAACI,OAAO;MACvBC,MAAM,EAAEC,MAAM,IAAI,CAACA,MAAM;MACzBC,MAAM,EAAE,IAAI,CAACC;IACf,CAAC,CAAC;EACJ;EAEOC,gBAAgBA,CAACnB,aAA4B,EAAE;IACpD,IAAI,CAACA,aAAa,GAAGA,aAAa;EACpC;EAEQoB,WAAW,GAAGA,CAACC,SAAiB,EAAEC,YAAqB,KAAK;IAClE,OAAO,GAAGD,SAAS,IAAIC,YAAY,GAAG,YAAY,GAAG,UAAU,EAAE;EACnE,CAAC;EAED,MAAMC,IAAIA,CAAC;IAAEC,IAAI;IAAEH,SAAS;IAAEC,YAAY;IAAEG;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AEkB,KAAK,IAAIC,wBAAa;UACrCC,WAAW,EAAEpB,MAAM,EAAEoB,WAAW,IAAIC;QACtC,CAAC,CAAC;;QAEF;QACA,IAAI,OAAON,QAAQ,KAAK,QAAQ,EAAE;UAChCD,SAAS,GAAG,0BAA0BC,QAAQ,EAAE;QAClD,CAAC,MAAM;UACLD,SAAS,GAAGC,QAAQ,EAAEO,YAAY,IAAI,EAAE;QAC1C;QAEA,IAAI,CAAChD,UAAU,CAACuC,QAAQ,CAAC,GAAGC,SAAS;MACvC;MAEA,IAAI,CAAClC,SAAS,CAACE,qBAAW,CAACwB,OAAO,CAAC;MACnC,MAAM,IAAI,CAAC/B,aAAa,CAACuB,IAAI,CAACgB,SAAS,EAAE,MAAM;QAC7C,IAAI,CAAClC,SAAS,CAACE,qBAAW,CAACC,OAAO,CAAC;QACnC,IAAI,CAACP,mBAAmB,CAAC,IAAI,CAAC;MAChC,CAAC,CAAC;IACJ,CAAC,CAAC,OAAO+C,KAAK,EAAE;MACd,IAAI,CAAC9B,KAAK,CAAC,CAAC;MACZ+B,OAAO,CAACD,KAAK,CAAC,gCAAgC,EAAEA,KAAK,CAAC;IACxD;EACF;EAEOX,IAAIA,CAAA,EAAG;IACZ,IAAI,CAAC,IAAI,CAACrC,aAAa,EAAE,MAAM,IAAI0B,KAAK,CAAC,kDAAkD,CAAC;IAC5F,IAAI,CAAC1B,aAAa,CAACqC,IAAI,CAAC,CAAC;EAC3B;EAEgBnB,KAAK,GAAG,IAAAgC,sBAAY,EAAC,MAAM;IACzC,IAAI,CAACb,IAAI,CAAC,CAAC;IACX,IAAI,CAAChC,SAAS,CAACE,qBAAW,CAACC,OAAO,CAAC;IACnC,IAAI,CAACP,mBAAmB,CAAC,IAAI,CAAC;EAChC,CAAC,CAAC;AACJ;AAACkD,OAAA,CAAArD,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getOptionsForTranslation","lastMessage","alternatives","options","length","hintAlternatives","hints","defaultAlternatives","default","map","text","addTranslationsToAlternative","translatedHints","translatedDefaults","translatedText","index","addTranslationToOptions","translations","option"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.helpers.ts"],"mappings":";;;;;;;;AAQO,SAASA,wBAAwBA,CAAC;EACvCC,WAAW;EACXC;AACe,CAAC,EAAoB;EACpC,IAAI,CAACD,WAAW,EAAE,OAAO;IAAEA,WAAW,EAAE,IAAI;IAAEC,YAAY,EAAE;EAAK,CAAC;EAClE,IAAI,CAACD,WAAW,CAACE,OAAO,CAACC,MAAM,EAAE;IAC/B,IAAI,CAACF,YAAY,EAAE,OAAO;MAAED,WAAW,EAAE,IAAI;MAAEC,YAAY,EAAE;IAAK,CAAC;IACnE,MAAMG,gBAAgB,GAAGH,YAAY,CAACC,OAAO,CAACG,KAAK,IAAI,EAAE;IACzD,MAAMC,mBAAmB,GAAGL,YAAY,CAACC,OAAO,CAACK,OAAO,IAAI,EAAE;IAC9D,OAAO;MACLP,WAAW,EAAE,IAAI;MACjBC,YAAY,EAAE;QACZI,KAAK,EAAED,gBAAgB,CAACI,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI,CAAC;QAC/CF,OAAO,EAAED,mBAAmB,CAACE,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI;MACrD;IACF,CAAC;EACH;EAEA,OAAO;IACLT,WAAW,EAAEA,WAAW,CAACE,OAAO,CAACM,GAAG,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAAC;IACxDR,YAAY,EAAE;EAChB,CAAC;AACH;AAEO,SAASS,4BAA4BA,CAAC;EAC3CT,YAAY;EACZU,eAAe;EACfC;AACiC,CAAC,EAA2B;EAC7D,OAAO;IACL,GAAGX,YAAY;IACfC,OAAO,EAAE;MACP,GAAGD,YAAY,CAACC,OAAO;MACvBG,KAAK,EAAEM,eAAe,CAACH,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QACrD,GAAGb,YAAY,CAACC,OAAO,CAACG,KAAK,CAACS,KAAK,CAAC;QACpCD;MACF,CAAC,CAAC,CAAC;MACHN,OAAO,EAAEK,kBAAkB,CAACJ,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QAC1D,GAAGb,YAAY,CAACC,OAAO,CAACK,OAAO,CAACO,KAAK,CAAC;QACtCD;MACF,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEO,SAASE,uBAAuBA,CAACb,OAAqB,EAAEc,YAAsB,EAAE;EACrF,OAAOd,OAAO,CAACM,GAAG,CAAC,CAACS,MAAM,EAAEH,KAAK,MAAM;IACrC,GAAGG,MAAM;IACTJ,cAAc,EAAEG,YAAY,CAACF,KAAK;EACpC,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
1
+ {"version":3,"names":["getOptionsForTranslation","lastMessage","alternatives","options","length","hintAlternatives","hints","defaultAlternatives","default","map","text","addTranslationsToAlternative","translatedHints","translatedDefaults","translatedText","index","addTranslationToOptions","translations","option"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.helpers.ts"],"mappings":";;;;;;;;AAOO,SAASA,wBAAwBA,CAAC;EACvCC,WAAW;EACXC;AACe,CAAC,EAAoB;EACpC,IAAI,CAACD,WAAW,EAAE,OAAO;IAAEA,WAAW,EAAE,IAAI;IAAEC,YAAY,EAAE;EAAK,CAAC;EAClE,IAAI,CAACD,WAAW,CAACE,OAAO,CAACC,MAAM,EAAE;IAC/B,IAAI,CAACF,YAAY,EAAE,OAAO;MAAED,WAAW,EAAE,IAAI;MAAEC,YAAY,EAAE;IAAK,CAAC;IACnE,MAAMG,gBAAgB,GAAGH,YAAY,CAACC,OAAO,CAACG,KAAK,IAAI,EAAE;IACzD,MAAMC,mBAAmB,GAAGL,YAAY,CAACC,OAAO,CAACK,OAAO,IAAI,EAAE;IAC9D,OAAO;MACLP,WAAW,EAAE,IAAI;MACjBC,YAAY,EAAE;QACZI,KAAK,EAAED,gBAAgB,CAACI,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI,CAAC;QAC/CF,OAAO,EAAED,mBAAmB,CAACE,GAAG,CAAC,CAAC;UAAEC;QAAK,CAAC,KAAKA,IAAI;MACrD;IACF,CAAC;EACH;EAEA,OAAO;IACLT,WAAW,EAAEA,WAAW,CAACE,OAAO,CAACM,GAAG,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAAC;IACxDR,YAAY,EAAE;EAChB,CAAC;AACH;AAEO,SAASS,4BAA4BA,CAAC;EAC3CT,YAAY;EACZU,eAAe;EACfC;AACiC,CAAC,EAA2B;EAC7D,OAAO;IACL,GAAGX,YAAY;IACfC,OAAO,EAAE;MACP,GAAGD,YAAY,CAACC,OAAO;MACvBG,KAAK,EAAEM,eAAe,CAACH,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QACrD,GAAGb,YAAY,CAACC,OAAO,CAACG,KAAK,CAACS,KAAK,CAAC;QACpCD;MACF,CAAC,CAAC,CAAC;MACHN,OAAO,EAAEK,kBAAkB,CAACJ,GAAG,CAAC,CAACK,cAAc,EAAEC,KAAK,MAAM;QAC1D,GAAGb,YAAY,CAACC,OAAO,CAACK,OAAO,CAACO,KAAK,CAAC;QACtCD;MACF,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAEO,SAASE,uBAAuBA,CAACb,OAAqB,EAAEc,YAAsB,EAAE;EACrF,OAAOd,OAAO,CAACM,GAAG,CAAC,CAACS,MAAM,EAAEH,KAAK,MAAM;IACrC,GAAGG,MAAM;IACTJ,cAAc,EAAEG,YAAY,CAACF,KAAK;EACpC,CAAC,CAAC,CAAC;AACL","ignoreList":[]}
@@ -14,44 +14,26 @@ class ChatbotTranslation {
14
14
  api,
15
15
  $key,
16
16
  defaultMessages,
17
+ messagesModel,
17
18
  alternativesModel,
18
- $context,
19
- chats
19
+ $context
20
20
  }) {
21
21
  this.api = api;
22
22
  this.$key = $key;
23
23
  this.$context = $context;
24
24
  this.defaultMessages = defaultMessages;
25
+ this.messagesModel = messagesModel;
25
26
  this.alternativesModel = alternativesModel;
26
- this.applyTranslationFx = (0, _effector.attach)({
27
- source: [this.$isTranslated, this.$context],
28
- mapParams: (messages, [isTranslationActive, context]) => ({
29
- messages,
30
- targetLanguage: context?.translationTargetLanguage ?? '',
31
- isTranslationActive
32
- }),
33
- effect: this.translateMessagesFx
34
- });
35
27
  this.translateAllMessagesFx = (0, _effector.attach)({
36
- source: [this.$key, chats.$data, this.alternativesModel.$store, this.$context],
37
- mapParams: (_, [key, chats, alternatives, context]) => ({
28
+ source: [this.$key, this.messagesModel.$state, this.alternativesModel.$store, this.$context],
29
+ mapParams: (_, [key, messages, alternatives, context]) => ({
38
30
  targetLanguage: context?.translationTargetLanguage ?? '',
39
- messages: chats[key]?.messages ?? [],
31
+ messages: messages[key] ?? [],
40
32
  alternatives
41
33
  }),
42
34
  effect: this.translateBatchFx
43
35
  });
44
- (0, _effector.sample)({
45
- clock: this.translateAllMessagesFx.doneData,
46
- source: [this.$key],
47
- fn: ([key], translatedMessages) => ({
48
- key,
49
- data: {
50
- messages: translatedMessages
51
- }
52
- }),
53
- target: chats.update
54
- });
36
+ this.initTranslationSamples();
55
37
  }
56
38
  shouldSkipTranslation(messages) {
57
39
  if (this.$isTranslated.getState()) {
@@ -65,6 +47,17 @@ class ChatbotTranslation {
65
47
  }
66
48
  return false;
67
49
  }
50
+ initTranslationSamples() {
51
+ (0, _effector.sample)({
52
+ clock: this.translateAllMessagesFx.doneData,
53
+ source: [this.$key],
54
+ fn: ([key], translatedMessages) => ({
55
+ key,
56
+ data: translatedMessages
57
+ }),
58
+ target: this.messagesModel.setField
59
+ });
60
+ }
68
61
  async translateRequest({
69
62
  textList,
70
63
  targetLanguage
@@ -143,10 +136,8 @@ class ChatbotTranslation {
143
136
  });
144
137
  translateMessagesFx = (0, _effector.createEffect)(async ({
145
138
  messages,
146
- targetLanguage,
147
- isTranslationActive
139
+ targetLanguage
148
140
  }) => {
149
- if (!isTranslationActive || !targetLanguage) return messages;
150
141
  const text = messages.map(({
151
142
  options,
152
143
  message
@@ -1 +1 @@
1
- {"version":3,"names":["_effector","require","_helpers","_translationHelpers","ChatbotTranslation","setIsTranslated","createEvent","$isTranslated","restore","constructor","api","$key","defaultMessages","alternativesModel","$context","chats","applyTranslationFx","attach","source","mapParams","messages","isTranslationActive","context","targetLanguage","translationTargetLanguage","effect","translateMessagesFx","translateAllMessagesFx","$data","$store","_","key","alternatives","translateBatchFx","sample","clock","doneData","fn","translatedMessages","data","target","update","shouldSkipTranslation","getState","allTranslated","every","message","translatedMessage","translateRequest","textList","text","Object","values","flat","response","translateTextFx","translatedText","translations","map","decodeHTMLEntities","entries","reduce","result","texts","splice","length","addTranslationToAlternatives","props","set","addTranslationsToAlternative","createEffect","error","endMessage","defaultOptions","anotherHintOption","options","getOptionsForTranslation","lastMessage","at","translatedTextsList","alternativesHints","hints","alternativesDefaults","default","forEach","index","translatedHints","translatedDefaults","isLastMessage","addTranslationToOptions","translatedTexts","shift","reset","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AAqBO,MAAMG,kBAAkB,CAAC;EAOrBC,eAAe,GAAG,IAAAC,qBAAW,EAAU,CAAC;EACxCC,aAAa,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,eAAe,EAAE,KAAK,CAAC;EAK7DI,WAAWA,CAAC;IACVC,GAAG;IACHC,IAAI;IACJC,eAAe;IACfC,iBAAiB;IACjBC,QAAQ;IACRC;EACuB,CAAC,EAAE;IAC1B,IAAI,CAACL,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACG,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACF,eAAe,GAAGA,eAAe;IACtC,IAAI,CA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,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CACDG,IAAI,CAAC,CAAC;IAET,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAAC5C,GAAG,CAAC6C,eAAe,CAAC;MAAEL,IAAI;MAAE3B;IAAe,CAAC,CAAC;IACzE,MAAMmE,eAAe,GAAGpC,QAAQ,CAACf,IAAI,CAACkB,YAAY,CAACC,GAAG,CAAC,CAAC;MAAEF;IAAe,CAAC,KACxE,IAAAG,2BAAkB,EAACH,cAAc,CACnC,CAAC;IAED,OAAOpC,QAAQ,CAACsC,GAAG,CAAEZ,OAAO,IAA0B;MACpD,MAAM6B,OAAO,GAAG7B,OAAO,CAAC6B,OAAO;MAC/B,MAAM5B,iBAAiB,GAAG2C,eAAe,CAACC,KAAK,CAAC,CAAC;MACjD,OAAO;QACL,GAAG7C,OAAO;QACVC,iBAAiB;QACjB4B,OAAO,EAAE,IAAAc,2CAAuB,EAACd,OAAO,EAAEe,eAAe,CAAC1B,MAAM,CAAC,CAAC,EAAEW,OAAO,CAACV,MAAM,CAAC;MACrF,CAAC;IACH,CAAC,CAAC;EACJ,CACF,CAAC;EAEM2B,KAAKA,CAAA,EAAG;IACb,IAAI,CAACvF,eAAe,CAAC,KAAK,CAAC;EAC7B;AACF;AAACwF,OAAA,CAAAzF,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_effector","require","_helpers","_translationHelpers","ChatbotTranslation","setIsTranslated","createEvent","$isTranslated","restore","constructor","api","$key","defaultMessages","messagesModel","alternativesModel","$context","translateAllMessagesFx","attach","source","$state","$store","mapParams","_","key","messages","alternatives","context","targetLanguage","translationTargetLanguage","effect","translateBatchFx","initTranslationSamples","shouldSkipTranslation","getState","allTranslated","every","message","translatedMessage","sample","clock","doneData","fn","translatedMessages","data","target","setField","translateRequest","textList","text","Object","values","flat","response","translateTextFx","translatedText","translations","map","decodeHTMLEntities","entries","reduce","result","texts","splice","length","addTranslationToAlternatives","props","set","addTranslationsToAlternative","createEffect","error","endMessage","defaultOptions","anotherHintOption","options","getOptionsForTranslation","lastMessage","at","translatedTextsList","alternativesHints","hints","alternativesDefaults","default","forEach","index","translatedHints","translatedDefaults","isLastMessage","addTranslationToOptions","translateMessagesFx","translatedTexts","shift","reset","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/model/translation.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AAGA,IAAAE,mBAAA,GAAAF,OAAA;AAkBO,MAAMG,kBAAkB,CAAC;EAQrBC,eAAe,GAAG,IAAAC,qBAAW,EAAU,CAAC;EACxCC,aAAa,GAAG,IAAAC,iBAAO,EAAC,IAAI,CAACH,eAAe,EAAE,KAAK,CAAC;EAI7DI,WAAWA,CAAC;IACVC,GAAG;IACHC,IAAI;IACJC,eAAe;IACfC,aAAa;IACbC,iBAAiB;IACjBC;EACuB,CAAC,EAAE;IAC1B,IAAI,CAACL,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACI,QAAQ,GAAGA,QAAQ;IACxB,IAAI,CAACH,eAAe,GAAGA,eAAe;IACtC,IAAI,CAACC,aAAa,GAAGA,aAAa;IAClC,IAAI,CAACC,iBAAiB,GAAGA,iBAAiB;IAE1C,IAAI,CAACE,sBAAsB,GAAG,IAAAC,gBAAM,EAAC;MACnCC,MAAM,EAAE,CAAC,IAAI,CAACP,IAAI,EAAE,IAAI,CAACE,aAAa,CAACM,MAAM,EAAE,IAAI,CAACL,iBAAiB,CAACM,MAAM,EAAE,IAAI,CAACL,QAAQ,CAAC;MAC5FM,SAAS,EAAEA,CAACC,CAAO,EAAE,CAACC,GAAG,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,OAAO,CAAC,MAAM;QAC/DC,cAAc,EAAED,OAAO,EAAEE,yBAAyB,IAAI,EAAE;QACxDJ,QAAQ,EAAEA,QAAQ,CAACD,GAAG,CAAC,IAAI,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","ignoreList":[]}
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
2
  //# sourceMappingURL=api.types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["MessageVariant","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/types/model.types.ts"],"mappings":";;;;;;IAgEYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["MessageVariant","exports"],"sourceRoot":"../../../../../src","sources":["features/chatbot/types/model.types.ts"],"mappings":";;;;;;IAoEYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeUi","_PracticeButton","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PracticeButtonGroup","textContent","isPracticeButtonVisible","onLeftButtonPress","onRightButtonPress","isExam","buttonsContainerOpacity","useSharedValue","useEffect","value","withDelay","withTiming","duration","jsxs","View","style","styles","buttonsContainer","opacity","children","jsx","entering","FadeInRight","delay","easing","Easing","ease","FadeInUp","Button","variant","ButtonVariant","TERTIARY","PRIMARY","size","ButtonSize","LARGE","colorScheme","ButtonColor","PURPLE","BLUE","text","textTransform","onPress","leftButtonText","PracticeButton","rightButtonText","exports","StyleSheet","create","height","flexDirection","alignItems","justifyContent","paddingHorizontal","SPACING"],"sourceRoot":"../../../../../src","sources":["features/endOfAssignment/ui/PracticeButtonGroup.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAA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DC,OAAO,EAAEvC,iBAAkB;QAAAgB,QAAA,EAE1BlB,WAAW,CAAC0C;MAAc,CACrB;IAAC,CACI,CAAC,eAChB,IAAAhE,WAAA,CAAAyC,GAAA,EAAC5C,sBAAA,CAAAU,OAAQ,CAAC4B,IAAI;MAAAK,QAAA,EACXjB,uBAAuB,iBACtB,IAAAvB,WAAA,CAAAyC,GAAA,EAAC1C,eAAA,CAAAkE,cAAc;QAACF,OAAO,EAAEtC,kBAAmB;QAACoC,IAAI,EAAEvC,WAAW,CAAC4C;MAAgB,CAAE;IAClF,CACY,CAAC;EAAA,CACH,CAAC;AAEpB,CAAC;AAAAC,OAAA,CAAA9C,mBAAA,GAAAA,mBAAA;AAED,MAAMgB,MAAM,GAAG+B,uBAAU,CAACC,MAAM,CAAC;EAC/B/B,gBAAgB,EAAE;IAChBgC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,iBAAiB,EAAEC,sBAAO,CAAC,GAAG;EAChC;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeUi","_PracticeButton","_jsxRuntime","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","PracticeButtonGroup","textContent","isPracticeButtonVisible","onLeftButtonPress","onRightButtonPress","isExam","buttonsContainerOpacity","useSharedValue","useEffect","value","withDelay","withTiming","duration","jsxs","View","style","styles","buttonsContainer","opacity","children","jsx","entering","FadeInRight","delay","easing","Easing","ease","FadeInUp","Button","variant","ButtonVariant","TERTIARY","PRIMARY","size","ButtonSize","LARGE","colorScheme","ButtonColor","PURPLE","BLUE","text","textTransform","onPress","leftButtonText","PracticeButton","rightButtonText","exports","StyleSheet","create","height","flexDirection","alignItems","justifyContent","paddingHorizontal","SPACING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gC,0BAAW,CAACC,MAAM,GAAGD,0BAAW,CAACE,IAAK;QAC5DxB,KAAK,EAAE;UAAEyB,IAAI,EAAE;YAAEC,aAAa,EAAE;UAAY;QAAE,CAAE;QAChDC,OAAO,EAAEvC,iBAAkB;QAAAgB,QAAA,EAE1BlB,WAAW,CAAC0C;MAAc,CACrB;IAAC,CACI,CAAC,eAChB,IAAAhE,WAAA,CAAAyC,GAAA,EAAC5C,sBAAA,CAAAU,OAAQ,CAAC4B,IAAI;MAAAK,QAAA,EACXjB,uBAAuB,iBACtB,IAAAvB,WAAA,CAAAyC,GAAA,EAAC1C,eAAA,CAAAkE,cAAc;QAACF,OAAO,EAAEtC,kBAAmB;QAACoC,IAAI,EAAEvC,WAAW,CAAC4C;MAAgB,CAAE;IAClF,CACY,CAAC;EAAA,CACH,CAAC;AAEpB,CAAC;AAAAC,OAAA,CAAA9C,mBAAA,GAAAA,mBAAA;AAED,MAAMgB,MAAM,GAAG+B,uBAAU,CAACC,MAAM,CAAC;EAC/B/B,gBAAgB,EAAE;IAChBgC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBC,iBAAiB,EAAEC,sBAAO,CAAC,GAAG;EAChC;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_helpers","_index2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index3","_index4","_index5"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,M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AAG,MAAA,CAAAC,IAAA,CAAAa,OAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAW,OAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,OAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["_index","require","_helpers","_index2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_index3","_index4","_index5"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,OAAA,GAAAf,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAW,OAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAA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A","ignoreList":[]}
@@ -28,10 +28,6 @@ class EntityFieldStore {
28
28
  [key]: data
29
29
  };
30
30
  }).reset(this.reset);
31
- on(event, fn) {
32
- this.$state.on(event, fn);
33
- return this;
34
- }
35
31
  }
36
32
  exports.EntityFieldStore = EntityFieldStore;
37
33
  function createEntityFieldStore() {
@@ -1 +1 @@
1
- {"version":3,"names":["_effector","require","EntityFieldStore","setField","createEvent","reset","$state","createStore","on","state","key","data","fn","currentData","newData","undefined","event","exports","createEntityFieldStore"],"sourceRoot":"../../../../src","sources":["lib/effector/createEntityFieldStore.ts"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAMO,MAAMC,gBAAgB,CAAI;EACfC,QAAQ,GAAG,IAAAC,qBAAW,EAAiB,CAAC;EACxCC,KAAK,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAErBE,MAAM,GAAG,IAAAC,qBAAW,EAAoB,CAAC,CAAC,CAAC,CACxDC,EAAE,CAAC,IAAI,CAACL,QAAQ,EAAE,CAACM,KAAK,EAAE;IAAEC,GAAG;IAAEC,IAAI;IAAEC;EAAG,CAAC,KAAK;IAC/C,IAAIA,EAAE,EAAE;MACN,MAAMC,WAAW,GAAGJ,KAAK,CAACC,GAAG,CAAC;MAC9B,MAAMI,OAAO,GAAGF,EAAE,CAACC,WAAW,CAAC;MAC/B,IAAIC,OAAO,KAAKC,SAAS,EAAE,OAAON,KAAK;MACvC,OAAO;QAAE,GAAGA,KAAK;QAAE,CAACC,GAAG,GAAGI;MAAQ,CAAC;IACrC;IACA,OAAO;MAAE,GAAGL,KAAK;MAAE,CAACC,GAAG,GAAGC;IAAK,CAAC;EAClC,CAAC,CAAC,CACDN,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;EAEbG,EAAEA,CACPQ,KAAgB,EAChBJ,EAAuE,EACvE;IACA,IAAI,CAACN,MAAM,CAACE,EAAE,CAACQ,KAAK,EAAEJ,EAAE,CAAC;IACzB,OAAO,IAAI;EACb;AACF;AAACK,OAAA,CAAAf,gBAAA,GAAAA,gBAAA;AAEM,SAASgB,sBAAsBA,CAAA,EAAM;EAC1C,OAAO,IAAIhB,gBAAgB,CAAI,CAAC;AAClC","ignoreList":[]}
1
+ {"version":3,"names":["_effector","require","EntityFieldStore","setField","createEvent","reset","$state","createStore","on","state","key","data","fn","currentData","newData","undefined","exports","createEntityFieldStore"],"sourceRoot":"../../../../src","sources":["lib/effector/createEntityFieldStore.ts"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAMO,MAAMC,gBAAgB,CAAI;EACfC,QAAQ,GAAG,IAAAC,qBAAW,EAAiB,CAAC;EACxCC,KAAK,GAAG,IAAAD,qBAAW,EAAC,CAAC;EAErBE,MAAM,GAAG,IAAAC,qBAAW,EAAoB,CAAC,CAAC,CAAC,CACxDC,EAAE,CAAC,IAAI,CAACL,QAAQ,EAAE,CAACM,KAAK,EAAE;IAAEC,GAAG;IAAEC,IAAI;IAAEC;EAAG,CAAC,KAAK;IAC/C,IAAIA,EAAE,EAAE;MACN,MAAMC,WAAW,GAAGJ,KAAK,CAACC,GAAG,CAAC;MAC9B,MAAMI,OAAO,GAAGF,EAAE,CAACC,WAAW,CAAC;MAC/B,IAAIC,OAAO,KAAKC,SAAS,EAAE,OAAON,KAAK;MACvC,OAAO;QAAE,GAAGA,KAAK;QAAE,CAACC,GAAG,GAAGI;MAAQ,CAAC;IACrC;IACA,OAAO;MAAE,GAAGL,KAAK;MAAE,CAACC,GAAG,GAAGC;IAAK,CAAC;EAClC,CAAC,CAAC,CACDN,KAAK,CAAC,IAAI,CAACA,KAAK,CAAC;AACtB;AAACW,OAAA,CAAAd,gBAAA,GAAAA,gBAAA;AAEM,SAASe,sBAAsBA,CAAA,EAAM;EAC1C,OAAO,IAAIf,gBAAgB,CAAI,CAAC;AAClC","ignoreList":[]}
@@ -10,12 +10,5 @@
10
10
  "time.monthAgo": "month ago",
11
11
  "time.monthsAgo": "months ago",
12
12
  "time.yearAgo": "year ago",
13
- "time.yearsAgo": "years ago",
14
- "chat": {
15
- "anotherHint": "Give me another hint",
16
- "answerAgain": "Answer again to get another hint!",
17
- "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
18
- "howCanIHelp": "Hi! Do you want help?",
19
- "showError": "Show error"
20
- }
13
+ "time.yearsAgo": "years ago"
21
14
  }
@@ -10,12 +10,5 @@
10
10
  "time.monthAgo": "month ago",
11
11
  "time.monthsAgo": "months ago",
12
12
  "time.yearAgo": "year ago",
13
- "time.yearsAgo": "years ago",
14
- "chat": {
15
- "anotherHint": "Give me another hint",
16
- "answerAgain": "Answer again to get another hint!",
17
- "errorMessage": "Sorry, I can't help with this issue at the moment 😔.",
18
- "howCanIHelp": "Hi! Do you want help?",
19
- "showError": "Show error"
20
- }
13
+ "time.yearsAgo": "years ago"
21
14
  }
@@ -10,12 +10,5 @@
10
10
  "time.monthAgo": "månad sedan",
11
11
  "time.monthsAgo": "månader sedan",
12
12
  "time.yearAgo": "år sedan",
13
- "time.yearsAgo": "år sedan",
14
- "chat": {
15
- "anotherHint": "Ge mig en ledtråd",
16
- "answerAgain": "Svara igen för att få en till ledtråd!",
17
- "errorMessage": "Tyvärr kan jag inte hjälpa dig just nu 😔.",
18
- "howCanIHelp": "Hej! Hur kan jag hjälpa dig?",
19
- "showError": "Visa fel"
20
- }
13
+ "time.yearsAgo": "år sedan"
21
14
  }
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
2
  //# sourceMappingURL=icon.types.js.map
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.LOCALIZATION_CONFIGS = void 0;
7
7
  var _types = require("./types.js");
8
- var _en = _interopRequireDefault(require("./localization/en.json"));
9
- var _gb = _interopRequireDefault(require("./localization/gb.json"));
10
- var _sw = _interopRequireDefault(require("./localization/sw.json"));
8
+ var _en = _interopRequireDefault(require("../../lib/localization/en.json"));
9
+ var _gb = _interopRequireDefault(require("../../lib/localization/gb.json"));
10
+ var _sw = _interopRequireDefault(require("../../lib/localization/sw.json"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  const LOCALIZATION_CONFIGS = exports.LOCALIZATION_CONFIGS = {
13
13
  [_types.Locale.EN]: _en.default,
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_en","_interopRequireDefault","_gb","_sw","e","__esModule","default","LOCALIZATION_CONFIGS","exports","Locale","EN","GB","SW"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EAClC,CAACE,aAAM,CAACC,EAAE,GAAGA,WAAE;EACf,CAACD,aAAM,CAACE,EAAE,GAAGA,WAAE;EACf,CAACF,aAAM,CAACG,EAAE,GAAGA;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_types","require","_en","_interopRequireDefault","_gb","_sw","e","__esModule","default","LOCALIZATION_CONFIGS","exports","Locale","EN","GB","SW"],"sourceRoot":"../../../../src","sources":["shared/translation/constants.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,GAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,GAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,GAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA+C,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAExC,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EAClC,CAACE,aAAM,CAACC,EAAE,GAAGA,WAAE;EACf,CAACD,aAAM,CAACE,EAAE,GAAGA,WAAE;EACf,CAACF,aAAM,CAACG,EAAE,GAAGA;AACf,CAAC","ignoreList":[]}
@@ -3,26 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getText = exports.getSubstitutedString = void 0;
7
- exports.getTranslation = getTranslation;
8
- exports.setFeaturesLocalization = void 0;
6
+ exports.setFeaturesLocalization = exports.getText = exports.getSubstitutedString = void 0;
9
7
  var _model = require("./model.js");
10
- function getTranslation(config, key) {
11
- const rawTranslation = config?.[key];
12
- if (typeof rawTranslation === 'string' || !key.includes('.')) {
13
- return rawTranslation;
14
- }
15
- const keys = key.split('.');
16
- let translation = config;
17
- for (const k of keys) {
18
- if (translation[k] === undefined) return key;
19
- translation = translation[k];
20
- }
21
- if (typeof translation === 'string') {
22
- return translation;
23
- }
24
- return key;
25
- }
26
8
  const getSubstitutedString = (str, substitutions = {}) => {
27
9
  const substitutionsArray = Object.entries(substitutions);
28
10
  let result = str;
@@ -35,9 +17,11 @@ const getSubstitutedString = (str, substitutions = {}) => {
35
17
  exports.getSubstitutedString = getSubstitutedString;
36
18
  const getText = (key, args = null) => {
37
19
  const config = _model.$localization.getState();
38
- const translation = getTranslation(config, key);
39
- if (args) return getSubstitutedString(translation, args);
40
- return translation;
20
+ const translation = config?.[key];
21
+ if (translation && args) {
22
+ return getSubstitutedString(translation, args);
23
+ }
24
+ return translation ?? key;
41
25
  };
42
26
  exports.getText = getText;
43
27
  const setFeaturesLocalization = generator => {
@@ -1 +1 @@
1
- {"version":3,"names":["_model","require","getTranslation","config","key","rawTranslation","includes","keys","split","translation","k","undefined","getSubstitutedString","str","substitutions","substitutionsArray","Object","entries","result","length","forEach","value","replace","exports","getText","args","$localization","getState","setFeaturesLocalization","generator","setLocalization"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAGO,SAASC,cAAcA,CAACC,MAAoB,EAAEC,GAAoB,EAAE;EACzE,MAAMC,cAAc,GAAGF,MAAM,GAAGC,GAAG,CAAuB;EAC1D,IAAI,OAAOC,cAAc,KAAK,QAAQ,IAAI,CAACD,GAAG,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC5D,OAAOD,cAAc;EACvB;EACA,MAAME,IAAI,GAAGH,GAAG,CAACI,KAAK,CAAC,GAAG,CAAC;EAC3B,IAAIC,WAAW,GAAGN,MAAM;EACxB,KAAK,MAAMO,CAAC,IAAIH,IAAI,EAAE;IACpB,IAAIE,WAAW,CAACC,CAAC,CAAuB,KAAKC,SAAS,EAAE,OAAOP,GAAG;IAClEK,WAAW,GAAGA,WAAW,CAACC,CAAC,CAA8B;EAC3D;EACA,IAAI,OAAOD,WAAW,KAAK,QAAQ,EAAE;IACnC,OAAOA,WAAW;EACpB;EACA,OAAOL,GAAG;AACZ;AAEO,MAAMQ,oBAAoB,GAAGA,CAACC,GAAW,EAAEC,aAAqC,GAAG,CAAC,CAAC,KAAK;EAC/F,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,OAAO,CAACH,aAAa,CAAC;EACxD,IAAII,MAAM,GAAGL,GAAG;EAEhB,IAAI,CAACE,kBAAkB,CAACI,MAAM,EAAE,OAAOD,MAAM;EAE7CH,kBAAkB,CAACK,OAAO,CAAC,CAAC,CAAChB,GAAG,EAAEiB,KAAK,CAAC,KAAK;IAC3CH,MAAM,GAAGA,MAAM,CAACI,OAAO,CAAC,KAAKlB,GAAG,IAAI,EAAEiB,KAAK,CAAC;EAC9C,CAAC,CAAC;EAEF,OAAOH,MAAM;AACf,CAAC;AAAAK,OAAA,CAAAX,oBAAA,GAAAA,oBAAA;AAEM,MAAMY,OAAgB,GAAGA,CAACpB,GAAoB,EAAEqB,IAAI,GAAG,IAAI,KAAK;EACrE,MAAMtB,MAAM,GAAGuB,oBAAa,CAACC,QAAQ,CAAC,CAAC;EAEvC,MAAMlB,WAAW,GAAGP,cAAc,CAACC,MAAM,EAAEC,GAAG,CAAC;EAC/C,IAAIqB,IAAI,EAAE,OAAOb,oBAAoB,CAACH,WAAW,EAAEgB,IAAI,CAAC;EACxD,OAAOhB,WAAW;AACpB,CAAC;AAAAc,OAAA,CAAAC,OAAA,GAAAA,OAAA;AAEM,MAAMI,uBAAuB,GAClCC,SAAiF,IAC9E;EACH,IAAAC,sBAAe,EAACD,SAAS,CAAC;AAC5B,CAAC;AAAAN,OAAA,CAAAK,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_model","require","getSubstitutedString","str","substitutions","substitutionsArray","Object","entries","result","length","forEach","key","value","replace","exports","getText","args","config","$localization","getState","translation","setFeaturesLocalization","generator","setLocalization"],"sourceRoot":"../../../../src","sources":["shared/translation/helpers.ts"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAGO,MAAMC,oBAAoB,GAAGA,CAACC,GAAW,EAAEC,aAAqC,GAAG,CAAC,CAAC,KAAK;EAC/F,MAAMC,kBAAkB,GAAGC,MAAM,CAACC,OAAO,CAACH,aAAa,CAAC;EACxD,IAAII,MAAM,GAAGL,GAAG;EAEhB,IAAI,CAACE,kBAAkB,CAACI,MAAM,EAAE,OAAOD,MAAM;EAE7CH,kBAAkB,CAACK,OAAO,CAAC,CAAC,CAACC,GAAG,EAAEC,KAAK,CAAC,KAAK;IAC3CJ,MAAM,GAAGA,MAAM,CAACK,OAAO,CAAC,KAAKF,GAAG,IAAI,EAAEC,KAAK,CAAC;EAC9C,CAAC,CAAC;EAEF,OAAOJ,MAAM;AACf,CAAC;AAAAM,OAAA,CAAAZ,oBAAA,GAAAA,oBAAA;AAEM,MAAMa,OAAgB,GAAGA,CAACJ,GAAoB,EAAEK,IAAI,GAAG,IAAI,KAAK;EACrE,MAAMC,MAAM,GAAGC,oBAAa,CAACC,QAAQ,CAAC,CAAC;EAEvC,MAAMC,WAAW,GAAGH,MAAM,GAAGN,GAAG,CAAC;EAEjC,IAAIS,WAAW,IAAIJ,IAAI,EAAE;IACvB,OAAOd,oBAAoB,CAACkB,WAAW,EAAEJ,IAAI,CAAC;EAChD;EAEA,OAAOI,WAAW,IAAIT,GAAG;AAC3B,CAAC;AAAAG,OAAA,CAAAC,OAAA,GAAAA,OAAA;AAEM,MAAMM,uBAAuB,GAClCC,SAA6F,IAC1F;EACH,IAAAC,sBAAe,EAACD,SAAS,CAAC;AAC5B,CAAC;AAAAR,OAAA,CAAAO,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -11,9 +11,11 @@ var _helpers = require("./helpers.js");
11
11
  const useText = () => {
12
12
  const config = (0, _effectorReact.useUnit)(_model.$localization);
13
13
  return (key, args = null) => {
14
- const translation = (0, _helpers.getTranslation)(config, key);
15
- if (args) return (0, _helpers.getSubstitutedString)(translation, args);
16
- return translation;
14
+ const translation = config?.[key];
15
+ if (translation && args) {
16
+ return (0, _helpers.getSubstitutedString)(translation, args);
17
+ }
18
+ return translation ?? key;
17
19
  };
18
20
  };
19
21
  exports.useText = useText;
@@ -1 +1 @@
1
- {"version":3,"names":["_effectorReact","require","_model","_react","_helpers","useText","config","useUnit","$localization","key","args","translation","getTranslation","getSubstitutedString","exports","useFeaturesLocalization","generator","useEffect","setLocalization"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AAEO,MAAMI,OAAO,GAAGA,CAAA,KAAe;EACpC,MAAMC,MAAM,GAAG,IAAAC,sBAAO,EAACC,oBAAa,CAAC;EAErC,OAAO,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;IAC3B,MAAMC,WAAW,GAAG,IAAAC,uBAAc,EAACN,MAAM,EAAEG,GAAG,CAAC;IAC/C,IAAIC,IAAI,EAAE,OAAO,IAAAG,6BAAoB,EAACF,WAAW,EAAED,IAAI,CAAC;IACxD,OAAOC,WAAW;EACpB,CAAC;AACH,CAAC;AAAAG,OAAA,CAAAT,OAAA,GAAAA,OAAA;AAEM,MAAMU,uBAAuB,GAClCC,SAAiF,IAC9E;EACH,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAAC,sBAAe,EAACF,SAAS,CAAC;EAC5B,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;AACjB,CAAC;AAAAF,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_effectorReact","require","_model","_react","_helpers","useText","config","useUnit","$localization","key","args","translation","getSubstitutedString","exports","useFeaturesLocalization","generator","useEffect","setLocalization"],"sourceRoot":"../../../../src","sources":["shared/translation/hooks.ts"],"mappings":";;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AAEO,MAAMI,OAAO,GAAGA,CAAA,KAAe;EAClC,MAAMC,MAAM,GAAG,IAAAC,sBAAO,EAACC,oBAAa,CAAuB;EAE3D,OAAO,CAACC,GAAG,EAAEC,IAAI,GAAG,IAAI,KAAK;IACzB,MAAMC,WAAW,GAAGL,MAAM,GAAGG,GAAG,CAAC;IAEjC,IAAIE,WAAW,IAAID,IAAI,EAAE;MACrB,OAAO,IAAAE,6BAAoB,EAACD,WAAW,EAAED,IAAI,CAAC;IAClD;IAEA,OAAOC,WAAW,IAAIF,GAAG;EAC7B,CAAC;AACL,CAAC;AAAAI,OAAA,CAAAR,OAAA,GAAAA,OAAA;AAEM,MAAMS,uBAAuB,GAChCC,SAA6F,IAC5F;EACD,IAAAC,gBAAS,EAAC,MAAM;IACZ,IAAAC,sBAAe,EAACF,SAAS,CAAC;EAC9B,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;AACnB,CAAC;AAAAF,OAAA,CAAAC,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -10,6 +10,6 @@ var _constants = require("./constants.js");
10
10
  const setLocalization = exports.setLocalization = (0, _effector.createEvent)();
11
11
  const $localization = exports.$localization = (0, _effector.createStore)(_constants.LOCALIZATION_CONFIGS[_types.Locale.EN]).on(setLocalization, (state, payload) => {
12
12
  if (typeof payload === 'function') return payload(_constants.LOCALIZATION_CONFIGS);
13
- return payload;
13
+ if (state.locale !== payload.locale) return payload;
14
14
  });
15
15
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_effector","require","_types","_constants","setLocalization","exports","createEvent","$localization","createStore","LOCALIZATION_CONFIGS","Locale","EN","on","state","payload"],"sourceRoot":"../../../../src","sources":["shared/translation/model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,qBAAW,EAExC,CAAC;AAEI,MAAMC,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAG,IAAAC,qBAAW,EAAeC,+BAAoB,CAACC,aAAM,CAACC,EAAE,CAAC,CAAC,CAACC,EAAE,CACxFR,eAAe,EACf,CAACS,KAAK,EAAEC,OAAO,KAAK;EAClB,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE,OAAOA,OAAO,CAACL,+BAAoB,CAAC;EACvE,OAAOK,OAAO;AAChB,CACF,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_effector","require","_types","_constants","setLocalization","exports","createEvent","$localization","createStore","LOCALIZATION_CONFIGS","Locale","EN","on","state","payload","locale"],"sourceRoot":"../../../../src","sources":["shared/translation/model.ts"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEO,MAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,IAAAE,qBAAW,EAExC,CAAC;AAEI,MAAMC,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAG,IAAAC,qBAAW,EAAqBC,+BAAoB,CAACC,aAAM,CAACC,EAAE,CAAC,CAAC,CAACC,EAAE,CAC5FR,eAAe,EACf,CAACS,KAAK,EAAEC,OAAO,KAAK;EAChB,IAAI,OAAOA,OAAO,KAAK,UAAU,EAAE,OAAOA,OAAO,CAACL,+BAAoB,CAAC;EACvE,IAAII,KAAK,CAACE,MAAM,KAAKD,OAAO,CAACC,MAAM,EAAE,OAAOD,OAAO;AACvD,CACJ,CAAC","ignoreList":[]}
@@ -9,5 +9,5 @@ let Locale = exports.Locale = /*#__PURE__*/function (Locale) {
9
9
  Locale["SW"] = "sv-SE";
10
10
  Locale["GB"] = "en-GB";
11
11
  return Locale;
12
- }({}); // Validation of translations, do not remove
12
+ }({});
13
13
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Locale","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":";;;;;;IAUYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA,OAMlB","ignoreList":[]}
1
+ {"version":3,"names":["Locale","exports"],"sourceRoot":"../../../../src","sources":["shared/translation/types.ts"],"mappings":";;;;;;IAUYA,MAAM,GAAAC,OAAA,CAAAD,MAAA,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA","ignoreList":[]}
@@ -175,10 +175,10 @@ export const CELEBRATION_VARIANTS = {
175
175
  },
176
176
  speedRange: {
177
177
  spark: [14, 28],
178
- main: [6, 18]
178
+ main: [12, 24]
179
179
  },
180
180
  life: 100,
181
- gravity: 0.1
181
+ gravity: 0.19
182
182
  },
183
183
  [CelebrationVariant.CORRECT_FINISH_ASSIGNMENT]: {
184
184
  color: COLORS.PRIMARY_GREEN,
@@ -210,10 +210,10 @@ export const CELEBRATION_VARIANTS = {
210
210
  },
211
211
  speedRange: {
212
212
  spark: [14, 28],
213
- main: [6, 18]
213
+ main: [12, 24]
214
214
  },
215
215
  life: 100,
216
- gravity: 0.1
216
+ gravity: 0.19
217
217
  }
218
218
  };
219
219
  //# sourceMappingURL=config.js.map