hanc-webrtc-widgets 2.4.6 → 2.4.8
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 +109 -2
- package/dist/hanc-webrtc-widgets.es.js +8773 -7989
- package/dist/hanc-webrtc-widgets.umd.js +601 -224
- package/dist/src/components/floating-call/floating-call.d.ts +5 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/inline-call/inline-call.d.ts +5 -0
- package/dist/src/components/pill-call/pill-call.d.ts +5 -0
- package/dist/src/components/pill-floating-call/index.d.ts +1 -0
- package/dist/src/components/pill-floating-call/pill-floating-call.d.ts +62 -0
- package/dist/src/components/privacy-modal/index.d.ts +1 -0
- package/dist/src/components/privacy-modal/privacy-modal.d.ts +20 -0
- package/dist/src/core/livekit-call-manager.d.ts +2 -1
- package/dist/src/core/privacy-consent.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ You can use it in **plain HTML**, or integrate it with **React**, **Next.js**, *
|
|
|
8
8
|
|
|
9
9
|
## ✨ Features
|
|
10
10
|
|
|
11
|
-
- 🎨 **
|
|
11
|
+
- 🎨 **Four Widget Types**: Inline, Floating, Pill, and Pill Floating layouts
|
|
12
12
|
- 🌈 **Audio-Reactive 3D Orb**: WebGL-powered visualization responding to voice
|
|
13
13
|
- 🎭 **Color Presets**: Dark and light theme color palettes
|
|
14
14
|
- 🔧 **Highly Customizable**: Full control over colors, glow, animations, and behavior
|
|
@@ -52,6 +52,13 @@ You can use it in **plain HTML**, or integrate it with **React**, **Next.js**, *
|
|
|
52
52
|
button-start-text="Talk to AI Agent"
|
|
53
53
|
orb-size="48"
|
|
54
54
|
></hanc-ai-pill-call>
|
|
55
|
+
|
|
56
|
+
<!-- Pill Floating Widget (floating pill button in corner) -->
|
|
57
|
+
<hanc-ai-pill-floating-call
|
|
58
|
+
agent-id="YOUR_AGENT_ID"
|
|
59
|
+
position="bottom-right"
|
|
60
|
+
button-start-text="Talk to AI"
|
|
61
|
+
></hanc-ai-pill-floating-call>
|
|
55
62
|
</body>
|
|
56
63
|
</html>
|
|
57
64
|
```
|
|
@@ -75,7 +82,7 @@ npm install @lit/react hanc-webrtc-widgets
|
|
|
75
82
|
```tsx
|
|
76
83
|
import React from 'react';
|
|
77
84
|
import { createComponent } from '@lit/react';
|
|
78
|
-
import { InlineCall, FloatingCall, PillCall } from 'hanc-webrtc-widgets';
|
|
85
|
+
import { InlineCall, FloatingCall, PillCall, PillFloatingCall } from 'hanc-webrtc-widgets';
|
|
79
86
|
|
|
80
87
|
export const HancAiInlineCall = createComponent({
|
|
81
88
|
tagName: 'hanc-ai-inline-call',
|
|
@@ -106,6 +113,16 @@ export const HancAiPillCall = createComponent({
|
|
|
106
113
|
onCallEnd: 'call-end',
|
|
107
114
|
},
|
|
108
115
|
});
|
|
116
|
+
|
|
117
|
+
export const HancAiPillFloatingCall = createComponent({
|
|
118
|
+
tagName: 'hanc-ai-pill-floating-call',
|
|
119
|
+
elementClass: PillFloatingCall,
|
|
120
|
+
react: React,
|
|
121
|
+
events: {
|
|
122
|
+
onCallStart: 'call-start',
|
|
123
|
+
onCallEnd: 'call-end',
|
|
124
|
+
},
|
|
125
|
+
});
|
|
109
126
|
```
|
|
110
127
|
|
|
111
128
|
3. Use in your components:
|
|
@@ -137,6 +154,13 @@ export default function Example() {
|
|
|
137
154
|
buttonStartText="Talk to AI"
|
|
138
155
|
orbColors={lightPresets.indigo}
|
|
139
156
|
/>
|
|
157
|
+
|
|
158
|
+
{/* Floating pill button */}
|
|
159
|
+
<HancAiPillFloatingCall
|
|
160
|
+
agentId="YOUR_AGENT_ID"
|
|
161
|
+
position="bottom-right"
|
|
162
|
+
buttonStartText="Chat with AI"
|
|
163
|
+
/>
|
|
140
164
|
</>
|
|
141
165
|
);
|
|
142
166
|
}
|
|
@@ -209,6 +233,23 @@ export const HancAiPillCall = dynamic(
|
|
|
209
233
|
},
|
|
210
234
|
{ ssr: false }
|
|
211
235
|
);
|
|
236
|
+
|
|
237
|
+
export const HancAiPillFloatingCall = dynamic(
|
|
238
|
+
async () => {
|
|
239
|
+
const { PillFloatingCall } = await import('hanc-webrtc-widgets');
|
|
240
|
+
|
|
241
|
+
return createComponent({
|
|
242
|
+
tagName: 'hanc-ai-pill-floating-call',
|
|
243
|
+
elementClass: PillFloatingCall,
|
|
244
|
+
react: React,
|
|
245
|
+
events: {
|
|
246
|
+
onCallStart: 'call-start',
|
|
247
|
+
onCallEnd: 'call-end',
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
},
|
|
251
|
+
{ ssr: false }
|
|
252
|
+
);
|
|
212
253
|
```
|
|
213
254
|
|
|
214
255
|
3. Use in your pages:
|
|
@@ -278,6 +319,13 @@ const handleCallEnd = () => {
|
|
|
278
319
|
agent-id="YOUR_AGENT_ID"
|
|
279
320
|
button-start-text="Chat with AI"
|
|
280
321
|
/>
|
|
322
|
+
|
|
323
|
+
<!-- Pill floating widget -->
|
|
324
|
+
<hanc-ai-pill-floating-call
|
|
325
|
+
agent-id="YOUR_AGENT_ID"
|
|
326
|
+
position="bottom-right"
|
|
327
|
+
button-start-text="Talk to AI"
|
|
328
|
+
/>
|
|
281
329
|
</div>
|
|
282
330
|
</template>
|
|
283
331
|
```
|
|
@@ -469,6 +517,65 @@ Same attributes as `<hanc-ai-inline-call>`, plus:
|
|
|
469
517
|
|
|
470
518
|
---
|
|
471
519
|
|
|
520
|
+
### `<hanc-ai-pill-floating-call>`
|
|
521
|
+
|
|
522
|
+
A floating pill-shaped button that stays fixed in a corner of the viewport. Combines the compact pill design with floating positioning for persistent AI assistant access.
|
|
523
|
+
|
|
524
|
+
#### Quick Start Attributes
|
|
525
|
+
|
|
526
|
+
The essentials to get started:
|
|
527
|
+
|
|
528
|
+
| Attribute | Type | Default | Description |
|
|
529
|
+
|-----------|------|---------|-------------|
|
|
530
|
+
| `agent-id` **(required)** | string | - | Your Hanc AI agent ID |
|
|
531
|
+
| `position` | string | `"bottom-right"` | Corner position: `"bottom-right"`, `"bottom-left"`, `"top-right"`, `"top-left"`, or `"static"` |
|
|
532
|
+
| `theme` | string | `"default"` | Theme name: `"default"`, `"emerald"`, `"rose"`, `"amber"`, `"cyan"`, `"purple"`, `"blue"` |
|
|
533
|
+
| `theme-mode` | string | `"auto"` | `"auto"` (system), `"dark"`, or `"light"` |
|
|
534
|
+
| `button-start-text` | string | `"Talk to AI Agent"` | Button text when idle |
|
|
535
|
+
| `orb-size` | number | `48` | Orb diameter in pixels |
|
|
536
|
+
|
|
537
|
+
#### All Attributes
|
|
538
|
+
|
|
539
|
+
Same attributes as `<hanc-ai-pill-call>`, plus:
|
|
540
|
+
|
|
541
|
+
| Attribute | Type | Default | Description |
|
|
542
|
+
|-----------|------|---------|-------------|
|
|
543
|
+
| `position` | string | `"bottom-right"` | Corner position: `"bottom-right"`, `"bottom-left"`, `"top-right"`, `"top-left"`, or `"static"` |
|
|
544
|
+
| `button-start-text` | string | `"Talk to AI Agent"` | Button text in idle state |
|
|
545
|
+
| `button-end-text` | string | `"End call"` | Button text when connected |
|
|
546
|
+
| `button-connecting-text` | string | `"Connecting..."` | Button text when connecting |
|
|
547
|
+
| `orb-size` | number | `48` | Orb diameter in pixels |
|
|
548
|
+
| `theme` | string | `"default"` | Theme name - see Themes section |
|
|
549
|
+
| `theme-mode` | string | `"auto"` | Theme mode: `"auto"`, `"dark"`, or `"light"` |
|
|
550
|
+
|
|
551
|
+
#### Example
|
|
552
|
+
|
|
553
|
+
```html
|
|
554
|
+
<!-- Bottom-right corner (default) -->
|
|
555
|
+
<hanc-ai-pill-floating-call
|
|
556
|
+
agent-id="YOUR_AGENT_ID"
|
|
557
|
+
position="bottom-right"
|
|
558
|
+
button-start-text="Chat with AI"
|
|
559
|
+
></hanc-ai-pill-floating-call>
|
|
560
|
+
|
|
561
|
+
<!-- Top-left corner with custom orb size -->
|
|
562
|
+
<hanc-ai-pill-floating-call
|
|
563
|
+
agent-id="YOUR_AGENT_ID"
|
|
564
|
+
position="top-left"
|
|
565
|
+
orb-size="56"
|
|
566
|
+
button-start-text="Need help?"
|
|
567
|
+
></hanc-ai-pill-floating-call>
|
|
568
|
+
|
|
569
|
+
<!-- Static positioning (for custom layouts) -->
|
|
570
|
+
<hanc-ai-pill-floating-call
|
|
571
|
+
agent-id="YOUR_AGENT_ID"
|
|
572
|
+
position="static"
|
|
573
|
+
theme="emerald"
|
|
574
|
+
></hanc-ai-pill-floating-call>
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
472
579
|
## Color Presets
|
|
473
580
|
|
|
474
581
|
The library includes professional color presets optimized for dark and light backgrounds.
|