@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 CHANGED
@@ -915,6 +915,7 @@ function TypingIndicator({ className = "" }) {
915
915
 
916
916
  // src/ChatPanel.tsx
917
917
  var import_jsx_runtime10 = require("react/jsx-runtime");
918
+ var CHAT_PANEL_VERSION = true ? "0.2.38" : "dev";
918
919
  var DEFAULT_AGENT_URL = "http://localhost:5002";
919
920
  var PANEL_WIDTH = 340;
920
921
  function unescapeJsonString(str) {
@@ -1360,6 +1361,9 @@ function ChatPanel({
1360
1361
  const supabaseRef = React4.useRef(null);
1361
1362
  const typingChannelRef = React4.useRef(null);
1362
1363
  const typingTimeoutRef = React4.useRef(null);
1364
+ React4.useEffect(() => {
1365
+ console.log(`[KiteChat] Chat Panel v${CHAT_PANEL_VERSION} loaded`);
1366
+ }, []);
1363
1367
  const resetSession = React4.useCallback(() => {
1364
1368
  if (isEscalated && supabaseRef.current && sessionId) {
1365
1369
  supabaseRef.current.from("escalations").update({
@@ -1390,9 +1394,12 @@ function ChatPanel({
1390
1394
  }
1391
1395
  const channelName = `typing:${sessionId}`;
1392
1396
  const channel = supabaseRef.current.channel(channelName);
1397
+ console.log(`[KiteChat] Subscribing to typing channel: ${channelName}`);
1393
1398
  channel.on("broadcast", { event: "typing" }, (payload) => {
1399
+ console.log("[KiteChat] Received typing broadcast:", payload);
1394
1400
  const { sender, isTyping } = payload.payload;
1395
1401
  if (sender === "agent") {
1402
+ console.log(`[KiteChat] Agent typing: ${isTyping}`);
1396
1403
  setAgentIsTyping(isTyping);
1397
1404
  if (isTyping) {
1398
1405
  if (typingTimeoutRef.current) {
@@ -1404,8 +1411,10 @@ function ChatPanel({
1404
1411
  }
1405
1412
  }
1406
1413
  }).subscribe((status) => {
1414
+ console.log(`[KiteChat] Typing channel status: ${status}`);
1407
1415
  if (status === "SUBSCRIBED") {
1408
1416
  typingChannelRef.current = channel;
1417
+ console.log("[KiteChat] Typing channel ready");
1409
1418
  }
1410
1419
  });
1411
1420
  return () => {
@@ -1477,7 +1486,15 @@ function ChatPanel({
1477
1486
  };
1478
1487
  }, [isEscalated, sessionId, updateCustomerStatus]);
1479
1488
  const sendTypingIndicator = React4.useCallback((isTyping) => {
1480
- if (!typingChannelRef.current || !isEscalated) return;
1489
+ if (!typingChannelRef.current) {
1490
+ console.log("[KiteChat] Cannot send typing - channel not ready");
1491
+ return;
1492
+ }
1493
+ if (!isEscalated) {
1494
+ console.log("[KiteChat] Cannot send typing - not escalated");
1495
+ return;
1496
+ }
1497
+ console.log(`[KiteChat] Sending typing indicator: ${isTyping}`);
1481
1498
  typingChannelRef.current.send({
1482
1499
  type: "broadcast",
1483
1500
  event: "typing",
@@ -4201,7 +4218,7 @@ ${userText}`
4201
4218
  progressSteps
4202
4219
  }
4203
4220
  ) }),
4204
- isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
4221
+ isEscalated && agentIsTyping && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "mt-2", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypingIndicator, {}) }),
4205
4222
  !activeGuide && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { ref: messagesEndRef })
4206
4223
  ] }) }) }) })
4207
4224
  }
package/dist/auto.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createKiteChat
3
- } from "./chunk-GUAWNSRO.js";
3
+ } from "./chunk-QSVOPKVC.js";
4
4
 
5
5
  // src/auto.ts
6
6
  function mountKiteChat(config) {
@@ -916,6 +916,7 @@ function TypingIndicator({ className = "" }) {
916
916
 
917
917
  // src/ChatPanel.tsx
918
918
  import { Fragment as Fragment2, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
919
+ var CHAT_PANEL_VERSION = true ? "0.2.38" : "dev";
919
920
  var DEFAULT_AGENT_URL = "http://localhost:5002";
920
921
  var PANEL_WIDTH = 340;
921
922
  function unescapeJsonString(str) {
@@ -1361,6 +1362,9 @@ function ChatPanel({
1361
1362
  const supabaseRef = React4.useRef(null);
1362
1363
  const typingChannelRef = React4.useRef(null);
1363
1364
  const typingTimeoutRef = React4.useRef(null);
1365
+ React4.useEffect(() => {
1366
+ console.log(`[KiteChat] Chat Panel v${CHAT_PANEL_VERSION} loaded`);
1367
+ }, []);
1364
1368
  const resetSession = React4.useCallback(() => {
1365
1369
  if (isEscalated && supabaseRef.current && sessionId) {
1366
1370
  supabaseRef.current.from("escalations").update({
@@ -1391,9 +1395,12 @@ function ChatPanel({
1391
1395
  }
1392
1396
  const channelName = `typing:${sessionId}`;
1393
1397
  const channel = supabaseRef.current.channel(channelName);
1398
+ console.log(`[KiteChat] Subscribing to typing channel: ${channelName}`);
1394
1399
  channel.on("broadcast", { event: "typing" }, (payload) => {
1400
+ console.log("[KiteChat] Received typing broadcast:", payload);
1395
1401
  const { sender, isTyping } = payload.payload;
1396
1402
  if (sender === "agent") {
1403
+ console.log(`[KiteChat] Agent typing: ${isTyping}`);
1397
1404
  setAgentIsTyping(isTyping);
1398
1405
  if (isTyping) {
1399
1406
  if (typingTimeoutRef.current) {
@@ -1405,8 +1412,10 @@ function ChatPanel({
1405
1412
  }
1406
1413
  }
1407
1414
  }).subscribe((status) => {
1415
+ console.log(`[KiteChat] Typing channel status: ${status}`);
1408
1416
  if (status === "SUBSCRIBED") {
1409
1417
  typingChannelRef.current = channel;
1418
+ console.log("[KiteChat] Typing channel ready");
1410
1419
  }
1411
1420
  });
1412
1421
  return () => {
@@ -1478,7 +1487,15 @@ function ChatPanel({
1478
1487
  };
1479
1488
  }, [isEscalated, sessionId, updateCustomerStatus]);
1480
1489
  const sendTypingIndicator = React4.useCallback((isTyping) => {
1481
- if (!typingChannelRef.current || !isEscalated) return;
1490
+ if (!typingChannelRef.current) {
1491
+ console.log("[KiteChat] Cannot send typing - channel not ready");
1492
+ return;
1493
+ }
1494
+ if (!isEscalated) {
1495
+ console.log("[KiteChat] Cannot send typing - not escalated");
1496
+ return;
1497
+ }
1498
+ console.log(`[KiteChat] Sending typing indicator: ${isTyping}`);
1482
1499
  typingChannelRef.current.send({
1483
1500
  type: "broadcast",
1484
1501
  event: "typing",
@@ -4202,7 +4219,7 @@ ${userText}`
4202
4219
  progressSteps
4203
4220
  }
4204
4221
  ) }),
4205
- isEscalated && agentIsTyping && phase === "idle" && /* @__PURE__ */ jsx10("div", { className: "mt-2", children: /* @__PURE__ */ jsx10(TypingIndicator, {}) }),
4222
+ isEscalated && agentIsTyping && /* @__PURE__ */ jsx10("div", { className: "mt-2", children: /* @__PURE__ */ jsx10(TypingIndicator, {}) }),
4206
4223
  !activeGuide && /* @__PURE__ */ jsx10("div", { ref: messagesEndRef })
4207
4224
  ] }) }) }) })
4208
4225
  }