@rodrigocoliveira/agno-react 2.1.0 → 2.2.0
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/README.md +34 -11
- package/dist/hooks/useAgnoChat.d.ts +1 -0
- package/dist/hooks/useAgnoChat.d.ts.map +1 -1
- package/dist/index.js +19 -14
- package/dist/index.js.map +6 -6
- package/dist/index.mjs +19 -14
- package/dist/index.mjs.map +6 -6
- package/dist/ui/composed/AgnoMessageItem.d.ts +3 -1
- package/dist/ui/composed/AgnoMessageItem.d.ts.map +1 -1
- package/dist/ui/composed/agno-chat/agno-chat.d.ts +18 -1
- package/dist/ui/composed/agno-chat/agno-chat.d.ts.map +1 -1
- package/dist/ui/composed/agno-chat/messages.d.ts.map +1 -1
- package/dist/ui/composed/agno-message/context.d.ts +7 -0
- package/dist/ui/composed/agno-message/context.d.ts.map +1 -1
- package/dist/ui/composed/agno-message/footer.d.ts.map +1 -1
- package/dist/ui/composed/agno-message/message.d.ts +8 -1
- package/dist/ui/composed/agno-message/message.d.ts.map +1 -1
- package/dist/ui.js +27 -15
- package/dist/ui.js.map +8 -8
- package/dist/ui.mjs +27 -15
- package/dist/ui.mjs.map +8 -8
- package/package.json +3 -9
package/dist/index.mjs
CHANGED
|
@@ -2144,25 +2144,27 @@ function AgnoMessageReferences() {
|
|
|
2144
2144
|
import { AlertCircle } from "lucide-react";
|
|
2145
2145
|
import { jsx as jsx21, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2146
2146
|
function AgnoMessageFooter({ showTimestamp = true } = {}) {
|
|
2147
|
-
const { message, classNames, actions, isLastAssistantMessage, formatTimestamp } = useAgnoMessageContext();
|
|
2147
|
+
const { message, classNames, actions, isLastAssistantMessage, isStreamingThisMessage, formatTimestamp } = useAgnoMessageContext();
|
|
2148
2148
|
const hasError = message.streamingError;
|
|
2149
2149
|
const isCustomTimestamp = !!formatTimestamp;
|
|
2150
2150
|
const resolvedFormatTimestamp = formatTimestamp ?? formatSmartTimestamp;
|
|
2151
|
-
if (
|
|
2151
|
+
if (isStreamingThisMessage)
|
|
2152
2152
|
return null;
|
|
2153
|
+
const hasActions = !!actions?.assistant;
|
|
2154
|
+
const visibility = actions?.visibility ?? "visible";
|
|
2155
|
+
if (hasActions && visibility === "last-assistant" && !isLastAssistantMessage) {
|
|
2156
|
+
return null;
|
|
2157
|
+
}
|
|
2158
|
+
if (!hasActions && !showTimestamp && !hasError)
|
|
2159
|
+
return null;
|
|
2160
|
+
const useHover = hasActions && (visibility === "hover" || visibility === "hover-last-visible" && !isLastAssistantMessage);
|
|
2153
2161
|
return /* @__PURE__ */ jsxs13("div", {
|
|
2154
|
-
className: "flex items-center gap-2 pt-1",
|
|
2162
|
+
className: cn("flex items-center gap-2 pt-1 transition-opacity", useHover && "opacity-0 group-hover/message:opacity-100"),
|
|
2155
2163
|
children: [
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
const useHover = visibility === "hover" || visibility === "hover-last-visible" && !isLastAssistantMessage;
|
|
2161
|
-
return /* @__PURE__ */ jsx21("div", {
|
|
2162
|
-
className: cn("flex items-center gap-1 transition-opacity", useHover && "opacity-0 group-hover/message:opacity-100", classNames?.assistant?.actions),
|
|
2163
|
-
children: actions.assistant(message)
|
|
2164
|
-
});
|
|
2165
|
-
})(),
|
|
2164
|
+
hasActions && /* @__PURE__ */ jsx21("div", {
|
|
2165
|
+
className: cn("flex items-center gap-1", classNames?.assistant?.actions),
|
|
2166
|
+
children: actions.assistant(message)
|
|
2167
|
+
}),
|
|
2166
2168
|
hasError && /* @__PURE__ */ jsxs13("span", {
|
|
2167
2169
|
className: "flex items-center gap-1 text-[11px] text-destructive",
|
|
2168
2170
|
children: [
|
|
@@ -2204,6 +2206,7 @@ function AgnoMessage({
|
|
|
2204
2206
|
avatars,
|
|
2205
2207
|
actions,
|
|
2206
2208
|
isLastAssistantMessage = false,
|
|
2209
|
+
isStreamingThisMessage = false,
|
|
2207
2210
|
showFilePreview = true,
|
|
2208
2211
|
showImageLightbox = true,
|
|
2209
2212
|
showTimestamp = true,
|
|
@@ -2219,6 +2222,7 @@ function AgnoMessage({
|
|
|
2219
2222
|
const ctx = useMemo3(() => ({
|
|
2220
2223
|
message,
|
|
2221
2224
|
isLastAssistantMessage,
|
|
2225
|
+
isStreamingThisMessage,
|
|
2222
2226
|
classNames,
|
|
2223
2227
|
actions,
|
|
2224
2228
|
avatars,
|
|
@@ -2239,6 +2243,7 @@ function AgnoMessage({
|
|
|
2239
2243
|
}), [
|
|
2240
2244
|
message,
|
|
2241
2245
|
isLastAssistantMessage,
|
|
2246
|
+
isStreamingThisMessage,
|
|
2242
2247
|
classNames,
|
|
2243
2248
|
actions,
|
|
2244
2249
|
avatars,
|
|
@@ -3253,4 +3258,4 @@ export {
|
|
|
3253
3258
|
AgnoMessage
|
|
3254
3259
|
};
|
|
3255
3260
|
|
|
3256
|
-
//# debugId=
|
|
3261
|
+
//# debugId=EC3FE2C2B9E1280964756E2164756E21
|