@cntyclub/agent-react 0.14.2 → 0.14.4

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
- {"version":3,"file":"message-item.d.ts","sourceRoot":"","sources":["../../src/components/message-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,4BAmEjE"}
1
+ {"version":3,"file":"message-item.d.ts","sourceRoot":"","sources":["../../src/components/message-item.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,YAAY,CAAA;CAAE,4BAsGjE"}
@@ -7,8 +7,8 @@ export interface ThinkingIndicatorProps {
7
7
  className?: string;
8
8
  }
9
9
  /**
10
- * A muted "typing" bubble: three bouncing dots plus a phrase that rotates every
11
- * ~1.8s, so a long tool run reads as active progress instead of a frozen "…".
10
+ * A muted "typing" bubble: a spinning gradient ring plus a phrase that rotates
11
+ * every ~1.8s, so a long tool run reads as active progress instead of a frozen "…".
12
12
  */
13
13
  export declare function ThinkingIndicator({ className, intervalMs, phrases }: ThinkingIndicatorProps): React.JSX.Element;
14
14
  //# sourceMappingURL=thinking-indicator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-indicator.d.ts","sourceRoot":"","sources":["../../src/components/thinking-indicator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,UAAiB,EAAE,OAAO,EAAE,EAAE,sBAAsB,qBAqClG"}
1
+ {"version":3,"file":"thinking-indicator.d.ts","sourceRoot":"","sources":["../../src/components/thinking-indicator.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,UAAiB,EAAE,OAAO,EAAE,EAAE,sBAAsB,qBA8ClG"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cn, Button, Tooltip, TooltipTrigger, TooltipContent, ChatMessage, ChatMessageBubble, Markdown, Spinner, Checkbox, Collapsible, CollapsibleTrigger, ChatToolChip, CollapsiblePanel, ChatToolCard, ChatToolCardHeader, ChatToolCardActions, Group, Menu, MenuTrigger, MenuPopup, MenuItem, ChatHeader, ChatHeaderAvatar, ChatHeaderTitle, ChatHeaderActions, Chat, ChatEmptyState, ChatEmptyStateIcon, ChatEmptyStateTitle, ChatEmptyStateDescription, ChatSuggestions, ChatSuggestion, useMediaQuery, TooltipProvider, DataTablePaged } from '@cntyclub/ui-react';
1
+ import { cn, Button, Tooltip, TooltipTrigger, TooltipContent, ChatMessage, ChatMessageBubble, Markdown, AuroraText, Spinner, Checkbox, Collapsible, CollapsibleTrigger, ChatToolChip, CollapsiblePanel, ChatToolCard, ChatToolCardHeader, ChatToolCardActions, Group, Menu, MenuTrigger, MenuPopup, MenuItem, ChatHeader, ChatHeaderAvatar, ChatHeaderTitle, ChatHeaderActions, Chat, ChatEmptyState, ChatEmptyStateIcon, ChatEmptyStateTitle, ChatEmptyStateDescription, ChatSuggestions, ChatSuggestion, useMediaQuery, TooltipProvider, DataTablePaged } from '@cntyclub/ui-react';
2
2
  import { XIcon, Trash2Icon, SquareIcon, PauseIcon, PlayIcon, CheckIcon, Loader2Icon, FileTextIcon, PaperclipIcon, MicIcon, ArrowUpIcon, CopyIcon, Maximize2Icon, ListChecksIcon, ChevronDownIcon, ShieldAlertIcon, CheckCheckIcon, UploadCloudIcon, HistoryIcon, SquarePenIcon, Minimize2Icon, ChevronsRightIcon, SparklesIcon, DownloadIcon, CodeIcon } from 'lucide-react';
3
3
  import * as React11 from 'react';
4
4
  import { AnimatePresence, motion } from 'motion/react';
@@ -931,7 +931,7 @@ function MessageItem({ message }) {
931
931
  const attachments = message.attachments ?? [];
932
932
  const images = attachments.filter((a) => isImageAttachment(a.format) && a.url);
933
933
  const others = attachments.filter((a) => !isImageAttachment(a.format) || !a.url);
934
- return /* @__PURE__ */ jsxs(ChatMessage, { from: "user", children: [
934
+ return /* @__PURE__ */ jsxs(ChatMessage, { className: "group", from: "user", children: [
935
935
  images.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex flex-wrap justify-end gap-1.5", children: images.map((attachment) => /* @__PURE__ */ jsx(
936
936
  "button",
937
937
  {
@@ -954,14 +954,37 @@ function MessageItem({ message }) {
954
954
  },
955
955
  attachment.id
956
956
  )) }) : null,
957
- message.content ? /* @__PURE__ */ jsx(ChatMessageBubble, { from: "user", children: message.content }) : null,
957
+ message.content ? /* @__PURE__ */ jsx(ChatMessageBubble, { className: "whitespace-pre-wrap", from: "user", children: message.content }) : null,
958
+ message.content ? /* @__PURE__ */ jsx(
959
+ "div",
960
+ {
961
+ className: cn(
962
+ "mt-0.5 flex justify-end opacity-0 transition-opacity",
963
+ "group-hover:opacity-100 focus-within:opacity-100"
964
+ ),
965
+ children: /* @__PURE__ */ jsx(CopyButton, { text: message.content })
966
+ }
967
+ ) : null,
958
968
  /* @__PURE__ */ jsx(AgentImageLightbox, { onClose: () => setLightboxSrc(null), src: lightboxSrc })
959
969
  ] });
960
970
  }
961
971
  if (message.role === "assistant") {
962
972
  if (!message.content || !message.content.trim()) return null;
963
973
  return /* @__PURE__ */ jsxs(ChatMessage, { className: "group", from: "assistant", children: [
964
- /* @__PURE__ */ jsx(ChatMessageBubble, { from: "assistant", children: /* @__PURE__ */ jsx(Markdown, { children: message.content }) }),
974
+ /* @__PURE__ */ jsx(ChatMessageBubble, { from: "assistant", children: /* @__PURE__ */ jsx(
975
+ "div",
976
+ {
977
+ className: "[&_img]:cursor-zoom-in [&_img]:rounded-md",
978
+ onClick: (event) => {
979
+ const target = event.target;
980
+ if (target.tagName !== "IMG") return;
981
+ const src = target.currentSrc || target.src;
982
+ if (src) setLightboxSrc(src);
983
+ },
984
+ role: "presentation",
985
+ children: /* @__PURE__ */ jsx(Markdown, { children: message.content })
986
+ }
987
+ ) }),
965
988
  /* @__PURE__ */ jsx(
966
989
  "div",
967
990
  {
@@ -971,7 +994,8 @@ function MessageItem({ message }) {
971
994
  ),
972
995
  children: /* @__PURE__ */ jsx(CopyButton, { text: message.content })
973
996
  }
974
- )
997
+ ),
998
+ /* @__PURE__ */ jsx(AgentImageLightbox, { onClose: () => setLightboxSrc(null), src: lightboxSrc })
975
999
  ] });
976
1000
  }
977
1001
  return null;
@@ -1005,19 +1029,23 @@ function ThinkingIndicator({ className, intervalMs = 1800, phrases }) {
1005
1029
  "data-slot": "thinking-indicator",
1006
1030
  role: "status",
1007
1031
  children: [
1008
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
1009
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground/60 [animation-delay:0ms]" }),
1010
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground/60 [animation-delay:150ms]" }),
1011
- /* @__PURE__ */ jsx("span", { className: "size-1.5 animate-bounce rounded-full bg-muted-foreground/60 [animation-delay:300ms]" })
1012
- ] }),
1013
- /* @__PURE__ */ jsxs(
1032
+ /* @__PURE__ */ jsx(
1014
1033
  "span",
1015
1034
  {
1016
- className: "fade-in-0 animate-in text-muted-foreground text-xs duration-300",
1017
- children: [
1018
- words[index],
1019
- " \u2026"
1020
- ]
1035
+ "aria-hidden": "true",
1036
+ className: "size-4 shrink-0 animate-spin rounded-full [animation-duration:900ms]",
1037
+ style: {
1038
+ background: "conic-gradient(from 0deg, #FF0080, #7928CA, #0070F3, #38bdf8, #FF0080)",
1039
+ WebkitMask: "radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))",
1040
+ mask: "radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px))"
1041
+ }
1042
+ }
1043
+ ),
1044
+ /* @__PURE__ */ jsx(
1045
+ "span",
1046
+ {
1047
+ className: "fade-in-0 animate-in text-xs font-medium duration-300",
1048
+ children: /* @__PURE__ */ jsx(AuroraText, { children: words[index] })
1021
1049
  },
1022
1050
  index
1023
1051
  )