@elevenlabs/convai-widget-core 0.0.7
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/Avatar.d.ts +10 -0
- package/dist/components/Button.d.ts +26 -0
- package/dist/components/CopyButton.d.ts +7 -0
- package/dist/components/Flag.d.ts +11 -0
- package/dist/components/Icon.d.ts +31 -0
- package/dist/components/InOutTransition.d.ts +37 -0
- package/dist/components/SizeTransition.d.ts +28 -0
- package/dist/components/TextArea.d.ts +2 -0
- package/dist/contexts/attributes.d.ts +17 -0
- package/dist/contexts/avatar-config.d.ts +13 -0
- package/dist/contexts/conversation.d.ts +42 -0
- package/dist/contexts/language-config.d.ts +16 -0
- package/dist/contexts/mic-config.d.ts +13 -0
- package/dist/contexts/root-portal.d.ts +6 -0
- package/dist/contexts/server-location.d.ts +14 -0
- package/dist/contexts/session-config.d.ts +9 -0
- package/dist/contexts/terms.d.ts +14 -0
- package/dist/contexts/text-contents.d.ts +12 -0
- package/dist/contexts/widget-config.d.ts +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.dev.d.ts +1 -0
- package/dist/index.js +5511 -0
- package/dist/index.local.d.ts +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/mocks/browser.d.ts +29 -0
- package/dist/mocks/web-component.d.ts +5 -0
- package/dist/orb/Orb.d.ts +24 -0
- package/dist/styles/Style.d.ts +1 -0
- package/dist/types/attributes.d.ts +5 -0
- package/dist/types/config.d.ts +71 -0
- package/dist/types/languages.d.ts +169 -0
- package/dist/utils/signalish.d.ts +7 -0
- package/dist/utils/useContextSafely.d.ts +2 -0
- package/dist/utils/useCssTransition.d.ts +13 -0
- package/dist/utils/useReducedMotion.d.ts +1 -0
- package/dist/widget/CallButton.d.ts +7 -0
- package/dist/widget/CompactExpandableTrigger.d.ts +2 -0
- package/dist/widget/CompactTrigger.d.ts +2 -0
- package/dist/widget/ErrorModal.d.ts +6 -0
- package/dist/widget/ExpandableTriggerActions.d.ts +2 -0
- package/dist/widget/FullExpandableTrigger.d.ts +2 -0
- package/dist/widget/FullTrigger.d.ts +2 -0
- package/dist/widget/LanguageSelect.d.ts +7 -0
- package/dist/widget/PoweredBy.d.ts +1 -0
- package/dist/widget/Sheet.d.ts +6 -0
- package/dist/widget/SheetActions.d.ts +7 -0
- package/dist/widget/SheetLanguageSelect.d.ts +2 -0
- package/dist/widget/StatusLabel.d.ts +2 -0
- package/dist/widget/TermsModal.d.ts +1 -0
- package/dist/widget/Transcript.d.ts +8 -0
- package/dist/widget/TranscriptMessage.d.ts +7 -0
- package/dist/widget/Trigger.d.ts +11 -0
- package/dist/widget/TriggerActions.d.ts +1 -0
- package/dist/widget/TriggerLanguageSelect.d.ts +6 -0
- package/dist/widget/TriggerMuteButton.d.ts +6 -0
- package/dist/widget/Wrapper.d.ts +1 -0
- package/dist/widget/index.d.ts +2 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 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.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const SIZE_CLASSES: {
|
|
2
|
+
sm: string;
|
|
3
|
+
lg: string;
|
|
4
|
+
};
|
|
5
|
+
interface AvatarProps {
|
|
6
|
+
size?: keyof typeof SIZE_CLASSES;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Avatar({ size, className }: AvatarProps): import("preact/compat").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from "preact/compat";
|
|
2
|
+
import { IconName } from "./Icon";
|
|
3
|
+
import { ComponentChildren } from "preact";
|
|
4
|
+
import { Signalish } from "../utils/signalish";
|
|
5
|
+
declare const VARIANT_CLASSES: {
|
|
6
|
+
primary: string;
|
|
7
|
+
secondary: string;
|
|
8
|
+
};
|
|
9
|
+
export interface BaseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
10
|
+
iconClassName?: string;
|
|
11
|
+
variant?: keyof typeof VARIANT_CLASSES;
|
|
12
|
+
disabledStyle?: boolean;
|
|
13
|
+
truncate?: boolean;
|
|
14
|
+
icon?: IconName;
|
|
15
|
+
}
|
|
16
|
+
interface TextButtonProps extends BaseButtonProps {
|
|
17
|
+
children: ComponentChildren;
|
|
18
|
+
}
|
|
19
|
+
interface IconButtonProps extends BaseButtonProps {
|
|
20
|
+
"aria-label": Signalish<string | undefined>;
|
|
21
|
+
}
|
|
22
|
+
export type ButtonProps = TextButtonProps | IconButtonProps;
|
|
23
|
+
export declare const Button: import("preact").FunctionalComponent<import("preact/compat").PropsWithoutRef<ButtonProps> & {
|
|
24
|
+
ref?: import("preact").Ref<HTMLButtonElement> | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseButtonProps } from "./Button";
|
|
2
|
+
import { Signalish } from "../utils/signalish";
|
|
3
|
+
interface CopyButtonProps extends BaseButtonProps {
|
|
4
|
+
copyText: Signalish<string | null>;
|
|
5
|
+
}
|
|
6
|
+
export declare function CopyButton({ copyText, children }: CopyButtonProps): import("preact/compat").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ImgHTMLAttributes } from "preact/compat";
|
|
2
|
+
declare const SIZE_CLASSES: {
|
|
3
|
+
sm: string;
|
|
4
|
+
md: string;
|
|
5
|
+
};
|
|
6
|
+
interface FlagProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
7
|
+
size?: keyof typeof SIZE_CLASSES;
|
|
8
|
+
flagCode: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Flag({ size, flagCode, className, ...props }: FlagProps): import("preact/compat").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { JSX } from "preact";
|
|
2
|
+
declare const ICON_MAP: {
|
|
3
|
+
phone: typeof PhoneIcon;
|
|
4
|
+
"phone-off": typeof PhoneSlashIcon;
|
|
5
|
+
chat: typeof ChatIcon;
|
|
6
|
+
mic: typeof MicIcon;
|
|
7
|
+
"mic-off": typeof MicOffIcon;
|
|
8
|
+
check: typeof CheckIcon;
|
|
9
|
+
"chevron-down": typeof ChevronDownIcon;
|
|
10
|
+
"chevron-up": typeof ChevronUpIcon;
|
|
11
|
+
};
|
|
12
|
+
declare const SIZE_CLASSES: {
|
|
13
|
+
sm: string;
|
|
14
|
+
md: string;
|
|
15
|
+
};
|
|
16
|
+
export type IconName = keyof typeof ICON_MAP;
|
|
17
|
+
interface IconProps {
|
|
18
|
+
name: IconName;
|
|
19
|
+
size?: keyof typeof SIZE_CLASSES;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function Icon({ name, size, className }: IconProps): JSX.Element;
|
|
23
|
+
declare function PhoneIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
24
|
+
declare function PhoneSlashIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
25
|
+
declare function ChatIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
26
|
+
declare function MicIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
27
|
+
declare function MicOffIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
28
|
+
declare function ChevronDownIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
29
|
+
declare function ChevronUpIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
30
|
+
declare function CheckIcon(props: JSX.HTMLAttributes<SVGSVGElement>): JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HTMLAttributes } from "preact/compat";
|
|
2
|
+
import { Signalish } from "../utils/signalish";
|
|
3
|
+
interface InOutTransitionProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the child should be shown or not.
|
|
6
|
+
*/
|
|
7
|
+
active: Signalish<boolean>;
|
|
8
|
+
/**
|
|
9
|
+
* The initial state of the child.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Defaults to the value of `active` at the time of mounting.
|
|
13
|
+
*/
|
|
14
|
+
initial?: Signalish<boolean>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A wrapper component that retains its children during CSS transitions.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* The component expects a single child element. The child will be mounted only
|
|
21
|
+
* when the `active` property is set. When inactive, the component will wait
|
|
22
|
+
* for all ongoing CSS transitions to end and unmount the child afterward.
|
|
23
|
+
*
|
|
24
|
+
* `data-hidden:*` and `data-shown:*` tailwind modifiers can be used to animate
|
|
25
|
+
* the child in and out.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <InOutTransition enabled={enabled}>
|
|
30
|
+
* <div className="transition-opacity duration-200 data-hidden:opacity-0">
|
|
31
|
+
* Example
|
|
32
|
+
* </div>
|
|
33
|
+
* </InOutTransition>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function InOutTransition(props: InOutTransitionProps): import("preact/compat").JSX.Element;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes, PropsWithoutRef } from "preact/compat";
|
|
2
|
+
interface SizeTransitionProps extends PropsWithoutRef<HTMLAttributes<HTMLSpanElement>> {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the children should be shown.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* When set to `false`, the children will fade out and the size will
|
|
8
|
+
* transition towards `0` to make the element disappear.
|
|
9
|
+
*/
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the component should grow to fill the available space in a flex
|
|
13
|
+
* layout.
|
|
14
|
+
*/
|
|
15
|
+
grow?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* A dependency used to detect when the size of the children changes.
|
|
18
|
+
*/
|
|
19
|
+
dep?: any;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A component whose size animates to match its content.
|
|
23
|
+
*
|
|
24
|
+
* @param props
|
|
25
|
+
* @constructor
|
|
26
|
+
*/
|
|
27
|
+
export declare function SizeTransition(props: SizeTransitionProps): import("preact/compat").JSX.Element;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReadonlySignal, Signal } from "@preact/signals";
|
|
2
|
+
import { CustomAttributeList, CustomAttributes } from "../types/attributes";
|
|
3
|
+
import type { JSX } from "preact";
|
|
4
|
+
export type AttributeSignals = {
|
|
5
|
+
[key in (typeof CustomAttributeList)[number]]: Signal<string | undefined>;
|
|
6
|
+
};
|
|
7
|
+
export type AttributeReadonlySignals = {
|
|
8
|
+
[key in (typeof CustomAttributeList)[number]]: ReadonlySignal<string | undefined>;
|
|
9
|
+
};
|
|
10
|
+
interface AttributesProviderProps {
|
|
11
|
+
value: CustomAttributes;
|
|
12
|
+
children: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare function AttributesProvider({ value, children, }: AttributesProviderProps): JSX.Element;
|
|
15
|
+
export declare function useAttributes(): AttributeReadonlySignals;
|
|
16
|
+
export declare function useAttribute(name: (typeof CustomAttributeList)[number]): ReadonlySignal<string | undefined>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReadonlySignal, Signal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
import { AvatarConfig } from "../types/config";
|
|
4
|
+
interface AvatarConfigProviderProps {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
}
|
|
7
|
+
export declare function AvatarConfigProvider({ children }: AvatarConfigProviderProps): import("preact").JSX.Element;
|
|
8
|
+
export declare function useAvatarConfig(): {
|
|
9
|
+
config: ReadonlySignal<AvatarConfig>;
|
|
10
|
+
previewUrl: ReadonlySignal<string>;
|
|
11
|
+
canvasUrl: Signal<string>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Mode, Role, Status } from "@elevenlabs/client";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
interface ConversationProviderProps {
|
|
4
|
+
children: ComponentChildren;
|
|
5
|
+
}
|
|
6
|
+
export type TranscriptEntry = {
|
|
7
|
+
type: "message";
|
|
8
|
+
role: Role;
|
|
9
|
+
message: string;
|
|
10
|
+
isText: boolean;
|
|
11
|
+
conversationIndex: number;
|
|
12
|
+
} | {
|
|
13
|
+
type: "disconnection";
|
|
14
|
+
role: Role;
|
|
15
|
+
message?: undefined;
|
|
16
|
+
conversationIndex: number;
|
|
17
|
+
} | {
|
|
18
|
+
type: "error";
|
|
19
|
+
message: string;
|
|
20
|
+
conversationIndex: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function ConversationProvider({ children }: ConversationProviderProps): import("preact").JSX.Element;
|
|
23
|
+
export declare function useConversation(): {
|
|
24
|
+
status: import("@preact/signals").Signal<Status>;
|
|
25
|
+
isSpeaking: import("@preact/signals").ReadonlySignal<boolean>;
|
|
26
|
+
mode: import("@preact/signals").Signal<Mode>;
|
|
27
|
+
isDisconnected: import("@preact/signals").ReadonlySignal<boolean>;
|
|
28
|
+
lastId: import("@preact/signals").Signal<string | null>;
|
|
29
|
+
error: import("@preact/signals").Signal<string | null>;
|
|
30
|
+
canSendFeedback: import("@preact/signals").Signal<boolean>;
|
|
31
|
+
conversationIndex: import("@preact/signals").Signal<number>;
|
|
32
|
+
conversationTextOnly: import("@preact/signals").Signal<boolean | null>;
|
|
33
|
+
transcript: import("@preact/signals").Signal<TranscriptEntry[]>;
|
|
34
|
+
startSession: (element: HTMLElement, initialMessage?: string) => Promise<string | undefined>;
|
|
35
|
+
endSession: () => Promise<void>;
|
|
36
|
+
getInputVolume: () => number;
|
|
37
|
+
getOutputVolume: () => number;
|
|
38
|
+
sendFeedback: (like: boolean) => void;
|
|
39
|
+
sendUserMessage: (text: string) => void;
|
|
40
|
+
sendUserActivity: () => void;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
import { Language } from "@elevenlabs/client";
|
|
4
|
+
import { LanguageInfo } from "../types/languages";
|
|
5
|
+
interface LanguageConfig {
|
|
6
|
+
language: ReadonlySignal<LanguageInfo>;
|
|
7
|
+
setLanguage: (value: Language) => void;
|
|
8
|
+
options: ReadonlySignal<LanguageInfo[]>;
|
|
9
|
+
showPicker: ReadonlySignal<boolean>;
|
|
10
|
+
}
|
|
11
|
+
interface LanguageConfigProviderProps {
|
|
12
|
+
children: ComponentChildren;
|
|
13
|
+
}
|
|
14
|
+
export declare function LanguageConfigProvider({ children, }: LanguageConfigProviderProps): import("preact").JSX.Element;
|
|
15
|
+
export declare function useLanguageConfig(): LanguageConfig;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
interface MicConfig {
|
|
4
|
+
isMutingEnabled: ReadonlySignal<boolean>;
|
|
5
|
+
isMuted: ReadonlySignal<boolean>;
|
|
6
|
+
setIsMuted: (value: boolean) => void;
|
|
7
|
+
}
|
|
8
|
+
interface MicConfigProviderProps {
|
|
9
|
+
children: ComponentChildren;
|
|
10
|
+
}
|
|
11
|
+
export declare function MicConfigProvider({ children }: MicConfigProviderProps): import("preact").JSX.Element;
|
|
12
|
+
export declare function useMicConfig(): MicConfig;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from "preact/compat";
|
|
2
|
+
interface RootPortalProviderProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
}
|
|
4
|
+
export declare function Root({ children, ...rest }: RootPortalProviderProps): import("preact/compat").JSX.Element;
|
|
5
|
+
export declare function useRootPortal(): HTMLDivElement;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
export type Location = "us" | "global";
|
|
4
|
+
interface ServerLocationProviderProps {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
}
|
|
7
|
+
export declare function ServerLocationProvider({ children, }: ServerLocationProviderProps): import("preact").JSX.Element;
|
|
8
|
+
export declare function useServerLocation(): {
|
|
9
|
+
location: ReadonlySignal<Location>;
|
|
10
|
+
serverUrl: ReadonlySignal<string>;
|
|
11
|
+
webSocketUrl: ReadonlySignal<string>;
|
|
12
|
+
};
|
|
13
|
+
export declare function parseLocation(location?: string): Location;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SessionConfig } from "@elevenlabs/client";
|
|
2
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
3
|
+
import { ComponentChildren } from "preact";
|
|
4
|
+
interface SessionConfigProviderProps {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
}
|
|
7
|
+
export declare function SessionConfigProvider({ children, }: SessionConfigProviderProps): import("preact").JSX.Element | null;
|
|
8
|
+
export declare function useSessionConfig(): ReadonlySignal<SessionConfig>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
interface TermsProviderProps {
|
|
4
|
+
children: ComponentChildren;
|
|
5
|
+
}
|
|
6
|
+
export declare function TermsProvider({ children }: TermsProviderProps): import("preact").JSX.Element;
|
|
7
|
+
export declare function useTerms(): {
|
|
8
|
+
termsAccepted: ReadonlySignal<boolean>;
|
|
9
|
+
termsShown: ReadonlySignal<boolean>;
|
|
10
|
+
requestTerms: () => Promise<void>;
|
|
11
|
+
dismissTerms: () => void;
|
|
12
|
+
acceptTerms: () => void;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
import { TextContents } from "../types/config";
|
|
4
|
+
type TextContentsType = {
|
|
5
|
+
[key in keyof TextContents]: ReadonlySignal<string>;
|
|
6
|
+
};
|
|
7
|
+
interface TextContentsProviderProps {
|
|
8
|
+
children: ComponentChildren;
|
|
9
|
+
}
|
|
10
|
+
export declare function TextContentsProvider({ children }: TextContentsProviderProps): import("preact").JSX.Element;
|
|
11
|
+
export declare function useTextContents(): TextContentsType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReadonlySignal } from "@preact/signals";
|
|
2
|
+
import { ComponentChildren } from "preact";
|
|
3
|
+
import { WidgetConfig } from "../types/config";
|
|
4
|
+
interface WidgetConfigProviderProps {
|
|
5
|
+
children: ComponentChildren;
|
|
6
|
+
}
|
|
7
|
+
export declare function WidgetConfigProvider({ children }: WidgetConfigProviderProps): import("preact").JSX.Element | null;
|
|
8
|
+
export declare function useWidgetConfig(): ReadonlySignal<WidgetConfig>;
|
|
9
|
+
export declare function useTextOnly(): ReadonlySignal<boolean>;
|
|
10
|
+
export declare function useIsConversationTextOnly(): ReadonlySignal<boolean>;
|
|
11
|
+
export declare function useFirstMessage(): ReadonlySignal<string | null>;
|
|
12
|
+
export {};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|