@agno-hq/chat-react 0.3.1 → 0.3.2

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.
@@ -2,7 +2,7 @@ import { AgnoClient, activityLabel, isSubRunEvent, applySubRunEvent, isStepEvent
2
2
  import React7, { createContext, useMemo, useState, useRef, useEffect, useCallback, useContext, useId, isValidElement, cloneElement, useLayoutEffect, useReducer } from 'react';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
4
  import { createPortal } from 'react-dom';
5
- import { Square, ChevronDown as ChevronDown$1, ArrowUp as ArrowUp$1, Paperclip as Paperclip$1, File, FileType2, FileAudio as FileAudio$1, FileVideo as FileVideo$1, Wrench as Wrench$1, BookOpen as BookOpen$1, Globe as Globe$1, Link, Brain as Brain$1, Box as Box$1, Plus as Plus$1, Check as Check$1, Copy as Copy$1, X, MemoryStick, RefreshCcw, Activity, Trash2, MessageSquare, LoaderCircle } from 'lucide-react';
5
+ import { ChevronDown as ChevronDown$1, ArrowUp as ArrowUp$1, Paperclip as Paperclip$1, File, FileType2, FileAudio as FileAudio$1, FileVideo as FileVideo$1, Wrench as Wrench$1, BookOpen as BookOpen$1, Globe as Globe$1, Link, Brain as Brain$1, Box as Box$1, Plus as Plus$1, Check as Check$1, Copy as Copy$1, X, MemoryStick, RefreshCcw, Activity, Trash2, MessageSquare, LoaderCircle, Square } from 'lucide-react';
6
6
  import { Streamdown } from 'streamdown';
7
7
 
8
8
  var messageCounter = 0;
@@ -656,9 +656,7 @@ var Pulse = icon(Activity);
656
656
  var Trash = icon(Trash2);
657
657
  var ChatBubble = icon(MessageSquare);
658
658
  var Spinner = icon(LoaderCircle, 12);
659
- function Stop({ size = 16, className }) {
660
- return /* @__PURE__ */ jsx(Square, { size, className, fill: "currentColor", strokeWidth: 0 });
661
- }
659
+ var Stop = icon(Square, 10.67);
662
660
  function AgnoMark({ size = 24, className }) {
663
661
  return /* @__PURE__ */ jsxs(
664
662
  "svg",
@@ -1094,15 +1092,18 @@ function ChatInput({
1094
1092
  }
1095
1093
  )
1096
1094
  ] });
1097
- const primary = isBusy && stop ? /* @__PURE__ */ jsx(
1098
- "button",
1099
- {
1100
- type: "button",
1101
- className: cx("agno-btn", "agno-btn--destructive", "agno-btn--icon", cn.stopButton),
1102
- onClick: stop,
1103
- "aria-label": "Stop",
1104
- children: /* @__PURE__ */ jsx(Stop, { size: iconSize })
1105
- }
1095
+ const primary = isBusy && stop ? (
1096
+ // The same button the arrow sends from, with AgentOS's square-stop in it.
1097
+ /* @__PURE__ */ jsx(
1098
+ "button",
1099
+ {
1100
+ type: "button",
1101
+ className: cx("agno-btn", "agno-btn--icon", cn.stopButton),
1102
+ onClick: stop,
1103
+ "aria-label": "Stop",
1104
+ children: /* @__PURE__ */ jsx(Stop, {})
1105
+ }
1106
+ )
1106
1107
  ) : /* @__PURE__ */ jsx(
1107
1108
  "button",
1108
1109
  {
@@ -2624,10 +2625,11 @@ function Message({
2624
2625
  }, [message.references, message.citations, message.content, uid]);
2625
2626
  const isUser = message.role === "user";
2626
2627
  const isAgent = message.role === "agent";
2627
- const showSources = isAgent && !hideSources && sources.length > 0;
2628
+ const hasSources = isAgent && !hideSources && sources.length > 0;
2629
+ const showSources = hasSources && !message.streaming;
2628
2630
  const content = useMemo(
2629
- () => showSources && message.content ? withoutSourcesLine(message.content) : message.content,
2630
- [message.content, showSources]
2631
+ () => hasSources && message.content ? withoutSourcesLine(message.content) : message.content,
2632
+ [message.content, hasSources]
2631
2633
  );
2632
2634
  const hasActivity = !message.content && !hasBehindTheScenes(message, { hideReasoning, hideTools });
2633
2635
  const kind = isUser ? "user" : isAgent ? entityType : "system";
@@ -3497,5 +3499,5 @@ function EventLog({
3497
3499
  }
3498
3500
 
3499
3501
  export { AgnoChat, AgnoMark, ArrowUp, BehindTheScenes, BookOpen, Box, Brain, ChatBubble, ChatInput, ChatLauncher, ChatProvider, ChatWindow, Check, ChevronDown, Citations, Close, Copy, EntityBadge, EntitySelector, EventLog, Favicon, FileAudio, FileIcon, FilePreview, FileType, FileVideo, Followups, Globe, GridLoader, HoverPreview, HumanInput, LinkIcon, LinkPreviewCard, Markdown, MemberResponses, Memory, Message, MessageList, Multimedia, Paperclip, Plus, Pulse, QuickPrompts, Reasoning, Rerun, SessionList, SourceCard, SourcesProvider, Spinner, StatusIndicator, Stop, TeamGlyph, ToolCalls, Trash, WorkflowSteps, Wrench, admitFiles, behindTheScenesItems, behindTheScenesLabel, collectSources, cx, displayUrl, faviconUrl, fileAccepted, getProviderIcon, hasBehindTheScenes, linkCitations, normalizeFollowups, quickPromptLabel, quickPromptText, sourceHost, sourcesFromMarkdown, useAgnoChat, useChatContext, useLinkComponent, useLinkPreview, useOptionalChatContext, useResolvedChat, useResolvedClassNames, useSources, withoutSourcesLine, writeClipboard };
3500
- //# sourceMappingURL=chunk-BZC2674Z.js.map
3501
- //# sourceMappingURL=chunk-BZC2674Z.js.map
3502
+ //# sourceMappingURL=chunk-XTP3TMEZ.js.map
3503
+ //# sourceMappingURL=chunk-XTP3TMEZ.js.map