@ethora/chat-component 26.5.7 → 26.5.9
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 +12 -0
- package/dist/components/VideoCalls/VideoCallOverlay.d.ts +2 -0
- package/dist/components/VideoCalls/VideoCallSession.d.ts +25 -0
- package/dist/helpers/callLogMessage.d.ts +11 -0
- package/dist/helpers/callPush.d.ts +22 -0
- package/dist/helpers/mamReactions.d.ts +47 -0
- package/dist/helpers/storeConsole.d.ts +1 -0
- package/dist/helpers/useDraggable.d.ts +18 -0
- package/dist/main.js +47166 -23051
- package/dist/main.js.map +1 -1
- package/dist/networking/api-requests/rooms.api.d.ts +3 -0
- package/dist/networking/callTokenStanza.d.ts +13 -0
- package/dist/roomStore/callSlice.d.ts +37 -0
- package/dist/roomStore/index.d.ts +4 -0
- package/dist/types/models/config.model.d.ts +32 -0
- package/dist/types/models/message.model.d.ts +7 -0
- package/dist/version.d.ts +1 -1
- package/package.json +4 -1
package/dist/assets/icons.d.ts
CHANGED
|
@@ -23,6 +23,18 @@ export declare const SearchIcon: ({ color, ...props }: {
|
|
|
23
23
|
[x: string]: any;
|
|
24
24
|
color?: string;
|
|
25
25
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const VideoCallIcon: ({ color, ...props }: {
|
|
27
|
+
[x: string]: any;
|
|
28
|
+
color?: string;
|
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare const AudioCallIcon: ({ color, ...props }: {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
color?: string;
|
|
33
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare const HangUpIcon: ({ color, ...props }: {
|
|
35
|
+
[x: string]: any;
|
|
36
|
+
color?: string;
|
|
37
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
38
|
export declare const ReferalsIcon: ({ color, ...props }: {
|
|
27
39
|
[x: string]: any;
|
|
28
40
|
color?: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|
|
@@ -0,0 +1,22 @@
|
|
|
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;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Element } from 'ltx';
|
|
2
|
+
import { IMessage } from '../types/models/message.model';
|
|
3
|
+
import { ReactionAction } from '../types/models/action.model';
|
|
4
|
+
/**
|
|
5
|
+
* A reaction restored from the MAM archive whose target message is NOT in the
|
|
6
|
+
* same history page. It is handed back to the caller so it can be dispatched to
|
|
7
|
+
* the store (where a target loaded by an earlier page or a live stanza lives).
|
|
8
|
+
*/
|
|
9
|
+
export type DeferredReaction = ReactionAction;
|
|
10
|
+
/** Normalised view of a single `<reactions xmlns="urn:xmpp:reactions:0">` stanza. */
|
|
11
|
+
export interface ExtractedReaction {
|
|
12
|
+
/** Stanza id of the message the reaction targets (matches `IMessage.id`). */
|
|
13
|
+
messageId: string;
|
|
14
|
+
/** Full reactor JID, e.g. `<localpart>@xmpp.host/resource`. */
|
|
15
|
+
from: string;
|
|
16
|
+
/** Bare reactor id (`from` up to `@`); the key reactions are stored under. */
|
|
17
|
+
fromId: string;
|
|
18
|
+
/** Emoji shortcodes for this reactor; empty means the reactor cleared them. */
|
|
19
|
+
emoji: string[];
|
|
20
|
+
/** `<data senderFirstName=… senderLastName=…/>` attributes, if present. */
|
|
21
|
+
data: Record<string, string>;
|
|
22
|
+
/** Room JID derived from `<stanza-id by>` or the reactor JID. */
|
|
23
|
+
roomJID: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Pull the reaction details out of a forwarded MAM message that carries a
|
|
27
|
+
* `<reactions>` child. Returns null when the stanza is not a usable reaction
|
|
28
|
+
* (missing target id or reactor).
|
|
29
|
+
*/
|
|
30
|
+
export declare const extractMamReaction: (msg: Element) => ExtractedReaction | null;
|
|
31
|
+
/**
|
|
32
|
+
* Apply MAM reaction stanzas to a freshly parsed history page.
|
|
33
|
+
*
|
|
34
|
+
* Reactions are archived in MAM as standalone `<reactions>` stanzas. The MAM
|
|
35
|
+
* fetch path bypasses the live `onReactionHistory` handler, so without this the
|
|
36
|
+
* reactions only ever existed for the live session and disappeared on refresh.
|
|
37
|
+
*
|
|
38
|
+
* Reactions whose target message is in this same page are merged directly onto
|
|
39
|
+
* the message object (so they are present the instant the page is stored).
|
|
40
|
+
* Reactions whose target is not in the page are returned as `deferred` for the
|
|
41
|
+
* caller to dispatch to the store (the target may live in an earlier page or
|
|
42
|
+
* have arrived live).
|
|
43
|
+
*/
|
|
44
|
+
export declare const applyMamReactions: (messages: IMessage[], reactionStanzas: Element[]) => {
|
|
45
|
+
messages: IMessage[];
|
|
46
|
+
deferred: DeferredReaction[];
|
|
47
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
};
|