@eshal-bot/chat-widget 0.1.114 → 0.1.115

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.
@@ -1 +1 @@
1
- export{S as default}from"./chat-widget-index-DngtpZEU.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
1
+ export{S as default}from"./chat-widget-index-DryngjDK.esm.js";import"react";import"react-dom/client";import"react-dom";import"react/jsx-runtime";
@@ -12051,7 +12051,7 @@
12051
12051
  * See the LICENSE file in the root directory of this source tree.
12052
12052
  */
12053
12053
 
12054
- const __iconNode$i = [["path", {
12054
+ const __iconNode$j = [["path", {
12055
12055
  d: "M2 10v3",
12056
12056
  key: "1fnikh"
12057
12057
  }], ["path", {
@@ -12070,7 +12070,20 @@
12070
12070
  d: "M22 10v3",
12071
12071
  key: "154ddg"
12072
12072
  }]];
12073
- const AudioLines = createLucideIcon("audio-lines", __iconNode$i);
12073
+ const AudioLines = createLucideIcon("audio-lines", __iconNode$j);
12074
+
12075
+ /**
12076
+ * @license lucide-react v0.575.0 - ISC
12077
+ *
12078
+ * This source code is licensed under the ISC license.
12079
+ * See the LICENSE file in the root directory of this source tree.
12080
+ */
12081
+
12082
+ const __iconNode$i = [["path", {
12083
+ d: "M20 6 9 17l-5-5",
12084
+ key: "1gmf2c"
12085
+ }]];
12086
+ const Check = createLucideIcon("check", __iconNode$i);
12074
12087
 
12075
12088
  /**
12076
12089
  * @license lucide-react v0.575.0 - ISC
@@ -15070,7 +15083,46 @@
15070
15083
  downloadingKey
15071
15084
  };
15072
15085
  }
15073
- const AssistantMessage = _ref8 => {
15086
+
15087
+ // EV-2719: per-message copy, alongside the header's existing whole-chat
15088
+ // "Copy Chat" action. Styled to match the thumbs up/down buttons below
15089
+ // (same size/color classes) and always visible rather than hover-only -
15090
+ // this widget runs on customer sites where touch devices with no hover
15091
+ // state are common, unlike the desktop-first admin Inbox.
15092
+ function CopyMessageButton(_ref8) {
15093
+ let {
15094
+ content,
15095
+ isDark
15096
+ } = _ref8;
15097
+ const [copied, setCopied] = reactExports.useState(false);
15098
+ const handleCopy = reactExports.useCallback(() => {
15099
+ var _navigator$clipboard;
15100
+ if (!content) return;
15101
+ (_navigator$clipboard = navigator.clipboard) === null || _navigator$clipboard === void 0 || _navigator$clipboard.writeText(content).catch(() => {});
15102
+ setCopied(true);
15103
+ setTimeout(() => setCopied(false), 1500);
15104
+ }, [content]);
15105
+ return /*#__PURE__*/jsxRuntimeExports.jsx("button", {
15106
+ type: "button",
15107
+ onClick: handleCopy,
15108
+ className: "p-0.5 rounded transition-colors ".concat(isDark ? "text-gray-500 hover:text-gray-300" : "text-gray-400 hover:text-gray-600"),
15109
+ style: {
15110
+ border: "none",
15111
+ background: "transparent",
15112
+ appearance: "none",
15113
+ WebkitAppearance: "none",
15114
+ cursor: "pointer"
15115
+ },
15116
+ "aria-label": copied ? "Copied" : "Copy message",
15117
+ title: copied ? "Copied" : "Copy message",
15118
+ children: copied ? /*#__PURE__*/jsxRuntimeExports.jsx(Check, {
15119
+ className: "w-3 h-3 text-green-500"
15120
+ }) : /*#__PURE__*/jsxRuntimeExports.jsx(Copy, {
15121
+ className: "w-3 h-3"
15122
+ })
15123
+ });
15124
+ }
15125
+ const AssistantMessage = _ref9 => {
15074
15126
  let {
15075
15127
  message,
15076
15128
  formatTime,
@@ -15096,7 +15148,7 @@
15096
15148
  provideCitations = true,
15097
15149
  onFeedback,
15098
15150
  headerTextColor
15099
- } = _ref8;
15151
+ } = _ref9;
15100
15152
  const rawContent = typeof message.content === "string" ? message.content : "";
15101
15153
  // 2026-07-14 - `[N]` markers are preserved verbatim in `displayContent`
15102
15154
  // so the ReactMarkdown pipeline's `rehypeCitations` plugin can spot
@@ -15319,6 +15371,9 @@
15319
15371
  className: "text-xs leading-none ".concat(isDark ? "text-gray-400" : "text-gray-500"),
15320
15372
  dir: "auto",
15321
15373
  children: formatTime(message.timestamp)
15374
+ }), !isTypingMessage && !message.isProcessing && displayContent && /*#__PURE__*/jsxRuntimeExports.jsx(CopyMessageButton, {
15375
+ content: displayContent,
15376
+ isDark: isDark
15322
15377
  }), allowFeedback !== false && onFeedback && !isTypingMessage && !message.isProcessing && displayContent && message.type !== 'welcome' && !message.isWelcome && /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
15323
15378
  className: "flex items-center gap-0.5 ml-0.5",
15324
15379
  children: [/*#__PURE__*/jsxRuntimeExports.jsx("button", {
@@ -15408,7 +15463,7 @@
15408
15463
  })
15409
15464
  );
15410
15465
  };
15411
- const UserMessage = _ref9 => {
15466
+ const UserMessage = _ref0 => {
15412
15467
  let {
15413
15468
  message,
15414
15469
  formatTime,
@@ -15423,7 +15478,7 @@
15423
15478
  fontSize,
15424
15479
  isDark,
15425
15480
  isRtl
15426
- } = _ref9;
15481
+ } = _ref0;
15427
15482
  const primary = resolvedUserMessageColor !== undefined && resolvedUserMessageColor !== null ? resolvedUserMessageColor : userMessageBoxColor !== undefined && userMessageBoxColor !== null ? userMessageBoxColor : primaryColor !== undefined && primaryColor !== null ? primaryColor : "#2563eb";
15428
15483
  const messageTextColor = userTextColor !== undefined && userTextColor !== null ? userTextColor : textColor !== undefined && textColor !== null ? textColor : "#FFFFFF";
15429
15484
  const messageFontFamily = userMessageBubbleFontFamily !== undefined && userMessageBubbleFontFamily !== null ? userMessageBubbleFontFamily : fontFamily !== undefined && fontFamily !== null ? fontFamily : "Inter";
@@ -15513,15 +15568,21 @@
15513
15568
  },
15514
15569
  children: message.content
15515
15570
  })
15516
- }), /*#__PURE__*/jsxRuntimeExports.jsx("p", {
15517
- className: "text-xs mt-1.5 px-1 ".concat(isDark ? "text-gray-400" : "text-gray-500"),
15518
- dir: "auto",
15519
- children: formatTime(message.timestamp)
15571
+ }), /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
15572
+ className: "flex items-center gap-1.5 mt-1.5 px-1",
15573
+ children: [/*#__PURE__*/jsxRuntimeExports.jsx("p", {
15574
+ className: "text-xs leading-none ".concat(isDark ? "text-gray-400" : "text-gray-500"),
15575
+ dir: "auto",
15576
+ children: formatTime(message.timestamp)
15577
+ }), message.content && message.content.trim() !== "" && /*#__PURE__*/jsxRuntimeExports.jsx(CopyMessageButton, {
15578
+ content: message.content,
15579
+ isDark: isDark
15580
+ })]
15520
15581
  })]
15521
15582
  })
15522
15583
  });
15523
15584
  };
15524
- const MessageBubble = _ref0 => {
15585
+ const MessageBubble = _ref1 => {
15525
15586
  let {
15526
15587
  message,
15527
15588
  isDark,
@@ -15552,7 +15613,7 @@
15552
15613
  provideCitations,
15553
15614
  onFeedback,
15554
15615
  headerTextColor
15555
- } = _ref0;
15616
+ } = _ref1;
15556
15617
  if (!message) {
15557
15618
  return null;
15558
15619
  }