mirror of
https://github.com/CopilotKit/CopilotKit.git
synced 2026-09-14 16:26:20 +08:00
9b0ab581e6
Mirror the React @copilotkit/react-ui Attachments pipeline in @copilotkitnext/angular:
- copilot-chat-attachment-renderer: dispatches a single Attachment by modality
(image/audio/video/document) using getSourceUrl(source) once and per-modality
default components. Each modality is overridable via #imageRenderer /
#audioRenderer / #videoRenderer / #documentRenderer templates or
*RendererComponent inputs. Image renderer surfaces a load error to a
fallback view via an internal signal (parity with React useState).
- copilot-chat-attachment-queue: list/queue view with a remove control,
uploading overlay/spinner, and per-type previews. Container and item are
overridable via #container / #item templates or *Component inputs.
Renames React's onRemoveAttachment prop to a removeAttachment output that
emits { id, attachment }.
Behavioral tests (28) cover: src derivation for data vs url sources, slot
context shape, document icon fallbacks, displayName fallback chain,
formattedSize, uploading-state src masking, entry keying by attachment.id,
clickHandler -> removeAttachment, container context reactivity.