-
Notifications
You must be signed in to change notification settings - Fork 2
Fernandorocha/ent 808 adjusting agentops popup chat #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
18a66c0
01f21c5
605be28
0f672e8
3246a9e
1218e6a
e07163a
dd7ed62
1f6d672
61800ef
bad3bf7
60354d6
c233210
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,3 +69,14 @@ apps/svendio-backend/ | |
| apps/svendio-frontend/ | ||
| .turbo | ||
| .idea/dbnavigator.xml | ||
|
|
||
| # temp files | ||
| .temp.css | ||
|
|
||
| # npmrc | ||
| .npmrc | ||
| .npmrc.local | ||
| .npmrc.github | ||
| .npmrc.npm | ||
| npmrc.github | ||
| npmrc.npm | ||
|
Comment on lines
+72
to
+82
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems like you're trying to ignore multiple # temp files
.temp.css
# npmrc
.npmrc
.npmrc.local
.npmrc.github
.npmrc.npm
-81: npmrc.github
-82: npmrc.npm |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,11 +5,52 @@ A customizable chat widget that provides AI-powered chat functionality based on | |
| ## Installation | ||
|
|
||
| ```bash | ||
| npm install | ||
| # Using npm | ||
| npm install @entelligence-ai/chat-widget | ||
|
|
||
| # Using pnpm | ||
| pnpm add @entelligence-ai/chat-widget | ||
| ``` | ||
|
|
||
| ```bash | ||
| pnpm install | ||
| ## Usage | ||
|
|
||
| ### React Component | ||
| ```tsx | ||
| import { EntelligenceChat } from '@entelligence-ai/chat-widget/react'; | ||
| // Import styles separately | ||
| import '@entelligence-ai/chat-widget/style.css'; | ||
|
|
||
| function App() { | ||
| return ( | ||
| <EntelligenceChat | ||
| analyticsData={{ | ||
| apiKey: "your-api-key", | ||
| repoName: "your-repo", | ||
| organization: "your-org", | ||
| companyName: "Your Company", | ||
| theme: "light" | ||
| }} | ||
| /> | ||
| ); | ||
| } | ||
| ``` | ||
|
Comment on lines
+19
to
+36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The interface AnalyticsData {
apiKey: string;
repoName: string;
organization: string;
companyName: string;
theme: string;
}
function App() {
return (
<EntelligenceChat
analyticsData={{
apiKey: "your-api-key",
repoName: "your-repo",
organization: "your-org",
companyName: "Your Company",
theme: "light"
}}
/>
);
} |
||
|
|
||
| ### Vanilla JavaScript | ||
| ```html | ||
| <script type="module"> | ||
| import { EntelligenceChatInit } from '@entelligence-ai/chat-widget'; | ||
| import '@entelligence-ai/chat-widget/style.css'; | ||
|
|
||
| EntelligenceChatInit({ | ||
| analyticsData: { | ||
| apiKey: "your-api-key", | ||
| repoName: "your-repo", | ||
| organization: "your-org", | ||
| companyName: "Your Company", | ||
| theme: "light" | ||
| } | ||
| }); | ||
| </script> | ||
|
Comment on lines
+40
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to the previous comment, the // TypeScript
interface AnalyticsData {
apiKey: string;
repoName: string;
organization: string;
companyName: string;
theme: string;
}
EntelligenceChatInit({
analyticsData: {
apiKey: "your-api-key",
repoName: "your-repo",
organization: "your-org",
companyName: "Your Company",
theme: "light"
}
}); |
||
| ``` | ||
|
|
||
| ## Development | ||
|
|
@@ -82,6 +123,7 @@ The application follows this initialization flow: | |
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <link rel="stylesheet" href="node_modules/@entelligence-ai/chat-widget/style.css"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The path to the CSS file seems to be incorrect. It's unlikely that the - <link rel="stylesheet" href="node_modules/@entelligence-ai/chat-widget/style.css">
+ <link rel="stylesheet" href="/path/to/@entelligence-ai/chat-widget/style.css"> |
||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
|
|
@@ -95,6 +137,7 @@ The application follows this initialization flow: | |
| // src/index.tsx | ||
| import { createRoot } from 'react-dom/client'; | ||
| import { App } from './app'; | ||
| import '@entelligence-ai/chat-widget/style.css'; | ||
|
|
||
| const root = createRoot(document.getElementById('root')!); | ||
| root.render(<App />); | ||
|
|
@@ -124,74 +167,16 @@ export const App = ({ | |
| }; | ||
| ``` | ||
|
|
||
| 4. The build process creates two distinct bundles: | ||
| - A React component library for direct React integration | ||
| - A vanilla JS bundle that can self-initialize | ||
|
|
||
| #### Build Configuration | ||
| The project uses Vite with dual build modes for React and Vanilla JS: | ||
| ### CSS and Styling | ||
| The package includes two CSS bundles: | ||
| - `@entelligence-ai/chat-widget/style.css` - Main styles for the widget | ||
| - `@entelligence-ai/chat-widget/styles.css` - Additional styles (if needed) | ||
|
|
||
| You must import at least the main style.css for the widget to work properly: | ||
| ```typescript | ||
| // vite.config.ts | ||
| export default defineConfig(({ mode }) => ({ | ||
| build: { | ||
| lib: { | ||
| entry: mode === 'react' | ||
| ? 'src/react/index.ts' | ||
| : 'src/main-vanilla.tsx', | ||
| formats: ['es', 'umd'] | ||
| }, | ||
| rollupOptions: { | ||
| manualChunks: { | ||
| 'react-vendor': ['react', 'react-dom'], | ||
| 'ui-vendor': ['@assistant-ui/react'], | ||
| 'markdown': ['@assistant-ui/react-markdown'], | ||
| 'syntax': ['@assistant-ui/react-syntax-highlighter'] | ||
| } | ||
| } | ||
| } | ||
| })) | ||
| import '@entelligence-ai/chat-widget/style.css'; | ||
| ``` | ||
|
Comment on lines
+170
to
178
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a typo in the CSS file name. You've mentioned - - `@entelligence-ai/chat-widget/styles.css` - Additional styles (if needed)
+ - `@entelligence-ai/chat-widget/additional-style.css` - Additional styles (if needed) |
||
|
|
||
| #### HTML Integration | ||
| ```html | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <script type="module"> | ||
| import { EntelligenceChat } from './src/main.tsx' | ||
|
|
||
| const container = document.getElementById('chat-widget') | ||
| EntelligenceChat.init({ | ||
| analyticsData: { | ||
| repoName: import.meta.env.VITE_REPO_NAME, | ||
| organization: import.meta.env.VITE_ORGANIZATION, | ||
| apiKey: import.meta.env.VITE_API_KEY, | ||
| companyName: import.meta.env.VITE_COMPANY_NAME | ||
| } | ||
| }, container) | ||
| </script> | ||
| </head> | ||
| <body> | ||
| <div id="chat-widget"></div> | ||
| </body> | ||
| </html> | ||
| ``` | ||
|
|
||
| #### Build Process | ||
| 1. Vite builds two versions: | ||
| - React component library (`/react`) | ||
| - Vanilla JS bundle | ||
| 2. Code is optimized through: | ||
| - Tree shaking | ||
| - Code splitting | ||
| - Chunk optimization | ||
| - CSS code splitting | ||
| 3. Output includes: | ||
| - ES modules | ||
| - UMD bundles | ||
| - TypeScript declarations | ||
|
|
||
| ### Environment Variables | ||
| Create a `.env` file in the root directory with: | ||
| ```env | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.