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

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.
@@ -1,5 +1,5 @@
1
1
  import type { DetailedHTMLProps, ImgHTMLAttributes } from "react";
2
- import type { ExtraProps } from "react-markdown";
2
+ import type { ExtraProps } from "../utils/markdown";
3
3
  type ImageComponentProps = DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> & ExtraProps;
4
4
  export declare const ImageComponent: ({ node, className, src, alt, ...props }: ImageComponentProps) => import("preact").JSX.Element | null;
5
5
  export {};
@@ -1,2 +1,2 @@
1
- import type { Options } from "react-markdown";
2
- export declare const components: Options["components"];
1
+ import type { Components } from "../utils/markdown";
2
+ export declare const components: Components;
@@ -1,6 +1,5 @@
1
- import { type Options } from "react-markdown";
2
- export { defaultUrlTransform } from "react-markdown";
3
- export type StreamdownProps = Options & {
1
+ export type StreamdownProps = {
2
+ children?: string;
4
3
  parseIncompleteMarkdown?: boolean;
5
4
  className?: string;
6
5
  isAnimating?: boolean;
@@ -9,4 +8,4 @@ export type StreamdownRuntimeContextType = {
9
8
  isAnimating: boolean;
10
9
  };
11
10
  export declare const StreamdownRuntimeContext: import("preact").Context<StreamdownRuntimeContextType>;
12
- export declare const WidgetStreamdown: ({ children, parseIncompleteMarkdown: shouldParseIncompleteMarkdown, components, className, isAnimating, urlTransform, ...props }: StreamdownProps) => import("preact").JSX.Element;
11
+ export declare const WidgetStreamdown: ({ children, parseIncompleteMarkdown: shouldParseIncompleteMarkdown, className, isAnimating, }: StreamdownProps) => import("preact").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import type { Element } from "hast";
2
+ import type { ComponentType, JSX, ReactElement } from "preact/compat";
3
+ import type { Options as RemarkRehypeOptions } from "remark-rehype";
4
+ import type { PluggableList } from "unified";
5
+ export type ExtraProps = {
6
+ node?: Element | undefined;
7
+ };
8
+ export type Components = {
9
+ [Key in keyof JSX.IntrinsicElements]?: ComponentType<JSX.IntrinsicElements[Key] & ExtraProps> | keyof JSX.IntrinsicElements;
10
+ };
11
+ export type Options = {
12
+ children?: string;
13
+ components?: Components;
14
+ rehypePlugins?: PluggableList;
15
+ remarkPlugins?: PluggableList;
16
+ remarkRehypeOptions?: Readonly<RemarkRehypeOptions>;
17
+ };
18
+ export declare const Markdown: (options: Readonly<Options>) => ReactElement<{}>;
@@ -30,6 +30,7 @@ export declare const AGENTS: {
30
30
  readonly supports_text_only: boolean;
31
31
  readonly first_message?: string;
32
32
  readonly use_rtc?: boolean;
33
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
33
34
  };
34
35
  readonly webrtc: {
35
36
  readonly use_rtc: true;
@@ -60,7 +61,39 @@ export declare const AGENTS: {
60
61
  readonly text_only: boolean;
61
62
  readonly supports_text_only: boolean;
62
63
  readonly first_message?: string;
64
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
63
65
  };
64
66
  readonly fail: WidgetConfig;
67
+ readonly markdown: {
68
+ readonly text_only: true;
69
+ readonly terms_html: undefined;
70
+ readonly default_expanded: true;
71
+ readonly first_message: "# Heading 1\n\nThis is **bold** and *italic* text.\n\n- List item 1\n- List item 2\n\n1. Ordered item 1\n2. Ordered item 2\n\n`inline code`\n\n```javascript\nconst codeBlock = true;\n```\n\n[Link text](https://example.com)\n\n![Alt text](data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=)\n\n> Blockquote text\n\n| Header 1 | Header 2 |\n| -------- | -------- |\n| Cell 1 | Cell 2 |\n\n---\n";
72
+ readonly variant: import("../types/config").Variant;
73
+ readonly placement: import("../types/config").Placement;
74
+ readonly avatar: import("../types/config").AvatarConfig;
75
+ readonly feedback_mode: import("../types/config").FeedbackMode;
76
+ readonly end_feedback?: {
77
+ type: import("../types/config").FeedbackType;
78
+ } | null;
79
+ readonly language: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage;
80
+ readonly supported_language_overrides?: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage[];
81
+ readonly terms_key?: string;
82
+ readonly mic_muting_enabled: boolean;
83
+ readonly transcript_enabled: boolean;
84
+ readonly text_input_enabled: boolean;
85
+ readonly always_expanded: boolean;
86
+ readonly text_contents: Partial<import("../types/config").TextContents>;
87
+ readonly styles?: Partial<import("../types/config").Styles>;
88
+ readonly language_presets: Partial<Record<import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage, {
89
+ text_contents?: Partial<import("../types/config").TextContents>;
90
+ first_message?: string;
91
+ }>>;
92
+ readonly disable_banner: boolean;
93
+ readonly override_link?: string;
94
+ readonly supports_text_only: boolean;
95
+ readonly use_rtc?: boolean;
96
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
97
+ };
65
98
  };
66
99
  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-first-message", "override-language", "override-voice-id", "override-text-only", "mic-muting", "transcript", "text-input", "text-contents", "default-expanded", "always-expanded", "user-id", "use-rtc", "collect-feedback"];
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-first-message", "override-language", "override-voice-id", "override-text-only", "mic-muting", "transcript", "text-input", "text-contents", "default-expanded", "always-expanded", "user-id", "use-rtc", "collect-feedback", "syntax-highlight-theme"];
3
3
  export type CustomAttributes = {
4
4
  [key in (typeof CustomAttributeList)[number]]?: string;
5
5
  };
@@ -7,6 +7,7 @@ export type Placement = (typeof Placements)[number];
7
7
  export declare function parsePlacement(placement: string | undefined): Placement;
8
8
  export type FeedbackMode = "none" | "during" | "end";
9
9
  export type FeedbackType = "rating";
10
+ export type SyntaxHighlightTheme = "light" | "dark";
10
11
  export interface WidgetConfig {
11
12
  variant: Variant;
12
13
  placement: Placement;
@@ -36,6 +37,7 @@ export interface WidgetConfig {
36
37
  supports_text_only: boolean;
37
38
  first_message?: string;
38
39
  use_rtc?: boolean;
40
+ syntax_highlight_theme?: SyntaxHighlightTheme;
39
41
  }
40
42
  export type AvatarConfig = {
41
43
  type: "orb";
@@ -1,13 +1,12 @@
1
- import { ReadonlySignal, Signal } from "@preact/signals";
2
- import { TranscriptEntry } from "../contexts/conversation";
3
- interface UseStickToBottomOptions {
1
+ import { Signal } from "@preact/signals";
2
+ export declare function useStickToBottom({ scrollPinned, }: {
4
3
  scrollPinned: Signal<boolean>;
5
- transcript: ReadonlySignal<TranscriptEntry[]>;
6
- }
7
- export declare function useStickToBottom({ scrollPinned, transcript, }: UseStickToBottomOptions): {
4
+ }): {
8
5
  scrollContainer: import("preact").RefObject<HTMLDivElement>;
6
+ contentRef: import("preact").RefObject<HTMLDivElement>;
9
7
  handleScroll: () => void;
10
- handleUserInteraction: () => void;
8
+ handleWheel: (e: WheelEvent) => void;
9
+ handleTouchStart: (e: TouchEvent) => void;
10
+ handleTouchMove: (e: TouchEvent) => void;
11
11
  firstRender: import("preact/hooks").MutableRef<boolean>;
12
12
  };
13
- export {};
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.6.0-beta.3";
1
+ export declare const PACKAGE_VERSION = "0.6.0-beta.5";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/convai-widget-core",
3
- "version": "0.6.0-beta.3",
3
+ "version": "0.6.0-beta.5",
4
4
  "description": "The common library for the Conversational AI Widget.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,6 +30,7 @@
30
30
  "@preact/preset-vite": "^2.10.1",
31
31
  "@radix-ui/react-select": "^2.2.2",
32
32
  "@radix-ui/react-slot": "^1.2.0",
33
+ "@types/hast": "^3.0.4",
33
34
  "@types/preact-custom-element": "^4.0.4",
34
35
  "@vitest/browser": "^3.1.2",
35
36
  "eslint": "^9.8.0",
@@ -43,6 +44,7 @@
43
44
  "vitest": "^3.1.2"
44
45
  },
45
46
  "dependencies": {
47
+ "@ctrl/tinycolor": "^4.2.0",
46
48
  "@elevenlabs/client": "workspace:*",
47
49
  "@lezer/common": "^1.3.0",
48
50
  "@lezer/highlight": "^1.2.3",
@@ -61,10 +63,13 @@
61
63
  "marked": "^17.0.0",
62
64
  "preact": "^10.26.5",
63
65
  "preact-custom-element": "^4.3.0",
64
- "react-markdown": "^10.1.0",
65
66
  "rehype-harden": "^1.1.5",
66
67
  "rehype-raw": "^7.0.0",
68
+ "remark-cjk-friendly": "^1.2.3",
69
+ "remark-cjk-friendly-gfm-strikethrough": "^1.2.3",
67
70
  "remark-gfm": "^4.0.1",
71
+ "remark-parse": "^11.0.0",
72
+ "remark-rehype": "^11.1.2",
68
73
  "tailwind-merge": "^3.4.0"
69
74
  },
70
75
  "publishConfig": {
@@ -1,5 +0,0 @@
1
- import { Signal } from "@preact/signals";
2
- export declare function SheetActions({ showTranscript, scrollPinned, }: {
3
- showTranscript: boolean;
4
- scrollPinned: Signal<boolean>;
5
- }): import("preact").JSX.Element;