hanc-webrtc-widgets 2.0.0 → 2.0.2
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 +152 -4
- package/dist/hanc-webrtc-widgets.es.js +3936 -3315
- package/dist/hanc-webrtc-widgets.umd.js +216 -66
- package/dist/src/components/floating-call/floating-call.d.ts +33 -1
- package/dist/src/components/inline-call/inline-call.d.ts +34 -1
- package/dist/src/core/color-utils.d.ts +3 -0
- package/dist/src/renderers/base-renderer.d.ts +10 -1
- package/dist/src/renderers/neural-network-renderer.d.ts +10 -0
- package/dist/src/types/config.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,38 @@ It provides ready-to-use, customizable, and lightweight UI widgets for initiatin
|
|
|
6
6
|
|
|
7
7
|
You can use it in **plain HTML**, or integrate it with **React**, **Next.js**, or any other modern frontend stack.
|
|
8
8
|
|
|
9
|
+
## What's New
|
|
10
|
+
|
|
11
|
+
- Light/dark orb color overrides via `orb-color-light` and `orb-color-dark`.
|
|
12
|
+
- Active-state overrides per theme via `active-orb-color-light` and `active-orb-color-dark`.
|
|
13
|
+
- Smoother neural-network transitions between connected and idle states.
|
|
14
|
+
|
|
15
|
+
### Examples
|
|
16
|
+
|
|
17
|
+
Inline (different colors per theme):
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<hanc-ai-inline-call
|
|
21
|
+
agent-id="YOUR_AGENT_ID"
|
|
22
|
+
orb-color-light="#6d28d9"
|
|
23
|
+
orb-color-dark="#8b5cf6"
|
|
24
|
+
active-orb-color-light="#16a34a"
|
|
25
|
+
active-orb-color-dark="#22c55e"
|
|
26
|
+
></hanc-ai-inline-call>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Floating (same behavior, colors optional per theme):
|
|
30
|
+
|
|
31
|
+
```html
|
|
32
|
+
<hanc-ai-floating-call
|
|
33
|
+
agent-id="YOUR_AGENT_ID"
|
|
34
|
+
orb-color-light="var(--brand-accent-600)"
|
|
35
|
+
orb-color-dark="var(--brand-accent-400)"
|
|
36
|
+
active-orb-color-light="#0ea5e9"
|
|
37
|
+
active-orb-color-dark="#38bdf8"
|
|
38
|
+
></hanc-ai-floating-call>
|
|
39
|
+
```
|
|
40
|
+
|
|
9
41
|
## Quick Start
|
|
10
42
|
|
|
11
43
|
### HTML Example
|
|
@@ -153,6 +185,15 @@ An “inline” widget that you embed directly in page content (often as a hero
|
|
|
153
185
|
| `agent-id` (required) | string | Agent ID for Twilio calls |
|
|
154
186
|
| `button-start-text` | string | Custom start button text (default: `Start Call with ai`) |
|
|
155
187
|
| `button-connecting-text` | string | Custom connecting button text (default: `Connecting...`) |
|
|
188
|
+
| `button-end-text` | string | End button text (default: `End call`) |
|
|
189
|
+
| `hide-button` | bool | Hide the button (orb click still toggles the call) |
|
|
190
|
+
| `button-position` | string | Button placement: `top` or `bottom` |
|
|
191
|
+
| `orb-color` | string | Base orb color in idle state |
|
|
192
|
+
| `active-orb-color` | string | Orb color applied when the call becomes active |
|
|
193
|
+
| `button-color` | string | Base button color (also used to derive hover/active) |
|
|
194
|
+
| `button-hover-color` | string | Button hover color override |
|
|
195
|
+
| `button-active-color` | string | Button active color override |
|
|
196
|
+
| `button-text-color` | string | Button text color |
|
|
156
197
|
|
|
157
198
|
#### Available Events:
|
|
158
199
|
|
|
@@ -205,11 +246,11 @@ Below are the new properties and examples you can add to the widgets.
|
|
|
205
246
|
|
|
206
247
|
### Theme and visual style
|
|
207
248
|
|
|
208
|
-
Themes: `liquid-purple`
|
|
209
|
-
`neural-blue
|
|
249
|
+
Themes: `liquid-purple` , `liquid-cyan`, `liquid-pink`, `neural-green`,
|
|
250
|
+
`neural-blue`(default), `orbit-blue`, `synaptic-purple`, `minimal-dark`, `minimal-light`, `custom`.
|
|
210
251
|
|
|
211
|
-
Visual styles: `liquid-glass`
|
|
212
|
-
`neural-orbit`, `neural-network
|
|
252
|
+
Visual styles: `liquid-glass` , `liquid-glass-premium`, `neural-liquid`,
|
|
253
|
+
`neural-orbit`, `neural-network`(default), `synaptic-core`, `organic-sphere`, `morphing-blob`.
|
|
213
254
|
|
|
214
255
|
```html
|
|
215
256
|
<hanc-ai-inline-call
|
|
@@ -227,6 +268,18 @@ Visual styles: `liquid-glass` (default), `liquid-glass-premium`, `neural-liquid`
|
|
|
227
268
|
- `visual-style`
|
|
228
269
|
- `orb-size`
|
|
229
270
|
- `button-end-text`
|
|
271
|
+
- `hide-button`
|
|
272
|
+
- `button-position`
|
|
273
|
+
- `orb-color`
|
|
274
|
+
- `orb-color-light`
|
|
275
|
+
- `orb-color-dark`
|
|
276
|
+
- `active-orb-color`
|
|
277
|
+
- `active-orb-color-light`
|
|
278
|
+
- `active-orb-color-dark`
|
|
279
|
+
- `button-color`
|
|
280
|
+
- `button-hover-color`
|
|
281
|
+
- `button-active-color`
|
|
282
|
+
- `button-text-color`
|
|
230
283
|
|
|
231
284
|
```html
|
|
232
285
|
<hanc-ai-inline-call
|
|
@@ -248,6 +301,18 @@ Visual styles: `liquid-glass` (default), `liquid-glass-premium`, `neural-liquid`
|
|
|
248
301
|
- `offset-x`
|
|
249
302
|
- `offset-y`
|
|
250
303
|
- `orb-size`
|
|
304
|
+
- `hide-button`
|
|
305
|
+
- `button-position`
|
|
306
|
+
- `orb-color`
|
|
307
|
+
- `orb-color-light`
|
|
308
|
+
- `orb-color-dark`
|
|
309
|
+
- `active-orb-color`
|
|
310
|
+
- `active-orb-color-light`
|
|
311
|
+
- `active-orb-color-dark`
|
|
312
|
+
- `button-color`
|
|
313
|
+
- `button-hover-color`
|
|
314
|
+
- `button-active-color`
|
|
315
|
+
- `button-text-color`
|
|
251
316
|
- `minimized`
|
|
252
317
|
|
|
253
318
|
```html
|
|
@@ -276,15 +341,90 @@ hanc-ai-inline-call {
|
|
|
276
341
|
--hanc-button-shadow: rgba(14, 165, 233, 0.35);
|
|
277
342
|
--hanc-button-shadow-hover: rgba(14, 165, 233, 0.45);
|
|
278
343
|
--hanc-button-shadow-active: rgba(239, 68, 68, 0.45);
|
|
344
|
+
--hanc-orb-active-glow: rgba(14, 165, 233, 0.35);
|
|
345
|
+
--hanc-orb-z-index: 10000;
|
|
346
|
+
--hanc-widget-z-index: 9999;
|
|
279
347
|
}
|
|
280
348
|
|
|
281
349
|
hanc-ai-floating-call {
|
|
282
350
|
--hanc-background: rgba(10, 10, 20, 0.9);
|
|
283
351
|
--hanc-glow-shadow: rgba(14, 165, 233, 0.2);
|
|
284
352
|
--hanc-orb-size: 140px;
|
|
353
|
+
--hanc-orb-active-glow: rgba(14, 165, 233, 0.35);
|
|
354
|
+
--hanc-orb-z-index: 10000;
|
|
355
|
+
--hanc-widget-z-index: 9999;
|
|
285
356
|
}
|
|
286
357
|
```
|
|
287
358
|
|
|
359
|
+
#### Custom theme examples
|
|
360
|
+
|
|
361
|
+
Tip: set `theme="custom"` and override only the variables you need. All other values fall back to defaults.
|
|
362
|
+
|
|
363
|
+
```html
|
|
364
|
+
<hanc-ai-inline-call
|
|
365
|
+
agent-id="YOUR_AGENT_ID"
|
|
366
|
+
theme="custom"
|
|
367
|
+
visual-style="neural-network"
|
|
368
|
+
active-orb-color="#22c55e"
|
|
369
|
+
></hanc-ai-inline-call>
|
|
370
|
+
|
|
371
|
+
<style>
|
|
372
|
+
hanc-ai-inline-call {
|
|
373
|
+
--hanc-background: rgba(10, 15, 20, 0.8);
|
|
374
|
+
--hanc-orb-size: 220px;
|
|
375
|
+
--hanc-button: linear-gradient(135deg, #0ea5e9 0%, #22c55e 100%);
|
|
376
|
+
--hanc-button-hover: linear-gradient(135deg, #0284c7 0%, #16a34a 100%);
|
|
377
|
+
--hanc-button-active: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
|
378
|
+
--hanc-button-text: #ffffff;
|
|
379
|
+
--hanc-orb-active-glow: rgba(34, 197, 94, 0.4);
|
|
380
|
+
}
|
|
381
|
+
</style>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
```html
|
|
385
|
+
<hanc-ai-inline-call
|
|
386
|
+
agent-id="YOUR_AGENT_ID"
|
|
387
|
+
theme="custom"
|
|
388
|
+
visual-style="neural-orbit"
|
|
389
|
+
button-position="top"
|
|
390
|
+
></hanc-ai-inline-call>
|
|
391
|
+
|
|
392
|
+
<style>
|
|
393
|
+
hanc-ai-inline-call {
|
|
394
|
+
--hanc-orb-size: 260px;
|
|
395
|
+
--hanc-button-radius: 999px;
|
|
396
|
+
--hanc-button: linear-gradient(135deg, #111827 0%, #374151 100%);
|
|
397
|
+
--hanc-button-hover: linear-gradient(135deg, #1f2937 0%, #111827 100%);
|
|
398
|
+
--hanc-button-active: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
|
|
399
|
+
--hanc-button-text: #f9fafb;
|
|
400
|
+
--hanc-orb-active-glow: rgba(59, 130, 246, 0.35);
|
|
401
|
+
}
|
|
402
|
+
</style>
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
```html
|
|
406
|
+
<hanc-ai-floating-call
|
|
407
|
+
agent-id="YOUR_AGENT_ID"
|
|
408
|
+
theme="custom"
|
|
409
|
+
position="top-right"
|
|
410
|
+
button-position="top"
|
|
411
|
+
active-orb-color="#f97316"
|
|
412
|
+
></hanc-ai-floating-call>
|
|
413
|
+
|
|
414
|
+
<style>
|
|
415
|
+
hanc-ai-floating-call {
|
|
416
|
+
--hanc-background: rgba(255, 255, 255, 0.92);
|
|
417
|
+
--hanc-text: rgba(24, 24, 27, 0.8);
|
|
418
|
+
--hanc-glow-shadow: rgba(249, 115, 22, 0.2);
|
|
419
|
+
--hanc-orb-size: 120px;
|
|
420
|
+
--hanc-button: linear-gradient(135deg, #f97316 0%, #f59e0b 100%);
|
|
421
|
+
--hanc-button-hover: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
|
|
422
|
+
--hanc-button-active: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
|
|
423
|
+
--hanc-button-text: #ffffff;
|
|
424
|
+
}
|
|
425
|
+
</style>
|
|
426
|
+
```
|
|
427
|
+
|
|
288
428
|
---
|
|
289
429
|
|
|
290
430
|
### `<hanc-ai-floating-call>`
|
|
@@ -301,6 +441,14 @@ A persistent, docked widget that floats in the corner and launches the same voic
|
|
|
301
441
|
| `button-start-text` | string | Start button text (default: `Start Call with ai`) |
|
|
302
442
|
| `button-connecting-text` | string | Custom connecting button text (default: `Connecting...`) |
|
|
303
443
|
| `button-end-text` | string | End button text (default: `End call`) |
|
|
444
|
+
| `hide-button` | bool | Hide the button (orb click still toggles the call) |
|
|
445
|
+
| `button-position` | string | Button placement: `top` or `bottom` |
|
|
446
|
+
| `orb-color` | string | Base orb color in idle state |
|
|
447
|
+
| `active-orb-color` | string | Orb color applied when the call becomes active |
|
|
448
|
+
| `button-color` | string | Base button color (also used to derive hover/active) |
|
|
449
|
+
| `button-hover-color` | string | Button hover color override |
|
|
450
|
+
| `button-active-color` | string | Button active color override |
|
|
451
|
+
| `button-text-color` | string | Button text color |
|
|
304
452
|
|
|
305
453
|
#### Available Events:
|
|
306
454
|
|