@convai/web-sdk 1.9.0-beta.0 → 1.9.0-beta.12

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 (342) hide show
  1. package/README.md +35 -43
  2. package/dist/core/AudioManager.d.ts +0 -1
  3. package/dist/core/AudioManager.js +0 -1
  4. package/dist/core/BlendshapeQueue.d.ts +0 -1
  5. package/dist/core/BlendshapeQueue.js +20 -6
  6. package/dist/core/CharacterRoster.d.ts +0 -1
  7. package/dist/core/CharacterRoster.js +0 -1
  8. package/dist/core/CharacterVersionManager.d.ts +0 -1
  9. package/dist/core/CharacterVersionManager.js +0 -1
  10. package/dist/core/ConnectionStateHandler.d.ts +0 -1
  11. package/dist/core/ConnectionStateHandler.js +5 -2
  12. package/dist/core/ConvaiClient.d.ts +66 -3
  13. package/dist/core/ConvaiClient.js +253 -20
  14. package/dist/core/ConvaiRoomError.d.ts +0 -1
  15. package/dist/core/ConvaiRoomError.js +20 -2
  16. package/dist/core/EventEmitter.d.ts +0 -1
  17. package/dist/core/EventEmitter.js +0 -1
  18. package/dist/core/MemoryManager.d.ts +0 -1
  19. package/dist/core/MemoryManager.js +0 -1
  20. package/dist/core/MessageHandler.d.ts +5 -3
  21. package/dist/core/MessageHandler.js +125 -47
  22. package/dist/core/SSESession.d.ts +13 -9
  23. package/dist/core/SSESession.js +240 -13
  24. package/dist/core/ScreenShareManager.d.ts +0 -1
  25. package/dist/core/ScreenShareManager.js +0 -1
  26. package/dist/core/VideoManager.d.ts +0 -1
  27. package/dist/core/VideoManager.js +0 -1
  28. package/dist/core/characterInfo.d.ts +45 -0
  29. package/dist/core/characterInfo.js +55 -0
  30. package/dist/core/characterReference.d.ts +0 -1
  31. package/dist/core/characterReference.js +0 -1
  32. package/dist/core/connectRequest.d.ts +0 -1
  33. package/dist/core/connectRequest.js +0 -1
  34. package/dist/core/contextUpdateRequest.d.ts +0 -1
  35. package/dist/core/contextUpdateRequest.js +0 -1
  36. package/dist/core/index.d.ts +6 -1
  37. package/dist/core/index.js +20 -1
  38. package/dist/core/logicalTurn.d.ts +0 -1
  39. package/dist/core/logicalTurn.js +0 -1
  40. package/dist/core/modelOutput.d.ts +0 -1
  41. package/dist/core/modelOutput.js +0 -1
  42. package/dist/core/publishedChat.d.ts +0 -1
  43. package/dist/core/publishedChat.js +0 -1
  44. package/dist/core/rosterRequest.d.ts +0 -1
  45. package/dist/core/rosterRequest.js +0 -1
  46. package/dist/core/rtviEnvelope.d.ts +5 -0
  47. package/dist/core/rtviEnvelope.js +9 -0
  48. package/dist/core/types.d.ts +241 -17
  49. package/dist/core/types.js +0 -1
  50. package/dist/core/videoSourceState.d.ts +0 -1
  51. package/dist/core/videoSourceState.js +0 -1
  52. package/dist/core/visionRequest.d.ts +0 -1
  53. package/dist/core/visionRequest.js +0 -1
  54. package/dist/embed/index.d.ts +20 -3
  55. package/dist/embed/index.js +20 -3
  56. package/dist/embed/publicationApi.d.ts +0 -1
  57. package/dist/embed/publicationApi.js +0 -1
  58. package/dist/index.d.ts +0 -1
  59. package/dist/index.js +0 -1
  60. package/dist/lipsync-helpers/arkitOrder61.d.ts +0 -1
  61. package/dist/lipsync-helpers/arkitOrder61.js +5 -3
  62. package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +0 -1
  63. package/dist/lipsync-helpers/createBlendshapeQueue.js +7 -1
  64. package/dist/lipsync-helpers/declarativeMapping.d.ts +2 -1
  65. package/dist/lipsync-helpers/declarativeMapping.js +72 -146
  66. package/dist/lipsync-helpers/index.d.ts +0 -1
  67. package/dist/lipsync-helpers/index.js +0 -1
  68. package/dist/lipsync-helpers/mappingTypes.d.ts +6 -5
  69. package/dist/lipsync-helpers/mappingTypes.js +0 -1
  70. package/dist/lipsync-helpers/metahumanOrder251.d.ts +0 -1
  71. package/dist/lipsync-helpers/metahumanOrder251.js +8 -9
  72. package/dist/lipsync-helpers/mhaLimitDrivers.d.ts +0 -1
  73. package/dist/lipsync-helpers/mhaLimitDrivers.js +0 -1
  74. package/dist/lipsync-helpers/naturalness/processor.d.ts +0 -1
  75. package/dist/lipsync-helpers/naturalness/processor.js +6 -4
  76. package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts +0 -1
  77. package/dist/lipsync-helpers/naturalness/profiles/mha.js +0 -1
  78. package/dist/lipsync-helpers/naturalness/types.d.ts +0 -1
  79. package/dist/lipsync-helpers/naturalness/types.js +0 -1
  80. package/dist/lipsync-helpers/presetMappers.d.ts +0 -1
  81. package/dist/lipsync-helpers/presetMappers.js +0 -1
  82. package/dist/react/components/ConvaiWidget.d.ts +9 -1
  83. package/dist/react/components/ConvaiWidget.js +23 -28
  84. package/dist/react/components/index.d.ts +0 -1
  85. package/dist/react/components/index.js +0 -1
  86. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +0 -1
  87. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +0 -1
  88. package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +0 -1
  89. package/dist/react/components/rtc-widget/components/AudioVisualizer.js +0 -1
  90. package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +4 -2
  91. package/dist/react/components/rtc-widget/components/ConviMessage.js +2 -3
  92. package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -1
  93. package/dist/react/components/rtc-widget/components/FloatingVideo.js +1 -3
  94. package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +21 -4
  95. package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +114 -131
  96. package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +0 -1
  97. package/dist/react/components/rtc-widget/components/MessageBubble.js +0 -1
  98. package/dist/react/components/rtc-widget/components/MessageList.d.ts +4 -2
  99. package/dist/react/components/rtc-widget/components/MessageList.js +2 -3
  100. package/dist/react/components/rtc-widget/components/SiteCard.d.ts +14 -0
  101. package/dist/react/components/rtc-widget/components/SiteCard.js +34 -0
  102. package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -1
  103. package/dist/react/components/rtc-widget/components/UserMessage.js +1 -2
  104. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +0 -1
  105. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +0 -1
  106. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +0 -1
  107. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +1 -3
  108. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -1
  109. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +1 -3
  110. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -1
  111. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +1 -4
  112. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +0 -1
  113. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +0 -1
  114. package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +0 -1
  115. package/dist/react/components/rtc-widget/components/conviComponents/index.js +0 -1
  116. package/dist/react/components/rtc-widget/components/index.d.ts +0 -1
  117. package/dist/react/components/rtc-widget/components/index.js +0 -1
  118. package/dist/react/components/rtc-widget/index.d.ts +0 -1
  119. package/dist/react/components/rtc-widget/index.js +0 -1
  120. package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +0 -1
  121. package/dist/react/components/rtc-widget/styles/framerConfig.js +0 -1
  122. package/dist/react/components/rtc-widget/styles/icons.d.ts +0 -1
  123. package/dist/react/components/rtc-widget/styles/icons.js +0 -1
  124. package/dist/react/components/rtc-widget/styles/index.d.ts +0 -1
  125. package/dist/react/components/rtc-widget/styles/index.js +0 -1
  126. package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +0 -1
  127. package/dist/react/components/rtc-widget/styles/styledComponents.js +0 -1
  128. package/dist/react/components/rtc-widget/styles/theme.d.ts +0 -1
  129. package/dist/react/components/rtc-widget/styles/theme.js +0 -1
  130. package/dist/react/components/rtc-widget/types/index.d.ts +0 -1
  131. package/dist/react/components/rtc-widget/types/index.js +0 -1
  132. package/dist/react/hooks/index.d.ts +0 -1
  133. package/dist/react/hooks/index.js +0 -1
  134. package/dist/react/hooks/useCharacterInfo.d.ts +12 -11
  135. package/dist/react/hooks/useCharacterInfo.js +49 -50
  136. package/dist/react/hooks/useConvaiClient.d.ts +0 -1
  137. package/dist/react/hooks/useConvaiClient.js +8 -5
  138. package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -1
  139. package/dist/react/hooks/useLocalCameraTrack.js +0 -1
  140. package/dist/react/icons.d.ts +37 -0
  141. package/dist/react/icons.js +53 -0
  142. package/dist/react/index.d.ts +4 -1
  143. package/dist/react/index.js +2 -1
  144. package/dist/utils/inlineMarkdown.d.ts +0 -1
  145. package/dist/utils/inlineMarkdown.js +0 -1
  146. package/dist/utils/lightbox.d.ts +15 -0
  147. package/dist/utils/lightbox.js +94 -0
  148. package/dist/utils/linkPresentation.d.ts +75 -0
  149. package/dist/utils/linkPresentation.js +414 -0
  150. package/dist/utils/linkPreview.d.ts +45 -0
  151. package/dist/utils/linkPreview.js +71 -0
  152. package/dist/utils/logger.d.ts +0 -1
  153. package/dist/utils/logger.js +0 -1
  154. package/dist/vanilla/AudioRenderer.d.ts +0 -1
  155. package/dist/vanilla/AudioRenderer.js +0 -1
  156. package/dist/vanilla/ConvaiWidget.d.ts +0 -1
  157. package/dist/vanilla/ConvaiWidget.js +302 -226
  158. package/dist/vanilla/WebSocketSession.d.ts +0 -1
  159. package/dist/vanilla/WebSocketSession.js +0 -1
  160. package/dist/vanilla/WidgetEventSubscriptions.d.ts +0 -1
  161. package/dist/vanilla/WidgetEventSubscriptions.js +0 -1
  162. package/dist/vanilla/icons.d.ts +0 -1
  163. package/dist/vanilla/icons.js +0 -1
  164. package/dist/vanilla/index.d.ts +4 -1
  165. package/dist/vanilla/index.js +2 -1
  166. package/dist/vanilla/styles.d.ts +0 -1
  167. package/dist/vanilla/styles.js +9 -1
  168. package/dist/vanilla/types.d.ts +9 -1
  169. package/dist/vanilla/types.js +0 -1
  170. package/dist/vanilla/websocket.d.ts +0 -1
  171. package/dist/vanilla/websocket.js +0 -1
  172. package/dist/version.d.ts +1 -2
  173. package/dist/version.js +1 -2
  174. package/package.json +23 -28
  175. package/dist/core/AudioManager.d.ts.map +0 -1
  176. package/dist/core/AudioManager.js.map +0 -1
  177. package/dist/core/BlendshapeQueue.d.ts.map +0 -1
  178. package/dist/core/BlendshapeQueue.js.map +0 -1
  179. package/dist/core/CharacterRoster.d.ts.map +0 -1
  180. package/dist/core/CharacterRoster.js.map +0 -1
  181. package/dist/core/CharacterVersionManager.d.ts.map +0 -1
  182. package/dist/core/CharacterVersionManager.js.map +0 -1
  183. package/dist/core/ConnectionStateHandler.d.ts.map +0 -1
  184. package/dist/core/ConnectionStateHandler.js.map +0 -1
  185. package/dist/core/ConvaiClient.d.ts.map +0 -1
  186. package/dist/core/ConvaiClient.js.map +0 -1
  187. package/dist/core/ConvaiRoomError.d.ts.map +0 -1
  188. package/dist/core/ConvaiRoomError.js.map +0 -1
  189. package/dist/core/EventEmitter.d.ts.map +0 -1
  190. package/dist/core/EventEmitter.js.map +0 -1
  191. package/dist/core/MemoryManager.d.ts.map +0 -1
  192. package/dist/core/MemoryManager.js.map +0 -1
  193. package/dist/core/MessageHandler.d.ts.map +0 -1
  194. package/dist/core/MessageHandler.js.map +0 -1
  195. package/dist/core/SSESession.d.ts.map +0 -1
  196. package/dist/core/SSESession.js.map +0 -1
  197. package/dist/core/ScreenShareManager.d.ts.map +0 -1
  198. package/dist/core/ScreenShareManager.js.map +0 -1
  199. package/dist/core/VideoManager.d.ts.map +0 -1
  200. package/dist/core/VideoManager.js.map +0 -1
  201. package/dist/core/characterReference.d.ts.map +0 -1
  202. package/dist/core/characterReference.js.map +0 -1
  203. package/dist/core/connectRequest.d.ts.map +0 -1
  204. package/dist/core/connectRequest.js.map +0 -1
  205. package/dist/core/contextUpdateRequest.d.ts.map +0 -1
  206. package/dist/core/contextUpdateRequest.js.map +0 -1
  207. package/dist/core/index.d.ts.map +0 -1
  208. package/dist/core/index.js.map +0 -1
  209. package/dist/core/logicalTurn.d.ts.map +0 -1
  210. package/dist/core/logicalTurn.js.map +0 -1
  211. package/dist/core/modelOutput.d.ts.map +0 -1
  212. package/dist/core/modelOutput.js.map +0 -1
  213. package/dist/core/publishedChat.d.ts.map +0 -1
  214. package/dist/core/publishedChat.js.map +0 -1
  215. package/dist/core/rosterRequest.d.ts.map +0 -1
  216. package/dist/core/rosterRequest.js.map +0 -1
  217. package/dist/core/types.d.ts.map +0 -1
  218. package/dist/core/types.js.map +0 -1
  219. package/dist/core/videoSourceState.d.ts.map +0 -1
  220. package/dist/core/videoSourceState.js.map +0 -1
  221. package/dist/core/visionRequest.d.ts.map +0 -1
  222. package/dist/core/visionRequest.js.map +0 -1
  223. package/dist/embed/ConvaiChatElement.d.ts +0 -103
  224. package/dist/embed/ConvaiChatElement.d.ts.map +0 -1
  225. package/dist/embed/ConvaiChatElement.js +0 -679
  226. package/dist/embed/ConvaiChatElement.js.map +0 -1
  227. package/dist/embed/browser.d.ts +0 -3
  228. package/dist/embed/browser.d.ts.map +0 -1
  229. package/dist/embed/browser.js +0 -5
  230. package/dist/embed/browser.js.map +0 -1
  231. package/dist/embed/chat-embed-v1.js +0 -200
  232. package/dist/embed/chat-embed-v1.js.map +0 -7
  233. package/dist/embed/index.d.ts.map +0 -1
  234. package/dist/embed/index.js.map +0 -1
  235. package/dist/embed/publicationApi.d.ts.map +0 -1
  236. package/dist/embed/publicationApi.js.map +0 -1
  237. package/dist/index.d.ts.map +0 -1
  238. package/dist/index.js.map +0 -1
  239. package/dist/lipsync-helpers/arkitOrder61.d.ts.map +0 -1
  240. package/dist/lipsync-helpers/arkitOrder61.js.map +0 -1
  241. package/dist/lipsync-helpers/createBlendshapeQueue.d.ts.map +0 -1
  242. package/dist/lipsync-helpers/createBlendshapeQueue.js.map +0 -1
  243. package/dist/lipsync-helpers/declarativeMapping.d.ts.map +0 -1
  244. package/dist/lipsync-helpers/declarativeMapping.js.map +0 -1
  245. package/dist/lipsync-helpers/index.d.ts.map +0 -1
  246. package/dist/lipsync-helpers/index.js.map +0 -1
  247. package/dist/lipsync-helpers/mappingTypes.d.ts.map +0 -1
  248. package/dist/lipsync-helpers/mappingTypes.js.map +0 -1
  249. package/dist/lipsync-helpers/metahumanOrder251.d.ts.map +0 -1
  250. package/dist/lipsync-helpers/metahumanOrder251.js.map +0 -1
  251. package/dist/lipsync-helpers/mhaLimitDrivers.d.ts.map +0 -1
  252. package/dist/lipsync-helpers/mhaLimitDrivers.js.map +0 -1
  253. package/dist/lipsync-helpers/naturalness/processor.d.ts.map +0 -1
  254. package/dist/lipsync-helpers/naturalness/processor.js.map +0 -1
  255. package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts.map +0 -1
  256. package/dist/lipsync-helpers/naturalness/profiles/mha.js.map +0 -1
  257. package/dist/lipsync-helpers/naturalness/types.d.ts.map +0 -1
  258. package/dist/lipsync-helpers/naturalness/types.js.map +0 -1
  259. package/dist/lipsync-helpers/presetMappers.d.ts.map +0 -1
  260. package/dist/lipsync-helpers/presetMappers.js.map +0 -1
  261. package/dist/react/components/ConvaiWidget.d.ts.map +0 -1
  262. package/dist/react/components/ConvaiWidget.js.map +0 -1
  263. package/dist/react/components/index.d.ts.map +0 -1
  264. package/dist/react/components/index.js.map +0 -1
  265. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +0 -1
  266. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js.map +0 -1
  267. package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +0 -1
  268. package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +0 -1
  269. package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +0 -1
  270. package/dist/react/components/rtc-widget/components/ConviMessage.js.map +0 -1
  271. package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +0 -1
  272. package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +0 -1
  273. package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +0 -1
  274. package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +0 -1
  275. package/dist/react/components/rtc-widget/components/MessageBubble.d.ts.map +0 -1
  276. package/dist/react/components/rtc-widget/components/MessageBubble.js.map +0 -1
  277. package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +0 -1
  278. package/dist/react/components/rtc-widget/components/MessageList.js.map +0 -1
  279. package/dist/react/components/rtc-widget/components/UserMessage.d.ts.map +0 -1
  280. package/dist/react/components/rtc-widget/components/UserMessage.js.map +0 -1
  281. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +0 -1
  282. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js.map +0 -1
  283. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +0 -1
  284. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +0 -1
  285. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +0 -1
  286. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +0 -1
  287. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +0 -1
  288. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +0 -1
  289. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +0 -1
  290. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +0 -1
  291. package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts.map +0 -1
  292. package/dist/react/components/rtc-widget/components/conviComponents/index.js.map +0 -1
  293. package/dist/react/components/rtc-widget/components/index.d.ts.map +0 -1
  294. package/dist/react/components/rtc-widget/components/index.js.map +0 -1
  295. package/dist/react/components/rtc-widget/index.d.ts.map +0 -1
  296. package/dist/react/components/rtc-widget/index.js.map +0 -1
  297. package/dist/react/components/rtc-widget/styles/framerConfig.d.ts.map +0 -1
  298. package/dist/react/components/rtc-widget/styles/framerConfig.js.map +0 -1
  299. package/dist/react/components/rtc-widget/styles/icons.d.ts.map +0 -1
  300. package/dist/react/components/rtc-widget/styles/icons.js.map +0 -1
  301. package/dist/react/components/rtc-widget/styles/index.d.ts.map +0 -1
  302. package/dist/react/components/rtc-widget/styles/index.js.map +0 -1
  303. package/dist/react/components/rtc-widget/styles/styledComponents.d.ts.map +0 -1
  304. package/dist/react/components/rtc-widget/styles/styledComponents.js.map +0 -1
  305. package/dist/react/components/rtc-widget/styles/theme.d.ts.map +0 -1
  306. package/dist/react/components/rtc-widget/styles/theme.js.map +0 -1
  307. package/dist/react/components/rtc-widget/types/index.d.ts.map +0 -1
  308. package/dist/react/components/rtc-widget/types/index.js.map +0 -1
  309. package/dist/react/hooks/index.d.ts.map +0 -1
  310. package/dist/react/hooks/index.js.map +0 -1
  311. package/dist/react/hooks/useCharacterInfo.d.ts.map +0 -1
  312. package/dist/react/hooks/useCharacterInfo.js.map +0 -1
  313. package/dist/react/hooks/useConvaiClient.d.ts.map +0 -1
  314. package/dist/react/hooks/useConvaiClient.js.map +0 -1
  315. package/dist/react/hooks/useLocalCameraTrack.d.ts.map +0 -1
  316. package/dist/react/hooks/useLocalCameraTrack.js.map +0 -1
  317. package/dist/react/index.d.ts.map +0 -1
  318. package/dist/react/index.js.map +0 -1
  319. package/dist/utils/inlineMarkdown.d.ts.map +0 -1
  320. package/dist/utils/inlineMarkdown.js.map +0 -1
  321. package/dist/utils/logger.d.ts.map +0 -1
  322. package/dist/utils/logger.js.map +0 -1
  323. package/dist/vanilla/AudioRenderer.d.ts.map +0 -1
  324. package/dist/vanilla/AudioRenderer.js.map +0 -1
  325. package/dist/vanilla/ConvaiWidget.d.ts.map +0 -1
  326. package/dist/vanilla/ConvaiWidget.js.map +0 -1
  327. package/dist/vanilla/WebSocketSession.d.ts.map +0 -1
  328. package/dist/vanilla/WebSocketSession.js.map +0 -1
  329. package/dist/vanilla/WidgetEventSubscriptions.d.ts.map +0 -1
  330. package/dist/vanilla/WidgetEventSubscriptions.js.map +0 -1
  331. package/dist/vanilla/icons.d.ts.map +0 -1
  332. package/dist/vanilla/icons.js.map +0 -1
  333. package/dist/vanilla/index.d.ts.map +0 -1
  334. package/dist/vanilla/index.js.map +0 -1
  335. package/dist/vanilla/styles.d.ts.map +0 -1
  336. package/dist/vanilla/styles.js.map +0 -1
  337. package/dist/vanilla/types.d.ts.map +0 -1
  338. package/dist/vanilla/types.js.map +0 -1
  339. package/dist/vanilla/websocket.d.ts.map +0 -1
  340. package/dist/vanilla/websocket.js.map +0 -1
  341. package/dist/version.d.ts.map +0 -1
  342. package/dist/version.js.map +0 -1
@@ -3,4 +3,3 @@ export { aeroTheme, glassStyles, iconSizes, variants, iosTransitions, animationV
3
3
  export { ConvaiContainer, MorphingContainer, ButtonContent, Logo, ChatContent, Header, Title, HeaderLogo, CloseButton, SettingsButton, Content, Footer, InputContainer, Input, ActionButton, } from "./styles/index.js";
4
4
  export type { RTCChatMessage, CharacterVerbosityConfig, ConviUIProps, } from "./types/index.js";
5
5
  export type { LogoState } from "./styles/index.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@ ConviButton, ConviHeader, ConviFooter, SettingsTray, VoiceModeOverlay, } from ".
6
6
  export { aeroTheme, glassStyles, iconSizes, variants, iosTransitions, animationVariants, ConvaiLogo, ChevronDown, } from "./styles/index.js";
7
7
  // Export styled components for custom layouts
8
8
  export { ConvaiContainer, MorphingContainer, ButtonContent, Logo, ChatContent, Header, Title, HeaderLogo, CloseButton, SettingsButton, Content, Footer, InputContainer, Input, ActionButton, } from "./styles/index.js";
9
- //# sourceMappingURL=index.js.map
@@ -113,4 +113,3 @@ export declare const animationVariants: {
113
113
  };
114
114
  };
115
115
  };
116
- //# sourceMappingURL=framerConfig.d.ts.map
@@ -70,4 +70,3 @@ export const animationVariants = {
70
70
  exit: { x: "-100%", opacity: 0 },
71
71
  },
72
72
  };
73
- //# sourceMappingURL=framerConfig.js.map
@@ -25,4 +25,3 @@ export declare const ChevronDown: ({ size, color, }: {
25
25
  animate?: boolean;
26
26
  state?: LogoState;
27
27
  }) => import("react/jsx-runtime").JSX.Element;
28
- //# sourceMappingURL=icons.d.ts.map
@@ -254,4 +254,3 @@ export const IconButton = styled.button `
254
254
  `;
255
255
  // Export individual icons for convenience
256
256
  export const { ChevronDown, ConvaiLogo } = AeroIcons;
257
- //# sourceMappingURL=icons.js.map
@@ -3,4 +3,3 @@ export { iosTransitions, animationVariants } from "./framerConfig.js";
3
3
  export { ConvaiContainer, MorphingContainer, ButtonContent, Logo, ChatContent, Header, Title, HeaderLogo, CloseButton, SettingsButton, SettingsTray, SettingsOption, Content, Footer, InputContainer, Input, ActionButton, MessageList, Message, MessageBubble, MessageTime, ButtonContainer, ButtonLogo, ConviBubble, ConviMessageContainer, MessageHeader, ConviLabel, LogoWrapper, UserBubble, UserMessageContainer, UserLabel, BubbleContainer, Bubble, Timestamp, MessageListContainer, MessageWrapper, EmptyState, } from "./styledComponents.js";
4
4
  export { ConvaiLogo, ChevronDown, AeroIcons, IconButton } from "./icons.js";
5
5
  export type { LogoState } from "./icons.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -6,4 +6,3 @@ export { iosTransitions, animationVariants } from "./framerConfig.js";
6
6
  export { ConvaiContainer, MorphingContainer, ButtonContent, Logo, ChatContent, Header, Title, HeaderLogo, CloseButton, SettingsButton, SettingsTray, SettingsOption, Content, Footer, InputContainer, Input, ActionButton, MessageList, Message, MessageBubble, MessageTime, ButtonContainer, ButtonLogo, ConviBubble, ConviMessageContainer, MessageHeader, ConviLabel, LogoWrapper, UserBubble, UserMessageContainer, UserLabel, BubbleContainer, Bubble, Timestamp, MessageListContainer, MessageWrapper, EmptyState, } from "./styledComponents.js";
7
7
  // Export icons
8
8
  export { ConvaiLogo, ChevronDown, AeroIcons, IconButton } from "./icons.js";
9
- //# sourceMappingURL=index.js.map
@@ -87,4 +87,3 @@ export declare const Timestamp: import("styled-components/dist/types").IStyledCo
87
87
  export declare const MessageListContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
88
88
  export declare const MessageWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
89
89
  export declare const EmptyState: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
90
- //# sourceMappingURL=styledComponents.d.ts.map
@@ -660,4 +660,3 @@ export const EmptyState = styled.div `
660
660
  text-align: center;
661
661
  padding: 32px;
662
662
  `;
663
- //# sourceMappingURL=styledComponents.js.map
@@ -185,4 +185,3 @@ export declare const variants: {
185
185
  interactive: string;
186
186
  };
187
187
  };
188
- //# sourceMappingURL=theme.d.ts.map
@@ -287,4 +287,3 @@ export const variants = {
287
287
  `,
288
288
  },
289
289
  };
290
- //# sourceMappingURL=theme.js.map
@@ -57,4 +57,3 @@ export interface ConviUIProps {
57
57
  settingsButtonRef?: React.RefObject<HTMLButtonElement>;
58
58
  convaiClient?: any;
59
59
  }
60
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,3 @@
1
1
  export { useConvaiClient } from './useConvaiClient.js';
2
2
  export { useCharacterInfo } from './useCharacterInfo.js';
3
3
  export { useLocalCameraTrack } from './useLocalCameraTrack.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ export { useConvaiClient } from './useConvaiClient.js';
3
3
  // Additional hooks
4
4
  export { useCharacterInfo } from './useCharacterInfo.js';
5
5
  export { useLocalCameraTrack } from './useLocalCameraTrack.js';
6
- //# sourceMappingURL=index.js.map
@@ -1,17 +1,18 @@
1
- interface CharacterInfo {
2
- name: string;
3
- image: string | null;
4
- }
1
+ import { type CharacterInfo } from "../../core/characterInfo.js";
5
2
  /**
6
- * Hook to fetch character information from Convai API
3
+ * Fetch a character's display name and avatar for the widget header.
7
4
  *
8
- * @param characterId - The character ID to fetch information for (optional)
9
- * @param apiKey - The Convai API key (optional)
10
- * @returns Character information including name and image URL
5
+ * The request itself lives in `core/characterInfo` so the vanilla widget runs
6
+ * the same code rather than a hand-synced copy of it.
7
+ *
8
+ * @param characterId - Character to look up
9
+ * @param apiKey - Convai API key, sent as `X-API-Key`
10
+ * @param authToken - Preferred over `apiKey`, sent as `API-AUTH-TOKEN`
11
+ * @param baseUrl - Origin to ask; defaults to `https://api.convai.com`. Pass
12
+ * `client.characterInfoUrl` so a non-SaaS deployment is not asked to send
13
+ * its credential to Convai's public API.
11
14
  */
12
- export declare const useCharacterInfo: (characterId?: string, apiKey?: string, authToken?: string) => CharacterInfo & {
15
+ export declare const useCharacterInfo: (characterId?: string, apiKey?: string, authToken?: string, baseUrl?: string | null) => CharacterInfo & {
13
16
  isLoading: boolean;
14
17
  error: Error | null;
15
18
  };
16
- export {};
17
- //# sourceMappingURL=useCharacterInfo.d.ts.map
@@ -1,66 +1,65 @@
1
1
  import { useState, useEffect } from "react";
2
2
  import { logger } from "../../utils/logger.js";
3
+ import { fetchCharacterInfo, FALLBACK_CHARACTER_NAME, } from "../../core/characterInfo.js";
3
4
  /**
4
- * Hook to fetch character information from Convai API
5
+ * Fetch a character's display name and avatar for the widget header.
5
6
  *
6
- * @param characterId - The character ID to fetch information for (optional)
7
- * @param apiKey - The Convai API key (optional)
8
- * @returns Character information including name and image URL
7
+ * The request itself lives in `core/characterInfo` so the vanilla widget runs
8
+ * the same code rather than a hand-synced copy of it.
9
+ *
10
+ * @param characterId - Character to look up
11
+ * @param apiKey - Convai API key, sent as `X-API-Key`
12
+ * @param authToken - Preferred over `apiKey`, sent as `API-AUTH-TOKEN`
13
+ * @param baseUrl - Origin to ask; defaults to `https://api.convai.com`. Pass
14
+ * `client.characterInfoUrl` so a non-SaaS deployment is not asked to send
15
+ * its credential to Convai's public API.
9
16
  */
10
- export const useCharacterInfo = (characterId, apiKey, authToken) => {
17
+ export const useCharacterInfo = (characterId, apiKey, authToken, baseUrl) => {
11
18
  const [characterInfo, setCharacterInfo] = useState({
12
- name: "Convi",
19
+ name: FALLBACK_CHARACTER_NAME,
13
20
  image: null,
14
21
  });
15
22
  const [isLoading, setIsLoading] = useState(true);
16
23
  const [error, setError] = useState(null);
17
24
  useEffect(() => {
18
- const fetchCharacterInfo = async () => {
19
- if (!characterId || !apiKey) {
20
- setIsLoading(false);
25
+ if (!characterId || !apiKey) {
26
+ setIsLoading(false);
27
+ return;
28
+ }
29
+ // Dropped on unmount, and on any change of the inputs below: a resolved
30
+ // response for a character the widget has moved off must not overwrite the
31
+ // header with the previous one's name.
32
+ const controller = new AbortController();
33
+ let cancelled = false;
34
+ setIsLoading(true);
35
+ setError(null);
36
+ fetchCharacterInfo({
37
+ characterId,
38
+ apiKey,
39
+ authToken,
40
+ baseUrl,
41
+ signal: controller.signal,
42
+ })
43
+ .then((info) => {
44
+ if (!cancelled)
45
+ setCharacterInfo(info);
46
+ })
47
+ .catch((err) => {
48
+ if (cancelled || controller.signal.aborted)
21
49
  return;
22
- }
23
- try {
24
- setIsLoading(true);
25
- setError(null);
26
- const headers = {
27
- "Content-Type": "application/json",
28
- };
29
- if (authToken) {
30
- headers["API-AUTH-TOKEN"] = authToken;
31
- }
32
- else if (apiKey) {
33
- headers["X-API-Key"] = apiKey;
34
- }
35
- const response = await fetch("https://api.convai.com/character/get", {
36
- method: "POST",
37
- headers,
38
- body: JSON.stringify({ charID: characterId }),
39
- });
40
- if (!response.ok) {
41
- throw new Error(`Failed to fetch character info: ${response.status}`);
42
- }
43
- const data = await response.json();
44
- // Extract character name and image with fallbacks
45
- const name = data.character_name || "Convi";
46
- const image = data.model_details?.METAHUMAN?.avatar_image_square ||
47
- data.model_details?.METAHUMAN?.avatar_image ||
48
- data.model_details?.modelPlaceholder ||
49
- null;
50
- setCharacterInfo({ name, image });
51
- }
52
- catch (err) {
53
- const error = err instanceof Error ? err : new Error("Unknown error");
54
- logger.error("Failed to fetch character info:", error);
55
- setError(error);
56
- // Keep default values on error
57
- }
58
- finally {
50
+ const error = err instanceof Error ? err : new Error("Unknown error");
51
+ logger.error("Failed to fetch character info:", error);
52
+ setError(error);
53
+ // Keep the fallback name and no image; the header is cosmetic.
54
+ })
55
+ .finally(() => {
56
+ if (!cancelled)
59
57
  setIsLoading(false);
60
- }
58
+ });
59
+ return () => {
60
+ cancelled = true;
61
+ controller.abort();
61
62
  };
62
- fetchCharacterInfo();
63
- }, [characterId, apiKey]);
63
+ }, [characterId, apiKey, authToken, baseUrl]);
64
64
  return { ...characterInfo, isLoading, error };
65
65
  };
66
- //# sourceMappingURL=useCharacterInfo.js.map
@@ -34,4 +34,3 @@ export declare const useConvaiClient: (config?: ConvaiConfig) => IConvaiClient &
34
34
  isVideoEnabled: boolean;
35
35
  isScreenShareActive: boolean;
36
36
  };
37
- //# sourceMappingURL=useConvaiClient.d.ts.map
@@ -50,12 +50,14 @@ export const useConvaiClient = (config) => {
50
50
  const unsubStateChange = client.on("stateChange", (newState) => {
51
51
  setState(newState);
52
52
  // Update activity based on state (priority: speaking > listening > thinking > connected)
53
- if (!newState.isConnected) {
54
- setActivity("Disconnected");
55
- }
56
- else if (newState.isConnecting) {
53
+ // isConnecting first: a connecting client is not yet connected, so
54
+ // checking !isConnected first made "Connecting..." unreachable.
55
+ if (newState.isConnecting) {
57
56
  setActivity("Connecting...");
58
57
  }
58
+ else if (!newState.isConnected) {
59
+ setActivity("Disconnected");
60
+ }
59
61
  else if (newState.isSpeaking) {
60
62
  setActivity("Speaking");
61
63
  }
@@ -181,6 +183,8 @@ export const useConvaiClient = (config) => {
181
183
  appendMessage: client.appendMessage.bind(client),
182
184
  toggleUsageUpdates: client.toggleUsageUpdates.bind(client),
183
185
  setInteractionTarget: client.setInteractionTarget.bind(client),
186
+ setCharacterMuted: client.setCharacterMuted.bind(client),
187
+ isCharacterMuted: client.isCharacterMuted.bind(client),
184
188
  updateCharacterRoster: client.updateCharacterRoster.bind(client),
185
189
  roomSession: client.roomSession,
186
190
  characters: client.characters,
@@ -227,4 +231,3 @@ export const useConvaiClient = (config) => {
227
231
  isScreenShareActive,
228
232
  };
229
233
  };
230
- //# sourceMappingURL=useConvaiClient.js.map
@@ -19,4 +19,3 @@ import { TrackReferenceOrPlaceholder } from "@livekit/components-react";
19
19
  * ```
20
20
  */
21
21
  export declare const useLocalCameraTrack: () => TrackReferenceOrPlaceholder;
22
- //# sourceMappingURL=useLocalCameraTrack.d.ts.map
@@ -31,4 +31,3 @@ export const useLocalCameraTrack = () => {
31
31
  }, [localParticipant, cameraTrack]);
32
32
  return cameraTrackRef;
33
33
  };
34
- //# sourceMappingURL=useLocalCameraTrack.js.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The icons the React widget draws, as inline SVG.
3
+ *
4
+ * These were the only 15 icons `react-icons` supplied, and that package is an
5
+ * 84 MB install — every icon set it ships — for 9 KB of bundled output. Each
6
+ * entry below is the exact element tree react-icons 5.6.0 generates for that
7
+ * icon, and `IconBase` reproduces its renderer: the same default
8
+ * `stroke`/`fill`/`strokeWidth`, `size` -> `height`/`width`, `color` both as
9
+ * an attribute and in `style`, and the `xmlns`. `__tests__/icons.test.tsx`
10
+ * pins that equivalence against the server-rendered markup of the original
11
+ * components, so a change here that alters a single attribute fails a test.
12
+ *
13
+ * Only the props the widget passes are supported — `size` and `color`, plus
14
+ * ordinary SVG attributes. react-icons' `IconContext` is not: nothing in this
15
+ * package ever provided one.
16
+ */
17
+ import React from "react";
18
+ export interface IconProps extends React.SVGAttributes<SVGElement> {
19
+ size?: string | number;
20
+ color?: string;
21
+ title?: string;
22
+ }
23
+ export declare const FaUser: (props: IconProps) => React.ReactElement;
24
+ export declare const FiMoreVertical: (props: IconProps) => React.ReactElement;
25
+ export declare const FiMic: (props: IconProps) => React.ReactElement;
26
+ export declare const FiSend: (props: IconProps) => React.ReactElement;
27
+ export declare const FiPhoneOff: (props: IconProps) => React.ReactElement;
28
+ export declare const IoClose: (props: IconProps) => React.ReactElement;
29
+ export declare const IoVideocam: (props: IconProps) => React.ReactElement;
30
+ export declare const IoVideocamOff: (props: IconProps) => React.ReactElement;
31
+ export declare const IoVolumeMute: (props: IconProps) => React.ReactElement;
32
+ export declare const IoVolumeHigh: (props: IconProps) => React.ReactElement;
33
+ export declare const LiaRedoAltSolid: (props: IconProps) => React.ReactElement;
34
+ export declare const MdDragIndicator: (props: IconProps) => React.ReactElement;
35
+ export declare const MdScreenShare: (props: IconProps) => React.ReactElement;
36
+ export declare const MdStopScreenShare: (props: IconProps) => React.ReactElement;
37
+ export declare const PiWaveform: (props: IconProps) => React.ReactElement;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * The icons the React widget draws, as inline SVG.
3
+ *
4
+ * These were the only 15 icons `react-icons` supplied, and that package is an
5
+ * 84 MB install — every icon set it ships — for 9 KB of bundled output. Each
6
+ * entry below is the exact element tree react-icons 5.6.0 generates for that
7
+ * icon, and `IconBase` reproduces its renderer: the same default
8
+ * `stroke`/`fill`/`strokeWidth`, `size` -> `height`/`width`, `color` both as
9
+ * an attribute and in `style`, and the `xmlns`. `__tests__/icons.test.tsx`
10
+ * pins that equivalence against the server-rendered markup of the original
11
+ * components, so a change here that alters a single attribute fails a test.
12
+ *
13
+ * Only the props the widget passes are supported — `size` and `color`, plus
14
+ * ordinary SVG attributes. react-icons' `IconContext` is not: nothing in this
15
+ * package ever provided one.
16
+ */
17
+ import React from "react";
18
+ function renderTree(tree) {
19
+ return tree.map((node, i) => React.createElement(node.tag, { key: i, ...node.attr }, renderTree(node.child)));
20
+ }
21
+ function IconBase({ data, size, title, ...svgProps }) {
22
+ const computedSize = size || "1em";
23
+ return React.createElement("svg", {
24
+ stroke: "currentColor",
25
+ fill: "currentColor",
26
+ strokeWidth: "0",
27
+ ...data.attr,
28
+ ...svgProps,
29
+ className: svgProps.className,
30
+ style: { color: svgProps.color, ...svgProps.style },
31
+ height: computedSize,
32
+ width: computedSize,
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ }, title && React.createElement("title", null, title), renderTree(data.child));
35
+ }
36
+ function icon(data) {
37
+ return (props) => IconBase({ ...props, data });
38
+ }
39
+ export const FaUser = icon({ "tag": "svg", "attr": { "viewBox": "0 0 448 512" }, "child": [{ "tag": "path", "attr": { "d": "M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" }, "child": [] }] });
40
+ export const FiMoreVertical = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "circle", "attr": { "cx": "12", "cy": "12", "r": "1" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "5", "r": "1" }, "child": [] }, { "tag": "circle", "attr": { "cx": "12", "cy": "19", "r": "1" }, "child": [] }] });
41
+ export const FiMic = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" }, "child": [] }, { "tag": "path", "attr": { "d": "M19 10v2a7 7 0 0 1-14 0v-2" }, "child": [] }, { "tag": "line", "attr": { "x1": "12", "y1": "19", "x2": "12", "y2": "23" }, "child": [] }, { "tag": "line", "attr": { "x1": "8", "y1": "23", "x2": "16", "y2": "23" }, "child": [] }] });
42
+ export const FiSend = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "line", "attr": { "x1": "22", "y1": "2", "x2": "11", "y2": "13" }, "child": [] }, { "tag": "polygon", "attr": { "points": "22 2 15 22 11 13 2 9 22 2" }, "child": [] }] });
43
+ export const FiPhoneOff = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "none", "stroke": "currentColor", "strokeWidth": "2", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "d": "M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91" }, "child": [] }, { "tag": "line", "attr": { "x1": "23", "y1": "1", "x2": "1", "y2": "23" }, "child": [] }] });
44
+ export const IoClose = icon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z" }, "child": [] }] });
45
+ export const IoVideocam = icon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M464 384.39a32 32 0 0 1-13-2.77 15.77 15.77 0 0 1-2.71-1.54l-82.71-58.22A32 32 0 0 1 352 295.7v-79.4a32 32 0 0 1 13.58-26.16l82.71-58.22a15.77 15.77 0 0 1 2.71-1.54 32 32 0 0 1 45 29.24v192.76a32 32 0 0 1-32 32zM268 400H84a68.07 68.07 0 0 1-68-68V180a68.07 68.07 0 0 1 68-68h184.48A67.6 67.6 0 0 1 336 179.52V332a68.07 68.07 0 0 1-68 68z" }, "child": [] }] });
46
+ export const IoVideocamOff = icon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M336 179.52A67.52 67.52 0 0 0 268.48 112h-79.2a4 4 0 0 0-2.82 6.83l142.71 142.71a4 4 0 0 0 6.83-2.82zM16 180v152a68 68 0 0 0 68 68h184a67.66 67.66 0 0 0 42.84-15.24 4 4 0 0 0 .33-6L54.41 122a4 4 0 0 0-4.87-.62A68 68 0 0 0 16 180zm448 204.39a32 32 0 0 1-13-2.77 15.77 15.77 0 0 1-2.71-1.54l-82.71-58.22A32 32 0 0 1 352 295.7v-79.4a32 32 0 0 1 13.58-26.16l82.71-58.22a15.77 15.77 0 0 1 2.71-1.54 32 32 0 0 1 45 29.24v192.76a32 32 0 0 1-32 32z" }, "child": [] }, { "tag": "path", "attr": { "fill": "none", "strokeLinecap": "round", "strokeMiterlimit": "10", "strokeWidth": "32", "d": "M416 416 80 80" }, "child": [] }] });
47
+ export const IoVolumeMute = icon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "fill": "none", "strokeLinecap": "round", "strokeMiterlimit": "10", "strokeWidth": "32", "d": "M416 432 64 80" }, "child": [] }, { "tag": "path", "attr": { "d": "M243.33 98.86a23.89 23.89 0 0 0-25.55 1.82l-.66.51-28.52 23.35a8 8 0 0 0-.59 11.85l54.33 54.33a8 8 0 0 0 13.66-5.66v-64.49a24.51 24.51 0 0 0-12.67-21.71zm8 236.43L96.69 180.69A16 16 0 0 0 85.38 176H56a24 24 0 0 0-24 24v112a24 24 0 0 0 24 24h69.76l92 75.31a23.9 23.9 0 0 0 25.87 1.69A24.51 24.51 0 0 0 256 391.45v-44.86a16 16 0 0 0-4.67-11.3zM352 256c0-24.56-5.81-47.87-17.75-71.27a16 16 0 1 0-28.5 14.55C315.34 218.06 320 236.62 320 256q0 4-.31 8.13a8 8 0 0 0 2.32 6.25l14.36 14.36a8 8 0 0 0 13.55-4.31A146 146 0 0 0 352 256zm64 0c0-51.18-13.08-83.89-34.18-120.06a16 16 0 0 0-27.64 16.12C373.07 184.44 384 211.83 384 256c0 23.83-3.29 42.88-9.37 60.65a8 8 0 0 0 1.9 8.26L389 337.4a8 8 0 0 0 13.13-2.79C411 311.76 416 287.26 416 256z" }, "child": [] }, { "tag": "path", "attr": { "d": "M480 256c0-74.25-20.19-121.11-50.51-168.61a16 16 0 1 0-27 17.22C429.82 147.38 448 189.5 448 256c0 46.19-8.43 80.27-22.43 110.53a8 8 0 0 0 1.59 9l11.92 11.92a8 8 0 0 0 12.92-2.16C471.6 344.9 480 305 480 256z" }, "child": [] }] });
48
+ export const IoVolumeHigh = icon({ "tag": "svg", "attr": { "viewBox": "0 0 512 512" }, "child": [{ "tag": "path", "attr": { "d": "M232 416a23.88 23.88 0 0 1-14.2-4.68 8.27 8.27 0 0 1-.66-.51L125.76 336H56a24 24 0 0 1-24-24V200a24 24 0 0 1 24-24h69.75l91.37-74.81a8.27 8.27 0 0 1 .66-.51A24 24 0 0 1 256 120v272a24 24 0 0 1-24 24zm-106.18-80zm-.27-159.86zM320 336a16 16 0 0 1-14.29-23.19c9.49-18.87 14.3-38 14.3-56.81 0-19.38-4.66-37.94-14.25-56.73a16 16 0 0 1 28.5-14.54C346.19 208.12 352 231.44 352 256c0 23.86-6 47.81-17.7 71.19A16 16 0 0 1 320 336z" }, "child": [] }, { "tag": "path", "attr": { "d": "M368 384a16 16 0 0 1-13.86-24C373.05 327.09 384 299.51 384 256c0-44.17-10.93-71.56-29.82-103.94a16 16 0 0 1 27.64-16.12C402.92 172.11 416 204.81 416 256c0 50.43-13.06 83.29-34.13 120a16 16 0 0 1-13.87 8z" }, "child": [] }, { "tag": "path", "attr": { "d": "M416 432a16 16 0 0 1-13.39-24.74C429.85 365.47 448 323.76 448 256c0-66.5-18.18-108.62-45.49-151.39a16 16 0 1 1 27-17.22C459.81 134.89 480 181.74 480 256c0 64.75-14.66 113.63-50.6 168.74A16 16 0 0 1 416 432z" }, "child": [] }] });
49
+ export const LiaRedoAltSolid = icon({ "tag": "svg", "attr": { "viewBox": "0 0 32 32" }, "child": [{ "tag": "path", "attr": { "d": "M 16 3 C 8.832031 3 3 8.832031 3 16 C 3 23.167969 8.832031 29 16 29 C 23.167969 29 29 23.167969 29 16 L 27 16 C 27 22.085938 22.085938 27 16 27 C 9.914063 27 5 22.085938 5 16 C 5 9.914063 9.914063 5 16 5 C 19.875 5 23.261719 6.984375 25.21875 10 L 20 10 L 20 12 L 28 12 L 28 4 L 26 4 L 26 7.71875 C 23.617188 4.84375 20.019531 3 16 3 Z" }, "child": [] }] });
50
+ export const MdDragIndicator = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }, "child": [] }] });
51
+ export const MdScreenShare = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "M20 18c1.1 0 1.99-.9 1.99-2L22 6a2 2 0 0 0-2-2H4c-1.11 0-2 .89-2 2v10a2 2 0 0 0 2 2H0v2h24v-2h-4zm-7-3.53v-2.19c-2.78 0-4.61.85-6 2.72.56-2.67 2.11-5.33 6-5.87V7l4 3.73-4 3.74z" }, "child": [] }] });
52
+ export const MdStopScreenShare = icon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "fill": "none", "d": "M0 0h24v24H0V0z" }, "child": [] }, { "tag": "path", "attr": { "d": "m21.22 18.02 2 2H24v-2h-2.78zm.77-2 .01-10a2 2 0 0 0-2-2H7.22l5.23 5.23c.18-.04.36-.07.55-.1V7.02l4 3.73-1.58 1.47 5.54 5.54c.61-.33 1.03-.99 1.03-1.74zM2.39 1.73 1.11 3l1.54 1.54c-.4.36-.65.89-.65 1.48v10a2 2 0 0 0 2 2H0v2h18.13l2.71 2.71 1.27-1.27L2.39 1.73zM7 15.02c.31-1.48.92-2.95 2.07-4.06l1.59 1.59c-1.54.38-2.7 1.18-3.66 2.47z" }, "child": [] }] });
53
+ export const PiWaveform = icon({ "tag": "svg", "attr": { "viewBox": "0 0 256 256", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M56,96v64a8,8,0,0,1-16,0V96a8,8,0,0,1,16,0ZM88,24a8,8,0,0,0-8,8V224a8,8,0,0,0,16,0V32A8,8,0,0,0,88,24Zm40,32a8,8,0,0,0-8,8V192a8,8,0,0,0,16,0V64A8,8,0,0,0,128,56Zm40,32a8,8,0,0,0-8,8v64a8,8,0,0,0,16,0V96A8,8,0,0,0,168,88Zm40-16a8,8,0,0,0-8,8v96a8,8,0,0,0,16,0V80A8,8,0,0,0,208,72Z" }, "child": [] }] });
@@ -3,9 +3,12 @@ export { ConvaiWidget } from './components/ConvaiWidget.js';
3
3
  export { MarkdownRenderer } from './components/rtc-widget/components/MarkdownRenderer.js';
4
4
  export { parseInlineMarkdown, mediaKindForUrl, isSafeHref, compactUrl } from '../utils/inlineMarkdown.js';
5
5
  export type { InlineNode, MediaKind } from '../utils/inlineMarkdown.js';
6
+ export { linkKindForUrl, describeUrl } from '../utils/linkPresentation.js';
7
+ export type { LinkKind } from '../utils/linkPresentation.js';
8
+ export { resolveLinkPreviewCached, isCardWorthy, LINK_PREVIEW_TIMEOUT_MS } from '../utils/linkPreview.js';
9
+ export type { LinkPreviewMeta, LinkPreviewResolver } from '../utils/linkPreview.js';
6
10
  export * from './hooks/index.js';
7
11
  export * from '../core/types.js';
8
12
  export { getDisconnectReasonMessage } from '../core/types.js';
9
13
  export { ActionResultAckError, ConvaiClient } from '../core/index.js';
10
14
  export { RoomAudioRenderer as AudioRenderer, RoomContext as AudioContext } from '@livekit/components-react';
11
- //# sourceMappingURL=index.d.ts.map
@@ -9,6 +9,8 @@ export { ConvaiWidget } from './components/ConvaiWidget.js';
9
9
  export { MarkdownRenderer } from './components/rtc-widget/components/MarkdownRenderer.js';
10
10
  // The tokenizer behind it, for building a renderer from scratch.
11
11
  export { parseInlineMarkdown, mediaKindForUrl, isSafeHref, compactUrl } from '../utils/inlineMarkdown.js';
12
+ export { linkKindForUrl, describeUrl } from '../utils/linkPresentation.js';
13
+ export { resolveLinkPreviewCached, isCardWorthy, LINK_PREVIEW_TIMEOUT_MS } from '../utils/linkPreview.js';
12
14
  // Additional hooks (for advanced usage)
13
15
  export * from './hooks/index.js';
14
16
  // Re-export core types for convenience
@@ -19,4 +21,3 @@ export { getDisconnectReasonMessage } from '../core/types.js';
19
21
  export { ActionResultAckError, ConvaiClient } from '../core/index.js';
20
22
  // Re-export LiveKit components for convenience (backward compatible)
21
23
  export { RoomAudioRenderer as AudioRenderer, RoomContext as AudioContext } from '@livekit/components-react';
22
- //# sourceMappingURL=index.js.map
@@ -57,4 +57,3 @@ export declare function compactUrl(url: string, max?: number): string;
57
57
  /** True when `url` uses a scheme safe to expose as an anchor href. */
58
58
  export declare function isSafeHref(url: string): boolean;
59
59
  export declare function parseInlineMarkdown(line: string): InlineNode[];
60
- //# sourceMappingURL=inlineMarkdown.d.ts.map
@@ -180,4 +180,3 @@ export function parseInlineMarkdown(line) {
180
180
  pushText(line.slice(lastIndex));
181
181
  return nodes;
182
182
  }
183
- //# sourceMappingURL=inlineMarkdown.js.map
@@ -0,0 +1,15 @@
1
+ export interface LightboxOptions {
2
+ src: string;
3
+ alt: string;
4
+ /** Shown under the image; normally `describeUrl(src)`. */
5
+ caption: string;
6
+ /** Target of "Open original". */
7
+ href: string;
8
+ root: Document | ShadowRoot;
9
+ /** Where focus goes back to on close. Defaults to whatever was focused on open. */
10
+ returnFocusTo?: HTMLElement | null;
11
+ }
12
+ export interface LightboxHandle {
13
+ close(): void;
14
+ }
15
+ export declare function openLightbox(opts: LightboxOptions): LightboxHandle;
@@ -0,0 +1,94 @@
1
+ /**
2
+ * The image lightbox — one plain-DOM implementation used by the React
3
+ * renderer and the vanilla widget. Mounted into a Document or a ShadowRoot so
4
+ * `part` hooks and the injected keyframes resolve wherever the widget lives.
5
+ * One at a time: opening a second closes the first.
6
+ */
7
+ import { glyph, presentationStyles, toCssText } from "./linkPresentation.js";
8
+ import { injectKeyframes } from "../vanilla/styles.js";
9
+ let current = null;
10
+ const el = (tag, part, style) => {
11
+ const node = document.createElement(tag);
12
+ node.setAttribute("part", part);
13
+ node.style.cssText = toCssText(style);
14
+ return node;
15
+ };
16
+ export function openLightbox(opts) {
17
+ current?.close();
18
+ injectKeyframes(opts.root);
19
+ const mount = opts.root instanceof ShadowRoot ? opts.root : opts.root.body;
20
+ const backdrop = el("div", "lightbox-backdrop", presentationStyles.lightboxBackdrop);
21
+ backdrop.setAttribute("role", "dialog");
22
+ backdrop.setAttribute("aria-modal", "true");
23
+ backdrop.setAttribute("aria-label", opts.alt || "Image preview");
24
+ const box = el("div", "lightbox", presentationStyles.lightbox);
25
+ const img = el("img", "lightbox-image", presentationStyles.lightboxImage);
26
+ img.src = opts.src;
27
+ img.alt = opts.alt;
28
+ const caption = el("span", "lightbox-caption", presentationStyles.lightboxCaption);
29
+ caption.textContent = opts.caption;
30
+ const controls = el("div", "lightbox-controls", presentationStyles.lightboxControls);
31
+ const open = el("a", "lightbox-open", presentationStyles.lightboxButton);
32
+ open.href = opts.href;
33
+ open.target = "_blank";
34
+ open.rel = "noopener noreferrer";
35
+ open.innerHTML = `${glyph("external")}<span>Open original</span>`;
36
+ const close = el("button", "lightbox-close", presentationStyles.lightboxButton);
37
+ close.type = "button";
38
+ close.setAttribute("aria-label", "Close image preview");
39
+ close.innerHTML = glyph("close");
40
+ controls.append(open, close);
41
+ // A character can invent a URL; the card already collapsed for that case,
42
+ // but the full-size load can still fail on its own. Keep the way out visible.
43
+ img.addEventListener("error", () => {
44
+ const fallback = el("div", "lightbox-fallback", presentationStyles.lightboxFallback);
45
+ fallback.textContent = "Image could not be loaded";
46
+ img.replaceWith(fallback);
47
+ });
48
+ const previousOverflow = document.body.style.overflow;
49
+ const restoreFocus = opts.returnFocusTo ?? document.activeElement;
50
+ const activeElement = () => opts.root instanceof ShadowRoot ? opts.root.activeElement : document.activeElement;
51
+ const onKey = (e) => {
52
+ if (e.key === "Escape") {
53
+ e.preventDefault();
54
+ handle.close();
55
+ return;
56
+ }
57
+ if (e.key === "Tab") {
58
+ // Trap between the two controls; there is nothing else to reach.
59
+ const active = activeElement();
60
+ if (e.shiftKey && active === open) {
61
+ e.preventDefault();
62
+ close.focus();
63
+ }
64
+ else if (!e.shiftKey && active === close) {
65
+ e.preventDefault();
66
+ open.focus();
67
+ }
68
+ }
69
+ };
70
+ const handle = {
71
+ close() {
72
+ if (current !== handle)
73
+ return;
74
+ current = null;
75
+ document.removeEventListener("keydown", onKey, true);
76
+ backdrop.remove();
77
+ document.body.style.overflow = previousOverflow;
78
+ restoreFocus?.focus?.();
79
+ },
80
+ };
81
+ backdrop.addEventListener("click", (e) => {
82
+ if (e.target === backdrop)
83
+ handle.close();
84
+ });
85
+ close.addEventListener("click", () => handle.close());
86
+ document.addEventListener("keydown", onKey, true);
87
+ box.append(controls, img, caption);
88
+ backdrop.appendChild(box);
89
+ mount.appendChild(backdrop);
90
+ document.body.style.overflow = "hidden";
91
+ current = handle;
92
+ close.focus();
93
+ return handle;
94
+ }