@cometchat/calls-sdk-react-native 5.0.0-beta.5 → 5.0.0-beta.6
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 +12 -8
- package/dist/index.d.ts +4 -0
- package/dist/index.js +12 -2
- package/dist/index.mjs +12 -2
- package/package.json +6 -6
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";
|
|
@@ -357,6 +357,10 @@ type BaseState = {
|
|
|
357
357
|
startIndex: number;
|
|
358
358
|
endIndex: number;
|
|
359
359
|
};
|
|
360
|
+
sidebarVisibleParticipants: {
|
|
361
|
+
startIndex: number;
|
|
362
|
+
endIndex: number;
|
|
363
|
+
};
|
|
360
364
|
};
|
|
361
365
|
type Actions$5 = {
|
|
362
366
|
toggleParticipantListVisible: () => void;
|
|
@@ -369,7 +373,7 @@ type Actions$5 = {
|
|
|
369
373
|
isMobileSDK: () => boolean;
|
|
370
374
|
isMobile: () => boolean;
|
|
371
375
|
};
|
|
372
|
-
declare const useBaseStore:
|
|
376
|
+
declare const useBaseStore: zustand0.UseBoundStore<Omit<Omit<zustand0.StoreApi<BaseState & Actions$5>, "subscribe"> & {
|
|
373
377
|
subscribe: {
|
|
374
378
|
(listener: (selectedState: BaseState & Actions$5, previousSelectedState: BaseState & Actions$5) => void): () => void;
|
|
375
379
|
<U>(selector: (state: BaseState & Actions$5) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -449,7 +453,7 @@ type Actions$4 = {
|
|
|
449
453
|
endConference: () => Promise<void>;
|
|
450
454
|
stopRecording: () => Promise<void>;
|
|
451
455
|
};
|
|
452
|
-
declare const useConferenceStore:
|
|
456
|
+
declare const useConferenceStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
|
|
453
457
|
subscribe: {
|
|
454
458
|
(listener: (selectedState: ConferenceState & Actions$4, previousSelectedState: ConferenceState & Actions$4) => void): () => void;
|
|
455
459
|
<U>(selector: (state: ConferenceState & Actions$4) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -525,7 +529,7 @@ type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & Co
|
|
|
525
529
|
type Actions$3 = {
|
|
526
530
|
reset: () => void;
|
|
527
531
|
};
|
|
528
|
-
declare const useConfigStore:
|
|
532
|
+
declare const useConfigStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
|
|
529
533
|
subscribe: {
|
|
530
534
|
(listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
|
|
531
535
|
<U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -677,7 +681,7 @@ type Actions$2 = {
|
|
|
677
681
|
disconnect: () => Promise<void>;
|
|
678
682
|
reset: () => void;
|
|
679
683
|
};
|
|
680
|
-
declare const useConnectionStore:
|
|
684
|
+
declare const useConnectionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
|
|
681
685
|
subscribe: {
|
|
682
686
|
(listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
|
|
683
687
|
<U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -728,7 +732,7 @@ type Actions$1 = {
|
|
|
728
732
|
getParticipantById: (pid: string) => HumanParticipant | undefined;
|
|
729
733
|
reset: () => void;
|
|
730
734
|
};
|
|
731
|
-
declare const useParticipantStore:
|
|
735
|
+
declare const useParticipantStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
|
|
732
736
|
subscribe: {
|
|
733
737
|
(listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
|
|
734
738
|
<U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -774,7 +778,7 @@ type Actions = {
|
|
|
774
778
|
updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
|
|
775
779
|
updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
|
|
776
780
|
};
|
|
777
|
-
declare const useTracksStore:
|
|
781
|
+
declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
|
|
778
782
|
subscribe: {
|
|
779
783
|
(listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
|
|
780
784
|
<U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
@@ -1260,7 +1264,7 @@ interface TranslationState {
|
|
|
1260
1264
|
translations: Record<string, typeof __json_default_export>;
|
|
1261
1265
|
currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
|
|
1262
1266
|
}
|
|
1263
|
-
declare const useTranslationStore:
|
|
1267
|
+
declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
|
|
1264
1268
|
reset: () => void;
|
|
1265
1269
|
setLocale: (locale: CometChatSupportedLocale) => void;
|
|
1266
1270
|
}>, "subscribe"> & {
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1872,6 +1872,10 @@ const initialState$3 = {
|
|
|
1872
1872
|
visibleParticipants: {
|
|
1873
1873
|
startIndex: 0,
|
|
1874
1874
|
endIndex: 0
|
|
1875
|
+
},
|
|
1876
|
+
sidebarVisibleParticipants: {
|
|
1877
|
+
startIndex: 0,
|
|
1878
|
+
endIndex: 0
|
|
1875
1879
|
}
|
|
1876
1880
|
};
|
|
1877
1881
|
const useBaseStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.persist)((0, zustand_middleware.combine)(initialState$3, (set, get$1) => ({
|
|
@@ -2397,8 +2401,10 @@ function setReceiverConstraintsInternal() {
|
|
|
2397
2401
|
}
|
|
2398
2402
|
});
|
|
2399
2403
|
} else if (layout$1 === "SIDEBAR") {
|
|
2400
|
-
const
|
|
2401
|
-
|
|
2404
|
+
const { startIndex, endIndex } = useBaseStore.getState().sidebarVisibleParticipants;
|
|
2405
|
+
const allParticipants = getAllParticipants();
|
|
2406
|
+
const visibleSidebarParticipants = allParticipants.slice(startIndex, endIndex);
|
|
2407
|
+
visibleSidebarParticipants.forEach((participant) => {
|
|
2402
2408
|
const videoSources$1 = participant.sources?.get("video");
|
|
2403
2409
|
if (videoSources$1) {
|
|
2404
2410
|
Array.from(videoSources$1.keys()).forEach((source) => {
|
|
@@ -2424,6 +2430,9 @@ const setReceiverConstraints = debounce(setReceiverConstraintsInternal, 200);
|
|
|
2424
2430
|
useBaseStore.subscribe((state) => state.visibleParticipants, () => {
|
|
2425
2431
|
setReceiverConstraints();
|
|
2426
2432
|
});
|
|
2433
|
+
useBaseStore.subscribe((state) => state.sidebarVisibleParticipants, () => {
|
|
2434
|
+
setReceiverConstraints();
|
|
2435
|
+
});
|
|
2427
2436
|
useBaseStore.subscribe((state) => state.layout, () => {
|
|
2428
2437
|
setReceiverConstraints();
|
|
2429
2438
|
});
|
|
@@ -2562,6 +2571,7 @@ var ConferenceListener = class {
|
|
|
2562
2571
|
}
|
|
2563
2572
|
onConnectionEstablished() {
|
|
2564
2573
|
useConferenceStore.setState({ conferenceStatus: "joined" });
|
|
2574
|
+
setTimeout(setReceiverConstraints, 500);
|
|
2565
2575
|
}
|
|
2566
2576
|
onConnectionInterrupted() {
|
|
2567
2577
|
useConferenceStore.setState({ conferenceStatus: "interrupted" });
|
package/dist/index.mjs
CHANGED
|
@@ -1840,6 +1840,10 @@ const initialState$3 = {
|
|
|
1840
1840
|
visibleParticipants: {
|
|
1841
1841
|
startIndex: 0,
|
|
1842
1842
|
endIndex: 0
|
|
1843
|
+
},
|
|
1844
|
+
sidebarVisibleParticipants: {
|
|
1845
|
+
startIndex: 0,
|
|
1846
|
+
endIndex: 0
|
|
1843
1847
|
}
|
|
1844
1848
|
};
|
|
1845
1849
|
const useBaseStore = create()(subscribeWithSelector(persist(combine(initialState$3, (set, get$1) => ({
|
|
@@ -2365,8 +2369,10 @@ function setReceiverConstraintsInternal() {
|
|
|
2365
2369
|
}
|
|
2366
2370
|
});
|
|
2367
2371
|
} else if (layout$1 === "SIDEBAR") {
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2372
|
+
const { startIndex, endIndex } = useBaseStore.getState().sidebarVisibleParticipants;
|
|
2373
|
+
const allParticipants = getAllParticipants();
|
|
2374
|
+
const visibleSidebarParticipants = allParticipants.slice(startIndex, endIndex);
|
|
2375
|
+
visibleSidebarParticipants.forEach((participant) => {
|
|
2370
2376
|
const videoSources$1 = participant.sources?.get("video");
|
|
2371
2377
|
if (videoSources$1) {
|
|
2372
2378
|
Array.from(videoSources$1.keys()).forEach((source) => {
|
|
@@ -2392,6 +2398,9 @@ const setReceiverConstraints = debounce(setReceiverConstraintsInternal, 200);
|
|
|
2392
2398
|
useBaseStore.subscribe((state) => state.visibleParticipants, () => {
|
|
2393
2399
|
setReceiverConstraints();
|
|
2394
2400
|
});
|
|
2401
|
+
useBaseStore.subscribe((state) => state.sidebarVisibleParticipants, () => {
|
|
2402
|
+
setReceiverConstraints();
|
|
2403
|
+
});
|
|
2395
2404
|
useBaseStore.subscribe((state) => state.layout, () => {
|
|
2396
2405
|
setReceiverConstraints();
|
|
2397
2406
|
});
|
|
@@ -2530,6 +2539,7 @@ var ConferenceListener = class {
|
|
|
2530
2539
|
}
|
|
2531
2540
|
onConnectionEstablished() {
|
|
2532
2541
|
useConferenceStore.setState({ conferenceStatus: "joined" });
|
|
2542
|
+
setTimeout(setReceiverConstraints, 500);
|
|
2533
2543
|
}
|
|
2534
2544
|
onConnectionInterrupted() {
|
|
2535
2545
|
useConferenceStore.setState({ conferenceStatus: "interrupted" });
|
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.6",
|
|
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",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
"cometchat-calls-sdk-react-native.podspec"
|
|
14
14
|
],
|
|
15
15
|
"scripts": {},
|
|
16
|
-
"dependencies": {
|
|
16
|
+
"dependencies": {},
|
|
17
|
+
"devDependencies": {},
|
|
18
|
+
"peerDependencies": {
|
|
17
19
|
"@xmldom/xmldom": "^0.8.11",
|
|
18
20
|
"abab": "^2.0.6",
|
|
19
|
-
"clsx": "^2.1.1",
|
|
20
21
|
"promise.allsettled": "^1.0.7",
|
|
21
22
|
"text-encoding": "^0.7.0",
|
|
22
23
|
"valibot": "^1.2.0",
|
|
23
|
-
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1790.0.0+311766e3/lib-jitsi-meet.tgz"
|
|
24
|
+
"lib-jitsi-meet": "https://github.com/jitsi/lib-jitsi-meet/releases/download/v1790.0.0+311766e3/lib-jitsi-meet.tgz",
|
|
25
|
+
"zustand": "^5.0.4"
|
|
24
26
|
},
|
|
25
|
-
"devDependencies": {},
|
|
26
|
-
"peerDependencies": {},
|
|
27
27
|
"engines": {
|
|
28
28
|
"node": ">=18"
|
|
29
29
|
},
|