@ethora/chat-component 25.3.1 → 25.3.2
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/components/MainComponents/MessageContainer.d.ts +1 -1
- package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
- package/dist/components/Modals/AddMembersModal/AddMembersModal.d.ts +4 -0
- package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
- package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +4 -0
- package/dist/helpers/createUserNameFromSetUser.d.ts +3 -0
- package/dist/helpers/extractUniqueMembersFromRooms.d.ts +10 -0
- package/dist/helpers/handleCopyClick.d.ts +1 -0
- package/dist/hooks/useRoomState.d.ts +1 -0
- package/dist/main.js +6179 -5870
- package/dist/main.js.map +1 -1
- package/dist/networking/api-requests/rooms.api.d.ts +2 -1
- package/dist/roomStore/roomsSlice.d.ts +16 -2
- package/dist/types/types.d.ts +28 -8
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ApiRoom, PostRoom } from '../../types/types';
|
|
1
|
+
import { ApiRoom, PostReportRoom, PostRoom } from '../../types/types';
|
|
2
2
|
|
|
3
3
|
export declare function getRooms(): Promise<{
|
|
4
4
|
items: ApiRoom[];
|
|
5
5
|
}>;
|
|
6
6
|
export declare function postRoom(data: PostRoom): Promise<any>;
|
|
7
|
+
export declare function postReportRoom(data: PostReportRoom): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { AddRoomMessageAction, EditAction, IMessage, IRoom, ReactionAction } from '../types/types';
|
|
2
|
+
import { AddRoomMessageAction, ApiRoom, EditAction, IMessage, IRoom, ReactionAction, RoomMember } from '../types/types';
|
|
3
3
|
import { default as XmppClient } from '../networking/xmppClient';
|
|
4
4
|
|
|
5
5
|
interface RoomMessagesState {
|
|
@@ -9,6 +9,10 @@ interface RoomMessagesState {
|
|
|
9
9
|
activeRoomJID: string;
|
|
10
10
|
editAction?: EditAction;
|
|
11
11
|
isLoading: boolean;
|
|
12
|
+
usersSet: Record<string, RoomMember>;
|
|
13
|
+
reportRoom: {
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
};
|
|
12
16
|
}
|
|
13
17
|
export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesState, {
|
|
14
18
|
addRoom(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
|
|
@@ -74,6 +78,12 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
|
|
|
74
78
|
room: IRoom;
|
|
75
79
|
xmpp: XmppClient;
|
|
76
80
|
}>) => void;
|
|
81
|
+
updateUsersSet: (state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
|
|
82
|
+
rooms: ApiRoom[];
|
|
83
|
+
}>) => void;
|
|
84
|
+
setOpenReportModal: (state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
|
|
85
|
+
isOpen: boolean;
|
|
86
|
+
}>) => void;
|
|
77
87
|
}, "roomMessages", "roomMessages", import('@reduxjs/toolkit').SliceSelectors<RoomMessagesState>>;
|
|
78
88
|
export declare const getLastMessageTimestamp: (state: RoomMessagesState, jid: string) => string | null;
|
|
79
89
|
export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
@@ -119,6 +129,10 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
|
|
|
119
129
|
}, "roomMessages/updateRoom">, addRoomViaApi: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
120
130
|
room: IRoom;
|
|
121
131
|
xmpp: XmppClient;
|
|
122
|
-
}, "roomMessages/addRoomViaApi"
|
|
132
|
+
}, "roomMessages/addRoomViaApi">, updateUsersSet: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
133
|
+
rooms: ApiRoom[];
|
|
134
|
+
}, "roomMessages/updateUsersSet">, setOpenReportModal: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
135
|
+
isOpen: boolean;
|
|
136
|
+
}, "roomMessages/setOpenReportModal">;
|
|
123
137
|
declare const _default: import('redux').Reducer<RoomMessagesState>;
|
|
124
138
|
export default _default;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { TranslationObject } from '../helpers/transformTranslatations';
|
|
|
4
4
|
|
|
5
5
|
export interface IUser extends Partial<User> {
|
|
6
6
|
id: string;
|
|
7
|
-
name
|
|
7
|
+
name?: string;
|
|
8
8
|
userJID?: string | null;
|
|
9
9
|
token?: string;
|
|
10
10
|
refreshToken?: string;
|
|
@@ -54,6 +54,18 @@ export interface IRoom {
|
|
|
54
54
|
messages: IMessage[];
|
|
55
55
|
isLoading: boolean;
|
|
56
56
|
roomBg: string;
|
|
57
|
+
members?: RoomMember[];
|
|
58
|
+
type?: 'public' | 'group';
|
|
59
|
+
creteadAt?: string;
|
|
60
|
+
appId?: string;
|
|
61
|
+
createdAt?: string;
|
|
62
|
+
createdBy?: string;
|
|
63
|
+
description?: string;
|
|
64
|
+
isAppChat?: boolean;
|
|
65
|
+
picture?: string;
|
|
66
|
+
updatedAt?: string;
|
|
67
|
+
__v?: number | string;
|
|
68
|
+
_id?: string;
|
|
57
69
|
id?: string;
|
|
58
70
|
lastMessage?: LastMessage;
|
|
59
71
|
lastMessageTimestamp?: number;
|
|
@@ -65,7 +77,6 @@ export interface IRoom {
|
|
|
65
77
|
unreadMessages?: number;
|
|
66
78
|
noMessages?: boolean;
|
|
67
79
|
role?: string;
|
|
68
|
-
roomMembers?: RoomMember[];
|
|
69
80
|
messageStats?: {
|
|
70
81
|
lastMessageTimestamp?: number;
|
|
71
82
|
firstMessageTimestamp?: number;
|
|
@@ -78,7 +89,7 @@ export interface ApiRoom {
|
|
|
78
89
|
title?: string;
|
|
79
90
|
description?: string;
|
|
80
91
|
picture?: string;
|
|
81
|
-
members?:
|
|
92
|
+
members?: RoomMember[];
|
|
82
93
|
createdBy?: string;
|
|
83
94
|
appId?: any;
|
|
84
95
|
_id?: string;
|
|
@@ -94,14 +105,23 @@ export interface PostRoom {
|
|
|
94
105
|
description?: string;
|
|
95
106
|
picture?: string;
|
|
96
107
|
}
|
|
108
|
+
export interface PostReportRoom {
|
|
109
|
+
chatName: string;
|
|
110
|
+
category: string;
|
|
111
|
+
text?: string;
|
|
112
|
+
}
|
|
97
113
|
export interface IRoomCompressed extends Pick<IRoom, 'jid'> {
|
|
98
114
|
}
|
|
99
115
|
export interface RoomMember {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
116
|
+
firstName: string;
|
|
117
|
+
lastName: string;
|
|
118
|
+
xmppUsername: string;
|
|
119
|
+
_id: string;
|
|
120
|
+
ban_status?: string;
|
|
121
|
+
jid?: string;
|
|
122
|
+
name?: string;
|
|
123
|
+
role?: string;
|
|
124
|
+
last_active?: number;
|
|
105
125
|
}
|
|
106
126
|
export interface RoomLastMessage {
|
|
107
127
|
name: string;
|