@cntyclub/agent-react 0.14.3 → 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,
|
|
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:
|
|
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,
|
|
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
|
@@ -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(
|
|
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,11 +1029,18 @@ function ThinkingIndicator({ className, intervalMs = 1800, phrases }) {
|
|
|
1005
1029
|
"data-slot": "thinking-indicator",
|
|
1006
1030
|
role: "status",
|
|
1007
1031
|
children: [
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1032
|
+
/* @__PURE__ */ jsx(
|
|
1033
|
+
"span",
|
|
1034
|
+
{
|
|
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
|
+
),
|
|
1013
1044
|
/* @__PURE__ */ jsx(
|
|
1014
1045
|
"span",
|
|
1015
1046
|
{
|