@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.
- package/README.md +35 -43
- package/dist/core/AudioManager.d.ts +0 -1
- package/dist/core/AudioManager.js +0 -1
- package/dist/core/BlendshapeQueue.d.ts +0 -1
- package/dist/core/BlendshapeQueue.js +20 -6
- package/dist/core/CharacterRoster.d.ts +0 -1
- package/dist/core/CharacterRoster.js +0 -1
- package/dist/core/CharacterVersionManager.d.ts +0 -1
- package/dist/core/CharacterVersionManager.js +0 -1
- package/dist/core/ConnectionStateHandler.d.ts +0 -1
- package/dist/core/ConnectionStateHandler.js +5 -2
- package/dist/core/ConvaiClient.d.ts +66 -3
- package/dist/core/ConvaiClient.js +253 -20
- package/dist/core/ConvaiRoomError.d.ts +0 -1
- package/dist/core/ConvaiRoomError.js +20 -2
- package/dist/core/EventEmitter.d.ts +0 -1
- package/dist/core/EventEmitter.js +0 -1
- package/dist/core/MemoryManager.d.ts +0 -1
- package/dist/core/MemoryManager.js +0 -1
- package/dist/core/MessageHandler.d.ts +5 -3
- package/dist/core/MessageHandler.js +125 -47
- package/dist/core/SSESession.d.ts +13 -9
- package/dist/core/SSESession.js +240 -13
- package/dist/core/ScreenShareManager.d.ts +0 -1
- package/dist/core/ScreenShareManager.js +0 -1
- package/dist/core/VideoManager.d.ts +0 -1
- package/dist/core/VideoManager.js +0 -1
- package/dist/core/characterInfo.d.ts +45 -0
- package/dist/core/characterInfo.js +55 -0
- package/dist/core/characterReference.d.ts +0 -1
- package/dist/core/characterReference.js +0 -1
- package/dist/core/connectRequest.d.ts +0 -1
- package/dist/core/connectRequest.js +0 -1
- package/dist/core/contextUpdateRequest.d.ts +0 -1
- package/dist/core/contextUpdateRequest.js +0 -1
- package/dist/core/index.d.ts +6 -1
- package/dist/core/index.js +20 -1
- package/dist/core/logicalTurn.d.ts +0 -1
- package/dist/core/logicalTurn.js +0 -1
- package/dist/core/modelOutput.d.ts +0 -1
- package/dist/core/modelOutput.js +0 -1
- package/dist/core/publishedChat.d.ts +0 -1
- package/dist/core/publishedChat.js +0 -1
- package/dist/core/rosterRequest.d.ts +0 -1
- package/dist/core/rosterRequest.js +0 -1
- package/dist/core/rtviEnvelope.d.ts +5 -0
- package/dist/core/rtviEnvelope.js +9 -0
- package/dist/core/types.d.ts +241 -17
- package/dist/core/types.js +0 -1
- package/dist/core/videoSourceState.d.ts +0 -1
- package/dist/core/videoSourceState.js +0 -1
- package/dist/core/visionRequest.d.ts +0 -1
- package/dist/core/visionRequest.js +0 -1
- package/dist/embed/index.d.ts +20 -3
- package/dist/embed/index.js +20 -3
- package/dist/embed/publicationApi.d.ts +0 -1
- package/dist/embed/publicationApi.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/lipsync-helpers/arkitOrder61.d.ts +0 -1
- package/dist/lipsync-helpers/arkitOrder61.js +5 -3
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.js +7 -1
- package/dist/lipsync-helpers/declarativeMapping.d.ts +2 -1
- package/dist/lipsync-helpers/declarativeMapping.js +72 -146
- package/dist/lipsync-helpers/index.d.ts +0 -1
- package/dist/lipsync-helpers/index.js +0 -1
- package/dist/lipsync-helpers/mappingTypes.d.ts +6 -5
- package/dist/lipsync-helpers/mappingTypes.js +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.d.ts +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.js +8 -9
- package/dist/lipsync-helpers/mhaLimitDrivers.d.ts +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.js +0 -1
- package/dist/lipsync-helpers/naturalness/processor.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/processor.js +6 -4
- package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.js +0 -1
- package/dist/lipsync-helpers/naturalness/types.d.ts +0 -1
- package/dist/lipsync-helpers/naturalness/types.js +0 -1
- package/dist/lipsync-helpers/presetMappers.d.ts +0 -1
- package/dist/lipsync-helpers/presetMappers.js +0 -1
- package/dist/react/components/ConvaiWidget.d.ts +9 -1
- package/dist/react/components/ConvaiWidget.js +23 -28
- package/dist/react/components/index.d.ts +0 -1
- package/dist/react/components/index.js +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +4 -2
- package/dist/react/components/rtc-widget/components/ConviMessage.js +2 -3
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +1 -3
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +21 -4
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +114 -131
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.js +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +4 -2
- package/dist/react/components/rtc-widget/components/MessageList.js +2 -3
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts +14 -0
- package/dist/react/components/rtc-widget/components/SiteCard.js +34 -0
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js +1 -2
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +1 -3
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +1 -3
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +1 -4
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.js +0 -1
- package/dist/react/components/rtc-widget/components/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/components/index.js +0 -1
- package/dist/react/components/rtc-widget/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/index.js +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.js +0 -1
- package/dist/react/components/rtc-widget/styles/icons.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/icons.js +0 -1
- package/dist/react/components/rtc-widget/styles/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/index.js +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.js +0 -1
- package/dist/react/components/rtc-widget/styles/theme.d.ts +0 -1
- package/dist/react/components/rtc-widget/styles/theme.js +0 -1
- package/dist/react/components/rtc-widget/types/index.d.ts +0 -1
- package/dist/react/components/rtc-widget/types/index.js +0 -1
- package/dist/react/hooks/index.d.ts +0 -1
- package/dist/react/hooks/index.js +0 -1
- package/dist/react/hooks/useCharacterInfo.d.ts +12 -11
- package/dist/react/hooks/useCharacterInfo.js +49 -50
- package/dist/react/hooks/useConvaiClient.d.ts +0 -1
- package/dist/react/hooks/useConvaiClient.js +8 -5
- package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -1
- package/dist/react/hooks/useLocalCameraTrack.js +0 -1
- package/dist/react/icons.d.ts +37 -0
- package/dist/react/icons.js +53 -0
- package/dist/react/index.d.ts +4 -1
- package/dist/react/index.js +2 -1
- package/dist/utils/inlineMarkdown.d.ts +0 -1
- package/dist/utils/inlineMarkdown.js +0 -1
- package/dist/utils/lightbox.d.ts +15 -0
- package/dist/utils/lightbox.js +94 -0
- package/dist/utils/linkPresentation.d.ts +75 -0
- package/dist/utils/linkPresentation.js +414 -0
- package/dist/utils/linkPreview.d.ts +45 -0
- package/dist/utils/linkPreview.js +71 -0
- package/dist/utils/logger.d.ts +0 -1
- package/dist/utils/logger.js +0 -1
- package/dist/vanilla/AudioRenderer.d.ts +0 -1
- package/dist/vanilla/AudioRenderer.js +0 -1
- package/dist/vanilla/ConvaiWidget.d.ts +0 -1
- package/dist/vanilla/ConvaiWidget.js +302 -226
- package/dist/vanilla/WebSocketSession.d.ts +0 -1
- package/dist/vanilla/WebSocketSession.js +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.d.ts +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.js +0 -1
- package/dist/vanilla/icons.d.ts +0 -1
- package/dist/vanilla/icons.js +0 -1
- package/dist/vanilla/index.d.ts +4 -1
- package/dist/vanilla/index.js +2 -1
- package/dist/vanilla/styles.d.ts +0 -1
- package/dist/vanilla/styles.js +9 -1
- package/dist/vanilla/types.d.ts +9 -1
- package/dist/vanilla/types.js +0 -1
- package/dist/vanilla/websocket.d.ts +0 -1
- package/dist/vanilla/websocket.js +0 -1
- package/dist/version.d.ts +1 -2
- package/dist/version.js +1 -2
- package/package.json +23 -28
- package/dist/core/AudioManager.d.ts.map +0 -1
- package/dist/core/AudioManager.js.map +0 -1
- package/dist/core/BlendshapeQueue.d.ts.map +0 -1
- package/dist/core/BlendshapeQueue.js.map +0 -1
- package/dist/core/CharacterRoster.d.ts.map +0 -1
- package/dist/core/CharacterRoster.js.map +0 -1
- package/dist/core/CharacterVersionManager.d.ts.map +0 -1
- package/dist/core/CharacterVersionManager.js.map +0 -1
- package/dist/core/ConnectionStateHandler.d.ts.map +0 -1
- package/dist/core/ConnectionStateHandler.js.map +0 -1
- package/dist/core/ConvaiClient.d.ts.map +0 -1
- package/dist/core/ConvaiClient.js.map +0 -1
- package/dist/core/ConvaiRoomError.d.ts.map +0 -1
- package/dist/core/ConvaiRoomError.js.map +0 -1
- package/dist/core/EventEmitter.d.ts.map +0 -1
- package/dist/core/EventEmitter.js.map +0 -1
- package/dist/core/MemoryManager.d.ts.map +0 -1
- package/dist/core/MemoryManager.js.map +0 -1
- package/dist/core/MessageHandler.d.ts.map +0 -1
- package/dist/core/MessageHandler.js.map +0 -1
- package/dist/core/SSESession.d.ts.map +0 -1
- package/dist/core/SSESession.js.map +0 -1
- package/dist/core/ScreenShareManager.d.ts.map +0 -1
- package/dist/core/ScreenShareManager.js.map +0 -1
- package/dist/core/VideoManager.d.ts.map +0 -1
- package/dist/core/VideoManager.js.map +0 -1
- package/dist/core/characterReference.d.ts.map +0 -1
- package/dist/core/characterReference.js.map +0 -1
- package/dist/core/connectRequest.d.ts.map +0 -1
- package/dist/core/connectRequest.js.map +0 -1
- package/dist/core/contextUpdateRequest.d.ts.map +0 -1
- package/dist/core/contextUpdateRequest.js.map +0 -1
- package/dist/core/index.d.ts.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/logicalTurn.d.ts.map +0 -1
- package/dist/core/logicalTurn.js.map +0 -1
- package/dist/core/modelOutput.d.ts.map +0 -1
- package/dist/core/modelOutput.js.map +0 -1
- package/dist/core/publishedChat.d.ts.map +0 -1
- package/dist/core/publishedChat.js.map +0 -1
- package/dist/core/rosterRequest.d.ts.map +0 -1
- package/dist/core/rosterRequest.js.map +0 -1
- package/dist/core/types.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/core/videoSourceState.d.ts.map +0 -1
- package/dist/core/videoSourceState.js.map +0 -1
- package/dist/core/visionRequest.d.ts.map +0 -1
- package/dist/core/visionRequest.js.map +0 -1
- package/dist/embed/ConvaiChatElement.d.ts +0 -103
- package/dist/embed/ConvaiChatElement.d.ts.map +0 -1
- package/dist/embed/ConvaiChatElement.js +0 -679
- package/dist/embed/ConvaiChatElement.js.map +0 -1
- package/dist/embed/browser.d.ts +0 -3
- package/dist/embed/browser.d.ts.map +0 -1
- package/dist/embed/browser.js +0 -5
- package/dist/embed/browser.js.map +0 -1
- package/dist/embed/chat-embed-v1.js +0 -200
- package/dist/embed/chat-embed-v1.js.map +0 -7
- package/dist/embed/index.d.ts.map +0 -1
- package/dist/embed/index.js.map +0 -1
- package/dist/embed/publicationApi.d.ts.map +0 -1
- package/dist/embed/publicationApi.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lipsync-helpers/arkitOrder61.d.ts.map +0 -1
- package/dist/lipsync-helpers/arkitOrder61.js.map +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts.map +0 -1
- package/dist/lipsync-helpers/createBlendshapeQueue.js.map +0 -1
- package/dist/lipsync-helpers/declarativeMapping.d.ts.map +0 -1
- package/dist/lipsync-helpers/declarativeMapping.js.map +0 -1
- package/dist/lipsync-helpers/index.d.ts.map +0 -1
- package/dist/lipsync-helpers/index.js.map +0 -1
- package/dist/lipsync-helpers/mappingTypes.d.ts.map +0 -1
- package/dist/lipsync-helpers/mappingTypes.js.map +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.d.ts.map +0 -1
- package/dist/lipsync-helpers/metahumanOrder251.js.map +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.d.ts.map +0 -1
- package/dist/lipsync-helpers/mhaLimitDrivers.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/processor.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/processor.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.js.map +0 -1
- package/dist/lipsync-helpers/naturalness/types.d.ts.map +0 -1
- package/dist/lipsync-helpers/naturalness/types.js.map +0 -1
- package/dist/lipsync-helpers/presetMappers.d.ts.map +0 -1
- package/dist/lipsync-helpers/presetMappers.js.map +0 -1
- package/dist/react/components/ConvaiWidget.d.ts.map +0 -1
- package/dist/react/components/ConvaiWidget.js.map +0 -1
- package/dist/react/components/index.d.ts.map +0 -1
- package/dist/react/components/index.js.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/AudioVisualizer.js.map +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.js.map +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.js.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/MessageList.js.map +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/conviComponents/index.js.map +0 -1
- package/dist/react/components/rtc-widget/components/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/components/index.js.map +0 -1
- package/dist/react/components/rtc-widget/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/index.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/framerConfig.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/icons.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/icons.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/index.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/styledComponents.js.map +0 -1
- package/dist/react/components/rtc-widget/styles/theme.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/styles/theme.js.map +0 -1
- package/dist/react/components/rtc-widget/types/index.d.ts.map +0 -1
- package/dist/react/components/rtc-widget/types/index.js.map +0 -1
- package/dist/react/hooks/index.d.ts.map +0 -1
- package/dist/react/hooks/index.js.map +0 -1
- package/dist/react/hooks/useCharacterInfo.d.ts.map +0 -1
- package/dist/react/hooks/useCharacterInfo.js.map +0 -1
- package/dist/react/hooks/useConvaiClient.d.ts.map +0 -1
- package/dist/react/hooks/useConvaiClient.js.map +0 -1
- package/dist/react/hooks/useLocalCameraTrack.d.ts.map +0 -1
- package/dist/react/hooks/useLocalCameraTrack.js.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js.map +0 -1
- package/dist/utils/inlineMarkdown.d.ts.map +0 -1
- package/dist/utils/inlineMarkdown.js.map +0 -1
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js.map +0 -1
- package/dist/vanilla/AudioRenderer.d.ts.map +0 -1
- package/dist/vanilla/AudioRenderer.js.map +0 -1
- package/dist/vanilla/ConvaiWidget.d.ts.map +0 -1
- package/dist/vanilla/ConvaiWidget.js.map +0 -1
- package/dist/vanilla/WebSocketSession.d.ts.map +0 -1
- package/dist/vanilla/WebSocketSession.js.map +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.d.ts.map +0 -1
- package/dist/vanilla/WidgetEventSubscriptions.js.map +0 -1
- package/dist/vanilla/icons.d.ts.map +0 -1
- package/dist/vanilla/icons.js.map +0 -1
- package/dist/vanilla/index.d.ts.map +0 -1
- package/dist/vanilla/index.js.map +0 -1
- package/dist/vanilla/styles.d.ts.map +0 -1
- package/dist/vanilla/styles.js.map +0 -1
- package/dist/vanilla/types.d.ts.map +0 -1
- package/dist/vanilla/types.js.map +0 -1
- package/dist/vanilla/websocket.d.ts.map +0 -1
- package/dist/vanilla/websocket.js.map +0 -1
- package/dist/version.d.ts.map +0 -1
- 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
|
|
@@ -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 "
|
|
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
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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 {
|
|
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
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
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
|
-
|
|
89
|
-
|
|
30
|
+
const DocumentCard = ({ href }) => {
|
|
31
|
+
const ring = useFocusRing();
|
|
32
|
+
let host = "";
|
|
90
33
|
try {
|
|
91
|
-
|
|
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
|
-
|
|
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
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
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
|
|
109
|
-
React.
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
152
|
-
|
|
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
|
|
@@ -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
|
+
};
|
|
@@ -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 "
|
|
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
|
|
@@ -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,
|
|
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 "
|
|
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 "
|
|
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
|
|
@@ -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
|