@ethora/chat-component 26.5.4 → 26.5.5
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/assets/icons.d.ts +4 -15
- package/dist/components/InputComponents/Search.d.ts +1 -0
- package/dist/components/styled/StyledInput.d.ts +1 -0
- package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +6 -1
- package/dist/helpers/resolveIconColor.d.ts +9 -0
- package/dist/helpers/storeConsole.d.ts +0 -1
- package/dist/hooks/useUnreadMessagesCounter.d.ts +6 -4
- package/dist/main.js +23195 -47220
- package/dist/main.js.map +1 -1
- package/dist/networking/api-requests/rooms.api.d.ts +0 -3
- package/dist/roomStore/index.d.ts +0 -4
- package/dist/types/models/config.model.d.ts +7 -32
- package/dist/types/models/message.model.d.ts +0 -7
- package/dist/version.d.ts +1 -1
- package/package.json +1 -4
- package/dist/components/VideoCalls/VideoCallOverlay.d.ts +0 -2
- package/dist/components/VideoCalls/VideoCallSession.d.ts +0 -25
- package/dist/helpers/callLogMessage.d.ts +0 -11
- package/dist/helpers/callPush.d.ts +0 -22
- package/dist/helpers/useDraggable.d.ts +0 -18
- package/dist/networking/callTokenStanza.d.ts +0 -13
- package/dist/roomStore/callSlice.d.ts +0 -37
|
@@ -10,6 +10,3 @@ export declare function postReportRoom(data: PostReportRoom): Promise<any>;
|
|
|
10
10
|
export declare function postAddRoomMember(data: PostAddRoomMember): Promise<RoomMember[]>;
|
|
11
11
|
export declare function deleteRoomMember(data: DeleteRoomMember): Promise<any>;
|
|
12
12
|
export declare function deleteRoom(name: string): Promise<any>;
|
|
13
|
-
export declare function createChatCall(chatName: string, options?: {
|
|
14
|
-
kind?: 'audio' | 'video';
|
|
15
|
-
}): Promise<void>;
|
|
@@ -4,12 +4,10 @@ declare const rootReducer: Reducer<{
|
|
|
4
4
|
chatSettingStore: any;
|
|
5
5
|
rooms: any;
|
|
6
6
|
roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
|
|
7
|
-
call: import('immer').WritableDraft<import('./callSlice').CallState>;
|
|
8
7
|
}, import('redux').UnknownAction, Partial<{
|
|
9
8
|
chatSettingStore: any;
|
|
10
9
|
rooms: any;
|
|
11
10
|
roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
|
|
12
|
-
call: import('immer').WritableDraft<import('./callSlice').CallState>;
|
|
13
11
|
}>>;
|
|
14
12
|
export type RootState = ReturnType<typeof rootReducer>;
|
|
15
13
|
export declare const getActiveRoom: (state: RootState) => IRoom | null;
|
|
@@ -17,13 +15,11 @@ export declare const store: import('@reduxjs/toolkit').EnhancedStore<{
|
|
|
17
15
|
chatSettingStore: any;
|
|
18
16
|
rooms: any;
|
|
19
17
|
roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
|
|
20
|
-
call: import('immer').WritableDraft<import('./callSlice').CallState>;
|
|
21
18
|
}, AnyAction, import('@reduxjs/toolkit').Tuple<[import('redux').StoreEnhancer<{
|
|
22
19
|
dispatch: import('redux-thunk').ThunkDispatch<{
|
|
23
20
|
chatSettingStore: any;
|
|
24
21
|
rooms: any;
|
|
25
22
|
roomHeapSlice: import('./roomHeapSlice').roomHeapSliceState;
|
|
26
|
-
call: import('immer').WritableDraft<import('./callSlice').CallState>;
|
|
27
23
|
}, undefined, import('redux').UnknownAction>;
|
|
28
24
|
}>, import('redux').StoreEnhancer]>>;
|
|
29
25
|
export type AppDispatch = typeof store.dispatch;
|
|
@@ -5,37 +5,6 @@ import { MessageBubble, MessageProps, IMessage } from './message.model';
|
|
|
5
5
|
import { Iso639_1Codes } from './language.model';
|
|
6
6
|
import { default as React } from 'react';
|
|
7
7
|
import { MessageNotificationToastProps } from '../../components/MessageNotification/MessageNotificationToast';
|
|
8
|
-
/**
|
|
9
|
-
* Override the icons used by the in-call control bar and the incoming-call
|
|
10
|
-
* ring screen. Each value is any React node (an <svg>, an <img>, an icon
|
|
11
|
-
* component element). When omitted, the chat's built-in icon is used. The
|
|
12
|
-
* mic/camera/screen-share toggles take separate on/off icons so the host can
|
|
13
|
-
* express the active vs muted state however they like.
|
|
14
|
-
*/
|
|
15
|
-
export interface VideoCallIcons {
|
|
16
|
-
micOn?: React.ReactNode;
|
|
17
|
-
micOff?: React.ReactNode;
|
|
18
|
-
cameraOn?: React.ReactNode;
|
|
19
|
-
cameraOff?: React.ReactNode;
|
|
20
|
-
screenShareOn?: React.ReactNode;
|
|
21
|
-
screenShareOff?: React.ReactNode;
|
|
22
|
-
hangup?: React.ReactNode;
|
|
23
|
-
accept?: React.ReactNode;
|
|
24
|
-
decline?: React.ReactNode;
|
|
25
|
-
}
|
|
26
|
-
export interface VideoCallsConfig {
|
|
27
|
-
enabled: boolean;
|
|
28
|
-
livekitUrl: string;
|
|
29
|
-
allowedRoomTypes?: Array<'private'>;
|
|
30
|
-
/** Start a video call with the camera already on. Default true. */
|
|
31
|
-
startWithCameraOn?: boolean;
|
|
32
|
-
/** Start a call with the microphone already on. Default true. */
|
|
33
|
-
startWithMicOn?: boolean;
|
|
34
|
-
/** Show the screen-share control. Default true. */
|
|
35
|
-
showScreenShare?: boolean;
|
|
36
|
-
/** Custom icons for the call control bar / ring screen. See VideoCallIcons. */
|
|
37
|
-
icons?: VideoCallIcons;
|
|
38
|
-
}
|
|
39
8
|
export interface FBConfig {
|
|
40
9
|
apiKey: string;
|
|
41
10
|
authDomain: string;
|
|
@@ -118,12 +87,19 @@ export interface IConfig {
|
|
|
118
87
|
* primary theme colour.
|
|
119
88
|
*/
|
|
120
89
|
icons?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Background colour of the chat's icon "chips" (attach, send, microphone,
|
|
92
|
+
* file preview, etc.). When omitted, falls back to `secondary` and then to
|
|
93
|
+
* white. Set to decouple the icon backgrounds from `secondary`.
|
|
94
|
+
*/
|
|
95
|
+
iconsBg?: string;
|
|
121
96
|
/** Background colour of the user's own message bubbles. Default #E7EDF9. */
|
|
122
97
|
ownMessageBackground?: string;
|
|
123
98
|
/** Background colour of other users' message bubbles. Default #FFFFFF. */
|
|
124
99
|
otherMessageBackground?: string;
|
|
125
100
|
/** Background colour of the message input bar. Default #FFFFFF. */
|
|
126
101
|
inputBackground?: string;
|
|
102
|
+
colorInput?: string;
|
|
127
103
|
};
|
|
128
104
|
/** Configurable font family / size / weights for the chat UI. See TypographyConfig. */
|
|
129
105
|
typography?: TypographyConfig;
|
|
@@ -357,5 +333,4 @@ export interface IConfig {
|
|
|
357
333
|
source?: 'service_worker' | 'foreground';
|
|
358
334
|
}) => void | Promise<void>;
|
|
359
335
|
};
|
|
360
|
-
videoCalls?: VideoCallsConfig;
|
|
361
336
|
}
|
|
@@ -32,13 +32,6 @@ export interface IMessage {
|
|
|
32
32
|
size?: string;
|
|
33
33
|
xmppId?: string;
|
|
34
34
|
xmppFrom?: string;
|
|
35
|
-
callLog?: {
|
|
36
|
-
callId: string;
|
|
37
|
-
direction: 'outgoing' | 'incoming';
|
|
38
|
-
durationMs: number;
|
|
39
|
-
missed: boolean;
|
|
40
|
-
kind: 'audio' | 'video';
|
|
41
|
-
};
|
|
42
35
|
}
|
|
43
36
|
export interface ReactionMessage {
|
|
44
37
|
emoji: string[];
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ETHORA_CHAT_COMPONENT_VERSION = "26.
|
|
1
|
+
export declare const ETHORA_CHAT_COMPONENT_VERSION = "26.02.22";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ethora/chat-component",
|
|
3
|
-
"version": "26.5.
|
|
3
|
+
"version": "26.5.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/main.js",
|
|
6
6
|
"types": "dist/main.d.ts",
|
|
@@ -29,8 +29,6 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@emoji-mart/data": "^1.2.1",
|
|
31
31
|
"@emoji-mart/react": "^1.1.1",
|
|
32
|
-
"@livekit/components-react": "^2.9.20",
|
|
33
|
-
"@livekit/components-styles": "^1.2.0",
|
|
34
32
|
"@reduxjs/toolkit": "^2.8.2",
|
|
35
33
|
"@types/styled-components": "^5.1.34",
|
|
36
34
|
"@xmpp/client": "^0.13.6",
|
|
@@ -38,7 +36,6 @@
|
|
|
38
36
|
"emoji-mart": "^5.6.0",
|
|
39
37
|
"firebase": "^11.9.1",
|
|
40
38
|
"js-sha256": "^0.11.1",
|
|
41
|
-
"livekit-client": "^2.18.3",
|
|
42
39
|
"ltx": "^3.1.2",
|
|
43
40
|
"react": "^18.3.1",
|
|
44
41
|
"react-dom": "^18.3.1",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { VideoCallIcons } from '../../types/models/config.model';
|
|
3
|
-
interface VideoCallSessionProps {
|
|
4
|
-
token: string;
|
|
5
|
-
livekitUrl: string;
|
|
6
|
-
kind?: 'audio' | 'video';
|
|
7
|
-
primaryColor?: string;
|
|
8
|
-
/** Host icon overrides for the control bar. */
|
|
9
|
-
icons?: VideoCallIcons;
|
|
10
|
-
/** Start with the camera on (video calls). Default true. */
|
|
11
|
-
startWithCameraOn?: boolean;
|
|
12
|
-
/** Start with the microphone on. Default true. */
|
|
13
|
-
startWithMicOn?: boolean;
|
|
14
|
-
/** Show the screen-share control. Default true. */
|
|
15
|
-
showScreenShare?: boolean;
|
|
16
|
-
/** Render the compact floating-panel layout instead of the full screen. */
|
|
17
|
-
minimized?: boolean;
|
|
18
|
-
/** Toggle between full and minimized layouts (keeps the session mounted). */
|
|
19
|
-
onToggleMinimize?: () => void;
|
|
20
|
-
onConnected?: () => void;
|
|
21
|
-
onError?: (message: string) => void;
|
|
22
|
-
onHangup: () => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const VideoCallSession: React.FC<VideoCallSessionProps>;
|
|
25
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IMessage } from '../types/types';
|
|
2
|
-
export interface CallLogMeta {
|
|
3
|
-
callId: string;
|
|
4
|
-
direction: 'outgoing' | 'incoming';
|
|
5
|
-
durationMs: number;
|
|
6
|
-
missed: boolean;
|
|
7
|
-
kind: 'audio' | 'video';
|
|
8
|
-
}
|
|
9
|
-
export declare const isCallLogMessage: (message: unknown) => boolean;
|
|
10
|
-
export declare const callStateHasLogData: (attrs: Record<string, any>) => boolean;
|
|
11
|
-
export declare const transformCallLogMessage: (message: IMessage, selfXmppUsername: string) => IMessage;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export interface ParsedCallPush {
|
|
2
|
-
callId: string | null;
|
|
3
|
-
/** LiveKit token, if the push carried one (lets us ring + accept offline). */
|
|
4
|
-
token: string | null;
|
|
5
|
-
kind: 'audio' | 'video';
|
|
6
|
-
/** Bare room name (JID localpart) the call belongs to. */
|
|
7
|
-
roomBareName: string | null;
|
|
8
|
-
/** Raw room reference from the payload (full JID or bare name). */
|
|
9
|
-
roomRef: string | null;
|
|
10
|
-
/** Display name for the ring screen (caller). */
|
|
11
|
-
callerName: string | null;
|
|
12
|
-
/** Caller's xmpp localpart, when provided. */
|
|
13
|
-
callerXmppUsername: string | null;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* True when a push `data` payload represents an incoming call. Matches on an
|
|
17
|
-
* explicit call marker (`type`/`pushType`/`category`/`event` === "call"-ish)
|
|
18
|
-
* or on a callId paired with a call-specific field, so a normal message push
|
|
19
|
-
* is never misread as a call.
|
|
20
|
-
*/
|
|
21
|
-
export declare const isCallPush: (data: Record<string, any> | null | undefined) => boolean;
|
|
22
|
-
export declare const parseCallPush: (data: Record<string, any> | null | undefined) => ParsedCallPush;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface DraggablePosition {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Minimal pointer-based drag hook (no deps). Returns the current offset and a
|
|
7
|
-
* pointer-down handler to attach to a drag handle. The consumer decides how to
|
|
8
|
-
* apply `pos` (e.g. as `left/top`, or as a delta from a default corner).
|
|
9
|
-
*
|
|
10
|
-
* `onChange` fires while dragging so callers can clamp to bounds. Works with
|
|
11
|
-
* mouse and touch via Pointer Events. `null` position means "not yet dragged"
|
|
12
|
-
* (use your default layout until the user moves it).
|
|
13
|
-
*/
|
|
14
|
-
export declare const useDraggable: (clamp?: (pos: DraggablePosition) => DraggablePosition) => {
|
|
15
|
-
pos: DraggablePosition;
|
|
16
|
-
onPointerDown: (e: React.PointerEvent) => void;
|
|
17
|
-
setPos: import('react').Dispatch<import('react').SetStateAction<DraggablePosition>>;
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Element } from 'ltx';
|
|
2
|
-
export declare const onCallTokenMessage: (stanza: Element) => boolean;
|
|
3
|
-
export type CallSignalState = 'ended' | 'declined' | 'cancelled' | 'rejected';
|
|
4
|
-
export declare const sendCallStateSignal: (state: CallSignalState, options?: {
|
|
5
|
-
peerXmppUsername?: string | null;
|
|
6
|
-
callId?: string | null;
|
|
7
|
-
roomBareName?: string | null;
|
|
8
|
-
}) => void;
|
|
9
|
-
export declare const sendCallInviteSignal: (kind: "audio" | "video", options: {
|
|
10
|
-
peerXmppUsername: string;
|
|
11
|
-
roomBareName: string;
|
|
12
|
-
callId?: string | null;
|
|
13
|
-
}) => void;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type CallPhase = 'idle' | 'requesting' | 'ringing-incoming' | 'connecting' | 'in-call' | 'error';
|
|
2
|
-
export type CallDirection = 'outgoing' | 'incoming' | null;
|
|
3
|
-
export type CallKind = 'audio' | 'video';
|
|
4
|
-
export interface CallState {
|
|
5
|
-
phase: CallPhase;
|
|
6
|
-
direction: CallDirection;
|
|
7
|
-
kind: CallKind;
|
|
8
|
-
roomJid: string | null;
|
|
9
|
-
roomName: string | null;
|
|
10
|
-
roomBareName: string | null;
|
|
11
|
-
callId: string | null;
|
|
12
|
-
peerXmppUsername: string | null;
|
|
13
|
-
token: string | null;
|
|
14
|
-
error: string | null;
|
|
15
|
-
startedAt: number | null;
|
|
16
|
-
}
|
|
17
|
-
export declare const startOutgoingCall: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
18
|
-
roomJid: string;
|
|
19
|
-
roomName?: string | null;
|
|
20
|
-
roomBareName?: string | null;
|
|
21
|
-
kind?: CallKind;
|
|
22
|
-
peerXmppUsername?: string | null;
|
|
23
|
-
}, "call/startOutgoingCall">, setIncomingCallToken: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
24
|
-
roomJid: string;
|
|
25
|
-
roomName?: string | null;
|
|
26
|
-
roomBareName?: string | null;
|
|
27
|
-
token: string;
|
|
28
|
-
kind?: CallKind;
|
|
29
|
-
callId?: string | null;
|
|
30
|
-
peerXmppUsername?: string | null;
|
|
31
|
-
}, "call/setIncomingCallToken">, setOutgoingCallToken: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<{
|
|
32
|
-
roomJid: string;
|
|
33
|
-
token: string;
|
|
34
|
-
callId?: string | null;
|
|
35
|
-
}, "call/setOutgoingCallToken">, acceptIncomingCall: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"call/acceptIncomingCall">, declineIncomingCall: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"call/declineIncomingCall">, endCall: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"call/endCall">, setCallError: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, "call/setCallError">, setCallPhase: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<CallPhase, "call/setCallPhase">, setCallKind: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<CallKind, "call/setCallKind">, resetCall: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<"call/resetCall">;
|
|
36
|
-
declare const _default: import('redux').Reducer<import('immer').WritableDraft<CallState>>;
|
|
37
|
-
export default _default;
|