@springbrand/message-panel 0.1.3-alpha.26 → 0.1.3-alpha.27
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/package.json
CHANGED
|
@@ -59,7 +59,7 @@ export const AttachmentPreview = forwardRef<
|
|
|
59
59
|
attachment.status === "uploading"
|
|
60
60
|
? "上传中…"
|
|
61
61
|
: attachment.status === "error"
|
|
62
|
-
? "
|
|
62
|
+
? "Upload failed"
|
|
63
63
|
: [attachment.note, formatSize(attachment.size)].filter(Boolean).join(" · ");
|
|
64
64
|
return (
|
|
65
65
|
<div
|
|
@@ -211,10 +211,10 @@ function ComposerInner<TAttachment>(
|
|
|
211
211
|
);
|
|
212
212
|
const invalid = selected.filter((file) => !valid.includes(file));
|
|
213
213
|
if (all.length > selected.length) {
|
|
214
|
-
onValidationError?.(
|
|
214
|
+
onValidationError?.(`You can add up to ${maxFiles ?? 1} attachments`, all);
|
|
215
215
|
}
|
|
216
216
|
if (invalid.length) {
|
|
217
|
-
onValidationError?.("
|
|
217
|
+
onValidationError?.("Some files are unsupported or exceed the size limit", invalid);
|
|
218
218
|
}
|
|
219
219
|
if (valid.length) void onFilesAdded?.(valid);
|
|
220
220
|
},
|
package/src/message-panel.tsx
CHANGED
|
@@ -277,7 +277,7 @@ function MessagePanelInner<T>(
|
|
|
277
277
|
? slots.error(error)
|
|
278
278
|
: slots.error ?? (
|
|
279
279
|
<PanelStatus kind="error">
|
|
280
|
-
{error instanceof Error ? error.message : "
|
|
280
|
+
{error instanceof Error ? error.message : "This turn failed. Please try again."}
|
|
281
281
|
</PanelStatus>
|
|
282
282
|
))}
|
|
283
283
|
<Conversation>
|
package/src/parts/index.tsx
CHANGED
|
@@ -1115,7 +1115,7 @@ export function DefaultPartRenderer({
|
|
|
1115
1115
|
);
|
|
1116
1116
|
}
|
|
1117
1117
|
if (kind === "error") {
|
|
1118
|
-
return <ErrorPart title={String(data.title ?? "Error")} body={String(data.body ?? data.message ?? "
|
|
1118
|
+
return <ErrorPart title={String(data.title ?? "Error")} body={String(data.body ?? data.message ?? "Request failed")} />;
|
|
1119
1119
|
}
|
|
1120
1120
|
if (kind === "image") {
|
|
1121
1121
|
return <ImagePart src={String(record.src ?? record.url ?? data.src ?? data.url ?? "")} alt={String(record.alt ?? record.filename ?? data.alt ?? data.filename ?? "图片")} onPreview={() => context.actions.onPreview?.(part)} />;
|