hitech-chatbot-react 1.0.0
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 +38 -0
- package/dist/index.css +1 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# hitech-chat-react
|
|
2
|
+
|
|
3
|
+
A ready-to-use React component for [n8n chat](https://github.com/n8n-io/n8n).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @hitech/chatbot
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Note: This package requires `react` and `react-dom` as peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Chatbot } from '@hitech/chatbot';
|
|
17
|
+
import '@hitech/chatbot/dist/index.css';
|
|
18
|
+
|
|
19
|
+
function App() {
|
|
20
|
+
return (
|
|
21
|
+
<div className="App">
|
|
22
|
+
<ChatN8N
|
|
23
|
+
webhookUrl="https://your-n8n-instance.com/webhook/..."
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
|
|
32
|
+
- Pre-configured with HiTech AI settings.
|
|
33
|
+
- Automatic session loading.
|
|
34
|
+
- Custom welcome messages and i18n support.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
MIT
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--chat--color--primary: #e74266;--chat--color--primary-shade-50: #db4061;--chat--color--primary--shade-100: #cf3c5c;--chat--color--secondary: #20b69e;--chat--color-secondary-shade-50: #1ca08a;--chat--color-white: #ffffff;--chat--color-light: #f2f4f8;--chat--color-light-shade-50: #e6e9f1;--chat--color-light-shade-100: #c2c5cc;--chat--color-medium: #d2d4d9;--chat--color-dark: #101330;--chat--color-disabled: #777980;--chat--color-typing: #404040;--chat--input--text-color: #404040;--chat--spacing: 1rem;--chat--border-radius: .25rem;--chat--transition-duration: .15s;--chat--window--width: 400px;--chat--window--height: 600px;--chat--header-height: auto;--chat--header--padding: var(--chat--spacing);--chat--header--background: var(--chat--color-dark);--chat--header--border-top: none;--chat--header--border-bottom: none;--chat--heading--font-size: 2em;--chat--header--color: var(--chat--color-light);--chat--subtitle--font-size: inherit;--chat--subtitle--line-height: 1.8;--chat--textarea--height: 50px;--chat--message--font-size: 1rem;--chat--message--padding: var(--chat--spacing);--chat--message--border-radius: var(--chat--border-radius);--chat--message-line-height: 1.8;--chat--message--bot--background: var(--chat--color-white);--chat--message--bot--color: var(--chat--color-dark);--chat--message--bot--border: none;--chat--message--user--background: var(--chat--color--secondary);--chat--message--user--color: var(--chat--color-white);--chat--message--user--border: none;--chat--message--pre--background: rgba(0, 0, 0, .05);--chat--toggle--background: var(--chat--color--primary);--chat--toggle--hover--background: var(--chat--color--primary-shade-50);--chat--toggle--active--background: var(--chat--color--primary--shade-100);--chat--toggle--color: var(--chat--color-white);--chat--toggle--size: 64px}
|
package/dist/index.d.mts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var g=(a,t)=>{for(var e in t)r(a,e,{get:t[e],enumerable:!0})},b=(a,t,e,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of l(t))!n.call(a,o)&&o!==e&&r(a,o,{get:()=>t[o],enumerable:!(c=d(t,o))||c.enumerable});return a};var m=a=>b(r({},"__esModule",{value:!0}),a);var p={};g(p,{Chatbot:()=>u});module.exports=m(p);var h=require("react"),w=require("@n8n/chat/style.css");var i=require("@n8n/chat"),s=require("react/jsx-runtime"),u=({webhookUrl:a})=>((0,h.useEffect)(()=>{(0,i.createChat)({webhookUrl:a,target:"#chatbot",mode:"window",loadPreviousSession:!0,metadata:{},showWelcomeScreen:!1,defaultLanguage:"en",initialMessages:["It's HiTech AI! \u{1F44B}","I can help you with all your questions and tasks about ArcGIS Pro. What can I do for you?"],i18n:{en:{title:"Hi there! \u{1F44B}",subtitle:"Start a chat. We're here to help you 24/7.",footer:"",getStarted:"New Conversation",inputPlaceholder:"Type your question..",closeButtonTooltip:"Close"}}})},[a]),(0,s.jsx)("div",{id:"chatbot"}));0&&(module.exports={Chatbot});
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useEffect as t}from"react";import"@n8n/chat/style.css";import{createChat as o}from"@n8n/chat";import{jsx as e}from"react/jsx-runtime";var l=({webhookUrl:a})=>(t(()=>{o({webhookUrl:a,target:"#chatbot",mode:"window",loadPreviousSession:!0,metadata:{},showWelcomeScreen:!1,defaultLanguage:"en",initialMessages:["It's HiTech AI! \u{1F44B}","I can help you with all your questions and tasks about ArcGIS Pro. What can I do for you?"],i18n:{en:{title:"Hi there! \u{1F44B}",subtitle:"Start a chat. We're here to help you 24/7.",footer:"",getStarted:"New Conversation",inputPlaceholder:"Type your question..",closeButtonTooltip:"Close"}}})},[a]),e("div",{id:"chatbot"}));export{l as Chatbot};
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hitech-chatbot-react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Ready-to-use React component for chat",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --minify --clean",
|
|
13
|
+
"dev": "tsup src/index.ts --format cjs,esm --watch --dts",
|
|
14
|
+
"lint": "tsc"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"chat",
|
|
18
|
+
"react",
|
|
19
|
+
"component"
|
|
20
|
+
],
|
|
21
|
+
"author": "",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=16",
|
|
25
|
+
"react-dom": ">=16"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@n8n/chat": "^1.0.0-rc.3"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/react": "^19.2.7",
|
|
32
|
+
"@types/react-dom": "^19.2.3",
|
|
33
|
+
"tsup": "^8.5.1",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
}
|
|
36
|
+
}
|