@cometchat/calls-sdk-react-native 5.0.0-beta.7 → 5.0.0-beta.8

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
@@ -754,6 +754,38 @@ declare const getMainParticipantFromState: (state: {
754
754
  localParticipant: HumanParticipant;
755
755
  }) => Participant$2;
756
756
  //#endregion
757
+ //#region calls-sdk-core/store/toast.d.ts
758
+ interface ToastAction {
759
+ label: string;
760
+ onPress: () => void;
761
+ }
762
+ interface ToastItem {
763
+ id: string;
764
+ message: string;
765
+ type: NotificationType;
766
+ duration: number;
767
+ position: 'top' | 'bottom';
768
+ action?: ToastAction;
769
+ createdAt: number;
770
+ }
771
+ interface ToastState {
772
+ toasts: ToastItem[];
773
+ }
774
+ interface ToastActions {
775
+ addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
776
+ removeToast: (id: string) => void;
777
+ clearAll: () => void;
778
+ reset: () => void;
779
+ }
780
+ declare const useToastStore: zustand7.UseBoundStore<zustand7.StoreApi<ToastState & ToastActions>>;
781
+ declare function showToast(params: {
782
+ message: string;
783
+ type?: NotificationType;
784
+ duration?: number;
785
+ position?: 'top' | 'bottom';
786
+ action?: ToastAction;
787
+ }): string;
788
+ //#endregion
757
789
  //#region calls-sdk-core/store/tracks.d.ts
758
790
  type Track = {
759
791
  local: boolean;
@@ -2660,7 +2692,7 @@ interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
2660
2692
  /**
2661
2693
  * @deprecated Use `sessionSettings` instead.
2662
2694
  */
2663
- callSettings: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2695
+ callSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2664
2696
  sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2665
2697
  }
2666
2698
  declare function AppReactNativeSDK(props: AppProps): React.JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as zustand0 from "zustand";
1
+ import * as zustand3 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: zustand0.UseBoundStore<Omit<Omit<zustand0.StoreApi<BaseState & Actions$5>, "subscribe"> & {
376
+ declare const useBaseStore: zustand3.UseBoundStore<Omit<Omit<zustand3.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: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConferenceState & Actions$4>, "subscribe"> & {
456
+ declare const useConferenceStore: zustand3.UseBoundStore<Omit<zustand3.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?: {
@@ -529,7 +529,7 @@ type ConfigState = ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & Co
529
529
  type Actions$3 = {
530
530
  reset: () => void;
531
531
  };
532
- declare const useConfigStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
532
+ declare const useConfigStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3>, "subscribe"> & {
533
533
  subscribe: {
534
534
  (listener: (selectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3, previousSelectedState: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => void): () => void;
535
535
  <U>(selector: (state: ConfigStateInternal & ConfigStateMobile & ConfigStateWeb & ConfigStateBoth & Actions$3) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -681,7 +681,7 @@ type Actions$2 = {
681
681
  disconnect: () => Promise<void>;
682
682
  reset: () => void;
683
683
  };
684
- declare const useConnectionStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
684
+ declare const useConnectionStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ConnectionState & Actions$2>, "subscribe"> & {
685
685
  subscribe: {
686
686
  (listener: (selectedState: ConnectionState & Actions$2, previousSelectedState: ConnectionState & Actions$2) => void): () => void;
687
687
  <U>(selector: (state: ConnectionState & Actions$2) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -732,7 +732,7 @@ type Actions$1 = {
732
732
  getParticipantById: (pid: string) => HumanParticipant | undefined;
733
733
  reset: () => void;
734
734
  };
735
- declare const useParticipantStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
735
+ declare const useParticipantStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<ParticipantsState & Actions$1>, "subscribe"> & {
736
736
  subscribe: {
737
737
  (listener: (selectedState: ParticipantsState & Actions$1, previousSelectedState: ParticipantsState & Actions$1) => void): () => void;
738
738
  <U>(selector: (state: ParticipantsState & Actions$1) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -754,6 +754,38 @@ declare const getMainParticipantFromState: (state: {
754
754
  localParticipant: HumanParticipant;
755
755
  }) => Participant$2;
756
756
  //#endregion
757
+ //#region calls-sdk-core/store/toast.d.ts
758
+ interface ToastAction {
759
+ label: string;
760
+ onPress: () => void;
761
+ }
762
+ interface ToastItem {
763
+ id: string;
764
+ message: string;
765
+ type: NotificationType;
766
+ duration: number;
767
+ position: 'top' | 'bottom';
768
+ action?: ToastAction;
769
+ createdAt: number;
770
+ }
771
+ interface ToastState {
772
+ toasts: ToastItem[];
773
+ }
774
+ interface ToastActions {
775
+ addToast: (toast: Omit<ToastItem, 'id' | 'createdAt'>) => string;
776
+ removeToast: (id: string) => void;
777
+ clearAll: () => void;
778
+ reset: () => void;
779
+ }
780
+ declare const useToastStore: zustand3.UseBoundStore<zustand3.StoreApi<ToastState & ToastActions>>;
781
+ declare function showToast(params: {
782
+ message: string;
783
+ type?: NotificationType;
784
+ duration?: number;
785
+ position?: 'top' | 'bottom';
786
+ action?: ToastAction;
787
+ }): string;
788
+ //#endregion
757
789
  //#region calls-sdk-core/store/tracks.d.ts
758
790
  type Track = {
759
791
  local: boolean;
@@ -778,7 +810,7 @@ type Actions = {
778
810
  updateTrack: (originalTrack: any, updatedTrack: Partial<Track>) => void;
779
811
  updateLocalTrack: (mediaType: MediaType, updatedTrack: Partial<Track>) => void;
780
812
  };
781
- declare const useTracksStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<TracksState & Actions>, "subscribe"> & {
813
+ declare const useTracksStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<TracksState & Actions>, "subscribe"> & {
782
814
  subscribe: {
783
815
  (listener: (selectedState: TracksState & Actions, previousSelectedState: TracksState & Actions) => void): () => void;
784
816
  <U>(selector: (state: TracksState & Actions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
@@ -1270,7 +1302,7 @@ interface TranslationState {
1270
1302
  translations: Record<string, typeof __json_default_export>;
1271
1303
  currentLocale: CometChatSupportedLocale | Omit<string, CometChatSupportedLocale>;
1272
1304
  }
1273
- declare const useTranslationStore: zustand0.UseBoundStore<Omit<zustand0.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
1305
+ declare const useTranslationStore: zustand3.UseBoundStore<Omit<zustand3.StoreApi<Omit<TranslationState, "reset" | "setLocale"> & {
1274
1306
  reset: () => void;
1275
1307
  setLocale: (locale: CometChatSupportedLocale) => void;
1276
1308
  }>, "subscribe"> & {
@@ -2660,7 +2692,7 @@ interface AppProps extends Partial<ConfigStateMobile & ConfigStateBoth> {
2660
2692
  /**
2661
2693
  * @deprecated Use `sessionSettings` instead.
2662
2694
  */
2663
- callSettings: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2695
+ callSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2664
2696
  sessionSettings?: CallSettings | Partial<ConfigStateMobile & ConfigStateBoth>;
2665
2697
  }
2666
2698
  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$7 = {
972
+ const initialState$8 = {
973
973
  sessionType: "VIDEO",
974
974
  autoStartRecording: false,
975
975
  layout: LAYOUT.TILE,
@@ -1007,7 +1007,7 @@ const initialState$7 = {
1007
1007
  enableCompanionMode: false,
1008
1008
  isPeerCall: false
1009
1009
  };
1010
- const useConfigStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$7, (set) => ({ reset: () => set(initialState$7) }))));
1010
+ const useConfigStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$8, (set) => ({ reset: () => set(initialState$8) }))));
1011
1011
  const setConfig = (config) => {
1012
1012
  useConfigStore.setState(config);
1013
1013
  };
@@ -1025,13 +1025,13 @@ const initialLocalParticipant = {
1025
1025
  type: "human",
1026
1026
  uid: "unknown"
1027
1027
  };
1028
- const initialState$6 = {
1028
+ const initialState$7 = {
1029
1029
  dominantSpeakers: [],
1030
1030
  localParticipant: initialLocalParticipant,
1031
1031
  participants: [],
1032
1032
  virtualParticipants: []
1033
1033
  };
1034
- const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$6, (set, get$1) => ({
1034
+ const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$7, (set, get$1) => ({
1035
1035
  addParticipant: (participant) => {
1036
1036
  set((state) => ({ participants: state.participants.some((p) => p.pid === participant.pid) ? state.participants.map((p) => p.pid === participant.pid ? {
1037
1037
  ...p,
@@ -1112,7 +1112,7 @@ const useParticipantStore = (0, zustand.create)()((0, zustand_middleware.subscri
1112
1112
  }
1113
1113
  return get$1().participants.find((p) => p.pid === pid);
1114
1114
  },
1115
- reset: () => set(initialState$6)
1115
+ reset: () => set(initialState$7)
1116
1116
  }))));
1117
1117
  function useAllParticipants() {
1118
1118
  const localParticipant = useParticipantStore((state) => state.localParticipant);
@@ -1246,7 +1246,7 @@ useParticipantStore.subscribe((state) => state.participants.filter((p) => p.uid)
1246
1246
 
1247
1247
  //#endregion
1248
1248
  //#region calls-sdk-core/store/conference.ts
1249
- const initialState$5 = {
1249
+ const initialState$6 = {
1250
1250
  conference: null,
1251
1251
  conferenceJoined: false,
1252
1252
  conferenceJoinedAt: null,
@@ -1261,7 +1261,7 @@ const initialState$5 = {
1261
1261
  },
1262
1262
  isRecording: false
1263
1263
  };
1264
- const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$5, (set) => ({
1264
+ const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$6, (set) => ({
1265
1265
  conferenceWillJoin: (conference) => {
1266
1266
  if (typeof window?.APP !== "undefined") {
1267
1267
  window.APP.conference._room = conference;
@@ -1272,7 +1272,7 @@ const useConferenceStore = (0, zustand.create)()((0, zustand_middleware.subscrib
1272
1272
  });
1273
1273
  },
1274
1274
  reset: () => {
1275
- set(initialState$5);
1275
+ set(initialState$6);
1276
1276
  },
1277
1277
  raiseHand: (participantId, timestamp) => {
1278
1278
  set((state) => ({ raiseHandMap: new Map(state.raiseHandMap).set(participantId, timestamp) }));
@@ -1446,7 +1446,7 @@ useConferenceStore.subscribe((state) => state.conference, (conference) => {
1446
1446
 
1447
1447
  //#endregion
1448
1448
  //#region calls-sdk-core/store/tracks.ts
1449
- const initialState$4 = {
1449
+ const initialState$5 = {
1450
1450
  tracks: [],
1451
1451
  permissions: {
1452
1452
  audio: false,
@@ -1454,9 +1454,9 @@ const initialState$4 = {
1454
1454
  initialized: false
1455
1455
  }
1456
1456
  };
1457
- const useTracksStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$4, (set, get$1) => ({
1457
+ const useTracksStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$5, (set, get$1) => ({
1458
1458
  reset: () => set({
1459
- ...initialState$4,
1459
+ ...initialState$5,
1460
1460
  permissions: get$1().permissions
1461
1461
  }),
1462
1462
  addTrack: (originalTrack) => set((state) => {
@@ -1838,7 +1838,7 @@ function updateConfig(config) {
1838
1838
 
1839
1839
  //#endregion
1840
1840
  //#region calls-sdk-core/store/base.ts
1841
- const initialState$3 = {
1841
+ const initialState$4 = {
1842
1842
  audioModeMenuVisible: false,
1843
1843
  audioModes: [],
1844
1844
  audioInputDevices: [],
@@ -1885,12 +1885,12 @@ const initialState$3 = {
1885
1885
  endIndex: 0
1886
1886
  }
1887
1887
  };
1888
- const useBaseStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.persist)((0, zustand_middleware.combine)(initialState$3, (set, get$1) => ({
1888
+ const useBaseStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.persist)((0, zustand_middleware.combine)(initialState$4, (set, get$1) => ({
1889
1889
  addSubscriptions: (subscriptions) => {
1890
1890
  useBaseStore.setState((state) => ({ subscriptions: [...state.subscriptions, ...subscriptions] }));
1891
1891
  },
1892
1892
  reset: () => set((state) => ({
1893
- ...initialState$3,
1893
+ ...initialState$4,
1894
1894
  audioInputDevice: state.audioInputDevice,
1895
1895
  audioOutputDevice: state.audioOutputDevice,
1896
1896
  videoInputDevice: state.videoInputDevice,
@@ -2125,13 +2125,13 @@ initBaseStoreSubscriptions();
2125
2125
 
2126
2126
  //#endregion
2127
2127
  //#region calls-sdk-core/store/connection.ts
2128
- const initialState$2 = {
2128
+ const initialState$3 = {
2129
2129
  connection: undefined,
2130
2130
  connectionStatus: "initial",
2131
2131
  error: undefined,
2132
2132
  timeEstablished: undefined
2133
2133
  };
2134
- const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$2, (set) => ({
2134
+ const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscribeWithSelector)((0, zustand_middleware.combine)(initialState$3, (set) => ({
2135
2135
  connectionEstablished: (connection) => set({
2136
2136
  connection,
2137
2137
  connectionStatus: "connected",
@@ -2164,10 +2164,10 @@ const useConnectionStore = (0, zustand.create)()((0, zustand_middleware.subscrib
2164
2164
  eventBus.stopEmitting();
2165
2165
  await tryCatch(connection.disconnect());
2166
2166
  eventBus.publish({ type: EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed }, true);
2167
- set(initialState$2);
2167
+ set(initialState$3);
2168
2168
  }
2169
2169
  },
2170
- reset: () => set(initialState$2)
2170
+ reset: () => set(initialState$3)
2171
2171
  }))));
2172
2172
  function waitForConnection() {
2173
2173
  const { connectionStatus } = useConnectionStore.getState();
@@ -2191,6 +2191,52 @@ function waitForConnection() {
2191
2191
  });
2192
2192
  }
2193
2193
 
2194
+ //#endregion
2195
+ //#region calls-sdk-core/store/toast.ts
2196
+ const MAX_TOASTS = 3;
2197
+ const initialState$2 = { toasts: [] };
2198
+ let counter = 0;
2199
+ const useToastStore = (0, zustand.create)((set) => ({
2200
+ ...initialState$2,
2201
+ addToast: (toast) => {
2202
+ if (!getIsConferenceJoined()) {
2203
+ return "";
2204
+ }
2205
+ const id = `toast-${++counter}-${Date.now()}`;
2206
+ const newToast = {
2207
+ ...toast,
2208
+ id,
2209
+ createdAt: Date.now()
2210
+ };
2211
+ set((state) => {
2212
+ const updated = [...state.toasts, newToast];
2213
+ if (updated.length > MAX_TOASTS) {
2214
+ return { toasts: updated.slice(-MAX_TOASTS) };
2215
+ }
2216
+ return { toasts: updated };
2217
+ });
2218
+ return id;
2219
+ },
2220
+ removeToast: (id) => {
2221
+ set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
2222
+ },
2223
+ clearAll: () => {
2224
+ set(initialState$2);
2225
+ },
2226
+ reset: () => {
2227
+ set(initialState$2);
2228
+ }
2229
+ }));
2230
+ function showToast(params) {
2231
+ return useToastStore.getState().addToast({
2232
+ message: params.message,
2233
+ type: params.type ?? "info",
2234
+ duration: params.duration ?? 3e3,
2235
+ position: params.position ?? "bottom",
2236
+ action: params.action
2237
+ });
2238
+ }
2239
+
2194
2240
  //#endregion
2195
2241
  //#region calls-sdk-core/store/utils/hooks.ts
2196
2242
  const useHideMuteAudioButton = () => {
@@ -3009,6 +3055,7 @@ function resetAllStores() {
3009
3055
  useConfigStore.getState().reset();
3010
3056
  useConnectionStore.getState().reset();
3011
3057
  useParticipantStore.getState().reset();
3058
+ useToastStore.getState().reset();
3012
3059
  useTracksStore.getState().reset();
3013
3060
  }
3014
3061
 
@@ -4000,6 +4047,13 @@ const commonStyles = react_native.StyleSheet.create({
4000
4047
  borderDefault: { borderColor: colors.border.default },
4001
4048
  borderDark: { borderColor: colors.border.dark },
4002
4049
  borderHighlight: { borderColor: colors.border.highlight },
4050
+ absoluteFill: {
4051
+ position: "absolute",
4052
+ top: 0,
4053
+ bottom: 0,
4054
+ left: 0,
4055
+ right: 0
4056
+ },
4003
4057
  flex1: { flex: 1 },
4004
4058
  flexRow: { flexDirection: "row" },
4005
4059
  flexColumn: { flexDirection: "column" },
@@ -4521,7 +4575,11 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
4521
4575
  return null;
4522
4576
  }
4523
4577
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Animated.View, {
4524
- style: [styles$25.videoContainer, { opacity: fadeAnim }],
4578
+ style: [
4579
+ commonStyles.absoluteFill,
4580
+ styles$25.videoContainer,
4581
+ { opacity: fadeAnim }
4582
+ ],
4525
4583
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native_webrtc.RTCView, {
4526
4584
  streamURL: streamURL.toURL(),
4527
4585
  style: [styles$25.video, style],
@@ -4534,8 +4592,7 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
4534
4592
  const styles$25 = react_native.StyleSheet.create({
4535
4593
  videoContainer: {
4536
4594
  height: "100%",
4537
- width: "100%",
4538
- ...react_native.StyleSheet.absoluteFillObject
4595
+ width: "100%"
4539
4596
  },
4540
4597
  video: {
4541
4598
  width: "100%",
@@ -5009,7 +5066,11 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
5009
5066
  return null;
5010
5067
  }
5011
5068
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.Animated.View, {
5012
- style: [styles$18.overlay, { opacity }],
5069
+ style: [
5070
+ commonStyles.absoluteFill,
5071
+ styles$18.overlay,
5072
+ { opacity }
5073
+ ],
5013
5074
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.ActivityIndicator, {
5014
5075
  size: "large",
5015
5076
  color: "#fff"
@@ -5021,7 +5082,6 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
5021
5082
  }
5022
5083
  const styles$18 = react_native.StyleSheet.create({
5023
5084
  overlay: {
5024
- ...react_native.StyleSheet.absoluteFillObject,
5025
5085
  justifyContent: "center",
5026
5086
  alignItems: "center",
5027
5087
  backgroundColor: "#1A1A1A",
@@ -5199,7 +5259,6 @@ function showConfirmationDialog(title, description, confirmText, cancelText, onC
5199
5259
  const { width } = react_native.Dimensions.get("window");
5200
5260
  const styles$15 = react_native.StyleSheet.create({
5201
5261
  backdrop: {
5202
- ...react_native.StyleSheet.absoluteFillObject,
5203
5262
  backgroundColor: "rgba(0, 0, 0, 0.8)",
5204
5263
  justifyContent: "center",
5205
5264
  alignItems: "center",
@@ -5298,7 +5357,7 @@ function ConfirmationDialog() {
5298
5357
  ],
5299
5358
  onRequestClose: handleBackdropPress,
5300
5359
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Pressable, {
5301
- style: styles$15.backdrop,
5360
+ style: [commonStyles.absoluteFill, styles$15.backdrop],
5302
5361
  onPress: handleBackdropPress,
5303
5362
  testID: "cometchat-confirmation-dialog-backdrop",
5304
5363
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
@@ -5370,7 +5429,7 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
5370
5429
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [isVisible && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.TouchableWithoutFeedback, {
5371
5430
  onPress: onClose,
5372
5431
  testID: "cometchat-bottom-sheet-backdrop",
5373
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: styles$14.backdrop })
5432
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, { style: [commonStyles.absoluteFill, styles$14.backdrop] })
5374
5433
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_native.Animated.View, {
5375
5434
  testID,
5376
5435
  style: [
@@ -5386,7 +5445,6 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
5386
5445
  };
5387
5446
  const styles$14 = react_native.StyleSheet.create({
5388
5447
  backdrop: {
5389
- ...react_native.StyleSheet.absoluteFillObject,
5390
5448
  backgroundColor: "rgba(0,0,0,0.5)",
5391
5449
  zIndex: 1
5392
5450
  },
@@ -5779,14 +5837,15 @@ const FullScreenDialog = ({ children, visible = false }) => {
5779
5837
  return null;
5780
5838
  }
5781
5839
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Animated.View, {
5782
- style: [styles$10.container, { opacity: fadeAnim }],
5840
+ style: [
5841
+ commonStyles.absoluteFill,
5842
+ styles$10.container,
5843
+ { opacity: fadeAnim }
5844
+ ],
5783
5845
  children
5784
5846
  });
5785
5847
  };
5786
- const styles$10 = react_native.StyleSheet.create({ container: {
5787
- ...react_native.StyleSheet.absoluteFillObject,
5788
- zIndex: 1e3
5789
- } });
5848
+ const styles$10 = react_native.StyleSheet.create({ container: { zIndex: 1e3 } });
5790
5849
  var FullScreenDialog_native_default = FullScreenDialog;
5791
5850
 
5792
5851
  //#endregion
@@ -6591,45 +6650,6 @@ const styles$2 = react_native.StyleSheet.create({
6591
6650
  }
6592
6651
  });
6593
6652
 
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
6653
  //#endregion
6634
6654
  //#region src/ui/toast/Toast.native.tsx
6635
6655
  const SLIDE_IN_DURATION = 300;
@@ -6835,13 +6855,6 @@ const styles$1 = react_native.StyleSheet.create({
6835
6855
  alignItems: "center",
6836
6856
  gap: GRID_GAP,
6837
6857
  paddingHorizontal: 20
6838
- },
6839
- loadingContainer: {
6840
- ...react_native.StyleSheet.absoluteFillObject,
6841
- justifyContent: "center",
6842
- alignItems: "center",
6843
- backgroundColor: "#000",
6844
- zIndex: 1e3
6845
6858
  }
6846
6859
  });
6847
6860
  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$7 = {
940
+ const initialState$8 = {
941
941
  sessionType: "VIDEO",
942
942
  autoStartRecording: false,
943
943
  layout: LAYOUT.TILE,
@@ -975,7 +975,7 @@ const initialState$7 = {
975
975
  enableCompanionMode: false,
976
976
  isPeerCall: false
977
977
  };
978
- const useConfigStore = create()(subscribeWithSelector(combine(initialState$7, (set) => ({ reset: () => set(initialState$7) }))));
978
+ const useConfigStore = create()(subscribeWithSelector(combine(initialState$8, (set) => ({ reset: () => set(initialState$8) }))));
979
979
  const setConfig = (config) => {
980
980
  useConfigStore.setState(config);
981
981
  };
@@ -993,13 +993,13 @@ const initialLocalParticipant = {
993
993
  type: "human",
994
994
  uid: "unknown"
995
995
  };
996
- const initialState$6 = {
996
+ const initialState$7 = {
997
997
  dominantSpeakers: [],
998
998
  localParticipant: initialLocalParticipant,
999
999
  participants: [],
1000
1000
  virtualParticipants: []
1001
1001
  };
1002
- const useParticipantStore = create()(subscribeWithSelector(combine(initialState$6, (set, get$1) => ({
1002
+ const useParticipantStore = create()(subscribeWithSelector(combine(initialState$7, (set, get$1) => ({
1003
1003
  addParticipant: (participant) => {
1004
1004
  set((state) => ({ participants: state.participants.some((p) => p.pid === participant.pid) ? state.participants.map((p) => p.pid === participant.pid ? {
1005
1005
  ...p,
@@ -1080,7 +1080,7 @@ const useParticipantStore = create()(subscribeWithSelector(combine(initialState$
1080
1080
  }
1081
1081
  return get$1().participants.find((p) => p.pid === pid);
1082
1082
  },
1083
- reset: () => set(initialState$6)
1083
+ reset: () => set(initialState$7)
1084
1084
  }))));
1085
1085
  function useAllParticipants() {
1086
1086
  const localParticipant = useParticipantStore((state) => state.localParticipant);
@@ -1214,7 +1214,7 @@ useParticipantStore.subscribe((state) => state.participants.filter((p) => p.uid)
1214
1214
 
1215
1215
  //#endregion
1216
1216
  //#region calls-sdk-core/store/conference.ts
1217
- const initialState$5 = {
1217
+ const initialState$6 = {
1218
1218
  conference: null,
1219
1219
  conferenceJoined: false,
1220
1220
  conferenceJoinedAt: null,
@@ -1229,7 +1229,7 @@ const initialState$5 = {
1229
1229
  },
1230
1230
  isRecording: false
1231
1231
  };
1232
- const useConferenceStore = create()(subscribeWithSelector(combine(initialState$5, (set) => ({
1232
+ const useConferenceStore = create()(subscribeWithSelector(combine(initialState$6, (set) => ({
1233
1233
  conferenceWillJoin: (conference) => {
1234
1234
  if (typeof window?.APP !== "undefined") {
1235
1235
  window.APP.conference._room = conference;
@@ -1240,7 +1240,7 @@ const useConferenceStore = create()(subscribeWithSelector(combine(initialState$5
1240
1240
  });
1241
1241
  },
1242
1242
  reset: () => {
1243
- set(initialState$5);
1243
+ set(initialState$6);
1244
1244
  },
1245
1245
  raiseHand: (participantId, timestamp) => {
1246
1246
  set((state) => ({ raiseHandMap: new Map(state.raiseHandMap).set(participantId, timestamp) }));
@@ -1414,7 +1414,7 @@ useConferenceStore.subscribe((state) => state.conference, (conference) => {
1414
1414
 
1415
1415
  //#endregion
1416
1416
  //#region calls-sdk-core/store/tracks.ts
1417
- const initialState$4 = {
1417
+ const initialState$5 = {
1418
1418
  tracks: [],
1419
1419
  permissions: {
1420
1420
  audio: false,
@@ -1422,9 +1422,9 @@ const initialState$4 = {
1422
1422
  initialized: false
1423
1423
  }
1424
1424
  };
1425
- const useTracksStore = create()(subscribeWithSelector(combine(initialState$4, (set, get$1) => ({
1425
+ const useTracksStore = create()(subscribeWithSelector(combine(initialState$5, (set, get$1) => ({
1426
1426
  reset: () => set({
1427
- ...initialState$4,
1427
+ ...initialState$5,
1428
1428
  permissions: get$1().permissions
1429
1429
  }),
1430
1430
  addTrack: (originalTrack) => set((state) => {
@@ -1806,7 +1806,7 @@ function updateConfig(config) {
1806
1806
 
1807
1807
  //#endregion
1808
1808
  //#region calls-sdk-core/store/base.ts
1809
- const initialState$3 = {
1809
+ const initialState$4 = {
1810
1810
  audioModeMenuVisible: false,
1811
1811
  audioModes: [],
1812
1812
  audioInputDevices: [],
@@ -1853,12 +1853,12 @@ const initialState$3 = {
1853
1853
  endIndex: 0
1854
1854
  }
1855
1855
  };
1856
- const useBaseStore = create()(subscribeWithSelector(persist(combine(initialState$3, (set, get$1) => ({
1856
+ const useBaseStore = create()(subscribeWithSelector(persist(combine(initialState$4, (set, get$1) => ({
1857
1857
  addSubscriptions: (subscriptions) => {
1858
1858
  useBaseStore.setState((state) => ({ subscriptions: [...state.subscriptions, ...subscriptions] }));
1859
1859
  },
1860
1860
  reset: () => set((state) => ({
1861
- ...initialState$3,
1861
+ ...initialState$4,
1862
1862
  audioInputDevice: state.audioInputDevice,
1863
1863
  audioOutputDevice: state.audioOutputDevice,
1864
1864
  videoInputDevice: state.videoInputDevice,
@@ -2093,13 +2093,13 @@ initBaseStoreSubscriptions();
2093
2093
 
2094
2094
  //#endregion
2095
2095
  //#region calls-sdk-core/store/connection.ts
2096
- const initialState$2 = {
2096
+ const initialState$3 = {
2097
2097
  connection: undefined,
2098
2098
  connectionStatus: "initial",
2099
2099
  error: undefined,
2100
2100
  timeEstablished: undefined
2101
2101
  };
2102
- const useConnectionStore = create()(subscribeWithSelector(combine(initialState$2, (set) => ({
2102
+ const useConnectionStore = create()(subscribeWithSelector(combine(initialState$3, (set) => ({
2103
2103
  connectionEstablished: (connection) => set({
2104
2104
  connection,
2105
2105
  connectionStatus: "connected",
@@ -2132,10 +2132,10 @@ const useConnectionStore = create()(subscribeWithSelector(combine(initialState$2
2132
2132
  eventBus.stopEmitting();
2133
2133
  await tryCatch(connection.disconnect());
2134
2134
  eventBus.publish({ type: EVENT_LISTENER_METHODS.SessionStatusListener.onConnectionClosed }, true);
2135
- set(initialState$2);
2135
+ set(initialState$3);
2136
2136
  }
2137
2137
  },
2138
- reset: () => set(initialState$2)
2138
+ reset: () => set(initialState$3)
2139
2139
  }))));
2140
2140
  function waitForConnection() {
2141
2141
  const { connectionStatus } = useConnectionStore.getState();
@@ -2159,6 +2159,52 @@ function waitForConnection() {
2159
2159
  });
2160
2160
  }
2161
2161
 
2162
+ //#endregion
2163
+ //#region calls-sdk-core/store/toast.ts
2164
+ const MAX_TOASTS = 3;
2165
+ const initialState$2 = { toasts: [] };
2166
+ let counter = 0;
2167
+ const useToastStore = create((set) => ({
2168
+ ...initialState$2,
2169
+ addToast: (toast) => {
2170
+ if (!getIsConferenceJoined()) {
2171
+ return "";
2172
+ }
2173
+ const id = `toast-${++counter}-${Date.now()}`;
2174
+ const newToast = {
2175
+ ...toast,
2176
+ id,
2177
+ createdAt: Date.now()
2178
+ };
2179
+ set((state) => {
2180
+ const updated = [...state.toasts, newToast];
2181
+ if (updated.length > MAX_TOASTS) {
2182
+ return { toasts: updated.slice(-MAX_TOASTS) };
2183
+ }
2184
+ return { toasts: updated };
2185
+ });
2186
+ return id;
2187
+ },
2188
+ removeToast: (id) => {
2189
+ set((state) => ({ toasts: state.toasts.filter((t) => t.id !== id) }));
2190
+ },
2191
+ clearAll: () => {
2192
+ set(initialState$2);
2193
+ },
2194
+ reset: () => {
2195
+ set(initialState$2);
2196
+ }
2197
+ }));
2198
+ function showToast(params) {
2199
+ return useToastStore.getState().addToast({
2200
+ message: params.message,
2201
+ type: params.type ?? "info",
2202
+ duration: params.duration ?? 3e3,
2203
+ position: params.position ?? "bottom",
2204
+ action: params.action
2205
+ });
2206
+ }
2207
+
2162
2208
  //#endregion
2163
2209
  //#region calls-sdk-core/store/utils/hooks.ts
2164
2210
  const useHideMuteAudioButton = () => {
@@ -2977,6 +3023,7 @@ function resetAllStores() {
2977
3023
  useConfigStore.getState().reset();
2978
3024
  useConnectionStore.getState().reset();
2979
3025
  useParticipantStore.getState().reset();
3026
+ useToastStore.getState().reset();
2980
3027
  useTracksStore.getState().reset();
2981
3028
  }
2982
3029
 
@@ -3968,6 +4015,13 @@ const commonStyles = StyleSheet.create({
3968
4015
  borderDefault: { borderColor: colors.border.default },
3969
4016
  borderDark: { borderColor: colors.border.dark },
3970
4017
  borderHighlight: { borderColor: colors.border.highlight },
4018
+ absoluteFill: {
4019
+ position: "absolute",
4020
+ top: 0,
4021
+ bottom: 0,
4022
+ left: 0,
4023
+ right: 0
4024
+ },
3971
4025
  flex1: { flex: 1 },
3972
4026
  flexRow: { flexDirection: "row" },
3973
4027
  flexColumn: { flexDirection: "column" },
@@ -4489,7 +4543,11 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
4489
4543
  return null;
4490
4544
  }
4491
4545
  return /* @__PURE__ */ jsx(Animated.View, {
4492
- style: [styles$25.videoContainer, { opacity: fadeAnim }],
4546
+ style: [
4547
+ commonStyles.absoluteFill,
4548
+ styles$25.videoContainer,
4549
+ { opacity: fadeAnim }
4550
+ ],
4493
4551
  children: /* @__PURE__ */ jsx(RTCView, {
4494
4552
  streamURL: streamURL.toURL(),
4495
4553
  style: [styles$25.video, style],
@@ -4502,8 +4560,7 @@ const VideoNative = ({ videoTrack, style, objectFit = "cover", mirror = false, m
4502
4560
  const styles$25 = StyleSheet.create({
4503
4561
  videoContainer: {
4504
4562
  height: "100%",
4505
- width: "100%",
4506
- ...StyleSheet.absoluteFillObject
4563
+ width: "100%"
4507
4564
  },
4508
4565
  video: {
4509
4566
  width: "100%",
@@ -4977,7 +5034,11 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
4977
5034
  return null;
4978
5035
  }
4979
5036
  return /* @__PURE__ */ jsxs(Animated.View, {
4980
- style: [styles$18.overlay, { opacity }],
5037
+ style: [
5038
+ commonStyles.absoluteFill,
5039
+ styles$18.overlay,
5040
+ { opacity }
5041
+ ],
4981
5042
  children: [/* @__PURE__ */ jsx(ActivityIndicator, {
4982
5043
  size: "large",
4983
5044
  color: "#fff"
@@ -4989,7 +5050,6 @@ function ProcessingOverlay({ message, visible = true, animated = false }) {
4989
5050
  }
4990
5051
  const styles$18 = StyleSheet.create({
4991
5052
  overlay: {
4992
- ...StyleSheet.absoluteFillObject,
4993
5053
  justifyContent: "center",
4994
5054
  alignItems: "center",
4995
5055
  backgroundColor: "#1A1A1A",
@@ -5167,7 +5227,6 @@ function showConfirmationDialog(title, description, confirmText, cancelText, onC
5167
5227
  const { width } = Dimensions.get("window");
5168
5228
  const styles$15 = StyleSheet.create({
5169
5229
  backdrop: {
5170
- ...StyleSheet.absoluteFillObject,
5171
5230
  backgroundColor: "rgba(0, 0, 0, 0.8)",
5172
5231
  justifyContent: "center",
5173
5232
  alignItems: "center",
@@ -5266,7 +5325,7 @@ function ConfirmationDialog() {
5266
5325
  ],
5267
5326
  onRequestClose: handleBackdropPress,
5268
5327
  children: /* @__PURE__ */ jsx(Pressable, {
5269
- style: styles$15.backdrop,
5328
+ style: [commonStyles.absoluteFill, styles$15.backdrop],
5270
5329
  onPress: handleBackdropPress,
5271
5330
  testID: "cometchat-confirmation-dialog-backdrop",
5272
5331
  children: /* @__PURE__ */ jsx(View, {
@@ -5338,7 +5397,7 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
5338
5397
  return /* @__PURE__ */ jsxs(Fragment, { children: [isVisible && /* @__PURE__ */ jsx(TouchableWithoutFeedback, {
5339
5398
  onPress: onClose,
5340
5399
  testID: "cometchat-bottom-sheet-backdrop",
5341
- children: /* @__PURE__ */ jsx(View, { style: styles$14.backdrop })
5400
+ children: /* @__PURE__ */ jsx(View, { style: [commonStyles.absoluteFill, styles$14.backdrop] })
5342
5401
  }), /* @__PURE__ */ jsxs(Animated.View, {
5343
5402
  testID,
5344
5403
  style: [
@@ -5354,7 +5413,6 @@ const BottomSheet = ({ children, isVisible, onClose, maxHeight = SCREEN_HEIGHT *
5354
5413
  };
5355
5414
  const styles$14 = StyleSheet.create({
5356
5415
  backdrop: {
5357
- ...StyleSheet.absoluteFillObject,
5358
5416
  backgroundColor: "rgba(0,0,0,0.5)",
5359
5417
  zIndex: 1
5360
5418
  },
@@ -5747,14 +5805,15 @@ const FullScreenDialog = ({ children, visible = false }) => {
5747
5805
  return null;
5748
5806
  }
5749
5807
  return /* @__PURE__ */ jsx(Animated.View, {
5750
- style: [styles$10.container, { opacity: fadeAnim }],
5808
+ style: [
5809
+ commonStyles.absoluteFill,
5810
+ styles$10.container,
5811
+ { opacity: fadeAnim }
5812
+ ],
5751
5813
  children
5752
5814
  });
5753
5815
  };
5754
- const styles$10 = StyleSheet.create({ container: {
5755
- ...StyleSheet.absoluteFillObject,
5756
- zIndex: 1e3
5757
- } });
5816
+ const styles$10 = StyleSheet.create({ container: { zIndex: 1e3 } });
5758
5817
  var FullScreenDialog_native_default = FullScreenDialog;
5759
5818
 
5760
5819
  //#endregion
@@ -6559,45 +6618,6 @@ const styles$2 = StyleSheet.create({
6559
6618
  }
6560
6619
  });
6561
6620
 
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
6621
  //#endregion
6602
6622
  //#region src/ui/toast/Toast.native.tsx
6603
6623
  const SLIDE_IN_DURATION = 300;
@@ -6803,13 +6823,6 @@ const styles$1 = StyleSheet.create({
6803
6823
  alignItems: "center",
6804
6824
  gap: GRID_GAP,
6805
6825
  paddingHorizontal: 20
6806
- },
6807
- loadingContainer: {
6808
- ...StyleSheet.absoluteFillObject,
6809
- justifyContent: "center",
6810
- alignItems: "center",
6811
- backgroundColor: "#000",
6812
- zIndex: 1e3
6813
6826
  }
6814
6827
  });
6815
6828
  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.7",
3
+ "version": "5.0.0-beta.8",
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",