@elevenlabs/convai-widget-core 0.6.0-beta.5 → 0.6.0-beta.8
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/LICENSE +21 -0
- package/dist/components/Icon.d.ts +2 -0
- package/dist/contexts/{mic-config.d.ts → audio-config.d.ts} +4 -4
- package/dist/contexts/conversation-mode.d.ts +15 -0
- package/dist/contexts/conversation.d.ts +11 -0
- package/dist/contexts/shadow-host.d.ts +8 -0
- package/dist/contexts/widget-config.d.ts +11 -0
- package/dist/index.js +8357 -8735
- package/dist/markdown/index.d.ts +3 -1
- package/dist/markdown/utils/allowedDomainsToLinkPrefixes.d.ts +2 -0
- package/dist/markdown/utils/allowedDomainsToLinkPrefixes.test.d.ts +1 -0
- package/dist/mocks/browser.d.ts +234 -0
- package/dist/mocks/web-component.d.ts +1 -1
- package/dist/types/attributes.d.ts +1 -1
- package/dist/types/config.d.ts +15 -0
- package/dist/types/languages.d.ts +195 -0
- package/dist/version.d.ts +1 -1
- package/dist/widget/ConversationModeToggleButton.d.ts +2 -0
- package/dist/widget/SheetHeader.d.ts +2 -1
- package/package.json +20 -20
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ElevenLabs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -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
|
|
3
|
+
interface AudioConfig {
|
|
4
4
|
isMutingEnabled: ReadonlySignal<boolean>;
|
|
5
5
|
isMuted: ReadonlySignal<boolean>;
|
|
6
6
|
setIsMuted: (value: boolean) => void;
|
|
7
7
|
}
|
|
8
|
-
interface
|
|
8
|
+
interface AudioConfigProviderProps {
|
|
9
9
|
children: ComponentChildren;
|
|
10
10
|
}
|
|
11
|
-
export declare function
|
|
12
|
-
export declare function
|
|
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 {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentChildren } from "preact";
|
|
2
|
+
import { Signal } from "@preact/signals";
|
|
3
|
+
interface ShadowHostProviderProps {
|
|
4
|
+
children: ComponentChildren;
|
|
5
|
+
}
|
|
6
|
+
export declare function ShadowHostProvider({ children }: ShadowHostProviderProps): import("preact").JSX.Element;
|
|
7
|
+
export declare function useShadowHost(): Signal<HTMLElement | null>;
|
|
8
|
+
export {};
|
|
@@ -10,7 +10,18 @@ export declare function useTextOnly(): ReadonlySignal<boolean>;
|
|
|
10
10
|
export declare function useIsConversationTextOnly(): ReadonlySignal<boolean>;
|
|
11
11
|
export declare function useFirstMessage(): ReadonlySignal<string | null>;
|
|
12
12
|
export declare function useTextInputEnabled(): ReadonlySignal<boolean>;
|
|
13
|
+
export declare function useLocalizedTerms(): ReadonlySignal<{
|
|
14
|
+
terms_html: string | undefined;
|
|
15
|
+
terms_text: string | undefined;
|
|
16
|
+
terms_key: string | undefined;
|
|
17
|
+
}>;
|
|
13
18
|
export declare function useWebRTC(): ReadonlySignal<boolean>;
|
|
14
19
|
export declare function useEndFeedbackType(): ReadonlySignal<"rating" | null>;
|
|
20
|
+
export interface MarkdownLinkConfig {
|
|
21
|
+
allowedHosts: string[];
|
|
22
|
+
includeWww: boolean;
|
|
23
|
+
allowHttp: boolean;
|
|
24
|
+
}
|
|
25
|
+
export declare function useMarkdownLinkConfig(): ReadonlySignal<MarkdownLinkConfig>;
|
|
15
26
|
export declare function useSyntaxTheme(): ReadonlySignal<SyntaxHighlightTheme>;
|
|
16
27
|
export {};
|