@kite-copilot/chat-panel 0.2.36 → 0.2.38
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/auto.cjs +19 -2
- package/dist/auto.js +1 -1
- package/dist/{chunk-GUAWNSRO.js → chunk-QSVOPKVC.js} +19 -2
- package/dist/embed.global.js +15 -15
- package/dist/index.cjs +19 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -969,6 +969,7 @@ function TypingIndicator({ className = "" }) {
|
|
|
969
969
|
|
|
970
970
|
// src/ChatPanel.tsx
|
|
971
971
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
972
|
+
var CHAT_PANEL_VERSION = true ? "0.2.38" : "dev";
|
|
972
973
|
var DEFAULT_AGENT_URL = "http://localhost:5002";
|
|
973
974
|
var PANEL_WIDTH = 340;
|
|
974
975
|
function unescapeJsonString(str) {
|
|
@@ -1414,6 +1415,9 @@ function ChatPanel({
|
|
|
1414
1415
|
const supabaseRef = React4.useRef(null);
|
|
1415
1416
|
const typingChannelRef = React4.useRef(null);
|
|
1416
1417
|
const typingTimeoutRef = React4.useRef(null);
|
|
1418
|
+
React4.useEffect(() => {
|
|
1419
|
+
console.log(`[KiteChat] Chat Panel v${CHAT_PANEL_VERSION} loaded`);
|
|
1420
|
+
}, []);
|
|
1417
1421
|
const resetSession = React4.useCallback(() => {
|
|
1418
1422
|
if (isEscalated && supabaseRef.current && sessionId) {
|
|
1419
1423
|
supabaseRef.current.from("escalations").update({
|
|
@@ -1444,9 +1448,12 @@ function ChatPanel({
|
|
|
1444
1448
|
}
|
|
1445
1449
|
const channelName = `typing:${sessionId}`;
|
|
1446
1450
|
const channel = supabaseRef.current.channel(channelName);
|
|
1451
|
+
console.log(`[KiteChat] Subscribing to typing channel: ${channelName}`);
|
|
1447
1452
|
channel.on("broadcast", { event: "typing" }, (payload) => {
|
|
1453
|
+
console.log("[KiteChat] Received typing broadcast:", payload);
|
|
1448
1454
|
const { sender, isTyping } = payload.payload;
|
|
1449
1455
|
if (sender === "agent") {
|
|
1456
|
+
console.log(`[KiteChat] Agent typing: ${isTyping}`);
|
|
1450
1457
|
setAgentIsTyping(isTyping);
|
|
1451
1458
|
if (isTyping) {
|
|
1452
1459
|
if (typingTimeoutRef.current) {
|
|
@@ -1458,8 +1465,10 @@ function ChatPanel({
|
|
|
1458
1465
|
}
|
|
1459
1466
|
}
|
|
1460
1467
|
}).subscribe((status) => {
|
|
1468
|
+
console.log(`[KiteChat] Typing channel status: ${status}`);
|
|
1461
1469
|
if (status === "SUBSCRIBED") {
|
|
1462
1470
|
typingChannelRef.current = channel;
|
|
1471
|
+
console.log("[KiteChat] Typing channel ready");
|
|
1463
1472
|
}
|
|
1464
1473
|
});
|
|
1465
1474
|
return () => {
|
|
@@ -1531,7 +1540,15 @@ function ChatPanel({
|
|
|
1531
1540
|
};
|
|
1532
1541
|
}, [isEscalated, sessionId, updateCustomerStatus]);
|
|
1533
1542
|
const sendTypingIndicator = React4.useCallback((isTyping) => {
|
|
1534
|
-
if (!typingChannelRef.current
|
|
1543
|
+
if (!typingChannelRef.current) {
|
|
1544
|
+
console.log("[KiteChat] Cannot send typing - channel not ready");
|
|
1545
|
+
return;
|
|
1546
|
+
}
|
|
1547
|
+
if (!isEscalated) {
|
|
1548
|
+
console.log("[KiteChat] Cannot send typing - not escalated");
|
|
1549
|
+
return;
|
|
1550
|
+
}
|
|
1551
|
+
console.log(`[KiteChat] Sending typing indicator: ${isTyping}`);
|
|
1535
1552
|
typingChannelRef.current.send({
|
|
1536
1553
|
type: "broadcast",
|
|
1537
1554
|
event: "typing",
|
|
@@ -4255,7 +4272,7 @@ ${userText}`
|
|
|
4255
4272
|
progressSteps
|
|
4256
4273
|
}
|
|
4257
4274
|
) }),
|
|
4258
|
-
isEscalated && agentIsTyping &&
|
|
4275
|
+
isEscalated && agentIsTyping && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
|
|
4259
4276
|
!activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
|
|
4260
4277
|
] }) }) }) })
|
|
4261
4278
|
}
|
package/dist/index.js
CHANGED