@cometchat/calls-sdk-react-native 5.0.0-beta.7 → 5.0.0-beta.9
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 +42 -9
- package/dist/index.d.ts +42 -9
- package/dist/index.js +101 -80
- package/dist/index.mjs +101 -80
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import * as
|
|
2
|
+
import * as zustand0 from "zustand";
|
|
3
3
|
import * as zustand_middleware0 from "zustand/middleware";
|
|
4
4
|
import React from "react";
|
|
5
5
|
import JitsiMeetJS from "lib-jitsi-meet";
|
|
@@ -373,7 +373,7 @@ type Actions$5 = {
|
|
|
373
373
|
isMobileSDK: () => boolean;
|
|
374
374
|
isMobile: () => boolean;
|
|
375
375
|
};
|
|
376
|
-
declare const useBaseStore:
|
|
376
|
+
declare const useBaseStore: zustand0.UseBoundStore<Omit<Omit<zustand0.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
377
377
|
subscribe: {
|
|
378
378
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
379
379
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -453,7 +453,7 @@ type Actions$4 = {
|
|
|
453
453
|
endConference: () => Promise<void>;
|
|
454
454
|
stopRecording: () => Promise<void>;
|
|
455
455
|
};
|
|
456
|
-
declare const useConferenceStore:
|
|
456
|
+
declare const useConferenceStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
457
457
|
subscribe: {
|
|
458
458
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
459
459
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -524,12 +524,13 @@ type ConfigStateBoth = {
|
|
|
524
524
|
enableSpotlightDrag: boolean;
|
|
525
525
|
enableSpotlightSwap: boolean;
|
|
526
526
|
isPeerCall: boolean;
|
|
527
|
+
enableNotifications: boolean;
|
|
527
528
|
};
|
|
528
529
|
type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
|
|
529
530
|
type Actions$3 = {
|
|
530
531
|
reset: () => void;
|
|
531
532
|
};
|
|
532
|
-
declare const useConfigStore:
|
|
533
|
+
declare const useConfigStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
533
534
|
subscribe: {
|
|
534
535
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
535
536
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -681,7 +682,7 @@ type Actions$2 = {
|
|
|
681
682
|
disconnect: () => Promise<void>;
|
|
682
683
|
reset: () => void;
|
|
683
684
|
};
|
|
684
|
-
declare const useConnectionStore:
|
|
685
|
+
declare const useConnectionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
685
686
|
subscribe: {
|
|
686
687
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
687
688
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -732,7 +733,7 @@ type Actions$1 = {
|
|
|
732
733
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
733
734
|
reset: () => void;
|
|
734
735
|
};
|
|
735
|
-
declare const useParticipantStore:
|
|
736
|
+
declare const useParticipantStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
736
737
|
subscribe: {
|
|
737
738
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
738
739
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -754,6 +755,38 @@ declare const getMainParticipantFromState: (state: {
|
|
|
754
755
|
localParticipant: HumanParticipant;
|
|
755
756
|
}) => Participant$2;
|
|
756
757
|
//#endregion
|
|
758
|
+
//#region calls-sdk-core/store/toast.d.ts
|
|
759
|
+
interface ToastAction {
|
|
760
|
+
label: string;
|
|
761
|
+
onPress: () => void;
|
|
762
|
+
}
|
|
763
|
+
interface ToastItem {
|
|
764
|
+
id: string;
|
|
765
|
+
message: string;
|
|
766
|
+
type: NotificationType;
|
|
767
|
+
duration: number;
|
|
768
|
+
position: 'top' | 'bottom';
|
|
769
|
+
action?: ToastAction;
|
|
770
|
+
createdAt: number;
|
|
771
|
+
}
|
|
772
|
+
interface ToastState {
|
|
773
|
+
toasts: ToastItem[];
|
|
774
|
+
}
|
|
775
|
+
interface ToastActions {
|
|
776
|
+
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
|
|
777
|
+
removeToast: (id: string) => void;
|
|
778
|
+
clearAll: () => void;
|
|
779
|
+
reset: () => void;
|
|
780
|
+
}
|
|
781
|
+
declare const useToastStore: zustand0.UseBoundStore<zustand0.StoreApi<ToastState & ToastActions>>;
|
|
782
|
+
declare function showToast(params: {
|
|
783
|
+
message: string;
|
|
784
|
+
type?: NotificationType;
|
|
785
|
+
duration?: number;
|
|
786
|
+
position?: 'top' | 'bottom';
|
|
787
|
+
action?: ToastAction;
|
|
788
|
+
}): string;
|
|
789
|
+
//#endregion
|
|
757
790
|
//#region calls-sdk-core/store/tracks.d.ts
|
|
758
791
|
type Track = {
|
|
759
792
|
local: boolean;
|
|
@@ -778,7 +811,7 @@ type Actions = {
|
|
|
778
811
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
779
812
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
780
813
|
};
|
|
781
|
-
declare const useTracksStore:
|
|
814
|
+
declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
782
815
|
subscribe: {
|
|
783
816
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
784
817
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1270,7 +1303,7 @@ interface TranslationState {
|
|
|
1270
1303
|
translations: Record<string, typeof __json_default_export>;
|
|
1271
1304
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1272
1305
|
}
|
|
1273
|
-
declare const useTranslationStore:
|
|
1306
|
+
declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1274
1307
|
reset: () => void;
|
|
1275
1308
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1276
1309
|
}>, "subscribe"> & {
|
|
@@ -2660,7 +2693,7 @@ interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
|
|
|
2660
2693
|
/**
|
|
2661
2694
|
* @deprecated Use `sessionSettings` instead.
|
|
2662
2695
|
*/
|
|
2663
|
-
callSettings
|
|
2696
|
+
callSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2664
2697
|
sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2665
2698
|
}
|
|
2666
2699
|
declare function AppReactNativeSDK(props: AppProps): React.JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as zustand1 from "zustand";
|
|
2
2
|
import * as zustand_middleware0 from "zustand/middleware";
|
|
3
3
|
import { AppStateStatus } from "react-native";
|
|
4
4
|
import JitsiMeetJS from "lib-jitsi-meet";
|
|
@@ -373,7 +373,7 @@ type Actions$5 = {
|
|
|
373
373
|
isMobileSDK: () => boolean;
|
|
374
374
|
isMobile: () => boolean;
|
|
375
375
|
};
|
|
376
|
-
declare const useBaseStore:
|
|
376
|
+
declare const useBaseStore: zustand1.UseBoundStore<Omit<Omit<zustand1.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
377
377
|
subscribe: {
|
|
378
378
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
379
379
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -453,7 +453,7 @@ type Actions$4 = {
|
|
|
453
453
|
endConference: () => Promise<void>;
|
|
454
454
|
stopRecording: () => Promise<void>;
|
|
455
455
|
};
|
|
456
|
-
declare const useConferenceStore:
|
|
456
|
+
declare const useConferenceStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
457
457
|
subscribe: {
|
|
458
458
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
459
459
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -524,12 +524,13 @@ type ConfigStateBoth = {
|
|
|
524
524
|
enableSpotlightDrag: boolean;
|
|
525
525
|
enableSpotlightSwap: boolean;
|
|
526
526
|
isPeerCall: boolean;
|
|
527
|
+
enableNotifications: boolean;
|
|
527
528
|
};
|
|
528
529
|
type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth;
|
|
529
530
|
type Actions$3 = {
|
|
530
531
|
reset: () => void;
|
|
531
532
|
};
|
|
532
|
-
declare const useConfigStore:
|
|
533
|
+
declare const useConfigStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
533
534
|
subscribe: {
|
|
534
535
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
535
536
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -681,7 +682,7 @@ type Actions$2 = {
|
|
|
681
682
|
disconnect: () => Promise<void>;
|
|
682
683
|
reset: () => void;
|
|
683
684
|
};
|
|
684
|
-
declare const useConnectionStore:
|
|
685
|
+
declare const useConnectionStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
685
686
|
subscribe: {
|
|
686
687
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
687
688
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -732,7 +733,7 @@ type Actions$1 = {
|
|
|
732
733
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
733
734
|
reset: () => void;
|
|
734
735
|
};
|
|
735
|
-
declare const useParticipantStore:
|
|
736
|
+
declare const useParticipantStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
736
737
|
subscribe: {
|
|
737
738
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
738
739
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -754,6 +755,38 @@ declare const getMainParticipantFromState: (state: {
|
|
|
754
755
|
localParticipant: HumanParticipant;
|
|
755
756
|
}) => Participant$2;
|
|
756
757
|
//#endregion
|
|
758
|
+
//#region calls-sdk-core/store/toast.d.ts
|
|
759
|
+
interface ToastAction {
|
|
760
|
+
label: string;
|
|
761
|
+
onPress: () => void;
|
|
762
|
+
}
|
|
763
|
+
interface ToastItem {
|
|
764
|
+
id: string;
|
|
765
|
+
message: string;
|
|
766
|
+
type: NotificationType;
|
|
767
|
+
duration: number;
|
|
768
|
+
position: 'top' | 'bottom';
|
|
769
|
+
action?: ToastAction;
|
|
770
|
+
createdAt: number;
|
|
771
|
+
}
|
|
772
|
+
interface ToastState {
|
|
773
|
+
toasts: ToastItem[];
|
|
774
|
+
}
|
|
775
|
+
interface ToastActions {
|
|
776
|
+
addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
|
|
777
|
+
removeToast: (id: string) => void;
|
|
778
|
+
clearAll: () => void;
|
|
779
|
+
reset: () => void;
|
|
780
|
+
}
|
|
781
|
+
declare const useToastStore: zustand1.UseBoundStore<zustand1.StoreApi<ToastState & ToastActions>>;
|
|
782
|
+
declare function showToast(params: {
|
|
783
|
+
message: string;
|
|
784
|
+
type?: NotificationType;
|
|
785
|
+
duration?: number;
|
|
786
|
+
position?: 'top' | 'bottom';
|
|
787
|
+
action?: ToastAction;
|
|
788
|
+
}): string;
|
|
789
|
+
//#endregion
|
|
757
790
|
//#region calls-sdk-core/store/tracks.d.ts
|
|
758
791
|
type Track = {
|
|
759
792
|
local: boolean;
|
|
@@ -778,7 +811,7 @@ type Actions = {
|
|
|
778
811
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
779
812
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
780
813
|
};
|
|
781
|
-
declare const useTracksStore:
|
|
814
|
+
declare const useTracksStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
782
815
|
subscribe: {
|
|
783
816
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
784
817
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1270,7 +1303,7 @@ interface TranslationState {
|
|
|
1270
1303
|
translations: Record<string, typeof __json_default_export>;
|
|
1271
1304
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1272
1305
|
}
|
|
1273
|
-
declare const useTranslationStore:
|
|
1306
|
+
declare const useTranslationStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1274
1307
|
reset: () => void;
|
|
1275
1308
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1276
1309
|
}>, "subscribe"> & {
|
|
@@ -2660,7 +2693,7 @@ interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
|
|
|
2660
2693
|
/**
|
|
2661
2694
|
* @deprecated Use `sessionSettings` instead.
|
|
2662
2695
|
*/
|
|
2663
|
-
callSettings
|
|
2696
|
+
callSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2664
2697
|
sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
|
|
2665
2698
|
}
|
|
2666
2699
|
declare function AppReactNativeSDK(props: AppProps): React.JSX.Element;
|
package/dist/index.js
CHANGED
|
@@ -969,7 +969,7 @@ function sendParticipantListChangedEvent() {
|
|
|
969
969
|
|
|
970
970
|
//#endregion
|
|
971
971
|
//#region calls-sdk-core/store/config.ts
|
|
972
|
-
const initialState$
|
|
972
|
+
const initialState$8 = {
|
|
973
973
|
sessionType: "VIDEO",
|
|
974
974
|
autoStartRecording: false,
|
|
975
975
|
layout: LAYOUT.TILE,
|
|
@@ -1005,9 +1005,10 @@ const initialState$7 = {
|
|
|
1005
1005
|
enableSpotlightSwap: true,
|
|
1006
1006
|
showFrameRate: false,
|
|
1007
1007
|
enableCompanionMode: false,
|
|
1008
|
-
isPeerCall: false
|
|
1008
|
+
isPeerCall: false,
|
|
1009
|
+
enableNotifications: true
|
|
1009
1010
|
};
|
|
1010
|
-
const useConfigStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$
|
|
1011
|
+
const useConfigStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$8, (set) => ({ reset: () => set(initialState$8) }))));
|
|
1011
1012
|
const setConfig = (config) => {
|
|
1012
1013
|
useConfigStore.setState(config);
|
|
1013
1014
|
};
|
|
@@ -1025,13 +1026,13 @@ const initialLocalParticipant = {
|
|
|
1025
1026
|
type: "human",
|
|
1026
1027
|
uid: "unknown"
|
|
1027
1028
|
};
|
|
1028
|
-
const initialState$
|
|
1029
|
+
const initialState$7 = {
|
|
1029
1030
|
dominantSpeakers: [],
|
|
1030
1031
|
localParticipant: initialLocalParticipant,
|
|
1031
1032
|
participants: [],
|
|
1032
1033
|
virtualParticipants: []
|
|
1033
1034
|
};
|
|
1034
|
-
const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$
|
|
1035
|
+
const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$7, (set, get$1) => ({
|
|
1035
1036
|
addParticipant: (participant) => {
|
|
1036
1037
|
set((state) => ({ participants: state.participants.some((p) => p.pid === participant.pid) ? state.participants.map((p) => p.pid === participant.pid ? {
|
|
1037
1038
|
...p,
|
|
@@ -1112,7 +1113,7 @@ const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscri
|
|
|
1112
1113
|
}
|
|
1113
1114
|
return get$1().participants.find((p) => p.pid === pid);
|
|
1114
1115
|
},
|
|
1115
|
-
reset: () => set(initialState$
|
|
1116
|
+
reset: () => set(initialState$7)
|
|
1116
1117
|
}))));
|
|
1117
1118
|
function useAllParticipants() {
|
|
1118
1119
|
const localParticipant = useParticipantStore((state) => state.localParticipant);
|
|
@@ -1246,7 +1247,7 @@ useParticipantStore.subscribe((state) => state.participants.filter((p) => p.uid)
|
|
|
1246
1247
|
|
|
1247
1248
|
//#endregion
|
|
1248
1249
|
//#region calls-sdk-core/store/conference.ts
|
|
1249
|
-
const initialState$
|
|
1250
|
+
const initialState$6 = {
|
|
1250
1251
|
conference: null,
|
|
1251
1252
|
conferenceJoined: false,
|
|
1252
1253
|
conferenceJoinedAt: null,
|
|
@@ -1261,7 +1262,7 @@ const initialState$5 = {
|
|
|
1261
1262
|
},
|
|
1262
1263
|
isRecording: false
|
|
1263
1264
|
};
|
|
1264
|
-
const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$
|
|
1265
|
+
const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$6, (set) => ({
|
|
1265
1266
|
conferenceWillJoin: (conference) => {
|
|
1266
1267
|
if (typeof window?.APP !== "undefined") {
|
|
1267
1268
|
window.APP.conference._room = conference;
|
|
@@ -1272,7 +1273,7 @@ const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscrib
|
|
|
1272
1273
|
});
|
|
1273
1274
|
},
|
|
1274
1275
|
reset: () => {
|
|
1275
|
-
set(initialState$
|
|
1276
|
+
set(initialState$6);
|
|
1276
1277
|
},
|
|
1277
1278
|
raiseHand: (participantId, timestamp) => {
|
|
1278
1279
|
set((state) => ({ raiseHandMap: new Map(state.raiseHandMap).set(participantId, timestamp) }));
|
|
@@ -1446,7 +1447,7 @@ useConferenceStore.subscribe((state) => state.conference, (conference) => {
|
|
|
1446
1447
|
|
|
1447
1448
|
//#endregion
|
|
1448
1449
|
//#region calls-sdk-core/store/tracks.ts
|
|
1449
|
-
const initialState$
|
|
1450
|
+
const initialState$5 = {
|
|
1450
1451
|
tracks: [],
|
|
1451
1452
|
permissions: {
|
|
1452
1453
|
audio: false,
|
|
@@ -1454,9 +1455,9 @@ const initialState$4 = {
|
|
|
1454
1455
|
initialized: false
|
|
1455
1456
|
}
|
|
1456
1457
|
};
|
|
1457
|
-
const useTracksStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$
|
|
1458
|
+
const useTracksStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$5, (set, get$1) => ({
|
|
1458
1459
|
reset: () => set({
|
|
1459
|
-
...initialState$
|
|
1460
|
+
...initialState$5,
|
|
1460
1461
|
permissions: get$1().permissions
|
|
1461
1462
|
}),
|
|
1462
1463
|
addTrack: (originalTrack) => set((state) => {
|
|
@@ -1838,7 +1839,7 @@ function updateConfig(config) {
|
|
|
1838
1839
|
|
|
1839
1840
|
//#endregion
|
|
1840
1841
|
//#region calls-sdk-core/store/base.ts
|
|
1841
|
-
const initialState$
|
|
1842
|
+
const initialState$4 = {
|
|
1842
1843
|
audioModeMenuVisible: false,
|
|
1843
1844
|
audioModes: [],
|
|
1844
1845
|
audioInputDevices: [],
|
|
@@ -1885,12 +1886,12 @@ const initialState$3 = {
|
|
|
1885
1886
|
endIndex: 0
|
|
1886
1887
|
}
|
|
1887
1888
|
};
|
|
1888
|
-
const useBaseStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.persist)((0, zustand_middleware.combine)(initialState$
|
|
1889
|
+
const useBaseStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.persist)((0, zustand_middleware.combine)(initialState$4, (set, get$1) => ({
|
|
1889
1890
|
addSubscriptions: (subscriptions) => {
|
|
1890
1891
|
useBaseStore.setState((state) => ({ subscriptions: [...state.subscriptions, ...subscriptions] }));
|
|
1891
1892
|
},
|
|
1892
1893
|
reset: () => set((state) => ({
|
|
1893
|
-
...initialState$
|
|
1894
|
+
...initialState$4,
|
|
1894
1895
|
audioInputDevice: state.audioInputDevice,
|
|
1895
1896
|
audioOutputDevice: state.audioOutputDevice,
|
|
1896
1897
|
videoInputDevice: state.videoInputDevice,
|
|
@@ -2125,13 +2126,13 @@ initBaseStoreSubscriptions();
|
|
|
2125
2126
|
|
|
2126
2127
|
//#endregion
|
|
2127
2128
|
//#region calls-sdk-core/store/connection.ts
|
|
2128
|
-
const initialState$
|
|
2129
|
+
const initialState$3 = {
|
|
2129
2130
|
connection: undefined,
|
|
2130
2131
|
connectionStatus: "initial",
|
|
2131
2132
|
error: undefined,
|
|
2132
2133
|
timeEstablished: undefined
|
|
2133
2134
|
};
|
|
2134
|
-
const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$
|
|
2135
|
+
const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$3, (set) => ({
|
|
2135
2136
|
connectionEstablished: (connection) => set({
|
|
2136
2137
|
connection,
|
|
2137
2138
|
connectionStatus: "connected",
|
|
@@ -2164,10 +2165,10 @@ const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscrib
|
|
|
2164
2165
|
eventBus.stopEmitting();
|
|
2165
2166
|
await tryCatch(connection.disconnect());
|
|
2166
2167
|
eventBus.publish({ type: EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed }, true);
|
|
2167
|
-
set(initialState$
|
|
2168
|
+
set(initialState$3);
|
|
2168
2169
|
}
|
|
2169
2170
|
},
|
|
2170
|
-
reset: () => set(initialState$
|
|
2171
|
+
reset: () => set(initialState$3)
|
|
2171
2172
|
}))));
|
|
2172
2173
|
function waitForConnection() {
|
|
2173
2174
|
const { connectionStatus } = useConnectionStore.getState();
|
|
@@ -2191,6 +2192,55 @@ function waitForConnection() {
|
|
|
2191
2192
|
});
|
|
2192
2193
|
}
|
|
2193
2194
|
|
|
2195
|
+
//#endregion
|
|
2196
|
+
//#region calls-sdk-core/store/toast.ts
|
|
2197
|
+
const MAX_TOASTS = 3;
|
|
2198
|
+
const initialState$2 = { toasts: [] };
|
|
2199
|
+
let counter = 0;
|
|
2200
|
+
const useToastStore = (0, zustand.create)((set) => ({
|
|
2201
|
+
...initialState$2,
|
|
2202
|
+
addToast: (toast) => {
|
|
2203
|
+
if (!getIsConferenceJoined()) {
|
|
2204
|
+
return "";
|
|
2205
|
+
}
|
|
2206
|
+
if (!useConfigStore.getState().enableNotifications) {
|
|
2207
|
+
return "";
|
|
2208
|
+
}
|
|
2209
|
+
const id = `toast-${++counter}-${Date.now()}`;
|
|
2210
|
+
const newToast = {
|
|
2211
|
+
...toast,
|
|
2212
|
+
id,
|
|
2213
|
+
createdAt: Date.now()
|
|
2214
|
+
};
|
|
2215
|
+
set((state) => {
|
|
2216
|
+
const updated = [...state.toasts, newToast];
|
|
2217
|
+
if (updated.length > MAX_TOASTS) {
|
|
2218
|
+
return { toasts: updated.slice(-MAX_TOASTS) };
|
|
2219
|
+
}
|
|
2220
|
+
return { toasts: updated };
|
|
2221
|
+
});
|
|
2222
|
+
return id;
|
|
2223
|
+
},
|
|
2224
|
+
removeToast: (id) => {
|
|
2225
|
+
set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
|
|
2226
|
+
},
|
|
2227
|
+
clearAll: () => {
|
|
2228
|
+
set(initialState$2);
|
|
2229
|
+
},
|
|
2230
|
+
reset: () => {
|
|
2231
|
+
set(initialState$2);
|
|
2232
|
+
}
|
|
2233
|
+
}));
|
|
2234
|
+
function showToast(params) {
|
|
2235
|
+
return useToastStore.getState().addToast({
|
|
2236
|
+
message: params.message,
|
|
2237
|
+
type: params.type ?? "info",
|
|
2238
|
+
duration: params.duration ?? 3e3,
|
|
2239
|
+
position: params.position ?? "bottom",
|
|
2240
|
+
action: params.action
|
|
2241
|
+
});
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2194
2244
|
//#endregion
|
|
2195
2245
|
//#region calls-sdk-core/store/utils/hooks.ts
|
|
2196
2246
|
const useHideMuteAudioButton = () => {
|
|
@@ -2218,7 +2268,7 @@ const useHideScreenSharingButton = () => {
|
|
|
2218
2268
|
const useHideSwitchCameraButton = () => {
|
|
2219
2269
|
const videoTrack = getLocalTrack(MEDIA_TYPE.VIDEO);
|
|
2220
2270
|
const hideSwitchCameraButton = useConfigStore((state) => state.hideSwitchCameraButton);
|
|
2221
|
-
return hideSwitchCameraButton || !videoTrack;
|
|
2271
|
+
return hideSwitchCameraButton || !videoTrack?.originalTrack;
|
|
2222
2272
|
};
|
|
2223
2273
|
const useHideChatButton = () => {
|
|
2224
2274
|
const hideChatButton = useConfigStore((state) => state.hideChatButton);
|
|
@@ -3009,6 +3059,7 @@ function resetAllStores() {
|
|
|
3009
3059
|
useConfigStore.getState().reset();
|
|
3010
3060
|
useConnectionStore.getState().reset();
|
|
3011
3061
|
useParticipantStore.getState().reset();
|
|
3062
|
+
useToastStore.getState().reset();
|
|
3012
3063
|
useTracksStore.getState().reset();
|
|
3013
3064
|
}
|
|
3014
3065
|
|
|
@@ -3560,6 +3611,10 @@ eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount, () => {
|
|
|
3560
3611
|
});
|
|
3561
3612
|
});
|
|
3562
3613
|
useBaseStore.subscribe((state) => state.appState, (appState) => {
|
|
3614
|
+
const sessionType = useConfigStore.getState().sessionType;
|
|
3615
|
+
if (sessionType !== SESSION_TYPE.VIDEO) {
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3563
3618
|
if (appState === "active") {
|
|
3564
3619
|
resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);
|
|
3565
3620
|
} else {
|
|
@@ -4000,6 +4055,13 @@ const commonStyles = react_native.StyleSheet.create({
|
|
|
4000
4055
|
borderDefault: { borderColor: colors.border.default },
|
|
4001
4056
|
borderDark: { borderColor: colors.border.dark },
|
|
4002
4057
|
borderHighlight: { borderColor: colors.border.highlight },
|
|
4058
|
+
absoluteFill: {
|
|
4059
|
+
position: "absolute",
|
|
4060
|
+
top: 0,
|
|
4061
|
+
bottom: 0,
|
|
4062
|
+
left: 0,
|
|
4063
|
+
right: 0
|
|
4064
|
+
},
|
|
4003
4065
|
flex1: { flex: 1 },
|
|
4004
4066
|
flexRow: { flexDirection: "row" },
|
|
4005
4067
|
flexColumn: { flexDirection: "column" },
|
|
@@ -4521,7 +4583,11 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
|
|
|
4521
4583
|
return null;
|
|
4522
4584
|
}
|
|
4523
4585
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Animated.View, {
|
|
4524
|
-
style: [
|
|
4586
|
+
style: [
|
|
4587
|
+
commonStyles.absoluteFill,
|
|
4588
|
+
styles$25.videoContainer,
|
|
4589
|
+
{ opacity: fadeAnim }
|
|
4590
|
+
],
|
|
4525
4591
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_webrtc.RTCView, {
|
|
4526
4592
|
streamURL: streamURL.toURL(),
|
|
4527
4593
|
style: [styles$25.video, style],
|
|
@@ -4534,8 +4600,7 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
|
|
|
4534
4600
|
const styles$25 = react_native.StyleSheet.create({
|
|
4535
4601
|
videoContainer: {
|
|
4536
4602
|
height: "100%",
|
|
4537
|
-
width: "100%"
|
|
4538
|
-
...react_native.StyleSheet.absoluteFillObject
|
|
4603
|
+
width: "100%"
|
|
4539
4604
|
},
|
|
4540
4605
|
video: {
|
|
4541
4606
|
width: "100%",
|
|
@@ -5009,7 +5074,11 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
|
|
|
5009
5074
|
return null;
|
|
5010
5075
|
}
|
|
5011
5076
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.Animated.View, {
|
|
5012
|
-
style: [
|
|
5077
|
+
style: [
|
|
5078
|
+
commonStyles.absoluteFill,
|
|
5079
|
+
styles$18.overlay,
|
|
5080
|
+
{ opacity }
|
|
5081
|
+
],
|
|
5013
5082
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.ActivityIndicator, {
|
|
5014
5083
|
size: "large",
|
|
5015
5084
|
color: "#fff"
|
|
@@ -5021,7 +5090,6 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
|
|
|
5021
5090
|
}
|
|
5022
5091
|
const styles$18 = react_native.StyleSheet.create({
|
|
5023
5092
|
overlay: {
|
|
5024
|
-
...react_native.StyleSheet.absoluteFillObject,
|
|
5025
5093
|
justifyContent: "center",
|
|
5026
5094
|
alignItems: "center",
|
|
5027
5095
|
backgroundColor: "#1A1A1A",
|
|
@@ -5199,7 +5267,6 @@ function showConfirmationDialog(title, description, confirmText, cancelText, onC
|
|
|
5199
5267
|
const { width } = react_native.Dimensions.get("window");
|
|
5200
5268
|
const styles$15 = react_native.StyleSheet.create({
|
|
5201
5269
|
backdrop: {
|
|
5202
|
-
...react_native.StyleSheet.absoluteFillObject,
|
|
5203
5270
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
5204
5271
|
justifyContent: "center",
|
|
5205
5272
|
alignItems: "center",
|
|
@@ -5298,7 +5365,7 @@ function ConfirmationDialog() {
|
|
|
5298
5365
|
],
|
|
5299
5366
|
onRequestClose: handleBackdropPress,
|
|
5300
5367
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
|
|
5301
|
-
style: styles$15.backdrop,
|
|
5368
|
+
style: [commonStyles.absoluteFill, styles$15.backdrop],
|
|
5302
5369
|
onPress: handleBackdropPress,
|
|
5303
5370
|
testID: "cometchat-confirmation-dialog-backdrop",
|
|
5304
5371
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
|
|
@@ -5370,7 +5437,7 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
|
|
|
5370
5437
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [isVisible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback, {
|
|
5371
5438
|
onPress: onClose,
|
|
5372
5439
|
testID: "cometchat-bottom-sheet-backdrop",
|
|
5373
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: styles$14.backdrop })
|
|
5440
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: [commonStyles.absoluteFill, styles$14.backdrop] })
|
|
5374
5441
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.Animated.View, {
|
|
5375
5442
|
testID,
|
|
5376
5443
|
style: [
|
|
@@ -5386,7 +5453,6 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
|
|
|
5386
5453
|
};
|
|
5387
5454
|
const styles$14 = react_native.StyleSheet.create({
|
|
5388
5455
|
backdrop: {
|
|
5389
|
-
...react_native.StyleSheet.absoluteFillObject,
|
|
5390
5456
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
5391
5457
|
zIndex: 1
|
|
5392
5458
|
},
|
|
@@ -5779,14 +5845,15 @@ const FullScreenDialog = ({ children, visible = false }) => {
|
|
|
5779
5845
|
return null;
|
|
5780
5846
|
}
|
|
5781
5847
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Animated.View, {
|
|
5782
|
-
style: [
|
|
5848
|
+
style: [
|
|
5849
|
+
commonStyles.absoluteFill,
|
|
5850
|
+
styles$10.container,
|
|
5851
|
+
{ opacity: fadeAnim }
|
|
5852
|
+
],
|
|
5783
5853
|
children
|
|
5784
5854
|
});
|
|
5785
5855
|
};
|
|
5786
|
-
const styles$10 = react_native.StyleSheet.create({ container: {
|
|
5787
|
-
...react_native.StyleSheet.absoluteFillObject,
|
|
5788
|
-
zIndex: 1e3
|
|
5789
|
-
} });
|
|
5856
|
+
const styles$10 = react_native.StyleSheet.create({ container: { zIndex: 1e3 } });
|
|
5790
5857
|
var FullScreenDialog_native_default = FullScreenDialog;
|
|
5791
5858
|
|
|
5792
5859
|
//#endregion
|
|
@@ -6591,45 +6658,6 @@ const styles$2 = react_native.StyleSheet.create({
|
|
|
6591
6658
|
}
|
|
6592
6659
|
});
|
|
6593
6660
|
|
|
6594
|
-
//#endregion
|
|
6595
|
-
//#region src/ui/toast/toast-state.ts
|
|
6596
|
-
const MAX_TOASTS = 3;
|
|
6597
|
-
let counter = 0;
|
|
6598
|
-
const useToastStore = (0, zustand.create)((set) => ({
|
|
6599
|
-
toasts: [],
|
|
6600
|
-
addToast: (toast) => {
|
|
6601
|
-
const id = `toast-${++counter}-${Date.now()}`;
|
|
6602
|
-
const newToast = {
|
|
6603
|
-
...toast,
|
|
6604
|
-
id,
|
|
6605
|
-
createdAt: Date.now()
|
|
6606
|
-
};
|
|
6607
|
-
set((state) => {
|
|
6608
|
-
const updated = [...state.toasts, newToast];
|
|
6609
|
-
if (updated.length > MAX_TOASTS) {
|
|
6610
|
-
return { toasts: updated.slice(-MAX_TOASTS) };
|
|
6611
|
-
}
|
|
6612
|
-
return { toasts: updated };
|
|
6613
|
-
});
|
|
6614
|
-
return id;
|
|
6615
|
-
},
|
|
6616
|
-
removeToast: (id) => {
|
|
6617
|
-
set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
|
|
6618
|
-
},
|
|
6619
|
-
clearAll: () => {
|
|
6620
|
-
set({ toasts: [] });
|
|
6621
|
-
}
|
|
6622
|
-
}));
|
|
6623
|
-
function showToast(params) {
|
|
6624
|
-
return useToastStore.getState().addToast({
|
|
6625
|
-
message: params.message,
|
|
6626
|
-
type: params.type ?? "info",
|
|
6627
|
-
duration: params.duration ?? 3e3,
|
|
6628
|
-
position: params.position ?? "bottom",
|
|
6629
|
-
action: params.action
|
|
6630
|
-
});
|
|
6631
|
-
}
|
|
6632
|
-
|
|
6633
6661
|
//#endregion
|
|
6634
6662
|
//#region src/ui/toast/Toast.native.tsx
|
|
6635
6663
|
const SLIDE_IN_DURATION = 300;
|
|
@@ -6835,13 +6863,6 @@ const styles$1 = react_native.StyleSheet.create({
|
|
|
6835
6863
|
alignItems: "center",
|
|
6836
6864
|
gap: GRID_GAP,
|
|
6837
6865
|
paddingHorizontal: 20
|
|
6838
|
-
},
|
|
6839
|
-
loadingContainer: {
|
|
6840
|
-
...react_native.StyleSheet.absoluteFillObject,
|
|
6841
|
-
justifyContent: "center",
|
|
6842
|
-
alignItems: "center",
|
|
6843
|
-
backgroundColor: "#000",
|
|
6844
|
-
zIndex: 1e3
|
|
6845
6866
|
}
|
|
6846
6867
|
});
|
|
6847
6868
|
var index_native_default = CallUI;
|
package/dist/index.mjs
CHANGED
|
@@ -937,7 +937,7 @@ function sendParticipantListChangedEvent() {
|
|
|
937
937
|
|
|
938
938
|
//#endregion
|
|
939
939
|
//#region calls-sdk-core/store/config.ts
|
|
940
|
-
const initialState$
|
|
940
|
+
const initialState$8 = {
|
|
941
941
|
sessionType: "VIDEO",
|
|
942
942
|
autoStartRecording: false,
|
|
943
943
|
layout: LAYOUT.TILE,
|
|
@@ -973,9 +973,10 @@ const initialState$7 = {
|
|
|
973
973
|
enableSpotlightSwap: true,
|
|
974
974
|
showFrameRate: false,
|
|
975
975
|
enableCompanionMode: false,
|
|
976
|
-
isPeerCall: false
|
|
976
|
+
isPeerCall: false,
|
|
977
|
+
enableNotifications: true
|
|
977
978
|
};
|
|
978
|
-
const useConfigStore = create()(subscribeWithSelector(combine(initialState$
|
|
979
|
+
const useConfigStore = create()(subscribeWithSelector(combine(initialState$8, (set) => ({ reset: () => set(initialState$8) }))));
|
|
979
980
|
const setConfig = (config) => {
|
|
980
981
|
useConfigStore.setState(config);
|
|
981
982
|
};
|
|
@@ -993,13 +994,13 @@ const initialLocalParticipant = {
|
|
|
993
994
|
type: "human",
|
|
994
995
|
uid: "unknown"
|
|
995
996
|
};
|
|
996
|
-
const initialState$
|
|
997
|
+
const initialState$7 = {
|
|
997
998
|
dominantSpeakers: [],
|
|
998
999
|
localParticipant: initialLocalParticipant,
|
|
999
1000
|
participants: [],
|
|
1000
1001
|
virtualParticipants: []
|
|
1001
1002
|
};
|
|
1002
|
-
const useParticipantStore = create()(subscribeWithSelector(combine(initialState$
|
|
1003
|
+
const useParticipantStore = create()(subscribeWithSelector(combine(initialState$7, (set, get$1) => ({
|
|
1003
1004
|
addParticipant: (participant) => {
|
|
1004
1005
|
set((state) => ({ participants: state.participants.some((p) => p.pid === participant.pid) ? state.participants.map((p) => p.pid === participant.pid ? {
|
|
1005
1006
|
...p,
|
|
@@ -1080,7 +1081,7 @@ const useParticipantStore = create()(subscribeWithSelector(combine(initialState$
|
|
|
1080
1081
|
}
|
|
1081
1082
|
return get$1().participants.find((p) => p.pid === pid);
|
|
1082
1083
|
},
|
|
1083
|
-
reset: () => set(initialState$
|
|
1084
|
+
reset: () => set(initialState$7)
|
|
1084
1085
|
}))));
|
|
1085
1086
|
function useAllParticipants() {
|
|
1086
1087
|
const localParticipant = useParticipantStore((state) => state.localParticipant);
|
|
@@ -1214,7 +1215,7 @@ useParticipantStore.subscribe((state) => state.participants.filter((p) => p.uid)
|
|
|
1214
1215
|
|
|
1215
1216
|
//#endregion
|
|
1216
1217
|
//#region calls-sdk-core/store/conference.ts
|
|
1217
|
-
const initialState$
|
|
1218
|
+
const initialState$6 = {
|
|
1218
1219
|
conference: null,
|
|
1219
1220
|
conferenceJoined: false,
|
|
1220
1221
|
conferenceJoinedAt: null,
|
|
@@ -1229,7 +1230,7 @@ const initialState$5 = {
|
|
|
1229
1230
|
},
|
|
1230
1231
|
isRecording: false
|
|
1231
1232
|
};
|
|
1232
|
-
const useConferenceStore = create()(subscribeWithSelector(combine(initialState$
|
|
1233
|
+
const useConferenceStore = create()(subscribeWithSelector(combine(initialState$6, (set) => ({
|
|
1233
1234
|
conferenceWillJoin: (conference) => {
|
|
1234
1235
|
if (typeof window?.APP !== "undefined") {
|
|
1235
1236
|
window.APP.conference._room = conference;
|
|
@@ -1240,7 +1241,7 @@ const useConferenceStore = create()(subscribeWithSelector(combine(initialState$5
|
|
|
1240
1241
|
});
|
|
1241
1242
|
},
|
|
1242
1243
|
reset: () => {
|
|
1243
|
-
set(initialState$
|
|
1244
|
+
set(initialState$6);
|
|
1244
1245
|
},
|
|
1245
1246
|
raiseHand: (participantId, timestamp) => {
|
|
1246
1247
|
set((state) => ({ raiseHandMap: new Map(state.raiseHandMap).set(participantId, timestamp) }));
|
|
@@ -1414,7 +1415,7 @@ useConferenceStore.subscribe((state) => state.conference, (conference) => {
|
|
|
1414
1415
|
|
|
1415
1416
|
//#endregion
|
|
1416
1417
|
//#region calls-sdk-core/store/tracks.ts
|
|
1417
|
-
const initialState$
|
|
1418
|
+
const initialState$5 = {
|
|
1418
1419
|
tracks: [],
|
|
1419
1420
|
permissions: {
|
|
1420
1421
|
audio: false,
|
|
@@ -1422,9 +1423,9 @@ const initialState$4 = {
|
|
|
1422
1423
|
initialized: false
|
|
1423
1424
|
}
|
|
1424
1425
|
};
|
|
1425
|
-
const useTracksStore = create()(subscribeWithSelector(combine(initialState$
|
|
1426
|
+
const useTracksStore = create()(subscribeWithSelector(combine(initialState$5, (set, get$1) => ({
|
|
1426
1427
|
reset: () => set({
|
|
1427
|
-
...initialState$
|
|
1428
|
+
...initialState$5,
|
|
1428
1429
|
permissions: get$1().permissions
|
|
1429
1430
|
}),
|
|
1430
1431
|
addTrack: (originalTrack) => set((state) => {
|
|
@@ -1806,7 +1807,7 @@ function updateConfig(config) {
|
|
|
1806
1807
|
|
|
1807
1808
|
//#endregion
|
|
1808
1809
|
//#region calls-sdk-core/store/base.ts
|
|
1809
|
-
const initialState$
|
|
1810
|
+
const initialState$4 = {
|
|
1810
1811
|
audioModeMenuVisible: false,
|
|
1811
1812
|
audioModes: [],
|
|
1812
1813
|
audioInputDevices: [],
|
|
@@ -1853,12 +1854,12 @@ const initialState$3 = {
|
|
|
1853
1854
|
endIndex: 0
|
|
1854
1855
|
}
|
|
1855
1856
|
};
|
|
1856
|
-
const useBaseStore = create()(subscribeWithSelector(persist(combine(initialState$
|
|
1857
|
+
const useBaseStore = create()(subscribeWithSelector(persist(combine(initialState$4, (set, get$1) => ({
|
|
1857
1858
|
addSubscriptions: (subscriptions) => {
|
|
1858
1859
|
useBaseStore.setState((state) => ({ subscriptions: [...state.subscriptions, ...subscriptions] }));
|
|
1859
1860
|
},
|
|
1860
1861
|
reset: () => set((state) => ({
|
|
1861
|
-
...initialState$
|
|
1862
|
+
...initialState$4,
|
|
1862
1863
|
audioInputDevice: state.audioInputDevice,
|
|
1863
1864
|
audioOutputDevice: state.audioOutputDevice,
|
|
1864
1865
|
videoInputDevice: state.videoInputDevice,
|
|
@@ -2093,13 +2094,13 @@ initBaseStoreSubscriptions();
|
|
|
2093
2094
|
|
|
2094
2095
|
//#endregion
|
|
2095
2096
|
//#region calls-sdk-core/store/connection.ts
|
|
2096
|
-
const initialState$
|
|
2097
|
+
const initialState$3 = {
|
|
2097
2098
|
connection: undefined,
|
|
2098
2099
|
connectionStatus: "initial",
|
|
2099
2100
|
error: undefined,
|
|
2100
2101
|
timeEstablished: undefined
|
|
2101
2102
|
};
|
|
2102
|
-
const useConnectionStore = create()(subscribeWithSelector(combine(initialState$
|
|
2103
|
+
const useConnectionStore = create()(subscribeWithSelector(combine(initialState$3, (set) => ({
|
|
2103
2104
|
connectionEstablished: (connection) => set({
|
|
2104
2105
|
connection,
|
|
2105
2106
|
connectionStatus: "connected",
|
|
@@ -2132,10 +2133,10 @@ const useConnectionStore = create()(subscribeWithSelector(combine(initialState$2
|
|
|
2132
2133
|
eventBus.stopEmitting();
|
|
2133
2134
|
await tryCatch(connection.disconnect());
|
|
2134
2135
|
eventBus.publish({ type: EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed }, true);
|
|
2135
|
-
set(initialState$
|
|
2136
|
+
set(initialState$3);
|
|
2136
2137
|
}
|
|
2137
2138
|
},
|
|
2138
|
-
reset: () => set(initialState$
|
|
2139
|
+
reset: () => set(initialState$3)
|
|
2139
2140
|
}))));
|
|
2140
2141
|
function waitForConnection() {
|
|
2141
2142
|
const { connectionStatus } = useConnectionStore.getState();
|
|
@@ -2159,6 +2160,55 @@ function waitForConnection() {
|
|
|
2159
2160
|
});
|
|
2160
2161
|
}
|
|
2161
2162
|
|
|
2163
|
+
//#endregion
|
|
2164
|
+
//#region calls-sdk-core/store/toast.ts
|
|
2165
|
+
const MAX_TOASTS = 3;
|
|
2166
|
+
const initialState$2 = { toasts: [] };
|
|
2167
|
+
let counter = 0;
|
|
2168
|
+
const useToastStore = create((set) => ({
|
|
2169
|
+
...initialState$2,
|
|
2170
|
+
addToast: (toast) => {
|
|
2171
|
+
if (!getIsConferenceJoined()) {
|
|
2172
|
+
return "";
|
|
2173
|
+
}
|
|
2174
|
+
if (!useConfigStore.getState().enableNotifications) {
|
|
2175
|
+
return "";
|
|
2176
|
+
}
|
|
2177
|
+
const id = `toast-${++counter}-${Date.now()}`;
|
|
2178
|
+
const newToast = {
|
|
2179
|
+
...toast,
|
|
2180
|
+
id,
|
|
2181
|
+
createdAt: Date.now()
|
|
2182
|
+
};
|
|
2183
|
+
set((state) => {
|
|
2184
|
+
const updated = [...state.toasts, newToast];
|
|
2185
|
+
if (updated.length > MAX_TOASTS) {
|
|
2186
|
+
return { toasts: updated.slice(-MAX_TOASTS) };
|
|
2187
|
+
}
|
|
2188
|
+
return { toasts: updated };
|
|
2189
|
+
});
|
|
2190
|
+
return id;
|
|
2191
|
+
},
|
|
2192
|
+
removeToast: (id) => {
|
|
2193
|
+
set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
|
|
2194
|
+
},
|
|
2195
|
+
clearAll: () => {
|
|
2196
|
+
set(initialState$2);
|
|
2197
|
+
},
|
|
2198
|
+
reset: () => {
|
|
2199
|
+
set(initialState$2);
|
|
2200
|
+
}
|
|
2201
|
+
}));
|
|
2202
|
+
function showToast(params) {
|
|
2203
|
+
return useToastStore.getState().addToast({
|
|
2204
|
+
message: params.message,
|
|
2205
|
+
type: params.type ?? "info",
|
|
2206
|
+
duration: params.duration ?? 3e3,
|
|
2207
|
+
position: params.position ?? "bottom",
|
|
2208
|
+
action: params.action
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2162
2212
|
//#endregion
|
|
2163
2213
|
//#region calls-sdk-core/store/utils/hooks.ts
|
|
2164
2214
|
const useHideMuteAudioButton = () => {
|
|
@@ -2186,7 +2236,7 @@ const useHideScreenSharingButton = () => {
|
|
|
2186
2236
|
const useHideSwitchCameraButton = () => {
|
|
2187
2237
|
const videoTrack = getLocalTrack(MEDIA_TYPE.VIDEO);
|
|
2188
2238
|
const hideSwitchCameraButton = useConfigStore((state) => state.hideSwitchCameraButton);
|
|
2189
|
-
return hideSwitchCameraButton || !videoTrack;
|
|
2239
|
+
return hideSwitchCameraButton || !videoTrack?.originalTrack;
|
|
2190
2240
|
};
|
|
2191
2241
|
const useHideChatButton = () => {
|
|
2192
2242
|
const hideChatButton = useConfigStore((state) => state.hideChatButton);
|
|
@@ -2977,6 +3027,7 @@ function resetAllStores() {
|
|
|
2977
3027
|
useConfigStore.getState().reset();
|
|
2978
3028
|
useConnectionStore.getState().reset();
|
|
2979
3029
|
useParticipantStore.getState().reset();
|
|
3030
|
+
useToastStore.getState().reset();
|
|
2980
3031
|
useTracksStore.getState().reset();
|
|
2981
3032
|
}
|
|
2982
3033
|
|
|
@@ -3528,6 +3579,10 @@ eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount, () => {
|
|
|
3528
3579
|
});
|
|
3529
3580
|
});
|
|
3530
3581
|
useBaseStore.subscribe((state) => state.appState, (appState) => {
|
|
3582
|
+
const sessionType = useConfigStore.getState().sessionType;
|
|
3583
|
+
if (sessionType !== SESSION_TYPE.VIDEO) {
|
|
3584
|
+
return;
|
|
3585
|
+
}
|
|
3531
3586
|
if (appState === "active") {
|
|
3532
3587
|
resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);
|
|
3533
3588
|
} else {
|
|
@@ -3968,6 +4023,13 @@ const commonStyles = StyleSheet.create({
|
|
|
3968
4023
|
borderDefault: { borderColor: colors.border.default },
|
|
3969
4024
|
borderDark: { borderColor: colors.border.dark },
|
|
3970
4025
|
borderHighlight: { borderColor: colors.border.highlight },
|
|
4026
|
+
absoluteFill: {
|
|
4027
|
+
position: "absolute",
|
|
4028
|
+
top: 0,
|
|
4029
|
+
bottom: 0,
|
|
4030
|
+
left: 0,
|
|
4031
|
+
right: 0
|
|
4032
|
+
},
|
|
3971
4033
|
flex1: { flex: 1 },
|
|
3972
4034
|
flexRow: { flexDirection: "row" },
|
|
3973
4035
|
flexColumn: { flexDirection: "column" },
|
|
@@ -4489,7 +4551,11 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
|
|
|
4489
4551
|
return null;
|
|
4490
4552
|
}
|
|
4491
4553
|
return /* @__PURE__ */ jsx(Animated.View, {
|
|
4492
|
-
style: [
|
|
4554
|
+
style: [
|
|
4555
|
+
commonStyles.absoluteFill,
|
|
4556
|
+
styles$25.videoContainer,
|
|
4557
|
+
{ opacity: fadeAnim }
|
|
4558
|
+
],
|
|
4493
4559
|
children: /* @__PURE__ */ jsx(RTCView, {
|
|
4494
4560
|
streamURL: streamURL.toURL(),
|
|
4495
4561
|
style: [styles$25.video, style],
|
|
@@ -4502,8 +4568,7 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
|
|
|
4502
4568
|
const styles$25 = StyleSheet.create({
|
|
4503
4569
|
videoContainer: {
|
|
4504
4570
|
height: "100%",
|
|
4505
|
-
width: "100%"
|
|
4506
|
-
...StyleSheet.absoluteFillObject
|
|
4571
|
+
width: "100%"
|
|
4507
4572
|
},
|
|
4508
4573
|
video: {
|
|
4509
4574
|
width: "100%",
|
|
@@ -4977,7 +5042,11 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
|
|
|
4977
5042
|
return null;
|
|
4978
5043
|
}
|
|
4979
5044
|
return /* @__PURE__ */ jsxs(Animated.View, {
|
|
4980
|
-
style: [
|
|
5045
|
+
style: [
|
|
5046
|
+
commonStyles.absoluteFill,
|
|
5047
|
+
styles$18.overlay,
|
|
5048
|
+
{ opacity }
|
|
5049
|
+
],
|
|
4981
5050
|
children: [/* @__PURE__ */ jsx(ActivityIndicator, {
|
|
4982
5051
|
size: "large",
|
|
4983
5052
|
color: "#fff"
|
|
@@ -4989,7 +5058,6 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
|
|
|
4989
5058
|
}
|
|
4990
5059
|
const styles$18 = StyleSheet.create({
|
|
4991
5060
|
overlay: {
|
|
4992
|
-
...StyleSheet.absoluteFillObject,
|
|
4993
5061
|
justifyContent: "center",
|
|
4994
5062
|
alignItems: "center",
|
|
4995
5063
|
backgroundColor: "#1A1A1A",
|
|
@@ -5167,7 +5235,6 @@ function showConfirmationDialog(title, description, confirmText, cancelText, onC
|
|
|
5167
5235
|
const { width } = Dimensions.get("window");
|
|
5168
5236
|
const styles$15 = StyleSheet.create({
|
|
5169
5237
|
backdrop: {
|
|
5170
|
-
...StyleSheet.absoluteFillObject,
|
|
5171
5238
|
backgroundColor: "rgba(0, 0, 0, 0.8)",
|
|
5172
5239
|
justifyContent: "center",
|
|
5173
5240
|
alignItems: "center",
|
|
@@ -5266,7 +5333,7 @@ function ConfirmationDialog() {
|
|
|
5266
5333
|
],
|
|
5267
5334
|
onRequestClose: handleBackdropPress,
|
|
5268
5335
|
children: /* @__PURE__ */ jsx(Pressable, {
|
|
5269
|
-
style: styles$15.backdrop,
|
|
5336
|
+
style: [commonStyles.absoluteFill, styles$15.backdrop],
|
|
5270
5337
|
onPress: handleBackdropPress,
|
|
5271
5338
|
testID: "cometchat-confirmation-dialog-backdrop",
|
|
5272
5339
|
children: /* @__PURE__ */ jsx(View, {
|
|
@@ -5338,7 +5405,7 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
|
|
|
5338
5405
|
return /* @__PURE__ */ jsxs(Fragment, { children: [isVisible && /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
|
|
5339
5406
|
onPress: onClose,
|
|
5340
5407
|
testID: "cometchat-bottom-sheet-backdrop",
|
|
5341
|
-
children: /* @__PURE__ */ jsx(View, { style: styles$14.backdrop })
|
|
5408
|
+
children: /* @__PURE__ */ jsx(View, { style: [commonStyles.absoluteFill, styles$14.backdrop] })
|
|
5342
5409
|
}), /* @__PURE__ */ jsxs(Animated.View, {
|
|
5343
5410
|
testID,
|
|
5344
5411
|
style: [
|
|
@@ -5354,7 +5421,6 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
|
|
|
5354
5421
|
};
|
|
5355
5422
|
const styles$14 = StyleSheet.create({
|
|
5356
5423
|
backdrop: {
|
|
5357
|
-
...StyleSheet.absoluteFillObject,
|
|
5358
5424
|
backgroundColor: "rgba(0,0,0,0.5)",
|
|
5359
5425
|
zIndex: 1
|
|
5360
5426
|
},
|
|
@@ -5747,14 +5813,15 @@ const FullScreenDialog = ({ children, visible = false }) => {
|
|
|
5747
5813
|
return null;
|
|
5748
5814
|
}
|
|
5749
5815
|
return /* @__PURE__ */ jsx(Animated.View, {
|
|
5750
|
-
style: [
|
|
5816
|
+
style: [
|
|
5817
|
+
commonStyles.absoluteFill,
|
|
5818
|
+
styles$10.container,
|
|
5819
|
+
{ opacity: fadeAnim }
|
|
5820
|
+
],
|
|
5751
5821
|
children
|
|
5752
5822
|
});
|
|
5753
5823
|
};
|
|
5754
|
-
const styles$10 = StyleSheet.create({ container: {
|
|
5755
|
-
...StyleSheet.absoluteFillObject,
|
|
5756
|
-
zIndex: 1e3
|
|
5757
|
-
} });
|
|
5824
|
+
const styles$10 = StyleSheet.create({ container: { zIndex: 1e3 } });
|
|
5758
5825
|
var FullScreenDialog_native_default = FullScreenDialog;
|
|
5759
5826
|
|
|
5760
5827
|
//#endregion
|
|
@@ -6559,45 +6626,6 @@ const styles$2 = StyleSheet.create({
|
|
|
6559
6626
|
}
|
|
6560
6627
|
});
|
|
6561
6628
|
|
|
6562
|
-
//#endregion
|
|
6563
|
-
//#region src/ui/toast/toast-state.ts
|
|
6564
|
-
const MAX_TOASTS = 3;
|
|
6565
|
-
let counter = 0;
|
|
6566
|
-
const useToastStore = create((set) => ({
|
|
6567
|
-
toasts: [],
|
|
6568
|
-
addToast: (toast) => {
|
|
6569
|
-
const id = `toast-${++counter}-${Date.now()}`;
|
|
6570
|
-
const newToast = {
|
|
6571
|
-
...toast,
|
|
6572
|
-
id,
|
|
6573
|
-
createdAt: Date.now()
|
|
6574
|
-
};
|
|
6575
|
-
set((state) => {
|
|
6576
|
-
const updated = [...state.toasts, newToast];
|
|
6577
|
-
if (updated.length > MAX_TOASTS) {
|
|
6578
|
-
return { toasts: updated.slice(-MAX_TOASTS) };
|
|
6579
|
-
}
|
|
6580
|
-
return { toasts: updated };
|
|
6581
|
-
});
|
|
6582
|
-
return id;
|
|
6583
|
-
},
|
|
6584
|
-
removeToast: (id) => {
|
|
6585
|
-
set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
|
|
6586
|
-
},
|
|
6587
|
-
clearAll: () => {
|
|
6588
|
-
set({ toasts: [] });
|
|
6589
|
-
}
|
|
6590
|
-
}));
|
|
6591
|
-
function showToast(params) {
|
|
6592
|
-
return useToastStore.getState().addToast({
|
|
6593
|
-
message: params.message,
|
|
6594
|
-
type: params.type ?? "info",
|
|
6595
|
-
duration: params.duration ?? 3e3,
|
|
6596
|
-
position: params.position ?? "bottom",
|
|
6597
|
-
action: params.action
|
|
6598
|
-
});
|
|
6599
|
-
}
|
|
6600
|
-
|
|
6601
6629
|
//#endregion
|
|
6602
6630
|
//#region src/ui/toast/Toast.native.tsx
|
|
6603
6631
|
const SLIDE_IN_DURATION = 300;
|
|
@@ -6803,13 +6831,6 @@ const styles$1 = StyleSheet.create({
|
|
|
6803
6831
|
alignItems: "center",
|
|
6804
6832
|
gap: GRID_GAP,
|
|
6805
6833
|
paddingHorizontal: 20
|
|
6806
|
-
},
|
|
6807
|
-
loadingContainer: {
|
|
6808
|
-
...StyleSheet.absoluteFillObject,
|
|
6809
|
-
justifyContent: "center",
|
|
6810
|
-
alignItems: "center",
|
|
6811
|
-
backgroundColor: "#000",
|
|
6812
|
-
zIndex: 1e3
|
|
6813
6834
|
}
|
|
6814
6835
|
});
|
|
6815
6836
|
var index_native_default = CallUI;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cometchat/calls-sdk-react-native",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.9",
|
|
4
4
|
"description": "CometChat Calls SDK for React Native provides voice and video calling capabilities for React Native applications.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "dist/index.js",
|