@ethora/chat-component 25.1.18 → 25.2.1
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/App.d.ts +1 -3
- package/dist/AppWithNav.d.ts +1 -0
- package/dist/components/MainComponents/VirtualList.d.ts +11 -0
- package/dist/components/MessageBubble/CustomDivider.d.ts +2 -0
- package/dist/components/MessageBubble/MessageReaction.d.ts +1 -0
- package/dist/components/MessageBubble/MessageTranslations.d.ts +5 -7
- package/dist/components/RoomComponents/LastMessageItem.d.ts +8 -0
- package/dist/components/RoomComponents/styled/LastMessageEmoji.d.ts +7 -0
- package/dist/components/RoomComponents/styled/LastMessageFile.d.ts +7 -0
- package/dist/components/RoomComponents/styled/LastMessagePhoto.d.ts +7 -0
- package/dist/components/RoomComponents/styled/LastMessageVideo.d.ts +7 -0
- package/dist/components/RoomComponents/styled/LastTextMessage.d.ts +7 -0
- package/dist/components/RoomComponents/styled/StyledRoomComponents.d.ts +8 -0
- package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +1 -1
- package/dist/context/xmppProvider.d.ts +2 -1
- package/dist/helpers/nanoToMs.d.ts +1 -0
- package/dist/hooks/useMessageQueue.d.ts +2 -2
- package/dist/main.js +33991 -33776
- package/dist/main.js.map +1 -1
- package/dist/networking/xmppClient.d.ts +3 -3
- package/dist/roomStore/Middleware/reactionsMiddleware.d.ts +3 -0
- package/dist/roomStore/roomsSlice.d.ts +3 -11
- package/dist/types/types.d.ts +62 -1
- package/dist/utils/PriorityQueue.d.ts +3 -0
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@xmpp/client';
|
|
2
|
-
import { XmppClientInterface } from '../types/types';
|
|
2
|
+
import { XmppClientInterface, xmppSettingsInterface } from '../types/types';
|
|
3
3
|
|
|
4
4
|
export declare class XmppClient implements XmppClientInterface {
|
|
5
5
|
client: Client;
|
|
@@ -14,13 +14,13 @@ export declare class XmppClient implements XmppClientInterface {
|
|
|
14
14
|
maxReconnectAttempts: number;
|
|
15
15
|
reconnectDelay: number;
|
|
16
16
|
checkOnline(): boolean;
|
|
17
|
-
constructor(username: string, password: string,
|
|
17
|
+
constructor(username: string, password: string, xmppSettings?: xmppSettingsInterface);
|
|
18
18
|
initializeClient(): void;
|
|
19
19
|
attachEventListeners(): void;
|
|
20
20
|
scheduleReconnect(): void;
|
|
21
21
|
reconnect(): void;
|
|
22
22
|
close(): Promise<void>;
|
|
23
|
-
getRoomsStanza: () => Promise<void>;
|
|
23
|
+
getRoomsStanza: (disableGetRooms?: boolean) => Promise<void>;
|
|
24
24
|
getRoomsPagedStanza(maxResults?: number, after?: string | null): Promise<void>;
|
|
25
25
|
createRoomStanza(title: string, description: string): Promise<string>;
|
|
26
26
|
inviteRoomRequestStanza(to: string, roomJid: string): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { EditAction, IMessage, IRoom, ReactionAction } from '../types/types';
|
|
2
|
+
import { AddRoomMessageAction, EditAction, IMessage, IRoom, ReactionAction } from '../types/types';
|
|
3
3
|
|
|
4
4
|
interface RoomMessagesState {
|
|
5
5
|
rooms: {
|
|
@@ -35,11 +35,7 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
|
|
|
35
35
|
messageId: string;
|
|
36
36
|
text: string;
|
|
37
37
|
}>): void;
|
|
38
|
-
addRoomMessage(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<
|
|
39
|
-
roomJID: string;
|
|
40
|
-
message: IMessage;
|
|
41
|
-
start?: boolean;
|
|
42
|
-
}>): void;
|
|
38
|
+
addRoomMessage(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<AddRoomMessageAction>): void;
|
|
43
39
|
deleteAllRooms(state: import('immer').WritableDraft<RoomMessagesState>): void;
|
|
44
40
|
setComposing(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
|
|
45
41
|
chatJID: string;
|
|
@@ -80,11 +76,7 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
|
|
|
80
76
|
}, "roomMessages/addRoom">, deleteAllRooms: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomMessages/deleteAllRooms">, setRoomMessages: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
81
77
|
roomJID: string;
|
|
82
78
|
messages: IMessage[];
|
|
83
|
-
}, "roomMessages/setRoomMessages">, addRoomMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
84
|
-
roomJID: string;
|
|
85
|
-
message: IMessage;
|
|
86
|
-
start?: boolean;
|
|
87
|
-
}, "roomMessages/addRoomMessage">, deleteRoomMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
79
|
+
}, "roomMessages/setRoomMessages">, addRoomMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<AddRoomMessageAction, "roomMessages/addRoomMessage">, deleteRoomMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
88
80
|
roomJID: string;
|
|
89
81
|
messageId: string;
|
|
90
82
|
}, "roomMessages/deleteRoomMessage">, setEditAction: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<EditAction, "roomMessages/setEditAction">, editRoomMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
package/dist/types/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export interface IMessage {
|
|
|
32
32
|
mainMessage?: string;
|
|
33
33
|
reply?: IReply[];
|
|
34
34
|
reaction?: Record<string, ReactionMessage>;
|
|
35
|
+
fileName?: string;
|
|
35
36
|
translations?: TranslationObject;
|
|
36
37
|
langSource?: string;
|
|
37
38
|
originalName?: string;
|
|
@@ -52,7 +53,7 @@ export interface IRoom {
|
|
|
52
53
|
isLoading: boolean;
|
|
53
54
|
roomBg: string;
|
|
54
55
|
id?: string;
|
|
55
|
-
lastMessage?:
|
|
56
|
+
lastMessage?: LastMessage;
|
|
56
57
|
lastMessageTimestamp?: number;
|
|
57
58
|
lastRoomMessage?: RoomLastMessage;
|
|
58
59
|
icon?: string;
|
|
@@ -161,6 +162,12 @@ export interface IConfig {
|
|
|
161
162
|
enabled: boolean;
|
|
162
163
|
user: User | null;
|
|
163
164
|
};
|
|
165
|
+
customLogin?: {
|
|
166
|
+
enabled: boolean;
|
|
167
|
+
loginFunction: any;
|
|
168
|
+
};
|
|
169
|
+
baseUrl?: string;
|
|
170
|
+
xmppSettings?: xmppSettingsInterface;
|
|
164
171
|
disableRooms?: boolean;
|
|
165
172
|
defaultLogin?: boolean;
|
|
166
173
|
disableInteractions?: boolean;
|
|
@@ -175,7 +182,36 @@ export interface IConfig {
|
|
|
175
182
|
enabled: boolean;
|
|
176
183
|
refreshFunction?: any;
|
|
177
184
|
};
|
|
185
|
+
backgroundChat?: {
|
|
186
|
+
color?: string;
|
|
187
|
+
image?: any;
|
|
188
|
+
};
|
|
189
|
+
bubleMessage?: {
|
|
190
|
+
backgroundMessageUser?: string;
|
|
191
|
+
backgroundMessage?: string;
|
|
192
|
+
colorUser?: string;
|
|
193
|
+
color?: string;
|
|
194
|
+
borderRadius?: number;
|
|
195
|
+
};
|
|
196
|
+
headerLogo?: any;
|
|
197
|
+
headerMenu?: () => void;
|
|
198
|
+
headerChatMenu?: () => void;
|
|
199
|
+
customRooms?: {
|
|
200
|
+
rooms: PartialRoomWithMandatoryKeys[];
|
|
201
|
+
disableGetRooms?: boolean;
|
|
202
|
+
singleRoom: boolean;
|
|
203
|
+
};
|
|
178
204
|
enableTranslates?: boolean;
|
|
205
|
+
disableRoomConfig?: boolean;
|
|
206
|
+
disableProfilesInteractions?: boolean;
|
|
207
|
+
disableUserCount?: boolean;
|
|
208
|
+
clearStoreBeforeInit?: boolean;
|
|
209
|
+
}
|
|
210
|
+
type PartialRoomWithMandatoryKeys = Partial<IRoom> & Pick<IRoom, 'jid' | 'title'>;
|
|
211
|
+
export interface xmppSettingsInterface {
|
|
212
|
+
devServer: string;
|
|
213
|
+
host: string;
|
|
214
|
+
conference?: string;
|
|
179
215
|
}
|
|
180
216
|
interface ConfigRoom {
|
|
181
217
|
jid: string;
|
|
@@ -199,6 +235,11 @@ export interface StorageUser {
|
|
|
199
235
|
isAssetsOpen?: boolean;
|
|
200
236
|
isProfileOpen?: boolean;
|
|
201
237
|
}
|
|
238
|
+
export interface xmppSettingsInterface {
|
|
239
|
+
devServer: string;
|
|
240
|
+
host: string;
|
|
241
|
+
conference?: string;
|
|
242
|
+
}
|
|
202
243
|
export interface MessageProps {
|
|
203
244
|
message: IMessage;
|
|
204
245
|
isUser: boolean;
|
|
@@ -222,6 +263,7 @@ export interface ReactionAction {
|
|
|
222
263
|
messageId: string;
|
|
223
264
|
from: string;
|
|
224
265
|
reactions: string[];
|
|
266
|
+
latestReactionTimestamp?: string;
|
|
225
267
|
data?: Record<string, string>;
|
|
226
268
|
}
|
|
227
269
|
export type ModalType = (typeof MODAL_TYPES)[keyof typeof MODAL_TYPES];
|
|
@@ -235,6 +277,11 @@ export interface ReactionAction {
|
|
|
235
277
|
messageId: string;
|
|
236
278
|
reactions: string[];
|
|
237
279
|
}
|
|
280
|
+
export interface AddRoomMessageAction {
|
|
281
|
+
roomJID: string;
|
|
282
|
+
message: IMessage;
|
|
283
|
+
start?: boolean;
|
|
284
|
+
}
|
|
238
285
|
export interface XmppClientInterface {
|
|
239
286
|
client: Client;
|
|
240
287
|
devServer?: string;
|
|
@@ -285,4 +332,18 @@ export type LanguageOptions = {
|
|
|
285
332
|
languages: Array<Language>;
|
|
286
333
|
language?: Iso639_1Codes;
|
|
287
334
|
};
|
|
335
|
+
export type MediaFile = {
|
|
336
|
+
uri: string;
|
|
337
|
+
type: string;
|
|
338
|
+
name: string;
|
|
339
|
+
};
|
|
340
|
+
export interface LastMessage extends Omit<Partial<IMessage>, 'date'> {
|
|
341
|
+
body: string;
|
|
342
|
+
date?: string | Date;
|
|
343
|
+
emoji?: string;
|
|
344
|
+
locationPreview?: string;
|
|
345
|
+
filename?: string;
|
|
346
|
+
mimetype?: string;
|
|
347
|
+
originalName?: string;
|
|
348
|
+
}
|
|
288
349
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethora/chat-component",
|
|
3
|
-
"version": "25.01
|
|
3
|
+
"version": "25.02.01",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"react-dom": "^18.3.1",
|
|
35
35
|
"react-qr-code": "^2.0.15",
|
|
36
36
|
"react-redux": "^9.1.0",
|
|
37
|
+
"react-router-dom": "^7.1.5",
|
|
37
38
|
"redux": "^5.0.1",
|
|
38
39
|
"redux-persist": "^6.0.0",
|
|
39
40
|
"redux-persist-transform-encrypt": "^5.1.1",
|