@satek-team-intern/chatbot-widget 0.11.0 → 0.11.2
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.umd.js +9 -1
- package/dist/index.d.ts +90 -0
- package/dist/src/index.d.ts +5 -0
- package/package.json +7 -5
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,91 @@
|
|
|
1
|
+
import { ChatWidgetProps as ChatWidgetProps_2 } from '../../types';
|
|
2
|
+
import { FC } from 'react';
|
|
3
|
+
|
|
4
|
+
/** Các loại định dạng tập tin được phép đính kèm từ thiết bị */
|
|
5
|
+
declare type AttachmentType = 'image' | 'video' | 'audio' | 'file' | 'multiple';
|
|
6
|
+
|
|
7
|
+
declare interface AuthInfo {
|
|
8
|
+
code?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
phone?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare const ChatWidget: FC<ChatWidgetProps_2>;
|
|
16
|
+
|
|
17
|
+
export declare interface ChatWidgetProps {
|
|
18
|
+
scope?: WidgetScope;
|
|
19
|
+
title?: string;
|
|
20
|
+
workspace?: string;
|
|
21
|
+
logoUrl?: string;
|
|
22
|
+
primaryColor?: string;
|
|
23
|
+
auth: AuthInfo;
|
|
24
|
+
chatKey: string;
|
|
25
|
+
features?: WidgetFeature;
|
|
26
|
+
language?: LanguageOption;
|
|
27
|
+
initPosition?: PositionType;
|
|
28
|
+
disabledMembers?: string[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Các phương thức truyền thông và ghi hình.
|
|
33
|
+
* - 'voice': Ghi âm và gửi tin nhắn thoại.
|
|
34
|
+
*/
|
|
35
|
+
declare type CommunicationFeature = 'voice';
|
|
36
|
+
|
|
37
|
+
export declare function init(config: ChatWidgetProps): void;
|
|
38
|
+
|
|
39
|
+
/** Các tùy chọn ngôn ngữ hiển thị trên giao diện */
|
|
40
|
+
declare type LanguageOption = 'english' | 'vietnamese';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Vị trí tính theo tọa độ
|
|
44
|
+
*
|
|
45
|
+
* - right: Khoảng cách từ mép phải của cửa sổ trình duyệt đến điểm đặt widget.
|
|
46
|
+
* - bottom: Khoảng cách từ mép dưới của cửa sổ trình duyệt đến điểm đặt widget.
|
|
47
|
+
*/
|
|
48
|
+
declare interface PositionType {
|
|
49
|
+
right: number;
|
|
50
|
+
bottom: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Chế độ vận hành của cửa sổ chat.
|
|
55
|
+
* - 'single': Chat 1-1.
|
|
56
|
+
* - 'group': Chế độ chat nhóm nhiều người tham gia.
|
|
57
|
+
*/
|
|
58
|
+
declare type WidgetChatMode = 'single' | 'group';
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Các tùy chọn can thiệp và mở rộng giao diện Widget.
|
|
62
|
+
* - 'change-color': Người dùng cuối có thể tự chọn màu chủ đạo (Primary Color).
|
|
63
|
+
* - 'change-theme': Người dùng cuối có thể chuyển đổi giữa các chủ đề (ví dụ: Sáng/Tối).
|
|
64
|
+
* - 'drag-and-drop': Hiển thị cấu hình toggle kéo thả để thay đổi vị trí của widget trên màn hình.
|
|
65
|
+
* - 'resize-window': Cho phép người dùng thay đổi kích thước cửa sổ chat bằng cách kéo thả cạnh cửa sổ.
|
|
66
|
+
*/
|
|
67
|
+
declare type WidgetCustomizationOptions = 'change-color' | 'change-theme' | 'drag-and-drop' | 'resize-window';
|
|
68
|
+
|
|
69
|
+
declare interface WidgetFeature {
|
|
70
|
+
/** Danh sách các loại tập tin cho phép tải lên. Nếu có 'multiple', cho phép chọn nhiều file. */
|
|
71
|
+
attachments?: AttachmentType[];
|
|
72
|
+
/** Các tính năng tương tác trực tiếp bằng âm thanh và hình ảnh. */
|
|
73
|
+
communication?: CommunicationFeature[];
|
|
74
|
+
/**
|
|
75
|
+
* Xác định các hình thức hội thoại mà widget hỗ trợ.
|
|
76
|
+
* Nếu không truyền, mặc định là ['single']
|
|
77
|
+
*/
|
|
78
|
+
chatModes?: WidgetChatMode[];
|
|
79
|
+
/** Các quyền tùy biến giao diện cho phép người dùng thực hiện. */
|
|
80
|
+
customizations?: WidgetCustomizationOptions[];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Phạm vi hoạt động (Ngữ cảnh môi trường) của Chat Widget.
|
|
85
|
+
*
|
|
86
|
+
* - `external`: Widget được nhúng vào các website bên ngoài (phục vụ khách vãng lai và admin).
|
|
87
|
+
* - `internal`: Widget chạy nội bộ trong hệ thống/app SaOne (phục vụ cho thành viên - member).
|
|
88
|
+
*/
|
|
89
|
+
declare type WidgetScope = 'external' | 'internal';
|
|
90
|
+
|
|
1
91
|
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@satek-team-intern/chatbot-widget",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "A widget chatbot can be integrated into any website, providing a seamless and interactive user experience. It is designed to be easily embedded and customizable, allowing businesses to engage with their customers effectively.",
|
|
5
5
|
"author": "Satek Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,17 +18,19 @@
|
|
|
18
18
|
"publishConfig": {
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
21
|
+
"types": "./dist/src/index.d.ts",
|
|
22
22
|
"scripts": {
|
|
23
23
|
"dev": "vite",
|
|
24
|
-
"build": "
|
|
24
|
+
"build": "npm run build:es && npm run build:umd",
|
|
25
|
+
"build:es": "cross-env VITE_TARGET_FORMAT=es vite build",
|
|
26
|
+
"build:umd": "cross-env VITE_TARGET_FORMAT=umd vite build",
|
|
25
27
|
"lint": "eslint --fix",
|
|
26
28
|
"prepare": "husky",
|
|
27
|
-
"prepublishOnly": "npm run lint && npm run build"
|
|
29
|
+
"prepublishOnly": "npm run lint && npx tsc --noEmit && npm run build"
|
|
28
30
|
},
|
|
29
31
|
"exports": {
|
|
30
32
|
".": {
|
|
31
|
-
"types": "./dist/index.d.ts",
|
|
33
|
+
"types": "./dist/src/index.d.ts",
|
|
32
34
|
"import": "./dist/chatbot-widget.es.js",
|
|
33
35
|
"require": "./dist/chatbot-widget.umd.js"
|
|
34
36
|
}
|