quikchat 1.1.17 → 1.2.4
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 +167 -276
- package/dist/build-manifest.json +157 -0
- package/dist/quikchat-md-full.cjs.js +2742 -0
- package/dist/quikchat-md-full.cjs.js.map +1 -0
- package/dist/quikchat-md-full.cjs.min.js +10 -0
- package/dist/quikchat-md-full.cjs.min.js.map +1 -0
- package/dist/quikchat-md-full.esm.js +2740 -0
- package/dist/quikchat-md-full.esm.js.map +1 -0
- package/dist/quikchat-md-full.esm.min.js +10 -0
- package/dist/quikchat-md-full.esm.min.js.map +1 -0
- package/dist/quikchat-md-full.umd.js +2748 -0
- package/dist/quikchat-md-full.umd.js.map +1 -0
- package/dist/quikchat-md-full.umd.min.js +10 -0
- package/dist/quikchat-md-full.umd.min.js.map +1 -0
- package/dist/quikchat-md.cjs.js +1641 -0
- package/dist/quikchat-md.cjs.js.map +1 -0
- package/dist/quikchat-md.cjs.min.js +8 -0
- package/dist/quikchat-md.cjs.min.js.map +1 -0
- package/dist/quikchat-md.esm.js +1639 -0
- package/dist/quikchat-md.esm.js.map +1 -0
- package/dist/quikchat-md.esm.min.js +8 -0
- package/dist/quikchat-md.esm.min.js.map +1 -0
- package/dist/quikchat-md.umd.js +1647 -0
- package/dist/quikchat-md.umd.js.map +1 -0
- package/dist/quikchat-md.umd.min.js +8 -0
- package/dist/quikchat-md.umd.min.js.map +1 -0
- package/dist/quikchat.cjs.js +454 -1729
- package/dist/quikchat.cjs.js.map +1 -1
- package/dist/quikchat.cjs.min.js +1 -1
- package/dist/quikchat.cjs.min.js.map +1 -1
- package/dist/quikchat.css +753 -226
- package/dist/quikchat.esm.js +454 -1729
- package/dist/quikchat.esm.js.map +1 -1
- package/dist/quikchat.esm.min.js +1 -1
- package/dist/quikchat.esm.min.js.map +1 -1
- package/dist/quikchat.min.css +1 -1
- package/dist/quikchat.react.js +63 -0
- package/dist/quikchat.umd.js +454 -1729
- package/dist/quikchat.umd.js.map +1 -1
- package/dist/quikchat.umd.min.js +1 -1
- package/dist/quikchat.umd.min.js.map +1 -1
- package/package.json +59 -39
- package/dist/quikchat.d.ts +0 -194
package/README.md
CHANGED
|
@@ -1,357 +1,248 @@
|
|
|
1
|
-
[](https://opensource.org/licenses/BSD-2-Clause)
|
|
1
|
+
[](https://opensource.org/licenses/BSD-2-Clause)
|
|
2
|
+
[](https://www.npmjs.com/package/quikchat)
|
|
3
|
+

|
|
2
4
|
|
|
3
5
|
# QuikChat
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
A lightweight, zero-dependency vanilla JavaScript chat widget. Drop it into any page — no React, no Vue, no build step required — and connect it to any LLM, WebSocket, or message source with plain `fetch()`.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
```html
|
|
10
|
+
<script src="https://unpkg.com/quikchat"></script>
|
|
11
|
+
<link rel="stylesheet" href="https://unpkg.com/quikchat/dist/quikchat.css" />
|
|
12
|
+
```
|
|
10
13
|
|
|
14
|
+
```javascript
|
|
15
|
+
const chat = new quikchat('#chat', async (chat, msg) => {
|
|
16
|
+
chat.messageAddNew(msg, 'me', 'right', 'user');
|
|
11
17
|
|
|
18
|
+
// Stream a response from any LLM
|
|
19
|
+
const id = chat.messageAddTypingIndicator('bot');
|
|
20
|
+
const response = await fetch('http://localhost:11434/api/chat', {
|
|
21
|
+
method: 'POST',
|
|
22
|
+
headers: { 'Content-Type': 'application/json' },
|
|
23
|
+
body: JSON.stringify({
|
|
24
|
+
model: 'llama3.1',
|
|
25
|
+
messages: chat.historyGet(), // full conversation context
|
|
26
|
+
stream: true
|
|
27
|
+
})
|
|
28
|
+
});
|
|
12
29
|
|
|
13
|
-
|
|
30
|
+
const reader = response.body.getReader();
|
|
31
|
+
let first = true;
|
|
32
|
+
while (true) {
|
|
33
|
+
const { value, done } = await reader.read();
|
|
34
|
+
if (done) break;
|
|
35
|
+
const token = JSON.parse(new TextDecoder().decode(value).trim()).message.content;
|
|
36
|
+
if (first) { chat.messageReplaceContent(id, token); first = false; }
|
|
37
|
+
else { chat.messageAppendContent(id, token); }
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
```
|
|
14
41
|
|
|
15
|
-
|
|
16
|
-
- **🎨 Fully Customizable** - Complete CSS theming system with multi-instance support
|
|
17
|
-
- **🤖 LLM Ready** - Built-in support for OpenAI, Anthropic, Ollama, and streaming responses
|
|
18
|
-
- **📱 Responsive Design** - Adapts to any screen size and container dimensions
|
|
19
|
-
- **⚡ High Performance** - Virtual scrolling for large message volumes
|
|
20
|
-
- **👁 Advanced Visibility** - Individual and group-based message control (v1.1.13+)
|
|
21
|
-
- **🏷 Tagged Messages** - Powerful tagging system for message organization (v1.1.14+)
|
|
22
|
-
- **💾 Full History Control** - Save, load, and restore complete chat sessions
|
|
23
|
-
- **🔧 Developer Friendly** - TypeScript-ready with comprehensive API
|
|
42
|
+
That's a working streaming LLM chat in one file — no bundler, no framework, no SDK.
|
|
24
43
|
|
|
44
|
+
## Features
|
|
25
45
|
|
|
46
|
+
- **LLM-ready** — `historyGet()` returns `{ role, content }` objects compatible with OpenAI, Ollama, Mistral, and Claude APIs
|
|
47
|
+
- **Streaming built in** — `messageAddNew()` → `messageAppendContent()` for token-by-token display
|
|
48
|
+
- **Typing indicator** — animated "..." dots that auto-clear when streaming begins
|
|
49
|
+
- **Markdown support** — three tiers: base (no markdown), `-md` (basic markdown via [quikdown](https://github.com/deftio/quikdown)), `-md-full` (syntax highlighting, math, diagrams, maps — loaded on demand from CDN)
|
|
50
|
+
- **HTML sanitization** — built-in XSS protection or plug in your own sanitizer
|
|
51
|
+
- **Themeable** — 8 built-in CSS themes (light, dark, blue, warm, midnight, ocean, modern, debug) or write your own
|
|
52
|
+
- **Multi-user** — multiple users per chat, multiple independent chats per page
|
|
53
|
+
- **Message visibility & tagging** — hide system prompts and tool-call results from the UI while keeping them in history for LLM context
|
|
54
|
+
- **History export / import** — save and restore complete chat sessions (`historyExport()` / `historyImport()`)
|
|
55
|
+
- **RTL support** — `setDirection('rtl')` for Arabic, Hebrew, and other right-to-left languages
|
|
56
|
+
- **Event callbacks** — hooks for message add, append, replace, and delete events
|
|
57
|
+
- **Timestamps** — optional per-message timestamps (show/hide)
|
|
58
|
+
- **Zero runtime dependencies** — ~5 KB gzipped (base), ~9 KB with markdown, ~14 KB full
|
|
59
|
+
- **Any environment** — works with CDN, npm, or local files; UMD, ESM, and CJS builds included
|
|
60
|
+
- **Responsive** — fills its parent container and resizes automatically
|
|
61
|
+
- **Accessible** — ARIA roles and labels on all interactive elements
|
|
26
62
|
|
|
27
|
-
##
|
|
63
|
+
## Quick Start
|
|
28
64
|
|
|
29
|
-
|
|
65
|
+
### CDN
|
|
30
66
|
|
|
31
|
-
### Via CDN
|
|
32
67
|
```html
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
<head>
|
|
36
|
-
<link rel="stylesheet" href="https://unpkg.com/quikchat/dist/quikchat.css">
|
|
37
|
-
</head>
|
|
38
|
-
<body>
|
|
39
|
-
<div id="chat" style="width: 100%; height: 400px;"></div>
|
|
40
|
-
|
|
41
|
-
<script src="https://unpkg.com/quikchat"></script>
|
|
42
|
-
<script>
|
|
43
|
-
const chat = new quikchat('#chat', (instance, message) => {
|
|
44
|
-
// Echo user message
|
|
45
|
-
instance.messageAddNew(message, 'You', 'right');
|
|
46
|
-
|
|
47
|
-
// Add bot response
|
|
48
|
-
setTimeout(() => {
|
|
49
|
-
instance.messageAddNew('Thanks for your message!', 'Bot', 'left');
|
|
50
|
-
}, 1000);
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Add welcome message
|
|
54
|
-
chat.messageAddNew('Hello! How can I help you today?', 'Bot', 'left');
|
|
55
|
-
</script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
68
|
+
<script src="https://unpkg.com/quikchat"></script>
|
|
69
|
+
<link rel="stylesheet" href="https://unpkg.com/quikchat/dist/quikchat.css" />
|
|
58
70
|
```
|
|
59
71
|
|
|
60
|
-
###
|
|
72
|
+
### npm
|
|
73
|
+
|
|
61
74
|
```bash
|
|
62
75
|
npm install quikchat
|
|
63
76
|
```
|
|
64
77
|
|
|
65
78
|
```javascript
|
|
66
79
|
import quikchat from 'quikchat';
|
|
67
|
-
import 'quikchat/dist/quikchat.css';
|
|
68
|
-
|
|
69
|
-
const chat = new quikchat('#chat-container', (instance, message) => {
|
|
70
|
-
// Your message handling logic
|
|
71
|
-
console.log('User said:', message);
|
|
72
|
-
});
|
|
73
80
|
```
|
|
74
81
|
|
|
82
|
+
### With Markdown
|
|
75
83
|
|
|
76
|
-
|
|
77
|
-
## 📦 Installation Options
|
|
78
|
-
|
|
79
|
-
### NPM Package
|
|
80
|
-
```bash
|
|
81
|
-
npm install quikchat
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### CDN (Latest Version)
|
|
85
84
|
```html
|
|
86
|
-
<!--
|
|
87
|
-
<
|
|
85
|
+
<!-- Basic markdown (bold, italic, code, tables, lists) — ~9 KB gzip -->
|
|
86
|
+
<script src="https://unpkg.com/quikchat/dist/quikchat-md.umd.min.js"></script>
|
|
88
87
|
|
|
89
|
-
<!--
|
|
90
|
-
<script src="https://unpkg.com/quikchat"></script>
|
|
91
|
-
```
|
|
88
|
+
<!-- Full markdown (+ syntax highlighting, math, diagrams, maps) — ~14 KB gzip -->
|
|
89
|
+
<script src="https://unpkg.com/quikchat/dist/quikchat-md-full.umd.min.js"></script>
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
Download the latest release from [GitHub Releases](https://github.com/deftio/quikchat/releases)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
**[📖 View Full Release Notes](docs/release-notes.md)**
|
|
99
|
-
|
|
100
|
-
### 🔔 Enhanced Message Callbacks
|
|
101
|
-
Track message modifications for streaming and real-time updates:
|
|
102
|
-
|
|
103
|
-
```javascript
|
|
104
|
-
// Track streaming content as it arrives
|
|
105
|
-
chat.setCallbackonMessageAppend((instance, msgId, content) => {
|
|
106
|
-
console.log(`Streaming: ${content} added to message ${msgId}`);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
// Monitor message edits
|
|
110
|
-
chat.setCallbackonMessageReplace((instance, msgId, newContent) => {
|
|
111
|
-
console.log(`Message ${msgId} updated`);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// Track deletions
|
|
115
|
-
chat.setCallbackonMessageDelete((instance, msgId) => {
|
|
116
|
-
console.log(`Message ${msgId} deleted`);
|
|
117
|
-
});
|
|
91
|
+
<link rel="stylesheet" href="https://unpkg.com/quikchat/dist/quikchat.css" />
|
|
118
92
|
```
|
|
119
93
|
|
|
120
|
-
|
|
121
|
-
Efficiently handle large chat histories with pagination and search:
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
// Paginated history retrieval
|
|
125
|
-
const page = chat.historyGetPage(1, 20, 'desc'); // Get newest 20 messages
|
|
126
|
-
console.log(page.messages);
|
|
127
|
-
console.log(page.pagination.hasNext); // Check if more pages exist
|
|
128
|
-
|
|
129
|
-
// Search through history
|
|
130
|
-
const results = chat.historySearch({
|
|
131
|
-
text: 'error',
|
|
132
|
-
userString: 'Support',
|
|
133
|
-
limit: 50
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Get history metadata
|
|
137
|
-
const info = chat.historyGetInfo();
|
|
138
|
-
console.log(`Total messages: ${info.totalMessages}`);
|
|
139
|
-
console.log(`Memory used: ${info.memoryUsage.estimatedSize} bytes`);
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
|
|
94
|
+
The `-md-full` build uses [quikdown](https://github.com/deftio/quikdown)'s editor as a rendering engine. When your LLM returns a fenced code block with a language tag, highlight.js loads from CDN automatically. Same for math (MathJax), diagrams (Mermaid), and maps (Leaflet) — each loads on demand the first time it's encountered.
|
|
143
95
|
|
|
96
|
+
Same API across all three builds — just pick your script tag.
|
|
144
97
|
|
|
145
|
-
##
|
|
146
|
-
|
|
147
|
-
QuikChat includes beautiful built-in themes and supports complete customization:
|
|
98
|
+
## Usage
|
|
148
99
|
|
|
149
100
|
```javascript
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
101
|
+
const chat = new quikchat(
|
|
102
|
+
'#chat-container', // CSS selector or DOM element
|
|
103
|
+
(chat, msg) => { // onSend callback
|
|
104
|
+
chat.messageAddNew(msg, 'me', 'right');
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
theme: 'quikchat-theme-light',
|
|
108
|
+
titleArea: { title: 'My Chat', align: 'left', show: true },
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
// Add messages programmatically
|
|
113
|
+
chat.messageAddNew('Hello!', 'Alice', 'left', 'user');
|
|
114
|
+
chat.messageAddNew('Hi there!', 'Bot', 'left', 'assistant');
|
|
115
|
+
chat.messageAddNew('System notice', 'system', 'center', 'system');
|
|
116
|
+
|
|
117
|
+
// Streaming pattern
|
|
118
|
+
const id = chat.messageAddTypingIndicator('bot'); // show "..." dots
|
|
119
|
+
chat.messageReplaceContent(id, firstToken); // first token clears dots
|
|
120
|
+
chat.messageAppendContent(id, nextToken); // append subsequent tokens
|
|
121
|
+
|
|
122
|
+
// Disable input while bot is responding
|
|
123
|
+
chat.inputAreaSetEnabled(false);
|
|
124
|
+
chat.inputAreaSetButtonText('Thinking...');
|
|
125
|
+
// ... after response completes ...
|
|
126
|
+
chat.inputAreaSetEnabled(true);
|
|
127
|
+
chat.inputAreaSetButtonText('Send');
|
|
128
|
+
|
|
129
|
+
// History is LLM-API compatible
|
|
130
|
+
const history = chat.historyGet(); // [{ role: "user", content: "..." }, ...]
|
|
157
131
|
```
|
|
158
132
|
|
|
159
|
-
|
|
160
|
-
Create your own themes with CSS:
|
|
133
|
+
## Message Formatter & Sanitization
|
|
161
134
|
|
|
162
|
-
|
|
163
|
-
.my-custom-theme {
|
|
164
|
-
border: 2px solid #3b82f6;
|
|
165
|
-
border-radius: 12px;
|
|
166
|
-
font-family: 'SF Pro Display', sans-serif;
|
|
167
|
-
}
|
|
135
|
+
Process message content before display — render markdown, sanitize HTML, or both:
|
|
168
136
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
137
|
+
```javascript
|
|
138
|
+
const chat = new quikchat('#chat', onSend, {
|
|
139
|
+
// Sanitize user input (true = escape HTML entities, or pass a function)
|
|
140
|
+
sanitize: true,
|
|
173
141
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
theme: 'my-custom-theme'
|
|
142
|
+
// Format content (e.g., markdown → HTML)
|
|
143
|
+
messageFormatter: (content) => myMarkdownParser(content),
|
|
177
144
|
});
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
**📖 [Complete Theming Guide](docs/DEVELOPER-GUIDE.md#theming-guide)**
|
|
181
145
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
### OpenAI Integration
|
|
187
|
-
```javascript
|
|
188
|
-
async function handleMessage(chat, message) {
|
|
189
|
-
chat.messageAddNew(message, 'You', 'right');
|
|
190
|
-
|
|
191
|
-
const response = await fetch('https://api.openai.com/v1/chat/completions', {
|
|
192
|
-
method: 'POST',
|
|
193
|
-
headers: {
|
|
194
|
-
'Authorization': `Bearer ${API_KEY}`,
|
|
195
|
-
'Content-Type': 'application/json'
|
|
196
|
-
},
|
|
197
|
-
body: JSON.stringify({
|
|
198
|
-
model: 'gpt-4',
|
|
199
|
-
messages: formatChatHistory(chat.historyGetAllCopy(), message)
|
|
200
|
-
})
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
const data = await response.json();
|
|
204
|
-
chat.messageAddNew(data.choices[0].message.content, 'Assistant', 'left');
|
|
205
|
-
}
|
|
146
|
+
// Change at runtime
|
|
147
|
+
chat.setMessageFormatter((content) => marked.parse(content));
|
|
148
|
+
chat.setSanitize((content) => DOMPurify.sanitize(content));
|
|
206
149
|
```
|
|
207
150
|
|
|
208
|
-
|
|
209
|
-
```javascript
|
|
210
|
-
// Create message for streaming
|
|
211
|
-
const botMsgId = chat.messageAddNew('', 'Bot', 'left');
|
|
212
|
-
|
|
213
|
-
// Append content as it arrives
|
|
214
|
-
streamingAPI.onChunk(chunk => {
|
|
215
|
-
chat.messageAppendContent(botMsgId, chunk);
|
|
216
|
-
});
|
|
217
|
-
```
|
|
151
|
+
The pipeline is: **sanitize → format → display**. Sanitize cleans untrusted input; the formatter's output is trusted.
|
|
218
152
|
|
|
219
|
-
|
|
153
|
+
The `-md` and `-md-full` builds pre-wire [quikdown](https://github.com/deftio/quikdown) as the formatter — no configuration needed. The `-md-full` build additionally renders syntax-highlighted code, math equations, Mermaid diagrams, and maps via dynamic CDN loading.
|
|
220
154
|
|
|
155
|
+
## Theming
|
|
221
156
|
|
|
157
|
+
Themes are pure CSS — colors, borders, and shadows only. The base CSS handles all layout.
|
|
222
158
|
|
|
223
|
-
|
|
159
|
+
```javascript
|
|
160
|
+
// Built-in themes
|
|
161
|
+
chat.changeTheme('quikchat-theme-light');
|
|
162
|
+
chat.changeTheme('quikchat-theme-dark');
|
|
163
|
+
chat.changeTheme('quikchat-theme-modern'); // chat-bubble style
|
|
224
164
|
|
|
225
|
-
|
|
226
|
-
```jsx
|
|
227
|
-
function ChatComponent() {
|
|
228
|
-
const chatRef = useRef(null);
|
|
229
|
-
const instanceRef = useRef(null);
|
|
230
|
-
|
|
231
|
-
useEffect(() => {
|
|
232
|
-
instanceRef.current = new quikchat(chatRef.current, handleMessage);
|
|
233
|
-
}, []);
|
|
234
|
-
|
|
235
|
-
return <div ref={chatRef} style={{ height: '400px' }} />;
|
|
236
|
-
}
|
|
165
|
+
// Or write your own — just color overrides
|
|
237
166
|
```
|
|
238
167
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
<script>
|
|
246
|
-
import quikchat from 'quikchat';
|
|
247
|
-
|
|
248
|
-
export default {
|
|
249
|
-
mounted() {
|
|
250
|
-
this.chat = new quikchat(this.$refs.chatContainer, this.handleMessage);
|
|
251
|
-
}
|
|
168
|
+
```css
|
|
169
|
+
.my-theme {
|
|
170
|
+
background-color: #f9f9f9;
|
|
171
|
+
border: 1px solid #ccc;
|
|
172
|
+
border-radius: 10px;
|
|
252
173
|
}
|
|
253
|
-
|
|
174
|
+
.my-theme .quikchat-title-area { color: #333; }
|
|
175
|
+
.my-theme .quikchat-messages-area { background-color: #fff; color: #333; }
|
|
176
|
+
.my-theme .quikchat-input-send-btn { background-color: #4caf50; color: white; border: none; border-radius: 4px; }
|
|
254
177
|
```
|
|
255
178
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
## 📖 Documentation
|
|
179
|
+
The **modern bubble theme** uses alignment classes (`quikchat-align-left`, `quikchat-align-right`) to position messages as chat bubbles with colored backgrounds — left-aligned messages appear as grey bubbles, right-aligned as blue.
|
|
261
180
|
|
|
262
|
-
|
|
263
|
-
|-|-|
|
|
264
|
-
| **[API Reference](docs/API-REFERENCE.md)** | Complete technical reference for all methods and options |
|
|
265
|
-
| **[Developer Guide](docs/DEVELOPER-GUIDE.md)** | Practical recipes and advanced patterns |
|
|
266
|
-
| **[Examples](examples/)** | Working code examples and demos |
|
|
267
|
-
| **[Live Demo](https://deftio.github.io/quikchat/examples/)** | Interactive examples and showcase |
|
|
181
|
+
Style messages by role with CSS hooks: `.quikchat-role-user`, `.quikchat-role-assistant`, `.quikchat-role-system`, `.quikchat-role-tool`.
|
|
268
182
|
|
|
183
|
+
## Documentation
|
|
269
184
|
|
|
185
|
+
| Guide | Description |
|
|
186
|
+
|---|---|
|
|
187
|
+
| [Getting Started](docs/getting-started.md) | Installation, minimal example, constructor options |
|
|
188
|
+
| [API Reference](docs/api-reference.md) | Every public method, property, and return value |
|
|
189
|
+
| [Streaming](docs/streaming.md) | Token-by-token LLM response display |
|
|
190
|
+
| [Multi-User Chat](docs/multi-user-chat.md) | Multiple users, dual instances, message routing |
|
|
191
|
+
| [LLM Integration](docs/llm-integration.md) | Ollama, OpenAI, LM Studio, tool calls, conversational memory |
|
|
192
|
+
| [Theming](docs/theming.md) | Custom themes, CSS architecture, built-in themes |
|
|
193
|
+
| [CSS Architecture](docs/css-architecture.md) | Base vs theme separation, ARIA accessibility |
|
|
270
194
|
|
|
271
|
-
##
|
|
195
|
+
## Demo & Examples
|
|
272
196
|
|
|
273
|
-
|
|
274
|
-
- **[LLM Integration](examples/openai.html)** - OpenAI GPT integration
|
|
275
|
-
- **[Multi-Instance](examples/dual-chatrooms.html)** - Multiple chats on one page
|
|
276
|
-
- **[Visibility Controls](examples/hidden_message.html)** - Message visibility features
|
|
277
|
-
- **[Theme Showcase](https://deftio.github.io/quikchat/examples/)** - Light and dark themes
|
|
278
|
-
- **[React Integration](examples/quikchat-react.html)** - React component example
|
|
279
|
-
- **[Backend Examples](examples/)** - FastAPI and Node.js backends
|
|
197
|
+
[Live Demo](https://deftio.github.io/quikchat/site/) | [Examples](https://deftio.github.io/quikchat/examples/)
|
|
280
198
|
|
|
281
|
-
|
|
199
|
+
Examples include: basic UMD/ESM usage, theme switching, dual chatrooms, markdown rendering ([basic](./examples/example_markdown.html) and [full with syntax highlighting + math + diagrams](./examples/example_md_full.html)), streaming with Ollama/OpenAI/LM Studio, and React integration.
|
|
282
200
|
|
|
201
|
+
## Build Variants
|
|
283
202
|
|
|
203
|
+
| Build | What you get | Network |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| **Base** (`quikchat.umd.min.js`) | Chat widget, zero deps | None |
|
|
206
|
+
| **Markdown** (`quikchat-md.umd.min.js`) | + bold, italic, code, tables, lists | None |
|
|
207
|
+
| **Full** (`quikchat-md-full.umd.min.js`) | + syntax highlighting, math, diagrams, maps | CDN on demand |
|
|
208
|
+
| **CSS** (`quikchat.css`) | All 8 themes | None |
|
|
284
209
|
|
|
285
|
-
|
|
210
|
+
All builds are also available in ESM and CJS formats with sourcemaps. See the [downloads page](https://deftio.github.io/quikchat/site/downloads.html) for exact sizes, SRI hashes, and CDN links.
|
|
286
211
|
|
|
287
|
-
|
|
212
|
+
The `-md` builds bundle [quikdown](https://github.com/deftio/quikdown). The `-md-full` build post-processes fence blocks with dynamically loaded renderers (highlight.js, MathJax, Mermaid, Leaflet). The base builds have zero runtime dependencies.
|
|
288
213
|
|
|
289
|
-
|
|
290
|
-
- **Fast**: Sub-millisecond message rendering
|
|
291
|
-
- **Scalable**: Tested with 10,000 messages rendering in 38ms with virtual scrolling
|
|
292
|
-
- **Memory Efficient**: Only renders visible messages in viewport
|
|
293
|
-
|
|
294
|
-
**📊 [Virtual Scrolling Technical Details](docs/virtual_scrolling.md) | [Performance Guide](docs/DEVELOPER-GUIDE.md#performance-optimization)**
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
## 🛠 Building from Source
|
|
214
|
+
## Building from Source
|
|
299
215
|
|
|
300
216
|
```bash
|
|
301
|
-
# Clone repository
|
|
302
|
-
git clone https://github.com/deftio/quikchat.git
|
|
303
|
-
cd quikchat
|
|
304
|
-
|
|
305
|
-
# Install dependencies
|
|
306
217
|
npm install
|
|
307
|
-
|
|
308
|
-
#
|
|
309
|
-
npm run build
|
|
310
|
-
|
|
311
|
-
# Run tests
|
|
312
|
-
npm test
|
|
313
|
-
|
|
314
|
-
# Start development server
|
|
315
|
-
npm run dev
|
|
218
|
+
npm run build # lint, build all formats, report bundle sizes
|
|
219
|
+
npm test # jest unit tests with coverage
|
|
316
220
|
```
|
|
317
221
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
## 🤝 Contributing
|
|
323
|
-
|
|
324
|
-
We welcome contributions! Here's how you can help:
|
|
222
|
+
Build-time tooling (rollup, babel, eslint, jest) is all in devDependencies — zero runtime dependencies.
|
|
325
223
|
|
|
326
|
-
|
|
327
|
-
2. **💡 Feature Requests** - Have an idea? We'd love to hear it
|
|
328
|
-
3. **🔧 Code Contributions** - Submit pull requests for bug fixes or new features
|
|
329
|
-
4. **📖 Documentation** - Help improve our guides and examples
|
|
330
|
-
5. **🌟 Share Examples** - Show us what you've built with QuikChat
|
|
224
|
+
## Testing
|
|
331
225
|
|
|
332
|
-
### Development Setup
|
|
333
226
|
```bash
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
npm install
|
|
337
|
-
npm run dev
|
|
227
|
+
npm test # unit tests (jest, 100% coverage)
|
|
228
|
+
npm run test:e2e # browser tests (playwright)
|
|
338
229
|
```
|
|
339
230
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
231
|
+
## Development
|
|
343
232
|
|
|
344
|
-
|
|
233
|
+
```bash
|
|
234
|
+
npm run feature my-feature-name # creates feature/my-feature-name, bumps patch
|
|
235
|
+
npm run feature my-feature-name minor # bumps minor
|
|
236
|
+
```
|
|
345
237
|
|
|
346
|
-
|
|
238
|
+
A pre-commit hook runs lint and tests automatically before each commit.
|
|
347
239
|
|
|
240
|
+
See [RELEASE-PROCEDURE.md](RELEASE-PROCEDURE.md) for the full release workflow.
|
|
348
241
|
|
|
242
|
+
## License
|
|
349
243
|
|
|
350
|
-
|
|
244
|
+
BSD-2-Clause
|
|
351
245
|
|
|
352
|
-
|
|
353
|
-
- **🐙 [GitHub Repository](https://github.com/deftio/quikchat)**
|
|
354
|
-
- **🚀 [Live Examples](https://deftio.github.io/quikchat/examples/)**
|
|
355
|
-
- **📖 [Medium Article](https://medium.com/gitconnected/quikchat-4be8d4a849e5)**
|
|
356
|
-
- **💬 [Issues & Support](https://github.com/deftio/quikchat/issues)**
|
|
246
|
+
## Home Page
|
|
357
247
|
|
|
248
|
+
[github.com/deftio/quikchat](https://github.com/deftio/quikchat)
|