@scalemule/conference 0.0.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/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +53 -0
- package/dist/assets/sounds.d.ts +12 -0
- package/dist/assets/sounds.d.ts.map +1 -0
- package/dist/core/ConferenceClient.d.ts +103 -0
- package/dist/core/ConferenceClient.d.ts.map +1 -0
- package/dist/index.cjs +171 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +168 -0
- package/dist/react/CallButton.d.ts +22 -0
- package/dist/react/CallButton.d.ts.map +1 -0
- package/dist/react/CallControls.d.ts +17 -0
- package/dist/react/CallControls.d.ts.map +1 -0
- package/dist/react/CallOverlay.d.ts +30 -0
- package/dist/react/CallOverlay.d.ts.map +1 -0
- package/dist/react/CallWindow.d.ts +10 -0
- package/dist/react/CallWindow.d.ts.map +1 -0
- package/dist/react/HuddleBar.d.ts +25 -0
- package/dist/react/HuddleBar.d.ts.map +1 -0
- package/dist/react/PreCallLobby.d.ts +22 -0
- package/dist/react/PreCallLobby.d.ts.map +1 -0
- package/dist/react/useConference.d.ts +37 -0
- package/dist/react/useConference.d.ts.map +1 -0
- package/dist/react/useDevices.d.ts +28 -0
- package/dist/react/useDevices.d.ts.map +1 -0
- package/dist/react/useIncomingCalls.d.ts +34 -0
- package/dist/react/useIncomingCalls.d.ts.map +1 -0
- package/dist/react.cjs +1004 -0
- package/dist/react.d.ts +18 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +990 -0
- package/dist/transport.d.ts +21 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CallSession } from '../core/ConferenceClient';
|
|
3
|
+
export interface HuddleBarProps {
|
|
4
|
+
session: CallSession;
|
|
5
|
+
/** Called when the user disconnects or leaves. */
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
/** Called when a media session error occurs. */
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
/** Token refresh callback — called ~30s before expiry. */
|
|
10
|
+
onTokenRefresh?: () => Promise<CallSession>;
|
|
11
|
+
/** Call type label shown in the bar. */
|
|
12
|
+
callType?: 'audio' | 'video';
|
|
13
|
+
/** Participant display names (keyed by userId). */
|
|
14
|
+
participantNames?: Record<string, string>;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Persistent bottom huddle bar (Slack-style).
|
|
20
|
+
*
|
|
21
|
+
* Renders a fixed-position bar at the bottom of the viewport showing
|
|
22
|
+
* call status, duration, and inline controls (mute, camera, leave).
|
|
23
|
+
*/
|
|
24
|
+
export declare function HuddleBar({ session, onClose, onError, onTokenRefresh, callType, participantNames, style, className, }: HuddleBarProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=HuddleBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HuddleBar.d.ts","sourceRoot":"","sources":["../../src/react/HuddleBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gDAAgD;IAChD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,0DAA0D;IAC1D,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IAC5C,wCAAwC;IACxC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAmCD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,OAAO,EACP,OAAO,EACP,cAAc,EACd,QAAkB,EAClB,gBAAgB,EAChB,KAAK,EACL,SAAS,GACV,EAAE,cAAc,2CAkJhB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PreCallLobbyProps {
|
|
3
|
+
callType?: 'audio' | 'video';
|
|
4
|
+
onJoin: (options: {
|
|
5
|
+
audio: boolean;
|
|
6
|
+
video: boolean;
|
|
7
|
+
audioDeviceId?: string;
|
|
8
|
+
videoDeviceId?: string;
|
|
9
|
+
}) => void;
|
|
10
|
+
onCancel?: () => void;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Pre-call lobby with device preview and permission prompt.
|
|
16
|
+
*
|
|
17
|
+
* Shows a camera preview, microphone level indicator, and device selector
|
|
18
|
+
* dropdowns. Handles the full permission flow: checking → prompt → preview
|
|
19
|
+
* or denied.
|
|
20
|
+
*/
|
|
21
|
+
export declare function PreCallLobby({ callType, onJoin, onCancel, style, className, }: PreCallLobbyProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
//# sourceMappingURL=PreCallLobby.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PreCallLobby.d.ts","sourceRoot":"","sources":["../../src/react/PreCallLobby.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,MAAM,EAAE,CAAC,OAAO,EAAE;QAChB,KAAK,EAAE,OAAO,CAAC;QACf,KAAK,EAAE,OAAO,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,KAAK,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAkB,EAClB,MAAM,EACN,QAAQ,EACR,KAAK,EACL,SAAS,GACV,EAAE,iBAAiB,2CA2QnB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ConferenceClient } from '../core/ConferenceClient';
|
|
3
|
+
import type { CallSession } from '../core/ConferenceClient';
|
|
4
|
+
export type CallState = 'idle' | 'joining' | 'connected' | 'reconnecting' | 'ended';
|
|
5
|
+
interface ConferenceContextValue {
|
|
6
|
+
client: ConferenceClient;
|
|
7
|
+
activeSession: CallSession | null;
|
|
8
|
+
callState: CallState;
|
|
9
|
+
join: (callId: string) => Promise<void>;
|
|
10
|
+
leave: () => Promise<void>;
|
|
11
|
+
end: () => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
interface ConferenceProviderProps {
|
|
14
|
+
client: ConferenceClient;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Provides conference call state to the component tree.
|
|
19
|
+
*
|
|
20
|
+
* Receives a `ConferenceClient` instance (not raw config). This is an
|
|
21
|
+
* intentional divergence from chat SDK's `ChatProvider`, which takes config
|
|
22
|
+
* and constructs the client internally. For conference, the consumer
|
|
23
|
+
* constructs the client because:
|
|
24
|
+
* - Conference calls often go through a proxy (`/api/conference/...`)
|
|
25
|
+
* - The consumer may need to share the client instance with non-React code
|
|
26
|
+
* - It avoids hiding initialization behind the provider
|
|
27
|
+
*/
|
|
28
|
+
export declare function ConferenceProvider({ client, children }: ConferenceProviderProps): import("react").FunctionComponentElement<import("react").ProviderProps<ConferenceContextValue | null>>;
|
|
29
|
+
/**
|
|
30
|
+
* Access the conference call state from within a `<ConferenceProvider>`.
|
|
31
|
+
*
|
|
32
|
+
* Returns the `ConferenceClient`, active session, call state, and
|
|
33
|
+
* join/leave/end methods.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useConference(): ConferenceContextValue;
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=useConference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConference.d.ts","sourceRoot":"","sources":["../../src/react/useConference.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAM5D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,OAAO,CAAC;AAEpF,UAAU,sBAAsB;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,aAAa,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,SAAS,CAAC;IACrB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAID,UAAU,uBAAuB;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,uBAAuB,0GAmG/E;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,IAAI,sBAAsB,CAMtD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface DeviceInfo {
|
|
2
|
+
deviceId: string;
|
|
3
|
+
label: string;
|
|
4
|
+
kind: MediaDeviceKind;
|
|
5
|
+
}
|
|
6
|
+
export type PermissionState = 'prompt' | 'granted' | 'denied' | 'unknown';
|
|
7
|
+
export interface UseDevicesResult {
|
|
8
|
+
audioInputs: DeviceInfo[];
|
|
9
|
+
audioOutputs: DeviceInfo[];
|
|
10
|
+
videoInputs: DeviceInfo[];
|
|
11
|
+
selectedAudioInput: string | null;
|
|
12
|
+
selectedVideoInput: string | null;
|
|
13
|
+
selectAudioInput: (deviceId: string) => void;
|
|
14
|
+
selectVideoInput: (deviceId: string) => void;
|
|
15
|
+
permissionState: PermissionState;
|
|
16
|
+
requestPermission: (constraints?: MediaStreamConstraints) => Promise<MediaStream>;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Device enumeration hook for pre-call lobby and device selectors.
|
|
20
|
+
*
|
|
21
|
+
* Enumerates audio/video input and output devices, tracks permission state,
|
|
22
|
+
* and provides a `requestPermission()` method wrapping `getUserMedia`.
|
|
23
|
+
*
|
|
24
|
+
* Handles the Safari quirk where device labels are empty until permission
|
|
25
|
+
* is granted — re-enumerates after permission is acquired.
|
|
26
|
+
*/
|
|
27
|
+
export declare function useDevices(): UseDevicesResult;
|
|
28
|
+
//# sourceMappingURL=useDevices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDevices.d.ts","sourceRoot":"","sources":["../../src/react/useDevices.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1E,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,eAAe,EAAE,eAAe,CAAC;IACjC,iBAAiB,EAAE,CAAC,WAAW,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;CACnF;AAMD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,gBAAgB,CA+F7C"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ConferenceClient } from '../core/ConferenceClient';
|
|
2
|
+
import type { Call } from '../core/ConferenceClient';
|
|
3
|
+
export interface UseIncomingCallsOptions {
|
|
4
|
+
client: ConferenceClient;
|
|
5
|
+
/** Poll interval in ms (default: 5000). */
|
|
6
|
+
pollInterval?: number;
|
|
7
|
+
/** Only poll calls for these conversations. Omit for all. */
|
|
8
|
+
conversationIds?: string[];
|
|
9
|
+
/** Ignore calls created by this user (self-calls). */
|
|
10
|
+
currentUserId?: string;
|
|
11
|
+
/** Callback when a new call is detected (for sound/notification). */
|
|
12
|
+
onNewCall?: (call: Call) => void;
|
|
13
|
+
/** Disable polling entirely. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface UseIncomingCallsResult {
|
|
17
|
+
/** All active calls visible to the current user. */
|
|
18
|
+
activeCalls: Call[];
|
|
19
|
+
/** Whether polling is currently running. */
|
|
20
|
+
isPolling: boolean;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Cross-conversation call notification hook.
|
|
24
|
+
*
|
|
25
|
+
* Polls `GET /v1/conference/calls?status=active` to detect active calls
|
|
26
|
+
* across all conversations the user participates in. Deduplicates by
|
|
27
|
+
* `call.id` to avoid re-triggering `onNewCall` for previously seen calls.
|
|
28
|
+
*
|
|
29
|
+
* Pauses when `document.hidden` (tab not visible) or `disabled` is true.
|
|
30
|
+
*
|
|
31
|
+
* Replaces the per-conversation `useActiveCall` pattern with a global view.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useIncomingCalls(options: UseIncomingCallsOptions): UseIncomingCallsResult;
|
|
34
|
+
//# sourceMappingURL=useIncomingCalls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIncomingCalls.d.ts","sourceRoot":"","sources":["../../src/react/useIncomingCalls.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,gBAAgB,CAAC;IACzB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAC;IACjC,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,oDAAoD;IACpD,WAAW,EAAE,IAAI,EAAE,CAAC;IACpB,4CAA4C;IAC5C,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,GAAG,sBAAsB,CA8EzF"}
|