@orion-ds/react 5.1.13 → 5.3.0
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/AI_COMPONENTS.md +9 -2
- package/README.md +1 -5
- package/dist/blocks/index.cjs +1 -1
- package/dist/blocks/index.mjs +50 -54
- package/dist/blocks/sections/index.d.ts +0 -2
- package/dist/blocks/sections/index.d.ts.map +1 -1
- package/dist/blocks/templates/index.cjs +1 -1
- package/dist/blocks/templates/index.d.ts +0 -5
- package/dist/blocks/templates/index.d.ts.map +1 -1
- package/dist/blocks/templates/index.mjs +12 -14
- package/dist/blocks.css +0 -4
- package/dist/client.d.ts +1 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/components/ThemeController/ThemeController.cjs +1 -1
- package/dist/components/ThemeController/ThemeController.d.ts.map +1 -1
- package/dist/components/ThemeController/ThemeController.mjs +7 -7
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.d.ts.map +1 -1
- package/dist/hooks/useTheme.cjs +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useTheme.mjs +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/styles.css +0 -2
- package/dist/tokens/types.d.ts +64 -37
- package/dist/tokens/types.d.ts.map +1 -1
- package/dist/utils/fonts.cjs +1 -1
- package/dist/utils/fonts.d.ts.map +1 -1
- package/dist/utils/fonts.mjs +1 -0
- package/package.json +1 -6
- package/dist/blocks/sections/Chat/Chat.cjs +0 -1
- package/dist/blocks/sections/Chat/Chat.d.ts +0 -5
- package/dist/blocks/sections/Chat/Chat.d.ts.map +0 -1
- package/dist/blocks/sections/Chat/Chat.mjs +0 -93
- package/dist/blocks/sections/Chat/Chat.module.css +0 -1
- package/dist/blocks/sections/Chat/Chat.module.css.cjs +0 -1
- package/dist/blocks/sections/Chat/Chat.module.css.mjs +0 -47
- package/dist/blocks/sections/Chat/Chat.types.d.ts +0 -33
- package/dist/blocks/sections/Chat/Chat.types.d.ts.map +0 -1
- package/dist/blocks/sections/Chat/index.d.ts +0 -3
- package/dist/blocks/sections/Chat/index.d.ts.map +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.cjs +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts +0 -5
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.d.ts.map +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.mjs +0 -192
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.cjs +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.module.css.mjs +0 -81
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.types.d.ts +0 -42
- package/dist/blocks/templates/app/ChatPageTemplate/ChatPageTemplate.types.d.ts.map +0 -1
- package/dist/blocks/templates/app/ChatPageTemplate/index.d.ts +0 -3
- package/dist/blocks/templates/app/ChatPageTemplate/index.d.ts.map +0 -1
- package/dist/components/Chat/Chat.cjs +0 -1
- package/dist/components/Chat/Chat.d.ts +0 -22
- package/dist/components/Chat/Chat.d.ts.map +0 -1
- package/dist/components/Chat/Chat.mjs +0 -56
- package/dist/components/Chat/Chat.module.css +0 -1
- package/dist/components/Chat/Chat.module.css.cjs +0 -1
- package/dist/components/Chat/Chat.module.css.mjs +0 -237
- package/dist/components/Chat/Chat.types.d.ts +0 -387
- package/dist/components/Chat/Chat.types.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatAttachment.cjs +0 -1
- package/dist/components/Chat/components/ChatAttachment.d.ts +0 -5
- package/dist/components/Chat/components/ChatAttachment.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatAttachment.mjs +0 -125
- package/dist/components/Chat/components/ChatAudioPlayer.cjs +0 -1
- package/dist/components/Chat/components/ChatAudioPlayer.d.ts +0 -5
- package/dist/components/Chat/components/ChatAudioPlayer.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatAudioPlayer.mjs +0 -127
- package/dist/components/Chat/components/ChatCodeBlock.cjs +0 -1
- package/dist/components/Chat/components/ChatCodeBlock.d.ts +0 -5
- package/dist/components/Chat/components/ChatCodeBlock.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatCodeBlock.mjs +0 -93
- package/dist/components/Chat/components/ChatFileUpload.cjs +0 -1
- package/dist/components/Chat/components/ChatFileUpload.d.ts +0 -5
- package/dist/components/Chat/components/ChatFileUpload.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatFileUpload.mjs +0 -114
- package/dist/components/Chat/components/ChatHeader.cjs +0 -1
- package/dist/components/Chat/components/ChatHeader.d.ts +0 -5
- package/dist/components/Chat/components/ChatHeader.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatHeader.mjs +0 -36
- package/dist/components/Chat/components/ChatImagePreview.cjs +0 -1
- package/dist/components/Chat/components/ChatImagePreview.d.ts +0 -5
- package/dist/components/Chat/components/ChatImagePreview.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatImagePreview.mjs +0 -69
- package/dist/components/Chat/components/ChatInput.cjs +0 -1
- package/dist/components/Chat/components/ChatInput.d.ts +0 -5
- package/dist/components/Chat/components/ChatInput.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatInput.mjs +0 -188
- package/dist/components/Chat/components/ChatLightbox.cjs +0 -1
- package/dist/components/Chat/components/ChatLightbox.d.ts +0 -5
- package/dist/components/Chat/components/ChatLightbox.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatLightbox.mjs +0 -57
- package/dist/components/Chat/components/ChatMarkdown.cjs +0 -1
- package/dist/components/Chat/components/ChatMarkdown.d.ts +0 -5
- package/dist/components/Chat/components/ChatMarkdown.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatMarkdown.mjs +0 -70
- package/dist/components/Chat/components/ChatMessage.cjs +0 -1
- package/dist/components/Chat/components/ChatMessage.d.ts +0 -5
- package/dist/components/Chat/components/ChatMessage.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatMessage.mjs +0 -173
- package/dist/components/Chat/components/ChatMessages.cjs +0 -1
- package/dist/components/Chat/components/ChatMessages.d.ts +0 -5
- package/dist/components/Chat/components/ChatMessages.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatMessages.mjs +0 -46
- package/dist/components/Chat/components/ChatSidebar.cjs +0 -1
- package/dist/components/Chat/components/ChatSidebar.d.ts +0 -5
- package/dist/components/Chat/components/ChatSidebar.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatSidebar.mjs +0 -217
- package/dist/components/Chat/components/ChatTypingIndicator.cjs +0 -1
- package/dist/components/Chat/components/ChatTypingIndicator.d.ts +0 -5
- package/dist/components/Chat/components/ChatTypingIndicator.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatTypingIndicator.mjs +0 -31
- package/dist/components/Chat/components/ChatVoiceRecorder.cjs +0 -1
- package/dist/components/Chat/components/ChatVoiceRecorder.d.ts +0 -5
- package/dist/components/Chat/components/ChatVoiceRecorder.d.ts.map +0 -1
- package/dist/components/Chat/components/ChatVoiceRecorder.mjs +0 -111
- package/dist/components/Chat/components/index.d.ts +0 -18
- package/dist/components/Chat/components/index.d.ts.map +0 -1
- package/dist/components/Chat/hooks/index.d.ts +0 -12
- package/dist/components/Chat/hooks/index.d.ts.map +0 -1
- package/dist/components/Chat/hooks/useAutoScroll.cjs +0 -1
- package/dist/components/Chat/hooks/useAutoScroll.d.ts +0 -24
- package/dist/components/Chat/hooks/useAutoScroll.d.ts.map +0 -1
- package/dist/components/Chat/hooks/useAutoScroll.mjs +0 -50
- package/dist/components/Chat/hooks/useChatInput.cjs +0 -1
- package/dist/components/Chat/hooks/useChatInput.d.ts +0 -43
- package/dist/components/Chat/hooks/useChatInput.d.ts.map +0 -1
- package/dist/components/Chat/hooks/useChatInput.mjs +0 -44
- package/dist/components/Chat/hooks/useStreamingText.d.ts +0 -22
- package/dist/components/Chat/hooks/useStreamingText.d.ts.map +0 -1
- package/dist/components/Chat/hooks/useVoiceRecorder.cjs +0 -1
- package/dist/components/Chat/hooks/useVoiceRecorder.d.ts +0 -26
- package/dist/components/Chat/hooks/useVoiceRecorder.d.ts.map +0 -1
- package/dist/components/Chat/hooks/useVoiceRecorder.mjs +0 -74
- package/dist/components/Chat/index.d.ts +0 -28
- package/dist/components/Chat/index.d.ts.map +0 -1
- package/dist/components/Chat/utils.cjs +0 -1
- package/dist/components/Chat/utils.d.ts +0 -16
- package/dist/components/Chat/utils.d.ts.map +0 -1
- package/dist/components/Chat/utils.mjs +0 -12
- package/dist/rich.cjs +0 -1
- package/dist/rich.d.ts +0 -16
- package/dist/rich.d.ts.map +0 -1
- package/dist/rich.mjs +0 -4
|
@@ -1,387 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode, TextareaHTMLAttributes, RefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Message role types
|
|
5
|
-
*/
|
|
6
|
-
export type ChatRole = "user" | "assistant" | "system";
|
|
7
|
-
/**
|
|
8
|
-
* Message delivery status
|
|
9
|
-
*/
|
|
10
|
-
export type MessageStatus = "sending" | "sent" | "error" | "streaming";
|
|
11
|
-
/**
|
|
12
|
-
* Attachment types for multimodal support
|
|
13
|
-
*/
|
|
14
|
-
export type AttachmentType = "image" | "audio" | "file" | "code";
|
|
15
|
-
/**
|
|
16
|
-
* Message reaction types (feedback)
|
|
17
|
-
*/
|
|
18
|
-
export type MessageReaction = "like" | "dislike";
|
|
19
|
-
/**
|
|
20
|
-
* Base attachment interface
|
|
21
|
-
*/
|
|
22
|
-
export interface ChatAttachment {
|
|
23
|
-
/** Unique identifier for the attachment */
|
|
24
|
-
id: string;
|
|
25
|
-
/** Type of attachment */
|
|
26
|
-
type: AttachmentType;
|
|
27
|
-
/** Display name for the attachment */
|
|
28
|
-
name: string;
|
|
29
|
-
/** URL for media files (images, audio, etc.) */
|
|
30
|
-
url?: string;
|
|
31
|
-
/** Content for code blocks */
|
|
32
|
-
content?: string;
|
|
33
|
-
/** Programming language for syntax highlighting */
|
|
34
|
-
language?: string;
|
|
35
|
-
/** MIME type of the file */
|
|
36
|
-
mimeType?: string;
|
|
37
|
-
/** File size in bytes */
|
|
38
|
-
size?: number;
|
|
39
|
-
/** Audio duration in seconds */
|
|
40
|
-
duration?: number;
|
|
41
|
-
/** Thumbnail URL for images */
|
|
42
|
-
thumbnail?: string;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Chat message structure
|
|
46
|
-
*/
|
|
47
|
-
export interface ChatMessage {
|
|
48
|
-
/** Unique identifier for the message */
|
|
49
|
-
id: string;
|
|
50
|
-
/** Message sender role */
|
|
51
|
-
role: ChatRole;
|
|
52
|
-
/** Message content (supports Markdown) */
|
|
53
|
-
content: string;
|
|
54
|
-
/** Timestamp of the message */
|
|
55
|
-
timestamp?: Date;
|
|
56
|
-
/** Message delivery status */
|
|
57
|
-
status?: MessageStatus;
|
|
58
|
-
/** Attached files, images, audio, or code */
|
|
59
|
-
attachments?: ChatAttachment[];
|
|
60
|
-
/** Whether the message is currently streaming */
|
|
61
|
-
isStreaming?: boolean;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Conversation for sidebar listing
|
|
65
|
-
*/
|
|
66
|
-
export interface ChatConversation {
|
|
67
|
-
/** Unique identifier for the conversation */
|
|
68
|
-
id: string;
|
|
69
|
-
/** Conversation title */
|
|
70
|
-
title: string;
|
|
71
|
-
/** Preview of the last message */
|
|
72
|
-
preview?: string;
|
|
73
|
-
/** Last update timestamp */
|
|
74
|
-
updatedAt: Date;
|
|
75
|
-
/** Total number of messages */
|
|
76
|
-
messageCount?: number;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Voice recorder state interface
|
|
80
|
-
*/
|
|
81
|
-
export interface VoiceRecorderState {
|
|
82
|
-
/** Whether currently recording */
|
|
83
|
-
isRecording: boolean;
|
|
84
|
-
/** Recording duration in seconds */
|
|
85
|
-
duration: number;
|
|
86
|
-
/** Recorded audio blob */
|
|
87
|
-
audioBlob?: Blob;
|
|
88
|
-
/** Recording error */
|
|
89
|
-
error?: string;
|
|
90
|
-
}
|
|
91
|
-
/**
|
|
92
|
-
* Main Chat container props
|
|
93
|
-
*/
|
|
94
|
-
export interface ChatProps extends HTMLAttributes<HTMLDivElement> {
|
|
95
|
-
/** Chat content (compound components) */
|
|
96
|
-
children?: ReactNode;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Chat Header props
|
|
100
|
-
*/
|
|
101
|
-
export interface ChatHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
102
|
-
/** Title displayed in the header */
|
|
103
|
-
title?: string;
|
|
104
|
-
/** Subtitle or description */
|
|
105
|
-
subtitle?: string;
|
|
106
|
-
/** Avatar or icon to display */
|
|
107
|
-
avatar?: ReactNode;
|
|
108
|
-
/** Actions (buttons, menu) on the right side */
|
|
109
|
-
actions?: ReactNode;
|
|
110
|
-
/** Custom content */
|
|
111
|
-
children?: ReactNode;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Chat Messages container props
|
|
115
|
-
*/
|
|
116
|
-
export interface ChatMessagesProps extends HTMLAttributes<HTMLDivElement> {
|
|
117
|
-
/** Message content */
|
|
118
|
-
children?: ReactNode;
|
|
119
|
-
/** Reference for scroll control */
|
|
120
|
-
scrollRef?: RefObject<HTMLDivElement>;
|
|
121
|
-
/** Enable auto-scroll to latest message */
|
|
122
|
-
autoScroll?: boolean;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Individual chat message props
|
|
126
|
-
*/
|
|
127
|
-
export interface ChatMessageProps extends HTMLAttributes<HTMLDivElement> {
|
|
128
|
-
/** Message sender role */
|
|
129
|
-
role: ChatRole;
|
|
130
|
-
/** Message content (supports Markdown) */
|
|
131
|
-
content: string;
|
|
132
|
-
/** Timestamp of the message */
|
|
133
|
-
timestamp?: Date;
|
|
134
|
-
/** Message delivery status */
|
|
135
|
-
status?: MessageStatus;
|
|
136
|
-
/** Attached files, images, audio, or code */
|
|
137
|
-
attachments?: ChatAttachment[];
|
|
138
|
-
/** Custom avatar element */
|
|
139
|
-
avatar?: ReactNode;
|
|
140
|
-
/** Whether to show the avatar (defaults to false) */
|
|
141
|
-
showAvatar?: boolean;
|
|
142
|
-
/** Action buttons (copy, regenerate, etc.) */
|
|
143
|
-
actions?: ReactNode;
|
|
144
|
-
/** Whether the message is streaming */
|
|
145
|
-
isStreaming?: boolean;
|
|
146
|
-
/** Callback when an image attachment is clicked */
|
|
147
|
-
onImageClick?: (attachment: ChatAttachment) => void;
|
|
148
|
-
/** Callback to retry sending a failed message */
|
|
149
|
-
onRetry?: () => void;
|
|
150
|
-
/** Current reaction on this message */
|
|
151
|
-
reaction?: MessageReaction;
|
|
152
|
-
/** Callback when user reacts to a message */
|
|
153
|
-
onReaction?: (reaction: MessageReaction) => void;
|
|
154
|
-
/** Custom content instead of default rendering */
|
|
155
|
-
children?: ReactNode;
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Chat input props
|
|
159
|
-
*/
|
|
160
|
-
export interface ChatInputProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "onSubmit"> {
|
|
161
|
-
/** Callback when message is sent */
|
|
162
|
-
onSend?: (message: string, attachments?: File[]) => void;
|
|
163
|
-
/** Allow file attachments (images, files) */
|
|
164
|
-
allowAttachments?: boolean;
|
|
165
|
-
/** Allow voice recording */
|
|
166
|
-
allowVoiceRecording?: boolean;
|
|
167
|
-
/** Allow audio file upload */
|
|
168
|
-
allowAudioUpload?: boolean;
|
|
169
|
-
/** Whether input is disabled */
|
|
170
|
-
disabled?: boolean;
|
|
171
|
-
/** Maximum character count */
|
|
172
|
-
maxLength?: number;
|
|
173
|
-
/** Accepted file types for upload */
|
|
174
|
-
acceptedFileTypes?: string[];
|
|
175
|
-
/** Whether a message is being sent */
|
|
176
|
-
isLoading?: boolean;
|
|
177
|
-
/** Pending attachments to display */
|
|
178
|
-
pendingAttachments?: File[];
|
|
179
|
-
/** Callback to remove a pending attachment */
|
|
180
|
-
onRemoveAttachment?: (index: number) => void;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Typing indicator props
|
|
184
|
-
*/
|
|
185
|
-
export interface ChatTypingIndicatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
186
|
-
/** Label text (default: "Assistant is typing") */
|
|
187
|
-
label?: string;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Code block props
|
|
191
|
-
*/
|
|
192
|
-
export interface ChatCodeBlockProps extends HTMLAttributes<HTMLDivElement> {
|
|
193
|
-
/** Code content */
|
|
194
|
-
code: string;
|
|
195
|
-
/** Programming language for syntax highlighting */
|
|
196
|
-
language?: string;
|
|
197
|
-
/** Show line numbers */
|
|
198
|
-
showLineNumbers?: boolean;
|
|
199
|
-
/** Show copy button */
|
|
200
|
-
showCopyButton?: boolean;
|
|
201
|
-
/** Maximum height before scrolling */
|
|
202
|
-
maxHeight?: string;
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Markdown renderer props
|
|
206
|
-
*/
|
|
207
|
-
export interface ChatMarkdownProps extends HTMLAttributes<HTMLDivElement> {
|
|
208
|
-
/** Markdown content to render */
|
|
209
|
-
content: string;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Image preview props
|
|
213
|
-
*/
|
|
214
|
-
export interface ChatImagePreviewProps extends HTMLAttributes<HTMLDivElement> {
|
|
215
|
-
/** Image source URL */
|
|
216
|
-
src: string;
|
|
217
|
-
/** Alt text for accessibility */
|
|
218
|
-
alt?: string;
|
|
219
|
-
/** Thumbnail URL (optional, uses src if not provided) */
|
|
220
|
-
thumbnail?: string;
|
|
221
|
-
/** Callback when image is clicked */
|
|
222
|
-
onClick?: () => void;
|
|
223
|
-
/** Enable lightbox on click */
|
|
224
|
-
enableLightbox?: boolean;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Audio player props
|
|
228
|
-
*/
|
|
229
|
-
export interface ChatAudioPlayerProps extends HTMLAttributes<HTMLDivElement> {
|
|
230
|
-
/** Audio source URL */
|
|
231
|
-
src: string;
|
|
232
|
-
/** Duration in seconds (optional, auto-detected if not provided) */
|
|
233
|
-
duration?: number;
|
|
234
|
-
/** Audio title/name */
|
|
235
|
-
title?: string;
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Voice recorder props
|
|
239
|
-
*/
|
|
240
|
-
export interface ChatVoiceRecorderProps extends HTMLAttributes<HTMLDivElement> {
|
|
241
|
-
/** Callback when recording is complete */
|
|
242
|
-
onRecordingComplete?: (blob: Blob) => void;
|
|
243
|
-
/** Callback when recording is cancelled */
|
|
244
|
-
onCancel?: () => void;
|
|
245
|
-
/** Maximum recording duration in seconds */
|
|
246
|
-
maxDuration?: number;
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* File upload zone props
|
|
250
|
-
*/
|
|
251
|
-
export interface ChatFileUploadProps extends HTMLAttributes<HTMLDivElement> {
|
|
252
|
-
/** Callback when files are selected */
|
|
253
|
-
onFilesSelected?: (files: File[]) => void;
|
|
254
|
-
/** Accepted file types */
|
|
255
|
-
accept?: string[];
|
|
256
|
-
/** Allow multiple files */
|
|
257
|
-
multiple?: boolean;
|
|
258
|
-
/** Maximum file size in bytes */
|
|
259
|
-
maxSize?: number;
|
|
260
|
-
/** Custom upload button content */
|
|
261
|
-
children?: ReactNode;
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* Attachment preview props (unified)
|
|
265
|
-
*/
|
|
266
|
-
export interface ChatAttachmentPreviewProps extends HTMLAttributes<HTMLDivElement> {
|
|
267
|
-
/** Attachment data */
|
|
268
|
-
attachment: ChatAttachment;
|
|
269
|
-
/** Show remove button */
|
|
270
|
-
removable?: boolean;
|
|
271
|
-
/** Callback when remove is clicked */
|
|
272
|
-
onRemove?: () => void;
|
|
273
|
-
/** Callback when attachment is clicked */
|
|
274
|
-
onClick?: () => void;
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Chat sidebar props
|
|
278
|
-
*/
|
|
279
|
-
export interface ChatSidebarProps extends HTMLAttributes<HTMLDivElement> {
|
|
280
|
-
/** List of conversations */
|
|
281
|
-
conversations?: ChatConversation[];
|
|
282
|
-
/** Currently active conversation ID */
|
|
283
|
-
activeConversationId?: string;
|
|
284
|
-
/** Callback when a conversation is selected */
|
|
285
|
-
onSelectConversation?: (id: string) => void;
|
|
286
|
-
/** Callback when new conversation is created */
|
|
287
|
-
onNewConversation?: () => void;
|
|
288
|
-
/** Callback when a conversation is deleted */
|
|
289
|
-
onDeleteConversation?: (id: string) => void;
|
|
290
|
-
/** Callback when search query changes */
|
|
291
|
-
onSearch?: (query: string) => void;
|
|
292
|
-
/** Custom header content */
|
|
293
|
-
header?: ReactNode;
|
|
294
|
-
/** Custom footer content */
|
|
295
|
-
footer?: ReactNode;
|
|
296
|
-
/** Whether sidebar is collapsed (mobile) */
|
|
297
|
-
collapsed?: boolean;
|
|
298
|
-
/** Callback when collapse state changes */
|
|
299
|
-
onCollapsedChange?: (collapsed: boolean) => void;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* ChatSection props (sidebar + chat)
|
|
303
|
-
*/
|
|
304
|
-
export interface ChatSectionProps extends HTMLAttributes<HTMLDivElement> {
|
|
305
|
-
/** List of conversations for sidebar */
|
|
306
|
-
conversations?: ChatConversation[];
|
|
307
|
-
/** Currently active conversation ID */
|
|
308
|
-
activeConversationId?: string;
|
|
309
|
-
/** Messages for the active conversation */
|
|
310
|
-
messages?: ChatMessage[];
|
|
311
|
-
/** Callback when a message is sent */
|
|
312
|
-
onSendMessage?: (message: string, attachments?: File[]) => void;
|
|
313
|
-
/** Callback when a conversation is selected */
|
|
314
|
-
onSelectConversation?: (id: string) => void;
|
|
315
|
-
/** Callback when new conversation is created */
|
|
316
|
-
onNewConversation?: () => void;
|
|
317
|
-
/** Callback when a conversation is deleted */
|
|
318
|
-
onDeleteConversation?: (id: string) => void;
|
|
319
|
-
/** Whether assistant is typing */
|
|
320
|
-
isTyping?: boolean;
|
|
321
|
-
/** Whether message is being sent */
|
|
322
|
-
isLoading?: boolean;
|
|
323
|
-
/** Chat header configuration */
|
|
324
|
-
header?: {
|
|
325
|
-
title?: string;
|
|
326
|
-
subtitle?: string;
|
|
327
|
-
avatar?: ReactNode;
|
|
328
|
-
actions?: ReactNode;
|
|
329
|
-
};
|
|
330
|
-
/** Input configuration */
|
|
331
|
-
inputConfig?: {
|
|
332
|
-
placeholder?: string;
|
|
333
|
-
allowAttachments?: boolean;
|
|
334
|
-
allowVoiceRecording?: boolean;
|
|
335
|
-
maxLength?: number;
|
|
336
|
-
};
|
|
337
|
-
/** Hide sidebar (full-width chat) */
|
|
338
|
-
hideSidebar?: boolean;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* ChatPageTemplate props (full page layout)
|
|
342
|
-
*/
|
|
343
|
-
export interface ChatPageTemplateProps extends HTMLAttributes<HTMLDivElement> {
|
|
344
|
-
/** List of conversations */
|
|
345
|
-
conversations?: ChatConversation[];
|
|
346
|
-
/** Currently active conversation ID */
|
|
347
|
-
activeConversationId?: string;
|
|
348
|
-
/** Callback when a conversation is selected */
|
|
349
|
-
onSelectConversation?: (id: string) => void;
|
|
350
|
-
/** Callback when new conversation is created */
|
|
351
|
-
onNewConversation?: () => void;
|
|
352
|
-
/** Callback when a conversation is deleted */
|
|
353
|
-
onDeleteConversation?: (id: string) => void;
|
|
354
|
-
/** Messages for the active conversation */
|
|
355
|
-
messages?: ChatMessage[];
|
|
356
|
-
/** Callback when a message is sent */
|
|
357
|
-
onSendMessage?: (message: string, attachments?: File[]) => void;
|
|
358
|
-
/** Whether assistant is typing */
|
|
359
|
-
isTyping?: boolean;
|
|
360
|
-
/** Whether message is being sent */
|
|
361
|
-
isLoading?: boolean;
|
|
362
|
-
/** User information for header */
|
|
363
|
-
user?: {
|
|
364
|
-
name: string;
|
|
365
|
-
avatar?: string;
|
|
366
|
-
};
|
|
367
|
-
/** Callback when user logs out */
|
|
368
|
-
onLogout?: () => void;
|
|
369
|
-
/** Custom logo element */
|
|
370
|
-
logo?: ReactNode;
|
|
371
|
-
/** Chat input configuration */
|
|
372
|
-
inputConfig?: ChatSectionProps["inputConfig"];
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Image lightbox props
|
|
376
|
-
*/
|
|
377
|
-
export interface ChatLightboxProps extends HTMLAttributes<HTMLDivElement> {
|
|
378
|
-
/** Image source URL */
|
|
379
|
-
src: string;
|
|
380
|
-
/** Alt text for accessibility */
|
|
381
|
-
alt?: string;
|
|
382
|
-
/** Whether lightbox is open */
|
|
383
|
-
isOpen: boolean;
|
|
384
|
-
/** Callback when lightbox is closed */
|
|
385
|
-
onClose: () => void;
|
|
386
|
-
}
|
|
387
|
-
//# sourceMappingURL=Chat.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Chat.types.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/Chat.types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,SAAS,EACV,MAAM,OAAO,CAAC;AAMf;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEjE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;AAMjD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,EAAE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;AAMD;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,uCAAuC;IACvC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("lucide-react"),p=require("./ChatImagePreview.cjs"),P=require("./ChatAudioPlayer.cjs"),b=require("./ChatCodeBlock.cjs"),C=require("../utils.cjs"),t=require("../Chat.module.css.cjs"),w=d=>{switch(d){case"image":return e.jsx(a.Image,{size:18});case"audio":return e.jsx(a.Music,{size:18});case"code":return e.jsx(a.Code,{size:18});default:return e.jsx(a.FileText,{size:18})}},v=({attachment:d,removable:h=!1,onRemove:i,onClick:n,className:c,...o})=>{const{type:m,name:s,url:l,content:j,language:f,size:x,duration:u,thumbnail:g}=d;switch(m){case"image":if(l)return e.jsxs("div",{className:c,style:{position:"relative"},...o,children:[e.jsx(p.ChatImagePreview,{src:l,alt:s,thumbnail:g,onClick:n}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,style:{position:"absolute",top:4,right:4,background:"var(--surface-base)"},children:e.jsx(a.X,{size:14})})]});break;case"audio":if(l)return e.jsxs("div",{className:c,style:{position:"relative"},...o,children:[e.jsx(P.ChatAudioPlayer,{src:l,duration:u,title:s}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,children:e.jsx(a.X,{size:14})})]});break;case"code":if(j)return e.jsx(b.ChatCodeBlock,{code:j,language:f,className:c,...o});break}return e.jsxs("div",{className:[t.default.attachmentPreview,c].filter(Boolean).join(" "),onClick:n,role:n?"button":void 0,tabIndex:n?0:void 0,...o,children:[e.jsx("div",{className:t.default.attachmentPreviewIcon,children:w(m)}),e.jsxs("div",{className:t.default.attachmentPreviewInfo,children:[e.jsx("span",{className:t.default.attachmentPreviewName,children:s}),x&&e.jsxs("span",{className:t.default.attachmentPreviewMeta,children:[C.formatFileSize(x),u&&` · ${Math.floor(u/60)}:${(u%60).toString().padStart(2,"0")}`]})]}),h&&i&&e.jsx("button",{className:t.default.attachmentPreviewRemove,onClick:r=>{r.stopPropagation(),i()},"aria-label":`Remove ${s}`,children:e.jsx(a.X,{size:14})})]})};v.displayName="ChatAttachment";exports.ChatAttachment=v;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatAttachment.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatAttachment.tsx"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,0BAA0B,EAAkB,MAAM,eAAe,CAAC;AAqBhF,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA0H/D,CAAC"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { X as u, FileText as P, Code as w, Music as z, Image as y } from "lucide-react";
|
|
3
|
-
import { ChatImagePreview as C } from "./ChatImagePreview.mjs";
|
|
4
|
-
import { ChatAudioPlayer as N } from "./ChatAudioPlayer.mjs";
|
|
5
|
-
import { ChatCodeBlock as I } from "./ChatCodeBlock.mjs";
|
|
6
|
-
import { formatFileSize as k } from "../utils.mjs";
|
|
7
|
-
import t from "../Chat.module.css.mjs";
|
|
8
|
-
const x = (d) => {
|
|
9
|
-
switch (d) {
|
|
10
|
-
case "image":
|
|
11
|
-
return /* @__PURE__ */ e(y, { size: 18 });
|
|
12
|
-
case "audio":
|
|
13
|
-
return /* @__PURE__ */ e(z, { size: 18 });
|
|
14
|
-
case "code":
|
|
15
|
-
return /* @__PURE__ */ e(w, { size: 18 });
|
|
16
|
-
default:
|
|
17
|
-
return /* @__PURE__ */ e(P, { size: 18 });
|
|
18
|
-
}
|
|
19
|
-
}, $ = ({
|
|
20
|
-
attachment: d,
|
|
21
|
-
removable: h = !1,
|
|
22
|
-
onRemove: a,
|
|
23
|
-
onClick: n,
|
|
24
|
-
className: s,
|
|
25
|
-
...c
|
|
26
|
-
}) => {
|
|
27
|
-
const { type: p, name: i, url: l, content: v, language: b, size: f, duration: m, thumbnail: g } = d;
|
|
28
|
-
switch (p) {
|
|
29
|
-
case "image":
|
|
30
|
-
if (l)
|
|
31
|
-
return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
|
|
32
|
-
/* @__PURE__ */ e(
|
|
33
|
-
C,
|
|
34
|
-
{
|
|
35
|
-
src: l,
|
|
36
|
-
alt: i,
|
|
37
|
-
thumbnail: g,
|
|
38
|
-
onClick: n
|
|
39
|
-
}
|
|
40
|
-
),
|
|
41
|
-
h && a && /* @__PURE__ */ e(
|
|
42
|
-
"button",
|
|
43
|
-
{
|
|
44
|
-
className: t.attachmentPreviewRemove,
|
|
45
|
-
onClick: (r) => {
|
|
46
|
-
r.stopPropagation(), a();
|
|
47
|
-
},
|
|
48
|
-
"aria-label": `Remove ${i}`,
|
|
49
|
-
style: {
|
|
50
|
-
position: "absolute",
|
|
51
|
-
top: 4,
|
|
52
|
-
right: 4,
|
|
53
|
-
background: "var(--surface-base)"
|
|
54
|
-
},
|
|
55
|
-
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
56
|
-
}
|
|
57
|
-
)
|
|
58
|
-
] });
|
|
59
|
-
break;
|
|
60
|
-
case "audio":
|
|
61
|
-
if (l)
|
|
62
|
-
return /* @__PURE__ */ o("div", { className: s, style: { position: "relative" }, ...c, children: [
|
|
63
|
-
/* @__PURE__ */ e(N, { src: l, duration: m, title: i }),
|
|
64
|
-
h && a && /* @__PURE__ */ e(
|
|
65
|
-
"button",
|
|
66
|
-
{
|
|
67
|
-
className: t.attachmentPreviewRemove,
|
|
68
|
-
onClick: (r) => {
|
|
69
|
-
r.stopPropagation(), a();
|
|
70
|
-
},
|
|
71
|
-
"aria-label": `Remove ${i}`,
|
|
72
|
-
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
73
|
-
}
|
|
74
|
-
)
|
|
75
|
-
] });
|
|
76
|
-
break;
|
|
77
|
-
case "code":
|
|
78
|
-
if (v)
|
|
79
|
-
return /* @__PURE__ */ e(
|
|
80
|
-
I,
|
|
81
|
-
{
|
|
82
|
-
code: v,
|
|
83
|
-
language: b,
|
|
84
|
-
className: s,
|
|
85
|
-
...c
|
|
86
|
-
}
|
|
87
|
-
);
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
return /* @__PURE__ */ o(
|
|
91
|
-
"div",
|
|
92
|
-
{
|
|
93
|
-
className: [t.attachmentPreview, s].filter(Boolean).join(" "),
|
|
94
|
-
onClick: n,
|
|
95
|
-
role: n ? "button" : void 0,
|
|
96
|
-
tabIndex: n ? 0 : void 0,
|
|
97
|
-
...c,
|
|
98
|
-
children: [
|
|
99
|
-
/* @__PURE__ */ e("div", { className: t.attachmentPreviewIcon, children: x(p) }),
|
|
100
|
-
/* @__PURE__ */ o("div", { className: t.attachmentPreviewInfo, children: [
|
|
101
|
-
/* @__PURE__ */ e("span", { className: t.attachmentPreviewName, children: i }),
|
|
102
|
-
f && /* @__PURE__ */ o("span", { className: t.attachmentPreviewMeta, children: [
|
|
103
|
-
k(f),
|
|
104
|
-
m && ` · ${Math.floor(m / 60)}:${(m % 60).toString().padStart(2, "0")}`
|
|
105
|
-
] })
|
|
106
|
-
] }),
|
|
107
|
-
h && a && /* @__PURE__ */ e(
|
|
108
|
-
"button",
|
|
109
|
-
{
|
|
110
|
-
className: t.attachmentPreviewRemove,
|
|
111
|
-
onClick: (r) => {
|
|
112
|
-
r.stopPropagation(), a();
|
|
113
|
-
},
|
|
114
|
-
"aria-label": `Remove ${i}`,
|
|
115
|
-
children: /* @__PURE__ */ e(u, { size: 14 })
|
|
116
|
-
}
|
|
117
|
-
)
|
|
118
|
-
]
|
|
119
|
-
}
|
|
120
|
-
);
|
|
121
|
-
};
|
|
122
|
-
$.displayName = "ChatAttachment";
|
|
123
|
-
export {
|
|
124
|
-
$ as ChatAttachment
|
|
125
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),r=require("react"),P=require("lucide-react"),m=require("../utils.cjs"),l=require("../Chat.module.css.cjs"),p=({src:k,duration:T,title:h,className:b,...x})=>{const[o,f]=r.useState(!1),[s,d]=r.useState(0),[a,g]=r.useState(T||0),n=r.useRef(null),j=r.useCallback(()=>{const e=n.current;e&&!isNaN(e.duration)&&isFinite(e.duration)&&g(e.duration)},[]),v=r.useCallback(()=>{const e=n.current;e&&d(e.currentTime)},[]),C=r.useCallback(()=>{f(!1),d(0)},[]),w=r.useCallback(()=>{const e=n.current;e&&(o?e.pause():e.play().catch(()=>{f(!1)}),f(!o))},[o]),N=r.useCallback(e=>{const c=n.current;if(!c||!a)return;const u=e.currentTarget.getBoundingClientRect(),y=(e.clientX-u.left)/u.width*a;c.currentTime=y,d(y)},[a]),A=r.useCallback(e=>{const c=n.current;if(!c||!a)return;const u=5;let i=s;switch(e.key){case"ArrowRight":case"ArrowUp":e.preventDefault(),i=Math.min(s+u,a);break;case"ArrowLeft":case"ArrowDown":e.preventDefault(),i=Math.max(s-u,0);break;case"Home":e.preventDefault(),i=0;break;case"End":e.preventDefault(),i=a;break;default:return}c.currentTime=i,d(i)},[s,a]),D=a>0?s/a*100:0;return r.useEffect(()=>()=>{const e=n.current;e&&e.pause()},[]),t.jsxs("div",{className:[l.default.audioPlayer,b].filter(Boolean).join(" "),...x,children:[t.jsx("audio",{ref:n,src:k,onLoadedMetadata:j,onTimeUpdate:v,onEnded:C,preload:"metadata"}),t.jsx("button",{className:l.default.audioPlayerButton,onClick:w,"aria-label":o?"Pause":"Play",children:o?t.jsx(P.Pause,{size:16}):t.jsx(P.Play,{size:16})}),t.jsxs("div",{className:l.default.audioPlayerProgress,children:[h&&t.jsx("span",{className:l.default.attachmentPreviewName,children:h}),t.jsx("div",{className:l.default.audioPlayerTrack,onClick:N,onKeyDown:A,role:"slider","aria-label":"Audio progress","aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":s,"aria-valuetext":`${m.formatTime(s)} of ${m.formatTime(a)}`,tabIndex:0,children:t.jsx("div",{className:l.default.audioPlayerFill,style:{width:`${D}%`}})}),t.jsxs("div",{className:l.default.audioPlayerTime,children:[t.jsx("span",{children:m.formatTime(s)}),t.jsx("span",{children:m.formatTime(a)})]})]})]})};p.displayName="ChatAudioPlayer";exports.ChatAudioPlayer=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChatAudioPlayer.d.ts","sourceRoot":"","sources":["../../../../src/components/Chat/components/ChatAudioPlayer.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AAExE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAI1D,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsK1D,CAAC"}
|