@eloquentai/chat-sdk 0.33.9-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 +6 -0
- package/dist/components/chat-interface/skeleton.d.ts +3 -1
- package/dist/{config-CFAxzluW.js → config-dHSmhpBm.js} +2 -2
- package/dist/{config-CFAxzluW.js.map → config-dHSmhpBm.js.map} +1 -1
- package/dist/{index-IRBMUmPg.js → index-BDRYeCzO.js} +31 -18
- package/dist/{index-IRBMUmPg.js.map → index-BDRYeCzO.js.map} +1 -1
- package/dist/{index-oyJIfzwW.js → index-DZkoAai8.js} +2 -2
- package/dist/{index-oyJIfzwW.js.map → index-DZkoAai8.js.map} +1 -1
- package/dist/index.css +1 -1
- package/dist/index.mjs +1677 -1663
- package/dist/index.mjs.map +1 -1
- package/dist/{logo-animated-CI8oFAlZ.js → logo-animated-C9IKnbYd.js} +3 -3
- package/dist/{logo-animated-CI8oFAlZ.js.map → logo-animated-C9IKnbYd.js.map} +1 -1
- package/dist/ui.mjs +1 -1
- package/package.json +1 -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;
|
|
@@ -37,6 +37,12 @@ export interface ChatInterfaceProps {
|
|
|
37
37
|
* downloaded; read-only transcript views (and server rendering) want this.
|
|
38
38
|
*/
|
|
39
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;
|
|
40
46
|
onSendMessage?: (message: MessageData) => Promise<void>;
|
|
41
47
|
onMessageClick?: (message: MessageData) => void;
|
|
42
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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./index-
|
|
1
|
+
import "./index-BDRYeCzO.js";
|
|
2
2
|
try {
|
|
3
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
4
|
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "4fa3fbd0-d5e7-4d27-8da8-353f72257f91", e._sentryDebugIdIdentifier = "sentry-dbid-4fa3fbd0-d5e7-4d27-8da8-353f72257f91");
|
|
@@ -33,4 +33,4 @@ export {
|
|
|
33
33
|
l as b,
|
|
34
34
|
u as g
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=config-
|
|
36
|
+
//# sourceMappingURL=config-dHSmhpBm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-
|
|
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;"}
|
|
@@ -5,12 +5,12 @@ import { useState as Ee, useEffect as It, forwardRef as Te, createContext as Ur,
|
|
|
5
5
|
import * as ts from "react-dom";
|
|
6
6
|
try {
|
|
7
7
|
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {}, t = new e.Error().stack;
|
|
8
|
-
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "
|
|
8
|
+
t && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[t] = "507848d6-93a8-4436-b8ff-40ab08ec9952", e._sentryDebugIdIdentifier = "sentry-dbid-507848d6-93a8-4436-b8ff-40ab08ec9952");
|
|
9
9
|
} catch {
|
|
10
10
|
}
|
|
11
11
|
{
|
|
12
12
|
let e = typeof window < "u" ? window : typeof global < "u" ? global : typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : {};
|
|
13
|
-
e.SENTRY_RELEASE = { id: "
|
|
13
|
+
e.SENTRY_RELEASE = { id: "387a6e54c98ca3c114981f053c5551fcc2263df7" };
|
|
14
14
|
}
|
|
15
15
|
function ns(e) {
|
|
16
16
|
var t, n, r = "";
|
|
@@ -17140,7 +17140,7 @@ const Wk = ({ text: e }) => {
|
|
|
17140
17140
|
}
|
|
17141
17141
|
);
|
|
17142
17142
|
}, Gk = Ja(
|
|
17143
|
-
() => import("./logo-animated-
|
|
17143
|
+
() => import("./logo-animated-C9IKnbYd.js").then((e) => ({
|
|
17144
17144
|
default: e.LogoAnimated
|
|
17145
17145
|
}))
|
|
17146
17146
|
);
|
|
@@ -19077,13 +19077,15 @@ function dS(e, t) {
|
|
|
19077
19077
|
}
|
|
19078
19078
|
function pS({
|
|
19079
19079
|
isOpen: e = !1,
|
|
19080
|
-
isMobile: t
|
|
19080
|
+
isMobile: t,
|
|
19081
|
+
skipAnimation: n = !1
|
|
19081
19082
|
}) {
|
|
19082
|
-
const
|
|
19083
|
-
isOpen: n,
|
|
19084
|
-
isMobile: t
|
|
19083
|
+
const r = dS(e, 10), o = nf({
|
|
19084
|
+
isOpen: n ? e : r,
|
|
19085
|
+
isMobile: t,
|
|
19086
|
+
skipAnimation: n
|
|
19085
19087
|
});
|
|
19086
|
-
return /* @__PURE__ */ te(bi, { className:
|
|
19088
|
+
return /* @__PURE__ */ te(bi, { className: o, children: [
|
|
19087
19089
|
/* @__PURE__ */ v(yi, { className: "eloq:p-4 eloq:mb-4 eloq:flex eloq:flex-row eloq:items-center eloq:justify-between eloq:shadow-sm eloq:space-y-0", children: /* @__PURE__ */ te("div", { className: "eloq:flex eloq:flex-row eloq:items-center eloq:space-x-3", children: [
|
|
19088
19090
|
/* @__PURE__ */ v(vt, { className: "eloq:h-8 eloq:w-8" }),
|
|
19089
19091
|
/* @__PURE__ */ v(vt, { className: "eloq:h-6 eloq:w-32" })
|
|
@@ -19105,7 +19107,7 @@ function pS({
|
|
|
19105
19107
|
] }, "chat-interface-skeleton");
|
|
19106
19108
|
}
|
|
19107
19109
|
const hS = Ja(
|
|
19108
|
-
() => import("./logo-animated-
|
|
19110
|
+
() => import("./logo-animated-C9IKnbYd.js").then((e) => ({
|
|
19109
19111
|
default: e.LogoAnimated
|
|
19110
19112
|
}))
|
|
19111
19113
|
);
|
|
@@ -19116,14 +19118,25 @@ function RS(e) {
|
|
|
19116
19118
|
onCleanChat: r,
|
|
19117
19119
|
onClose: o,
|
|
19118
19120
|
theme: i,
|
|
19119
|
-
hasIntroAnimation: l = !0
|
|
19120
|
-
|
|
19121
|
-
|
|
19122
|
-
|
|
19121
|
+
hasIntroAnimation: l = !0,
|
|
19122
|
+
isTestMode: a = !1
|
|
19123
|
+
} = e, [s, u] = Ee(!l), [f, c] = Ee(!1), p = dt(t);
|
|
19124
|
+
p.current !== t && (p.current = t, f && c(!1));
|
|
19125
|
+
const d = nf({
|
|
19123
19126
|
isOpen: t,
|
|
19124
19127
|
isMobile: n,
|
|
19125
|
-
|
|
19126
|
-
|
|
19128
|
+
// No intro also means no panel-in/out entrance: the interface is being
|
|
19129
|
+
// rendered as page content (embedded playground, transcript previews),
|
|
19130
|
+
// where a popup-style "rise from the corner" animation is wrong.
|
|
19131
|
+
skipAnimation: f || !l
|
|
19132
|
+
}), h = () => s ? /* @__PURE__ */ te(bi, { className: ne(d, { "eloq:relative": a }), children: [
|
|
19133
|
+
a && /* @__PURE__ */ v(
|
|
19134
|
+
"div",
|
|
19135
|
+
{
|
|
19136
|
+
"data-testid": "test-mode-stripe",
|
|
19137
|
+
className: "eloq-test-mode-stripe eloq:absolute eloq:left-0 eloq:top-0 eloq:h-full eloq:w-3 eloq:z-10"
|
|
19138
|
+
}
|
|
19139
|
+
),
|
|
19127
19140
|
/* @__PURE__ */ v(
|
|
19128
19141
|
fS,
|
|
19129
19142
|
{
|
|
@@ -19140,7 +19153,7 @@ function RS(e) {
|
|
|
19140
19153
|
{
|
|
19141
19154
|
className: "eloq:hidden eloq:invisible",
|
|
19142
19155
|
onLoaded: () => {
|
|
19143
|
-
t &&
|
|
19156
|
+
t && c(!0), u(!0);
|
|
19144
19157
|
}
|
|
19145
19158
|
}
|
|
19146
19159
|
) })
|
|
@@ -19154,7 +19167,7 @@ function RS(e) {
|
|
|
19154
19167
|
dark: i?.mode === "dark"
|
|
19155
19168
|
}
|
|
19156
19169
|
),
|
|
19157
|
-
children:
|
|
19170
|
+
children: h()
|
|
19158
19171
|
}
|
|
19159
19172
|
) }) });
|
|
19160
19173
|
}
|
|
@@ -19194,4 +19207,4 @@ export {
|
|
|
19194
19207
|
Fu as v,
|
|
19195
19208
|
bS as w
|
|
19196
19209
|
};
|
|
19197
|
-
//# sourceMappingURL=index-
|
|
19210
|
+
//# sourceMappingURL=index-BDRYeCzO.js.map
|