@iota-uz/sdk 0.4.32 → 0.4.34
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/bichat/index.cjs +262 -64
- package/dist/bichat/index.cjs.map +1 -1
- package/dist/bichat/index.d.cts +13 -2
- package/dist/bichat/index.d.ts +13 -2
- package/dist/bichat/index.mjs +262 -64
- package/dist/bichat/index.mjs.map +1 -1
- package/package.json +1 -1
- package/tailwind/compiled.css +1 -1
package/dist/bichat/index.d.cts
CHANGED
|
@@ -1807,6 +1807,7 @@ interface ActivityTraceProps {
|
|
|
1807
1807
|
declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null;
|
|
1808
1808
|
declare const ActivityTrace: react.MemoExoticComponent<typeof ActivityTraceInner>;
|
|
1809
1809
|
|
|
1810
|
+
type ActiveTab = 'my-chats' | 'all-chats';
|
|
1810
1811
|
interface SidebarProps {
|
|
1811
1812
|
dataSource: ChatDataSource;
|
|
1812
1813
|
onSessionSelect: (sessionId: string) => void;
|
|
@@ -1820,8 +1821,12 @@ interface SidebarProps {
|
|
|
1820
1821
|
headerSlot?: react__default.ReactNode;
|
|
1821
1822
|
footerSlot?: react__default.ReactNode;
|
|
1822
1823
|
className?: string;
|
|
1824
|
+
/** Controlled active tab. When provided, overrides internal state. */
|
|
1825
|
+
activeTab?: ActiveTab;
|
|
1826
|
+
/** Called when tab changes. Use with activeTab for controlled mode. */
|
|
1827
|
+
onTabChange?: (tab: ActiveTab) => void;
|
|
1823
1828
|
}
|
|
1824
|
-
declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1829
|
+
declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, activeTab: controlledActiveTab, onTabChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1825
1830
|
|
|
1826
1831
|
/**
|
|
1827
1832
|
* SessionItem Component
|
|
@@ -3277,6 +3282,12 @@ interface UseBichatRouterReturn {
|
|
|
3277
3282
|
onArchivedView: () => void;
|
|
3278
3283
|
/** Navigate back (e.g. to home) */
|
|
3279
3284
|
onBack: () => void;
|
|
3285
|
+
/** Navigate to all-chats view */
|
|
3286
|
+
onAllChatsView: () => void;
|
|
3287
|
+
/** Current sidebar tab derived from URL */
|
|
3288
|
+
sidebarTab: 'my-chats' | 'all-chats';
|
|
3289
|
+
/** Handler to change sidebar tab (navigates to appropriate URL) */
|
|
3290
|
+
onSidebarTabChange: (tab: 'my-chats' | 'all-chats') => void;
|
|
3280
3291
|
}
|
|
3281
3292
|
/**
|
|
3282
3293
|
* Derives BiChat navigation callbacks and activeSessionId from router state.
|
|
@@ -4248,4 +4259,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
4248
4259
|
*/
|
|
4249
4260
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
4250
4261
|
|
|
4251
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
4262
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActiveTab, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
package/dist/bichat/index.d.ts
CHANGED
|
@@ -1807,6 +1807,7 @@ interface ActivityTraceProps {
|
|
|
1807
1807
|
declare function ActivityTraceInner({ thinkingContent, activeSteps, toolLabelPrefix, className, }: ActivityTraceProps): react_jsx_runtime.JSX.Element | null;
|
|
1808
1808
|
declare const ActivityTrace: react.MemoExoticComponent<typeof ActivityTraceInner>;
|
|
1809
1809
|
|
|
1810
|
+
type ActiveTab = 'my-chats' | 'all-chats';
|
|
1810
1811
|
interface SidebarProps {
|
|
1811
1812
|
dataSource: ChatDataSource;
|
|
1812
1813
|
onSessionSelect: (sessionId: string) => void;
|
|
@@ -1820,8 +1821,12 @@ interface SidebarProps {
|
|
|
1820
1821
|
headerSlot?: react__default.ReactNode;
|
|
1821
1822
|
footerSlot?: react__default.ReactNode;
|
|
1822
1823
|
className?: string;
|
|
1824
|
+
/** Controlled active tab. When provided, overrides internal state. */
|
|
1825
|
+
activeTab?: ActiveTab;
|
|
1826
|
+
/** Called when tab changes. Use with activeTab for controlled mode. */
|
|
1827
|
+
onTabChange?: (tab: ActiveTab) => void;
|
|
1823
1828
|
}
|
|
1824
|
-
declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1829
|
+
declare function Sidebar({ dataSource, onSessionSelect, onNewChat, onArchivedView, activeSessionId, creating, showAllChatsTab, isOpen: _isOpen, onClose, headerSlot, footerSlot, className, activeTab: controlledActiveTab, onTabChange, }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
1825
1830
|
|
|
1826
1831
|
/**
|
|
1827
1832
|
* SessionItem Component
|
|
@@ -3277,6 +3282,12 @@ interface UseBichatRouterReturn {
|
|
|
3277
3282
|
onArchivedView: () => void;
|
|
3278
3283
|
/** Navigate back (e.g. to home) */
|
|
3279
3284
|
onBack: () => void;
|
|
3285
|
+
/** Navigate to all-chats view */
|
|
3286
|
+
onAllChatsView: () => void;
|
|
3287
|
+
/** Current sidebar tab derived from URL */
|
|
3288
|
+
sidebarTab: 'my-chats' | 'all-chats';
|
|
3289
|
+
/** Handler to change sidebar tab (navigates to appropriate URL) */
|
|
3290
|
+
onSidebarTabChange: (tab: 'my-chats' | 'all-chats') => void;
|
|
3280
3291
|
}
|
|
3281
3292
|
/**
|
|
3282
3293
|
* Derives BiChat navigation callbacks and activeSessionId from router state.
|
|
@@ -4248,4 +4259,4 @@ declare function isPermissionDeniedError(error: unknown): boolean;
|
|
|
4248
4259
|
*/
|
|
4249
4260
|
declare function toErrorDisplay(error: unknown, fallbackTitle: string): RPCErrorDisplay;
|
|
4250
4261
|
|
|
4251
|
-
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
|
4262
|
+
export { ATTACHMENT_ACCEPT_ATTRIBUTE, ActionButton, type ActionButtonIconProps, type ActionButtonLabelProps, type ActionButtonRootProps, type ActionButtonTooltipProps, type ActiveTab, type ActivityStep, ActivityTrace, type ActivityTraceProps, type AdminStore, _default$1 as Alert, AllChatsList, type AppConfig, _default as ArchiveBanner, ArchivedChatList, type Artifact$1 as Artifact, type ArtifactStore, type AsChildProps, AssistantMessage, type AssistantMessageActionsSlotProps, type AssistantMessageArtifactsSlotProps, type AssistantMessageAvatarSlotProps, type AssistantMessageChartsSlotProps, type AssistantMessageClassNames, type AssistantMessageCodeOutputsSlotProps, type AssistantMessageContentSlotProps, type AssistantMessageExplanationSlotProps, type AssistantMessageProps, type AssistantMessageSlots, type AssistantMessageSourcesSlotProps, type AssistantMessageTablesSlotProps, type AssistantTurn$1 as AssistantTurn, AssistantTurnView, type AssistantTurnViewProps, type Attachment$1 as Attachment, MemoizedAttachmentGrid as AttachmentGrid, AttachmentPreview, AttachmentUpload, Avatar, type AvatarFallbackProps, type AvatarImageProps, type AvatarRootProps, AvatarStack, type AvatarStackProps, type BiChatConfig, BiChatLayout, type BiChatLayoutProps, type BichatRPC, Bubble, type BubbleContentProps, type BubbleFooterProps, type BubbleHeaderProps, type BubbleMetadataProps, type BubbleRootProps, type BubbleVariant, CHART_VISUAL, ChartCard, type ChartCardHost, type ChartData, type ChartSeries, type ChatDataSource, ChatHeader, type ChatInputStateValue, ChatMachine, type ChatMachineConfig, type ChatMessagingStateValue, ChatSession, type ChatSessionContextValue, type ChatSessionProps, ChatSessionProvider, type ChatSessionProviderProps, type ChatSessionStateValue, type Citation$1 as Citation, MemoizedCodeBlock as CodeBlock, type CodeOutput$1 as CodeOutput, CodeOutputsPanel, type ColumnMeta, type ColumnStats, type ColumnType, CompactionDoodle, ConfigProvider, ConfirmModal, type ConfirmModalProps, ConfirmationStep, type ConversationTurn$1 as ConversationTurn, type DataTableOptions, DateGroupHeader, DebugPanel, type DebugPanelProps, DefaultErrorContent, DownloadCard, MemoizedEditableText as EditableText, type EditableTextProps, type EditableTextRef, MemoizedEmptyState as EmptyState, type EmptyStateProps, ErrorBoundary, type FileValidationError, type FileVisual, type FormattedCell, HttpDataSource, type HttpDataSourceConfig, type ImageAttachment, type ImageLoadingStatus, ImageModal, InlineQuestionForm, InteractiveTableCard, type IotaContext, IotaContextProvider, ListItemSkeleton, MemoizedLoadingSpinner as LoadingSpinner, type LocaleContext, MemoizedMarkdownRenderer as MarkdownRenderer, MessageActions, MessageInput, type MessageInputProps, type MessageInputRef, MessageList, MessageRole, type MessageTransport, ModelSelector, type PendingQuestion$1 as PendingQuestion, PermissionGuard, type PermissionGuardProps, type Question, type QuestionAnswerData, type QuestionAnswers, QuestionForm, type QuestionOption, QuestionStep, type QueuedMessage, type RPCErrorDisplay, RateLimiter, type RateLimiterConfig, type RenderTableData, type RenderTableExport, RetryActionArea, ScreenReaderAnnouncer, ScrollToBottomButton, MemoizedSearchInput as SearchInput, type SearchInputProps, type Session$1 as Session, type SessionAccess$1 as SessionAccess, type SessionArtifact, SessionArtifactList, SessionArtifactPreview, SessionArtifactsPanel, type SessionGroup, SessionItem, type SessionListResult$1 as SessionListResult, type SessionMember$1 as SessionMember, SessionMembersModal, type SessionMembersModalProps, SessionSkeleton, type SessionStore, type SessionUser$1 as SessionUser, type ShortcutConfig, Sidebar, type SidebarDrawerProps, type SidebarProps, MemoizedSkeleton as Skeleton, SkeletonAvatar, SkeletonCard, SkeletonGroup, type SkeletonGroupProps, type SkeletonProps, SkeletonText, SkipLink, Slot, type SlotProps, type SortState, SourcesPanel, type StreamChunk, StreamError, type StreamEvent, StreamingCursor, SystemMessage, TabbedChartGroup, type TabbedChartGroupProps, TabbedTableGroup, type TabbedTableGroupProps, type TableCardHost, TableExportButton, TableWithExport, type TenantContext, type Theme, type ThemeBorderRadius, type ThemeColors, ThemeProvider, type ThemeSpacing, Toast, type ToastAction, ToastContainer, type ToastItem, type ToastProps, type ToastType, type ToolCall$1 as ToolCall, TouchContextMenu, Turn, type TurnActionsProps, type TurnAssistantProps, TurnBubble, type TurnBubbleClassNames, type TurnBubbleProps, type TurnRootProps, type TurnTimestampProps, type TurnUserProps, MemoizedTypingIndicator as TypingIndicator, type TypingIndicatorProps, type UseAttachmentsOptions, type UseAttachmentsReturn, type UseAutoScrollOptions, type UseAutoScrollReturn, type UseBichatRouterParams, type UseBichatRouterReturn, type UseDataTableReturn, type UseImageGalleryOptions, type UseImageGalleryReturn, type UseMarkdownCopyOptions, type UseMarkdownCopyReturn, type UseMessageActionsOptions, type UseMessageActionsReturn, type UseSidebarStateReturn, type UseToastReturn, MemoizedUserAvatar as UserAvatar, type UserAvatarProps, type UserContext, MemoizedUserFilter as UserFilter, UserMessage, type UserMessageActionsSlotProps, type UserMessageAttachmentsSlotProps, type UserMessageAvatarSlotProps, type UserMessageClassNames, type UserMessageContentSlotProps, type UserMessageProps, type UserMessageSlots, type UserTurn$1 as UserTurn, UserTurnView, type UserTurnViewProps, WelcomeContent, addCSRFHeader, backdropVariants, buttonVariants, convertToBase64, createDataUrl, createHeadersWithCSRF, createHttpDataSource, darkTheme, dropdownVariants, errorMessageVariants, fadeInUpVariants, fadeInVariants, floatingButtonVariants, formatFileSize, getCSRFToken, getFileVisual, getToolLabel, getValidChildren, groupSessionsByDate, groupSteps, hasPermission, isImageMimeType, isPermissionDeniedError, lightTheme, listItemVariants, messageContainerVariants, messageVariants, parseBichatStream, parseBichatStreamEvents, parseSSEStream, scaleFadeVariants, sessionItemVariants, staggerContainerVariants, toErrorDisplay, typingDotVariants, useActionButtonContext, useAttachments, useAutoScroll, useAvatarContext, useBichatRouter, useBubbleContext, useChatInput, useChatMessaging, useChatSession, useConfig, useDataTable, useFocusTrap, useHttpDataSourceConfigFromApplet, useImageGallery, useIotaContext, useKeyboardShortcuts, useLongPress, useMarkdownCopy, useMessageActions, useModalLock, useOptionalChatMessaging, useRequiredConfig, useScrollToBottom, useSidebarState, useStreaming, useTheme, useToast, useTranslation, useTurnContext, validateAttachmentFile, validateFileCount, validateImageFile, verbTransitionVariants };
|
package/dist/bichat/index.mjs
CHANGED
|
@@ -3647,16 +3647,26 @@ function hashString(str) {
|
|
|
3647
3647
|
return Math.abs(hash);
|
|
3648
3648
|
}
|
|
3649
3649
|
var colorPalette = [
|
|
3650
|
-
{ bg: "
|
|
3651
|
-
|
|
3652
|
-
{ bg: "
|
|
3653
|
-
|
|
3654
|
-
{ bg: "
|
|
3655
|
-
|
|
3656
|
-
{ bg: "
|
|
3657
|
-
|
|
3658
|
-
{ bg: "
|
|
3659
|
-
|
|
3650
|
+
{ bg: "#3b82f6", text: "#ffffff" },
|
|
3651
|
+
// blue-500
|
|
3652
|
+
{ bg: "#22c55e", text: "#111827" },
|
|
3653
|
+
// green-500 (light bg)
|
|
3654
|
+
{ bg: "#a855f7", text: "#ffffff" },
|
|
3655
|
+
// purple-500
|
|
3656
|
+
{ bg: "#ec4899", text: "#ffffff" },
|
|
3657
|
+
// pink-500
|
|
3658
|
+
{ bg: "#6366f1", text: "#ffffff" },
|
|
3659
|
+
// indigo-500
|
|
3660
|
+
{ bg: "#14b8a6", text: "#111827" },
|
|
3661
|
+
// teal-500 (light bg)
|
|
3662
|
+
{ bg: "#f97316", text: "#ffffff" },
|
|
3663
|
+
// orange-500
|
|
3664
|
+
{ bg: "#06b6d4", text: "#111827" },
|
|
3665
|
+
// cyan-500 (light bg)
|
|
3666
|
+
{ bg: "#f59e0b", text: "#111827" },
|
|
3667
|
+
// amber-500 (light bg)
|
|
3668
|
+
{ bg: "#84cc16", text: "#111827" }
|
|
3669
|
+
// lime-500 (light bg)
|
|
3660
3670
|
];
|
|
3661
3671
|
var sizeClasses = {
|
|
3662
3672
|
xs: "w-6 h-6 text-[10px]",
|
|
@@ -3686,8 +3696,6 @@ function UserAvatar({
|
|
|
3686
3696
|
{
|
|
3687
3697
|
className: `
|
|
3688
3698
|
${sizeClasses[size]}
|
|
3689
|
-
${colors.bg}
|
|
3690
|
-
${colors.text}
|
|
3691
3699
|
${className}
|
|
3692
3700
|
rounded-full
|
|
3693
3701
|
flex
|
|
@@ -3697,6 +3705,7 @@ function UserAvatar({
|
|
|
3697
3705
|
flex-shrink-0
|
|
3698
3706
|
select-none
|
|
3699
3707
|
`,
|
|
3708
|
+
style: { backgroundColor: colors.bg, color: colors.text },
|
|
3700
3709
|
"aria-label": `${firstName} ${lastName}`,
|
|
3701
3710
|
title: `${firstName} ${lastName}`,
|
|
3702
3711
|
children: initials
|
|
@@ -12645,9 +12654,11 @@ function ChatSession(props) {
|
|
|
12645
12654
|
);
|
|
12646
12655
|
}
|
|
12647
12656
|
init_IotaContext();
|
|
12657
|
+
init_useTranslation();
|
|
12648
12658
|
function ModelSelector() {
|
|
12649
12659
|
const { model, setModel } = useChatSession();
|
|
12650
12660
|
const context = useIotaContext();
|
|
12661
|
+
const { t } = useTranslation();
|
|
12651
12662
|
const models = useMemo(
|
|
12652
12663
|
() => context.extensions?.llm?.models ?? [],
|
|
12653
12664
|
[context.extensions?.llm?.models]
|
|
@@ -12678,9 +12689,9 @@ function ModelSelector() {
|
|
|
12678
12689
|
return null;
|
|
12679
12690
|
}
|
|
12680
12691
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 pt-3 pb-1", children: [
|
|
12681
|
-
/* @__PURE__ */ jsx("div", { className: "inline-flex rounded-lg bg-gray-100 p-0.5 dark:bg-gray-800", children: models.map((m) => {
|
|
12692
|
+
/* @__PURE__ */ jsx("div", { className: "inline-flex rounded-lg bg-gray-100 p-0.5 dark:bg-gray-800", children: models.map((m, i) => {
|
|
12682
12693
|
const isActive = m.id === currentModel;
|
|
12683
|
-
const isFast =
|
|
12694
|
+
const isFast = i === 0;
|
|
12684
12695
|
return /* @__PURE__ */ jsxs(
|
|
12685
12696
|
"button",
|
|
12686
12697
|
{
|
|
@@ -12692,7 +12703,7 @@ function ModelSelector() {
|
|
|
12692
12703
|
`,
|
|
12693
12704
|
children: [
|
|
12694
12705
|
isFast ? /* @__PURE__ */ jsx(Lightning, { size: 13, weight: "fill" }) : /* @__PURE__ */ jsx(Brain, { size: 13, weight: "fill" }),
|
|
12695
|
-
/* @__PURE__ */ jsx("span", { children: m.label })
|
|
12706
|
+
/* @__PURE__ */ jsx("span", { children: t(m.label) })
|
|
12696
12707
|
]
|
|
12697
12708
|
},
|
|
12698
12709
|
m.id
|
|
@@ -14371,6 +14382,62 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
|
|
|
14371
14382
|
});
|
|
14372
14383
|
return Array.from(userMap.values());
|
|
14373
14384
|
}, [chats, users, dataSource.listUsers]);
|
|
14385
|
+
const [expandedGroups, setExpandedGroups] = useState(/* @__PURE__ */ new Set());
|
|
14386
|
+
const toggleGroup = useCallback((ownerId) => {
|
|
14387
|
+
setExpandedGroups((prev) => {
|
|
14388
|
+
const next = new Set(prev);
|
|
14389
|
+
if (next.has(ownerId)) {
|
|
14390
|
+
next.delete(ownerId);
|
|
14391
|
+
} else {
|
|
14392
|
+
next.add(ownerId);
|
|
14393
|
+
}
|
|
14394
|
+
return next;
|
|
14395
|
+
});
|
|
14396
|
+
}, []);
|
|
14397
|
+
useEffect(() => {
|
|
14398
|
+
if (!activeSessionId || selectedUser) {
|
|
14399
|
+
return;
|
|
14400
|
+
}
|
|
14401
|
+
const chat = chats.find((c) => c.id === activeSessionId);
|
|
14402
|
+
if (chat?.owner?.id) {
|
|
14403
|
+
setExpandedGroups((prev) => {
|
|
14404
|
+
if (prev.has(chat.owner.id)) {
|
|
14405
|
+
return prev;
|
|
14406
|
+
}
|
|
14407
|
+
return /* @__PURE__ */ new Set([...prev, chat.owner.id]);
|
|
14408
|
+
});
|
|
14409
|
+
}
|
|
14410
|
+
}, [activeSessionId, chats, selectedUser]);
|
|
14411
|
+
const groupedChats = useMemo(() => {
|
|
14412
|
+
if (selectedUser) {
|
|
14413
|
+
return null;
|
|
14414
|
+
}
|
|
14415
|
+
const groupMap = /* @__PURE__ */ new Map();
|
|
14416
|
+
chats.forEach((chat) => {
|
|
14417
|
+
const owner = chat.owner ?? {
|
|
14418
|
+
id: "__unknown__",
|
|
14419
|
+
firstName: t("BiChat.Common.Untitled"),
|
|
14420
|
+
lastName: "",
|
|
14421
|
+
initials: "?"
|
|
14422
|
+
};
|
|
14423
|
+
const ownerId = owner.id;
|
|
14424
|
+
if (!groupMap.has(ownerId)) {
|
|
14425
|
+
groupMap.set(ownerId, {
|
|
14426
|
+
owner,
|
|
14427
|
+
chats: [],
|
|
14428
|
+
latestUpdatedAt: chat.updatedAt
|
|
14429
|
+
});
|
|
14430
|
+
}
|
|
14431
|
+
const group = groupMap.get(ownerId);
|
|
14432
|
+
group.chats.push(chat);
|
|
14433
|
+
if (chat.updatedAt > group.latestUpdatedAt) {
|
|
14434
|
+
group.latestUpdatedAt = chat.updatedAt;
|
|
14435
|
+
}
|
|
14436
|
+
});
|
|
14437
|
+
return Array.from(groupMap.values()).sort(
|
|
14438
|
+
(a, b) => b.latestUpdatedAt.localeCompare(a.latestUpdatedAt)
|
|
14439
|
+
);
|
|
14440
|
+
}, [chats, selectedUser, t]);
|
|
14374
14441
|
return /* @__PURE__ */ jsxs(
|
|
14375
14442
|
"div",
|
|
14376
14443
|
{
|
|
@@ -14416,61 +14483,159 @@ function AllChatsList({ dataSource, onSessionSelect, activeSessionId }) {
|
|
|
14416
14483
|
role: "list",
|
|
14417
14484
|
"aria-label": t("BiChat.AllChats.OrganizationChatSessions"),
|
|
14418
14485
|
children: [
|
|
14419
|
-
|
|
14420
|
-
|
|
14421
|
-
|
|
14422
|
-
|
|
14423
|
-
|
|
14424
|
-
|
|
14425
|
-
|
|
14426
|
-
|
|
14427
|
-
motion.div,
|
|
14428
|
-
{
|
|
14429
|
-
initial: { opacity: 0, y: -10 },
|
|
14430
|
-
animate: { opacity: 1, y: 0 },
|
|
14431
|
-
exit: { opacity: 0, y: -10 },
|
|
14432
|
-
children: /* @__PURE__ */ jsx(
|
|
14486
|
+
groupedChats ? (
|
|
14487
|
+
/* ── Grouped view (no user selected) ── */
|
|
14488
|
+
groupedChats.map((group) => {
|
|
14489
|
+
const ownerId = group.owner.id;
|
|
14490
|
+
const ownerName = [group.owner.firstName, group.owner.lastName].filter(Boolean).join(" ");
|
|
14491
|
+
const isCollapsed = !expandedGroups.has(ownerId);
|
|
14492
|
+
return /* @__PURE__ */ jsxs("div", { className: "mb-1", children: [
|
|
14493
|
+
/* @__PURE__ */ jsxs(
|
|
14433
14494
|
"div",
|
|
14434
14495
|
{
|
|
14435
|
-
role: "
|
|
14496
|
+
role: "button",
|
|
14436
14497
|
tabIndex: 0,
|
|
14437
|
-
onClick: () =>
|
|
14498
|
+
onClick: () => toggleGroup(ownerId),
|
|
14438
14499
|
onKeyDown: (e) => {
|
|
14439
14500
|
if (e.key === "Enter" || e.key === " ") {
|
|
14440
14501
|
e.preventDefault();
|
|
14441
|
-
|
|
14502
|
+
toggleGroup(ownerId);
|
|
14442
14503
|
}
|
|
14443
14504
|
},
|
|
14444
|
-
className:
|
|
14445
|
-
|
|
14446
|
-
|
|
14447
|
-
|
|
14448
|
-
|
|
14449
|
-
|
|
14505
|
+
className: "flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800 rounded-lg transition-smooth select-none",
|
|
14506
|
+
"aria-expanded": !isCollapsed,
|
|
14507
|
+
children: [
|
|
14508
|
+
/* @__PURE__ */ jsx(
|
|
14509
|
+
CaretRight,
|
|
14510
|
+
{
|
|
14511
|
+
size: 14,
|
|
14512
|
+
weight: "bold",
|
|
14513
|
+
className: `shrink-0 text-gray-500 dark:text-gray-400 transition-transform duration-150 ${isCollapsed ? "" : "rotate-90"}`
|
|
14514
|
+
}
|
|
14515
|
+
),
|
|
14450
14516
|
/* @__PURE__ */ jsx(
|
|
14451
14517
|
MemoizedUserAvatar,
|
|
14452
14518
|
{
|
|
14453
|
-
firstName: owner.firstName,
|
|
14454
|
-
lastName: owner.lastName,
|
|
14455
|
-
initials: owner.initials,
|
|
14519
|
+
firstName: group.owner.firstName,
|
|
14520
|
+
lastName: group.owner.lastName,
|
|
14521
|
+
initials: group.owner.initials,
|
|
14456
14522
|
size: "sm"
|
|
14457
14523
|
}
|
|
14458
14524
|
),
|
|
14459
|
-
/* @__PURE__ */
|
|
14460
|
-
|
|
14461
|
-
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
|
|
14525
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 truncate flex-1 min-w-0", children: ownerName || t("BiChat.Common.Untitled") }),
|
|
14526
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-800 px-2 py-0.5 rounded-full flex-shrink-0", children: group.chats.length })
|
|
14527
|
+
]
|
|
14528
|
+
}
|
|
14529
|
+
),
|
|
14530
|
+
/* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: !isCollapsed && /* @__PURE__ */ jsx(
|
|
14531
|
+
motion.div,
|
|
14532
|
+
{
|
|
14533
|
+
initial: { height: 0, opacity: 0 },
|
|
14534
|
+
animate: { height: "auto", opacity: 1 },
|
|
14535
|
+
exit: { height: 0, opacity: 0 },
|
|
14536
|
+
transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },
|
|
14537
|
+
className: "overflow-hidden",
|
|
14538
|
+
children: /* @__PURE__ */ jsx("div", { className: "space-y-0.5 pl-6", children: group.chats.map((chat) => /* @__PURE__ */ jsx(
|
|
14539
|
+
motion.div,
|
|
14540
|
+
{
|
|
14541
|
+
initial: { opacity: 0, y: -10 },
|
|
14542
|
+
animate: { opacity: 1, y: 0 },
|
|
14543
|
+
exit: { opacity: 0, y: -10 },
|
|
14544
|
+
children: /* @__PURE__ */ jsx(
|
|
14545
|
+
"div",
|
|
14546
|
+
{
|
|
14547
|
+
role: "link",
|
|
14548
|
+
tabIndex: 0,
|
|
14549
|
+
onClick: () => onSessionSelect(chat.id),
|
|
14550
|
+
onKeyDown: (e) => {
|
|
14551
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
14552
|
+
e.preventDefault();
|
|
14553
|
+
onSessionSelect(chat.id);
|
|
14554
|
+
}
|
|
14555
|
+
},
|
|
14556
|
+
className: `
|
|
14557
|
+
block px-3 py-2 rounded-lg transition-smooth group cursor-pointer
|
|
14558
|
+
${chat.id === activeSessionId ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"}
|
|
14559
|
+
`,
|
|
14560
|
+
"aria-current": chat.id === activeSessionId ? "page" : void 0,
|
|
14561
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
14562
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm truncate flex-1 min-w-0", children: chat.title || t("BiChat.Common.Untitled") }),
|
|
14563
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 flex-shrink-0", children: [
|
|
14564
|
+
chat.isGroup && chat.memberCount && chat.memberCount > 1 && /* @__PURE__ */ jsx("span", { className: "text-xs text-gray-400 dark:text-gray-500", children: chat.memberCount }),
|
|
14565
|
+
chat.status === "archived" && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
|
|
14566
|
+
/* @__PURE__ */ jsx(Archive, { size: 12, className: "w-3 h-3" }),
|
|
14567
|
+
t("BiChat.Chat.Archived")
|
|
14568
|
+
] })
|
|
14569
|
+
] })
|
|
14570
|
+
] })
|
|
14571
|
+
}
|
|
14572
|
+
)
|
|
14573
|
+
},
|
|
14574
|
+
chat.id
|
|
14575
|
+
)) })
|
|
14576
|
+
},
|
|
14577
|
+
`group-${ownerId}`
|
|
14578
|
+
) })
|
|
14579
|
+
] }, ownerId);
|
|
14580
|
+
})
|
|
14581
|
+
) : (
|
|
14582
|
+
/* ── Flat view (user selected) ── */
|
|
14583
|
+
chats.map((chat) => {
|
|
14584
|
+
const owner = chat.owner ?? {
|
|
14585
|
+
firstName: "",
|
|
14586
|
+
lastName: "",
|
|
14587
|
+
initials: "U"
|
|
14588
|
+
};
|
|
14589
|
+
const ownerName = [owner.firstName, owner.lastName].filter(Boolean).join(" ");
|
|
14590
|
+
return /* @__PURE__ */ jsx(
|
|
14591
|
+
motion.div,
|
|
14592
|
+
{
|
|
14593
|
+
initial: { opacity: 0, y: -10 },
|
|
14594
|
+
animate: { opacity: 1, y: 0 },
|
|
14595
|
+
exit: { opacity: 0, y: -10 },
|
|
14596
|
+
children: /* @__PURE__ */ jsx(
|
|
14597
|
+
"div",
|
|
14598
|
+
{
|
|
14599
|
+
role: "link",
|
|
14600
|
+
tabIndex: 0,
|
|
14601
|
+
onClick: () => onSessionSelect(chat.id),
|
|
14602
|
+
onKeyDown: (e) => {
|
|
14603
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
14604
|
+
e.preventDefault();
|
|
14605
|
+
onSessionSelect(chat.id);
|
|
14606
|
+
}
|
|
14607
|
+
},
|
|
14608
|
+
className: `
|
|
14609
|
+
block px-3 py-2 rounded-lg transition-smooth group cursor-pointer
|
|
14610
|
+
${chat.id === activeSessionId ? "bg-primary-50/50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-400 border-l-4 border-primary-400 dark:border-primary-600" : "text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 border-l-4 border-transparent"}
|
|
14611
|
+
`,
|
|
14612
|
+
"aria-current": chat.id === activeSessionId ? "page" : void 0,
|
|
14613
|
+
children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
|
|
14614
|
+
/* @__PURE__ */ jsx(
|
|
14615
|
+
MemoizedUserAvatar,
|
|
14616
|
+
{
|
|
14617
|
+
firstName: owner.firstName,
|
|
14618
|
+
lastName: owner.lastName,
|
|
14619
|
+
initials: owner.initials,
|
|
14620
|
+
size: "sm"
|
|
14621
|
+
}
|
|
14622
|
+
),
|
|
14623
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
14624
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium truncate", children: chat.title || t("BiChat.Common.Untitled") }),
|
|
14625
|
+
ownerName && /* @__PURE__ */ jsx("p", { className: "text-xs text-gray-500 dark:text-gray-400 truncate", children: ownerName }),
|
|
14626
|
+
chat.status === "archived" && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 mt-1 px-2 py-0.5 bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 rounded-full text-xs", children: [
|
|
14627
|
+
/* @__PURE__ */ jsx(Archive, { size: 12, className: "w-3 h-3" }),
|
|
14628
|
+
t("BiChat.Chat.Archived")
|
|
14629
|
+
] })
|
|
14465
14630
|
] })
|
|
14466
14631
|
] })
|
|
14467
|
-
|
|
14468
|
-
|
|
14469
|
-
|
|
14470
|
-
|
|
14471
|
-
|
|
14472
|
-
)
|
|
14473
|
-
|
|
14632
|
+
}
|
|
14633
|
+
)
|
|
14634
|
+
},
|
|
14635
|
+
chat.id
|
|
14636
|
+
);
|
|
14637
|
+
})
|
|
14638
|
+
),
|
|
14474
14639
|
hasMore && /* @__PURE__ */ jsx("div", { ref: loadMoreRef, className: "py-4 text-center", children: fetching ? /* @__PURE__ */ jsx(SessionSkeleton, { count: 2 }) : /* @__PURE__ */ jsx(
|
|
14475
14640
|
"button",
|
|
14476
14641
|
{
|
|
@@ -14693,7 +14858,9 @@ function Sidebar2({
|
|
|
14693
14858
|
onClose,
|
|
14694
14859
|
headerSlot,
|
|
14695
14860
|
footerSlot,
|
|
14696
|
-
className = ""
|
|
14861
|
+
className = "",
|
|
14862
|
+
activeTab: controlledActiveTab,
|
|
14863
|
+
onTabChange
|
|
14697
14864
|
}) {
|
|
14698
14865
|
const { t } = useTranslation();
|
|
14699
14866
|
const toast = useToast();
|
|
@@ -14753,7 +14920,14 @@ function Sidebar2({
|
|
|
14753
14920
|
const timer = setTimeout(() => setCollapsedOverflowVisible(true), 300);
|
|
14754
14921
|
return () => clearTimeout(timer);
|
|
14755
14922
|
}, [showCollapsed]);
|
|
14756
|
-
const [
|
|
14923
|
+
const [internalActiveTab, setInternalActiveTab] = useState("my-chats");
|
|
14924
|
+
const activeTab = controlledActiveTab ?? internalActiveTab;
|
|
14925
|
+
const handleTabChange = useCallback((tab) => {
|
|
14926
|
+
if (controlledActiveTab === void 0) {
|
|
14927
|
+
setInternalActiveTab(tab);
|
|
14928
|
+
}
|
|
14929
|
+
onTabChange?.(tab);
|
|
14930
|
+
}, [controlledActiveTab, onTabChange]);
|
|
14757
14931
|
const [searchQuery, setSearchQuery] = useState("");
|
|
14758
14932
|
const [sessions, setSessions] = useState([]);
|
|
14759
14933
|
const [loading, setLoading] = useState(true);
|
|
@@ -15367,7 +15541,7 @@ function Sidebar2({
|
|
|
15367
15541
|
onClick: (e) => {
|
|
15368
15542
|
e.preventDefault();
|
|
15369
15543
|
e.stopPropagation();
|
|
15370
|
-
|
|
15544
|
+
handleTabChange("all-chats");
|
|
15371
15545
|
close();
|
|
15372
15546
|
},
|
|
15373
15547
|
className: `cursor-pointer flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-gray-600 dark:text-gray-300 transition-colors ${focus ? "bg-gray-100 dark:bg-gray-800/70" : ""}`,
|
|
@@ -15384,7 +15558,7 @@ function Sidebar2({
|
|
|
15384
15558
|
onClick: (e) => {
|
|
15385
15559
|
e.preventDefault();
|
|
15386
15560
|
e.stopPropagation();
|
|
15387
|
-
|
|
15561
|
+
handleTabChange("my-chats");
|
|
15388
15562
|
close();
|
|
15389
15563
|
},
|
|
15390
15564
|
className: `cursor-pointer flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-[13px] text-gray-600 dark:text-gray-300 transition-colors ${focus ? "bg-gray-100 dark:bg-gray-800/70" : ""}`,
|
|
@@ -17491,42 +17665,66 @@ function useBichatRouter({
|
|
|
17491
17665
|
pathname,
|
|
17492
17666
|
onNavigate
|
|
17493
17667
|
}) {
|
|
17668
|
+
const isAllChats = pathname.startsWith("/all-chats");
|
|
17494
17669
|
const activeSessionId = useMemo(
|
|
17495
17670
|
() => pathname.match(SESSION_PATH_REGEX)?.[1],
|
|
17496
17671
|
[pathname]
|
|
17497
17672
|
);
|
|
17673
|
+
const sidebarTab = useMemo(
|
|
17674
|
+
() => isAllChats ? "all-chats" : "my-chats",
|
|
17675
|
+
[isAllChats]
|
|
17676
|
+
);
|
|
17498
17677
|
const maybeClose = useCallback(() => {
|
|
17499
17678
|
onNavigate?.();
|
|
17500
17679
|
}, [onNavigate]);
|
|
17501
17680
|
const onSessionSelect = useCallback(
|
|
17502
17681
|
(sessionId) => {
|
|
17503
17682
|
if (sessionId) {
|
|
17504
|
-
|
|
17683
|
+
const prefix = isAllChats ? "/all-chats" : "";
|
|
17684
|
+
navigate(`${prefix}/session/${sessionId}`);
|
|
17505
17685
|
} else {
|
|
17506
|
-
navigate("/");
|
|
17686
|
+
navigate(isAllChats ? "/all-chats" : "/");
|
|
17507
17687
|
}
|
|
17508
17688
|
maybeClose();
|
|
17509
17689
|
},
|
|
17510
|
-
[navigate, maybeClose]
|
|
17690
|
+
[navigate, maybeClose, isAllChats]
|
|
17511
17691
|
);
|
|
17512
17692
|
const onNewChat = useCallback(() => {
|
|
17513
|
-
navigate("/");
|
|
17693
|
+
navigate(isAllChats ? "/all-chats" : "/");
|
|
17514
17694
|
maybeClose();
|
|
17515
|
-
}, [navigate, maybeClose]);
|
|
17695
|
+
}, [navigate, maybeClose, isAllChats]);
|
|
17516
17696
|
const onArchivedView = useCallback(() => {
|
|
17517
17697
|
navigate("/archived");
|
|
17518
17698
|
maybeClose();
|
|
17519
17699
|
}, [navigate, maybeClose]);
|
|
17700
|
+
const onAllChatsView = useCallback(() => {
|
|
17701
|
+
navigate("/all-chats");
|
|
17702
|
+
maybeClose();
|
|
17703
|
+
}, [navigate, maybeClose]);
|
|
17520
17704
|
const onBack = useCallback(() => {
|
|
17521
17705
|
navigate("/");
|
|
17522
17706
|
maybeClose();
|
|
17523
17707
|
}, [navigate, maybeClose]);
|
|
17708
|
+
const onSidebarTabChange = useCallback(
|
|
17709
|
+
(tab) => {
|
|
17710
|
+
if (tab === "all-chats") {
|
|
17711
|
+
navigate("/all-chats");
|
|
17712
|
+
} else {
|
|
17713
|
+
navigate("/");
|
|
17714
|
+
}
|
|
17715
|
+
maybeClose();
|
|
17716
|
+
},
|
|
17717
|
+
[navigate, maybeClose]
|
|
17718
|
+
);
|
|
17524
17719
|
return {
|
|
17525
17720
|
activeSessionId,
|
|
17526
17721
|
onSessionSelect,
|
|
17527
17722
|
onNewChat,
|
|
17528
17723
|
onArchivedView,
|
|
17529
|
-
onBack
|
|
17724
|
+
onBack,
|
|
17725
|
+
onAllChatsView,
|
|
17726
|
+
sidebarTab,
|
|
17727
|
+
onSidebarTabChange
|
|
17530
17728
|
};
|
|
17531
17729
|
}
|
|
17532
17730
|
|