@ethora/chat-component 24.11.14 → 24.11.16

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.
@@ -27,5 +27,6 @@ declare const onMessageHistory: (stanza: any) => Promise<void>;
27
27
  declare const handleComposing: (stanza: Element, currentUser: string) => Promise<void>;
28
28
  declare const onPresenceInRoom: (stanza: Element | any) => void;
29
29
  declare const onGetLastMessageArchive: (stanza: Element, xmpp: any) => Promise<void>;
30
+ declare const onNewRoomCreated: (stanza: Element, xmpp: any) => void;
30
31
  declare const onGetChatRooms: (stanza: Element, xmpp: any) => void;
31
- export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onGetLastMessageArchive, handleComposing, onGetChatRooms, };
32
+ export { onRealtimeMessage, onMessageHistory, onPresenceInRoom, onGetLastMessageArchive, handleComposing, onGetChatRooms, onNewRoomCreated, };
@@ -0,0 +1,3 @@
1
+ import { Client } from '@xmpp/client';
2
+
3
+ export declare function createRoom(title: string, description: string, client: Client): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import { Client } from '@xmpp/client';
2
+
3
+ export declare function createRoomPresence(roomId: string, client: Client): Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { Client } from '@xmpp/client';
2
+
3
+ export declare function roomConfig(roomId: string, roomTitle: string, roomDescription: string, client: Client): Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { Client } from '@xmpp/client';
2
+
3
+ export declare function setMeAsOwner(roomId: string, client: Client): Promise<unknown>;
@@ -0,0 +1,3 @@
1
+ import { Client } from '@xmpp/client';
2
+
3
+ export declare function setRoomImage(roomJid: string, roomThumbnail: string, type: string, client: Client, roomBackground?: string): void;
@@ -15,13 +15,14 @@ export declare class XmppClient {
15
15
  checkOnline(): boolean;
16
16
  constructor(username: string, password: string);
17
17
  close(): void;
18
- joinBySendingPresence(chatJID: string): Promise<unknown>;
19
18
  unsubscribe: (address: string) => void;
20
19
  getRooms: () => Promise<unknown>;
20
+ createRoomStanza(title: string, description: string): Promise<string>;
21
21
  leaveTheRoom: (roomJID: string) => void;
22
22
  presenceInRoomStanza: (roomJID: string) => void;
23
23
  getHistoryStanza: (chatJID: string, max: number, before?: number) => Promise<void>;
24
24
  getLastMessageArchiveStanza(roomJID: string): void;
25
+ setRoomImageStanza: (roomJid: string, roomThumbnail: string, type: string, roomBackground?: string) => void;
25
26
  sendMessage: (roomJID: string, firstName: string, lastName: string, photo: string, walletAddress: string, userMessage: string, notDisplayedValue?: string) => void;
26
27
  deleteMessageStanza(room: string, msgId: string): void;
27
28
  sendTypingRequestStanza(chatId: string, fullName: string, start: boolean): void;
@@ -4,12 +4,12 @@ import { IConfig, User } from '../types/types';
4
4
  interface ChatState {
5
5
  user: User;
6
6
  config?: IConfig;
7
- activeModal?: 'settings' | 'profile' | undefined;
7
+ activeModal?: 'settings' | 'profile' | 'chatprofile' | undefined;
8
8
  }
9
9
  export declare const chatSlice: import('@reduxjs/toolkit').Slice<ChatState, {
10
10
  setUser: (state: import('immer').WritableDraft<ChatState>, action: PayloadAction<User>) => void;
11
11
  setConfig: (state: import('immer').WritableDraft<ChatState>, action: PayloadAction<IConfig | undefined>) => void;
12
- setActiveModal: (state: import('immer').WritableDraft<ChatState>, action: PayloadAction<"settings" | "profile" | undefined>) => void;
12
+ setActiveModal: (state: import('immer').WritableDraft<ChatState>, action: PayloadAction<"settings" | "profile" | "chatprofile" | undefined>) => void;
13
13
  refreshTokens: (state: import('immer').WritableDraft<ChatState>, action: PayloadAction<{
14
14
  token: string;
15
15
  refreshToken: string;
@@ -19,6 +19,6 @@ export declare const chatSlice: import('@reduxjs/toolkit').Slice<ChatState, {
19
19
  export declare const setUser: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<User, "chat/setUser">, setConfig: import('@reduxjs/toolkit').ActionCreatorWithNonInferrablePayload<"chat/setConfig">, refreshTokens: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
20
20
  token: string;
21
21
  refreshToken: string;
22
- }, "chat/refreshTokens">, logout: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"chat/logout">, setActiveModal: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<"settings" | "profile", "chat/setActiveModal">;
22
+ }, "chat/refreshTokens">, logout: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"chat/logout">, setActiveModal: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<"settings" | "profile" | "chatprofile", "chat/setActiveModal">;
23
23
  declare const _default: import('redux').Reducer<ChatState>;
24
24
  export default _default;
@@ -12,6 +12,13 @@ export declare const roomsStore: import('@reduxjs/toolkit').Slice<RoomMessagesSt
12
12
  addRoom(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
13
13
  roomData: IRoom;
14
14
  }>): void;
15
+ deleteRoom(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
16
+ jid: string;
17
+ }>): void;
18
+ updateRoom(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
19
+ jid: string;
20
+ updates: Partial<IRoom>;
21
+ }>): void;
15
22
  setRoomMessages(state: import('immer').WritableDraft<RoomMessagesState>, action: PayloadAction<{
16
23
  roomJID: string;
17
24
  messages: IMessage[];
@@ -80,6 +87,11 @@ export declare const addRoom: import('@reduxjs/toolkit').ActionCreatorWithOption
80
87
  }, "roomMessages/setCurrentRoom">, setRoomRole: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
81
88
  chatJID: string;
82
89
  role: string;
83
- }, "roomMessages/setRoomRole">, setLogoutState: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomMessages/setLogoutState">;
90
+ }, "roomMessages/setRoomRole">, setLogoutState: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"roomMessages/setLogoutState">, deleteRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
91
+ jid: string;
92
+ }, "roomMessages/deleteRoom">, updateRoom: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
93
+ jid: string;
94
+ updates: Partial<IRoom>;
95
+ }, "roomMessages/updateRoom">;
84
96
  declare const _default: import('redux').Reducer<RoomMessagesState>;
85
97
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethora/chat-component",
3
- "version": "24.11.14",
3
+ "version": "24.11.16",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -23,6 +23,7 @@
23
23
  "@xmpp/client": "^0.13.1",
24
24
  "axios": "^1.7.2",
25
25
  "firebase": "^10.13.2",
26
+ "js-sha256": "^0.11.0",
26
27
  "ltx": "^3.0.0",
27
28
  "react": "^18.3.1",
28
29
  "react-dom": "^18.3.1",
@@ -35,7 +36,6 @@
35
36
  },
36
37
  "devDependencies": {
37
38
  "@types/node": "^20.14.9",
38
- "vite-plugin-dts": "^3.9.1",
39
39
  "@types/react": "^18.3.3",
40
40
  "@types/react-dom": "^18.3.0",
41
41
  "@types/xmpp__client": "^0.13.3",
@@ -43,13 +43,14 @@
43
43
  "@typescript-eslint/parser": "^7.13.1",
44
44
  "@vitejs/plugin-react": "^4.3.1",
45
45
  "eslint": "^8.57.0",
46
+ "eslint-config-prettier": "^9.1.0",
47
+ "eslint-plugin-prettier": "^5.1.3",
46
48
  "eslint-plugin-react-hooks": "^4.6.2",
47
49
  "eslint-plugin-react-refresh": "^0.4.7",
50
+ "prettier": "3.2.5",
48
51
  "typescript": "^5.2.2",
49
52
  "vite": "^5.3.1",
50
- "prettier": "3.2.5",
51
- "eslint-config-prettier": "^9.1.0",
52
- "eslint-plugin-prettier": "^5.1.3"
53
+ "vite-plugin-dts": "^3.9.1"
53
54
  },
54
55
  "description": "1. npm create vite@latest 2. select name of project, select type (react/js) 3. cd project-name 4. npm i 5. npm i @ethora/chat-component 6. go to file src/App.tsx and replace it with this code",
55
56
  "directories": {