@lukeashford/aurelius 3.7.0 → 3.8.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/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +15 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -8
- package/dist/index.mjs.map +1 -1
- package/llms.md +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3972,7 +3972,7 @@ var Message = React55.forwardRef(
|
|
|
3972
3972
|
const isUser = variant === "user";
|
|
3973
3973
|
const [copied, setCopied] = useState10(false);
|
|
3974
3974
|
const [isEditing, setIsEditing] = useState10(false);
|
|
3975
|
-
const [editValue, setEditValue] = useState10(content);
|
|
3975
|
+
const [editValue, setEditValue] = useState10(typeof content === "string" ? content : "");
|
|
3976
3976
|
const textareaRef = useRef5(null);
|
|
3977
3977
|
const showBranchNav = branchInfo && branchInfo.total > 1;
|
|
3978
3978
|
const showActions = actions && !hideActions && !isStreaming;
|
|
@@ -3986,6 +3986,9 @@ var Message = React55.forwardRef(
|
|
|
3986
3986
|
}
|
|
3987
3987
|
}, [isEditing]);
|
|
3988
3988
|
const handleCopy = async () => {
|
|
3989
|
+
if (typeof content !== "string") {
|
|
3990
|
+
return;
|
|
3991
|
+
}
|
|
3989
3992
|
try {
|
|
3990
3993
|
await navigator.clipboard.writeText(content);
|
|
3991
3994
|
setCopied(true);
|
|
@@ -4002,16 +4005,20 @@ var Message = React55.forwardRef(
|
|
|
4002
4005
|
}
|
|
4003
4006
|
};
|
|
4004
4007
|
const handleStartEdit = () => {
|
|
4005
|
-
|
|
4006
|
-
|
|
4008
|
+
if (typeof content === "string") {
|
|
4009
|
+
setEditValue(content);
|
|
4010
|
+
setIsEditing(true);
|
|
4011
|
+
}
|
|
4007
4012
|
};
|
|
4008
4013
|
const handleCancelEdit = () => {
|
|
4009
4014
|
setIsEditing(false);
|
|
4010
|
-
|
|
4015
|
+
if (typeof content === "string") {
|
|
4016
|
+
setEditValue(content);
|
|
4017
|
+
}
|
|
4011
4018
|
};
|
|
4012
4019
|
const handleSubmitEdit = () => {
|
|
4013
4020
|
const trimmed = editValue.trim();
|
|
4014
|
-
if (trimmed && trimmed !== content) {
|
|
4021
|
+
if (typeof content === "string" && trimmed && trimmed !== content) {
|
|
4015
4022
|
actions?.onEdit?.(trimmed);
|
|
4016
4023
|
}
|
|
4017
4024
|
setIsEditing(false);
|
|
@@ -4078,7 +4085,7 @@ var Message = React55.forwardRef(
|
|
|
4078
4085
|
variantStyles2[variant]
|
|
4079
4086
|
)
|
|
4080
4087
|
},
|
|
4081
|
-
/* @__PURE__ */ React55.createElement(
|
|
4088
|
+
typeof content === "string" ? /* @__PURE__ */ React55.createElement(
|
|
4082
4089
|
MarkdownContent,
|
|
4083
4090
|
{
|
|
4084
4091
|
content,
|
|
@@ -4086,7 +4093,7 @@ var Message = React55.forwardRef(
|
|
|
4086
4093
|
isStreaming,
|
|
4087
4094
|
cursorClassName: "ml-0.5"
|
|
4088
4095
|
}
|
|
4089
|
-
)
|
|
4096
|
+
) : content
|
|
4090
4097
|
),
|
|
4091
4098
|
showActions && !isEditing && /* @__PURE__ */ React55.createElement("div", { className: cx(
|
|
4092
4099
|
"flex items-center gap-0.5 mt-1",
|
|
@@ -4098,7 +4105,7 @@ var Message = React55.forwardRef(
|
|
|
4098
4105
|
label: copied ? "Copied!" : "Copy message"
|
|
4099
4106
|
},
|
|
4100
4107
|
copied ? /* @__PURE__ */ React55.createElement(CheckIcon, null) : /* @__PURE__ */ React55.createElement(CopyIcon, null)
|
|
4101
|
-
), isUser && actions.onEdit && /* @__PURE__ */ React55.createElement(ActionButton, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ React55.createElement(PencilIcon, null)), !isUser && actions.onRetry && /* @__PURE__ */ React55.createElement(ActionButton, { onClick: actions.onRetry, label: "Regenerate response" }, /* @__PURE__ */ React55.createElement(RetryIcon, null)), showBranchNav && /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement("div", { className: "w-px h-4 bg-ash/40 mx-1" }), /* @__PURE__ */ React55.createElement("div", { className: "flex items-center gap-0.5 text-silver/70" }, /* @__PURE__ */ React55.createElement(GitBranchIcon, null), /* @__PURE__ */ React55.createElement(
|
|
4108
|
+
), isUser && actions.onEdit && typeof content === "string" && /* @__PURE__ */ React55.createElement(ActionButton, { onClick: handleStartEdit, label: "Edit message" }, /* @__PURE__ */ React55.createElement(PencilIcon, null)), !isUser && actions.onRetry && /* @__PURE__ */ React55.createElement(ActionButton, { onClick: actions.onRetry, label: "Regenerate response" }, /* @__PURE__ */ React55.createElement(RetryIcon, null)), showBranchNav && /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement("div", { className: "w-px h-4 bg-ash/40 mx-1" }), /* @__PURE__ */ React55.createElement("div", { className: "flex items-center gap-0.5 text-silver/70" }, /* @__PURE__ */ React55.createElement(GitBranchIcon, null), /* @__PURE__ */ React55.createElement(
|
|
4102
4109
|
"button",
|
|
4103
4110
|
{
|
|
4104
4111
|
type: "button",
|