@realtimexsco/live-chat 1.5.3 → 1.5.5

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/index.d.mts CHANGED
@@ -1921,7 +1921,7 @@ type AdminFeatureKey = "audioCall" | "videoCall" | "pushNotification" | "blockUs
1921
1921
  */
1922
1922
  declare function useAdminFeatureGate(feature: AdminFeatureKey): CallFeatureGate;
1923
1923
 
1924
- declare const CallOverlay: () => React__default.ReactPortal | null;
1924
+ declare const CallOverlay: () => React__default.JSX.Element | null;
1925
1925
 
1926
1926
  interface IncomingCallDialogProps {
1927
1927
  /** Looped while the dialog is open. Omit for silent ringing. */
@@ -1989,6 +1989,16 @@ interface CallEndedPayload extends CallSummary {
1989
1989
  interface CallBusyPayload extends CallSummary {
1990
1990
  userId: string;
1991
1991
  }
1992
+ /**
1993
+ * Group calls only (CALLS_API.md §3.1/§3.2): call_end from a group member
1994
+ * is a *leave*, not a full hangup — the call keeps going for whoever's
1995
+ * left. `activeParticipants` is the authoritative "who's still on this
1996
+ * call" list; the call only becomes call_ended once that drops below two.
1997
+ */
1998
+ interface CallParticipantLeftPayload extends CallSummary {
1999
+ userId: string;
2000
+ activeParticipants: string[];
2001
+ }
1992
2002
  interface CallHistoryEntry {
1993
2003
  _id: string;
1994
2004
  conversationId: string;
@@ -2027,19 +2037,22 @@ interface CallState {
2027
2037
  caller: CallParticipantSummary | null;
2028
2038
  participants: string[];
2029
2039
  error: string | null;
2030
- /** Caller side only — the channel being called, for the "Calling {name}" screen. */
2031
- callee: CallPeer | null;
2040
+ /** Who/what to display for this call — the other person for a DM, the
2041
+ * group for a group call. Set by startCall() (caller) or resolved from
2042
+ * the conversation list on _receiveIncoming (callee). */
2043
+ peer: CallPeer | null;
2044
+ isGroupCall: boolean;
2032
2045
  /** Set on transition to in-call. Display-only (duration timer), not billing-accurate. */
2033
2046
  callStartedAt: number | null;
2034
2047
  /** Caller: create the room and start ringing everyone else. */
2035
- startCall: (conversationId: string, mode: CallMode, callee?: CallPeer) => Promise<void>;
2048
+ startCall: (conversationId: string, mode: CallMode, peer?: CallPeer, isGroupCall?: boolean) => Promise<void>;
2036
2049
  /** Caller: stop ringing before anyone accepted. */
2037
2050
  cancelCall: () => void;
2038
2051
  /** Callee: accept the ringing call and fetch a join token. */
2039
2052
  acceptCall: () => Promise<void>;
2040
2053
  /** Callee: decline the ringing call. */
2041
2054
  rejectCall: (reason?: string) => void;
2042
- /** Either side: leave/end a live call. */
2055
+ /** Either side: leave/end a live call (group calls: leave, others continue). */
2043
2056
  endCall: () => void;
2044
2057
  /** Drop back to idle without notifying anyone (e.g. after a fatal error). */
2045
2058
  reset: () => void;
@@ -2057,6 +2070,7 @@ interface CallState {
2057
2070
  _receiveRejected: (payload: CallRejectedPayload) => void;
2058
2071
  _receiveCancelled: (payload: CallCancelledPayload) => void;
2059
2072
  _receiveEnded: (payload: CallEndedPayload) => void;
2073
+ _receiveParticipantLeft: (payload: CallParticipantLeftPayload) => void;
2060
2074
  _receiveBusy: (payload: CallBusyPayload) => void;
2061
2075
  _receiveMissed: (payload: CallSummary) => void;
2062
2076
  }
package/dist/index.d.ts CHANGED
@@ -1921,7 +1921,7 @@ type AdminFeatureKey = "audioCall" | "videoCall" | "pushNotification" | "blockUs
1921
1921
  */
1922
1922
  declare function useAdminFeatureGate(feature: AdminFeatureKey): CallFeatureGate;
1923
1923
 
1924
- declare const CallOverlay: () => React__default.ReactPortal | null;
1924
+ declare const CallOverlay: () => React__default.JSX.Element | null;
1925
1925
 
1926
1926
  interface IncomingCallDialogProps {
1927
1927
  /** Looped while the dialog is open. Omit for silent ringing. */
@@ -1989,6 +1989,16 @@ interface CallEndedPayload extends CallSummary {
1989
1989
  interface CallBusyPayload extends CallSummary {
1990
1990
  userId: string;
1991
1991
  }
1992
+ /**
1993
+ * Group calls only (CALLS_API.md §3.1/§3.2): call_end from a group member
1994
+ * is a *leave*, not a full hangup — the call keeps going for whoever's
1995
+ * left. `activeParticipants` is the authoritative "who's still on this
1996
+ * call" list; the call only becomes call_ended once that drops below two.
1997
+ */
1998
+ interface CallParticipantLeftPayload extends CallSummary {
1999
+ userId: string;
2000
+ activeParticipants: string[];
2001
+ }
1992
2002
  interface CallHistoryEntry {
1993
2003
  _id: string;
1994
2004
  conversationId: string;
@@ -2027,19 +2037,22 @@ interface CallState {
2027
2037
  caller: CallParticipantSummary | null;
2028
2038
  participants: string[];
2029
2039
  error: string | null;
2030
- /** Caller side only — the channel being called, for the "Calling {name}" screen. */
2031
- callee: CallPeer | null;
2040
+ /** Who/what to display for this call — the other person for a DM, the
2041
+ * group for a group call. Set by startCall() (caller) or resolved from
2042
+ * the conversation list on _receiveIncoming (callee). */
2043
+ peer: CallPeer | null;
2044
+ isGroupCall: boolean;
2032
2045
  /** Set on transition to in-call. Display-only (duration timer), not billing-accurate. */
2033
2046
  callStartedAt: number | null;
2034
2047
  /** Caller: create the room and start ringing everyone else. */
2035
- startCall: (conversationId: string, mode: CallMode, callee?: CallPeer) => Promise<void>;
2048
+ startCall: (conversationId: string, mode: CallMode, peer?: CallPeer, isGroupCall?: boolean) => Promise<void>;
2036
2049
  /** Caller: stop ringing before anyone accepted. */
2037
2050
  cancelCall: () => void;
2038
2051
  /** Callee: accept the ringing call and fetch a join token. */
2039
2052
  acceptCall: () => Promise<void>;
2040
2053
  /** Callee: decline the ringing call. */
2041
2054
  rejectCall: (reason?: string) => void;
2042
- /** Either side: leave/end a live call. */
2055
+ /** Either side: leave/end a live call (group calls: leave, others continue). */
2043
2056
  endCall: () => void;
2044
2057
  /** Drop back to idle without notifying anyone (e.g. after a fatal error). */
2045
2058
  reset: () => void;
@@ -2057,6 +2070,7 @@ interface CallState {
2057
2070
  _receiveRejected: (payload: CallRejectedPayload) => void;
2058
2071
  _receiveCancelled: (payload: CallCancelledPayload) => void;
2059
2072
  _receiveEnded: (payload: CallEndedPayload) => void;
2073
+ _receiveParticipantLeft: (payload: CallParticipantLeftPayload) => void;
2060
2074
  _receiveBusy: (payload: CallBusyPayload) => void;
2061
2075
  _receiveMissed: (payload: CallSummary) => void;
2062
2076
  }