@copilotz/chat-ui 0.7.5 → 0.7.8

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.cts CHANGED
@@ -1,6 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { Options, Components } from 'react-markdown';
3
3
 
4
+ type MediaAttachmentKind = "image" | "audio" | "video" | "file";
4
5
  type MediaAttachment = {
5
6
  kind: "image";
6
7
  dataUrl: string;
@@ -22,6 +23,12 @@ type MediaAttachment = {
22
23
  fileName?: string;
23
24
  size?: number;
24
25
  poster?: string;
26
+ } | {
27
+ kind: "file";
28
+ dataUrl: string;
29
+ mimeType: string;
30
+ fileName?: string;
31
+ size?: number;
25
32
  };
26
33
  type AudioAttachment = Extract<MediaAttachment, {
27
34
  kind: "audio";
@@ -237,6 +244,7 @@ interface ChatConfig {
237
244
  showActivityDetails?: boolean;
238
245
  maxAttachments?: number;
239
246
  maxFileSize?: number;
247
+ acceptedFileTypes?: string[];
240
248
  };
241
249
  ui?: {
242
250
  theme?: "light" | "dark" | "auto";
@@ -470,4 +478,7 @@ declare function useChatUserContext(): ChatUserContextValue;
470
478
  declare const defaultChatConfig: Required<ChatConfig>;
471
479
  declare function mergeConfig(_baseConfig: ChatConfig, userConfig?: Partial<ChatConfig>): Required<ChatConfig>;
472
480
 
473
- export { type AgentOption, AssistantActivity, type AssistantActivityBlock, type AssistantActivityItem, type AssistantActivityKind, type AssistantActivityStatus, type AudioAttachment, type ChatCallbacks, type ChatConfig, type ChatMarkdownConfig, type ChatMessage, type ChatSender, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatUserMenuItem, type ChatUserMenuSection, type ChatV2Props, type CreateVoiceProvider, type FileUploadProgress, type MediaAttachment, type MemoryItem, type MessageAction, type MessageActionEvent, MessageSenderAvatar, type StateCallback, type StreamingUpdate, type ToolCall, type UserCustomField, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, defaultChatConfig, mergeConfig, resolveMessageSenderDisplay, useChatUserContext };
481
+ declare const getAttachmentKindFromMimeType: (mimeType?: string | null) => MediaAttachmentKind;
482
+ declare const getMimeTypeFromDataUrl: (dataUrl: string) => string | null;
483
+
484
+ export { type AgentOption, AssistantActivity, type AssistantActivityBlock, type AssistantActivityItem, type AssistantActivityKind, type AssistantActivityStatus, type AudioAttachment, type ChatCallbacks, type ChatConfig, type ChatMarkdownConfig, type ChatMessage, type ChatSender, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatUserMenuItem, type ChatUserMenuSection, type ChatV2Props, type CreateVoiceProvider, type FileUploadProgress, type MediaAttachment, type MediaAttachmentKind, type MemoryItem, type MessageAction, type MessageActionEvent, MessageSenderAvatar, type StateCallback, type StreamingUpdate, type ToolCall, type UserCustomField, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, defaultChatConfig, getAttachmentKindFromMimeType, getMimeTypeFromDataUrl, mergeConfig, resolveMessageSenderDisplay, useChatUserContext };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { Options, Components } from 'react-markdown';
3
3
 
4
+ type MediaAttachmentKind = "image" | "audio" | "video" | "file";
4
5
  type MediaAttachment = {
5
6
  kind: "image";
6
7
  dataUrl: string;
@@ -22,6 +23,12 @@ type MediaAttachment = {
22
23
  fileName?: string;
23
24
  size?: number;
24
25
  poster?: string;
26
+ } | {
27
+ kind: "file";
28
+ dataUrl: string;
29
+ mimeType: string;
30
+ fileName?: string;
31
+ size?: number;
25
32
  };
26
33
  type AudioAttachment = Extract<MediaAttachment, {
27
34
  kind: "audio";
@@ -237,6 +244,7 @@ interface ChatConfig {
237
244
  showActivityDetails?: boolean;
238
245
  maxAttachments?: number;
239
246
  maxFileSize?: number;
247
+ acceptedFileTypes?: string[];
240
248
  };
241
249
  ui?: {
242
250
  theme?: "light" | "dark" | "auto";
@@ -470,4 +478,7 @@ declare function useChatUserContext(): ChatUserContextValue;
470
478
  declare const defaultChatConfig: Required<ChatConfig>;
471
479
  declare function mergeConfig(_baseConfig: ChatConfig, userConfig?: Partial<ChatConfig>): Required<ChatConfig>;
472
480
 
473
- export { type AgentOption, AssistantActivity, type AssistantActivityBlock, type AssistantActivityItem, type AssistantActivityKind, type AssistantActivityStatus, type AudioAttachment, type ChatCallbacks, type ChatConfig, type ChatMarkdownConfig, type ChatMessage, type ChatSender, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatUserMenuItem, type ChatUserMenuSection, type ChatV2Props, type CreateVoiceProvider, type FileUploadProgress, type MediaAttachment, type MemoryItem, type MessageAction, type MessageActionEvent, MessageSenderAvatar, type StateCallback, type StreamingUpdate, type ToolCall, type UserCustomField, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, defaultChatConfig, mergeConfig, resolveMessageSenderDisplay, useChatUserContext };
481
+ declare const getAttachmentKindFromMimeType: (mimeType?: string | null) => MediaAttachmentKind;
482
+ declare const getMimeTypeFromDataUrl: (dataUrl: string) => string | null;
483
+
484
+ export { type AgentOption, AssistantActivity, type AssistantActivityBlock, type AssistantActivityItem, type AssistantActivityKind, type AssistantActivityStatus, type AudioAttachment, type ChatCallbacks, type ChatConfig, type ChatMarkdownConfig, type ChatMessage, type ChatSender, type ChatState, type ChatThread, ChatUI, type ChatUserContext, ChatUserContextProvider, type ChatUserMenuItem, type ChatUserMenuSection, type ChatV2Props, type CreateVoiceProvider, type FileUploadProgress, type MediaAttachment, type MediaAttachmentKind, type MemoryItem, type MessageAction, type MessageActionEvent, MessageSenderAvatar, type StateCallback, type StreamingUpdate, type ToolCall, type UserCustomField, type VoiceComposerState, type VoiceProvider, type VoiceProviderHandlers, type VoiceProviderOptions, type VoiceReviewMode, type VoiceSegment, type VoiceTranscript, type VoiceTranscriptMode, defaultChatConfig, getAttachmentKindFromMimeType, getMimeTypeFromDataUrl, mergeConfig, resolveMessageSenderDisplay, useChatUserContext };