@schmitech/chatbot-widget 0.3.2 → 0.3.4
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/chatbot-widget.bundle.js +109 -75
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +20334 -3764
- package/dist/chatbot-widget.umd.js +108 -74
- package/package.json +11 -7
- package/dist/index.d.ts +0 -95
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schmitech/chatbot-widget",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/chatbot-widget.umd.js",
|
|
7
7
|
"module": "./dist/chatbot-widget.es.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
|
+
"readme": "how-to-use.md",
|
|
9
10
|
"exports": {
|
|
10
11
|
".": {
|
|
11
12
|
"import": "./dist/chatbot-widget.es.js",
|
|
@@ -15,24 +16,22 @@
|
|
|
15
16
|
"./style.css": "./dist/chatbot-widget.css"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
"README.md"
|
|
19
|
+
"dist"
|
|
20
20
|
],
|
|
21
21
|
"scripts": {
|
|
22
22
|
"dev": "vite",
|
|
23
|
-
"build": "tsc && vite build",
|
|
23
|
+
"build": "tsc --emitDeclarationOnly && vite build",
|
|
24
24
|
"build:bundle": "node scripts/bundle.js",
|
|
25
25
|
"build:all": "./scripts/build.sh",
|
|
26
26
|
"lint": "eslint .",
|
|
27
27
|
"preview": "vite preview"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@schmitech/chatbot-api": "^0.4.
|
|
30
|
+
"@schmitech/chatbot-api": "^0.4.4",
|
|
31
31
|
"clsx": "^2.1.0",
|
|
32
32
|
"lucide-react": "^0.344.0",
|
|
33
33
|
"react": "^18.3.1",
|
|
34
34
|
"react-dom": "^18.3.1",
|
|
35
|
-
"react-markdown": "^9.0.1",
|
|
36
35
|
"zustand": "^4.5.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
@@ -48,11 +47,16 @@
|
|
|
48
47
|
"eslint-plugin-react-refresh": "^0.4.11",
|
|
49
48
|
"globals": "^15.9.0",
|
|
50
49
|
"postcss": "^8.4.35",
|
|
50
|
+
"react-markdown": "^10.1.0",
|
|
51
|
+
"rehype-highlight": "^7.0.2",
|
|
52
|
+
"rehype-sanitize": "^6.0.0",
|
|
53
|
+
"remark-gfm": "^4.0.1",
|
|
51
54
|
"tailwindcss": "^3.4.1",
|
|
52
55
|
"typescript": "^5.5.3",
|
|
53
56
|
"typescript-eslint": "^8.3.0",
|
|
54
57
|
"vite": "^5.4.2",
|
|
55
|
-
"vite-plugin-dts": "^4.5.3"
|
|
58
|
+
"vite-plugin-dts": "^4.5.3",
|
|
59
|
+
"vite-plugin-svgr": "^4.3.0"
|
|
56
60
|
},
|
|
57
61
|
"peerDependencies": {
|
|
58
62
|
"react": "^18.3.1",
|
package/dist/index.d.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { default as default_2 } from 'react';
|
|
2
|
-
import { StoreApi } from 'zustand';
|
|
3
|
-
import { UseBoundStore } from 'zustand';
|
|
4
|
-
|
|
5
|
-
export declare interface ChatConfig {
|
|
6
|
-
header: {
|
|
7
|
-
title: string;
|
|
8
|
-
};
|
|
9
|
-
theme: {
|
|
10
|
-
primary: string;
|
|
11
|
-
secondary: string;
|
|
12
|
-
background: string;
|
|
13
|
-
text: {
|
|
14
|
-
primary: string;
|
|
15
|
-
inverse: string;
|
|
16
|
-
};
|
|
17
|
-
input: {
|
|
18
|
-
background: string;
|
|
19
|
-
border: string;
|
|
20
|
-
};
|
|
21
|
-
message: {
|
|
22
|
-
user: string;
|
|
23
|
-
userText: string;
|
|
24
|
-
assistant: string;
|
|
25
|
-
};
|
|
26
|
-
suggestedQuestions: {
|
|
27
|
-
background: string;
|
|
28
|
-
text: string;
|
|
29
|
-
hoverBackground: string;
|
|
30
|
-
};
|
|
31
|
-
iconColor?: string;
|
|
32
|
-
};
|
|
33
|
-
welcome: {
|
|
34
|
-
title: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
suggestedQuestions: Array<{
|
|
38
|
-
text: string;
|
|
39
|
-
query: string;
|
|
40
|
-
}>;
|
|
41
|
-
icon?: string;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
declare interface ChatState {
|
|
45
|
-
messages: Message[];
|
|
46
|
-
isLoading: boolean;
|
|
47
|
-
error: string | null;
|
|
48
|
-
voiceEnabled: boolean;
|
|
49
|
-
toggleVoice: () => void;
|
|
50
|
-
sendMessage: (content: string) => Promise<void>;
|
|
51
|
-
appendToLastMessage: (content: string) => void;
|
|
52
|
-
clearMessages: () => void;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
declare const ChatWidget: default_2.FC<ChatWidgetProps>;
|
|
56
|
-
export { ChatWidget }
|
|
57
|
-
export default ChatWidget;
|
|
58
|
-
|
|
59
|
-
export declare interface ChatWidgetProps extends Partial<ChatConfig> {
|
|
60
|
-
config?: never;
|
|
61
|
-
sessionId: string;
|
|
62
|
-
apiUrl: string;
|
|
63
|
-
apiKey: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export declare function getApiKey(): string;
|
|
67
|
-
|
|
68
|
-
export declare function getApiUrl(): string;
|
|
69
|
-
|
|
70
|
-
export declare const getChatConfig: () => ChatConfig;
|
|
71
|
-
|
|
72
|
-
export declare function injectChatWidget(config: {
|
|
73
|
-
apiUrl: string;
|
|
74
|
-
apiKey: string;
|
|
75
|
-
sessionId: string;
|
|
76
|
-
containerSelector?: string;
|
|
77
|
-
widgetConfig?: Partial<ChatConfig>;
|
|
78
|
-
}): void;
|
|
79
|
-
|
|
80
|
-
declare interface Message {
|
|
81
|
-
role: MessageRole;
|
|
82
|
-
content: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
declare type MessageRole = 'user' | 'assistant' | 'system';
|
|
86
|
-
|
|
87
|
-
export declare function setApiKey(key: string): void;
|
|
88
|
-
|
|
89
|
-
export declare function setApiUrl(url: string): void;
|
|
90
|
-
|
|
91
|
-
export declare function updateWidgetConfig(config: Partial<ChatConfig>): void;
|
|
92
|
-
|
|
93
|
-
export declare const useChatStore: UseBoundStore<StoreApi<ChatState>>;
|
|
94
|
-
|
|
95
|
-
export { }
|