@springbrand/message-panel 0.1.3-alpha.11 → 0.1.3-alpha.13
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.
|
@@ -150,26 +150,31 @@ function UserBubble({
|
|
|
150
150
|
</div>
|
|
151
151
|
)}
|
|
152
152
|
{entry.attachments.length > 0 && (
|
|
153
|
-
<div className="mb-1.5 flex max-w-[min(680px,78%)] flex-wrap justify-end gap-2">
|
|
154
|
-
{entry.attachments.map((attachment, index) =>
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
153
|
+
<div className="mb-1.5 flex max-w-[min(680px,78%)] flex-wrap items-start justify-end gap-2">
|
|
154
|
+
{entry.attachments.map((attachment, index) => {
|
|
155
|
+
const view = renderFileView(renderFile, {
|
|
156
|
+
file: {
|
|
157
|
+
...attachment,
|
|
158
|
+
url: resolveUrl?.(attachment.url) ?? attachment.url,
|
|
159
|
+
},
|
|
160
|
+
placement: "user-message",
|
|
161
|
+
});
|
|
162
|
+
return attachment.mediaType?.startsWith("image/") ? (
|
|
163
|
+
<Fragment key={`${attachment.url}:${index}`}>{view}</Fragment>
|
|
164
|
+
) : (
|
|
165
|
+
<span
|
|
166
|
+
key={`${attachment.url}:${index}`}
|
|
167
|
+
className="flex basis-full justify-end"
|
|
168
|
+
>
|
|
169
|
+
{view}
|
|
170
|
+
</span>
|
|
171
|
+
);
|
|
172
|
+
})}
|
|
165
173
|
</div>
|
|
166
174
|
)}
|
|
167
175
|
{entry.text && (
|
|
168
|
-
<div className="themed-user-bubble-shadow cos-markdown w-fit max-w-[min(680px,78%)] rounded-[24px] rounded-br-lg border border-transparent bg-kumo-bubble-user px-4 py-2.5 text-[14px] leading-[22px] tracking-[-0.25px] text-kumo-default">
|
|
169
|
-
{
|
|
170
|
-
<div className="whitespace-pre-wrap">
|
|
171
|
-
<MarkdownMessage message={entry.text} resolveUrl={resolveUrl} />
|
|
172
|
-
</div>
|
|
176
|
+
<div className="themed-user-bubble-shadow cos-markdown cos-user-markdown w-fit max-w-[min(680px,78%)] rounded-[24px] rounded-br-lg border border-transparent bg-kumo-bubble-user px-4 py-2.5 text-[14px] leading-[22px] tracking-[-0.25px] text-kumo-default">
|
|
177
|
+
<MarkdownMessage message={entry.text} resolveUrl={resolveUrl} />
|
|
173
178
|
</div>
|
|
174
179
|
)}
|
|
175
180
|
<div className="mt-0.5 flex items-center justify-end gap-2 pr-1 text-[11px] leading-4 text-kumo-inactive opacity-0 transition-opacity duration-150 ease-out group-hover/message:opacity-100 group-focus-within/message:opacity-100">
|
package/cloud-os/file-view.tsx
CHANGED
|
@@ -165,7 +165,15 @@ export function FileView({
|
|
|
165
165
|
data-state={status === "ready" ? "done" : status}
|
|
166
166
|
>
|
|
167
167
|
<span className="flex size-8 shrink-0 items-center justify-center rounded-[10px] bg-kumo-control text-kumo-inactive themed-thumbnail-shadow">
|
|
168
|
-
|
|
168
|
+
{isImage ? (
|
|
169
|
+
<img
|
|
170
|
+
src={file.url}
|
|
171
|
+
alt=""
|
|
172
|
+
className="size-8 object-cover"
|
|
173
|
+
/>
|
|
174
|
+
) : (
|
|
175
|
+
<AttachmentIcon className="size-4" aria-hidden="true" />
|
|
176
|
+
)}
|
|
169
177
|
</span>
|
|
170
178
|
<span className="flex min-w-0 flex-col">
|
|
171
179
|
<span className="max-w-36 truncate text-xs font-medium text-kumo-default">
|