@cometchat/calls-sdk-react-native 5.0.0-beta.8 → 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 +10 -9
- package/dist/index.d.ts +10 -9
- package/dist/index.js +10 -2
- package/dist/index.mjs +10 -2
- 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?: {
|
|
@@ -777,7 +778,7 @@ interface ToastActions {
|
|
|
777
778
|
clearAll: () => void;
|
|
778
779
|
reset: () => void;
|
|
779
780
|
}
|
|
780
|
-
declare const useToastStore:
|
|
781
|
+
declare const useToastStore: zustand0.UseBoundStore<zustand0.StoreApi<ToastState & ToastActions>>;
|
|
781
782
|
declare function showToast(params: {
|
|
782
783
|
message: string;
|
|
783
784
|
type?: NotificationType;
|
|
@@ -810,7 +811,7 @@ type Actions = {
|
|
|
810
811
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
811
812
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
812
813
|
};
|
|
813
|
-
declare const useTracksStore:
|
|
814
|
+
declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
814
815
|
subscribe: {
|
|
815
816
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
816
817
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1302,7 +1303,7 @@ interface TranslationState {
|
|
|
1302
1303
|
translations: Record<string, typeof __json_default_export>;
|
|
1303
1304
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1304
1305
|
}
|
|
1305
|
-
declare const useTranslationStore:
|
|
1306
|
+
declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1306
1307
|
reset: () => void;
|
|
1307
1308
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1308
1309
|
}>, "subscribe"> & {
|
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?: {
|
|
@@ -777,7 +778,7 @@ interface ToastActions {
|
|
|
777
778
|
clearAll: () => void;
|
|
778
779
|
reset: () => void;
|
|
779
780
|
}
|
|
780
|
-
declare const useToastStore:
|
|
781
|
+
declare const useToastStore: zustand1.UseBoundStore<zustand1.StoreApi<ToastState & ToastActions>>;
|
|
781
782
|
declare function showToast(params: {
|
|
782
783
|
message: string;
|
|
783
784
|
type?: NotificationType;
|
|
@@ -810,7 +811,7 @@ type Actions = {
|
|
|
810
811
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
811
812
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
812
813
|
};
|
|
813
|
-
declare const useTracksStore:
|
|
814
|
+
declare const useTracksStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
814
815
|
subscribe: {
|
|
815
816
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
816
817
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1302,7 +1303,7 @@ interface TranslationState {
|
|
|
1302
1303
|
translations: Record<string, typeof __json_default_export>;
|
|
1303
1304
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1304
1305
|
}
|
|
1305
|
-
declare const useTranslationStore:
|
|
1306
|
+
declare const useTranslationStore: zustand1.UseBoundStore<Omit<zustand1.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1306
1307
|
reset: () => void;
|
|
1307
1308
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1308
1309
|
}>, "subscribe"> & {
|
package/dist/index.js
CHANGED
|
@@ -1005,7 +1005,8 @@ const initialState$8 = {
|
|
|
1005
1005
|
enableSpotlightSwap: true,
|
|
1006
1006
|
showFrameRate: false,
|
|
1007
1007
|
enableCompanionMode: false,
|
|
1008
|
-
isPeerCall: false
|
|
1008
|
+
isPeerCall: false,
|
|
1009
|
+
enableNotifications: true
|
|
1009
1010
|
};
|
|
1010
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) => {
|
|
@@ -2202,6 +2203,9 @@ const useToastStore = (0, zustand.create)((set) => ({
|
|
|
2202
2203
|
if (!getIsConferenceJoined()) {
|
|
2203
2204
|
return "";
|
|
2204
2205
|
}
|
|
2206
|
+
if (!useConfigStore.getState().enableNotifications) {
|
|
2207
|
+
return "";
|
|
2208
|
+
}
|
|
2205
2209
|
const id = `toast-${++counter}-${Date.now()}`;
|
|
2206
2210
|
const newToast = {
|
|
2207
2211
|
...toast,
|
|
@@ -2264,7 +2268,7 @@ const useHideScreenSharingButton = () => {
|
|
|
2264
2268
|
const useHideSwitchCameraButton = () => {
|
|
2265
2269
|
const videoTrack = getLocalTrack(MEDIA_TYPE.VIDEO);
|
|
2266
2270
|
const hideSwitchCameraButton = useConfigStore((state) => state.hideSwitchCameraButton);
|
|
2267
|
-
return hideSwitchCameraButton || !videoTrack;
|
|
2271
|
+
return hideSwitchCameraButton || !videoTrack?.originalTrack;
|
|
2268
2272
|
};
|
|
2269
2273
|
const useHideChatButton = () => {
|
|
2270
2274
|
const hideChatButton = useConfigStore((state) => state.hideChatButton);
|
|
@@ -3607,6 +3611,10 @@ eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount, () => {
|
|
|
3607
3611
|
});
|
|
3608
3612
|
});
|
|
3609
3613
|
useBaseStore.subscribe((state) => state.appState, (appState) => {
|
|
3614
|
+
const sessionType = useConfigStore.getState().sessionType;
|
|
3615
|
+
if (sessionType !== SESSION_TYPE.VIDEO) {
|
|
3616
|
+
return;
|
|
3617
|
+
}
|
|
3610
3618
|
if (appState === "active") {
|
|
3611
3619
|
resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);
|
|
3612
3620
|
} else {
|
package/dist/index.mjs
CHANGED
|
@@ -973,7 +973,8 @@ const initialState$8 = {
|
|
|
973
973
|
enableSpotlightSwap: true,
|
|
974
974
|
showFrameRate: false,
|
|
975
975
|
enableCompanionMode: false,
|
|
976
|
-
isPeerCall: false
|
|
976
|
+
isPeerCall: false,
|
|
977
|
+
enableNotifications: true
|
|
977
978
|
};
|
|
978
979
|
const useConfigStore = create()(subscribeWithSelector(combine(initialState$8, (set) => ({ reset: () => set(initialState$8) }))));
|
|
979
980
|
const setConfig = (config) => {
|
|
@@ -2170,6 +2171,9 @@ const useToastStore = create((set) => ({
|
|
|
2170
2171
|
if (!getIsConferenceJoined()) {
|
|
2171
2172
|
return "";
|
|
2172
2173
|
}
|
|
2174
|
+
if (!useConfigStore.getState().enableNotifications) {
|
|
2175
|
+
return "";
|
|
2176
|
+
}
|
|
2173
2177
|
const id = `toast-${++counter}-${Date.now()}`;
|
|
2174
2178
|
const newToast = {
|
|
2175
2179
|
...toast,
|
|
@@ -2232,7 +2236,7 @@ const useHideScreenSharingButton = () => {
|
|
|
2232
2236
|
const useHideSwitchCameraButton = () => {
|
|
2233
2237
|
const videoTrack = getLocalTrack(MEDIA_TYPE.VIDEO);
|
|
2234
2238
|
const hideSwitchCameraButton = useConfigStore((state) => state.hideSwitchCameraButton);
|
|
2235
|
-
return hideSwitchCameraButton || !videoTrack;
|
|
2239
|
+
return hideSwitchCameraButton || !videoTrack?.originalTrack;
|
|
2236
2240
|
};
|
|
2237
2241
|
const useHideChatButton = () => {
|
|
2238
2242
|
const hideChatButton = useConfigStore((state) => state.hideChatButton);
|
|
@@ -3575,6 +3579,10 @@ eventBus.subscribe(INTERNAL_EVENTS.lifecycle.componentDidMount, () => {
|
|
|
3575
3579
|
});
|
|
3576
3580
|
});
|
|
3577
3581
|
useBaseStore.subscribe((state) => state.appState, (appState) => {
|
|
3582
|
+
const sessionType = useConfigStore.getState().sessionType;
|
|
3583
|
+
if (sessionType !== SESSION_TYPE.VIDEO) {
|
|
3584
|
+
return;
|
|
3585
|
+
}
|
|
3578
3586
|
if (appState === "active") {
|
|
3579
3587
|
resumeVideoTrack(VIDEO_PAUSE_AUTHORITY.BACKGROUND);
|
|
3580
3588
|
} else {
|
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",
|