@kite-copilot/chat-panel 0.2.54 → 0.2.56
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/README.md +13 -18
- package/dist/auto.cjs +202 -60
- package/dist/auto.d.cts +1 -1
- package/dist/auto.d.ts +1 -1
- package/dist/auto.js +1 -1
- package/dist/{chunk-TK7U64UR.js → chunk-YTH7EUFD.js} +203 -61
- package/dist/{createKiteChat-Cl1sNjam.d.cts → createKiteChat-DiJ2Otkm.d.cts} +16 -2
- package/dist/{createKiteChat-Cl1sNjam.d.ts → createKiteChat-DiJ2Otkm.d.ts} +16 -2
- package/dist/embed.global.js +30 -30
- package/dist/index.cjs +202 -60
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -886,7 +886,7 @@ import * as React6 from "react";
|
|
|
886
886
|
import { createPortal } from "react-dom";
|
|
887
887
|
import { createClient } from "@supabase/supabase-js";
|
|
888
888
|
import { ArrowLeft, ArrowUp, Command, CornerDownLeft, CheckCircle2 as CheckCircle23, SquarePen, Paperclip, X, FileSpreadsheet, Loader2 as Loader22, ChevronLeft, ChevronRight, Sparkles, Minus, Download } from "lucide-react";
|
|
889
|
-
import { motion as motion2,
|
|
889
|
+
import { motion as motion2, useDragControls } from "framer-motion";
|
|
890
890
|
|
|
891
891
|
// src/hooks/useUserAuth.ts
|
|
892
892
|
import * as React4 from "react";
|
|
@@ -1692,9 +1692,8 @@ function ChatPanel({
|
|
|
1692
1692
|
const [input, setInput] = React6.useState("");
|
|
1693
1693
|
const [corner, setCorner] = React6.useState(initialCorner);
|
|
1694
1694
|
const [isDragging, setIsDragging] = React6.useState(false);
|
|
1695
|
-
const dragControls =
|
|
1695
|
+
const dragControls = useDragControls();
|
|
1696
1696
|
const handleDragEnd = React6.useCallback((_event, info) => {
|
|
1697
|
-
dragControls.set({ x: 0, y: 0 });
|
|
1698
1697
|
setIsDragging(false);
|
|
1699
1698
|
const viewportWidth = window.innerWidth;
|
|
1700
1699
|
const pointerX = info.point.x;
|
|
@@ -1703,7 +1702,7 @@ function ChatPanel({
|
|
|
1703
1702
|
setCorner(newCorner);
|
|
1704
1703
|
onCornerChange?.(newCorner);
|
|
1705
1704
|
}
|
|
1706
|
-
}, [corner, onCornerChange
|
|
1705
|
+
}, [corner, onCornerChange]);
|
|
1707
1706
|
const [sessionId, setSessionId] = React6.useState(() => crypto.randomUUID());
|
|
1708
1707
|
const [sessionUser, setSessionUser] = React6.useState(null);
|
|
1709
1708
|
const orgConfigState = useOrgConfig({ agentUrl, orgId: orgId || "" });
|
|
@@ -1776,6 +1775,18 @@ function ChatPanel({
|
|
|
1776
1775
|
}
|
|
1777
1776
|
);
|
|
1778
1777
|
}
|
|
1778
|
+
if (supabaseRef.current && sessionId) {
|
|
1779
|
+
console.log("[KiteChat] resetSession - marking session as ended:", sessionId);
|
|
1780
|
+
supabaseRef.current.from("sessions").update({ session_status: "ended" }).eq("session_id", sessionId).then(
|
|
1781
|
+
() => console.log("[KiteChat] resetSession - session marked as ended successfully:", sessionId),
|
|
1782
|
+
(err) => console.error("[KiteChat] resetSession - failed to mark session as ended:", sessionId, err)
|
|
1783
|
+
);
|
|
1784
|
+
} else {
|
|
1785
|
+
console.log("[KiteChat] resetSession - skipped marking session as ended:", {
|
|
1786
|
+
hasSupabase: !!supabaseRef.current,
|
|
1787
|
+
sessionId
|
|
1788
|
+
});
|
|
1789
|
+
}
|
|
1779
1790
|
setSessionUser(null);
|
|
1780
1791
|
setSessionId(crypto.randomUUID());
|
|
1781
1792
|
setIsEscalated(false);
|
|
@@ -1838,19 +1849,112 @@ function ChatPanel({
|
|
|
1838
1849
|
};
|
|
1839
1850
|
}, [isEscalated, sessionId, effectiveSupabaseUrl, effectiveSupabaseAnonKey]);
|
|
1840
1851
|
React6.useEffect(() => {
|
|
1841
|
-
if (!
|
|
1842
|
-
console.log("[KiteChat]
|
|
1852
|
+
if (!sessionId || !supabaseRef.current || isEscalated) {
|
|
1853
|
+
console.log("[KiteChat] Session status subscription skip - sessionId:", sessionId, "supabase:", !!supabaseRef.current, "isEscalated:", isEscalated);
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
const channelName = `session-status:${sessionId}`;
|
|
1857
|
+
console.log("[KiteChat] Subscribing to session status changes:", channelName);
|
|
1858
|
+
const statusChannel = supabaseRef.current.channel(channelName).on(
|
|
1859
|
+
"postgres_changes",
|
|
1860
|
+
{
|
|
1861
|
+
event: "UPDATE",
|
|
1862
|
+
schema: "public",
|
|
1863
|
+
table: "sessions",
|
|
1864
|
+
filter: `session_id=eq.${sessionId}`
|
|
1865
|
+
},
|
|
1866
|
+
(payload) => {
|
|
1867
|
+
console.log("[KiteChat] Session status changed:", payload);
|
|
1868
|
+
if (payload.new.session_status === "escalated") {
|
|
1869
|
+
console.log("[KiteChat] Manual escalation detected - agent took over from control center");
|
|
1870
|
+
setIsEscalated(true);
|
|
1871
|
+
setPhase("idle");
|
|
1872
|
+
const escalationMessageId = Date.now() + 2;
|
|
1873
|
+
const escalationMessage = {
|
|
1874
|
+
id: escalationMessageId,
|
|
1875
|
+
role: "assistant",
|
|
1876
|
+
kind: "text",
|
|
1877
|
+
content: "A support agent has joined the conversation and will assist you shortly."
|
|
1878
|
+
};
|
|
1879
|
+
setMessages((prev) => [...prev, escalationMessage]);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
).subscribe((status) => {
|
|
1883
|
+
if (status === "SUBSCRIBED") {
|
|
1884
|
+
console.log("[KiteChat] Successfully subscribed to session status changes");
|
|
1885
|
+
} else if (status === "CHANNEL_ERROR") {
|
|
1886
|
+
console.error("[KiteChat] Failed to subscribe to session status changes");
|
|
1887
|
+
}
|
|
1888
|
+
});
|
|
1889
|
+
return () => {
|
|
1890
|
+
console.log("[KiteChat] Unsubscribing from session status changes");
|
|
1891
|
+
statusChannel.unsubscribe();
|
|
1892
|
+
};
|
|
1893
|
+
}, [sessionId, isEscalated, effectiveSupabaseUrl, effectiveSupabaseAnonKey]);
|
|
1894
|
+
React6.useEffect(() => {
|
|
1895
|
+
if (!isEscalated || !supabaseRef.current || !sessionId) {
|
|
1896
|
+
return;
|
|
1897
|
+
}
|
|
1898
|
+
if (!isOpen) {
|
|
1899
|
+
console.log("[KiteChat] Panel minimized during live chat, marking inactive");
|
|
1843
1900
|
supabaseRef.current.from("escalations").update({
|
|
1844
|
-
customer_status: "
|
|
1901
|
+
customer_status: "inactive",
|
|
1902
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1903
|
+
}).eq("session_id", sessionId).then(
|
|
1904
|
+
() => console.log("[KiteChat] Successfully marked inactive on panel minimize"),
|
|
1905
|
+
(err) => {
|
|
1906
|
+
console.error("[KiteChat] Failed to mark inactive on panel minimize:", err);
|
|
1907
|
+
}
|
|
1908
|
+
);
|
|
1909
|
+
} else {
|
|
1910
|
+
console.log("[KiteChat] Panel reopened during live chat, marking active");
|
|
1911
|
+
supabaseRef.current.from("escalations").update({
|
|
1912
|
+
customer_status: "active",
|
|
1845
1913
|
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1846
1914
|
}).eq("session_id", sessionId).then(
|
|
1847
|
-
() => console.log("[KiteChat] Successfully marked
|
|
1915
|
+
() => console.log("[KiteChat] Successfully marked active on panel reopen"),
|
|
1848
1916
|
(err) => {
|
|
1849
|
-
console.error("[KiteChat] Failed to mark
|
|
1917
|
+
console.error("[KiteChat] Failed to mark active on panel reopen:", err);
|
|
1850
1918
|
}
|
|
1851
1919
|
);
|
|
1852
1920
|
}
|
|
1853
1921
|
}, [isOpen, isEscalated, sessionId]);
|
|
1922
|
+
React6.useEffect(() => {
|
|
1923
|
+
if (!sessionId || !effectiveSupabaseUrl || !effectiveSupabaseAnonKey) {
|
|
1924
|
+
console.log("[KiteChat] Session end handler skipped - missing:", {
|
|
1925
|
+
sessionId: !!sessionId,
|
|
1926
|
+
supabaseUrl: !!effectiveSupabaseUrl,
|
|
1927
|
+
supabaseKey: !!effectiveSupabaseAnonKey
|
|
1928
|
+
});
|
|
1929
|
+
return;
|
|
1930
|
+
}
|
|
1931
|
+
const currentSessionId = sessionId;
|
|
1932
|
+
const sbUrl = effectiveSupabaseUrl;
|
|
1933
|
+
const sbKey = effectiveSupabaseAnonKey;
|
|
1934
|
+
console.log("[KiteChat] Registering session end handler for session:", currentSessionId);
|
|
1935
|
+
const markSessionEnded = () => {
|
|
1936
|
+
console.log("[KiteChat] Marking session as ended:", currentSessionId);
|
|
1937
|
+
const sessionsUrl = `${sbUrl}/rest/v1/sessions?session_id=eq.${currentSessionId}`;
|
|
1938
|
+
fetch(sessionsUrl, {
|
|
1939
|
+
method: "PATCH",
|
|
1940
|
+
headers: {
|
|
1941
|
+
"Content-Type": "application/json",
|
|
1942
|
+
"apikey": sbKey,
|
|
1943
|
+
"Authorization": `Bearer ${sbKey}`,
|
|
1944
|
+
"Prefer": "return=minimal"
|
|
1945
|
+
},
|
|
1946
|
+
body: JSON.stringify({ session_status: "ended" }),
|
|
1947
|
+
keepalive: true
|
|
1948
|
+
}).catch(() => {
|
|
1949
|
+
});
|
|
1950
|
+
};
|
|
1951
|
+
window.addEventListener("beforeunload", markSessionEnded);
|
|
1952
|
+
return () => {
|
|
1953
|
+
console.log("[KiteChat] Component unmounting - marking session as ended:", currentSessionId);
|
|
1954
|
+
window.removeEventListener("beforeunload", markSessionEnded);
|
|
1955
|
+
markSessionEnded();
|
|
1956
|
+
};
|
|
1957
|
+
}, [sessionId, effectiveSupabaseUrl, effectiveSupabaseAnonKey]);
|
|
1854
1958
|
const heartbeatIntervalRef = React6.useRef(null);
|
|
1855
1959
|
const updateCustomerStatus = React6.useCallback(async (status) => {
|
|
1856
1960
|
if (!supabaseRef.current || !sessionId) return;
|
|
@@ -1881,8 +1985,21 @@ function ChatPanel({
|
|
|
1881
1985
|
(err) => console.error("[KiteChat] Failed to update customer status:", err)
|
|
1882
1986
|
);
|
|
1883
1987
|
};
|
|
1988
|
+
const markInactive = () => {
|
|
1989
|
+
supabase.from("escalations").update({
|
|
1990
|
+
customer_status: "inactive",
|
|
1991
|
+
customer_last_seen: (/* @__PURE__ */ new Date()).toISOString()
|
|
1992
|
+
}).eq("session_id", currentSessionId).then(
|
|
1993
|
+
() => console.log("[KiteChat] Marked inactive on tab hidden"),
|
|
1994
|
+
(err) => console.error("[KiteChat] Failed to mark inactive:", err)
|
|
1995
|
+
);
|
|
1996
|
+
};
|
|
1884
1997
|
const markDisconnectedWithKeepalive = () => {
|
|
1885
|
-
|
|
1998
|
+
console.log("[KiteChat] markDisconnectedWithKeepalive called for escalated session:", currentSessionId);
|
|
1999
|
+
if (!sbUrl || !sbKey) {
|
|
2000
|
+
console.log("[KiteChat] markDisconnectedWithKeepalive skipped - missing credentials");
|
|
2001
|
+
return;
|
|
2002
|
+
}
|
|
1886
2003
|
const url = `${sbUrl}/rest/v1/escalations?session_id=eq.${currentSessionId}`;
|
|
1887
2004
|
fetch(url, {
|
|
1888
2005
|
method: "PATCH",
|
|
@@ -1899,6 +2016,20 @@ function ChatPanel({
|
|
|
1899
2016
|
keepalive: true
|
|
1900
2017
|
}).catch(() => {
|
|
1901
2018
|
});
|
|
2019
|
+
console.log("[KiteChat] markDisconnectedWithKeepalive - also marking session as ended:", currentSessionId);
|
|
2020
|
+
const sessionsUrl = `${sbUrl}/rest/v1/sessions?session_id=eq.${currentSessionId}`;
|
|
2021
|
+
fetch(sessionsUrl, {
|
|
2022
|
+
method: "PATCH",
|
|
2023
|
+
headers: {
|
|
2024
|
+
"Content-Type": "application/json",
|
|
2025
|
+
"apikey": sbKey,
|
|
2026
|
+
"Authorization": `Bearer ${sbKey}`,
|
|
2027
|
+
"Prefer": "return=minimal"
|
|
2028
|
+
},
|
|
2029
|
+
body: JSON.stringify({ session_status: "ended" }),
|
|
2030
|
+
keepalive: true
|
|
2031
|
+
}).catch(() => {
|
|
2032
|
+
});
|
|
1902
2033
|
};
|
|
1903
2034
|
console.log("[KiteChat] Starting presence heartbeat for live chat");
|
|
1904
2035
|
markActive();
|
|
@@ -1911,6 +2042,8 @@ function ChatPanel({
|
|
|
1911
2042
|
const handleVisibilityChange = () => {
|
|
1912
2043
|
if (document.visibilityState === "visible") {
|
|
1913
2044
|
markActive();
|
|
2045
|
+
} else {
|
|
2046
|
+
markInactive();
|
|
1914
2047
|
}
|
|
1915
2048
|
};
|
|
1916
2049
|
window.addEventListener("beforeunload", handleBeforeUnload);
|
|
@@ -2673,7 +2806,7 @@ ${imageMarkdown}` : imageMarkdown;
|
|
|
2673
2806
|
body: JSON.stringify({
|
|
2674
2807
|
session_id: sessionId,
|
|
2675
2808
|
message: userText,
|
|
2676
|
-
current_page: currentPage || "dashboard",
|
|
2809
|
+
current_page: typeof window !== "undefined" ? window.location.href : currentPage || "dashboard",
|
|
2677
2810
|
user_id: userId,
|
|
2678
2811
|
org_id: orgId,
|
|
2679
2812
|
user_name: userName,
|
|
@@ -2870,6 +3003,7 @@ ${imageMarkdown}` : imageMarkdown;
|
|
|
2870
3003
|
setPhase("idle");
|
|
2871
3004
|
streamCompleted = true;
|
|
2872
3005
|
} else if (eventType === "escalation") {
|
|
3006
|
+
console.log("[KiteChat] SSE escalation event received (AI-triggered)");
|
|
2873
3007
|
setIsEscalated(true);
|
|
2874
3008
|
setPhase("idle");
|
|
2875
3009
|
const escalationMessageId = Date.now() + 2;
|
|
@@ -2942,7 +3076,7 @@ ${userText}`
|
|
|
2942
3076
|
formData.append("file", file);
|
|
2943
3077
|
formData.append("message", userText);
|
|
2944
3078
|
formData.append("session_id", sessionId);
|
|
2945
|
-
formData.append("current_page", currentPage || "dashboard");
|
|
3079
|
+
formData.append("current_page", typeof window !== "undefined" ? window.location.href : currentPage || "dashboard");
|
|
2946
3080
|
if (orgId) formData.append("org_id", orgId);
|
|
2947
3081
|
const controller = new AbortController();
|
|
2948
3082
|
const timeoutId = setTimeout(() => controller.abort(), 12e4);
|
|
@@ -3716,9 +3850,10 @@ ${userText}`
|
|
|
3716
3850
|
motion2.section,
|
|
3717
3851
|
{
|
|
3718
3852
|
drag: true,
|
|
3853
|
+
dragControls,
|
|
3854
|
+
dragListener: false,
|
|
3719
3855
|
dragMomentum: false,
|
|
3720
3856
|
dragElastic: 0,
|
|
3721
|
-
animate: dragControls,
|
|
3722
3857
|
onDragStart: () => setIsDragging(true),
|
|
3723
3858
|
onDragEnd: handleDragEnd,
|
|
3724
3859
|
className: `fixed bottom-4 z-40 flex flex-col bg-white border border-gray-200 rounded-2xl overflow-hidden shadow-2xl ${isDragging ? "cursor-grabbing" : ""} ${corner === "bottom-left" ? "left-4" : "right-4"} ${isOpen ? "opacity-100 scale-100" : "opacity-0 scale-95 pointer-events-none"}`,
|
|
@@ -3727,53 +3862,60 @@ ${userText}`
|
|
|
3727
3862
|
height: `${PANEL_HEIGHT}px`
|
|
3728
3863
|
},
|
|
3729
3864
|
children: [
|
|
3730
|
-
/* @__PURE__ */ jsxs6(
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
variant: "ghost",
|
|
3757
|
-
size: "sm",
|
|
3758
|
-
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
3759
|
-
onClick: () => {
|
|
3760
|
-
if (isEscalated) {
|
|
3761
|
-
resetSession();
|
|
3762
|
-
setMessages([]);
|
|
3763
|
-
setPanelView("landing");
|
|
3764
|
-
setCurrentFolderId(void 0);
|
|
3765
|
-
setActiveGuide(void 0);
|
|
3766
|
-
activeGuideRef.current = void 0;
|
|
3767
|
-
setGuideComplete(false);
|
|
3865
|
+
/* @__PURE__ */ jsxs6(
|
|
3866
|
+
"div",
|
|
3867
|
+
{
|
|
3868
|
+
className: "flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-gradient-to-r from-gray-50 to-white shrink-0 cursor-grab active:cursor-grabbing",
|
|
3869
|
+
onPointerDown: (e) => dragControls.start(e),
|
|
3870
|
+
children: [
|
|
3871
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-2.5", children: [
|
|
3872
|
+
/* @__PURE__ */ jsx10(Sparkles, { className: "h-3.5 w-3.5 text-black", fill: "currentColor" }),
|
|
3873
|
+
/* @__PURE__ */ jsx10("h3", { className: "text-sm font-semibold text-gray-800", children: "Copilot" })
|
|
3874
|
+
] }),
|
|
3875
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-1", children: [
|
|
3876
|
+
/* @__PURE__ */ jsx10(
|
|
3877
|
+
Button,
|
|
3878
|
+
{
|
|
3879
|
+
variant: "ghost",
|
|
3880
|
+
size: "sm",
|
|
3881
|
+
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
3882
|
+
onClick: () => {
|
|
3883
|
+
setMessages([]);
|
|
3884
|
+
resetSession();
|
|
3885
|
+
setCurrentFolderId(void 0);
|
|
3886
|
+
setActiveGuide(void 0);
|
|
3887
|
+
activeGuideRef.current = void 0;
|
|
3888
|
+
setGuideComplete(false);
|
|
3889
|
+
},
|
|
3890
|
+
children: /* @__PURE__ */ jsx10(SquarePen, { className: "h-3 w-3" })
|
|
3768
3891
|
}
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3892
|
+
),
|
|
3893
|
+
/* @__PURE__ */ jsx10(
|
|
3894
|
+
Button,
|
|
3895
|
+
{
|
|
3896
|
+
variant: "ghost",
|
|
3897
|
+
size: "sm",
|
|
3898
|
+
className: "h-7 w-7 p-0 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-full",
|
|
3899
|
+
onClick: () => {
|
|
3900
|
+
if (isEscalated) {
|
|
3901
|
+
resetSession();
|
|
3902
|
+
setMessages([]);
|
|
3903
|
+
setPanelView("landing");
|
|
3904
|
+
setCurrentFolderId(void 0);
|
|
3905
|
+
setActiveGuide(void 0);
|
|
3906
|
+
activeGuideRef.current = void 0;
|
|
3907
|
+
setGuideComplete(false);
|
|
3908
|
+
}
|
|
3909
|
+
onClose?.();
|
|
3910
|
+
},
|
|
3911
|
+
children: /* @__PURE__ */ jsx10(Minus, { className: "h-3.5 w-3.5" })
|
|
3912
|
+
}
|
|
3913
|
+
)
|
|
3914
|
+
] })
|
|
3915
|
+
]
|
|
3916
|
+
}
|
|
3917
|
+
),
|
|
3918
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 flex flex-col min-h-0 overflow-hidden relative select-text", children: [
|
|
3777
3919
|
/* @__PURE__ */ jsx10(
|
|
3778
3920
|
"div",
|
|
3779
3921
|
{
|
|
@@ -3893,8 +4035,8 @@ ${userText}`
|
|
|
3893
4035
|
}
|
|
3894
4036
|
const agentImageUrls = message.imageUrls || extractedImageUrls;
|
|
3895
4037
|
const agentTextContent = contentStr.replace(/!\[image\]\([^)]+\)\n*/g, "").trim();
|
|
3896
|
-
return /* @__PURE__ */ jsxs6("div", { className: `flex flex-col items-start
|
|
3897
|
-
isRoleChange && /* @__PURE__ */ jsx10("span", { className: "text-[10px] text-gray-500 mb-
|
|
4038
|
+
return /* @__PURE__ */ jsxs6("div", { className: `flex flex-col items-start ${isRoleChange ? "mt-2" : ""}`, children: [
|
|
4039
|
+
isRoleChange && /* @__PURE__ */ jsx10("span", { className: "text-[10px] text-gray-500 mb-0.5 ml-1", children: "Agent" }),
|
|
3898
4040
|
agentImageUrls.length > 0 && /* @__PURE__ */ jsx10("div", { className: "flex flex-wrap gap-1 justify-start max-w-[300px]", children: agentImageUrls.map((url, imgIndex) => /* @__PURE__ */ jsx10(
|
|
3899
4041
|
"button",
|
|
3900
4042
|
{
|
|
@@ -94,6 +94,10 @@ interface ChatPanelProps {
|
|
|
94
94
|
onBack?: () => void;
|
|
95
95
|
onNavigate?: (page: Page, subtab?: SettingsTab) => void;
|
|
96
96
|
onActionComplete?: (actionType: ActionType, data: ActionData) => void;
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
99
|
+
* This prop is no longer needed and will be ignored.
|
|
100
|
+
*/
|
|
97
101
|
currentPage?: Page;
|
|
98
102
|
agentUrl?: string;
|
|
99
103
|
/** Custom starting questions (fetched per-user from backend) */
|
|
@@ -158,6 +162,10 @@ declare function PanelToggle({ isOpen, onClick, className, }: PanelToggleProps):
|
|
|
158
162
|
interface ChatPanelWithToggleProps {
|
|
159
163
|
onNavigate?: (page: Page, subtab?: SettingsTab) => void;
|
|
160
164
|
onActionComplete?: (actionType: ActionType, data: ActionData) => void;
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
167
|
+
* This prop is no longer needed and will be ignored.
|
|
168
|
+
*/
|
|
161
169
|
currentPage?: Page;
|
|
162
170
|
agentUrl?: string;
|
|
163
171
|
startingQuestions?: StartingQuestion[];
|
|
@@ -239,7 +247,10 @@ interface KiteChatConfig {
|
|
|
239
247
|
orgId?: string;
|
|
240
248
|
/** Backend agent API URL (defaults to http://localhost:5002) */
|
|
241
249
|
agentUrl?: string;
|
|
242
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
252
|
+
* This prop is no longer needed and will be ignored.
|
|
253
|
+
*/
|
|
243
254
|
currentPage?: string;
|
|
244
255
|
/** Theme mode */
|
|
245
256
|
theme?: 'light' | 'dark' | 'system';
|
|
@@ -280,7 +291,10 @@ interface KiteChatInstance {
|
|
|
280
291
|
toggle: () => void;
|
|
281
292
|
/** Check if the panel is open */
|
|
282
293
|
isOpen: () => boolean;
|
|
283
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
296
|
+
* This method is no longer needed and will be ignored.
|
|
297
|
+
*/
|
|
284
298
|
setCurrentPage: (page: string) => void;
|
|
285
299
|
/** Update configuration (userId, callbacks, etc.) */
|
|
286
300
|
updateConfig: (config: Partial<KiteChatConfig>) => void;
|
|
@@ -94,6 +94,10 @@ interface ChatPanelProps {
|
|
|
94
94
|
onBack?: () => void;
|
|
95
95
|
onNavigate?: (page: Page, subtab?: SettingsTab) => void;
|
|
96
96
|
onActionComplete?: (actionType: ActionType, data: ActionData) => void;
|
|
97
|
+
/**
|
|
98
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
99
|
+
* This prop is no longer needed and will be ignored.
|
|
100
|
+
*/
|
|
97
101
|
currentPage?: Page;
|
|
98
102
|
agentUrl?: string;
|
|
99
103
|
/** Custom starting questions (fetched per-user from backend) */
|
|
@@ -158,6 +162,10 @@ declare function PanelToggle({ isOpen, onClick, className, }: PanelToggleProps):
|
|
|
158
162
|
interface ChatPanelWithToggleProps {
|
|
159
163
|
onNavigate?: (page: Page, subtab?: SettingsTab) => void;
|
|
160
164
|
onActionComplete?: (actionType: ActionType, data: ActionData) => void;
|
|
165
|
+
/**
|
|
166
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
167
|
+
* This prop is no longer needed and will be ignored.
|
|
168
|
+
*/
|
|
161
169
|
currentPage?: Page;
|
|
162
170
|
agentUrl?: string;
|
|
163
171
|
startingQuestions?: StartingQuestion[];
|
|
@@ -239,7 +247,10 @@ interface KiteChatConfig {
|
|
|
239
247
|
orgId?: string;
|
|
240
248
|
/** Backend agent API URL (defaults to http://localhost:5002) */
|
|
241
249
|
agentUrl?: string;
|
|
242
|
-
/**
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
252
|
+
* This prop is no longer needed and will be ignored.
|
|
253
|
+
*/
|
|
243
254
|
currentPage?: string;
|
|
244
255
|
/** Theme mode */
|
|
245
256
|
theme?: 'light' | 'dark' | 'system';
|
|
@@ -280,7 +291,10 @@ interface KiteChatInstance {
|
|
|
280
291
|
toggle: () => void;
|
|
281
292
|
/** Check if the panel is open */
|
|
282
293
|
isOpen: () => boolean;
|
|
283
|
-
/**
|
|
294
|
+
/**
|
|
295
|
+
* @deprecated The chat panel now automatically captures the browser URL (window.location.href).
|
|
296
|
+
* This method is no longer needed and will be ignored.
|
|
297
|
+
*/
|
|
284
298
|
setCurrentPage: (page: string) => void;
|
|
285
299
|
/** Update configuration (userId, callbacks, etc.) */
|
|
286
300
|
updateConfig: (config: Partial<KiteChatConfig>) => void;
|