@kite-copilot/chat-panel 0.2.19 → 0.2.21

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
@@ -935,7 +935,7 @@ function renderMarkdown(text) {
935
935
  "a",
936
936
  {
937
937
  href: linkMatch[2],
938
- className: "text-blue-600 hover:underline",
938
+ className: "kite-link",
939
939
  target: "_blank",
940
940
  rel: "noopener noreferrer",
941
941
  children: linkMatch[1]
@@ -946,7 +946,44 @@ function renderMarkdown(text) {
946
946
  remaining = remaining.slice(linkMatch[0].length);
947
947
  continue;
948
948
  }
949
- const nextSpecial = remaining.search(/[`*\[]/);
949
+ const urlMatch = remaining.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);
950
+ if (urlMatch) {
951
+ const url = urlMatch[1];
952
+ const href = url.startsWith("www.") ? `https://${url}` : url;
953
+ parts.push(
954
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
955
+ "a",
956
+ {
957
+ href,
958
+ className: "kite-link",
959
+ target: "_blank",
960
+ rel: "noopener noreferrer",
961
+ children: url
962
+ },
963
+ keyIndex++
964
+ )
965
+ );
966
+ remaining = remaining.slice(url.length);
967
+ continue;
968
+ }
969
+ const emailMatch = remaining.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);
970
+ if (emailMatch) {
971
+ const email = emailMatch[1];
972
+ parts.push(
973
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
974
+ "a",
975
+ {
976
+ href: `mailto:${email}`,
977
+ className: "kite-link",
978
+ children: email
979
+ },
980
+ keyIndex++
981
+ )
982
+ );
983
+ remaining = remaining.slice(email.length);
984
+ continue;
985
+ }
986
+ const nextSpecial = remaining.search(/[`*\[@h]/);
950
987
  if (nextSpecial === -1) {
951
988
  parts.push(remaining);
952
989
  break;
@@ -2602,7 +2639,7 @@ ${userText}`
2602
2639
  }
2603
2640
  }
2604
2641
  if (!isOpen) {
2605
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-3 rounded-xl bg-white border border-gray-200 shadow-lg px-4 py-3 hover:shadow-xl transition-all duration-300 ease-out ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
2642
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3 w-full", children: [
2606
2643
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
2607
2644
  "button",
2608
2645
  {
package/dist/auto.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createKiteChat
3
- } from "./chunk-5SGUG45C.js";
3
+ } from "./chunk-OQCVEXPE.js";
4
4
 
5
5
  // src/auto.ts
6
6
  function mountKiteChat(config) {
@@ -934,7 +934,7 @@ function renderMarkdown(text) {
934
934
  "a",
935
935
  {
936
936
  href: linkMatch[2],
937
- className: "text-blue-600 hover:underline",
937
+ className: "kite-link",
938
938
  target: "_blank",
939
939
  rel: "noopener noreferrer",
940
940
  children: linkMatch[1]
@@ -945,7 +945,44 @@ function renderMarkdown(text) {
945
945
  remaining = remaining.slice(linkMatch[0].length);
946
946
  continue;
947
947
  }
948
- const nextSpecial = remaining.search(/[`*\[]/);
948
+ const urlMatch = remaining.match(/^(https?:\/\/[^\s<>]+|www\.[^\s<>]+)/);
949
+ if (urlMatch) {
950
+ const url = urlMatch[1];
951
+ const href = url.startsWith("www.") ? `https://${url}` : url;
952
+ parts.push(
953
+ /* @__PURE__ */ jsx9(
954
+ "a",
955
+ {
956
+ href,
957
+ className: "kite-link",
958
+ target: "_blank",
959
+ rel: "noopener noreferrer",
960
+ children: url
961
+ },
962
+ keyIndex++
963
+ )
964
+ );
965
+ remaining = remaining.slice(url.length);
966
+ continue;
967
+ }
968
+ const emailMatch = remaining.match(/^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/);
969
+ if (emailMatch) {
970
+ const email = emailMatch[1];
971
+ parts.push(
972
+ /* @__PURE__ */ jsx9(
973
+ "a",
974
+ {
975
+ href: `mailto:${email}`,
976
+ className: "kite-link",
977
+ children: email
978
+ },
979
+ keyIndex++
980
+ )
981
+ );
982
+ remaining = remaining.slice(email.length);
983
+ continue;
984
+ }
985
+ const nextSpecial = remaining.search(/[`*\[@h]/);
949
986
  if (nextSpecial === -1) {
950
987
  parts.push(remaining);
951
988
  break;
@@ -2601,7 +2638,7 @@ ${userText}`
2601
2638
  }
2602
2639
  }
2603
2640
  if (!isOpen) {
2604
- return /* @__PURE__ */ jsx9("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ jsx9("div", { className: `flex items-center gap-3 rounded-xl bg-white border border-gray-200 shadow-lg px-4 py-3 hover:shadow-xl transition-all duration-300 ease-out ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3 w-full", children: [
2641
+ return /* @__PURE__ */ jsx9("div", { className: "fixed bottom-6 left-1/2 -translate-x-1/2 z-50", children: /* @__PURE__ */ jsx9("div", { className: `flex items-center gap-3 rounded-2xl bg-white border border-gray-200 shadow-lg px-4 py-2 hover:shadow-xl transition-all duration-300 ease-out focus-within:border-gray-700 ${searchExpanded ? "w-[480px]" : "w-[320px]"}`, children: !searchExpanded ? /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-3 w-full", children: [
2605
2642
  /* @__PURE__ */ jsxs5(
2606
2643
  "button",
2607
2644
  {