@inploi/plugin-chatbot 1.0.3 → 1.0.5
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/.eslintrc.cjs +1 -1
- package/CHANGELOG.md +17 -0
- package/package.json +6 -5
- package/src/chatbot.ts +4 -5
- package/src/index.dev.ts +0 -2
- package/src/mocks/handlers.ts +1 -1
package/.eslintrc.cjs
CHANGED
|
@@ -6,5 +6,5 @@ module.exports = {
|
|
|
6
6
|
extends: ['custom', 'plugin:react-hooks/recommended'],
|
|
7
7
|
plugins: ['react-hooks'],
|
|
8
8
|
env: { browser: true, es2020: true },
|
|
9
|
-
parserOptions: { project: ['./
|
|
9
|
+
parserOptions: { project: ['./tsconfig.json'], tsconfigRootDir: __dirname },
|
|
10
10
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @inploi/plugin-chatbot
|
|
2
2
|
|
|
3
|
+
## 1.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Implement map of node types
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @inploi/core@1.5.3
|
|
10
|
+
- @inploi/sdk@1.4.4
|
|
11
|
+
|
|
12
|
+
## 1.0.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @inploi/core@1.5.2
|
|
18
|
+
- @inploi/sdk@1.4.3
|
|
19
|
+
|
|
3
20
|
## 1.0.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inploi/plugin-chatbot",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hookform/resolvers": "^3.3.2",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"vaul": "^0.7.8",
|
|
20
20
|
"zod": "^3.22.0",
|
|
21
21
|
"zustand": "^4.4.4",
|
|
22
|
-
"@inploi/core": "1.5.
|
|
22
|
+
"@inploi/core": "1.5.3"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@inploi/sdk": "*"
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"rollup-plugin-visualizer": "^5.9.2",
|
|
40
40
|
"tailwindcss": "^3.3.5",
|
|
41
41
|
"ts-toolbelt": "^9.6.0",
|
|
42
|
-
"typescript": "^5.
|
|
42
|
+
"typescript": "^5.3.2",
|
|
43
43
|
"vite": "^4.4.5",
|
|
44
44
|
"vite-tsconfig-paths": "^4.2.1",
|
|
45
|
-
"
|
|
45
|
+
"tsconfig": "0.1.0",
|
|
46
46
|
"eslint-config-custom": "0.1.0",
|
|
47
|
-
"
|
|
47
|
+
"@inploi/sdk": "1.4.4"
|
|
48
48
|
},
|
|
49
49
|
"msw": {
|
|
50
50
|
"workerDirectory": "public"
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"dev": "vite",
|
|
54
54
|
"build": "tsc && vite build",
|
|
55
55
|
"setup-local": "cp -n .env.example .env || true",
|
|
56
|
+
"check": "eslint src --fix --max-warnings 0 && tsc",
|
|
56
57
|
"preview": "vite preview"
|
|
57
58
|
}
|
|
58
59
|
}
|
package/src/chatbot.ts
CHANGED
|
@@ -8,7 +8,6 @@ import { useChatbotStore, useLocalState } from './chatbot.state';
|
|
|
8
8
|
|
|
9
9
|
export const chatbotPlugin = ({
|
|
10
10
|
_internal_domManager: dom = createChatbotDomManager(),
|
|
11
|
-
geolocationApiKey,
|
|
12
11
|
}: {
|
|
13
12
|
geolocationApiKey?: string;
|
|
14
13
|
_internal_domManager?: ChatbotDomManager;
|
|
@@ -22,10 +21,10 @@ export const chatbotPlugin = ({
|
|
|
22
21
|
prepare: async () => {
|
|
23
22
|
try {
|
|
24
23
|
await import('~/ui/chatbot');
|
|
25
|
-
logger
|
|
24
|
+
logger.info('Chatbot plugin prepared');
|
|
26
25
|
} catch (error) {
|
|
27
26
|
console.error(error);
|
|
28
|
-
logger
|
|
27
|
+
logger.error('Error preparing chatbot plugin', error);
|
|
29
28
|
}
|
|
30
29
|
},
|
|
31
30
|
startApplication: async ({ jobId }: { jobId: string }) => {
|
|
@@ -47,13 +46,13 @@ export const chatbotPlugin = ({
|
|
|
47
46
|
const Chatbot = chatbotPromise.value;
|
|
48
47
|
const application = dataPromise.value;
|
|
49
48
|
startApplication(application);
|
|
50
|
-
logger
|
|
49
|
+
logger.info(`Starting application for job "${application.job.id}" using flow "${application.flow.id}"`);
|
|
51
50
|
chatbotElement.innerHTML = '';
|
|
52
51
|
|
|
53
52
|
render(h(Chatbot, { apiClient, logger }), chatbotElement);
|
|
54
53
|
} catch (error) {
|
|
55
54
|
console.error(error);
|
|
56
|
-
logger
|
|
55
|
+
logger.error('Error starting application', error);
|
|
57
56
|
}
|
|
58
57
|
},
|
|
59
58
|
closeApplication: async () => {
|
package/src/index.dev.ts
CHANGED
package/src/mocks/handlers.ts
CHANGED
|
@@ -22,7 +22,7 @@ export const handlers = [
|
|
|
22
22
|
};
|
|
23
23
|
return new Response(JSON.stringify(mockApplication));
|
|
24
24
|
}),
|
|
25
|
-
http.post(`${import.meta.env.VITE_BASE_URL}/flow/job/:jobId`,
|
|
25
|
+
http.post(`${import.meta.env.VITE_BASE_URL}/flow/job/:jobId`, () => {
|
|
26
26
|
return new Response(JSON.stringify({ message: 'Success' }));
|
|
27
27
|
}),
|
|
28
28
|
];
|