@eshal-bot/chat-widget 0.1.25 → 0.1.27
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/chat-widget.esm.js +5 -5
- package/dist/chat-widget.js +536 -158
- package/dist/chat-widget.min.js +7 -7
- package/dist/chat-widget.umd.js +5 -5
- package/index.d.ts +75 -0
- package/package.json +5 -4
package/index.d.ts
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface ChatWidgetProps {
|
|
4
|
+
darkMode?: boolean;
|
|
5
|
+
primaryColor?: string;
|
|
6
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
7
|
+
companyName?: string;
|
|
8
|
+
companyLogo?: string | null;
|
|
9
|
+
welcomeMessage?: string;
|
|
10
|
+
apiBaseUrl?: string;
|
|
11
|
+
organizationId?: string;
|
|
12
|
+
quickQuestions?: string[];
|
|
13
|
+
quickQuestionsLayout?: 'vertical' | 'horizontal';
|
|
14
|
+
textColor?: string;
|
|
15
|
+
agentMessageBubbleColor?: string;
|
|
16
|
+
userMessageBoxColor?: string;
|
|
17
|
+
assistantTextColor?: string;
|
|
18
|
+
userTextColor?: string;
|
|
19
|
+
fontFamily?: string;
|
|
20
|
+
fontSize?: string;
|
|
21
|
+
defaultLanguage?: string;
|
|
22
|
+
autoOpen?: boolean;
|
|
23
|
+
openDelay?: number;
|
|
24
|
+
locale?: string;
|
|
25
|
+
headerTextBold?: boolean;
|
|
26
|
+
headerTextItalic?: boolean;
|
|
27
|
+
enableVoiceInteraction?: boolean;
|
|
28
|
+
disclaimerText?: string;
|
|
29
|
+
disclaimerPosition?: 'top' | 'footer';
|
|
30
|
+
showPoweredBy?: boolean;
|
|
31
|
+
conciergeName?: string;
|
|
32
|
+
className?: string;
|
|
33
|
+
onboardingQuestions?: Array<{
|
|
34
|
+
askToType: string;
|
|
35
|
+
fieldType: 'phone' | 'fullName' | 'email';
|
|
36
|
+
required: boolean;
|
|
37
|
+
}>;
|
|
38
|
+
collectionPrompt?: string;
|
|
39
|
+
allowedDomains?: string[];
|
|
40
|
+
onboardingEnabled?: boolean;
|
|
41
|
+
inactivityTimeoutValue?: number;
|
|
42
|
+
inactivityTimeoutUnit?: 'MINUTES' | 'HOURS' | 'DAYS';
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare const ChatWidget: FC<ChatWidgetProps>;
|
|
46
|
+
|
|
47
|
+
export default ChatWidget;
|
|
48
|
+
|
|
49
|
+
export interface VanillaConfig extends ChatWidgetProps {
|
|
50
|
+
apiUrl?: string;
|
|
51
|
+
apiKey?: string;
|
|
52
|
+
sessionUrl?: string;
|
|
53
|
+
userId?: string;
|
|
54
|
+
userName?: string;
|
|
55
|
+
userEmail?: string;
|
|
56
|
+
onOpen?: () => void;
|
|
57
|
+
onClose?: () => void;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface VanillaAPI {
|
|
61
|
+
init(config?: VanillaConfig): Promise<VanillaAPI>;
|
|
62
|
+
updateConfig(config: Partial<VanillaConfig>): VanillaAPI;
|
|
63
|
+
open(): VanillaAPI;
|
|
64
|
+
close(): VanillaAPI;
|
|
65
|
+
toggleTheme(): VanillaAPI;
|
|
66
|
+
destroy(): VanillaAPI;
|
|
67
|
+
getConfig(): VanillaConfig;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare global {
|
|
71
|
+
interface Window {
|
|
72
|
+
ChatWidget: VanillaAPI;
|
|
73
|
+
ChatWidgetConfig?: VanillaConfig;
|
|
74
|
+
}
|
|
75
|
+
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eshal-bot/chat-widget",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "Beautiful, embeddable chat widget with dark mode support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/chat-widget.js",
|
|
7
7
|
"module": "dist/chat-widget.esm.js",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
11
|
"import": "./dist/chat-widget.esm.js",
|
|
12
12
|
"require": "./dist/chat-widget.umd.js",
|
|
13
13
|
"browser": "./dist/chat-widget.js"
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"./dist/chat-widget.css": "./dist/chat-widget.css",
|
|
17
17
|
"./dist/chat-widget.esm.css": "./dist/chat-widget.esm.css"
|
|
18
18
|
},
|
|
19
|
-
"types": "
|
|
19
|
+
"types": "index.d.ts",
|
|
20
20
|
"files": [
|
|
21
21
|
"dist",
|
|
22
|
+
"index.d.ts",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"scripts": {
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"build:dev": "npm run build:types && cross-env NODE_ENV=development rollup -c",
|
|
30
31
|
"prepublishOnly": "npm run build",
|
|
31
32
|
"build:types": "node scripts/generate-types.js",
|
|
32
|
-
"postpublish": "curl -s https://purge.jsdelivr.net/npm/@eshal-bot/chat-widget@latest/dist/chat-widget.min.js"
|
|
33
|
+
"postpublish": "curl -s https://purge.jsdelivr.net/npm/@eshal-bot/chat-widget@latest/dist/chat-widget.min.js && curl -s https://purge.jsdelivr.net/npm/@eshal-bot/chat-widget@latest/dist/chat-widget.js && curl -s https://purge.jsdelivr.net/npm/@eshal-bot/chat-widget"
|
|
33
34
|
},
|
|
34
35
|
"keywords": [
|
|
35
36
|
"chat",
|