@elevenlabs/convai-widget-core 0.6.0-beta.5 → 0.6.0-beta.6

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.
@@ -5,6 +5,7 @@ declare const ICON_MAP: {
5
5
  chat: typeof ChatIcon;
6
6
  mic: typeof MicIcon;
7
7
  "mic-off": typeof MicOffIcon;
8
+ soundwave: typeof SoundwaveIcon;
8
9
  check: typeof CheckIcon;
9
10
  "chevron-down": typeof ChevronDownIcon;
10
11
  "chevron-up": typeof ChevronUpIcon;
@@ -34,6 +35,7 @@ declare function PhoneSlashIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.E
34
35
  declare function ChatIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
35
36
  declare function MicIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
36
37
  declare function MicOffIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
38
+ declare function SoundwaveIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
37
39
  declare function ChevronDownIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
38
40
  declare function ChevronUpIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
39
41
  declare function CheckIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import { ReadonlySignal } from "@preact/signals";
2
2
  import { ComponentChildren } from "preact";
3
- interface MicConfig {
3
+ interface AudioConfig {
4
4
  isMutingEnabled: ReadonlySignal<boolean>;
5
5
  isMuted: ReadonlySignal<boolean>;
6
6
  setIsMuted: (value: boolean) => void;
7
7
  }
8
- interface MicConfigProviderProps {
8
+ interface AudioConfigProviderProps {
9
9
  children: ComponentChildren;
10
10
  }
11
- export declare function MicConfigProvider({ children }: MicConfigProviderProps): import("preact").JSX.Element;
12
- export declare function useMicConfig(): MicConfig;
11
+ export declare function AudioConfigProvider({ children }: AudioConfigProviderProps): import("preact").JSX.Element;
12
+ export declare function useAudioConfig(): AudioConfig;
13
13
  export {};
@@ -0,0 +1,15 @@
1
+ import { ReadonlySignal } from "@preact/signals";
2
+ import { ComponentChildren } from "preact";
3
+ export type ConversationMode = "text" | "voice";
4
+ interface ConversationModeConfig {
5
+ mode: ReadonlySignal<ConversationMode>;
6
+ setMode: (value: ConversationMode) => void;
7
+ isTextMode: ReadonlySignal<boolean>;
8
+ isVoiceMode: ReadonlySignal<boolean>;
9
+ }
10
+ interface ConversationModeProviderProps {
11
+ children: ComponentChildren;
12
+ }
13
+ export declare function ConversationModeProvider({ children, }: ConversationModeProviderProps): import("preact").JSX.Element;
14
+ export declare function useConversationMode(): ConversationModeConfig;
15
+ export {};
@@ -1,5 +1,6 @@
1
1
  import { Mode, Role, Status } from "@elevenlabs/client";
2
2
  import { ComponentChildren } from "preact";
3
+ import { ConversationMode } from "./conversation-mode";
3
4
  export declare const ConversationContext: import("preact").Context<{
4
5
  status: import("@preact/signals").Signal<Status>;
5
6
  isSpeaking: import("@preact/signals").ReadonlySignal<boolean>;
@@ -15,9 +16,12 @@ export declare const ConversationContext: import("preact").Context<{
15
16
  endSession: () => Promise<void>;
16
17
  getInputVolume: () => number;
17
18
  getOutputVolume: () => number;
19
+ setVolume: (volume: number) => void;
20
+ setMicMuted: (muted: boolean) => void;
18
21
  sendFeedback: (like: boolean) => void;
19
22
  sendUserMessage: (text: string) => void;
20
23
  sendUserActivity: () => void;
24
+ addModeToggleEntry: (mode: ConversationMode) => void;
21
25
  } | null>;
22
26
  interface ConversationProviderProps {
23
27
  children: ComponentChildren;
@@ -37,6 +41,10 @@ export type TranscriptEntry = {
37
41
  type: "error";
38
42
  message: string;
39
43
  conversationIndex: number;
44
+ } | {
45
+ type: "mode_toggle";
46
+ mode: ConversationMode;
47
+ conversationIndex: number;
40
48
  };
41
49
  export declare function ConversationProvider({ children }: ConversationProviderProps): import("preact").JSX.Element;
42
50
  export declare function useConversation(): {
@@ -54,8 +62,11 @@ export declare function useConversation(): {
54
62
  endSession: () => Promise<void>;
55
63
  getInputVolume: () => number;
56
64
  getOutputVolume: () => number;
65
+ setVolume: (volume: number) => void;
66
+ setMicMuted: (muted: boolean) => void;
57
67
  sendFeedback: (like: boolean) => void;
58
68
  sendUserMessage: (text: string) => void;
59
69
  sendUserActivity: () => void;
70
+ addModeToggleEntry: (mode: ConversationMode) => void;
60
71
  };
61
72
  export {};