@eloquentai/chat-sdk 0.33.8-dev → 0.33.10-dev
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/dist/components/chat/chat.hook.d.ts +10 -1
- package/dist/components/chat-interface/index.d.ts +13 -0
- package/dist/components/chat-interface/skeleton.d.ts +3 -1
- package/dist/config-dHSmhpBm.js +36 -0
- package/dist/config-dHSmhpBm.js.map +1 -0
- package/dist/index-BDRYeCzO.js +19210 -0
- package/dist/index-BDRYeCzO.js.map +1 -0
- package/dist/{index-D8L2nbN3.js → index-DZkoAai8.js} +3 -3
- package/dist/{index-D8L2nbN3.js.map → index-DZkoAai8.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +7394 -7
- package/dist/index.mjs.map +1 -1
- package/dist/logo-animated-C9IKnbYd.js +7413 -0
- package/dist/logo-animated-C9IKnbYd.js.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.mjs +19 -0
- package/dist/ui.mjs.map +1 -0
- package/package.json +21 -8
- package/dist/index-BCh-m5v9.js +0 -33926
- package/dist/index-BCh-m5v9.js.map +0 -1
|
@@ -56,8 +56,17 @@ export interface UseChatReturn {
|
|
|
56
56
|
* @param options The hook parameters
|
|
57
57
|
* @returns The chat hook return type
|
|
58
58
|
*/
|
|
59
|
-
export declare function useChat({ environment, apiUrl, appId, userId: initialUserId, userName, userData, chatProps, isMobile: propIsMobile, isInitiallyOpen: propIsInitiallyOpen, hasCloseButton: propHasCloseButton, hasCleanChatButton: propHasCleanChatButton, initialOpen: deprecatedInitialOpen, closeButton: deprecatedCloseButton, cleanChatButton: deprecatedCleanChatButton, proactiveMessageHideDelay: propProactiveMessageHideDelay, }: Readonly<Partial<UseChatProps> & {
|
|
59
|
+
export declare function useChat({ environment, apiUrl, appId, userId: initialUserId, userName, userData, chatProps, isMobile: propIsMobile, isInitiallyOpen: propIsInitiallyOpen, hasCloseButton: propHasCloseButton, hasCleanChatButton: propHasCleanChatButton, initialOpen: deprecatedInitialOpen, closeButton: deprecatedCloseButton, cleanChatButton: deprecatedCleanChatButton, proactiveMessageHideDelay: propProactiveMessageHideDelay, isAlwaysOpen, }: Readonly<Partial<UseChatProps> & {
|
|
60
60
|
environment: "test" | "live";
|
|
61
61
|
apiUrl?: string;
|
|
62
62
|
appId: string;
|
|
63
|
+
/**
|
|
64
|
+
* Embedded mode (INTERNAL_ONLY_CHAT_INTERFACE_ONLY): the interface is the
|
|
65
|
+
* page content and there is no launcher bubble to reopen a closed chat, so
|
|
66
|
+
* open/close state does not apply — not the isInitiallyOpen prop, not the
|
|
67
|
+
* boot `chat_settings.initial_open`, and not the closed-cookie. Without
|
|
68
|
+
* this, a boot `initial_open: false` closes the widget from under the
|
|
69
|
+
* host page a moment after it renders.
|
|
70
|
+
*/
|
|
71
|
+
isAlwaysOpen?: boolean;
|
|
63
72
|
}>): UseChatReturn;
|
|
@@ -30,6 +30,19 @@ export interface ChatInterfaceProps {
|
|
|
30
30
|
hasSuggestedMessageShine?: boolean;
|
|
31
31
|
title?: string;
|
|
32
32
|
subtitle?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Play the intro sequence (skeleton + animated logo) while the Rive asset
|
|
35
|
+
* loads, defaulting to true — the embed widget's existing behavior. With
|
|
36
|
+
* false the real interface renders immediately and the Rive runtime is never
|
|
37
|
+
* downloaded; read-only transcript views (and server rendering) want this.
|
|
38
|
+
*/
|
|
39
|
+
hasIntroAnimation?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Mark the widget as running against a test (non-live) agent: a yellow/black
|
|
42
|
+
* caution stripe is drawn down the widget's left edge so a test session can
|
|
43
|
+
* never be mistaken for the production one.
|
|
44
|
+
*/
|
|
45
|
+
isTestMode?: boolean;
|
|
33
46
|
onSendMessage?: (message: MessageData) => Promise<void>;
|
|
34
47
|
onMessageClick?: (message: MessageData) => void;
|
|
35
48
|
onClose?: () => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export declare function SkeletonChatInterface({ isOpen, isMobile, }: {
|
|
1
|
+
export declare function SkeletonChatInterface({ isOpen, isMobile, skipAnimation, }: {
|
|
2
2
|
isOpen?: boolean;
|
|
3
3
|
isMobile: boolean | undefined;
|
|
4
|
+
/** Render in place without the panel entrance — for embedded remounts, where the frame replaces a widget that was already on screen. */
|
|
5
|
+
skipAnimation?: boolean;
|
|
4
6
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import "./index-BDRYeCzO.js";
|
|
2
|
+
try {
|
|
3
|
+
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
|
|
4
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4fa3fbd0-d5e7-4d27-8da8-353f72257f91", e._sentryDebugIdIdentifier = "sentry-dbid-4fa3fbd0-d5e7-4d27-8da8-353f72257f91");
|
|
5
|
+
} catch {
|
|
6
|
+
}
|
|
7
|
+
const o = { BASE_URL: "/", DEV: !1, MODE: "dev", PROD: !0, SSR: !1, VITE_API_URL: "https://chat.eloquentai.dev", VITE_CDN_URL: "https://cdn.eloquentai.dev", VITE_ENVIRONMENT: "dev", VITE_REGION_API_URL: "https://region.eloquentai.dev" }, d = "/assets/logo-waiting-simple.riv";
|
|
8
|
+
function n(e) {
|
|
9
|
+
return typeof window > "u" || typeof import.meta > "u" ? "" : o[e] || "";
|
|
10
|
+
}
|
|
11
|
+
const _ = n("VITE_CDN_URL"), f = n("VITE_API_URL"), s = n("VITE_REGION_API_URL"), r = _ + d;
|
|
12
|
+
function l() {
|
|
13
|
+
return f || "";
|
|
14
|
+
}
|
|
15
|
+
function u() {
|
|
16
|
+
return s || "";
|
|
17
|
+
}
|
|
18
|
+
function I(e, t, i) {
|
|
19
|
+
return {
|
|
20
|
+
API: {
|
|
21
|
+
Events: {
|
|
22
|
+
endpoint: e || "",
|
|
23
|
+
region: i || "",
|
|
24
|
+
defaultAuthMode: "apiKey",
|
|
25
|
+
apiKey: t || ""
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
r as L,
|
|
32
|
+
I as a,
|
|
33
|
+
l as b,
|
|
34
|
+
u as g
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=config-dHSmhpBm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-dHSmhpBm.js","sources":["../src/lib/config.ts"],"sourcesContent":["const logoAnimatedUrl = \"/assets/logo-waiting-simple.riv\";\n\n// Helper to safely access import.meta.env in SSR environments\nfunction getEnvVariable(key: string): string {\n // Check if we're in a browser or if import.meta is available\n if (typeof window === \"undefined\" || typeof import.meta === \"undefined\") {\n return \"\";\n }\n return (import.meta.env[key] as string) || \"\";\n}\n\n// Define environment-specific constants that will be replaced during build\nconst ENV_CDN_URL = getEnvVariable(\"VITE_CDN_URL\");\nconst ENV_API_URL = getEnvVariable(\"VITE_API_URL\");\nconst ENV_REGION_API_URL = getEnvVariable(\"VITE_REGION_API_URL\");\n\nexport const LOGO_ANIMATED_URL = ENV_CDN_URL + logoAnimatedUrl;\n\n/**\n * Returns the API URL based on the provided custom URL or the default API URL.\n * @returns The API URL.\n */\nexport function getApiUrl(): string {\n return ENV_API_URL || \"\";\n}\n\n/**\n * Returns the Region API URL based on the environment.\n * @returns The Region API URL.\n */\nexport function getRegionApiUrl(): string {\n return ENV_REGION_API_URL || \"\";\n}\n\n/**\n * Returns the Amplify configuration for the API.\n * @returns The Amplify configuration.\n */\nexport function amplifyConfig(\n appSyncUrl?: string | null,\n appSyncApiKey?: string | null,\n appSyncRegion?: string | null,\n) {\n return {\n API: {\n Events: {\n endpoint: appSyncUrl || \"\",\n region: appSyncRegion || \"\",\n defaultAuthMode: \"apiKey\",\n apiKey: appSyncApiKey || \"\",\n },\n },\n } as const;\n}\n"],"names":["logoAnimatedUrl","getEnvVariable","key","__vite_import_meta_env__","ENV_CDN_URL","ENV_API_URL","ENV_REGION_API_URL","LOGO_ANIMATED_URL","getApiUrl","getRegionApiUrl","amplifyConfig","appSyncUrl","appSyncApiKey","appSyncRegion"],"mappings":";;;;;;8OAAMA,IAAkB;AAGxB,SAASC,EAAeC,GAAqB;AAE3C,SAAI,OAAO,SAAW,OAAe,OAAO,cAAgB,MACnD,KAEDC,EAAgBD,CAAG,KAAgB;AAC7C;AAGA,MAAME,IAAcH,EAAe,cAAc,GAC3CI,IAAcJ,EAAe,cAAc,GAC3CK,IAAqBL,EAAe,qBAAqB,GAElDM,IAAoBH,IAAcJ;AAMxC,SAASQ,IAAoB;AAClC,SAAOH,KAAe;AACxB;AAMO,SAASI,IAA0B;AACxC,SAAOH,KAAsB;AAC/B;AAMO,SAASI,EACdC,GACAC,GACAC,GACA;AACA,SAAO;AAAA,IACL,KAAK;AAAA,MACH,QAAQ;AAAA,QACN,UAAUF,KAAc;AAAA,QACxB,QAAQE,KAAiB;AAAA,QACzB,iBAAiB;AAAA,QACjB,QAAQD,KAAiB;AAAA,MAAA;AAAA,IAC3B;AAAA,EACF;AAEJ;"}
|