@magmamath/students-features 0.10.0 → 0.11.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/dist/commonjs/features/celebrations/helpers.js +4 -1
  2. package/dist/commonjs/features/celebrations/helpers.js.map +1 -1
  3. package/dist/commonjs/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
  4. package/dist/commonjs/features/chatbot/components/Chat/Chat.js +66 -30
  5. package/dist/commonjs/features/chatbot/components/Chat/Chat.js.map +1 -1
  6. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js +61 -0
  7. package/dist/commonjs/features/chatbot/components/Chat/CloseButton.js.map +1 -0
  8. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js +44 -54
  9. package/dist/commonjs/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  10. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js +3 -1
  11. package/dist/commonjs/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  12. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  13. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  14. package/dist/commonjs/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  15. package/dist/commonjs/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  16. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js +16 -4
  17. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
  18. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js +12 -20
  19. package/dist/commonjs/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  20. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -8
  21. package/dist/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  22. package/dist/commonjs/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  23. package/dist/commonjs/features/chatbot/components/Chatbot.js +29 -7
  24. package/dist/commonjs/features/chatbot/components/Chatbot.js.map +1 -1
  25. package/dist/commonjs/features/chatbot/constants.js +2 -1
  26. package/dist/commonjs/features/chatbot/constants.js.map +1 -1
  27. package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js +29 -0
  28. package/dist/commonjs/features/chatbot/helpers/ttsHighlight.js.map +1 -0
  29. package/dist/commonjs/features/chatbot/helpers.js +19 -2
  30. package/dist/commonjs/features/chatbot/helpers.js.map +1 -1
  31. package/dist/commonjs/features/chatbot/index.js.map +1 -1
  32. package/dist/commonjs/features/chatbot/model/ChatBotModel.js +59 -17
  33. package/dist/commonjs/features/chatbot/model/ChatBotModel.js.map +1 -1
  34. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js +2 -2
  35. package/dist/commonjs/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  36. package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js +56 -0
  37. package/dist/commonjs/features/chatbot/model/ChatTTSHighlightModel.js.map +1 -0
  38. package/dist/commonjs/features/chatbot/model/ChatTTSModel.js +154 -0
  39. package/dist/commonjs/features/chatbot/model/ChatTTSModel.js.map +1 -0
  40. package/dist/commonjs/features/chatbot/model/ChatbotApi.js +1 -1
  41. package/dist/commonjs/features/chatbot/model/ChatbotApi.js.map +1 -1
  42. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js +9 -0
  43. package/dist/commonjs/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  44. package/dist/commonjs/features/chatbot/types/model.types.js.map +1 -1
  45. package/dist/commonjs/features/chatbot/types/t2s.types.js.map +1 -1
  46. package/dist/commonjs/features/feedback/model/model.js.map +1 -1
  47. package/dist/commonjs/features/feedback/model/sockets.js +8 -5
  48. package/dist/commonjs/features/feedback/model/sockets.js.map +1 -1
  49. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +2 -2
  50. package/dist/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  51. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js +2 -2
  52. package/dist/commonjs/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  53. package/dist/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.js +4 -4
  54. package/dist/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.js.map +1 -1
  55. package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js +2 -2
  56. package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js.map +1 -1
  57. package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js +4 -4
  58. package/dist/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js.map +1 -1
  59. package/dist/commonjs/features/keyboard/components/Keyboard.js +4 -2
  60. package/dist/commonjs/features/keyboard/components/Keyboard.js.map +1 -1
  61. package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js +1 -6
  62. package/dist/commonjs/features/keyboard/components/MainLayout/MainLayout.js.map +1 -1
  63. package/dist/commonjs/features/keyboard/components/UnitsLayout/UnitTabs.js +1 -1
  64. package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js +3 -1
  65. package/dist/commonjs/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
  66. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +27 -6
  67. package/dist/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  68. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  69. package/dist/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  70. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js +1 -0
  71. package/dist/commonjs/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  72. package/dist/commonjs/features/keyboard/constants/constants.js +1 -1
  73. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js +2 -1
  74. package/dist/commonjs/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  75. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js +20 -4
  76. package/dist/commonjs/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  77. package/dist/commonjs/features/keyboard/helpers.js +7 -0
  78. package/dist/commonjs/features/keyboard/helpers.js.map +1 -1
  79. package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js +20 -3
  80. package/dist/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
  81. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js +6 -3
  82. package/dist/commonjs/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  83. package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js +34 -0
  84. package/dist/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.js.map +1 -0
  85. package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js +77 -0
  86. package/dist/commonjs/features/openEnded/components/OpenEndedScoreLabel.js.map +1 -0
  87. package/dist/commonjs/features/openEnded/index.js +48 -0
  88. package/dist/commonjs/features/openEnded/index.js.map +1 -0
  89. package/dist/commonjs/features/openEnded/oe.helpers.js +26 -0
  90. package/dist/commonjs/features/openEnded/oe.helpers.js.map +1 -0
  91. package/dist/commonjs/features/openEnded/oe.types.js +14 -0
  92. package/dist/commonjs/features/openEnded/oe.types.js.map +1 -0
  93. package/dist/commonjs/index.js +13 -1
  94. package/dist/commonjs/index.js.map +1 -1
  95. package/dist/commonjs/lib/components/ConditionalWrapper.js +23 -0
  96. package/dist/commonjs/lib/components/ConditionalWrapper.js.map +1 -0
  97. package/dist/commonjs/shared/common.constants.js +9 -0
  98. package/dist/commonjs/shared/common.constants.js.map +1 -0
  99. package/dist/commonjs/shared/icons/TimeIcon.js +37 -0
  100. package/dist/commonjs/shared/icons/TimeIcon.js.map +1 -0
  101. package/dist/commonjs/shared/icons/keyboard/CDotIcon/CDotIcon.js +4 -4
  102. package/dist/commonjs/shared/icons/keyboard/CDotIcon/CDotIcon.js.map +1 -1
  103. package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +32 -0
  104. package/dist/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +1 -0
  105. package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +32 -0
  106. package/dist/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +1 -0
  107. package/dist/commonjs/shared/translation/localization/ca.json +2 -1
  108. package/dist/commonjs/shared/translation/localization/de.json +2 -1
  109. package/dist/commonjs/shared/translation/localization/en.json +2 -1
  110. package/dist/commonjs/shared/translation/localization/gb.json +2 -1
  111. package/dist/commonjs/shared/translation/localization/sct.json +2 -1
  112. package/dist/commonjs/shared/translation/localization/sw.json +2 -1
  113. package/dist/commonjs/types/common.types.js +4 -0
  114. package/dist/module/features/celebrations/helpers.js +4 -1
  115. package/dist/module/features/celebrations/helpers.js.map +1 -1
  116. package/dist/module/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
  117. package/dist/module/features/chatbot/components/Chat/Chat.js +66 -30
  118. package/dist/module/features/chatbot/components/Chat/Chat.js.map +1 -1
  119. package/dist/module/features/chatbot/components/Chat/CloseButton.js +55 -0
  120. package/dist/module/features/chatbot/components/Chat/CloseButton.js.map +1 -0
  121. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js +44 -55
  122. package/dist/module/features/chatbot/components/ChatControls/ChatControls.js.map +1 -1
  123. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js +3 -1
  124. package/dist/module/features/chatbot/components/ChatInput/ChatInput.js.map +1 -1
  125. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js +2 -2
  126. package/dist/module/features/chatbot/components/ChatInput/FreeText/ChatTextInput.js.map +1 -1
  127. package/dist/module/features/chatbot/components/ChatInput/FreeText/SendMessageButton.js +1 -1
  128. package/dist/module/features/chatbot/components/ChatMessage/ChatMessage.js.map +1 -1
  129. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js +16 -4
  130. package/dist/module/features/chatbot/components/ChatMessage/MessageContent.js.map +1 -1
  131. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js +12 -20
  132. package/dist/module/features/chatbot/components/ChatMessage/MessageLoader.js.map +1 -1
  133. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js +13 -8
  134. package/dist/module/features/chatbot/components/ChatMessage/ReceivedMessage.js.map +1 -1
  135. package/dist/module/features/chatbot/components/ChatMessage/SentMessage.js +1 -1
  136. package/dist/module/features/chatbot/components/Chatbot.js +27 -6
  137. package/dist/module/features/chatbot/components/Chatbot.js.map +1 -1
  138. package/dist/module/features/chatbot/constants.js +1 -0
  139. package/dist/module/features/chatbot/constants.js.map +1 -1
  140. package/dist/module/features/chatbot/helpers/ttsHighlight.js +23 -0
  141. package/dist/module/features/chatbot/helpers/ttsHighlight.js.map +1 -0
  142. package/dist/module/features/chatbot/helpers.js +19 -2
  143. package/dist/module/features/chatbot/helpers.js.map +1 -1
  144. package/dist/module/features/chatbot/index.js.map +1 -1
  145. package/dist/module/features/chatbot/model/ChatBotModel.js +59 -17
  146. package/dist/module/features/chatbot/model/ChatBotModel.js.map +1 -1
  147. package/dist/module/features/chatbot/model/ChatBotThreadManager.js +2 -2
  148. package/dist/module/features/chatbot/model/ChatBotThreadManager.js.map +1 -1
  149. package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js +52 -0
  150. package/dist/module/features/chatbot/model/ChatTTSHighlightModel.js.map +1 -0
  151. package/dist/module/features/chatbot/model/ChatTTSModel.js +149 -0
  152. package/dist/module/features/chatbot/model/ChatTTSModel.js.map +1 -0
  153. package/dist/module/features/chatbot/model/ChatbotApi.js +1 -1
  154. package/dist/module/features/chatbot/model/ChatbotApi.js.map +1 -1
  155. package/dist/module/features/chatbot/model/ChatsCacheModel.js +9 -0
  156. package/dist/module/features/chatbot/model/ChatsCacheModel.js.map +1 -1
  157. package/dist/module/features/chatbot/types/model.types.js.map +1 -1
  158. package/dist/module/features/chatbot/types/t2s.types.js.map +1 -1
  159. package/dist/module/features/feedback/model/model.js.map +1 -1
  160. package/dist/module/features/feedback/model/sockets.js +8 -5
  161. package/dist/module/features/feedback/model/sockets.js.map +1 -1
  162. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js +3 -3
  163. package/dist/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.js.map +1 -1
  164. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js +2 -2
  165. package/dist/module/features/keyboard/components/BasicLayout/BasicLayout.js.map +1 -1
  166. package/dist/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.js +4 -4
  167. package/dist/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.js.map +1 -1
  168. package/dist/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js +2 -2
  169. package/dist/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.js.map +1 -1
  170. package/dist/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js +4 -4
  171. package/dist/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.js.map +1 -1
  172. package/dist/module/features/keyboard/components/Keyboard.js +4 -2
  173. package/dist/module/features/keyboard/components/Keyboard.js.map +1 -1
  174. package/dist/module/features/keyboard/components/KeysList/KeysList.js.map +1 -1
  175. package/dist/module/features/keyboard/components/MainLayout/MainLayout.js +2 -7
  176. package/dist/module/features/keyboard/components/MainLayout/MainLayout.js.map +1 -1
  177. package/dist/module/features/keyboard/components/UnitsLayout/UnitTabs.js +1 -1
  178. package/dist/module/features/keyboard/components/UnitsLayout/helpers.js +2 -1
  179. package/dist/module/features/keyboard/components/UnitsLayout/helpers.js.map +1 -1
  180. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js +27 -6
  181. package/dist/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.js.map +1 -1
  182. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js +9 -1
  183. package/dist/module/features/keyboard/components/UnitsLayout/keyboardGroups.js.map +1 -1
  184. package/dist/module/features/keyboard/components/UnitsLayout/types.js +1 -0
  185. package/dist/module/features/keyboard/components/UnitsLayout/types.js.map +1 -1
  186. package/dist/module/features/keyboard/constants/constants.js +1 -1
  187. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js +3 -2
  188. package/dist/module/features/keyboard/constants/keyboardGroupsByLocale.js.map +1 -1
  189. package/dist/module/features/keyboard/constants/keyboardLayouts.js +19 -4
  190. package/dist/module/features/keyboard/constants/keyboardLayouts.js.map +1 -1
  191. package/dist/module/features/keyboard/helpers.js +5 -0
  192. package/dist/module/features/keyboard/helpers.js.map +1 -1
  193. package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js +20 -3
  194. package/dist/module/features/keyboard/types/MathKeysGroups/basicOperators.js.map +1 -1
  195. package/dist/module/features/keyboard/types/MathKeysGroups/units.js +6 -3
  196. package/dist/module/features/keyboard/types/MathKeysGroups/units.js.map +1 -1
  197. package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js +28 -0
  198. package/dist/module/features/openEnded/components/OpenEndedAttemptsLimit.js.map +1 -0
  199. package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js +71 -0
  200. package/dist/module/features/openEnded/components/OpenEndedScoreLabel.js.map +1 -0
  201. package/dist/module/features/openEnded/index.js +7 -0
  202. package/dist/module/features/openEnded/index.js.map +1 -0
  203. package/dist/module/features/openEnded/oe.helpers.js +21 -0
  204. package/dist/module/features/openEnded/oe.helpers.js.map +1 -0
  205. package/dist/module/features/openEnded/oe.types.js +10 -0
  206. package/dist/module/features/openEnded/oe.types.js.map +1 -0
  207. package/dist/module/index.js +1 -0
  208. package/dist/module/index.js.map +1 -1
  209. package/dist/module/lib/components/ConditionalWrapper.js +17 -0
  210. package/dist/module/lib/components/ConditionalWrapper.js.map +1 -0
  211. package/dist/module/shared/common.constants.js +5 -0
  212. package/dist/module/shared/common.constants.js.map +1 -0
  213. package/dist/module/shared/icons/TimeIcon.js +29 -0
  214. package/dist/module/shared/icons/TimeIcon.js.map +1 -0
  215. package/dist/module/shared/icons/keyboard/CDotIcon/CDotIcon.js +4 -4
  216. package/dist/module/shared/icons/keyboard/CDotIcon/CDotIcon.js.map +1 -1
  217. package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js +24 -0
  218. package/dist/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.js.map +1 -0
  219. package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js +24 -0
  220. package/dist/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.js.map +1 -0
  221. package/dist/module/shared/translation/localization/ca.json +2 -1
  222. package/dist/module/shared/translation/localization/de.json +2 -1
  223. package/dist/module/shared/translation/localization/en.json +2 -1
  224. package/dist/module/shared/translation/localization/gb.json +2 -1
  225. package/dist/module/shared/translation/localization/sct.json +2 -1
  226. package/dist/module/shared/translation/localization/sw.json +2 -1
  227. package/dist/module/types/common.types.js +2 -0
  228. package/dist/typescript/commonjs/features/celebrations/helpers.d.ts.map +1 -1
  229. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts +7 -2
  230. package/dist/typescript/commonjs/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  231. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts +7 -0
  232. package/dist/typescript/commonjs/features/chatbot/components/Chat/CloseButton.d.ts.map +1 -0
  233. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -2
  234. package/dist/typescript/commonjs/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  235. package/dist/typescript/commonjs/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  236. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts +3 -1
  237. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  238. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts +4 -2
  239. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
  240. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts +1 -6
  241. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  242. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  243. package/dist/typescript/commonjs/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  244. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts +4 -1
  245. package/dist/typescript/commonjs/features/chatbot/components/Chatbot.d.ts.map +1 -1
  246. package/dist/typescript/commonjs/features/chatbot/constants.d.ts +1 -0
  247. package/dist/typescript/commonjs/features/chatbot/constants.d.ts.map +1 -1
  248. package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts +8 -0
  249. package/dist/typescript/commonjs/features/chatbot/helpers/ttsHighlight.d.ts.map +1 -0
  250. package/dist/typescript/commonjs/features/chatbot/helpers.d.ts.map +1 -1
  251. package/dist/typescript/commonjs/features/chatbot/index.d.ts +3 -2
  252. package/dist/typescript/commonjs/features/chatbot/index.d.ts.map +1 -1
  253. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts +6 -3
  254. package/dist/typescript/commonjs/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  255. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts +4 -3
  256. package/dist/typescript/commonjs/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
  257. package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts +25 -0
  258. package/dist/typescript/commonjs/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +1 -0
  259. package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts +38 -0
  260. package/dist/typescript/commonjs/features/chatbot/model/ChatTTSModel.d.ts.map +1 -0
  261. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts +1 -0
  262. package/dist/typescript/commonjs/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  263. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts +28 -16
  264. package/dist/typescript/commonjs/features/chatbot/types/api.types.d.ts.map +1 -1
  265. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts +14 -11
  266. package/dist/typescript/commonjs/features/chatbot/types/model.types.d.ts.map +1 -1
  267. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts +25 -0
  268. package/dist/typescript/commonjs/features/chatbot/types/t2s.types.d.ts.map +1 -1
  269. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts +1 -0
  270. package/dist/typescript/commonjs/features/chatbot/types/units.types.d.ts.map +1 -1
  271. package/dist/typescript/commonjs/features/feedback/model/model.d.ts +4 -1
  272. package/dist/typescript/commonjs/features/feedback/model/model.d.ts.map +1 -1
  273. package/dist/typescript/commonjs/features/feedback/model/sockets.d.ts.map +1 -1
  274. package/dist/typescript/commonjs/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  275. package/dist/typescript/commonjs/features/keyboard/components/BasicPlusLayout/keyboardGroups.d.ts.map +1 -1
  276. package/dist/typescript/commonjs/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.d.ts.map +1 -1
  277. package/dist/typescript/commonjs/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.d.ts.map +1 -1
  278. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts +2 -1
  279. package/dist/typescript/commonjs/features/keyboard/components/Keyboard.d.ts.map +1 -1
  280. package/dist/typescript/commonjs/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -1
  281. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
  282. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
  283. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
  284. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  285. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  286. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  287. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
  288. package/dist/typescript/commonjs/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  289. package/dist/typescript/commonjs/features/keyboard/constants/constants.d.ts +1 -1
  290. package/dist/typescript/commonjs/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  291. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts +4 -0
  292. package/dist/typescript/commonjs/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  293. package/dist/typescript/commonjs/features/keyboard/helpers.d.ts +1 -0
  294. package/dist/typescript/commonjs/features/keyboard/helpers.d.ts.map +1 -1
  295. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +10 -0
  296. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
  297. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts +36 -0
  298. package/dist/typescript/commonjs/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  299. package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +7 -0
  300. package/dist/typescript/commonjs/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +1 -0
  301. package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts +12 -0
  302. package/dist/typescript/commonjs/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +1 -0
  303. package/dist/typescript/commonjs/features/openEnded/index.d.ts +5 -0
  304. package/dist/typescript/commonjs/features/openEnded/index.d.ts.map +1 -0
  305. package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts +13 -0
  306. package/dist/typescript/commonjs/features/openEnded/oe.helpers.d.ts.map +1 -0
  307. package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts +7 -0
  308. package/dist/typescript/commonjs/features/openEnded/oe.types.d.ts.map +1 -0
  309. package/dist/typescript/commonjs/index.d.ts +1 -0
  310. package/dist/typescript/commonjs/index.d.ts.map +1 -1
  311. package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts +9 -0
  312. package/dist/typescript/commonjs/lib/components/ConditionalWrapper.d.ts.map +1 -0
  313. package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts +1 -1
  314. package/dist/typescript/commonjs/lib/effector/createControllerEffect.d.ts.map +1 -1
  315. package/dist/typescript/commonjs/shared/common.constants.d.ts +2 -0
  316. package/dist/typescript/commonjs/shared/common.constants.d.ts.map +1 -0
  317. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts +4 -0
  318. package/dist/typescript/commonjs/shared/icons/TimeIcon.d.ts.map +1 -0
  319. package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +4 -0
  320. package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +1 -0
  321. package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +4 -0
  322. package/dist/typescript/commonjs/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +1 -0
  323. package/dist/typescript/commonjs/shared/translation/constants.d.ts +6 -0
  324. package/dist/typescript/commonjs/shared/translation/constants.d.ts.map +1 -1
  325. package/dist/typescript/commonjs/shared/translation/model.d.ts +2 -0
  326. package/dist/typescript/commonjs/shared/translation/model.d.ts.map +1 -1
  327. package/dist/typescript/commonjs/types/common.types.d.ts +2 -0
  328. package/dist/typescript/commonjs/types/common.types.d.ts.map +1 -1
  329. package/dist/typescript/module/features/celebrations/helpers.d.ts.map +1 -1
  330. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts +7 -2
  331. package/dist/typescript/module/features/chatbot/components/Chat/Chat.d.ts.map +1 -1
  332. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts +7 -0
  333. package/dist/typescript/module/features/chatbot/components/Chat/CloseButton.d.ts.map +1 -0
  334. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts +3 -2
  335. package/dist/typescript/module/features/chatbot/components/ChatControls/ChatControls.d.ts.map +1 -1
  336. package/dist/typescript/module/features/chatbot/components/ChatInput/ChatInput.d.ts.map +1 -1
  337. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts +3 -1
  338. package/dist/typescript/module/features/chatbot/components/ChatMessage/ChatMessage.d.ts.map +1 -1
  339. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts +4 -2
  340. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageContent.d.ts.map +1 -1
  341. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts +1 -6
  342. package/dist/typescript/module/features/chatbot/components/ChatMessage/MessageLoader.d.ts.map +1 -1
  343. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts +1 -1
  344. package/dist/typescript/module/features/chatbot/components/ChatMessage/ReceivedMessage.d.ts.map +1 -1
  345. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts +4 -1
  346. package/dist/typescript/module/features/chatbot/components/Chatbot.d.ts.map +1 -1
  347. package/dist/typescript/module/features/chatbot/constants.d.ts +1 -0
  348. package/dist/typescript/module/features/chatbot/constants.d.ts.map +1 -1
  349. package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts +8 -0
  350. package/dist/typescript/module/features/chatbot/helpers/ttsHighlight.d.ts.map +1 -0
  351. package/dist/typescript/module/features/chatbot/helpers.d.ts.map +1 -1
  352. package/dist/typescript/module/features/chatbot/index.d.ts +3 -2
  353. package/dist/typescript/module/features/chatbot/index.d.ts.map +1 -1
  354. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts +6 -3
  355. package/dist/typescript/module/features/chatbot/model/ChatBotModel.d.ts.map +1 -1
  356. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts +4 -3
  357. package/dist/typescript/module/features/chatbot/model/ChatBotThreadManager.d.ts.map +1 -1
  358. package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts +25 -0
  359. package/dist/typescript/module/features/chatbot/model/ChatTTSHighlightModel.d.ts.map +1 -0
  360. package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts +38 -0
  361. package/dist/typescript/module/features/chatbot/model/ChatTTSModel.d.ts.map +1 -0
  362. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts +1 -0
  363. package/dist/typescript/module/features/chatbot/model/ChatsCacheModel.d.ts.map +1 -1
  364. package/dist/typescript/module/features/chatbot/types/api.types.d.ts +28 -16
  365. package/dist/typescript/module/features/chatbot/types/api.types.d.ts.map +1 -1
  366. package/dist/typescript/module/features/chatbot/types/model.types.d.ts +14 -11
  367. package/dist/typescript/module/features/chatbot/types/model.types.d.ts.map +1 -1
  368. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts +25 -0
  369. package/dist/typescript/module/features/chatbot/types/t2s.types.d.ts.map +1 -1
  370. package/dist/typescript/module/features/chatbot/types/units.types.d.ts +1 -0
  371. package/dist/typescript/module/features/chatbot/types/units.types.d.ts.map +1 -1
  372. package/dist/typescript/module/features/feedback/model/model.d.ts +4 -1
  373. package/dist/typescript/module/features/feedback/model/model.d.ts.map +1 -1
  374. package/dist/typescript/module/features/feedback/model/sockets.d.ts.map +1 -1
  375. package/dist/typescript/module/features/keyboard/components/AlgebraLayout/AlgebraLayout.d.ts.map +1 -1
  376. package/dist/typescript/module/features/keyboard/components/BasicPlusLayout/keyboardGroups.d.ts.map +1 -1
  377. package/dist/typescript/module/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.d.ts.map +1 -1
  378. package/dist/typescript/module/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.d.ts.map +1 -1
  379. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts +2 -1
  380. package/dist/typescript/module/features/keyboard/components/Keyboard.d.ts.map +1 -1
  381. package/dist/typescript/module/features/keyboard/components/MainLayout/MainLayout.d.ts.map +1 -1
  382. package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts +1 -0
  383. package/dist/typescript/module/features/keyboard/components/UnitsLayout/helpers.d.ts.map +1 -1
  384. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts +4 -7
  385. package/dist/typescript/module/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.d.ts.map +1 -1
  386. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts +1 -0
  387. package/dist/typescript/module/features/keyboard/components/UnitsLayout/keyboardGroups.d.ts.map +1 -1
  388. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts +7 -1
  389. package/dist/typescript/module/features/keyboard/components/UnitsLayout/types.d.ts.map +1 -1
  390. package/dist/typescript/module/features/keyboard/constants/constants.d.ts +1 -1
  391. package/dist/typescript/module/features/keyboard/constants/keyboardGroupsByLocale.d.ts.map +1 -1
  392. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts +4 -0
  393. package/dist/typescript/module/features/keyboard/constants/keyboardLayouts.d.ts.map +1 -1
  394. package/dist/typescript/module/features/keyboard/helpers.d.ts +1 -0
  395. package/dist/typescript/module/features/keyboard/helpers.d.ts.map +1 -1
  396. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts +10 -0
  397. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/basicOperators.d.ts.map +1 -1
  398. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts +36 -0
  399. package/dist/typescript/module/features/keyboard/types/MathKeysGroups/units.d.ts.map +1 -1
  400. package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts +7 -0
  401. package/dist/typescript/module/features/openEnded/components/OpenEndedAttemptsLimit.d.ts.map +1 -0
  402. package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts +12 -0
  403. package/dist/typescript/module/features/openEnded/components/OpenEndedScoreLabel.d.ts.map +1 -0
  404. package/dist/typescript/module/features/openEnded/index.d.ts +5 -0
  405. package/dist/typescript/module/features/openEnded/index.d.ts.map +1 -0
  406. package/dist/typescript/module/features/openEnded/oe.helpers.d.ts +13 -0
  407. package/dist/typescript/module/features/openEnded/oe.helpers.d.ts.map +1 -0
  408. package/dist/typescript/module/features/openEnded/oe.types.d.ts +7 -0
  409. package/dist/typescript/module/features/openEnded/oe.types.d.ts.map +1 -0
  410. package/dist/typescript/module/index.d.ts +1 -0
  411. package/dist/typescript/module/index.d.ts.map +1 -1
  412. package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts +9 -0
  413. package/dist/typescript/module/lib/components/ConditionalWrapper.d.ts.map +1 -0
  414. package/dist/typescript/module/lib/effector/createControllerEffect.d.ts +1 -1
  415. package/dist/typescript/module/lib/effector/createControllerEffect.d.ts.map +1 -1
  416. package/dist/typescript/module/shared/common.constants.d.ts +2 -0
  417. package/dist/typescript/module/shared/common.constants.d.ts.map +1 -0
  418. package/dist/typescript/module/shared/icons/TimeIcon.d.ts +4 -0
  419. package/dist/typescript/module/shared/icons/TimeIcon.d.ts.map +1 -0
  420. package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts +4 -0
  421. package/dist/typescript/module/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.d.ts.map +1 -0
  422. package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts +4 -0
  423. package/dist/typescript/module/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.d.ts.map +1 -0
  424. package/dist/typescript/module/shared/translation/constants.d.ts +6 -0
  425. package/dist/typescript/module/shared/translation/constants.d.ts.map +1 -1
  426. package/dist/typescript/module/shared/translation/model.d.ts +2 -0
  427. package/dist/typescript/module/shared/translation/model.d.ts.map +1 -1
  428. package/dist/typescript/module/types/common.types.d.ts +2 -0
  429. package/dist/typescript/module/types/common.types.d.ts.map +1 -1
  430. package/package.json +1 -1
  431. package/src/features/celebrations/helpers.ts +35 -33
  432. package/src/features/chatbot/TTS_HIGHLIGHTING.md +120 -0
  433. package/src/features/chatbot/components/Chat/Chat.tsx +76 -33
  434. package/src/features/chatbot/components/Chat/CloseButton.tsx +60 -0
  435. package/src/features/chatbot/components/ChatControls/ChatControls.tsx +45 -60
  436. package/src/features/chatbot/components/ChatInput/ChatInput.tsx +3 -1
  437. package/src/features/chatbot/components/ChatInput/FreeText/ChatTextInput.tsx +2 -2
  438. package/src/features/chatbot/components/ChatInput/FreeText/SendMessageButton.tsx +1 -1
  439. package/src/features/chatbot/components/ChatMessage/ChatMessage.tsx +3 -1
  440. package/src/features/chatbot/components/ChatMessage/MessageContent.tsx +25 -3
  441. package/src/features/chatbot/components/ChatMessage/MessageLoader.tsx +9 -21
  442. package/src/features/chatbot/components/ChatMessage/ReceivedMessage.tsx +11 -6
  443. package/src/features/chatbot/components/ChatMessage/SentMessage.tsx +1 -1
  444. package/src/features/chatbot/components/Chatbot.tsx +28 -3
  445. package/src/features/chatbot/constants.ts +2 -0
  446. package/src/features/chatbot/helpers/ttsHighlight.ts +25 -0
  447. package/src/features/chatbot/helpers.ts +14 -1
  448. package/src/features/chatbot/index.ts +17 -2
  449. package/src/features/chatbot/model/ChatBotModel.ts +67 -16
  450. package/src/features/chatbot/model/ChatBotThreadManager.ts +12 -4
  451. package/src/features/chatbot/model/ChatTTSHighlightModel.ts +64 -0
  452. package/src/features/chatbot/model/ChatTTSModel.ts +168 -0
  453. package/src/features/chatbot/model/ChatbotApi.ts +1 -1
  454. package/src/features/chatbot/model/ChatsCacheModel.ts +11 -0
  455. package/src/features/chatbot/types/api.types.ts +25 -19
  456. package/src/features/chatbot/types/model.types.ts +23 -12
  457. package/src/features/chatbot/types/t2s.types.ts +33 -0
  458. package/src/features/chatbot/types/units.types.ts +1 -0
  459. package/src/features/feedback/model/model.ts +4 -1
  460. package/src/features/feedback/model/sockets.ts +8 -6
  461. package/src/features/keyboard/components/AlgebraLayout/AlgebraLayout.tsx +4 -3
  462. package/src/features/keyboard/components/BasicLayout/BasicLayout.tsx +2 -2
  463. package/src/features/keyboard/components/BasicPlusLayout/keyboardGroups.ts +27 -17
  464. package/src/features/keyboard/components/BasicPlusPlusLayout/BasicPlusPlusLayout.tsx +3 -2
  465. package/src/features/keyboard/components/BasicPlusPlusLayout/keyboardGroups.ts +30 -24
  466. package/src/features/keyboard/components/Keyboard.tsx +14 -4
  467. package/src/features/keyboard/components/KeysList/KeysList.tsx +1 -1
  468. package/src/features/keyboard/components/MainLayout/MainLayout.tsx +2 -6
  469. package/src/features/keyboard/components/UnitsLayout/UnitTabs.tsx +1 -1
  470. package/src/features/keyboard/components/UnitsLayout/helpers.tsx +3 -0
  471. package/src/features/keyboard/components/UnitsLayout/hooks/useUnitTabs.ts +36 -22
  472. package/src/features/keyboard/components/UnitsLayout/keyboardGroups.ts +11 -0
  473. package/src/features/keyboard/components/UnitsLayout/types.ts +7 -0
  474. package/src/features/keyboard/constants/constants.ts +1 -1
  475. package/src/features/keyboard/constants/keyboardGroupsByLocale.ts +2 -0
  476. package/src/features/keyboard/constants/keyboardLayouts.ts +18 -1
  477. package/src/features/keyboard/helpers.ts +6 -0
  478. package/src/features/keyboard/types/MathKeysGroups/basicOperators.tsx +15 -3
  479. package/src/features/keyboard/types/MathKeysGroups/units.tsx +3 -0
  480. package/src/features/openEnded/components/OpenEndedAttemptsLimit.tsx +26 -0
  481. package/src/features/openEnded/components/OpenEndedScoreLabel.tsx +81 -0
  482. package/src/features/openEnded/index.ts +4 -0
  483. package/src/features/openEnded/oe.helpers.ts +31 -0
  484. package/src/features/openEnded/oe.types.ts +6 -0
  485. package/src/index.ts +1 -0
  486. package/src/lib/components/ConditionalWrapper.tsx +15 -0
  487. package/src/lib/effector/createControllerEffect.ts +1 -1
  488. package/src/shared/common.constants.ts +3 -0
  489. package/src/shared/icons/TimeIcon.tsx +23 -0
  490. package/src/shared/icons/keyboard/CDotIcon/CDotIcon.tsx +2 -2
  491. package/src/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.tsx +18 -0
  492. package/src/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.tsx +18 -0
  493. package/src/shared/translation/localization/ca.json +2 -1
  494. package/src/shared/translation/localization/de.json +2 -1
  495. package/src/shared/translation/localization/en.json +2 -1
  496. package/src/shared/translation/localization/gb.json +2 -1
  497. package/src/shared/translation/localization/sct.json +2 -1
  498. package/src/shared/translation/localization/sw.json +2 -1
  499. package/src/types/common.types.ts +4 -0
  500. package/dist/commonjs/features/chatbot/model/t2s.js +0 -107
  501. package/dist/commonjs/features/chatbot/model/t2s.js.map +0 -1
  502. package/dist/module/features/chatbot/model/t2s.js +0 -102
  503. package/dist/module/features/chatbot/model/t2s.js.map +0 -1
  504. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts +0 -34
  505. package/dist/typescript/commonjs/features/chatbot/model/t2s.d.ts.map +0 -1
  506. package/dist/typescript/module/features/chatbot/model/t2s.d.ts +0 -34
  507. package/dist/typescript/module/features/chatbot/model/t2s.d.ts.map +0 -1
  508. package/src/features/chatbot/model/t2s.ts +0 -123
@@ -1 +1 @@
1
- {"version":3,"file":"createControllerEffect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createControllerEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAClD,UAAU,EAAE,eAAe,CAAA;CAC5B,CAAA;AAED,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAErD,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAClD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,uCAM9D,sBAAsB,CAAC,CAAC,CAAC,gBAwB7B;AAED,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,CAAC,aACrC,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,2BAa7D,CAAA"}
1
+ {"version":3,"file":"createControllerEffect.d.ts","sourceRoot":"","sources":["../../../../../src/lib/effector/createControllerEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,UAAU,CAAA;AAMpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAClD,UAAU,EAAE,eAAe,CAAA;CAC5B,CAAA;AAED,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAA;AAE5D,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,IAAI,EAClD,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,uCAM9D,sBAAsB,CAAC,CAAC,CAAC,gBAwB7B;AAED,eAAO,MAAM,sBAAsB,GAAI,CAAC,EAAE,CAAC,aACrC,CAAC,KAAK,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,2BAa7D,CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const isWeb: boolean;
2
+ //# sourceMappingURL=common.constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.constants.d.ts","sourceRoot":"","sources":["../../../../src/shared/common.constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,SAAwB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { IconProps } from './icon.types';
2
+ import React from 'react';
3
+ export declare const TimeIcon: ({ size, color }: IconProps) => React.JSX.Element;
4
+ //# sourceMappingURL=TimeIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimeIcon.d.ts","sourceRoot":"","sources":["../../../../../src/shared/icons/TimeIcon.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAExC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,QAAQ,oBAA6C,SAAS,sBAiB1E,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IconProps } from '../../icon.types';
3
+ export declare const RoundBracketLeftIcon: ({ size, color }: IconProps) => React.JSX.Element;
4
+ //# sourceMappingURL=RoundBracketLeftIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoundBracketLeftIcon.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/icons/keyboard/RoundBracketLeftIcon/RoundBracketLeftIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAK5C,eAAO,MAAM,oBAAoB,oBAA0B,SAAS,sBAWnE,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { IconProps } from '../../icon.types';
3
+ export declare const RoundBracketRightIcon: ({ size, color }: IconProps) => React.JSX.Element;
4
+ //# sourceMappingURL=RoundBracketRightIcon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoundBracketRightIcon.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/icons/keyboard/RoundBracketRightIcon/RoundBracketRightIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAK5C,eAAO,MAAM,qBAAqB,oBAA0B,SAAS,sBAWpE,CAAA"}
@@ -39,6 +39,7 @@ export declare const LOCALIZATION_CONFIGS: {
39
39
  area: string;
40
40
  volume: string;
41
41
  weight: string;
42
+ time: string;
42
43
  };
43
44
  };
44
45
  "en-GB": {
@@ -81,6 +82,7 @@ export declare const LOCALIZATION_CONFIGS: {
81
82
  area: string;
82
83
  volume: string;
83
84
  weight: string;
85
+ time: string;
84
86
  };
85
87
  };
86
88
  "sv-SE": {
@@ -123,6 +125,7 @@ export declare const LOCALIZATION_CONFIGS: {
123
125
  area: string;
124
126
  volume: string;
125
127
  weight: string;
128
+ time: string;
126
129
  };
127
130
  };
128
131
  "en-CA": {
@@ -165,6 +168,7 @@ export declare const LOCALIZATION_CONFIGS: {
165
168
  area: string;
166
169
  volume: string;
167
170
  weight: string;
171
+ time: string;
168
172
  };
169
173
  };
170
174
  "en-SCT": {
@@ -207,6 +211,7 @@ export declare const LOCALIZATION_CONFIGS: {
207
211
  area: string;
208
212
  volume: string;
209
213
  weight: string;
214
+ time: string;
210
215
  };
211
216
  };
212
217
  "de-DE": {
@@ -249,6 +254,7 @@ export declare const LOCALIZATION_CONFIGS: {
249
254
  area: string;
250
255
  volume: string;
251
256
  weight: string;
257
+ time: string;
252
258
  };
253
259
  };
254
260
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhC,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/shared/translation/constants.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAOhC,CAAA"}
@@ -40,6 +40,7 @@ export declare const setLocalization: import("effector").EventCallable<{
40
40
  area: string;
41
41
  volume: string;
42
42
  weight: string;
43
+ time: string;
43
44
  };
44
45
  } | ((config: typeof LOCALIZATION_CONFIGS) => Translations)>;
45
46
  export declare const $localization: import("effector").StoreWritable<{
@@ -82,6 +83,7 @@ export declare const $localization: import("effector").StoreWritable<{
82
83
  area: string;
83
84
  volume: string;
84
85
  weight: string;
86
+ time: string;
85
87
  };
86
88
  }>;
87
89
  //# 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,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,5 +1,7 @@
1
+ import { COLORS } from '@magmamath/react-native-ui';
1
2
  export type Size = {
2
3
  width: number;
3
4
  height: number;
4
5
  };
6
+ export type ColorValue = (typeof COLORS)[keyof typeof COLORS];
5
7
  //# sourceMappingURL=common.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../../src/types/common.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
1
+ {"version":3,"file":"common.types.d.ts","sourceRoot":"","sources":["../../../../src/types/common.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEnD,MAAM,MAAM,IAAI,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magmamath/students-features",
3
- "version": "0.10.0",
3
+ "version": "0.11.0-rc.0",
4
4
  "description": "Magmamath features library",
5
5
  "source": "src/index.ts",
6
6
  "main": "src/index.ts",
@@ -1,39 +1,41 @@
1
- import { ParticlesBatch } from './components/ParticleBatch';
2
- import { Spark } from './components/Spark';
3
- import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config';
4
- import { CelebrationVariant } from './types';
1
+ import { ParticlesBatch } from './components/ParticleBatch'
2
+ import { Spark } from './components/Spark'
3
+ import { CELEBRATION_ICON_CONFIG, CELEBRATION_VARIANTS } from './config'
4
+ import { CelebrationVariant } from './types'
5
5
 
6
- export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min;
6
+ export const randomRange = (min: number, max: number) => Math.random() * (max - min) + min
7
7
 
8
8
  const isDateInRange = (currentDate: Date, startDateStr: string, endDateStr: string) => {
9
- const [startDay, startMonth] = startDateStr.split('-').map(Number);
10
- const [endDay, endMonth] = endDateStr.split('-').map(Number);
9
+ const [startDay, startMonth] = startDateStr.split('-').map(Number)
10
+ const [endDay, endMonth] = endDateStr.split('-').map(Number)
11
11
 
12
- const currentYear = currentDate.getFullYear();
13
- const startDate = new Date(currentYear, startMonth - 1, startDay);
14
- const endDate = new Date(currentYear, endMonth - 1, endDay + 1);
12
+ const currentYear = currentDate.getFullYear()
13
+ const startDate = new Date(currentYear, startMonth - 1, startDay)
15
14
 
16
- return currentDate >= startDate && currentDate <= endDate;
17
- };
15
+ // If end month is earlier than start month, it spans to next year
16
+ const endYear = endMonth < startMonth ? currentYear + 1 : currentYear
17
+ const endDate = new Date(endYear, endMonth - 1, endDay + 1)
18
+
19
+ return currentDate >= startDate && currentDate <= endDate
20
+ }
18
21
 
19
22
  export const getIconForCurrentDate = () => {
20
- const currentDate = new Date();
23
+ const currentDate = new Date()
21
24
 
22
25
  for (const celebration of CELEBRATION_ICON_CONFIG) {
23
26
  if (celebration.activePeriod) {
24
- const { start, end } = celebration.activePeriod;
27
+ const { start, end } = celebration.activePeriod
25
28
  if (isDateInRange(currentDate, start, end)) {
26
- return celebration.Icon;
29
+ return celebration.Icon
27
30
  }
28
31
  }
29
32
  }
30
33
 
31
- return CELEBRATION_ICON_CONFIG[0].Icon;
32
- };
34
+ return CELEBRATION_ICON_CONFIG[0].Icon
35
+ }
33
36
 
34
- const MainIcon = getIconForCurrentDate();
35
- export const generateParticle = (variant: CelebrationVariant
36
- ) => {
37
+ const MainIcon = getIconForCurrentDate()
38
+ export const generateParticle = (variant: CelebrationVariant) => {
37
39
  const {
38
40
  elementsCount,
39
41
  angle,
@@ -44,20 +46,20 @@ export const generateParticle = (variant: CelebrationVariant
44
46
  friction,
45
47
  life,
46
48
  angularAcceleration,
47
- speedRange
48
- } = CELEBRATION_VARIANTS[variant];
49
+ speedRange,
50
+ } = CELEBRATION_VARIANTS[variant]
49
51
 
50
52
  const sparkSpeedMin = speedRange?.spark?.[0]
51
53
  const sparkSpeedMax = speedRange?.spark?.[1]
52
54
  const mainSpeedMin = speedRange?.main?.[0]
53
55
  const mainSpeedMax = speedRange?.main?.[1]
54
56
 
55
- const particles: ParticlesBatch[] = [];
57
+ const particles: ParticlesBatch[] = []
56
58
 
57
59
  for (let i = 0; i < elementsCount.spark; i++) {
58
- const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180);
59
- const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax);
60
- const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to);
60
+ const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
61
+ const randomSpeed = randomRange(sparkSpeedMin, sparkSpeedMax)
62
+ const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
61
63
 
62
64
  particles.push({
63
65
  id: Math.random(),
@@ -74,12 +76,12 @@ export const generateParticle = (variant: CelebrationVariant
74
76
  friction,
75
77
  Component: Spark,
76
78
  life,
77
- });
79
+ })
78
80
  }
79
81
  for (let i = 0; i < elementsCount.star; i++) {
80
- const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180);
81
- const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax);
82
- const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to);
82
+ const randomAngle = randomRange((angle.from * Math.PI) / 180, (angle.to * Math.PI) / 180)
83
+ const randomSpeed = randomRange(mainSpeedMin, mainSpeedMax)
84
+ const randomAngularAcceleration = randomRange(angularAcceleration.from, angularAcceleration.to)
83
85
 
84
86
  particles.push({
85
87
  id: Math.random(),
@@ -96,8 +98,8 @@ export const generateParticle = (variant: CelebrationVariant
96
98
  friction,
97
99
  Component: MainIcon,
98
100
  life,
99
- });
101
+ })
100
102
  }
101
103
 
102
- return particles;
103
- };
104
+ return particles
105
+ }
@@ -0,0 +1,120 @@
1
+ # TTS Word-by-Word Highlighting
2
+
3
+ ## Overview
4
+
5
+ Word-by-word text highlighting synchronized with text-to-speech playback in the chatbot. The feature is optional and enabled via `isWordHighlightEnabled` config flag.
6
+
7
+ ## How It Works
8
+
9
+ ```
10
+ ┌─────────────────────────────────────────────────────────────────┐
11
+ │ 1. User clicks TTS button on a message │
12
+ │ ↓ │
13
+ │ 2. Text is converted to SSML with word marks │
14
+ │ "Hello world" → <speak><mark name="w_0"/>Hello │
15
+ │ <mark name="w_1"/>world</speak> │
16
+ │ ↓ │
17
+ │ 3. Google TTS API returns audio + timepoints │
18
+ │ [{ markName: "w_0", timeSeconds: 0.0 }, │
19
+ │ { markName: "w_1", timeSeconds: 0.5 }] │
20
+ │ ↓ │
21
+ │ 4. Audio plays, onTimeUpdate fires via RAF loop │
22
+ │ ↓ │
23
+ │ 5. Current time → find matching timepoint → word index │
24
+ │ ↓ │
25
+ │ 6. $highlightedWordIndex updates → UI re-renders highlighted │
26
+ └─────────────────────────────────────────────────────────────────┘
27
+ ```
28
+
29
+ ## Usage
30
+
31
+ ```tsx
32
+ // In students-web model setup
33
+ chatModel.bot.setUpT2S({
34
+ audioProvider: createT2SAudioProvider(),
35
+ textSanitizer: removeKatexPartFromTextToSpeech,
36
+ isWordHighlightEnabled: true,
37
+ })
38
+ ```
39
+
40
+ ## Architecture
41
+
42
+ ### ChatTTSModel (ChatTTSModel.ts)
43
+
44
+ Handles TTS playback and word highlighting. Key design decisions:
45
+
46
+ - **Map-based cache** — `audioCache: Map<string, AudioCache>` stores both `audioPath` and `timepoints` per message. When highlighting is off, `timepoints` is `[]`. Cache lives for the model's lifetime (cleared when user leaves the problem).
47
+ - **`fetchAudio()` method** — encapsulates API call + audioContent decoding. Highlight vs non-highlight differences are ternaries (SSML vs plain text, `enableTimePointing`).
48
+ - **`play()` is linear** — cache lookup → fetch if miss → store → activate highlight if enabled → play audio. No branching between highlight/non-highlight paths.
49
+ - **Pause/resume guards** — `wordHighlightEnabled` check before toggling `setIsActive(false)`/`setIsActive(true)` on pause/resume.
50
+ - **`wordHighlightEnabled` (private)** — stored result of `!!isWordHighlightEnabled && !!audioProvider.onTimeUpdate`. Set once at `setConfig`.
51
+ - **`isWordHighlightEnabled` (public getter)** — read-only access for external consumers (e.g. `Chat.tsx`).
52
+
53
+ ### AudioProvider type
54
+
55
+ ```typescript
56
+ type AudioProvider = {
57
+ play: (audioPath: string, onPlaybackComplete: () => void) => Promise<void>
58
+ pause: () => void
59
+ resume: () => void
60
+ stop: () => void
61
+ onTimeUpdate?: OnTimeUpdate // optional — presence enables highlight capability
62
+ }
63
+ ```
64
+
65
+ `onTimeUpdate` is optional. It's the mechanism that syncs audio playback time with word highlights via a RAF loop. If the provider doesn't have it, highlighting won't activate even if `isWordHighlightEnabled: true`.
66
+
67
+ ### ChatTTSHighlightModel (ChatTTSHighlightModel.ts)
68
+
69
+ Manages highlight state using Effector stores with declarative reset. Receives `OnTimeUpdate` callback directly (not the whole `AudioProvider`).
70
+
71
+ - **`$isActive`** — gates `$highlightedWordIndex` computation. Toggled on pause/resume without resetting timepoints.
72
+ - **`$highlightedWordIndex`** — derived store, returns `-1` when inactive or no match. Parses mark name via `WORD_MARK_REGEX`.
73
+ - **`activate(timepoints, onTimeUpdate)`** — sets timepoints, enables highlighting, registers time update callback. Only triggers store updates when the highlighted word actually changes (`lastMark` comparison).
74
+ - **`deactivate(onTimeUpdate)`** — stops listening, resets all state via declarative `.reset()` chain.
75
+ - **All stores use `.reset(this.reset)`** — single `reset` event clears `$time`, `$timepoints`, and `$isActive`.
76
+
77
+ ### Helpers (helpers/ttsHighlight.ts)
78
+
79
+ - **`textToSSML(text)`** — converts plain text to SSML with `<mark>` tags for word timing.
80
+ - **`findCurrentMark(timepoints, time)`** — iterates backwards through timepoints to find the current mark. Efficient for linear playback.
81
+
82
+ ### Constants (constants.ts)
83
+
84
+ - **`WORD_MARK_REGEX`** — `/^w_(\d+)$/` — extracts word index from mark names like `w_0`, `w_1`.
85
+
86
+ ### Naming conventions
87
+
88
+ | Name | Scope | Purpose |
89
+ |------|-------|---------|
90
+ | `wordHighlight` | public instance | `ChatTTSHighlightModel` instance on `ChatTTSModel` |
91
+ | `wordHighlightEnabled` | private field | Whether highlighting is active (set once at config) |
92
+ | `isWordHighlightEnabled` | public getter | Read-only access to `wordHighlightEnabled` for external consumers |
93
+ | `isWordHighlightEnabled` | T2SConfig field | Config flag passed to `setUpT2S()` |
94
+
95
+ ## Data Flow
96
+
97
+ ```
98
+ AudioProvider.onTimeUpdate(callback)
99
+
100
+ ChatTTSHighlightModel.activate(timepoints, onTimeUpdate)
101
+
102
+ RAF loop → audio.currentTime → findCurrentMark() → only updates when mark changes
103
+
104
+ $highlightedWordIndex = parse mark name "w_N" → N (or -1 if inactive/no match)
105
+
106
+ Chat.tsx: model.t2s.isWordHighlightEnabled && isPlayingMessage ? highlightedWordIndex : -1
107
+
108
+ ChatMessage → MessageContent → TTSHighlightRenderer({ text, highlightedIndex })
109
+ ```
110
+
111
+ ## Key Files
112
+
113
+ | File | Purpose |
114
+ |------|---------|
115
+ | `model/ChatTTSModel.ts` | `ChatTTSModel` — TTS playback, caching, highlight orchestration |
116
+ | `model/ChatTTSHighlightModel.ts` | Highlight state — timepoints, current time, `$isActive`, derived word index |
117
+ | `helpers/ttsHighlight.ts` | `textToSSML` + `findCurrentMark` — SSML conversion and playback position lookup |
118
+ | `constants.ts` | `WORD_MARK_REGEX` and audio config defaults |
119
+ | `types/t2s.types.ts` | `AudioProvider`, `OnTimeUpdate`, `AudioStatus`, `AudioCache`, `TTSHighlightRendererProps` types |
120
+ | `components/Chat/Chat.tsx` | Reads `isWordHighlightEnabled` and `$highlightedWordIndex`, passes to messages |
@@ -1,13 +1,17 @@
1
- import React, { useRef } from 'react'
1
+ import React, { ComponentType, PropsWithChildren, useRef } from 'react'
2
2
  import { Platform, ScrollView, StyleSheet, useWindowDimensions, View } from 'react-native'
3
3
  import { useStoreMap, useUnit } from 'effector-react'
4
+ import { SPACING } from '@magmamath/react-native-ui'
4
5
 
5
6
  import { ChatbotModel } from '../../model/ChatBotModel'
6
7
  import { ChatMessage } from '../ChatMessage/ChatMessage'
7
8
  import { MessageLoader } from '../ChatMessage/MessageLoader'
8
9
  import { ChatInput } from '../ChatInput/ChatInput'
10
+ import { CloseButton } from './CloseButton'
9
11
  import { MessageVariant } from '../../types/model.types'
10
12
  import { ColorScheme } from '../../types/style.types'
13
+ import { ConditionalWrapper } from '../../../../lib/components/ConditionalWrapper'
14
+ import { TTSHighlightRenderer } from '../../types/t2s.types'
11
15
 
12
16
  const TOOLBAR_HEIGHT = 140
13
17
  const BOTTOM_OFFSET = Platform.select({
@@ -19,14 +23,22 @@ type ChatProps = {
19
23
  model: ChatbotModel
20
24
  isHintFeedback: boolean
21
25
  isTextToSpeechEnabled: boolean
26
+ isInputDisabled?: boolean
22
27
  colorScheme?: ColorScheme
28
+ MessageWrapper?: ComponentType<PropsWithChildren>
29
+ TTSHighlightRenderer?: TTSHighlightRenderer
30
+ onPressClose?: () => void
23
31
  }
24
32
 
25
33
  export const Chat = ({
26
34
  model,
27
35
  isHintFeedback,
28
36
  isTextToSpeechEnabled,
37
+ isInputDisabled,
29
38
  colorScheme = ColorScheme.Blue,
39
+ MessageWrapper,
40
+ TTSHighlightRenderer,
41
+ onPressClose,
30
42
  }: ChatProps) => {
31
43
  const dimensions = useWindowDimensions()
32
44
  const ref = useRef<ScrollView>(null)
@@ -35,15 +47,19 @@ export const Chat = ({
35
47
  const isHelpRequestPending = useUnit(model.sendHelpRequestFx.pending)
36
48
  const isTextToSpeechPending = useUnit(model.api.textToSpeechTextFx.pending)
37
49
 
50
+ const audioStatus = useUnit(model.t2s.$status)
38
51
  const currentPlayingId = useUnit(model.t2s.$currentPlayingId)
52
+ const highlightedWordIndex = useUnit(model.t2s.wordHighlight.$highlightedWordIndex)
53
+
54
+ const isScrollActive = useUnit(model.$isScrollActive)
39
55
  const isTranslated = useUnit(model.translation.$isTranslated)
40
- const audioStatus = useUnit(model.t2s.$status)
41
56
  const errorSpottingEnabled = useUnit(model.errorSpotting.$isEnabled)
42
57
 
43
58
  const messages = useStoreMap(model.$currentChatData, ({ messages }) => messages)
44
59
  const lastMessageId = messages.at(-1)?.id
45
60
 
46
61
  const MAX_HEIGHT = dimensions.height - TOOLBAR_HEIGHT - BOTTOM_OFFSET
62
+ const shouldWrapMessage = MessageWrapper && isInputDisabled && messages.length === 1
47
63
 
48
64
  return (
49
65
  <View style={[styles.container, { maxHeight: MAX_HEIGHT }]}>
@@ -52,7 +68,9 @@ export const Chat = ({
52
68
  bounces={false}
53
69
  contentContainerStyle={styles.list}
54
70
  onContentSizeChange={(_, height) => {
55
- ref.current?.scrollToEnd()
71
+ if (messages.length > 1) {
72
+ ref.current?.scrollToEnd()
73
+ }
56
74
 
57
75
  if (height >= MAX_HEIGHT) {
58
76
  model.setScrollActive(true)
@@ -60,38 +78,55 @@ export const Chat = ({
60
78
  }}
61
79
  >
62
80
  {isOpen && (
63
- <View style={styles.gap}>
64
- {messages.map((message) => (
65
- <ChatMessage
66
- key={message.id}
67
- isTranslated={isTranslated}
68
- withIcon={!message.isOwnMessage && message.id === lastMessageId}
69
- message={message}
70
- variant={message.isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED}
71
- colorScheme={colorScheme}
72
- withErrorSpotting={errorSpottingEnabled && !message.isOwnMessage}
73
- t2sState={{
74
- isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
75
- isActive: message.id === currentPlayingId,
76
- isLoading: isTextToSpeechPending,
77
- status: audioStatus,
78
- disabled: isTextToSpeechPending,
79
- }}
80
- />
81
- ))}
81
+ <View style={[styles.gap, isInputDisabled && styles.messagesWithoutInput]}>
82
+ {messages.map((message, index) => {
83
+ const key = `${message.id}-${index}`
84
+ const isPlayingMessage = message.id === currentPlayingId
85
+ const messageHighlightIndex =
86
+ model.t2s.isWordHighlightEnabled && isPlayingMessage ? highlightedWordIndex : -1
82
87
 
83
- {isHelpRequestPending && <MessageLoader colorScheme={colorScheme} />}
84
- </View>
85
- )}
88
+ return (
89
+ <React.Fragment key={key}>
90
+ <ConditionalWrapper withWrapper={shouldWrapMessage} Wrapper={MessageWrapper}>
91
+ <ChatMessage
92
+ isTranslated={isTranslated}
93
+ withIcon={!message.isOwnMessage && message.id === lastMessageId}
94
+ message={message}
95
+ variant={message.isOwnMessage ? MessageVariant.SENT : MessageVariant.RECEIVED}
96
+ colorScheme={colorScheme}
97
+ withErrorSpotting={errorSpottingEnabled && !message.isOwnMessage}
98
+ highlightedWordIndex={messageHighlightIndex}
99
+ TTSHighlightRenderer={TTSHighlightRenderer}
100
+ t2sState={{
101
+ isEnabled: isTextToSpeechEnabled && !message.isOwnMessage,
102
+ isActive: isPlayingMessage,
103
+ isLoading: isTextToSpeechPending,
104
+ status: audioStatus,
105
+ disabled: isTextToSpeechPending,
106
+ }}
107
+ />
108
+ </ConditionalWrapper>
109
+ </React.Fragment>
110
+ )
111
+ })}
86
112
 
87
- {isOpen && (
88
- <ChatInput
89
- isHintFeedback={isHintFeedback}
90
- colorScheme={colorScheme}
91
- hasMessages={messages.length > 1}
92
- />
113
+ {isHelpRequestPending && <MessageLoader />}
114
+ </View>
93
115
  )}
94
116
  </ScrollView>
117
+
118
+ {isOpen && (
119
+ <View style={styles.inputRow}>
120
+ <CloseButton onPress={onPressClose} />
121
+ {!isInputDisabled && (
122
+ <ChatInput
123
+ isHintFeedback={isHintFeedback}
124
+ colorScheme={colorScheme}
125
+ hasMessages={messages.length > 1}
126
+ />
127
+ )}
128
+ </View>
129
+ )}
95
130
  </View>
96
131
  )
97
132
  }
@@ -102,14 +137,22 @@ const styles = StyleSheet.create({
102
137
  alignItems: 'flex-end',
103
138
  width: 378,
104
139
  height: '100%',
140
+ paddingRight: SPACING['200'],
105
141
  },
106
142
  list: {
107
143
  alignItems: 'flex-end',
108
144
  paddingVertical: 2,
109
- paddingRight: 6,
145
+ },
146
+ messagesWithoutInput: {
147
+ marginBottom: SPACING['200'],
148
+ },
149
+ inputRow: {
150
+ flexDirection: 'row',
151
+ alignItems: 'center',
152
+ gap: SPACING['200'],
110
153
  },
111
154
  gap: {
112
155
  flex: 1,
113
- gap: 8,
156
+ gap: SPACING['200'],
114
157
  },
115
158
  })
@@ -0,0 +1,60 @@
1
+ import React from 'react'
2
+ import { StyleSheet } from 'react-native'
3
+ import {
4
+ Button,
5
+ ButtonColor,
6
+ ButtonSize,
7
+ ButtonStates,
8
+ ButtonVariant,
9
+ COLORS,
10
+ } from '@magmamath/react-native-ui'
11
+ import { CloseIcon } from '../../../../shared/icons/CloseIcon'
12
+
13
+ const COLOR_SCHEME = {
14
+ [ButtonStates.DEFAULT]: {
15
+ backgroundColor: COLORS.NEUTRAL_1,
16
+ borderColor: COLORS.NEUTRAL_5,
17
+ raiseColor: COLORS.NEUTRAL_5,
18
+ color: COLORS.NEUTRAL_10,
19
+ },
20
+ [ButtonStates.PRESSED]: {
21
+ backgroundColor: COLORS.NEUTRAL_4,
22
+ borderColor: COLORS.NEUTRAL_5,
23
+ raiseColor: COLORS.NEUTRAL_5,
24
+ color: COLORS.NEUTRAL_1,
25
+ },
26
+ [ButtonStates.HOVER]: {
27
+ backgroundColor: COLORS.NEUTRAL_3,
28
+ borderColor: COLORS.NEUTRAL_5,
29
+ raiseColor: COLORS.NEUTRAL_5,
30
+ color: COLORS.NEUTRAL_10,
31
+ },
32
+ }
33
+
34
+ type CloseButtonProps = {
35
+ onPress?: () => void
36
+ }
37
+
38
+ export const CloseButton = ({ onPress }: CloseButtonProps) => (
39
+ <Button
40
+ onPress={onPress}
41
+ style={{ button: styles.button }}
42
+ variant={ButtonVariant.PRIMARY}
43
+ size={ButtonSize.MEDIUM}
44
+ colorScheme={ButtonColor.WHITE}
45
+ raiseLevel={5}
46
+ // customColorScheme={COLOR_SCHEME}
47
+ >
48
+ <CloseIcon width={18} height={18} />
49
+ </Button>
50
+ )
51
+
52
+ const styles = StyleSheet.create({
53
+ button: {
54
+ width: 38,
55
+ height: 38,
56
+ borderRadius: 36,
57
+ paddingHorizontal: 0,
58
+ borderColor: COLORS.NEUTRAL_5,
59
+ },
60
+ })