@convai/web-sdk 1.9.1 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +25 -14
  2. package/dist/core/ConvaiClient.js +10 -1
  3. package/dist/core/types.d.ts +13 -3
  4. package/dist/core/websocketUrl.d.ts +11 -0
  5. package/dist/core/websocketUrl.js +17 -0
  6. package/dist/react/hooks/index.d.ts +0 -2
  7. package/dist/react/hooks/index.js +0 -3
  8. package/dist/react/index.d.ts +0 -3
  9. package/dist/react/index.js +3 -10
  10. package/dist/utils/inlineMarkdown.d.ts +7 -5
  11. package/dist/utils/inlineMarkdown.js +7 -5
  12. package/dist/vanilla/WebSocketSession.d.ts +19 -13
  13. package/dist/vanilla/WebSocketSession.js +58 -14
  14. package/dist/vanilla/index.d.ts +6 -18
  15. package/dist/vanilla/index.js +7 -19
  16. package/dist/version.d.ts +1 -1
  17. package/dist/version.js +1 -1
  18. package/package.json +9 -8
  19. package/dist/react/components/ConvaiWidget.d.ts +0 -86
  20. package/dist/react/components/ConvaiWidget.js +0 -610
  21. package/dist/react/components/index.d.ts +0 -1
  22. package/dist/react/components/index.js +0 -2
  23. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +0 -9
  24. package/dist/react/components/rtc-widget/components/AudioSettingsPanel.js +0 -315
  25. package/dist/react/components/rtc-widget/components/AudioVisualizer.d.ts +0 -35
  26. package/dist/react/components/rtc-widget/components/AudioVisualizer.js +0 -285
  27. package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +0 -12
  28. package/dist/react/components/rtc-widget/components/ConviMessage.js +0 -13
  29. package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts +0 -8
  30. package/dist/react/components/rtc-widget/components/FloatingVideo.js +0 -120
  31. package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +0 -31
  32. package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +0 -140
  33. package/dist/react/components/rtc-widget/components/MessageBubble.d.ts +0 -9
  34. package/dist/react/components/rtc-widget/components/MessageBubble.js +0 -22
  35. package/dist/react/components/rtc-widget/components/MessageList.d.ts +0 -13
  36. package/dist/react/components/rtc-widget/components/MessageList.js +0 -88
  37. package/dist/react/components/rtc-widget/components/SiteCard.d.ts +0 -14
  38. package/dist/react/components/rtc-widget/components/SiteCard.js +0 -34
  39. package/dist/react/components/rtc-widget/components/UserMessage.d.ts +0 -8
  40. package/dist/react/components/rtc-widget/components/UserMessage.js +0 -14
  41. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.d.ts +0 -5
  42. package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +0 -14
  43. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts +0 -24
  44. package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +0 -170
  45. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts +0 -16
  46. package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +0 -64
  47. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +0 -11
  48. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +0 -65
  49. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.d.ts +0 -13
  50. package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +0 -298
  51. package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +0 -5
  52. package/dist/react/components/rtc-widget/components/conviComponents/index.js +0 -5
  53. package/dist/react/components/rtc-widget/components/index.d.ts +0 -8
  54. package/dist/react/components/rtc-widget/components/index.js +0 -14
  55. package/dist/react/components/rtc-widget/index.d.ts +0 -5
  56. package/dist/react/components/rtc-widget/index.js +0 -8
  57. package/dist/react/components/rtc-widget/styles/framerConfig.d.ts +0 -115
  58. package/dist/react/components/rtc-widget/styles/framerConfig.js +0 -72
  59. package/dist/react/components/rtc-widget/styles/icons.d.ts +0 -27
  60. package/dist/react/components/rtc-widget/styles/icons.js +0 -256
  61. package/dist/react/components/rtc-widget/styles/index.d.ts +0 -5
  62. package/dist/react/components/rtc-widget/styles/index.js +0 -8
  63. package/dist/react/components/rtc-widget/styles/styledComponents.d.ts +0 -89
  64. package/dist/react/components/rtc-widget/styles/styledComponents.js +0 -662
  65. package/dist/react/components/rtc-widget/styles/theme.d.ts +0 -187
  66. package/dist/react/components/rtc-widget/styles/theme.js +0 -289
  67. package/dist/react/components/rtc-widget/types/index.d.ts +0 -59
  68. package/dist/react/components/rtc-widget/types/index.js +0 -1
  69. package/dist/react/hooks/useCharacterInfo.d.ts +0 -18
  70. package/dist/react/hooks/useCharacterInfo.js +0 -65
  71. package/dist/react/hooks/useLocalCameraTrack.d.ts +0 -21
  72. package/dist/react/hooks/useLocalCameraTrack.js +0 -33
  73. package/dist/react/icons.d.ts +0 -37
  74. package/dist/react/icons.js +0 -53
  75. package/dist/utils/lightbox.d.ts +0 -15
  76. package/dist/utils/lightbox.js +0 -94
  77. package/dist/vanilla/ConvaiWidget.d.ts +0 -46
  78. package/dist/vanilla/ConvaiWidget.js +0 -2866
  79. package/dist/vanilla/WidgetEventSubscriptions.d.ts +0 -14
  80. package/dist/vanilla/WidgetEventSubscriptions.js +0 -36
  81. package/dist/vanilla/icons.d.ts +0 -34
  82. package/dist/vanilla/icons.js +0 -268
  83. package/dist/vanilla/styles.d.ts +0 -168
  84. package/dist/vanilla/styles.js +0 -407
  85. package/dist/vanilla/types.d.ts +0 -170
  86. package/dist/vanilla/types.js +0 -1
@@ -1,86 +0,0 @@
1
- import type { LinkPreviewResolver } from "../../utils/linkPreview.js";
2
- import type { IConvaiClient, PublishedChatConnectOptions } from "../../core/types.js";
3
- import type { PublishedChatDescriptor } from "../../embed/publicationApi.js";
4
- interface ConvaiWidgetProps {
5
- /** Convai client instance (required) */
6
- convaiClient: IConvaiClient & {
7
- activity?: string;
8
- isAudioMuted: boolean;
9
- isVideoEnabled: boolean;
10
- isScreenShareActive: boolean;
11
- };
12
- /**
13
- * Show video toggle button in settings (default: true).
14
- * Only works if connection type is "video". If false, hides the video button.
15
- */
16
- showVideo?: boolean;
17
- /**
18
- * Show screen share toggle button in settings (default: true).
19
- * Only works if connection type is "video". If false, hides the screen share button.
20
- */
21
- showScreenShare?: boolean;
22
- /**
23
- * Start in voice mode by default when widget opens (default: true).
24
- * When true, the widget will open directly in voice mode with microphone enabled.
25
- */
26
- defaultVoiceMode?: boolean;
27
- /**
28
- * Mint a fresh single-use grant when a published-chat session is reopened.
29
- * Required when using this widget with connectWithPublicationGrant().
30
- */
31
- requestPublicationGrant?: () => Promise<string>;
32
- /** Core endpoint override used with requestPublicationGrant. */
33
- publishedChatConnectOptions?: PublishedChatConnectOptions;
34
- /**
35
- * Open Graph lookup for plain web links the character sends. Supply a
36
- * function that asks your backend for a page's metadata and each such link
37
- * gets a site card (favicon, site name, title, description, image) once it
38
- * resolves. Omit it and links render as before. See
39
- * docs/convai_link_previews.md, "Site cards".
40
- */
41
- linkPreviewResolver?: LinkPreviewResolver;
42
- /** Public descriptor used to label a credential-free published session. */
43
- publishedChatDescriptor?: Pick<PublishedChatDescriptor, "display_name" | "image_url">;
44
- }
45
- /**
46
- * ConvaiWidget - A consolidated chat widget component for real-time conversations
47
- *
48
- * This component provides a complete UI for interacting with Convai characters.
49
- * Connection configuration should be handled via useConvaiClient.connect().
50
- *
51
- * Features:
52
- * - Collapsed circular button with status indicator
53
- * - Expandable/collapsible chat interface
54
- * - Voice mode support
55
- * - Real-time message streaming
56
- * - Audio controls (mute/unmute)
57
- * - Settings tray with session reset
58
- * - Optional video and screen share (when connection type supports it)
59
- *
60
- * @param {ConvaiWidgetProps} props - Component props
61
- * @param {ConvaiClient} props.convaiClient - Convai client instance (required)
62
- * @param {boolean} props.showVideo - Show video toggle in settings (default: true)
63
- * @param {boolean} props.showScreenShare - Show screen share toggle in settings (default: true)
64
- * @param {boolean} props.defaultVoiceMode - Start in voice mode when widget opens (default: true)
65
- *
66
- * @example
67
- * ```tsx
68
- * function App() {
69
- * const convaiClient = useConvaiClient({
70
- * apiKey: 'your-api-key',
71
- * characterId: 'your-character-id',
72
- * enableVideo: true,
73
- * });
74
- *
75
- * return (
76
- * <ConvaiWidget
77
- * convaiClient={convaiClient}
78
- * showVideo={true}
79
- * showScreenShare={true}
80
- * />
81
- * );
82
- * }
83
- * ```
84
- */
85
- export declare const ConvaiWidget: React.FC<ConvaiWidgetProps>;
86
- export {};