widget-chatbot 2.0.6 → 2.0.7-alpha.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/README.md +85 -85
- package/dist/index.d.ts +25 -25
- package/dist/widget-chatbot.es.js +1858 -1856
- package/package.json +54 -54
package/README.md
CHANGED
|
@@ -1,85 +1,85 @@
|
|
|
1
|
-
### Built With
|
|
2
|
-
|
|
3
|
-
- [![React][react.js]][react-url]
|
|
4
|
-
- [![Socket-io][socket-io-img]][socket-io-url]
|
|
5
|
-
- [![Chart.js][chart.js-img]][chart.js-url]
|
|
6
|
-
|
|
7
|
-
### Requirements
|
|
8
|
-
|
|
9
|
-
- Node : >=21.7.3
|
|
10
|
-
- react : >=^17.0.2
|
|
11
|
-
- react-dom : >=^17.0.2
|
|
12
|
-
- @emoji-mart/react
|
|
13
|
-
- @ant-design/plots
|
|
14
|
-
- antd
|
|
15
|
-
- axios
|
|
16
|
-
- react-markdown
|
|
17
|
-
- remark-gfm
|
|
18
|
-
|
|
19
|
-
## Getting Started
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
npm i widget-chatbot
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
```sh
|
|
28
|
-
import Widget from 'widget-chatbot';
|
|
29
|
-
import { createBrowserHistory } from 'history';
|
|
30
|
-
import 'widget-chatbot/dist/widget-chatbot.css';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const history = createBrowserHistory();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const App = ()=>{
|
|
37
|
-
const initPayload = {
|
|
38
|
-
access_token: 'jwt token',
|
|
39
|
-
refresh_token: 'refresh token',
|
|
40
|
-
uagent: window.navigator.userAgent,
|
|
41
|
-
uriBackend: 'uri backend',
|
|
42
|
-
uriService: 'uri open ai service chatbot',
|
|
43
|
-
companyid: 'coid',
|
|
44
|
-
companycode:'companycode',
|
|
45
|
-
lang:'EN',
|
|
46
|
-
uriBackendEnt: 'uri backend go',
|
|
47
|
-
uriBackendHRMGO: 'uri backend hrm go',
|
|
48
|
-
config: cookies?.CHATBOT?.config,
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const textSayHiAndGetStarted = 'Hi and get started';
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<Widget
|
|
56
|
-
getStartedPayload={getInitPayload()}
|
|
57
|
-
history={history}
|
|
58
|
-
keyEncrypt={keyEncrypt}
|
|
59
|
-
onPayslipFn={{
|
|
60
|
-
onCheckPYAccess,
|
|
61
|
-
onSubmitPYPwd,
|
|
62
|
-
}}
|
|
63
|
-
socketPath={socketPath || ''}
|
|
64
|
-
socketURL={socketUrl}
|
|
65
|
-
subTitle={textSayHiAndGetStarted}
|
|
66
|
-
title={textSunfishAssistantTitle}
|
|
67
|
-
isSF
|
|
68
|
-
/>
|
|
69
|
-
)
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## [Click this for Publish Process](./publish_process/README.md)
|
|
74
|
-
|
|
75
|
-
<!-- Read [This](./publish_process/README.md) -->
|
|
76
|
-
|
|
77
|
-
<!-- MARKDOWN LINKS & IMAGES -->
|
|
78
|
-
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
|
79
|
-
|
|
80
|
-
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
|
|
81
|
-
[react-url]: https://reactjs.org/
|
|
82
|
-
[socket-io-url]: https://socket.io/
|
|
83
|
-
[socket-io-img]: https://img.shields.io/badge/Socket-io?logo=socketdotio&label=Socket.io
|
|
84
|
-
[chart.js-url]: https://www.chartjs.org/
|
|
85
|
-
[chart.js-img]: https://img.shields.io/badge/Chart-js?logo=chartdotjs&logoColor=%23FF6384&label=Chart.js&labelColor=white&color=%23FF6384
|
|
1
|
+
### Built With
|
|
2
|
+
|
|
3
|
+
- [![React][react.js]][react-url]
|
|
4
|
+
- [![Socket-io][socket-io-img]][socket-io-url]
|
|
5
|
+
- [![Chart.js][chart.js-img]][chart.js-url]
|
|
6
|
+
|
|
7
|
+
### Requirements
|
|
8
|
+
|
|
9
|
+
- Node : >=21.7.3
|
|
10
|
+
- react : >=^17.0.2
|
|
11
|
+
- react-dom : >=^17.0.2
|
|
12
|
+
- @emoji-mart/react
|
|
13
|
+
- @ant-design/plots
|
|
14
|
+
- antd
|
|
15
|
+
- axios
|
|
16
|
+
- react-markdown
|
|
17
|
+
- remark-gfm
|
|
18
|
+
|
|
19
|
+
## Getting Started
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm i widget-chatbot
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
import Widget from 'widget-chatbot';
|
|
29
|
+
import { createBrowserHistory } from 'history';
|
|
30
|
+
import 'widget-chatbot/dist/widget-chatbot.css';
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
const history = createBrowserHistory();
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
const App = ()=>{
|
|
37
|
+
const initPayload = {
|
|
38
|
+
access_token: 'jwt token',
|
|
39
|
+
refresh_token: 'refresh token',
|
|
40
|
+
uagent: window.navigator.userAgent,
|
|
41
|
+
uriBackend: 'uri backend',
|
|
42
|
+
uriService: 'uri open ai service chatbot',
|
|
43
|
+
companyid: 'coid',
|
|
44
|
+
companycode:'companycode',
|
|
45
|
+
lang:'EN',
|
|
46
|
+
uriBackendEnt: 'uri backend go',
|
|
47
|
+
uriBackendHRMGO: 'uri backend hrm go',
|
|
48
|
+
config: cookies?.CHATBOT?.config,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const textSayHiAndGetStarted = 'Hi and get started';
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Widget
|
|
56
|
+
getStartedPayload={getInitPayload()}
|
|
57
|
+
history={history}
|
|
58
|
+
keyEncrypt={keyEncrypt}
|
|
59
|
+
onPayslipFn={{
|
|
60
|
+
onCheckPYAccess,
|
|
61
|
+
onSubmitPYPwd,
|
|
62
|
+
}}
|
|
63
|
+
socketPath={socketPath || ''}
|
|
64
|
+
socketURL={socketUrl}
|
|
65
|
+
subTitle={textSayHiAndGetStarted}
|
|
66
|
+
title={textSunfishAssistantTitle}
|
|
67
|
+
isSF
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## [Click this for Publish Process](./publish_process/README.md)
|
|
74
|
+
|
|
75
|
+
<!-- Read [This](./publish_process/README.md) -->
|
|
76
|
+
|
|
77
|
+
<!-- MARKDOWN LINKS & IMAGES -->
|
|
78
|
+
<!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->
|
|
79
|
+
|
|
80
|
+
[react.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge&logo=react&logoColor=61DAFB
|
|
81
|
+
[react-url]: https://reactjs.org/
|
|
82
|
+
[socket-io-url]: https://socket.io/
|
|
83
|
+
[socket-io-img]: https://img.shields.io/badge/Socket-io?logo=socketdotio&label=Socket.io
|
|
84
|
+
[chart.js-url]: https://www.chartjs.org/
|
|
85
|
+
[chart.js-img]: https://img.shields.io/badge/Chart-js?logo=chartdotjs&logoColor=%23FF6384&label=Chart.js&labelColor=white&color=%23FF6384
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Axios } from "axios";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
|
|
4
|
-
declare module "widget-chatbot" {
|
|
5
|
-
type PayslipFn = {
|
|
6
|
-
onSubmitPYPwd: () => Axios;
|
|
7
|
-
onCheckPYAccess: () => void;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type WidgetChatbotProps = {
|
|
11
|
-
getStartedPayload: string;
|
|
12
|
-
socketURL: string;
|
|
13
|
-
socketPath: string;
|
|
14
|
-
onPayslipFn: PayslipFn;
|
|
15
|
-
title: string;
|
|
16
|
-
subTitle: string;
|
|
17
|
-
keyEncrypt: string;
|
|
18
|
-
history: Object;
|
|
19
|
-
isSF?: boolean;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const WidgetChatbot: (props: WidgetChatbotProps) => ReactNode;
|
|
23
|
-
|
|
24
|
-
export default WidgetChatbot;
|
|
25
|
-
}
|
|
1
|
+
import { Axios } from "axios";
|
|
2
|
+
import { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
declare module "widget-chatbot" {
|
|
5
|
+
type PayslipFn = {
|
|
6
|
+
onSubmitPYPwd: () => Axios;
|
|
7
|
+
onCheckPYAccess: () => void;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type WidgetChatbotProps = {
|
|
11
|
+
getStartedPayload: string;
|
|
12
|
+
socketURL: string;
|
|
13
|
+
socketPath: string;
|
|
14
|
+
onPayslipFn: PayslipFn;
|
|
15
|
+
title: string;
|
|
16
|
+
subTitle: string;
|
|
17
|
+
keyEncrypt: string;
|
|
18
|
+
history: Object;
|
|
19
|
+
isSF?: boolean;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const WidgetChatbot: (props: WidgetChatbotProps) => ReactNode;
|
|
23
|
+
|
|
24
|
+
export default WidgetChatbot;
|
|
25
|
+
}
|