bibot 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/.babelrc +7 -0
- package/.vscode/settings.json +5 -0
- package/README.md +46 -0
- package/dist/bibot.d.ts +5 -0
- package/dist/bibot.js +173 -0
- package/dist/bibot.js.map +1 -0
- package/dist/config/appStateEnums.d.ts +3 -0
- package/dist/config/appStateEnums.js +10 -0
- package/dist/config/appStateEnums.js.map +1 -0
- package/dist/config/endpointEnums.d.ts +18 -0
- package/dist/config/endpointEnums.js +31 -0
- package/dist/config/endpointEnums.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +38 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/statusCode.d.ts +42 -0
- package/dist/config/statusCode.js +49 -0
- package/dist/config/statusCode.js.map +1 -0
- package/dist/context/AppContext.d.ts +8 -0
- package/dist/context/AppContext.js +75 -0
- package/dist/context/AppContext.js.map +1 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +16 -0
- package/dist/context/index.js.map +1 -0
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +38 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/mobileView.d.ts +1 -0
- package/dist/hooks/mobileView.js +33 -0
- package/dist/hooks/mobileView.js.map +1 -0
- package/dist/hooks/useBiBotChatBot.d.ts +29 -0
- package/dist/hooks/useBiBotChatBot.js +206 -0
- package/dist/hooks/useBiBotChatBot.js.map +1 -0
- package/dist/hooks/usePluginFactory.d.ts +1 -0
- package/dist/hooks/usePluginFactory.js +62 -0
- package/dist/hooks/usePluginFactory.js.map +1 -0
- package/dist/index.css +36 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/reducers/appReducer.d.ts +2 -0
- package/dist/reducers/appReducer.js +24 -0
- package/dist/reducers/appReducer.js.map +1 -0
- package/dist/reducers/index.d.ts +1 -0
- package/dist/reducers/index.js +16 -0
- package/dist/reducers/index.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +16 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/plugin-api.d.ts +26 -0
- package/dist/services/plugin-api.js +185 -0
- package/dist/services/plugin-api.js.map +1 -0
- package/dist/styles/RegisterPageStyle.css +63 -0
- package/dist/styles/adminPortal.css +26 -0
- package/dist/styles/appConfig.css +90 -0
- package/dist/styles/buttonStyle.css +27 -0
- package/dist/styles/chatStyle.css +140 -0
- package/dist/styles/index.css +82 -0
- package/dist/styles/predefinedStyle.css +35 -0
- package/dist/styles/themeStyle.css +42 -0
- package/dist/styles/training.css +86 -0
- package/dist/types/coreInterfaces.d.ts +51 -0
- package/dist/types/coreInterfaces.js +5 -0
- package/dist/types/coreInterfaces.js.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +27 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/sessionManager.d.ts +2 -0
- package/dist/utils/sessionManager.js +17 -0
- package/dist/utils/sessionManager.js.map +1 -0
- package/dist/utils/trimWhitespace.d.ts +2 -0
- package/dist/utils/trimWhitespace.js +15 -0
- package/dist/utils/trimWhitespace.js.map +1 -0
- package/example/README.md +46 -0
- package/example/package-lock.json +18173 -0
- package/example/package.json +47 -0
- package/example/public/favicon.ico +0 -0
- package/example/public/index.html +43 -0
- package/example/public/logo192.png +0 -0
- package/example/public/logo512.png +0 -0
- package/example/public/manifest.json +25 -0
- package/example/public/robots.txt +3 -0
- package/example/src/App.css +38 -0
- package/example/src/App.test.tsx +9 -0
- package/example/src/App.tsx +28 -0
- package/example/src/index.css +13 -0
- package/example/src/index.tsx +13 -0
- package/example/src/logo.svg +1 -0
- package/example/src/react-app-env.d.ts +1 -0
- package/example/tsconfig.json +26 -0
- package/package.json +30 -8
- package/src/bibot.tsx +111 -0
- package/src/config/appStateEnums.ts +3 -0
- package/src/config/endpointEnums.ts +28 -0
- package/src/config/index.ts +5 -0
- package/src/config/statusCode.ts +49 -0
- package/src/context/AppContext.tsx +66 -0
- package/src/context/index.ts +3 -0
- package/src/hooks/index.ts +5 -0
- package/src/hooks/mobileView.tsx +17 -0
- package/src/hooks/useBiBotChatBot.tsx +107 -0
- package/src/hooks/usePluginFactory.tsx +38 -0
- package/src/index.css +36 -0
- package/src/index.tsx +3 -11
- package/src/reducers/appReducer.ts +16 -0
- package/src/reducers/index.ts +4 -0
- package/src/services/index.ts +2 -0
- package/src/services/plugin-api.tsx +120 -0
- package/src/styles/RegisterPageStyle.css +63 -0
- package/src/styles/adminPortal.css +26 -0
- package/src/styles/appConfig.css +90 -0
- package/src/styles/buttonStyle.css +27 -0
- package/src/styles/chatStyle.css +140 -0
- package/src/styles/index.css +82 -0
- package/src/styles/predefinedStyle.css +35 -0
- package/src/styles/themeStyle.css +42 -0
- package/src/styles/training.css +86 -0
- package/src/types/coreInterfaces.ts +69 -0
- package/src/types/index.ts +4 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/sessionManager.tsx +15 -0
- package/src/utils/trimWhitespace.ts +11 -0
- package/tsconfig.json +25 -0
- package/webpack.config.js +19 -0
- package/src/App.tsx +0 -11
@@ -0,0 +1,82 @@
|
|
1
|
+
@import 'themeStyle.css';
|
2
|
+
@import 'buttonStyle.css';
|
3
|
+
@import 'chatStyle.css';
|
4
|
+
@import 'predefinedStyle.css';
|
5
|
+
body {
|
6
|
+
font-family: 'Roboto', sans-serif;
|
7
|
+
margin: 0;
|
8
|
+
}
|
9
|
+
|
10
|
+
code {
|
11
|
+
font-family: 'Roboto', sans-serif;
|
12
|
+
}
|
13
|
+
|
14
|
+
.cardsBody, .container, .header, .display-message, .position, .embed-report, .controls, .footer, .button, .login-container, .admin-layout, .client-layout, .admin-header, .client-header, .content-layout, .title, .menu, .site-layout-background, .not-implemented, .admin-footer, .client-footer, .report-container {
|
15
|
+
box-sizing: border-box;
|
16
|
+
}
|
17
|
+
|
18
|
+
.cardsBody {
|
19
|
+
margin: 0;
|
20
|
+
padding: 10px;
|
21
|
+
min-height: 100vh;
|
22
|
+
display: flex;
|
23
|
+
flex-direction: column;
|
24
|
+
}
|
25
|
+
|
26
|
+
.content-layout {
|
27
|
+
padding: 24px;
|
28
|
+
margin: 0;
|
29
|
+
min-height: 280px;
|
30
|
+
/* background: green; */
|
31
|
+
}
|
32
|
+
|
33
|
+
.site-layout-background {
|
34
|
+
padding: 24px;
|
35
|
+
/* background-color: red; */
|
36
|
+
}
|
37
|
+
|
38
|
+
.admin-footer, .client-footer {
|
39
|
+
text-align: center;
|
40
|
+
background: #fff;
|
41
|
+
padding: 10px 50px;
|
42
|
+
}
|
43
|
+
|
44
|
+
.not-implemented {
|
45
|
+
min-height: 89.1vh;
|
46
|
+
color: red;
|
47
|
+
background-size: fit;
|
48
|
+
background-position: center;
|
49
|
+
background-repeat: no-repeat;
|
50
|
+
background-image: var(--bg-logo);
|
51
|
+
}
|
52
|
+
|
53
|
+
.ant-spin-dot-item {
|
54
|
+
background-color: #d67632 !important;
|
55
|
+
color: #d67632 !important;
|
56
|
+
}
|
57
|
+
|
58
|
+
.admin-layout, .client-layout {
|
59
|
+
flex: 1;
|
60
|
+
overflow-y: auto;
|
61
|
+
}
|
62
|
+
|
63
|
+
.descriptions-custom .ant-descriptions-item-label {
|
64
|
+
width: 20%;
|
65
|
+
}
|
66
|
+
|
67
|
+
.descriptions-custom .ant-descriptions-item-content {
|
68
|
+
width: 70%;
|
69
|
+
}
|
70
|
+
|
71
|
+
h1 {
|
72
|
+
color: #165a72;
|
73
|
+
margin: 50px auto;
|
74
|
+
font-size: 40px;
|
75
|
+
}
|
76
|
+
.soc-menu {
|
77
|
+
margin-bottom: 40px;
|
78
|
+
margin-top: 20px;
|
79
|
+
}
|
80
|
+
h2 {
|
81
|
+
color: #165a72;
|
82
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.predefined-questions {
|
2
|
+
margin-top: 10px;
|
3
|
+
padding: 10px;
|
4
|
+
background-color: #f7f7f7; /* light gray background */
|
5
|
+
border-top: 1px solid #e0e0e0; /* separator from the messages */
|
6
|
+
}
|
7
|
+
|
8
|
+
.predefined-question {
|
9
|
+
padding: 8px 12px;
|
10
|
+
margin-bottom: 5px; /* space between questions */
|
11
|
+
background-color: #ffffff; /* white background for the questions */
|
12
|
+
border: 1px solid #dedede; /* light gray border */
|
13
|
+
border-radius: 15px; /* rounded corners */
|
14
|
+
cursor: pointer;
|
15
|
+
transition: background-color 0.3s ease; /* smooth background color change on hover */
|
16
|
+
}
|
17
|
+
|
18
|
+
.predefined-question:hover {
|
19
|
+
background-color: #e8f0fe; /* slightly blue background on hover */
|
20
|
+
}
|
21
|
+
|
22
|
+
/* You may want to add additional styles for text size, color, and alignment */
|
23
|
+
.predefined-question {
|
24
|
+
font-size: 0.9rem; /* moderate text size */
|
25
|
+
color: #333333; /* dark gray text color */
|
26
|
+
text-align: left;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* Ensuring the list doesn't cover the entire chat window and has a scroll if there are many items */
|
30
|
+
.predefined-questions {
|
31
|
+
/* max-height: 150px; */
|
32
|
+
height: 100%;
|
33
|
+
overflow-y: auto; /* enables scroll */
|
34
|
+
}
|
35
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
@tailwind base;
|
2
|
+
@tailwind components;
|
3
|
+
@tailwind utilities;
|
4
|
+
|
5
|
+
.light {
|
6
|
+
/* Light mode colors */
|
7
|
+
--bg-color: #f0f0f0;
|
8
|
+
--text-color: #333;
|
9
|
+
--bg-light: #fff;
|
10
|
+
--text-light: #333;
|
11
|
+
--hover-bg-light: #000;
|
12
|
+
--hover-text-light: #fff;
|
13
|
+
--expanded-bg-light: #f5f5f5;
|
14
|
+
--sidebar-text-light: #333;
|
15
|
+
--sidebar-hover-bg-light: #000;
|
16
|
+
--sidebar-hover-text-light: #fff;
|
17
|
+
--sidebar-expanded-bg-light: #f5f5f5;
|
18
|
+
--border-color: blue;
|
19
|
+
--highlight-color: #ffcc00;
|
20
|
+
--bg-logo: url('/src/assets/logo/preauditai-high-resolution-logo-transparent.png')
|
21
|
+
}
|
22
|
+
|
23
|
+
.dark {
|
24
|
+
/* Dark mode colors */
|
25
|
+
--bg-color: #333;
|
26
|
+
--text-color: #f0f0f0;
|
27
|
+
--bg-dark: #333;
|
28
|
+
--text-dark: #fff;
|
29
|
+
--hover-bg-dark: #555;
|
30
|
+
--hover-text-dark: #fff;
|
31
|
+
--expanded-bg-dark: #444;
|
32
|
+
--sidebar-bg-dark: #333;
|
33
|
+
--sidebar-text-dark: #fff;
|
34
|
+
--sidebar-hover-bg-dark: #555;
|
35
|
+
--sidebar-hover-text-dark: #fff;
|
36
|
+
--sidebar-expanded-bg-dark: #444;
|
37
|
+
--border-color: blue;
|
38
|
+
--highlight-color: #007bff;
|
39
|
+
--bg-logo: url('/src/assets/logo/preauditai-high-resolution-logo-black-transparent.png')
|
40
|
+
}
|
41
|
+
|
42
|
+
|
@@ -0,0 +1,86 @@
|
|
1
|
+
.mainContainer{
|
2
|
+
display: flex;
|
3
|
+
flex-direction: column;
|
4
|
+
align-items: flex-start;
|
5
|
+
}
|
6
|
+
.contentContainer{
|
7
|
+
width: 100%;
|
8
|
+
display: flex;
|
9
|
+
justify-content: space-between;
|
10
|
+
text-align: start;
|
11
|
+
flex-wrap: wrap;
|
12
|
+
}
|
13
|
+
.fileUploadSection{
|
14
|
+
width: 50%;
|
15
|
+
}
|
16
|
+
.fileInfoSection{
|
17
|
+
display: flex;
|
18
|
+
width: 40%;
|
19
|
+
}
|
20
|
+
.fileUploaderContainer{
|
21
|
+
border: 3px dotted #929292;
|
22
|
+
border-radius: 10px;
|
23
|
+
padding: 30px;
|
24
|
+
display: flex;
|
25
|
+
align-items: center;
|
26
|
+
justify-content: center;
|
27
|
+
flex-direction: column;
|
28
|
+
width: 100%;
|
29
|
+
cursor: pointer;
|
30
|
+
}
|
31
|
+
.fileUploader{
|
32
|
+
width: 100%;
|
33
|
+
text-align: start;
|
34
|
+
}
|
35
|
+
|
36
|
+
|
37
|
+
/* Media query for screens smaller than 600px */
|
38
|
+
@media screen and (max-width: 600px) {
|
39
|
+
.fileUploaderContainer{
|
40
|
+
background-color: #f2f2f2;
|
41
|
+
padding: 30px;
|
42
|
+
display: flex;
|
43
|
+
align-items: center;
|
44
|
+
width: 100%;
|
45
|
+
}
|
46
|
+
.btn{
|
47
|
+
width: 100% !important;
|
48
|
+
margin-top: 30px;
|
49
|
+
}
|
50
|
+
.fileUploadSection{
|
51
|
+
width: 100%;
|
52
|
+
margin-bottom: 30px;
|
53
|
+
}
|
54
|
+
.fileInfoSection{
|
55
|
+
display: flex;
|
56
|
+
width: 100%;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
/* Media query for screens between 600px and 900px */
|
61
|
+
@media screen and (min-width: 600px) and (max-width: 900px) {
|
62
|
+
.fileUploaderContainer{
|
63
|
+
background-color: #f2f2f2;
|
64
|
+
padding: 30px;
|
65
|
+
display: flex;
|
66
|
+
align-items: center;
|
67
|
+
width: 100%;
|
68
|
+
}
|
69
|
+
.btn{
|
70
|
+
width: 100% !important;
|
71
|
+
margin-top: 30px;
|
72
|
+
}
|
73
|
+
.fileUploadSection{
|
74
|
+
width: 100%;
|
75
|
+
margin-bottom: 30px;
|
76
|
+
}
|
77
|
+
.fileInfoSection{
|
78
|
+
display: flex;
|
79
|
+
width: 100%;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
/* Media query for screens larger than 1200px */
|
84
|
+
@media screen and (min-width: 1200px) {
|
85
|
+
|
86
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import { type MenuTheme } from 'antd/es/menu'
|
2
|
+
import type { appStateEnums } from 'config'
|
3
|
+
|
4
|
+
interface AppStates {
|
5
|
+
hideImportantMessages?: boolean
|
6
|
+
collapsed?: boolean
|
7
|
+
chatIsOpen: boolean
|
8
|
+
sessionId: string
|
9
|
+
}
|
10
|
+
|
11
|
+
interface AppContextProps {
|
12
|
+
state: AppStates
|
13
|
+
dispatch: React.Dispatch<any>
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
interface AppAction {
|
18
|
+
type: appStateEnums
|
19
|
+
theme: MenuTheme
|
20
|
+
hideImportantMessages: boolean
|
21
|
+
collapsed: boolean
|
22
|
+
chatIsOpen: boolean
|
23
|
+
}
|
24
|
+
|
25
|
+
type NotificationType = 'info' | 'warning' | 'success' | 'error'
|
26
|
+
interface NOTIFICATION_DT {
|
27
|
+
id: number
|
28
|
+
message: string
|
29
|
+
timestamp: number
|
30
|
+
type: NotificationType
|
31
|
+
}
|
32
|
+
|
33
|
+
interface Plan {
|
34
|
+
name: string
|
35
|
+
price: string
|
36
|
+
accounts: number | string
|
37
|
+
complianceFrameworks: number | string
|
38
|
+
features: string[]
|
39
|
+
}
|
40
|
+
|
41
|
+
interface SUBSCRIPTION {
|
42
|
+
tier: 'free' | 'basic' | 'advanced' | 'premium' | null
|
43
|
+
status: 'active' | 'inactive' | null
|
44
|
+
created: number | null
|
45
|
+
next_billing_date?: number | null
|
46
|
+
}
|
47
|
+
|
48
|
+
interface AppconfigType {
|
49
|
+
appTitle: string;
|
50
|
+
file_name: string | undefined;
|
51
|
+
windowColor: string;
|
52
|
+
}
|
53
|
+
interface docInfoType {
|
54
|
+
name: string;
|
55
|
+
size: number;
|
56
|
+
type: string;
|
57
|
+
}
|
58
|
+
|
59
|
+
export type {
|
60
|
+
AppStates,
|
61
|
+
AppAction,
|
62
|
+
AppContextProps,
|
63
|
+
NOTIFICATION_DT,
|
64
|
+
NotificationType,
|
65
|
+
Plan,
|
66
|
+
SUBSCRIPTION,
|
67
|
+
AppconfigType,
|
68
|
+
docInfoType,
|
69
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid'
|
2
|
+
|
3
|
+
const SESSION_KEY: string = 'bibotUserSessionId'
|
4
|
+
|
5
|
+
const getSessionId = (): string => {
|
6
|
+
const sessionId = localStorage.getItem(SESSION_KEY)
|
7
|
+
if (sessionId === null) {
|
8
|
+
const newSessionId = uuidv4()
|
9
|
+
localStorage.setItem(SESSION_KEY, newSessionId)
|
10
|
+
return newSessionId
|
11
|
+
}
|
12
|
+
return sessionId
|
13
|
+
}
|
14
|
+
|
15
|
+
export { getSessionId }
|
@@ -0,0 +1,11 @@
|
|
1
|
+
const trimWhitespace = (e: any) => {
|
2
|
+
// Check if the event has a target (it's an input event)
|
3
|
+
if (e?.target) {
|
4
|
+
// If it's a string, trim the whitespace; otherwise, return the value as is
|
5
|
+
return typeof e.target.value === 'string' ? e.target.value.trim() : e.target.value
|
6
|
+
}
|
7
|
+
// If it's not an input event, return the value as is
|
8
|
+
return e
|
9
|
+
}
|
10
|
+
|
11
|
+
export { trimWhitespace }
|
package/tsconfig.json
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
"outDir": "./dist",
|
4
|
+
"module": "esnext",
|
5
|
+
"target": "es5",
|
6
|
+
"lib": ["dom", "dom.iterable", "esnext"],
|
7
|
+
"jsx": "react-jsx",
|
8
|
+
"moduleResolution": "node",
|
9
|
+
"declaration": true,
|
10
|
+
"sourceMap": true,
|
11
|
+
"skipLibCheck": true,
|
12
|
+
"esModuleInterop": true,
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
14
|
+
"strict": true,
|
15
|
+
"noImplicitAny": true,
|
16
|
+
"noImplicitThis": true,
|
17
|
+
"strictNullChecks": true,
|
18
|
+
"baseUrl": "src",
|
19
|
+
"paths": {
|
20
|
+
"@/*": ["./src/*"]
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"include": ["src/**/*", "tailwind.config.ts", "uuid.d.ts"],
|
24
|
+
"exclude": ["node_modules", "dist", "example"]
|
25
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module: {
|
2
|
+
rules: [
|
3
|
+
{
|
4
|
+
test: /\.(ts|tsx)$/,
|
5
|
+
exclude: /node_modules/,
|
6
|
+
use: {
|
7
|
+
loader: 'babel-loader',
|
8
|
+
options: {
|
9
|
+
presets: [
|
10
|
+
'@babel/preset-env',
|
11
|
+
'@babel/preset-react',
|
12
|
+
'@babel/preset-typescript'
|
13
|
+
]
|
14
|
+
}
|
15
|
+
}
|
16
|
+
}
|
17
|
+
]
|
18
|
+
}
|
19
|
+
|