@elevenlabs/convai-widget-core 0.11.6 → 0.12.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.
@@ -43,6 +43,10 @@ export declare const AGENTS: {
43
43
  readonly conversation_mode_toggle_enabled?: boolean;
44
44
  readonly show_agent_status?: boolean;
45
45
  readonly show_conversation_id?: boolean;
46
+ readonly file_input_config?: {
47
+ enabled?: boolean;
48
+ max_files_per_conversation?: number;
49
+ };
46
50
  };
47
51
  readonly webrtc: {
48
52
  readonly use_rtc: true;
@@ -86,6 +90,10 @@ export declare const AGENTS: {
86
90
  readonly conversation_mode_toggle_enabled?: boolean;
87
91
  readonly show_agent_status?: boolean;
88
92
  readonly show_conversation_id?: boolean;
93
+ readonly file_input_config?: {
94
+ enabled?: boolean;
95
+ max_files_per_conversation?: number;
96
+ };
89
97
  };
90
98
  readonly fail: WidgetConfig;
91
99
  readonly end_call_test: {
@@ -130,6 +138,10 @@ export declare const AGENTS: {
130
138
  readonly conversation_mode_toggle_enabled?: boolean;
131
139
  readonly show_agent_status?: boolean;
132
140
  readonly show_conversation_id?: boolean;
141
+ readonly file_input_config?: {
142
+ enabled?: boolean;
143
+ max_files_per_conversation?: number;
144
+ };
133
145
  };
134
146
  readonly localized: {
135
147
  readonly terms_html: "<p>Default Terms in English</p>";
@@ -184,6 +196,10 @@ export declare const AGENTS: {
184
196
  readonly conversation_mode_toggle_enabled?: boolean;
185
197
  readonly show_agent_status?: boolean;
186
198
  readonly show_conversation_id?: boolean;
199
+ readonly file_input_config?: {
200
+ enabled?: boolean;
201
+ max_files_per_conversation?: number;
202
+ };
187
203
  };
188
204
  readonly markdown: {
189
205
  readonly text_only: true;
@@ -229,6 +245,10 @@ export declare const AGENTS: {
229
245
  readonly conversation_mode_toggle_enabled?: boolean;
230
246
  readonly show_agent_status?: boolean;
231
247
  readonly show_conversation_id?: boolean;
248
+ readonly file_input_config?: {
249
+ enabled?: boolean;
250
+ max_files_per_conversation?: number;
251
+ };
232
252
  };
233
253
  readonly markdown_no_links: {
234
254
  readonly text_only: true;
@@ -272,6 +292,10 @@ export declare const AGENTS: {
272
292
  readonly conversation_mode_toggle_enabled?: boolean;
273
293
  readonly show_agent_status?: boolean;
274
294
  readonly show_conversation_id?: boolean;
295
+ readonly file_input_config?: {
296
+ enabled?: boolean;
297
+ max_files_per_conversation?: number;
298
+ };
275
299
  };
276
300
  readonly markdown_domain_allowlist: {
277
301
  readonly text_only: true;
@@ -317,6 +341,10 @@ export declare const AGENTS: {
317
341
  readonly conversation_mode_toggle_enabled?: boolean;
318
342
  readonly show_agent_status?: boolean;
319
343
  readonly show_conversation_id?: boolean;
344
+ readonly file_input_config?: {
345
+ enabled?: boolean;
346
+ max_files_per_conversation?: number;
347
+ };
320
348
  };
321
349
  readonly markdown_default_domain: {
322
350
  readonly text_only: true;
@@ -360,6 +388,10 @@ export declare const AGENTS: {
360
388
  readonly conversation_mode_toggle_enabled?: boolean;
361
389
  readonly show_agent_status?: boolean;
362
390
  readonly show_conversation_id?: boolean;
391
+ readonly file_input_config?: {
392
+ enabled?: boolean;
393
+ max_files_per_conversation?: number;
394
+ };
363
395
  };
364
396
  readonly tool_call: {
365
397
  readonly text_only: true;
@@ -403,6 +435,10 @@ export declare const AGENTS: {
403
435
  readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
404
436
  readonly conversation_mode_toggle_enabled?: boolean;
405
437
  readonly show_conversation_id?: boolean;
438
+ readonly file_input_config?: {
439
+ enabled?: boolean;
440
+ max_files_per_conversation?: number;
441
+ };
406
442
  };
407
443
  readonly audio_tags_strip: {
408
444
  readonly text_only: true;
@@ -446,6 +482,10 @@ export declare const AGENTS: {
446
482
  readonly conversation_mode_toggle_enabled?: boolean;
447
483
  readonly show_agent_status?: boolean;
448
484
  readonly show_conversation_id?: boolean;
485
+ readonly file_input_config?: {
486
+ enabled?: boolean;
487
+ max_files_per_conversation?: number;
488
+ };
449
489
  };
450
490
  readonly audio_tags_no_strip: {
451
491
  readonly text_only: true;
@@ -489,6 +529,103 @@ export declare const AGENTS: {
489
529
  readonly conversation_mode_toggle_enabled?: boolean;
490
530
  readonly show_agent_status?: boolean;
491
531
  readonly show_conversation_id?: boolean;
532
+ readonly file_input_config?: {
533
+ enabled?: boolean;
534
+ max_files_per_conversation?: number;
535
+ };
536
+ };
537
+ readonly file_upload: {
538
+ readonly text_only: true;
539
+ readonly transcript_enabled: true;
540
+ readonly text_input_enabled: true;
541
+ readonly file_input_config: {
542
+ readonly enabled: true;
543
+ readonly max_files_per_conversation: 2;
544
+ };
545
+ readonly terms_html: undefined;
546
+ readonly default_expanded: true;
547
+ readonly first_message: "";
548
+ readonly variant: import("../types/config").Variant;
549
+ readonly placement: import("../types/config").Placement;
550
+ readonly markdown_link_allowed_hosts?: import("../types/config").AllowlistItem[];
551
+ readonly markdown_link_include_www?: boolean;
552
+ readonly markdown_link_allow_http?: boolean;
553
+ readonly avatar: import("../types/config").AvatarConfig;
554
+ readonly feedback_mode: import("../types/config").FeedbackMode;
555
+ readonly end_feedback?: {
556
+ type: import("../types/config").FeedbackType;
557
+ } | null;
558
+ readonly language: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage;
559
+ readonly supported_language_overrides?: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage[];
560
+ readonly terms_text?: string;
561
+ readonly terms_key?: string;
562
+ readonly mic_muting_enabled: boolean;
563
+ readonly always_expanded: boolean;
564
+ readonly dismissible: boolean;
565
+ readonly strip_audio_tags?: boolean;
566
+ readonly text_contents: Partial<import("../types/config").TextContents>;
567
+ readonly styles?: Partial<import("../types/config").Styles>;
568
+ readonly language_presets: Partial<Record<import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage, {
569
+ text_contents?: Partial<import("../types/config").TextContents>;
570
+ first_message?: string;
571
+ terms_html?: string;
572
+ terms_text?: string;
573
+ terms_key?: string;
574
+ }>>;
575
+ readonly disable_banner: boolean;
576
+ readonly override_link?: string;
577
+ readonly supports_text_only: boolean;
578
+ readonly use_rtc?: boolean;
579
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
580
+ readonly conversation_mode_toggle_enabled?: boolean;
581
+ readonly show_agent_status?: boolean;
582
+ readonly show_conversation_id?: boolean;
583
+ };
584
+ readonly no_file_upload: {
585
+ readonly text_only: true;
586
+ readonly transcript_enabled: true;
587
+ readonly text_input_enabled: true;
588
+ readonly file_input_config: {
589
+ readonly enabled: false;
590
+ };
591
+ readonly terms_html: undefined;
592
+ readonly default_expanded: true;
593
+ readonly first_message: "";
594
+ readonly variant: import("../types/config").Variant;
595
+ readonly placement: import("../types/config").Placement;
596
+ readonly markdown_link_allowed_hosts?: import("../types/config").AllowlistItem[];
597
+ readonly markdown_link_include_www?: boolean;
598
+ readonly markdown_link_allow_http?: boolean;
599
+ readonly avatar: import("../types/config").AvatarConfig;
600
+ readonly feedback_mode: import("../types/config").FeedbackMode;
601
+ readonly end_feedback?: {
602
+ type: import("../types/config").FeedbackType;
603
+ } | null;
604
+ readonly language: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage;
605
+ readonly supported_language_overrides?: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage[];
606
+ readonly terms_text?: string;
607
+ readonly terms_key?: string;
608
+ readonly mic_muting_enabled: boolean;
609
+ readonly always_expanded: boolean;
610
+ readonly dismissible: boolean;
611
+ readonly strip_audio_tags?: boolean;
612
+ readonly text_contents: Partial<import("../types/config").TextContents>;
613
+ readonly styles?: Partial<import("../types/config").Styles>;
614
+ readonly language_presets: Partial<Record<import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage, {
615
+ text_contents?: Partial<import("../types/config").TextContents>;
616
+ first_message?: string;
617
+ terms_html?: string;
618
+ terms_text?: string;
619
+ terms_key?: string;
620
+ }>>;
621
+ readonly disable_banner: boolean;
622
+ readonly override_link?: string;
623
+ readonly supports_text_only: boolean;
624
+ readonly use_rtc?: boolean;
625
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
626
+ readonly conversation_mode_toggle_enabled?: boolean;
627
+ readonly show_agent_status?: boolean;
628
+ readonly show_conversation_id?: boolean;
492
629
  };
493
630
  };
494
631
  export declare const Worker: import("msw/browser").SetupWorker;
@@ -1,5 +1,5 @@
1
1
  export declare function parseBoolAttribute(value: string | undefined): boolean | null;
2
- export declare const CustomAttributeList: readonly ["variant", "placement", "override-config", "avatar-image-url", "avatar-orb-color-1", "avatar-orb-color-2", "agent-id", "signed-url", "terms-key", "server-location", "language", "dynamic-variables", "show-avatar-when-collapsed", "override-prompt", "override-llm", "override-speed", "override-stability", "override-similarity-boost", "override-first-message", "override-language", "override-voice-id", "override-text-only", "mic-muting", "transcript", "text-input", "text-contents", "default-expanded", "always-expanded", "dismissible", "strip-audio-tags", "user-id", "use-rtc", "collect-feedback", "worklet-path-raw-audio-processor", "worklet-path-audio-concat-processor", "worklet-path-libsamplerate", "syntax-highlight-theme", "markdown-link-allowed-hosts", "markdown-link-include-www", "markdown-link-allow-http", "show-agent-status", "show-conversation-id", "environment"];
2
+ export declare const CustomAttributeList: readonly ["variant", "placement", "override-config", "avatar-image-url", "avatar-orb-color-1", "avatar-orb-color-2", "agent-id", "signed-url", "terms-key", "server-location", "language", "dynamic-variables", "show-avatar-when-collapsed", "override-prompt", "override-llm", "override-speed", "override-stability", "override-similarity-boost", "override-first-message", "override-language", "override-voice-id", "override-text-only", "mic-muting", "transcript", "text-input", "text-contents", "default-expanded", "always-expanded", "dismissible", "strip-audio-tags", "user-id", "use-rtc", "collect-feedback", "worklet-path-raw-audio-processor", "worklet-path-audio-concat-processor", "worklet-path-libsamplerate", "syntax-highlight-theme", "markdown-link-allowed-hosts", "markdown-link-include-www", "markdown-link-allow-http", "allow-events", "show-agent-status", "show-conversation-id", "environment"];
3
3
  export type CustomAttributes = {
4
4
  [key in (typeof CustomAttributeList)[number]]?: string;
5
5
  };
@@ -53,6 +53,10 @@ export interface WidgetConfig {
53
53
  conversation_mode_toggle_enabled?: boolean;
54
54
  show_agent_status?: boolean;
55
55
  show_conversation_id?: boolean;
56
+ file_input_config?: {
57
+ enabled?: boolean;
58
+ max_files_per_conversation?: number;
59
+ };
56
60
  }
57
61
  export type AvatarConfig = {
58
62
  type: "orb";
@@ -109,6 +113,12 @@ export declare const DefaultTextContents: {
109
113
  agent_working: string;
110
114
  agent_done: string;
111
115
  agent_error: string;
116
+ attach_file: string;
117
+ remove_file: string;
118
+ file_upload_error: string;
119
+ file_type_unsupported: string;
120
+ file_too_large: string;
121
+ file_limit_reached: string;
112
122
  };
113
123
  export declare const TextKeys: (keyof typeof DefaultTextContents)[];
114
124
  export type TextContents = typeof DefaultTextContents;
@@ -1,5 +1,5 @@
1
1
  import type { Role } from "@elevenlabs/client";
2
- import type { TranscriptEntry } from "../contexts/conversation";
2
+ import type { TranscriptEntry, TranscriptFileInput } from "../contexts/conversation";
3
3
  import type { ConversationMode } from "../contexts/conversation-mode";
4
4
  export declare const ToolCallStatus: {
5
5
  readonly LOADING: "loading";
@@ -15,6 +15,7 @@ export type DisplayTranscriptEntry = {
15
15
  conversationIndex: number;
16
16
  eventId?: number;
17
17
  toolStatus?: ToolCallStatusType;
18
+ fileInput?: TranscriptFileInput | null;
18
19
  } | {
19
20
  type: "disconnection";
20
21
  role: Role;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.11.6";
1
+ export declare const PACKAGE_VERSION = "0.12.0";
@@ -0,0 +1 @@
1
+ export declare const EventBridge: import("preact").FunctionComponent<{}>;
@@ -0,0 +1,7 @@
1
+ import { type PendingFile } from "./useFileUpload";
2
+ interface PendingFilePreviewProps {
3
+ pendingFile: PendingFile;
4
+ onRemove: () => void;
5
+ }
6
+ export declare function PendingFilePreview({ pendingFile, onRemove, }: PendingFilePreviewProps): import("preact").JSX.Element;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { BaseButtonProps } from "../components/Button";
2
+ interface UploadFileButtonProps extends BaseButtonProps {
3
+ iconOnly?: boolean;
4
+ disabled?: boolean;
5
+ onFileSelect: (file: File) => void;
6
+ }
7
+ export declare function UploadFileButton({ iconOnly, disabled, onFileSelect, children, ...props }: UploadFileButtonProps): import("preact").JSX.Element;
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { ReadonlySignal } from "@preact/signals";
2
+ export declare const ACCEPTED_FILE_EXTENSIONS: readonly [".png", ".jpg", ".jpeg", ".gif", ".webp", ".pdf"];
3
+ export declare function isImageMimeType(mimeType: string): boolean;
4
+ export type PendingFile = {
5
+ status: "uploading";
6
+ file: File;
7
+ previewUrl: string | null;
8
+ } | {
9
+ status: "ready";
10
+ file: File;
11
+ fileId: string;
12
+ previewUrl: string | null;
13
+ } | {
14
+ status: "error";
15
+ file: File;
16
+ error: string;
17
+ previewUrl: string | null;
18
+ };
19
+ export type AddFileError = "unsupported_type" | "too_large" | "limit_reached";
20
+ interface UseFileUploadOptions {
21
+ conversationId: string | null;
22
+ maxFiles: number | null;
23
+ }
24
+ export declare function useFileUpload({ conversationId, maxFiles, }: UseFileUploadOptions): {
25
+ pendingFile: ReadonlySignal<PendingFile | null>;
26
+ isUploading: ReadonlySignal<boolean>;
27
+ hasReachedLimit: ReadonlySignal<boolean>;
28
+ addFile: (file: File) => AddFileError | null;
29
+ removeFile: () => void;
30
+ markFileAsSent: () => void;
31
+ };
32
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/convai-widget-core",
3
- "version": "0.11.6",
3
+ "version": "0.12.0",
4
4
  "description": "The common library for the Conversational AI Widget.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -16,22 +16,24 @@
16
16
  "@preact/preset-vite": "^2.10.1",
17
17
  "@radix-ui/react-select": "^2.2.2",
18
18
  "@radix-ui/react-slot": "^1.2.0",
19
+ "@tailwindcss/vite": "^4.1.18",
19
20
  "@types/hast": "^3.0.4",
20
21
  "@types/preact-custom-element": "^4.0.4",
21
- "@vitest/browser": "^3.1.2",
22
- "eslint": "^9.8.0",
22
+ "@vitest/browser": "^4.1.5",
23
+ "@vitest/browser-playwright": "^4.1.5",
24
+ "eslint": "^10.2.1",
23
25
  "msw": "^2.7.5",
24
26
  "playwright": "^1.46.1",
25
- "@tailwindcss/vite": "^4.1.18",
26
27
  "tailwindcss": "^4.1.18",
27
28
  "typescript": "^5.5.4",
28
29
  "unified": "^11.0.5",
29
- "vite": "^7.3.1",
30
- "vite-bundle-analyzer": "^1.3.2",
31
- "vitest": "^3.1.2"
30
+ "vite": "^8.0.10",
31
+ "vite-bundle-analyzer": "^1.3.8",
32
+ "vitest": "^4.1.5"
32
33
  },
33
34
  "dependencies": {
34
35
  "@ctrl/tinycolor": "^4.2.0",
36
+ "@fingerprintjs/fingerprintjs": "^5.1.0",
35
37
  "@lezer/common": "^1.3.0",
36
38
  "@lezer/highlight": "^1.2.3",
37
39
  "@lezer/html": "^1.3.12",
@@ -42,14 +44,14 @@
42
44
  "@lezer/python": "^1.1.18",
43
45
  "@lezer/xml": "^1.0.6",
44
46
  "@lezer/yaml": "^1.0.3",
45
- "@preact/signals": "^2.0.4",
47
+ "@preact/signals": "^2.9.0",
46
48
  "clsx": "^2.1.1",
47
49
  "hast-util-from-lezer": "^0.5.4",
48
50
  "hast-util-to-jsx-runtime": "^2.3.6",
49
51
  "marked": "^17.0.0",
50
52
  "preact": "^10.26.5",
51
53
  "preact-custom-element": "^4.3.0",
52
- "rehype-harden": "^1.1.7",
54
+ "rehype-harden": "^1.1.8",
53
55
  "rehype-raw": "^7.0.0",
54
56
  "rehype-sanitize": "^6.0.0",
55
57
  "remark-cjk-friendly": "^1.2.3",
@@ -58,7 +60,7 @@
58
60
  "remark-parse": "^11.0.0",
59
61
  "remark-rehype": "^11.1.2",
60
62
  "tailwind-merge": "^3.4.0",
61
- "@elevenlabs/client": "1.3.1"
63
+ "@elevenlabs/client": "1.5.0"
62
64
  },
63
65
  "publishConfig": {
64
66
  "access": "public"