@ethora/chat-component 24.11.25 → 24.11.26

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.
@@ -36,9 +36,10 @@ declare const onRealtimeMessage: (stanza: Element) => Promise<any>;
36
36
  declare const onMessageHistory: (stanza: any) => Promise<void>;
37
37
  declare const handleComposing: (stanza: Element, currentUser: string) => Promise<void>;
38
38
  declare const onPresenceInRoom: (stanza: Element | any) => void;
39
+ declare const onChatInvite: (stanza: Element, client: any) => Promise<void>;
39
40
  declare const onGetMembers: (stanza: Element) => void;
40
41
  declare const onGetRoomInfo: (stanza: Element) => void;
41
- declare const onGetLastMessageArchive: (stanza: Element, xmpp: any) => Promise<void>;
42
+ declare const onGetLastMessageArchive: (stanza: Element, xmpp: any) => void;
42
43
  declare const onNewRoomCreated: (stanza: Element, xmpp: any) => void;
43
44
  declare const onGetChatRooms: (stanza: Element, xmpp: any) => void;
44
- export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, onGetMembers, onGetRoomInfo, };
45
+ export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, onGetMembers, onGetRoomInfo, onChatInvite, };
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@xmpp/client';
2
2
 
3
- export declare function createRoom(title: string, description: string, client: Client): Promise<string>;
3
+ export declare function createRoom(title: string, description: string, client: Client, to?: string): Promise<string>;
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@xmpp/client';
2
2
 
3
- export declare const getHistory: (client: Client, chatJID: string, max: number, before?: number) => Promise<unknown>;
3
+ export declare const getHistory: (client: Client, chatJID: string, max: number, before?: number, otherId?: string) => Promise<unknown>;
@@ -1,3 +1,3 @@
1
1
  import { Client } from '@xmpp/client';
2
2
 
3
- export declare function getLastMessageArchive(client: Client, roomJID: string): void;
3
+ export declare function getLastMessage(client: Client, roomJID: string): void;
@@ -26,10 +26,11 @@ export declare class XmppClient {
26
26
  close(): void;
27
27
  unsubscribe(address: string): void;
28
28
  getRooms: () => Promise<unknown>;
29
- createRoomStanza(title: string, description: string): Promise<string>;
29
+ createRoomStanza(title: string, description: string, to?: string): Promise<string>;
30
+ inviteRoomRequest(to: string, roomJid: string): Promise<void>;
30
31
  leaveTheRoomStanza: (roomJID: string) => void;
31
32
  presenceInRoomStanza: (roomJID: string) => void;
32
- getHistoryStanza: (chatJID: string, max: number, before?: number) => Promise<void>;
33
+ getHistoryStanza: (chatJID: string, max: number, before?: number, id?: string) => Promise<void>;
33
34
  getLastMessageArchiveStanza(roomJID: string): void;
34
35
  setRoomImageStanza: (roomJid: string, roomThumbnail: string, type: string, roomBackground?: string) => void;
35
36
  getRoomInfoStanza: (roomJID: string) => void;
@@ -0,0 +1,3 @@
1
+ import { Middleware } from '@reduxjs/toolkit';
2
+
3
+ export declare const unreadMiddleware: Middleware;
@@ -36,6 +36,7 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
36
36
  setComposing(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
37
37
  chatJID: string;
38
38
  composing: boolean;
39
+ composingList?: string[];
39
40
  }>): void;
40
41
  setIsLoading: (state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
41
42
  chatJID?: string;
@@ -73,6 +74,7 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
73
74
  }, "roomMessages/deleteRoomMessage">, setComposing: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
74
75
  chatJID: string;
75
76
  composing: boolean;
77
+ composingList?: string[];
76
78
  }, "roomMessages/setComposing">, setIsLoading: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
77
79
  chatJID?: string;
78
80
  loading: boolean;
@@ -144,6 +144,12 @@ export interface IConfig {
144
144
  chatRoomStyles?: React.CSSProperties;
145
145
  setRoomJidInPath?: boolean;
146
146
  disableRoomMenu?: boolean;
147
+ defaultRooms?: string[] | ConfigRoom[];
148
+ }
149
+ interface ConfigRoom {
150
+ jid: string;
151
+ pinned: boolean;
152
+ _id: string;
147
153
  }
148
154
  export interface StorageUser {
149
155
  appId: string;
@@ -169,3 +175,4 @@ export interface MessageProps {
169
175
  export interface MediaMessageType {
170
176
  }
171
177
  export type ModalType = (typeof MODAL_TYPES)[keyof typeof MODAL_TYPES];
178
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "24.11.25",
3
+ "version": "24.11.26",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -23,10 +23,13 @@
23
23
  "@xmpp/client": "^0.13.1",
24
24
  "axios": "^1.7.2",
25
25
  "firebase": "^10.13.2",
26
+ "i": "^0.3.7",
26
27
  "js-sha256": "^0.11.0",
27
28
  "ltx": "^3.0.0",
29
+ "npm": "^10.9.1",
28
30
  "react": "^18.3.1",
29
31
  "react-dom": "^18.3.1",
32
+ "react-qr-code": "^2.0.15",
30
33
  "react-redux": "^9.1.0",
31
34
  "redux": "^5.0.1",
32
35
  "redux-saga": "^1.3.0",