bibot 1.0.6 → 1.0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. package/README.md +20 -36
  2. package/dist/component/bibot.d.ts +6 -5
  3. package/dist/config/appStateEnums.d.ts +3 -3
  4. package/dist/config/endpointEnums.d.ts +18 -18
  5. package/dist/config/index.d.ts +3 -3
  6. package/dist/config/statusCode.d.ts +42 -42
  7. package/dist/context/AppContext.d.ts +9 -8
  8. package/dist/context/index.d.ts +1 -1
  9. package/dist/hooks/index.d.ts +3 -3
  10. package/dist/hooks/mobileView.d.ts +1 -1
  11. package/dist/hooks/useBiBotChatBot.d.ts +29 -29
  12. package/dist/hooks/usePluginFactory.d.ts +1 -1
  13. package/dist/index.css +139 -35
  14. package/dist/index.d.ts +6 -2
  15. package/dist/index.js +649 -9
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.modern.js +646 -0
  18. package/dist/index.modern.js.map +1 -0
  19. package/dist/index.test.d.ts +1 -0
  20. package/dist/reducers/appReducer.d.ts +2 -2
  21. package/dist/reducers/index.d.ts +1 -1
  22. package/dist/services/index.d.ts +1 -1
  23. package/dist/services/plugin-api.d.ts +23 -26
  24. package/dist/types/coreInterfaces.d.ts +51 -51
  25. package/dist/types/index.d.ts +1 -1
  26. package/dist/utils/index.d.ts +2 -2
  27. package/dist/utils/sessionManager.d.ts +2 -2
  28. package/dist/utils/trimWhitespace.d.ts +2 -2
  29. package/package.json +60 -34
  30. package/.babelrc +0 -7
  31. package/.vscode/settings.json +0 -5
  32. package/dist/bibot.d.ts +0 -5
  33. package/dist/bibot.js +0 -175
  34. package/dist/bibot.js.map +0 -1
  35. package/dist/component/bibot.js +0 -170
  36. package/dist/component/bibot.js.map +0 -1
  37. package/dist/config/appStateEnums.js +0 -10
  38. package/dist/config/appStateEnums.js.map +0 -1
  39. package/dist/config/endpointEnums.js +0 -31
  40. package/dist/config/endpointEnums.js.map +0 -1
  41. package/dist/config/index.js +0 -38
  42. package/dist/config/index.js.map +0 -1
  43. package/dist/config/statusCode.js +0 -49
  44. package/dist/config/statusCode.js.map +0 -1
  45. package/dist/context/AppContext.js +0 -75
  46. package/dist/context/AppContext.js.map +0 -1
  47. package/dist/context/index.js +0 -16
  48. package/dist/context/index.js.map +0 -1
  49. package/dist/hooks/index.js +0 -38
  50. package/dist/hooks/index.js.map +0 -1
  51. package/dist/hooks/mobileView.js +0 -33
  52. package/dist/hooks/mobileView.js.map +0 -1
  53. package/dist/hooks/useBiBotChatBot.js +0 -206
  54. package/dist/hooks/useBiBotChatBot.js.map +0 -1
  55. package/dist/hooks/usePluginFactory.js +0 -62
  56. package/dist/hooks/usePluginFactory.js.map +0 -1
  57. package/dist/reducers/appReducer.js +0 -24
  58. package/dist/reducers/appReducer.js.map +0 -1
  59. package/dist/reducers/index.js +0 -16
  60. package/dist/reducers/index.js.map +0 -1
  61. package/dist/services/index.js +0 -16
  62. package/dist/services/index.js.map +0 -1
  63. package/dist/services/plugin-api.js +0 -185
  64. package/dist/services/plugin-api.js.map +0 -1
  65. package/dist/styles/RegisterPageStyle.css +0 -63
  66. package/dist/styles/adminPortal.css +0 -26
  67. package/dist/styles/appConfig.css +0 -90
  68. package/dist/styles/buttonStyle.css +0 -27
  69. package/dist/styles/chatStyle.css +0 -140
  70. package/dist/styles/index.css +0 -82
  71. package/dist/styles/predefinedStyle.css +0 -35
  72. package/dist/styles/themeStyle.css +0 -42
  73. package/dist/styles/training.css +0 -86
  74. package/dist/types/coreInterfaces.js +0 -5
  75. package/dist/types/coreInterfaces.js.map +0 -1
  76. package/dist/types/index.js +0 -16
  77. package/dist/types/index.js.map +0 -1
  78. package/dist/utils/index.js +0 -27
  79. package/dist/utils/index.js.map +0 -1
  80. package/dist/utils/sessionManager.js +0 -17
  81. package/dist/utils/sessionManager.js.map +0 -1
  82. package/dist/utils/trimWhitespace.js +0 -15
  83. package/dist/utils/trimWhitespace.js.map +0 -1
  84. package/src/component/bibot.tsx +0 -103
  85. package/src/config/appStateEnums.ts +0 -3
  86. package/src/config/endpointEnums.ts +0 -28
  87. package/src/config/index.ts +0 -5
  88. package/src/config/statusCode.ts +0 -49
  89. package/src/context/AppContext.tsx +0 -66
  90. package/src/context/index.ts +0 -3
  91. package/src/hooks/index.ts +0 -5
  92. package/src/hooks/mobileView.tsx +0 -17
  93. package/src/hooks/useBiBotChatBot.tsx +0 -107
  94. package/src/hooks/usePluginFactory.tsx +0 -38
  95. package/src/index.css +0 -36
  96. package/src/index.tsx +0 -3
  97. package/src/reducers/appReducer.ts +0 -16
  98. package/src/reducers/index.ts +0 -4
  99. package/src/services/index.ts +0 -2
  100. package/src/services/plugin-api.tsx +0 -120
  101. package/src/styles/RegisterPageStyle.css +0 -63
  102. package/src/styles/adminPortal.css +0 -26
  103. package/src/styles/appConfig.css +0 -90
  104. package/src/styles/buttonStyle.css +0 -27
  105. package/src/styles/chatStyle.css +0 -140
  106. package/src/styles/index.css +0 -82
  107. package/src/styles/predefinedStyle.css +0 -35
  108. package/src/styles/themeStyle.css +0 -42
  109. package/src/styles/training.css +0 -86
  110. package/src/types/coreInterfaces.ts +0 -69
  111. package/src/types/index.ts +0 -4
  112. package/src/utils/index.ts +0 -2
  113. package/src/utils/sessionManager.tsx +0 -15
  114. package/src/utils/trimWhitespace.ts +0 -11
  115. package/tsconfig.json +0 -25
  116. package/webpack.config.js +0 -19
package/README.md CHANGED
@@ -1,46 +1,30 @@
1
- # Getting Started with Create React App
1
+ # bibot
2
2
 
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
3
+ > Made with create-react-library
4
4
 
5
- ## Available Scripts
5
+ [![NPM](https://img.shields.io/npm/v/bibot.svg)](https://www.npmjs.com/package/bibot) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
6
6
 
7
- In the project directory, you can run:
7
+ ## Install
8
8
 
9
- ### `npm start`
9
+ ```bash
10
+ npm install --save bibot
11
+ ```
10
12
 
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
13
+ ## Usage
13
14
 
14
- The page will reload if you make edits.\
15
- You will also see any lint errors in the console.
15
+ ```tsx
16
+ import React, { Component } from 'react'
16
17
 
17
- ### `npm test`
18
+ import MyComponent from 'bibot'
19
+ import 'bibot/dist/index.css'
18
20
 
19
- Launches the test runner in the interactive watch mode.\
20
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
+ class Example extends Component {
22
+ render() {
23
+ return <MyComponent />
24
+ }
25
+ }
26
+ ```
21
27
 
22
- ### `npm run build`
28
+ ## License
23
29
 
24
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
29
-
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
- ### `npm run eject`
33
-
34
- **Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35
-
36
- If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39
-
40
- You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41
-
42
- ## Learn More
43
-
44
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
- To learn React, check out the [React documentation](https://reactjs.org/).
30
+ ISC © [chrisdjin](https://github.com/chrisdjin)
@@ -1,5 +1,6 @@
1
- interface bubbleProps {
2
- clientId: string;
3
- }
4
- declare const BiBot: ({ clientId }: bubbleProps) => import("react/jsx-runtime").JSX.Element;
5
- export default BiBot;
1
+ import * as React from 'react';
2
+ interface bubbleProps {
3
+ clientId: string;
4
+ }
5
+ declare const ChatBubbleBiBot: ({ clientId }: bubbleProps) => React.JSX.Element;
6
+ export default ChatBubbleBiBot;
@@ -1,3 +1,3 @@
1
- export declare enum appStateEnums {
2
- BIBOT = "BIBOT"
3
- }
1
+ export declare enum appStateEnums {
2
+ BIBOT = "BIBOT"
3
+ }
@@ -1,18 +1,18 @@
1
- export declare const APP_DATA: {
2
- APP_NAME: string;
3
- };
4
- export declare const endpoints: {
5
- readonly inference: string;
6
- };
7
- export declare enum domain {
8
- app = "/app",
9
- bibot = "/bibot",
10
- inference = "/inference"
11
- }
12
- export declare enum resources {
13
- chatBubble = "/chat-bubble-config",
14
- predefinedQ = "/predefined-q",
15
- localQ = "/local-q",
16
- timedOutLocalQ = "/t-local-q",
17
- q = "/q"
18
- }
1
+ export declare const APP_DATA: {
2
+ APP_NAME: string;
3
+ };
4
+ export declare const endpoints: {
5
+ readonly inference: string;
6
+ };
7
+ export declare enum domain {
8
+ app = "/app",
9
+ bibot = "/bibot",
10
+ inference = "/inference"
11
+ }
12
+ export declare enum resources {
13
+ chatBubble = "/chat-bubble-config",
14
+ predefinedQ = "/predefined-q",
15
+ localQ = "/local-q",
16
+ timedOutLocalQ = "/t-local-q",
17
+ q = "/q"
18
+ }
@@ -1,3 +1,3 @@
1
- export * from './appStateEnums';
2
- export * from './endpointEnums';
3
- export * from './statusCode';
1
+ export * from './appStateEnums';
2
+ export * from './endpointEnums';
3
+ export * from './statusCode';
@@ -1,42 +1,42 @@
1
- export declare enum statusCode {
2
- ok = 200,
3
- created = 201,
4
- accepted = 202,
5
- unmodified = 304,
6
- sucMsg = "success",
7
- badReq = 400,
8
- unauthorized = 401,
9
- paymentReq = 402,
10
- forbidden = 403,
11
- notFound = 404,
12
- methodNotAllowed = 405,
13
- notAcceptable = 406,
14
- pxyAuthReq = 407,
15
- reqTimeOut = 408,
16
- conflict = 409,
17
- gone = 410,
18
- lengthReq = 411,
19
- preConFailed = 412,
20
- payloadTooLarge = 413,
21
- urlTooLong = 414,
22
- unsupportedMediaType = 415,
23
- rangeNotSatisfiable = 416,
24
- expectationFailed = 417,
25
- misdirectedReq = 421,
26
- unprocessableEntity = 422,
27
- locked = 423,
28
- failedDependency = 424,
29
- tooLarge = 425,
30
- upgradeRequired = 426,
31
- preconReq = 428,
32
- tooManyReq = 429,
33
- reqHeaderTooLarge = 431,
34
- unavailableForLegalReasons = 451,
35
- internalServerError = 500,
36
- notImplemented = 501,
37
- badGateway = 502,
38
- svcUnavalable = 503,
39
- gtwayTimeout = 504,
40
- httpVNotSupported = 505,
41
- networkAuthReq = 511
42
- }
1
+ export declare enum statusCode {
2
+ ok = 200,
3
+ created = 201,
4
+ accepted = 202,
5
+ unmodified = 304,
6
+ sucMsg = "success",
7
+ badReq = 400,
8
+ unauthorized = 401,
9
+ paymentReq = 402,
10
+ forbidden = 403,
11
+ notFound = 404,
12
+ methodNotAllowed = 405,
13
+ notAcceptable = 406,
14
+ pxyAuthReq = 407,
15
+ reqTimeOut = 408,
16
+ conflict = 409,
17
+ gone = 410,
18
+ lengthReq = 411,
19
+ preConFailed = 412,
20
+ payloadTooLarge = 413,
21
+ urlTooLong = 414,
22
+ unsupportedMediaType = 415,
23
+ rangeNotSatisfiable = 416,
24
+ expectationFailed = 417,
25
+ misdirectedReq = 421,
26
+ unprocessableEntity = 422,
27
+ locked = 423,
28
+ failedDependency = 424,
29
+ tooLarge = 425,
30
+ upgradeRequired = 426,
31
+ preconReq = 428,
32
+ tooManyReq = 429,
33
+ reqHeaderTooLarge = 431,
34
+ unavailableForLegalReasons = 451,
35
+ internalServerError = 500,
36
+ notImplemented = 501,
37
+ badGateway = 502,
38
+ svcUnavalable = 503,
39
+ gtwayTimeout = 504,
40
+ httpVNotSupported = 505,
41
+ networkAuthReq = 511
42
+ }
@@ -1,8 +1,9 @@
1
- import React, { type ReactNode } from 'react';
2
- import type { AppContextProps } from '../types/coreInterfaces';
3
- interface AppProps {
4
- children: ReactNode;
5
- }
6
- declare const AppContext: React.Context<AppContextProps>;
7
- declare const AppProvider: React.FC<AppProps>;
8
- export { AppContext, AppProvider };
1
+ import React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import type { AppContextProps } from '../types/coreInterfaces';
4
+ interface AppProps {
5
+ children: ReactNode;
6
+ }
7
+ declare const AppContext: React.Context<AppContextProps>;
8
+ declare const AppProvider: React.FC<AppProps>;
9
+ export { AppContext, AppProvider };
@@ -1 +1 @@
1
- export * from './AppContext';
1
+ export * from './AppContext';
@@ -1,3 +1,3 @@
1
- export * from './usePluginFactory';
2
- export * from './useBiBotChatBot';
3
- export * from './mobileView';
1
+ export * from './usePluginFactory';
2
+ export * from './useBiBotChatBot';
3
+ export * from './mobileView';
@@ -1 +1 @@
1
- export default function MobileView(): boolean;
1
+ export default function MobileView(): boolean;
@@ -1,29 +1,29 @@
1
- import React from 'react';
2
- interface UseBiBotChatBotProps {
3
- clientId: string;
4
- }
5
- interface ChatBubbleConfigProps {
6
- bgColor?: string;
7
- color?: string;
8
- title?: string;
9
- logo_url?: string;
10
- }
11
- declare const useBiBotChatBot: ({ clientId }: UseBiBotChatBotProps) => {
12
- chatIsOpen: boolean;
13
- messages: {
14
- sender: 'user' | 'bot';
15
- text: string;
16
- }[];
17
- isLoading: boolean;
18
- messageEndRef: React.RefObject<HTMLDivElement>;
19
- userInput: string;
20
- handleUserInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
21
- handleKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => Promise<void>;
22
- toggleChat: () => void;
23
- sendInputInquiry: () => Promise<void>;
24
- chatBubbleConfig: ChatBubbleConfigProps | undefined;
25
- showPredefinedQuestions: boolean;
26
- predefinedQuestions: string[];
27
- handlePredefinedQuestionSelect: (question: any) => void;
28
- };
29
- export { useBiBotChatBot };
1
+ import React from 'react';
2
+ interface UseBiBotChatBotProps {
3
+ clientId: string;
4
+ }
5
+ interface ChatBubbleConfigProps {
6
+ bgColor?: string;
7
+ color?: string;
8
+ title?: string;
9
+ logo_url?: string;
10
+ }
11
+ declare const useBiBotChatBot: ({ clientId }: UseBiBotChatBotProps) => {
12
+ chatIsOpen: boolean;
13
+ messages: {
14
+ sender: 'user' | 'bot';
15
+ text: string;
16
+ }[];
17
+ isLoading: boolean;
18
+ messageEndRef: React.RefObject<HTMLDivElement>;
19
+ userInput: string;
20
+ handleUserInput: (e: React.ChangeEvent<HTMLInputElement>) => void;
21
+ handleKeyPress: (e: React.KeyboardEvent<HTMLInputElement>) => Promise<void>;
22
+ toggleChat: () => void;
23
+ sendInputInquiry: () => Promise<void>;
24
+ chatBubbleConfig: ChatBubbleConfigProps | undefined;
25
+ showPredefinedQuestions: boolean;
26
+ predefinedQuestions: string[];
27
+ handlePredefinedQuestionSelect: (question: any) => void;
28
+ };
29
+ export { useBiBotChatBot };
@@ -1 +1 @@
1
- export declare const createPluginAxiosInstance: (params?: {}, headers?: {}) => import("axios").AxiosInstance;
1
+ export declare const createPluginAxiosInstance: (params?: {}, headers?: {}) => import("axios").AxiosInstance;
package/dist/index.css CHANGED
@@ -1,36 +1,140 @@
1
- body {
2
- margin: 0;
3
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
4
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
5
- sans-serif;
6
- -webkit-font-smoothing: antialiased;
7
- -moz-osx-font-smoothing: grayscale;
8
- }
9
-
10
-
11
- *{
12
- margin: 0;
13
- padding: 0;
14
- box-sizing: border-box;
15
- }
16
- code {
17
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
18
- monospace;
19
- }
20
-
21
- .upload-component {
22
- .drop-area {
23
- border: 2px dashed #ccc;
24
- border-radius: 5px;
25
- padding: 20px;
26
- text-align: center;
27
- cursor: pointer;
28
- &:hover, &:focus {
29
- border-color: #007bff;
30
- }
31
- }
32
-
33
- .uploading { background-color: #fff3cd; }
34
- .completed { background-color: #d4edda; }
35
- .error { background-color: #f8d7da; }
1
+ ._2jyN5 {
2
+ position: fixed;
3
+ bottom: 20px;
4
+ right: 20px;
5
+ z-index: 9999;
6
+ }
7
+
8
+ ._tXNYe {
9
+ color: #fff;
10
+ border-radius: 50%;
11
+ height: 60px;
12
+ width: 60px;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ }
17
+
18
+ ._1P2y- {
19
+ position: absolute;
20
+ bottom: 50px;
21
+ right: 25px;
22
+ width: 350px;
23
+ height: 500px;
24
+ background-color: white;
25
+ border: 1px solid #ddd;
26
+ border-radius: 10px;
27
+ /* padding: 10px; */
28
+ box-shadow: 0 2px 10px rgba(0,0,0,0.2);
29
+ display: flex;
30
+ flex-direction: column;
31
+ justify-content: space-between;
32
+ }
33
+
34
+ /* Existing styles... */
35
+ ._2UNL5{
36
+ height: 50px;
37
+ border-top-left-radius: 8px;
38
+ border-top-right-radius: 8px;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: flex-start;
42
+ padding-inline: 15px;
43
+ padding-block: 30px;
44
+ }
45
+ ._2v5bZ {
46
+ height: calc(100% - 100px);
47
+ overflow-y: auto;
48
+ padding: 10px;
49
+ display: flex;
50
+ flex-grow: 1;
51
+ flex-direction: column;
52
+ }
53
+
54
+ ._2RbY_ {
55
+ margin-bottom: 10px;
56
+ padding: 5px 10px;
57
+ border-radius: 8px;
58
+ max-width: 70%;
59
+ }
60
+
61
+ ._2RbY_._1efWC {
62
+ background-color: #b8b8b8c6;
63
+ align-self: flex-end;
64
+ }
65
+
66
+ ._2RbY_._2idRy {
67
+ background-color: #f0f0f0;
68
+ align-self: flex-start;
69
+ }
70
+ textarea:focus, input:focus{
71
+ outline: none;
72
+ }
73
+
74
+ /* Chat loader*/
75
+ ._3qqrl {
76
+ width: 12px;
77
+ aspect-ratio: 1;
78
+ border-radius: 50%;
79
+ animation: _3cq86 1s infinite linear alternate;
80
+ }
81
+ @keyframes _3cq86 {
82
+ 0% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #000 }
83
+ 33% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #0002}
84
+ 66% {box-shadow: 20px 0 #0002,-20px 0 #000; background: #0002}
85
+ 100%{box-shadow: 20px 0 #0002,-20px 0 #000; background: #000 }
86
+ }
87
+
88
+
89
+ ._34vFI {
90
+ display: flex;
91
+ align-items: center;
92
+ border-top: 1px solid #ddd;
93
+ padding: 10px;
94
+ border-bottom-left-radius: 8px;
95
+ border-bottom-right-radius: 8px;
96
+ }
97
+
98
+ ._34vFI input {
99
+ flex-grow: 1;
100
+ border: none;
101
+ background-color: transparent;
102
+ /* border: 1px solid #ccc; */
103
+ /* border-radius: 15px; */
104
+ padding: 5px 10px;
105
+ margin-right: 10px;
106
+ }
107
+
108
+ ._34vFI button {
109
+ background-color: #007bff;
110
+ color: white;
111
+ border: none;
112
+ border-radius: 15px;
113
+ padding: 5px 10px;
114
+ cursor: pointer;
115
+ }
116
+
117
+ /* Existing styles... */
118
+
119
+ ._1kl6z {
120
+ display: flex;
121
+ justify-content: center;
122
+ align-items: center;
123
+ }
124
+
125
+ ._3cleF {
126
+ width: 8px;
127
+ height: 8px;
128
+ border-radius: 50%;
129
+ margin: 0 3px;
130
+ animation: _UNzJX 0.6s infinite alternate;
131
+ }
132
+
133
+ @keyframes _UNzJX {
134
+ from {
135
+ transform: translateY(0);
136
+ }
137
+ to {
138
+ transform: translateY(-15px);
139
+ }
36
140
  }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,6 @@
1
- import BiBot from './component/bibot';
2
- export default BiBot;
1
+ import * as React from 'react';
2
+ interface Props {
3
+ clientId: string;
4
+ }
5
+ export declare const BiBot: ({ clientId }: Props) => React.JSX.Element;
6
+ export {};