diff --git a/widget/.npmignore b/widget/.npmignore new file mode 100644 index 00000000..46ce5535 --- /dev/null +++ b/widget/.npmignore @@ -0,0 +1,17 @@ +src +node_modules +build +public +tests +Dockerfile +.dockerignore +.eslintrc.json +index.html +package.json +tsconfig.app.json +tsconfig.json +tsconfig.node.json +vite.config.ts +dist/index.html +dist/shadow.html +vite.svg diff --git a/widget/README.md b/widget/README.md index bb512674..64f272ba 100644 --- a/widget/README.md +++ b/widget/README.md @@ -1,6 +1,8 @@ # Hexabot Live Chat Widget The [Hexabot](https://hexabot.ai/) Live Chat Widget is a React-based embeddable widget that allows users to integrate real-time chat functionality into their websites. It connects to the Hexabot API and facilitates seamless interaction between end-users and chatbots across multiple channels. +[Hexabot](https://hexabot.ai/) is an open-source chatbot / agent solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. If you would like to learn more, please visit the [official github repo](https://github.com/Hexastack/Hexabot/). + ## Key Features - **Real-Time Chat:** Engage in real-time conversations with users directly through your website. - **Customizable:** Easily customize the widget's appearance and behavior to fit your brand and website. @@ -68,6 +70,40 @@ Once the widget is built, you can easily embed it into any webpage. Here's an ex ``` Replace the values in apiUrl and token with your configuration details. +To prevent the website css from conflicting with the chat widget css, we can leverage the shadow dom: +```js + + + + +
+ +``` + ## Customization You can customize the look and feel of the chat widget by modifying the widget’s scss styles or behavior. The widget allows you to: diff --git a/widget/package.json b/widget/package.json index 85a07b2e..4d7a3b03 100644 --- a/widget/package.json +++ b/widget/package.json @@ -1,11 +1,12 @@ { - "name": "hexabot-widget", - "private": true, - "version": "2.0.0", + "name": "hexabot-live-chat-widget", + "version": "2.0.0-rc.2", "description": "Hexabot is a solution for creating and managing chatbots across multiple channels, leveraging AI for advanced conversational capabilities. It provides a user-friendly interface for building, training, and deploying chatbots with integrated support for various messaging platforms.", "author": "Hexastack", "license": "AGPL-3.0-only", "type": "module", + "main": "dist/hexabot-widget.umd.js", + "style": "dist/style.css", "scripts": { "dev": "vite", "build": "tsc && vite build", @@ -38,5 +39,9 @@ "typescript": "^5.2.2", "vite": "^5.3.4", "vite-plugin-dts": "^4.0.2" + }, + "optionalDependencies": { + "@rollup/rollup-darwin-arm64": "^4.24.0", + "@esbuild/darwin-arm64": "^0.24.0" } } diff --git a/widget/public/index.html b/widget/public/index.html index 6904e828..08131b04 100644 --- a/widget/public/index.html +++ b/widget/public/index.html @@ -18,15 +18,26 @@ diff --git a/widget/src/components/UserInput.scss b/widget/src/components/UserInput.scss index 5ea10e54..60152fd7 100644 --- a/widget/src/components/UserInput.scss +++ b/widget/src/components/UserInput.scss @@ -8,7 +8,7 @@ border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; transition: background-color 0.2s ease, box-shadow 0.2s ease; - border-top: 1px solid #eaeaea; + border: 1px solid #eaeaea; } .sc-user-input--text { diff --git a/widget/src/components/UserInput.tsx b/widget/src/components/UserInput.tsx index ba9f4625..12f4055c 100644 --- a/widget/src/components/UserInput.tsx +++ b/widget/src/components/UserInput.tsx @@ -137,10 +137,7 @@ const UserInput: React.FC = () => { const uploading = outgoingMessageState === OutgoingMessageState.uploading; return ( -