@schmitech/chatbot-widget 0.1.0 → 0.2.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/README.md +134 -109
- package/dist/__vite-browser-external-DYxpcVy9-ctqB3X8p.js +5 -0
- package/dist/chatbot-widget.bundle.js +96 -32
- package/dist/chatbot-widget.css +1 -1
- package/dist/chatbot-widget.es.js +8709 -0
- package/dist/chatbot-widget.umd.js +95 -31
- package/dist/index.d.ts +30 -35
- package/package.json +4 -2
- package/dist/chatbot-widget.umd.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,19 +3,42 @@ import { StoreApi } from 'zustand';
|
|
|
3
3
|
import { UseBoundStore } from 'zustand';
|
|
4
4
|
|
|
5
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
|
+
};
|
|
6
33
|
welcome: {
|
|
7
34
|
title: string;
|
|
8
35
|
description: string;
|
|
9
36
|
};
|
|
10
|
-
suggestedQuestions: {
|
|
37
|
+
suggestedQuestions: Array<{
|
|
11
38
|
text: string;
|
|
12
39
|
query: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
title: string;
|
|
16
|
-
};
|
|
17
|
-
theme: ThemeConfig;
|
|
18
|
-
icon?: IconType;
|
|
40
|
+
}>;
|
|
41
|
+
icon?: string;
|
|
19
42
|
}
|
|
20
43
|
|
|
21
44
|
declare interface ChatState {
|
|
@@ -41,8 +64,6 @@ export declare function getApiUrl(): string;
|
|
|
41
64
|
|
|
42
65
|
export declare const getChatConfig: () => ChatConfig;
|
|
43
66
|
|
|
44
|
-
declare type IconType = 'heart' | 'message-square' | 'message-circle' | 'help-circle' | 'info' | 'bot' | 'sparkles';
|
|
45
|
-
|
|
46
67
|
export declare function injectChatWidget(config: {
|
|
47
68
|
apiUrl: string;
|
|
48
69
|
containerSelector?: string;
|
|
@@ -58,32 +79,6 @@ declare type MessageRole = 'user' | 'assistant' | 'system';
|
|
|
58
79
|
|
|
59
80
|
export declare function setApiUrl(url: string): void;
|
|
60
81
|
|
|
61
|
-
declare interface ThemeConfig {
|
|
62
|
-
primary: string;
|
|
63
|
-
secondary: string;
|
|
64
|
-
background: string;
|
|
65
|
-
text: {
|
|
66
|
-
primary: string;
|
|
67
|
-
secondary: string;
|
|
68
|
-
inverse: string;
|
|
69
|
-
};
|
|
70
|
-
input: {
|
|
71
|
-
background: string;
|
|
72
|
-
border: string;
|
|
73
|
-
};
|
|
74
|
-
message: {
|
|
75
|
-
user: string;
|
|
76
|
-
assistant: string;
|
|
77
|
-
userText: string;
|
|
78
|
-
};
|
|
79
|
-
suggestedQuestions: {
|
|
80
|
-
background: string;
|
|
81
|
-
hoverBackground: string;
|
|
82
|
-
text: string;
|
|
83
|
-
};
|
|
84
|
-
iconColor: string;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
82
|
export declare function updateWidgetConfig(config: Partial<ChatConfig>): void;
|
|
88
83
|
|
|
89
84
|
export declare const useChatStore: UseBoundStore<StoreApi<ChatState>>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schmitech/chatbot-widget",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1
|
|
4
|
+
"version": "0.2.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/chatbot-widget.umd.js",
|
|
7
7
|
"module": "./dist/chatbot-widget.es.js",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"dev": "vite",
|
|
23
23
|
"build": "tsc && vite build",
|
|
24
24
|
"build:bundle": "node scripts/bundle.js",
|
|
25
|
+
"build:all": "./scripts/build.sh",
|
|
25
26
|
"lint": "eslint .",
|
|
26
27
|
"preview": "vite preview"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
|
-
"@schmitech/chatbot-api": "^0.
|
|
30
|
+
"@schmitech/chatbot-api": "^0.2.1",
|
|
30
31
|
"clsx": "^2.1.0",
|
|
31
32
|
"lucide-react": "^0.344.0",
|
|
32
33
|
"react": "^18.3.1",
|
|
@@ -36,6 +37,7 @@
|
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@eslint/js": "^9.9.1",
|
|
40
|
+
"@tailwindcss/typography": "^0.5.16",
|
|
39
41
|
"@types/node": "^22.13.11",
|
|
40
42
|
"@types/react": "^18.3.5",
|
|
41
43
|
"@types/react-dom": "^18.3.0",
|