hanc-webrtc-widgets 1.3.1 → 1.4.0
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 +30 -0
- package/dist/hanc-webrtc-widgets.es.js +13 -5
- package/dist/hanc-webrtc-widgets.umd.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -50,12 +50,20 @@ export const HancAiInlineCall = createComponent({
|
|
|
50
50
|
tagName: 'hanc-ai-inline-call',
|
|
51
51
|
elementClass: InlineCall,
|
|
52
52
|
react: React,
|
|
53
|
+
events: {
|
|
54
|
+
onCallStart: 'call-start',
|
|
55
|
+
onCallEnd: 'call-end',
|
|
56
|
+
},
|
|
53
57
|
});
|
|
54
58
|
|
|
55
59
|
export const HancAiFloatingCall = createComponent({
|
|
56
60
|
tagName: 'hanc-ai-floating-call',
|
|
57
61
|
elementClass: FloatingCall,
|
|
58
62
|
react: React,
|
|
63
|
+
events: {
|
|
64
|
+
onCallStart: 'call-start',
|
|
65
|
+
onCallEnd: 'call-end',
|
|
66
|
+
},
|
|
59
67
|
});
|
|
60
68
|
|
|
61
69
|
// An example of a component where both widgets are used
|
|
@@ -94,6 +102,10 @@ export const HancAiInlineCall = dynamic(
|
|
|
94
102
|
tagName: 'hanc-ai-inline-call',
|
|
95
103
|
elementClass: InlineCall,
|
|
96
104
|
react: React,
|
|
105
|
+
events: {
|
|
106
|
+
onCallStart: 'call-start',
|
|
107
|
+
onCallEnd: 'call-end',
|
|
108
|
+
},
|
|
97
109
|
});
|
|
98
110
|
},
|
|
99
111
|
{ ssr: false },
|
|
@@ -107,6 +119,10 @@ export const HancAiFloatingCall = dynamic(
|
|
|
107
119
|
tagName: 'hanc-ai-floating-call',
|
|
108
120
|
elementClass: FloatingCall,
|
|
109
121
|
react: React,
|
|
122
|
+
events: {
|
|
123
|
+
onCallStart: 'call-start',
|
|
124
|
+
onCallEnd: 'call-end',
|
|
125
|
+
},
|
|
110
126
|
});
|
|
111
127
|
},
|
|
112
128
|
{ ssr: false },
|
|
@@ -138,6 +154,13 @@ An “inline” widget that you embed directly in page content (often as a hero
|
|
|
138
154
|
| `button-start-text` | string | Custom start button text (default: `Start Call with ai`) |
|
|
139
155
|
| `button-connecting-text` | string | Custom connecting button text (default: `Connecting...`) |
|
|
140
156
|
|
|
157
|
+
#### Available Events:
|
|
158
|
+
|
|
159
|
+
| Event Name | Description |
|
|
160
|
+
| ------------ | ------------------------------------------------------------ |
|
|
161
|
+
| `call-start` | Fired when a call is successfully connected and starts. |
|
|
162
|
+
| `call-end` | Fired when a call ends, either by hangup or due to an error. |
|
|
163
|
+
|
|
141
164
|
#### Available CSS Parts for Styling:
|
|
142
165
|
|
|
143
166
|
| Part Name | Description |
|
|
@@ -193,6 +216,13 @@ A persistent, docked widget that floats in the corner and launches the same voic
|
|
|
193
216
|
| `button-connecting-text` | string | Custom connecting button text (default: `Connecting...`) |
|
|
194
217
|
| `button-end-text` | string | End button text (default: `End call`) |
|
|
195
218
|
|
|
219
|
+
#### Available Events:
|
|
220
|
+
|
|
221
|
+
| Event Name | Description |
|
|
222
|
+
| ------------ | ------------------------------------------------------------ |
|
|
223
|
+
| `call-start` | Fired when a call is successfully connected and starts. |
|
|
224
|
+
| `call-end` | Fired when a call ends, either by hangup or due to an error. |
|
|
225
|
+
|
|
196
226
|
#### Available CSS Parts for Styling:
|
|
197
227
|
|
|
198
228
|
| Part Name | Description |
|
|
@@ -17084,7 +17084,7 @@ class Po extends EventTarget {
|
|
|
17084
17084
|
this._serviceUrl = e;
|
|
17085
17085
|
}
|
|
17086
17086
|
get serviceUrl() {
|
|
17087
|
-
return this._serviceUrl ?? "https://
|
|
17087
|
+
return this._serviceUrl ?? "https://voice.dev.hanc.me";
|
|
17088
17088
|
}
|
|
17089
17089
|
get status() {
|
|
17090
17090
|
return this.callStatus;
|
|
@@ -17347,11 +17347,15 @@ let Je = class extends gt {
|
|
|
17347
17347
|
this.callStatus = "connecting";
|
|
17348
17348
|
break;
|
|
17349
17349
|
case "connected":
|
|
17350
|
-
this.callStatus = "connected"
|
|
17350
|
+
this.callStatus = "connected", this.dispatchEvent(
|
|
17351
|
+
new Event("call-start", { bubbles: !0, composed: !0 })
|
|
17352
|
+
);
|
|
17351
17353
|
break;
|
|
17352
17354
|
case "disconnected":
|
|
17353
17355
|
case "error":
|
|
17354
|
-
this.callStatus = "idle"
|
|
17356
|
+
this.callStatus = "idle", this.dispatchEvent(
|
|
17357
|
+
new Event("call-end", { bubbles: !0, composed: !0 })
|
|
17358
|
+
);
|
|
17355
17359
|
break;
|
|
17356
17360
|
}
|
|
17357
17361
|
}, this.toggleCall = async () => {
|
|
@@ -17603,11 +17607,15 @@ let we = class extends gt {
|
|
|
17603
17607
|
this.callStatus = "connecting";
|
|
17604
17608
|
break;
|
|
17605
17609
|
case "connected":
|
|
17606
|
-
this.callStatus = "connected"
|
|
17610
|
+
this.callStatus = "connected", this.dispatchEvent(
|
|
17611
|
+
new Event("call-start", { bubbles: !0, composed: !0 })
|
|
17612
|
+
);
|
|
17607
17613
|
break;
|
|
17608
17614
|
case "disconnected":
|
|
17609
17615
|
case "error":
|
|
17610
|
-
this.callStatus = "idle"
|
|
17616
|
+
this.callStatus = "idle", this.dispatchEvent(
|
|
17617
|
+
new Event("call-end", { bubbles: !0, composed: !0 })
|
|
17618
|
+
);
|
|
17611
17619
|
break;
|
|
17612
17620
|
}
|
|
17613
17621
|
}, this.toggleCall = async () => {
|