@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
@@ -1,10 +1,12 @@
1
+ import type { LinkPreviewResolver } from "../../../../utils/linkPreview.js";
1
2
  interface ConviMessageProps {
2
3
  message: string;
3
4
  timestamp?: string;
4
5
  className?: string;
5
6
  showLogo?: boolean;
6
7
  sender?: string;
8
+ /** Open Graph lookup for plain web links; see MarkdownRenderer. */
9
+ resolveLinkPreview?: LinkPreviewResolver;
7
10
  }
8
- export declare const ConviMessage: ({ message, timestamp, className, showLogo, sender, }: ConviMessageProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ConviMessage: ({ message, timestamp, className, showLogo, sender, resolveLinkPreview, }: ConviMessageProps) => import("react/jsx-runtime").JSX.Element;
9
12
  export {};
10
- //# sourceMappingURL=ConviMessage.d.ts.map
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { aeroTheme } from "../styles/index.js";
3
3
  import { ConvaiLogo, ConviBubble, ConviMessageContainer, MessageHeader, ConviLabel, LogoWrapper, } from "../styles/index.js";
4
4
  import { MarkdownRenderer } from "./MarkdownRenderer.js";
5
- export const ConviMessage = ({ message, timestamp, className, showLogo = true, sender, }) => {
6
- return (_jsxs(ConviMessageContainer, { className: className, children: [_jsxs(ConviBubble, { children: [showLogo && (_jsxs(MessageHeader, { children: [_jsx(LogoWrapper, { children: _jsx(ConvaiLogo, { size: "sm", color: "#10b981", animate: false, state: "connected" }) }), _jsx(ConviLabel, { children: sender })] })), _jsx(MarkdownRenderer, { text: message })] }), timestamp && (_jsx("span", { style: {
5
+ export const ConviMessage = ({ message, timestamp, className, showLogo = true, sender, resolveLinkPreview, }) => {
6
+ return (_jsxs(ConviMessageContainer, { className: className, children: [_jsxs(ConviBubble, { children: [showLogo && (_jsxs(MessageHeader, { children: [_jsx(LogoWrapper, { children: _jsx(ConvaiLogo, { size: "sm", color: "#10b981", animate: false, state: "connected" }) }), _jsx(ConviLabel, { children: sender })] })), _jsx(MarkdownRenderer, { text: message, resolveLinkPreview: resolveLinkPreview })] }), timestamp && (_jsx("span", { style: {
7
7
  fontSize: aeroTheme.typography.sizes.caption,
8
8
  color: aeroTheme.colors.text.secondary,
9
9
  marginTop: 4,
@@ -11,4 +11,3 @@ export const ConviMessage = ({ message, timestamp, className, showLogo = true, s
11
11
  fontFamily: aeroTheme.typography.fontFamily.body,
12
12
  }, children: timestamp }))] }));
13
13
  };
14
- //# sourceMappingURL=ConviMessage.js.map
@@ -6,4 +6,3 @@ interface FloatingVideoProps {
6
6
  }
7
7
  export declare const FloatingVideo: React.FC<FloatingVideoProps>;
8
8
  export {};
9
- //# sourceMappingURL=FloatingVideo.d.ts.map
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useRef, useState } from "react";
3
3
  import { motion } from "framer-motion";
4
4
  import { VideoTrack, RoomContext, useRoomContext } from "@livekit/components-react";
5
- import { IoClose, IoVideocamOff } from "react-icons/io5";
6
- import { MdDragIndicator } from "react-icons/md";
5
+ import { IoClose, IoVideocamOff, MdDragIndicator } from "../../../icons.js";
7
6
  import { aeroTheme } from "../styles/theme.js";
8
7
  import { iosTransitions } from "../styles/framerConfig.js";
9
8
  import { useLocalCameraTrack } from "../../../hooks/useLocalCameraTrack.js";
@@ -119,4 +118,3 @@ export const FloatingVideo = ({ isVisible, onClose, mirror = true, }) => {
119
118
  height: "100%",
120
119
  }, children: _jsx(LocalVideoDisplay, { mirror: mirror }) }) })] }) }) }));
121
120
  };
122
- //# sourceMappingURL=FloatingVideo.js.map
@@ -1,14 +1,31 @@
1
1
  import React from "react";
2
+ import type { LinkPreviewResolver } from "../../../../utils/linkPreview.js";
3
+ /**
4
+ * The widget's bubble renderer. Everything visual comes from
5
+ * utils/linkPresentation so this file and the vanilla widget cannot drift;
6
+ * this file only maps tokenizer nodes onto JSX.
7
+ *
8
+ * `data-convai-part` mirrors the vanilla widget's `part` names. React renders
9
+ * in light DOM where `part` means nothing, but the same names let tests and
10
+ * host CSS target both renderers with one vocabulary.
11
+ */
2
12
  interface MarkdownRendererProps {
3
13
  text: string;
4
14
  /**
5
- * Render inline image/video previews under a media link. Bot messages want
6
- * them; the user's own bubble does not — you already know what you typed, and
7
- * a preview there would let a URL a user pasted embed remote media into the
15
+ * Render cards and chips under links. Bot messages want them; the user's
16
+ * own bubble does not — you already know what you typed, and a preview
17
+ * there would let a URL a user pasted embed remote media into the
8
18
  * transcript. Links stay clickable either way.
9
19
  */
10
20
  media?: boolean;
21
+ /** Test seam for mixed-content detection. Defaults to the page's protocol. */
22
+ pageProtocol?: string;
23
+ /**
24
+ * Host-supplied Open Graph lookup. With it, a plain web link in a bot
25
+ * bubble gets a site card once the lookup settles; without it, nothing
26
+ * changes. See docs/convai_link_previews.md, "Site cards".
27
+ */
28
+ resolveLinkPreview?: LinkPreviewResolver;
11
29
  }
12
30
  export declare const MarkdownRenderer: React.FC<MarkdownRendererProps>;
13
31
  export {};
14
- //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -1,157 +1,140 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from "react";
3
- import { parseInlineMarkdown, compactUrl, } from "../../../../utils/inlineMarkdown.js";
4
- const MEDIA_RADIUS = 8;
5
- const SHIMMER = "convai-preview-shimmer";
6
- /**
7
- * The renderer styles inline, but a keyframe cannot be expressed that way, so
8
- * the one animation it needs is injected once per document. Guarded for SSR and
9
- * for the tests, which render to a string with no document.
10
- */
11
- function ensureShimmerKeyframes() {
12
- if (typeof document === "undefined")
13
- return;
14
- if (document.getElementById(SHIMMER))
15
- return;
16
- const style = document.createElement("style");
17
- style.id = SHIMMER;
18
- style.textContent = `
19
- @keyframes ${SHIMMER} { from { background-position: 200% 0 } to { background-position: -200% 0 } }
20
- @media (prefers-reduced-motion: reduce) {
21
- [data-convai-skeleton] { animation: none !important }
22
- }`;
23
- document.head.appendChild(style);
24
- }
25
- const linkStyle = {
26
- color: "#10b981",
27
- textDecoration: "underline",
28
- wordBreak: "break-all",
29
- };
30
- const mediaStyle = {
31
- display: "block",
32
- width: "100%",
33
- height: "100%",
34
- objectFit: "cover",
35
- borderRadius: MEDIA_RADIUS,
36
- };
37
- /**
38
- * A preview card sizes itself before the media arrives, so the bubble does not
39
- * jump when an image decodes. 16/10 is a compromise: tall enough to read, short
40
- * enough that several in a row still scroll.
41
- */
42
- const CARD_ASPECT = "16 / 10";
43
- const cardStyle = {
44
- // A span by default is inline, where aspect-ratio does nothing.
45
- display: "block",
46
- position: "relative",
47
- marginTop: 6,
48
- maxWidth: 320,
49
- aspectRatio: CARD_ASPECT,
50
- borderRadius: MEDIA_RADIUS,
51
- overflow: "hidden",
52
- // The widget is embedded in someone else's page on an unknown background, so
53
- // chrome is derived from the inherited text colour rather than a fixed grey.
54
- background: "color-mix(in srgb, currentColor 6%, transparent)",
55
- boxShadow: "inset 0 0 0 1px color-mix(in srgb, currentColor 10%, transparent)",
56
- };
57
- const skeletonStyle = {
58
- position: "absolute",
59
- inset: 0,
60
- borderRadius: MEDIA_RADIUS,
61
- background: "color-mix(in srgb, currentColor 8%, transparent)",
62
- backgroundImage: "linear-gradient(90deg, transparent, color-mix(in srgb, currentColor 12%, transparent), transparent)",
63
- backgroundSize: "200% 100%",
64
- animation: `${SHIMMER} 1.4s ease-in-out infinite`,
65
- };
66
- const captionStyle = {
67
- display: "block",
68
- marginTop: 4,
69
- fontSize: 11,
70
- opacity: 0.7,
71
- whiteSpace: "nowrap",
72
- overflow: "hidden",
73
- textOverflow: "ellipsis",
3
+ import { parseInlineMarkdown, compactUrl } from "../../../../utils/inlineMarkdown.js";
4
+ import { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, glyph, presentationStyles as S, PREVIEW_TIMEOUT_MS, MAX_CARDS_PER_MESSAGE, } from "../../../../utils/linkPresentation.js";
5
+ import { openLightbox } from "../../../../utils/lightbox.js";
6
+ import { SiteCard } from "./SiteCard.js";
7
+ import { injectKeyframes } from "../../../../vanilla/styles.js";
8
+ const css = (...objs) => Object.assign({}, ...objs);
9
+ const Glyph = ({ name, style }) => (_jsx("span", { style: css(S.contactGlyph, style ?? {}), dangerouslySetInnerHTML: { __html: glyph(name) } }));
10
+ /** Inline styles cannot express :focus-visible, so the ring is toggled by hand. */
11
+ const useFocusRing = () => {
12
+ const [focused, setFocused] = React.useState(false);
13
+ return {
14
+ style: focused ? S.linkFocus : {},
15
+ onFocus: (e) => setFocused(e.target.matches(":focus-visible")),
16
+ onBlur: () => setFocused(false),
17
+ };
74
18
  };
75
- const unavailableStyle = {
76
- ...captionStyle,
77
- marginTop: 6,
78
- opacity: 0.55,
79
- fontStyle: "italic",
19
+ const Anchor = ({ href, kind, label }) => {
20
+ const ring = useFocusRing();
21
+ // A bare URL is its own label and may be elided for display; the title
22
+ // compares against what is actually shown so the full target is one hover away.
23
+ const display = label === href ? compactUrl(label) : label;
24
+ return (_jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", title: hoverTitle(kind, href, display), "data-convai-part": "message-link", style: css(S.link, ring.style), onFocus: ring.onFocus, onBlur: ring.onBlur, children: [display, kind === "ftp" && (_jsx("span", { "data-convai-part": "message-link-badge", style: css(S.badge), children: "FTP" }))] }));
80
25
  };
81
- /** An unsafe target: the words the character wrote, with no href behind them. */
82
- const blockedStyle = {
83
- opacity: 0.75,
84
- textDecoration: "underline",
85
- textDecorationStyle: "dotted",
86
- cursor: "help",
26
+ const ContactChip = ({ href, kind }) => {
27
+ const ring = useFocusRing();
28
+ return (_jsxs("a", { href: href, title: hoverTitle(kind, href, href), "data-convai-part": "message-contact", style: css(S.contact, ring.style), onFocus: ring.onFocus, onBlur: ring.onBlur, children: [_jsx(Glyph, { name: kind }), _jsx("span", { children: contactLabel(href) })] }));
87
29
  };
88
- /** `cdn.example.com/a/b/c.png` → `cdn.example.com · c.png` */
89
- function describeUrl(url) {
30
+ const DocumentCard = ({ href }) => {
31
+ const ring = useFocusRing();
32
+ let host = "";
90
33
  try {
91
- const { host, pathname } = new URL(url);
92
- const file = pathname.split("/").filter(Boolean).pop();
93
- return file ? `${host} · ${file}` : host;
34
+ host = new URL(href).host;
94
35
  }
95
36
  catch {
96
- return compactUrl(url);
37
+ /* keep empty */
97
38
  }
98
- }
39
+ return (_jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", title: href, "data-convai-part": "message-file-card", style: css(S.fileCard, ring.style), onFocus: ring.onFocus, onBlur: ring.onBlur, children: [_jsx("span", { "data-convai-part": "message-file-icon", style: css(S.fileIcon), children: documentBadge(href) }), _jsxs("span", { style: css(S.fileBody), children: [_jsx("span", { "data-convai-part": "message-file-name", style: css(S.fileName), children: fileNameOf(href) }), _jsxs("span", { "data-convai-part": "message-file-meta", style: css(S.fileMeta), children: [host, " \u00B7 Opens in a new tab"] })] })] }));
40
+ };
99
41
  /**
100
- * Inline preview for an image or video URL, shown under its link.
101
- *
102
- * The media element is always in the tree so the browser starts fetching it
103
- * immediately; the skeleton sits on top until it decodes. A URL that does not
104
- * resolve — which a character can easily invent — collapses to one muted line
105
- * instead of leaving an empty player in the transcript.
42
+ * Inline preview for an image or video URL. The element is in the tree from
43
+ * the start so the fetch begins immediately; a skeleton covers it until it
44
+ * decodes. Error, timeout, or an insecure URL collapse it to one muted line
45
+ * so a URL the character invented never leaves an empty player behind.
106
46
  */
107
- const MediaPreview = ({ src, alt, kind }) => {
108
- const [state, setState] = React.useState("loading");
109
- React.useEffect(ensureShimmerKeyframes, []);
47
+ const MediaPreview = ({ src, alt, kind, pageProtocol, }) => {
48
+ const insecure = isMixedContent(src, pageProtocol);
49
+ const [state, setState] = React.useState(insecure ? "error" : "loading");
50
+ const cardRef = React.useRef(null);
51
+ React.useEffect(() => {
52
+ injectKeyframes(document);
53
+ }, []);
54
+ React.useEffect(() => {
55
+ if (state !== "loading")
56
+ return;
57
+ const t = setTimeout(() => setState((s) => (s === "loading" ? "error" : s)), PREVIEW_TIMEOUT_MS);
58
+ return () => clearTimeout(t);
59
+ }, [state]);
110
60
  if (state === "error") {
111
- return _jsxs("span", { style: unavailableStyle, children: ["Preview unavailable \u2014 ", describeUrl(src)] });
61
+ return (_jsxs("span", { "data-convai-part": "message-media-unavailable", style: css(S.unavailable), children: ["Preview unavailable \u2014 ", describeUrl(src), insecure ? " (insecure URL)" : ""] }));
112
62
  }
113
63
  const ready = state === "ready";
114
- return (_jsxs(_Fragment, { children: [_jsxs("span", { style: cardStyle, children: [kind === "image" ? (_jsx("img", { src: src, alt: alt, loading: "lazy", onLoad: () => setState("ready"), onError: () => setState("error"), style: { ...mediaStyle, opacity: ready ? 1 : 0 } })) : (_jsx("video", { src: src, controls: true, preload: "metadata", onLoadedMetadata: () => setState("ready"), onError: () => setState("error"), style: { ...mediaStyle, objectFit: "contain", opacity: ready ? 1 : 0 } })), !ready && _jsx("span", { "data-convai-skeleton": "", style: skeletonStyle, "aria-hidden": "true" })] }), _jsx("span", { style: captionStyle, children: describeUrl(src) })] }));
64
+ const open = () => openLightbox({
65
+ src,
66
+ alt,
67
+ caption: describeUrl(src),
68
+ href: src,
69
+ root: document,
70
+ returnFocusTo: cardRef.current,
71
+ });
72
+ const buttonProps = kind === "image"
73
+ ? {
74
+ role: "button",
75
+ tabIndex: 0,
76
+ "aria-label": `Open image: ${fileNameOf(src)}`,
77
+ onClick: open,
78
+ onKeyDown: (e) => {
79
+ if (e.key === "Enter" || e.key === " ") {
80
+ e.preventDefault();
81
+ open();
82
+ }
83
+ },
84
+ }
85
+ : {};
86
+ return (_jsxs(_Fragment, { children: [_jsxs("span", { ref: cardRef, "data-convai-part": "message-media-card", style: css(S.card, kind === "image" ? S.cardButton : {}), ...buttonProps, children: [kind === "image" ? (_jsx("img", { src: src, alt: alt, loading: "lazy", "data-convai-part": "message-media", onLoad: () => setState("ready"), onError: () => setState("error"), style: css(S.media, { opacity: ready ? 1 : 0 }) })) : (_jsx("video", { src: src, controls: true, preload: "metadata", "data-convai-part": "message-media", onLoadedMetadata: () => setState("ready"), onError: () => setState("error"), style: css(S.media, S.videoMedia, { opacity: ready ? 1 : 0 }) })), !ready && (_jsx("span", { "data-convai-skeleton": "", "data-convai-part": "message-media-skeleton", style: css(S.skeleton), "aria-hidden": "true" })), kind === "image" && (_jsx("span", { "data-convai-part": "message-media-zoom", style: css(S.zoom), children: _jsx(Glyph, { name: "zoom", style: { fontSize: 14 } }) }))] }), _jsx("span", { "data-convai-part": "message-media-caption", style: css(S.caption), children: describeUrl(src) })] }));
115
87
  };
116
- const renderNode = (node, key, media) => {
88
+ const renderNode = (node, key, media, budget, pageProtocol, resolveLinkPreview) => {
117
89
  switch (node.kind) {
118
90
  case "strong":
119
91
  return _jsx("strong", { children: node.text }, key);
120
92
  case "em":
121
93
  return _jsx("em", { children: node.text }, key);
122
- case "link":
123
- return (_jsxs(React.Fragment, { children: [_jsx("a", { href: node.href, target: "_blank", rel: "noopener noreferrer", style: linkStyle, children: node.label === node.href ? compactUrl(node.label) : node.label }), media && node.media && (_jsx(MediaPreview, { src: node.href, alt: node.label, kind: node.media }))] }, key));
124
94
  case "blocked":
125
- return (_jsx("span", { style: blockedStyle, title: `Link blocked: ${node.href}`, children: node.label }, key));
126
- case "image":
127
- // With previews off, an image still has to say what it pointed at, so it
128
- // degrades to the same anchor a plain link would render.
129
- return media ? (_jsx(MediaPreview, { src: node.src, alt: node.alt, kind: "image" }, key)) : (_jsx("a", { href: node.src, target: "_blank", rel: "noopener noreferrer", style: linkStyle, children: node.alt || node.src }, key));
95
+ // Not an anchor, ever. The label reads as the character wrote it; the
96
+ // target is only revealed on hover.
97
+ return (_jsx("span", { "data-convai-part": "message-link-blocked", style: css(S.blocked), title: `Link blocked: ${node.href}`, children: node.label }, key));
98
+ case "image": {
99
+ if (media && budget.cards < MAX_CARDS_PER_MESSAGE) {
100
+ budget.cards++;
101
+ return (_jsx(MediaPreview, { src: node.src, alt: node.alt, kind: "image", pageProtocol: pageProtocol }, key));
102
+ }
103
+ // With previews off (or the budget spent), an image still has to say
104
+ // what it pointed at, so it degrades to the same anchor a link renders.
105
+ return _jsx(Anchor, { href: node.src, kind: "image", label: node.alt || node.src }, key);
106
+ }
107
+ case "link": {
108
+ const kind = linkKindForUrl(node.href);
109
+ if (kind === "email" || kind === "phone" || kind === "sms") {
110
+ return media ? (_jsx(ContactChip, { href: node.href, kind: kind }, key)) : (_jsx(Anchor, { href: node.href, kind: kind, label: node.label }, key));
111
+ }
112
+ const wantsCard = media &&
113
+ (kind === "image" || kind === "video" || kind === "document") &&
114
+ budget.cards < MAX_CARDS_PER_MESSAGE;
115
+ // The budget is spent when the card mounts, not when it resolves, so the
116
+ // cap stays deterministic for a message naming twenty pages.
117
+ const wantsSiteCard = media && kind === "web" && !!resolveLinkPreview && budget.cards < MAX_CARDS_PER_MESSAGE;
118
+ if (wantsCard || wantsSiteCard)
119
+ budget.cards++;
120
+ return (_jsxs(React.Fragment, { children: [_jsx(Anchor, { href: node.href, kind: kind, label: node.label }), wantsCard && kind === "document" && _jsx(DocumentCard, { href: node.href }), wantsCard && kind !== "document" && (_jsx(MediaPreview, { src: node.href, alt: node.label, kind: kind, pageProtocol: pageProtocol })), wantsSiteCard && _jsx(SiteCard, { href: node.href, resolver: resolveLinkPreview })] }, key));
121
+ }
130
122
  default:
131
123
  return _jsx(React.Fragment, { children: node.text }, key);
132
124
  }
133
125
  };
134
- export const MarkdownRenderer = ({ text, media = true }) => {
135
- // Convert markdown to JSX elements
136
- const renderMarkdown = (input) => {
137
- if (!input)
138
- return null;
139
- // Handle both actual newlines and \n escape sequences
140
- // Replace literal \n strings with actual newlines
141
- const normalizedText = input.replace(/\\n/g, '\n');
142
- // Split by actual newlines
143
- const lines = normalizedText.split('\n');
144
- return lines.map((line, lineIndex) => {
145
- // Bold, italic, links, images and bare URLs — see utils/inlineMarkdown.
146
- const processedLine = parseInlineMarkdown(line).map((node, i) => renderNode(node, `${node.kind}-${lineIndex}-${i}`, media));
147
- // Handle empty lines (creates paragraph spacing)
148
- if (line.trim() === "" && lineIndex > 0) {
126
+ const wrapperStyle = { whiteSpace: "pre-wrap", wordWrap: "break-word" };
127
+ export const MarkdownRenderer = ({ text, media = true, pageProtocol, resolveLinkPreview, }) => {
128
+ if (!text)
129
+ return _jsx("div", { style: wrapperStyle });
130
+ // Handle both actual newlines and literal "\n" sequences.
131
+ const lines = text.replace(/\\n/g, "\n").split("\n");
132
+ const budget = { cards: 0 };
133
+ return (_jsx("div", { style: wrapperStyle, children: lines.map((line, lineIndex) => {
134
+ // An empty line is paragraph spacing.
135
+ if (line.trim() === "" && lineIndex > 0)
149
136
  return _jsx("br", {}, `br-${lineIndex}`);
150
- }
151
- // Return the line with line break
152
- return (_jsxs(React.Fragment, { children: [processedLine.length > 0 ? processedLine : line, lineIndex < lines.length - 1 && _jsx("br", {})] }, `line-${lineIndex}`));
153
- });
154
- };
155
- return _jsx("div", { style: { whiteSpace: 'pre-wrap', wordWrap: 'break-word' }, children: renderMarkdown(text) });
137
+ const nodes = parseInlineMarkdown(line).map((node, i) => renderNode(node, `${node.kind}-${lineIndex}-${i}`, media, budget, pageProtocol, resolveLinkPreview));
138
+ return (_jsxs(React.Fragment, { children: [nodes.length > 0 ? nodes : line, lineIndex < lines.length - 1 && _jsx("br", {})] }, `line-${lineIndex}`));
139
+ }) }));
156
140
  };
157
- //# sourceMappingURL=MarkdownRenderer.js.map
@@ -7,4 +7,3 @@ interface MessageBubbleProps {
7
7
  }
8
8
  export declare const MessageBubble: ({ children, isUser, timestamp, className, }: MessageBubbleProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
10
- //# sourceMappingURL=MessageBubble.d.ts.map
@@ -20,4 +20,3 @@ const bubbleVariants = {
20
20
  export const MessageBubble = ({ children, isUser = false, timestamp, className, }) => {
21
21
  return (_jsxs(BubbleContainer, { "$isUser": isUser, className: className, initial: "initial", animate: "animate", exit: "exit", variants: bubbleVariants, transition: { duration: 0.2, ease: "easeInOut" }, children: [_jsx(Bubble, { "$isUser": isUser, children: children }), timestamp && _jsx(Timestamp, { "$isUser": isUser, children: timestamp })] }));
22
22
  };
23
- //# sourceMappingURL=MessageBubble.js.map
@@ -1,3 +1,4 @@
1
+ import type { LinkPreviewResolver } from "../../../../utils/linkPreview.js";
1
2
  import { RTCChatMessage } from "../types/index.js";
2
3
  type Message = RTCChatMessage;
3
4
  interface MessageListProps {
@@ -5,7 +6,8 @@ interface MessageListProps {
5
6
  className?: string;
6
7
  isStreaming?: boolean;
7
8
  forceToBottomToken?: string | number | boolean;
9
+ /** Open Graph lookup for plain web links in bot bubbles. */
10
+ linkPreviewResolver?: LinkPreviewResolver;
8
11
  }
9
- export declare const MessageList: ({ messages, className, isStreaming, forceToBottomToken, }: MessageListProps) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const MessageList: ({ messages, className, isStreaming, forceToBottomToken, linkPreviewResolver, }: MessageListProps) => import("react/jsx-runtime").JSX.Element;
10
13
  export {};
11
- //# sourceMappingURL=MessageList.d.ts.map
@@ -4,7 +4,7 @@ import { UserMessage } from "./UserMessage.js";
4
4
  import { ConviMessage } from "./ConviMessage.js";
5
5
  import { aeroTheme } from "../styles/index.js";
6
6
  import { MessageListContainer, MessageWrapper, EmptyState } from "../styles/index.js";
7
- export const MessageList = ({ messages, className, isStreaming = false, forceToBottomToken, }) => {
7
+ export const MessageList = ({ messages, className, isStreaming = false, forceToBottomToken, linkPreviewResolver, }) => {
8
8
  const containerRef = useRef(null);
9
9
  const [shouldAutoScroll, setShouldAutoScroll] = React.useState(true);
10
10
  // Handle scroll events
@@ -84,6 +84,5 @@ export const MessageList = ({ messages, className, isStreaming = false, forceToB
84
84
  marginTop: 8,
85
85
  }, children: "Type a message below to begin chatting" })] }));
86
86
  }
87
- return (_jsx(MessageListContainer, { ref: containerRef, className: className, onScroll: handleScroll, children: messages.map((message) => (_jsx(MessageWrapper, { children: message.isUser ? (_jsx(UserMessage, { message: message.text, timestamp: message.timestamp, sender: message.sender })) : (_jsx(ConviMessage, { message: message.text, timestamp: message.timestamp, showLogo: message.showLogo, sender: message.sender })) }, message.id))) }));
87
+ return (_jsx(MessageListContainer, { ref: containerRef, className: className, onScroll: handleScroll, children: messages.map((message) => (_jsx(MessageWrapper, { children: message.isUser ? (_jsx(UserMessage, { message: message.text, timestamp: message.timestamp, sender: message.sender })) : (_jsx(ConviMessage, { message: message.text, timestamp: message.timestamp, showLogo: message.showLogo, sender: message.sender, resolveLinkPreview: linkPreviewResolver })) }, message.id))) }));
88
88
  };
89
- //# sourceMappingURL=MessageList.js.map
@@ -0,0 +1,14 @@
1
+ import { type LinkPreviewResolver } from "../../../../utils/linkPreview.js";
2
+ /**
3
+ * Open Graph card under a plain web link. Renders nothing until the host's
4
+ * resolver settles and nothing at all unless the result has a title or an
5
+ * image: most links resolve to nothing card-worthy, and a placeholder that
6
+ * then vanishes reads worse than a card that appears.
7
+ *
8
+ * Everything from the resolver lands in text nodes or an `img` src that
9
+ * `resolveLinkPreviewCached` already restricted to http(s). Never markup.
10
+ */
11
+ export declare const SiteCard: ({ href, resolver }: {
12
+ href: string;
13
+ resolver: LinkPreviewResolver;
14
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { resolveLinkPreviewCached, isCardWorthy, siteNameFor, faviconFor, } from "../../../../utils/linkPreview.js";
4
+ import { presentationStyles as S } from "../../../../utils/linkPresentation.js";
5
+ const css = (...objs) => Object.assign({}, ...objs);
6
+ /**
7
+ * Open Graph card under a plain web link. Renders nothing until the host's
8
+ * resolver settles and nothing at all unless the result has a title or an
9
+ * image: most links resolve to nothing card-worthy, and a placeholder that
10
+ * then vanishes reads worse than a card that appears.
11
+ *
12
+ * Everything from the resolver lands in text nodes or an `img` src that
13
+ * `resolveLinkPreviewCached` already restricted to http(s). Never markup.
14
+ */
15
+ export const SiteCard = ({ href, resolver }) => {
16
+ const [meta, setMeta] = React.useState(null);
17
+ const [faviconOk, setFaviconOk] = React.useState(true);
18
+ const [imageOk, setImageOk] = React.useState(true);
19
+ const [focused, setFocused] = React.useState(false);
20
+ React.useEffect(() => {
21
+ let live = true;
22
+ resolveLinkPreviewCached(resolver, href).then((m) => {
23
+ if (live && isCardWorthy(m))
24
+ setMeta(m);
25
+ });
26
+ return () => {
27
+ live = false;
28
+ };
29
+ }, [href, resolver]);
30
+ if (!meta)
31
+ return null;
32
+ const favicon = faviconFor(meta, href);
33
+ return (_jsxs("a", { href: href, target: "_blank", rel: "noopener noreferrer", "data-convai-part": "message-site-card", style: css(S.siteCard, focused ? S.linkFocus : {}), onFocus: (e) => setFocused(e.target.matches(":focus-visible")), onBlur: () => setFocused(false), children: [_jsxs("span", { style: css(S.siteHeader), children: [favicon && faviconOk && (_jsx("img", { src: favicon, alt: "", "data-convai-part": "message-site-favicon", style: css(S.siteFavicon), onError: () => setFaviconOk(false) })), _jsx("span", { "data-convai-part": "message-site-name", style: css(S.siteName), children: siteNameFor(meta, href) })] }), meta.title && (_jsx("span", { "data-convai-part": "message-site-title", style: css(S.siteTitle), children: meta.title })), meta.description && (_jsx("span", { "data-convai-part": "message-site-description", style: css(S.siteDescription), children: meta.description })), meta.image && imageOk && (_jsx("img", { src: meta.image, alt: "", loading: "lazy", "data-convai-part": "message-site-image", style: css(S.siteImage), onError: () => setImageOk(false) }))] }));
34
+ };
@@ -6,4 +6,3 @@ interface UserMessageProps {
6
6
  }
7
7
  export declare const UserMessage: ({ message, timestamp, className, sender, }: UserMessageProps) => import("react/jsx-runtime").JSX.Element;
8
8
  export {};
9
- //# sourceMappingURL=UserMessage.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { aeroTheme } from "../styles/index.js";
3
3
  import { UserBubble, UserMessageContainer, MessageHeader, UserLabel, LogoWrapper, } from "../styles/index.js";
4
- import { FaUser } from "react-icons/fa";
4
+ import { FaUser } from "../../../icons.js";
5
5
  import { MarkdownRenderer } from "./MarkdownRenderer.js";
6
6
  export const UserMessage = ({ message, timestamp, className, sender, }) => {
7
7
  return (_jsxs(UserMessageContainer, { className: className, children: [_jsxs(UserBubble, { children: [sender && (_jsxs(MessageHeader, { children: [_jsx(LogoWrapper, { children: _jsx(FaUser, { size: 16, color: aeroTheme.colors.convai.dark }) }), _jsx(UserLabel, { children: sender === "User" ? "You" : sender })] })), _jsx(MarkdownRenderer, { text: message, media: false })] }), timestamp && (_jsx("span", { style: {
@@ -12,4 +12,3 @@ export const UserMessage = ({ message, timestamp, className, sender, }) => {
12
12
  fontFamily: aeroTheme.typography.fontFamily.body,
13
13
  }, children: timestamp }))] }));
14
14
  };
15
- //# sourceMappingURL=UserMessage.js.map
@@ -3,4 +3,3 @@ interface ConviButtonProps {
3
3
  }
4
4
  export declare const ConviButton: ({ isOpen }: ConviButtonProps) => import("react/jsx-runtime").JSX.Element;
5
5
  export {};
6
- //# sourceMappingURL=ConviButton.d.ts.map
@@ -12,4 +12,3 @@ export const ConviButton = ({ isOpen }) => {
12
12
  ease: "easeInOut",
13
13
  }, children: _jsx(Logo, { animate: { rotate: isOpen ? 90 : 0 }, transition: iosTransitions.layoutMorph, children: _jsx(ConvaiLogo, { size: "xl", color: aeroTheme.colors.primary[500], animate: isOpen, state: isOpen ? "connected" : "idle" }) }) }));
14
14
  };
15
- //# sourceMappingURL=ConviButton.js.map
@@ -22,4 +22,3 @@ interface ConviFooterProps {
22
22
  }
23
23
  export declare const ConviFooter: ({ inputMode, inputValue, liveUserText, chatbotMic, localIsTyping, convaiIsTyping, isCreatingSpeaker, isPressingMic, isSettingsOpen, isVoiceMode, onInputChange, onKeyPress, onSend, onMicPress, onMicRelease, setIsPressingMic, onToggleVoiceMode, verbosityChanged, onContinue, }: ConviFooterProps) => import("react/jsx-runtime").JSX.Element;
24
24
  export {};
25
- //# sourceMappingURL=ConviFooter.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AnimatePresence, motion } from "framer-motion";
3
- import { FiSend, FiMic } from "react-icons/fi";
4
- import { PiWaveform } from "react-icons/pi";
3
+ import { FiMic, FiSend, PiWaveform } from "../../../../icons.js";
5
4
  import { aeroTheme } from "../../styles/theme.js";
6
5
  import { iosTransitions } from "../../styles/framerConfig.js";
7
6
  import { Footer, InputContainer, Input, ActionButton, } from "../../styles/styledComponents.js";
@@ -169,4 +168,3 @@ export const ConviFooter = ({ inputMode, inputValue, liveUserText, chatbotMic, l
169
168
  outline: "none",
170
169
  }, "aria-label": "Voice Mode", title: isVoiceMode ? "exit voice mode" : "use voice mode", children: _jsx(PiWaveform, { size: 20 }) }, "voice")) }) }))] })] }));
171
170
  };
172
- //# sourceMappingURL=ConviFooter.js.map
@@ -14,4 +14,3 @@ interface ConviHeaderProps {
14
14
  }
15
15
  export declare const ConviHeader: ({ isOpen, isSpeakerEditMode, isVoiceMode, isVerbosityMode, isMuted, characterImage, characterName, onClose, onSettingsToggle, onToggleMute, settingsButtonRef, }: ConviHeaderProps) => import("react/jsx-runtime").JSX.Element;
16
16
  export {};
17
- //# sourceMappingURL=ConviHeader.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { motion } from "framer-motion";
3
- import { FiMoreVertical } from "react-icons/fi";
4
- import { IoVolumeMute, IoVolumeHigh } from "react-icons/io5";
3
+ import { FiMoreVertical, IoVolumeHigh, IoVolumeMute } from "../../../../icons.js";
5
4
  import { ChevronDown } from "../../styles/icons.js";
6
5
  import { aeroTheme } from "../../styles/theme.js";
7
6
  import { iosTransitions } from "../../styles/framerConfig.js";
@@ -63,4 +62,3 @@ export const ConviHeader = ({ isOpen, isSpeakerEditMode, isVoiceMode, isVerbosit
63
62
  position: "relative",
64
63
  }, children: _jsx(SettingsButton, { ref: settingsButtonRef, onClick: onSettingsToggle, whileHover: { scale: 1.1 }, whileTap: { scale: 0.9 }, transition: iosTransitions.snappy, style: { cursor: "pointer" }, children: _jsx(FiMoreVertical, { size: 20 }) }) })] }));
65
64
  };
66
- //# sourceMappingURL=ConviHeader.js.map
@@ -9,4 +9,3 @@ interface SettingsTrayProps {
9
9
  }
10
10
  export declare const SettingsTray: ({ isOpen, isVideoVisible, isScreenShareActive, onReset, onDisconnect, onToggleVideo, onToggleScreenShare, }: SettingsTrayProps) => import("react/jsx-runtime").JSX.Element | null;
11
11
  export {};
12
- //# sourceMappingURL=SettingsTray.d.ts.map
@@ -1,8 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AnimatePresence } from "framer-motion";
3
- import { LiaRedoAltSolid } from "react-icons/lia";
4
- import { IoVideocam, IoVideocamOff } from "react-icons/io5";
5
- import { MdScreenShare, MdStopScreenShare } from "react-icons/md";
3
+ import { IoVideocam, IoVideocamOff, LiaRedoAltSolid, MdScreenShare, MdStopScreenShare } from "../../../../icons.js";
6
4
  import { aeroTheme } from "../../styles/theme.js";
7
5
  import { iosTransitions } from "../../styles/framerConfig.js";
8
6
  import { SettingsTray as StyledSettingsTray, SettingsOption, } from "../../styles/styledComponents.js";
@@ -65,4 +63,3 @@ export const SettingsTray = ({ isOpen, isVideoVisible, isScreenShareActive, onRe
65
63
  color: "#ef4444",
66
64
  }, "aria-label": "Disconnect", title: "Disconnect", children: [_jsx("span", { style: { fontSize: "18px" }, children: "\u23FB" }), _jsx("span", { style: { fontSize: "10px", fontWeight: 500 }, children: "Disconnect" })] }))] }) }) }));
67
65
  };
68
- //# sourceMappingURL=SettingsTray.js.map
@@ -11,4 +11,3 @@ interface VoiceModeOverlayProps {
11
11
  }
12
12
  export declare const VoiceModeOverlay: ({ isActive, isTalking, isListening, convaiClient, characterImage, characterName, room, }: VoiceModeOverlayProps) => import("react/jsx-runtime").JSX.Element;
13
13
  export {};
14
- //# sourceMappingURL=VoiceModeOverlay.d.ts.map
@@ -296,4 +296,3 @@ export const VoiceModeOverlay = ({ isActive, isTalking, isListening = false, con
296
296
  color: aeroTheme.colors.text.secondary,
297
297
  }, children: isListening || isActive || isTalking ? "Audio active" : "Tap microphone to talk" })] })] }));
298
298
  };
299
- //# sourceMappingURL=VoiceModeOverlay.js.map
@@ -3,4 +3,3 @@ export { ConviHeader } from "./ConviHeader.js";
3
3
  export { ConviFooter } from "./ConviFooter.js";
4
4
  export { SettingsTray } from "./SettingsTray.js";
5
5
  export { VoiceModeOverlay } from "./VoiceModeOverlay.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@ export { ConviHeader } from "./ConviHeader.js";
3
3
  export { ConviFooter } from "./ConviFooter.js";
4
4
  export { SettingsTray } from "./SettingsTray.js";
5
5
  export { VoiceModeOverlay } from "./VoiceModeOverlay.js";
6
- //# sourceMappingURL=index.js.map
@@ -6,4 +6,3 @@ export { MarkdownRenderer } from "./MarkdownRenderer.js";
6
6
  export { FloatingVideo } from "./FloatingVideo.js";
7
7
  export { AudioVisualizer } from "./AudioVisualizer.js";
8
8
  export { ConviButton, ConviHeader, ConviFooter, SettingsTray, VoiceModeOverlay, } from "./conviComponents/index.js";
9
- //# sourceMappingURL=index.d.ts.map
@@ -12,4 +12,3 @@ export { AudioVisualizer } from "./AudioVisualizer.js";
12
12
  // export { AudioSettingsPanel } from "./AudioSettingsPanel.js";
13
13
  // Export convi sub-components
14
14
  export { ConviButton, ConviHeader, ConviFooter, SettingsTray, VoiceModeOverlay, } from "./conviComponents/index.js";
15
- //# sourceMappingURL=index.js.map