@jazzmine-ui/react 0.1.0 → 0.1.1
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/components/ChatInterface/ChatInterface.d.ts +4 -0
- package/dist/components/ChatInterface/index.d.ts +2 -0
- package/dist/components/ChatInterface/types.d.ts +17 -0
- package/dist/components/ChatWindow/ChatWindow.d.ts +4 -0
- package/dist/components/ChatWindow/index.d.ts +2 -0
- package/dist/components/ChatWindow/types.d.ts +18 -0
- package/dist/components/FloatingChatWidget/FloatingChatWidget.d.ts +4 -0
- package/dist/components/FloatingChatWidget/index.d.ts +2 -0
- package/dist/components/FloatingChatWidget/types.d.ts +13 -0
- package/dist/components/JazzmineChat/JazzmineChat.d.ts +3 -0
- package/dist/components/JazzmineChat/index.d.ts +2 -0
- package/dist/components/JazzmineChat/types.d.ts +13 -0
- package/dist/components/MessageList/MessageList.d.ts +4 -0
- package/dist/components/MessageList/index.d.ts +2 -0
- package/dist/components/MessageList/types.d.ts +13 -0
- package/dist/components/Navbar/Navbar.d.ts +4 -0
- package/dist/components/Navbar/index.d.ts +2 -0
- package/dist/components/Navbar/types.d.ts +11 -0
- package/dist/components/Sidebar/Sidebar.d.ts +4 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Sidebar/types.d.ts +23 -0
- package/dist/components/internal/Avatar/Avatar.d.ts +4 -0
- package/dist/components/internal/Avatar/index.d.ts +2 -0
- package/dist/components/internal/Avatar/types.d.ts +7 -0
- package/dist/components/internal/Button/Button.d.ts +4 -0
- package/dist/components/internal/Button/index.d.ts +2 -0
- package/dist/components/internal/Button/types.d.ts +6 -0
- package/dist/components/internal/ContextModal/ContextModal.d.ts +4 -0
- package/dist/components/internal/ContextModal/index.d.ts +2 -0
- package/dist/components/internal/ContextModal/types.d.ts +8 -0
- package/dist/components/internal/ContextPanel/ContextPanel.d.ts +4 -0
- package/dist/components/internal/ContextPanel/index.d.ts +2 -0
- package/dist/components/internal/ContextPanel/types.d.ts +6 -0
- package/dist/components/internal/ContextReference/ContextReference.d.ts +4 -0
- package/dist/components/internal/ContextReference/index.d.ts +2 -0
- package/dist/components/internal/ContextReference/types.d.ts +5 -0
- package/dist/components/internal/Message/Message.d.ts +4 -0
- package/dist/components/internal/Message/index.d.ts +2 -0
- package/dist/components/internal/Message/types.d.ts +15 -0
- package/dist/components/internal/MessageInput/MessageInput.d.ts +4 -0
- package/dist/components/internal/MessageInput/index.d.ts +2 -0
- package/dist/components/internal/MessageInput/types.d.ts +6 -0
- package/dist/components/internal/StatusIndicator/StatusIndicator.d.ts +3 -0
- package/dist/components/internal/StatusIndicator/index.d.ts +2 -0
- package/dist/components/internal/StatusIndicator/types.d.ts +6 -0
- package/dist/index.d.ts +12 -1
- package/dist/main.d.ts +3 -0
- package/dist/types/client.d.ts +32 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/utils/highlightText.d.ts +8 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/stripMarkdown.d.ts +4 -0
- package/package.json +8 -7
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Message, Context } from "../../types";
|
|
2
|
+
import type { Chat } from "../../types";
|
|
3
|
+
export interface ChatInterfaceProps {
|
|
4
|
+
messages: Message[];
|
|
5
|
+
chats: Chat[];
|
|
6
|
+
activeChatId?: string;
|
|
7
|
+
assistantName?: string;
|
|
8
|
+
onSend: (text: string, contexts?: Context[]) => void;
|
|
9
|
+
onNewChat: () => void;
|
|
10
|
+
onSelectChat: (chatId: string) => void;
|
|
11
|
+
onDeleteChat?: (chatId: string) => void;
|
|
12
|
+
loadingText?: string;
|
|
13
|
+
loadingVariant?: "text-and-dots" | "dots-only";
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Message, Context } from '../../types';
|
|
2
|
+
export interface ChatWindowProps {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
assistantName?: string;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
loadingText?: string;
|
|
7
|
+
loadingVariant?: 'text-and-dots' | 'dots-only';
|
|
8
|
+
compact?: boolean;
|
|
9
|
+
onSend: (text: string) => void;
|
|
10
|
+
inputPlaceholder?: string;
|
|
11
|
+
inputDisabled?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
searchQuery?: string;
|
|
14
|
+
activeSearchMessageId?: string;
|
|
15
|
+
selectedContexts?: Context[];
|
|
16
|
+
onAddContext?: (context: Context) => void;
|
|
17
|
+
onRemoveContext?: (contextId: string) => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Message } from '../../types';
|
|
2
|
+
export interface FloatingChatWidgetProps {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
assistantName?: string;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
loadingText?: string;
|
|
7
|
+
loadingVariant?: 'text-and-dots' | 'dots-only';
|
|
8
|
+
initialOpen?: boolean;
|
|
9
|
+
onOpen?: (open: boolean) => void;
|
|
10
|
+
onSend?: (text: string) => void;
|
|
11
|
+
logo?: string;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IJazzmineClient } from '../../types/client';
|
|
2
|
+
export interface JazzmineChatProps {
|
|
3
|
+
/** A JazzmineClient instance from @jazzmine-ui/sdk */
|
|
4
|
+
client: IJazzmineClient;
|
|
5
|
+
/** Displayed as the assistant's name in the UI. Default: agent name from /health */
|
|
6
|
+
assistantName?: string;
|
|
7
|
+
/** Placeholder text for the message input */
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
/** Additional CSS class for the root element */
|
|
10
|
+
className?: string;
|
|
11
|
+
/** Called when an unrecoverable error occurs */
|
|
12
|
+
onError?: (error: Error) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Message, Context } from '../../types';
|
|
2
|
+
export interface MessageListProps {
|
|
3
|
+
messages: Message[];
|
|
4
|
+
assistantName?: string;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
loadingText?: string;
|
|
7
|
+
loadingVariant?: 'text-and-dots' | 'dots-only';
|
|
8
|
+
className?: string;
|
|
9
|
+
searchQuery?: string;
|
|
10
|
+
activeSearchMessageId?: string;
|
|
11
|
+
onAddContext?: (context: Context) => void;
|
|
12
|
+
scrollRef?: React.RefObject<HTMLDivElement | null> | ((node: HTMLDivElement | null) => void);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface NavbarProps {
|
|
2
|
+
assistantName?: string;
|
|
3
|
+
onToggleSidebar: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
searchQuery?: string;
|
|
6
|
+
onSearchChange?: (query: string) => void;
|
|
7
|
+
searchResultsCount?: number;
|
|
8
|
+
currentSearchIndex?: number;
|
|
9
|
+
onSearchNext?: () => void;
|
|
10
|
+
onSearchPrev?: () => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Chat } from '../../types';
|
|
2
|
+
export interface ChatAction {
|
|
3
|
+
label: string;
|
|
4
|
+
icon?: React.ReactNode;
|
|
5
|
+
onClick: (chatId: string) => void;
|
|
6
|
+
danger?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SidebarProps {
|
|
9
|
+
chats: Chat[];
|
|
10
|
+
activeChatId?: string;
|
|
11
|
+
assistantName?: string;
|
|
12
|
+
logo?: string;
|
|
13
|
+
logoAlt?: string;
|
|
14
|
+
chatActions?: ChatAction[];
|
|
15
|
+
onNewChat: () => void;
|
|
16
|
+
onSelectChat: (chatId: string) => void;
|
|
17
|
+
onRenameChat?: (chatId: string) => void;
|
|
18
|
+
onDeleteChat?: (chatId: string) => void;
|
|
19
|
+
onArchiveChat?: (chatId: string) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
collapsed?: boolean;
|
|
22
|
+
onToggleCollapse?: (value?: boolean) => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Context } from '../../../types';
|
|
2
|
+
export interface MessageProps {
|
|
3
|
+
text?: string;
|
|
4
|
+
sender: 'user' | 'assistant';
|
|
5
|
+
avatar?: string;
|
|
6
|
+
assistantName?: string;
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
loadingText?: string;
|
|
9
|
+
loadingVariant?: 'text-and-dots' | 'dots-only';
|
|
10
|
+
searchQuery?: string;
|
|
11
|
+
isActiveSearchResult?: boolean;
|
|
12
|
+
messageId?: string;
|
|
13
|
+
contexts?: Context[];
|
|
14
|
+
onAddContext?: (context: Context) => void;
|
|
15
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export { ChatInterface } from './components/ChatInterface';
|
|
2
|
+
export { Sidebar } from './components/Sidebar';
|
|
3
|
+
export { MessageList } from './components/MessageList';
|
|
4
|
+
export { FloatingChatWidget } from './components/FloatingChatWidget';
|
|
5
|
+
export { JazzmineChat } from './components/JazzmineChat';
|
|
6
|
+
export type { ChatInterfaceProps } from './components/ChatInterface';
|
|
7
|
+
export type { SidebarProps } from './components/Sidebar';
|
|
8
|
+
export type { MessageListProps } from './components/MessageList';
|
|
9
|
+
export type { FloatingChatWidgetProps } from './components/FloatingChatWidget';
|
|
10
|
+
export type { JazzmineChatProps } from './components/JazzmineChat';
|
|
11
|
+
export type { IJazzmineClient } from './types/client';
|
|
12
|
+
export type { Message, Chat } from './types';
|
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface IJazzmineClient {
|
|
2
|
+
sendMessage(message: string, options?: {
|
|
3
|
+
conversationId?: string;
|
|
4
|
+
autoCreateConversation?: boolean;
|
|
5
|
+
conversationTitle?: string;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
response: {
|
|
8
|
+
response: string;
|
|
9
|
+
response_markdown: string;
|
|
10
|
+
conversation_id: string;
|
|
11
|
+
message_id: string;
|
|
12
|
+
is_blocked: boolean;
|
|
13
|
+
errors: string[];
|
|
14
|
+
};
|
|
15
|
+
conversationId: string;
|
|
16
|
+
}>;
|
|
17
|
+
createConversation(payload?: {
|
|
18
|
+
title?: string;
|
|
19
|
+
user_id?: string;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
conversation_id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
}>;
|
|
24
|
+
deleteConversation(conversationId: string): Promise<{
|
|
25
|
+
conversation_id: string;
|
|
26
|
+
deleted: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
getHealth(): Promise<{
|
|
29
|
+
status: string;
|
|
30
|
+
agent_name: string;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Context {
|
|
2
|
+
id: string;
|
|
3
|
+
messageId: string;
|
|
4
|
+
text: string;
|
|
5
|
+
sender: 'user' | 'assistant';
|
|
6
|
+
isPartial: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface Message {
|
|
9
|
+
id: string;
|
|
10
|
+
text: string;
|
|
11
|
+
sender: 'user' | 'assistant';
|
|
12
|
+
timestamp?: string;
|
|
13
|
+
avatar?: string;
|
|
14
|
+
contexts?: Context[];
|
|
15
|
+
}
|
|
16
|
+
export interface Chat {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
timestamp?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface HighlightMatch {
|
|
3
|
+
text: string;
|
|
4
|
+
isMatch: boolean;
|
|
5
|
+
isActive?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function highlightText(text: string, searchQuery: string, isActiveResult?: boolean): React.ReactNode;
|
|
8
|
+
export declare function highlightTextInChildren(children: React.ReactNode, searchQuery: string, isActiveResult: boolean): React.ReactNode;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jazzmine-ui/react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Jazzmine: A customizable React chat UI component library",
|
|
7
7
|
"keywords": [
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
"README.md",
|
|
32
32
|
"LICENSE"
|
|
33
33
|
],
|
|
34
|
-
"sideEffects": [
|
|
34
|
+
"sideEffects": [
|
|
35
|
+
"./dist/style.css"
|
|
36
|
+
],
|
|
35
37
|
"scripts": {
|
|
36
38
|
"dev": "vite",
|
|
37
|
-
"build": "
|
|
39
|
+
"build": "vite build && tsc -p tsconfig.build.json",
|
|
38
40
|
"lint": "eslint .",
|
|
39
41
|
"preview": "vite preview",
|
|
40
42
|
"prepublishOnly": "npm run build"
|
|
@@ -59,9 +61,8 @@
|
|
|
59
61
|
"react": "^18.0.0",
|
|
60
62
|
"react-dom": "^18.0.0",
|
|
61
63
|
"react-markdown": "^10.1.0",
|
|
62
|
-
"typescript": "
|
|
64
|
+
"typescript": "^6.0.2",
|
|
63
65
|
"typescript-eslint": "^8.45.0",
|
|
64
|
-
"vite": "^5.0.0"
|
|
65
|
-
"vite-plugin-dts": "^4.5.0"
|
|
66
|
+
"vite": "^5.0.0"
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
+
}
|