@agents24/chat-react 0.5.28 → 0.5.29

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.
@@ -27,7 +27,7 @@ import {
27
27
  useAudioRecorder,
28
28
  useChatComposerFocus
29
29
  } from "@agents24/chat-react/ui";
30
- import { canonicalInputMimeType, inputMimeTypes, validateAgentChatSubmission } from "@agents24/chat-react/runtime";
30
+ import { attachmentFileAccept, inputMimeTypes, validateAgentChatSubmission } from "@agents24/chat-react/runtime";
31
31
 
32
32
  // scaffold/src/components/ui/button.tsx
33
33
  import { cva } from "class-variance-authority";
@@ -648,15 +648,11 @@ function ChatComposer({
648
648
  className: "sr-only",
649
649
  type: "file",
650
650
  multiple: true,
651
- accept: attachmentMimeTypes.join(","),
651
+ accept: attachmentFileAccept(attachmentMimeTypes),
652
652
  onChange: (event) => {
653
653
  const selected = Array.from(event.target.files ?? []);
654
- const accepted = selected.filter((file) => attachmentMimeTypes.includes(canonicalInputMimeType(file.type)));
655
- draftRevisionRef.current += 1;
656
- setFiles((current) => [...current, ...accepted.map(createAgentChatComposerFile)]);
657
- setAttachmentError(
658
- accepted.length === selected.length ? null : "One or more selected file types are not supported by this Agent."
659
- );
654
+ setFiles((current) => [...current, ...selected.map(createAgentChatComposerFile)]);
655
+ setAttachmentError(null);
660
656
  event.currentTarget.value = "";
661
657
  }
662
658
  }