hanc-webrtc-widgets 2.3.2 → 2.4.1
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/dist/hanc-webrtc-widgets.es.js +32484 -16354
- package/dist/hanc-webrtc-widgets.umd.js +341 -310
- package/dist/src/components/floating-call/floating-call.d.ts +0 -35
- package/dist/src/components/inline-call/inline-call.d.ts +0 -36
- package/dist/src/components/pill-call/pill-call.d.ts +0 -35
- package/dist/src/core/livekit-call-manager.d.ts +6 -59
- package/package.json +2 -1
- package/dist/src/core/health-monitor.d.ts +0 -27
|
@@ -3,24 +3,16 @@ import { OrbColors, SoundPreset } from '../../core/orb';
|
|
|
3
3
|
export declare class FloatingCall extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
private callManager;
|
|
6
|
-
private healthMonitor;
|
|
7
6
|
private orbRenderer;
|
|
8
7
|
private audioAnalyzer;
|
|
9
8
|
private soundManager;
|
|
10
9
|
private orbContainerRef;
|
|
11
10
|
private animationId;
|
|
12
|
-
private pendingTimers;
|
|
13
|
-
private isPageVisible;
|
|
14
|
-
private boundHandleVisibilityChange;
|
|
15
|
-
private animationStartTime;
|
|
16
|
-
private intersectionObserver;
|
|
17
|
-
private isOrbInitialized;
|
|
18
11
|
agentId: string;
|
|
19
12
|
voiceServiceUrl?: string;
|
|
20
13
|
private callStatus;
|
|
21
14
|
private microphoneEnabled;
|
|
22
15
|
private microphoneInitialized;
|
|
23
|
-
private serviceUnavailable;
|
|
24
16
|
buttonStartText: string;
|
|
25
17
|
buttonConnectingText: string;
|
|
26
18
|
position: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' | 'static';
|
|
@@ -42,35 +34,9 @@ export declare class FloatingCall extends LitElement {
|
|
|
42
34
|
soundEnabled: boolean;
|
|
43
35
|
soundVolume: number;
|
|
44
36
|
soundPreset: SoundPreset;
|
|
45
|
-
constructor();
|
|
46
37
|
connectedCallback(): void;
|
|
47
38
|
disconnectedCallback(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Handle page visibility change (critical for iOS Safari)
|
|
50
|
-
*/
|
|
51
|
-
private handleVisibilityChange;
|
|
52
|
-
/**
|
|
53
|
-
* Stop animation loop (for page visibility)
|
|
54
|
-
*/
|
|
55
|
-
private stopAnimation;
|
|
56
|
-
/**
|
|
57
|
-
* Resume animation based on current state
|
|
58
|
-
*/
|
|
59
|
-
private resumeAnimation;
|
|
60
|
-
/**
|
|
61
|
-
* Schedule a timer that will be automatically cleaned up on disconnect
|
|
62
|
-
*/
|
|
63
|
-
private scheduleTimer;
|
|
64
|
-
/**
|
|
65
|
-
* Clear all pending timers
|
|
66
|
-
*/
|
|
67
|
-
private clearAllTimers;
|
|
68
39
|
firstUpdated(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Setup IntersectionObserver for lazy OrbRenderer initialization
|
|
71
|
-
* This significantly improves page load time when multiple widgets are present
|
|
72
|
-
*/
|
|
73
|
-
private setupLazyInitialization;
|
|
74
40
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
75
41
|
private applyTheme;
|
|
76
42
|
private initializeOrb;
|
|
@@ -81,7 +47,6 @@ export declare class FloatingCall extends LitElement {
|
|
|
81
47
|
private handleLocalAudioTrack;
|
|
82
48
|
private handleMicrophoneEnabled;
|
|
83
49
|
private handleMicrophoneDisabled;
|
|
84
|
-
private handleHealthChange;
|
|
85
50
|
private handleStatusChange;
|
|
86
51
|
private toggleCall;
|
|
87
52
|
private getButtonIcon;
|
|
@@ -3,25 +3,16 @@ import { OrbColors, SoundPreset } from '../../core/orb';
|
|
|
3
3
|
export declare class InlineCall extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
private callManager;
|
|
6
|
-
private healthMonitor;
|
|
7
6
|
private orbRenderer;
|
|
8
7
|
private audioAnalyzer;
|
|
9
8
|
private soundManager;
|
|
10
9
|
private orbContainerRef;
|
|
11
10
|
private animationId;
|
|
12
|
-
private pendingTimers;
|
|
13
|
-
private isPageVisible;
|
|
14
|
-
private boundHandleVisibilityChange;
|
|
15
|
-
private animationStartTime;
|
|
16
|
-
private intersectionObserver;
|
|
17
|
-
private isOrbInitialized;
|
|
18
|
-
private intersectionTimeoutId;
|
|
19
11
|
agentId: string;
|
|
20
12
|
voiceServiceUrl?: string;
|
|
21
13
|
private callStatus;
|
|
22
14
|
private microphoneEnabled;
|
|
23
15
|
private microphoneInitialized;
|
|
24
|
-
private serviceUnavailable;
|
|
25
16
|
buttonStartText: string;
|
|
26
17
|
buttonConnectingText: string;
|
|
27
18
|
size: number;
|
|
@@ -43,35 +34,9 @@ export declare class InlineCall extends LitElement {
|
|
|
43
34
|
soundEnabled: boolean;
|
|
44
35
|
soundVolume: number;
|
|
45
36
|
soundPreset: SoundPreset;
|
|
46
|
-
constructor();
|
|
47
37
|
connectedCallback(): void;
|
|
48
38
|
disconnectedCallback(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Handle page visibility change (critical for iOS Safari)
|
|
51
|
-
*/
|
|
52
|
-
private handleVisibilityChange;
|
|
53
|
-
/**
|
|
54
|
-
* Stop animation loop (for page visibility)
|
|
55
|
-
*/
|
|
56
|
-
private stopAnimation;
|
|
57
|
-
/**
|
|
58
|
-
* Resume animation based on current state
|
|
59
|
-
*/
|
|
60
|
-
private resumeAnimation;
|
|
61
|
-
/**
|
|
62
|
-
* Schedule a timer that will be automatically cleaned up on disconnect
|
|
63
|
-
*/
|
|
64
|
-
private scheduleTimer;
|
|
65
|
-
/**
|
|
66
|
-
* Clear all pending timers
|
|
67
|
-
*/
|
|
68
|
-
private clearAllTimers;
|
|
69
39
|
firstUpdated(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Setup IntersectionObserver for lazy OrbRenderer initialization
|
|
72
|
-
* This significantly improves page load time when multiple widgets are present
|
|
73
|
-
*/
|
|
74
|
-
private setupLazyInitialization;
|
|
75
40
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
76
41
|
private applyTheme;
|
|
77
42
|
private initializeOrb;
|
|
@@ -82,7 +47,6 @@ export declare class InlineCall extends LitElement {
|
|
|
82
47
|
private handleLocalAudioTrack;
|
|
83
48
|
private handleMicrophoneEnabled;
|
|
84
49
|
private handleMicrophoneDisabled;
|
|
85
|
-
private handleHealthChange;
|
|
86
50
|
private handleStatusChange;
|
|
87
51
|
private toggleCall;
|
|
88
52
|
private getButtonIcon;
|
|
@@ -3,24 +3,16 @@ import { OrbColors, SoundPreset } from '../../core/orb';
|
|
|
3
3
|
export declare class PillCall extends LitElement {
|
|
4
4
|
static styles: import('lit').CSSResult;
|
|
5
5
|
private callManager;
|
|
6
|
-
private healthMonitor;
|
|
7
6
|
private orbRenderer;
|
|
8
7
|
private audioAnalyzer;
|
|
9
8
|
private soundManager;
|
|
10
9
|
private orbContainerRef;
|
|
11
10
|
private animationId;
|
|
12
|
-
private pendingTimers;
|
|
13
|
-
private isPageVisible;
|
|
14
|
-
private boundHandleVisibilityChange;
|
|
15
|
-
private animationStartTime;
|
|
16
|
-
private intersectionObserver;
|
|
17
|
-
private isOrbInitialized;
|
|
18
11
|
agentId: string;
|
|
19
12
|
voiceServiceUrl?: string;
|
|
20
13
|
private callStatus;
|
|
21
14
|
private microphoneEnabled;
|
|
22
15
|
private microphoneInitialized;
|
|
23
|
-
private serviceUnavailable;
|
|
24
16
|
buttonStartText: string;
|
|
25
17
|
buttonConnectingText: string;
|
|
26
18
|
buttonEndText: string;
|
|
@@ -42,35 +34,9 @@ export declare class PillCall extends LitElement {
|
|
|
42
34
|
soundEnabled: boolean;
|
|
43
35
|
soundVolume: number;
|
|
44
36
|
soundPreset: SoundPreset;
|
|
45
|
-
constructor();
|
|
46
37
|
connectedCallback(): void;
|
|
47
38
|
disconnectedCallback(): void;
|
|
48
|
-
/**
|
|
49
|
-
* Handle page visibility change (critical for iOS Safari)
|
|
50
|
-
*/
|
|
51
|
-
private handleVisibilityChange;
|
|
52
|
-
/**
|
|
53
|
-
* Stop animation loop (for page visibility)
|
|
54
|
-
*/
|
|
55
|
-
private stopAnimation;
|
|
56
|
-
/**
|
|
57
|
-
* Resume animation based on current state
|
|
58
|
-
*/
|
|
59
|
-
private resumeAnimation;
|
|
60
|
-
/**
|
|
61
|
-
* Schedule a timer that will be automatically cleaned up on disconnect
|
|
62
|
-
*/
|
|
63
|
-
private scheduleTimer;
|
|
64
|
-
/**
|
|
65
|
-
* Clear all pending timers
|
|
66
|
-
*/
|
|
67
|
-
private clearAllTimers;
|
|
68
39
|
firstUpdated(): void;
|
|
69
|
-
/**
|
|
70
|
-
* Setup IntersectionObserver for lazy OrbRenderer initialization
|
|
71
|
-
* This significantly improves page load time when multiple widgets are present
|
|
72
|
-
*/
|
|
73
|
-
private setupLazyInitialization;
|
|
74
40
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
75
41
|
private applyTheme;
|
|
76
42
|
private initializeOrb;
|
|
@@ -81,7 +47,6 @@ export declare class PillCall extends LitElement {
|
|
|
81
47
|
private handleLocalAudioTrack;
|
|
82
48
|
private handleMicrophoneEnabled;
|
|
83
49
|
private handleMicrophoneDisabled;
|
|
84
|
-
private handleHealthChange;
|
|
85
50
|
private handleStatusChange;
|
|
86
51
|
private toggleCall;
|
|
87
52
|
private getButtonIcon;
|
|
@@ -53,66 +53,9 @@ export declare class LiveKitCallManager extends EventTarget {
|
|
|
53
53
|
private userIdentity;
|
|
54
54
|
private roomName;
|
|
55
55
|
private audioPlaybackPrompt;
|
|
56
|
-
private audioElements;
|
|
57
|
-
private audioContainer;
|
|
58
|
-
private wasConnectedBeforeHidden;
|
|
59
|
-
private isPageVisible;
|
|
60
|
-
private reconnectAttempts;
|
|
61
|
-
private maxReconnectAttempts;
|
|
62
|
-
private isReconnecting;
|
|
63
|
-
private isDestroyed;
|
|
64
|
-
private pendingTimers;
|
|
65
|
-
private boundHandleVisibilityChange;
|
|
66
|
-
private boundHandlePageHide;
|
|
67
|
-
private boundHandlePageShow;
|
|
68
|
-
private boundHandleOnline;
|
|
69
|
-
private boundHandleOffline;
|
|
70
56
|
private readonly isAppleDevice;
|
|
71
|
-
|
|
72
|
-
private
|
|
73
|
-
/**
|
|
74
|
-
* Schedule a timer that will be automatically cleaned up on destroy
|
|
75
|
-
*/
|
|
76
|
-
private scheduleTimer;
|
|
77
|
-
/**
|
|
78
|
-
* Clear all pending timers
|
|
79
|
-
*/
|
|
80
|
-
private clearAllTimers;
|
|
81
|
-
private setupLifecycleListeners;
|
|
82
|
-
private removeLifecycleListeners;
|
|
83
|
-
private handleVisibilityChange;
|
|
84
|
-
private handlePageHide;
|
|
85
|
-
private handlePageShow;
|
|
86
|
-
private handleOnline;
|
|
87
|
-
private handleOffline;
|
|
88
|
-
private pauseAllAudio;
|
|
89
|
-
private resumeAllAudio;
|
|
90
|
-
private resumeAfterVisibilityChange;
|
|
91
|
-
private attemptReconnect;
|
|
92
|
-
/**
|
|
93
|
-
* Clean up room without full destroy
|
|
94
|
-
*/
|
|
95
|
-
private cleanupRoom;
|
|
96
|
-
private cleanupBeforeUnload;
|
|
97
|
-
private cleanupAudioElements;
|
|
98
|
-
/**
|
|
99
|
-
* Remove the audio container from DOM
|
|
100
|
-
*/
|
|
101
|
-
private removeAudioContainer;
|
|
102
|
-
destroy(): void;
|
|
103
|
-
/**
|
|
104
|
-
* Attempt to play audio element with iOS Safari handling
|
|
105
|
-
* Returns true if played successfully, false if blocked
|
|
106
|
-
*/
|
|
107
|
-
private playAudioElement;
|
|
108
|
-
/**
|
|
109
|
-
* Fetch with timeout - prevents hanging on slow iOS connections
|
|
110
|
-
*/
|
|
111
|
-
private fetchWithTimeout;
|
|
112
|
-
/**
|
|
113
|
-
* Connect with timeout - prevents hanging on iOS
|
|
114
|
-
*/
|
|
115
|
-
private connectWithTimeout;
|
|
57
|
+
private krispFilter;
|
|
58
|
+
private krispSupported;
|
|
116
59
|
set serviceUrl(url: string | undefined);
|
|
117
60
|
get serviceUrl(): string;
|
|
118
61
|
get status(): CallStatus;
|
|
@@ -127,6 +70,10 @@ export declare class LiveKitCallManager extends EventTarget {
|
|
|
127
70
|
private updateStatus;
|
|
128
71
|
makeCall({ agentId }: MakeCallOptions): Promise<void>;
|
|
129
72
|
private setupRoomEventListeners;
|
|
73
|
+
/**
|
|
74
|
+
* Apply Krisp noise filter to local audio track
|
|
75
|
+
*/
|
|
76
|
+
private applyKrispFilter;
|
|
130
77
|
toggleMicrophone(): Promise<void>;
|
|
131
78
|
enableAudio(): Promise<void>;
|
|
132
79
|
hangUp(): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hanc-webrtc-widgets",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/hanc-webrtc-widgets.umd.js",
|
|
6
6
|
"module": "dist/hanc-webrtc-widgets.es.js",
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"@livekit/krisp-noise-filter": "^0.2.16",
|
|
16
17
|
"lit": "^3.2.1",
|
|
17
18
|
"livekit-client": "^2.15.6",
|
|
18
19
|
"three": "^0.182.0"
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Background Health Monitor (Singleton)
|
|
3
|
-
*
|
|
4
|
-
* Polls the voice service health endpoint every 30 seconds and maintains
|
|
5
|
-
* an in-memory health status flag. Widget components read this flag
|
|
6
|
-
* before initiating calls to avoid unnecessary latency.
|
|
7
|
-
*
|
|
8
|
-
* Uses reference counting - multiple widgets share one monitor instance.
|
|
9
|
-
*
|
|
10
|
-
* Events Emitted:
|
|
11
|
-
* - 'health-changed': When health status transitions between states
|
|
12
|
-
*/
|
|
13
|
-
export type HealthStatus = 'unknown' | 'healthy' | 'unhealthy';
|
|
14
|
-
/**
|
|
15
|
-
* HealthMonitor wrapper that uses the shared singleton
|
|
16
|
-
* Provides the same API as before for backwards compatibility
|
|
17
|
-
*/
|
|
18
|
-
export declare class HealthMonitor {
|
|
19
|
-
get isHealthy(): boolean;
|
|
20
|
-
get status(): HealthStatus;
|
|
21
|
-
set serviceUrl(url: string);
|
|
22
|
-
get serviceUrl(): string;
|
|
23
|
-
start(): void;
|
|
24
|
-
stop(): void;
|
|
25
|
-
addEventListener(type: string, listener: (e: Event) => void): void;
|
|
26
|
-
removeEventListener(type: string, listener: (e: Event) => void): void;
|
|
27
|
-
}
|