@ethora/chat-component 25.6.2 → 25.6.4
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/README.md +392 -99
- package/dist/helpers/initRoomsPresence.d.ts +1 -1
- package/dist/hooks/useHeapSender.d.ts +4 -0
- package/dist/hooks/useMessageHeapState.d.ts +1 -1
- package/dist/main.js +3286 -3247
- package/dist/main.js.map +1 -1
- package/dist/networking/stanzaHandlers.d.ts +2 -1
- package/dist/networking/xmpp/handlePong.xmpp.d.ts +0 -6
- package/dist/networking/xmpp/sendPing.xmpp.d.ts +0 -6
- package/dist/networking/xmppClient.d.ts +3 -3
- package/dist/roomStore/roomHeapSlice.d.ts +11 -6
- package/dist/roomStore/roomsSlice.d.ts +1 -5
- package/dist/types/models/message.model.d.ts +0 -1
- package/dist/types/models/xmpp.model.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Element } from 'ltx';
|
|
2
|
+
import { IMessage } from '../types/types';
|
|
2
3
|
import { default as XmppClient } from './xmppClient';
|
|
3
|
-
declare const onRealtimeMessage: (stanza: Element) => Promise<
|
|
4
|
+
declare const onRealtimeMessage: (stanza: Element) => Promise<IMessage>;
|
|
4
5
|
declare const onReactionMessage: (stanza: Element) => Promise<void>;
|
|
5
6
|
declare const onDeleteMessage: (stanza: Element) => Promise<void>;
|
|
6
7
|
declare const onEditMessage: (stanza: Element) => Promise<void>;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks if the stanza is a pong (IQ result) for the given pingId.
|
|
3
|
-
* @param stanza - The stanza to check
|
|
4
|
-
* @param pingId - The ping ID to match
|
|
5
|
-
* @returns true if the stanza is a pong for the pingId, false otherwise
|
|
6
|
-
*/
|
|
7
1
|
export declare function isPong(stanza: any, pingId: string): boolean;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sends an XMPP ping stanza (XEP-0199) to the specified JID (usually the server or peer).
|
|
3
|
-
* @param client - The XMPP client instance
|
|
4
|
-
* @param to - The JID to ping (usually the server domain)
|
|
5
|
-
* @param id - Optional unique ID for the ping stanza
|
|
6
|
-
*/
|
|
7
1
|
export declare function sendPing(client: any, to: string, id?: string): string;
|
|
@@ -8,17 +8,19 @@ export declare class XmppClient implements XmppClientInterface {
|
|
|
8
8
|
conference: string;
|
|
9
9
|
username: string;
|
|
10
10
|
status: string;
|
|
11
|
+
resource: string;
|
|
11
12
|
password: string;
|
|
12
13
|
reconnectAttempts: number;
|
|
13
14
|
maxReconnectAttempts: number;
|
|
14
15
|
reconnectDelay: number;
|
|
16
|
+
private reconnecting;
|
|
17
|
+
private reconnectPromise;
|
|
15
18
|
checkOnline(): boolean;
|
|
16
19
|
pingInterval: any;
|
|
17
20
|
pingTimeout: any;
|
|
18
21
|
lastPingId: string | null;
|
|
19
22
|
pingIntervalMs: number;
|
|
20
23
|
pongTimeoutMs: number;
|
|
21
|
-
pingOnTimeoutEnabled: boolean;
|
|
22
24
|
pingOnSendEnabled: boolean;
|
|
23
25
|
constructor(username: string, password: string, xmppSettings?: xmppSettingsInterface);
|
|
24
26
|
initializeClient(): Promise<void>;
|
|
@@ -52,8 +54,6 @@ export declare class XmppClient implements XmppClientInterface {
|
|
|
52
54
|
actionSetTimestampToPrivateStoreStanza(chatId: string, timestamp: number, chats?: string[]): Promise<void>;
|
|
53
55
|
createPrivateRoomStanza(title: string, description: string, to: string): Promise<string>;
|
|
54
56
|
sendMediaMessageStanza(roomJID: string, data: any): void;
|
|
55
|
-
startPingLoop(): void;
|
|
56
|
-
stopPingLoop(): void;
|
|
57
57
|
sendPing(): void;
|
|
58
58
|
handlePong(): void;
|
|
59
59
|
handlePingTimeout(): void;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { IMessage } from '../types/types';
|
|
1
3
|
interface roomHeapSliceState {
|
|
2
|
-
messageHeap: string[];
|
|
4
|
+
messageHeap: [string, IMessage][];
|
|
3
5
|
}
|
|
4
6
|
export declare const roomHeapSlice: import('@reduxjs/toolkit').Slice<roomHeapSliceState, {
|
|
5
|
-
addMessageToHeap: (state: import('immer').WritableDraft<roomHeapSliceState>, action: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}) => void;
|
|
7
|
+
addMessageToHeap: (state: import('immer').WritableDraft<roomHeapSliceState>, action: PayloadAction<{
|
|
8
|
+
jid: string;
|
|
9
|
+
message: IMessage;
|
|
10
|
+
}>) => void;
|
|
9
11
|
popMessageFromHeap: (state: import('immer').WritableDraft<roomHeapSliceState>) => void;
|
|
10
12
|
clearHeap: (state: import('immer').WritableDraft<roomHeapSliceState>) => void;
|
|
11
13
|
}, "roomHeapStore", "roomHeapStore", import('@reduxjs/toolkit').SliceSelectors<roomHeapSliceState>>;
|
|
12
|
-
export declare const addMessageToHeap: import('@reduxjs/toolkit').
|
|
14
|
+
export declare const addMessageToHeap: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
15
|
+
jid: string;
|
|
16
|
+
message: IMessage;
|
|
17
|
+
}, "roomHeapStore/addMessageToHeap">, popMessageFromHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapStore/popMessageFromHeap">, clearHeap: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomHeapStore/clearHeap">;
|
|
13
18
|
declare const _default: import('redux').Reducer<roomHeapSliceState>;
|
|
14
19
|
export default _default;
|
|
@@ -100,10 +100,6 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
|
|
|
100
100
|
setOpenReportModal: (state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
|
|
101
101
|
isOpen: boolean;
|
|
102
102
|
}>) => void;
|
|
103
|
-
updateMessageStatus(state: import('immer').WritableDraft<RoomMessagesState>, action: {
|
|
104
|
-
payload: any;
|
|
105
|
-
type: string;
|
|
106
|
-
}): void;
|
|
107
103
|
}, "roomMessages", "roomMessages", import('@reduxjs/toolkit').SliceSelectors<RoomMessagesState>>;
|
|
108
104
|
export declare const getLastMessageTimestamp: (state: RoomMessagesState, jid: string) => string | null;
|
|
109
105
|
export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
@@ -153,6 +149,6 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
|
|
|
153
149
|
isOpen: boolean;
|
|
154
150
|
}, "roomMessages/setOpenReportModal">, insertUsers: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
155
151
|
newUsers: RoomMember[];
|
|
156
|
-
}, "roomMessages/insertUsers"
|
|
152
|
+
}, "roomMessages/insertUsers">;
|
|
157
153
|
declare const _default: import('redux').Reducer<RoomMessagesState>;
|
|
158
154
|
export default _default;
|
|
@@ -10,8 +10,6 @@ export interface xmppSettingsInterface {
|
|
|
10
10
|
devServer: string;
|
|
11
11
|
host: string;
|
|
12
12
|
conference?: string;
|
|
13
|
-
xmppPingPongEnabled?: boolean;
|
|
14
|
-
xmppPingOnTimeoutEnabled?: boolean;
|
|
15
13
|
xmppPingOnSendEnabled?: boolean;
|
|
16
14
|
}
|
|
17
15
|
export interface MediaUploadData {
|
|
@@ -27,6 +25,7 @@ export interface XmppClientInterface {
|
|
|
27
25
|
conference: string;
|
|
28
26
|
username: string;
|
|
29
27
|
status: string;
|
|
28
|
+
resource: string;
|
|
30
29
|
password: string;
|
|
31
30
|
reconnectAttempts: number;
|
|
32
31
|
maxReconnectAttempts: number;
|