@eshal-bot/chat-widget 0.1.26 → 0.1.28
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.esm.js.map +1 -1
- package/dist/chat-widget.js +534 -165
- package/dist/chat-widget.js.map +1 -1
- package/dist/chat-widget.min.js +7 -7
- package/dist/chat-widget.umd.js +5 -5
- package/dist/chat-widget.umd.js.map +1 -1
- package/index.d.ts +75 -0
- package/package.json +89 -87
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,88 +1,90 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@eshal-bot/chat-widget",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Beautiful, embeddable chat widget with dark mode support",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/chat-widget.js",
|
|
7
|
-
"module": "dist/chat-widget.esm.js",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./
|
|
11
|
-
"import": "./dist/chat-widget.esm.js",
|
|
12
|
-
"require": "./dist/chat-widget.umd.js",
|
|
13
|
-
"browser": "./dist/chat-widget.js"
|
|
14
|
-
},
|
|
15
|
-
"./dist/index.css": "./dist/index.css",
|
|
16
|
-
"./dist/chat-widget.css": "./dist/chat-widget.css",
|
|
17
|
-
"./dist/chat-widget.esm.css": "./dist/chat-widget.esm.css"
|
|
18
|
-
},
|
|
19
|
-
"types": "
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"dev
|
|
27
|
-
"dev:
|
|
28
|
-
"
|
|
29
|
-
"build
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
"react
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"@babel/
|
|
59
|
-
"@babel/preset-
|
|
60
|
-
"@
|
|
61
|
-
"@rollup/plugin-
|
|
62
|
-
"@rollup/plugin-
|
|
63
|
-
"@rollup/plugin-
|
|
64
|
-
"@rollup/plugin-
|
|
65
|
-
"@rollup/plugin-
|
|
66
|
-
"@
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"rollup
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"react
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@eshal-bot/chat-widget",
|
|
3
|
+
"version": "0.1.28",
|
|
4
|
+
"description": "Beautiful, embeddable chat widget with dark mode support",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/chat-widget.js",
|
|
7
|
+
"module": "dist/chat-widget.esm.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./index.d.ts",
|
|
11
|
+
"import": "./dist/chat-widget.esm.js",
|
|
12
|
+
"require": "./dist/chat-widget.umd.js",
|
|
13
|
+
"browser": "./dist/chat-widget.js"
|
|
14
|
+
},
|
|
15
|
+
"./dist/index.css": "./dist/index.css",
|
|
16
|
+
"./dist/chat-widget.css": "./dist/chat-widget.css",
|
|
17
|
+
"./dist/chat-widget.esm.css": "./dist/chat-widget.esm.css"
|
|
18
|
+
},
|
|
19
|
+
"types": "index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"index.d.ts",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite",
|
|
27
|
+
"dev:rollup": "rollup -c -w",
|
|
28
|
+
"dev:react": "vite",
|
|
29
|
+
"build": "npm run build:types && cross-env NODE_ENV=production rollup -c",
|
|
30
|
+
"build:dev": "npm run build:types && cross-env NODE_ENV=development rollup -c",
|
|
31
|
+
"prepublishOnly": "npm run build",
|
|
32
|
+
"build:types": "node scripts/generate-types.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"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"chat",
|
|
37
|
+
"widget",
|
|
38
|
+
"intercom",
|
|
39
|
+
"customer-support",
|
|
40
|
+
"react",
|
|
41
|
+
"dark-mode"
|
|
42
|
+
],
|
|
43
|
+
"author": "Your Company",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"react": ">=16.8.0",
|
|
47
|
+
"react-dom": ">=16.8.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependenciesMeta": {
|
|
50
|
+
"react": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"react-dom": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@babel/core": "^7.23.0",
|
|
59
|
+
"@babel/preset-env": "^7.23.0",
|
|
60
|
+
"@babel/preset-react": "^7.22.0",
|
|
61
|
+
"@rollup/plugin-babel": "^6.0.3",
|
|
62
|
+
"@rollup/plugin-commonjs": "^25.0.0",
|
|
63
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
64
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
65
|
+
"@rollup/plugin-node-resolve": "^15.1.0",
|
|
66
|
+
"@rollup/plugin-replace": "^5.0.2",
|
|
67
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
68
|
+
"@vitejs/plugin-react": "^4.7.0",
|
|
69
|
+
"autoprefixer": "^10.4.14",
|
|
70
|
+
"cross-env": "^10.1.0",
|
|
71
|
+
"cssnano": "^6.0.1",
|
|
72
|
+
"jsdom": "^27.1.0",
|
|
73
|
+
"postcss": "^8.4.27",
|
|
74
|
+
"postcss-import": "^15.1.0",
|
|
75
|
+
"react": "^18.2.0",
|
|
76
|
+
"react-dom": "^18.2.0",
|
|
77
|
+
"rollup": "^3.26.0",
|
|
78
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
79
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
80
|
+
"tailwindcss": "^3.3.0",
|
|
81
|
+
"vite": "^5.4.21"
|
|
82
|
+
},
|
|
83
|
+
"dependencies": {
|
|
84
|
+
"lucide-react": "^0.575.0",
|
|
85
|
+
"react-markdown": "^9.0.1",
|
|
86
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
87
|
+
"remark-gfm": "^3.0.1",
|
|
88
|
+
"webfontloader": "^1.6.28"
|
|
89
|
+
}
|
|
88
90
|
}
|