@ethora/chat-component 26.10.5 → 26.10.7
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/README.md +32 -1
- package/dist/{ChatProfileModal-Dw7pPDv8.js → ChatProfileModal-BDZvd0rm.js} +145 -145
- package/dist/{FilePreviewModal-CEcb5HZ2.js → FilePreviewModal-DlOjnYzv.js} +79 -79
- package/dist/{ManageDataModal-Qma0dQja.js → ManageDataModal-BZLGJZze.js} +16 -16
- package/dist/{MarkdownBody-DiVdEIJH.js → MarkdownBody-CtArwCDa.js} +1 -1
- package/dist/{MessageSearchModal-DVJTW9WM.js → MessageSearchModal-CcUnfZlU.js} +46 -46
- package/dist/{PublicChatsModal-CX1qZbEc.js → PublicChatsModal-BWn0NXVo.js} +10 -10
- package/dist/{SideDrawer-BzfNGNbq.js → SideDrawer-CqZl9sxK.js} +28 -28
- package/dist/UserProfileModal-D0JZ3-uy.js +635 -0
- package/dist/{UserSettingsModal-DdbURRR3.js → UserSettingsModal-OvykYDsT.js} +4 -4
- package/dist/{VideoCallOverlay-D1lGzbw3.js → VideoCallOverlay-DrvO2v_g.js} +4616 -4477
- package/dist/{VisibilityModal-yGZ0eOJx.js → VisibilityModal-pOF9-UXR.js} +11 -11
- package/dist/components/Modals/styledModalComponents.d.ts +4 -4
- package/dist/components/VideoCalls/VideoCallSession.d.ts +2 -0
- package/dist/components/styled/SendInput.d.ts +3 -2
- package/dist/firebase-messaging-sw.js +918 -96
- package/dist/{handleCopyClick-C-w304_U.js → handleCopyClick-BUbVvd2G.js} +1 -1
- package/dist/helpers/callClaim.d.ts +17 -0
- package/dist/helpers/callOutcomeSync.d.ts +23 -0
- package/dist/helpers/callPush.d.ts +23 -0
- package/dist/helpers/incomingCallPush.d.ts +89 -0
- package/dist/helpers/pushRoomHandoff.d.ts +13 -0
- package/dist/hooks/useChatSettingState.d.ts +1 -0
- package/dist/hooks/usePushNotifications.d.ts +2 -0
- package/dist/{main-Cdwk7Rjj.js → main-CpHMnydn.js} +12241 -11463
- package/dist/main.js +17 -17
- package/dist/networking/api-requests/rooms.api.d.ts +9 -0
- package/dist/networking/xmpp/sendMessageReaction.xmpp.d.ts +13 -1
- package/dist/networking/xmppClient.d.ts +2 -1
- package/dist/roomStore/Middleware/blockedHydrationMiddleware.d.ts +2 -0
- package/dist/roomStore/chatSettingsSlice.d.ts +2 -1
- package/dist/types/models/config.model.d.ts +42 -0
- package/dist/types/models/xmpp.model.d.ts +2 -1
- package/dist/utils/callAuthMirror.d.ts +1 -0
- package/dist/utils/callBroadcast.d.ts +12 -0
- package/dist/utils/callNotifications.d.ts +67 -0
- package/dist/utils/firebasePushNotifications.d.ts +14 -0
- package/dist/utils/handledCalls.d.ts +5 -0
- package/dist/utils/pushServiceWorkerBridge.d.ts +19 -0
- package/dist/utils/webLock.d.ts +13 -0
- package/package.json +1 -1
- package/public/firebase-messaging-sw.js +918 -96
- package/dist/UserProfileModal-DdW_nEsM.js +0 -594
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Records that this tab took the decision for the call (see wonCallDecision). */
|
|
2
|
+
export declare const rememberCallDecision: (key: string | null | undefined) => void;
|
|
3
|
+
/** True when this tab took the accept or decline for `key` itself. */
|
|
4
|
+
export declare const wonCallDecision: (key: string | null | undefined) => boolean;
|
|
5
|
+
export declare const resetCallClaims: () => void;
|
|
6
|
+
/**
|
|
7
|
+
* Takes the per-call claim for accepting or declining `key`. A plain boolean
|
|
8
|
+
* without Web Locks (nothing to yield for), otherwise a promise. Both actions
|
|
9
|
+
* share the one lock, so an Accept here and a Decline in another tab cannot
|
|
10
|
+
* both go through either.
|
|
11
|
+
*/
|
|
12
|
+
export declare const claimCallDecision: (key: string) => boolean | Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Runs `run` when this tab gets the claim, and not at all when another tab
|
|
15
|
+
* has it. Synchronous when the claim is (no Web Locks).
|
|
16
|
+
*/
|
|
17
|
+
export declare const runIfCallClaimed: (key: string | null | undefined, run: () => void) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Marks the end of the ring `key` as local-only: the next time this tab's ring
|
|
3
|
+
* for it ends, nothing is broadcast. For a timeout, and for an end that came
|
|
4
|
+
* from another tab (no echo).
|
|
5
|
+
*/
|
|
6
|
+
export declare const silenceCallOutcome: (key: string | null | undefined) => void;
|
|
7
|
+
type CallLike = {
|
|
8
|
+
direction: string | null;
|
|
9
|
+
phase: string;
|
|
10
|
+
callId: string | null;
|
|
11
|
+
roomJid: string | null;
|
|
12
|
+
roomBareName: string | null;
|
|
13
|
+
};
|
|
14
|
+
export declare const incomingCallKey: (call: CallLike) => string | null;
|
|
15
|
+
interface StoreLike {
|
|
16
|
+
getState: () => {
|
|
17
|
+
call: CallLike;
|
|
18
|
+
};
|
|
19
|
+
subscribe: (listener: () => void) => () => void;
|
|
20
|
+
dispatch: (action: any) => unknown;
|
|
21
|
+
}
|
|
22
|
+
export declare function startCallOutcomeSync(store: StoreLike): () => void;
|
|
23
|
+
export {};
|
|
@@ -20,3 +20,26 @@ export interface ParsedCallPush {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare const isCallPush: (data: Record<string, any> | null | undefined) => boolean;
|
|
22
22
|
export declare const parseCallPush: (data: Record<string, any> | null | undefined) => ParsedCallPush;
|
|
23
|
+
/**
|
|
24
|
+
* Decode the claims of a JWT without verifying it. Only non-sensitive claims
|
|
25
|
+
* are ever read from the result; the server (and LiveKit on connect) is the
|
|
26
|
+
* authority on validity. Returns null for anything that is not a JWT.
|
|
27
|
+
*/
|
|
28
|
+
export declare const decodeJwtPayload: (token: string | null | undefined) => Record<string, any> | null;
|
|
29
|
+
/** Expiry of a JWT (`exp`, seconds) as epoch milliseconds, or null. */
|
|
30
|
+
export declare const jwtExpiresAtMs: (token: string | null | undefined) => number | null;
|
|
31
|
+
/** A call token with less than this left is treated as already expired. */
|
|
32
|
+
export declare const CALL_TOKEN_MIN_REMAINING_MS = 3000;
|
|
33
|
+
/**
|
|
34
|
+
* Whether a call push is still worth ringing for. The backend sets no push TTL,
|
|
35
|
+
* so a device that was offline can receive a call push long after the call.
|
|
36
|
+
* The LiveKit token lives 60 s, so its `exp` is the freshness clock.
|
|
37
|
+
*
|
|
38
|
+
* When no `exp` can be read (no token, malformed token) the push is treated
|
|
39
|
+
* as fresh: it cannot be proven stale, and the ring's own 45 s timeout bounds
|
|
40
|
+
* how long it can stay on screen.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getCallPushFreshness: (data: Record<string, any> | null | undefined, now?: number) => {
|
|
43
|
+
fresh: boolean;
|
|
44
|
+
expiresAt: number | null;
|
|
45
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface CallPushContext {
|
|
2
|
+
dispatch: (action: any) => unknown;
|
|
3
|
+
getState: () => any;
|
|
4
|
+
normalizeRoomJid: (jid?: string) => string;
|
|
5
|
+
}
|
|
6
|
+
export type CallPushOutcome =
|
|
7
|
+
/** The ring is on (or already was) for this call. */
|
|
8
|
+
'ringing'
|
|
9
|
+
/** Ringing and accepted in the same step (Answer action). */
|
|
10
|
+
| 'accepted'
|
|
11
|
+
/** This call is already answered / in progress; nothing to do. */
|
|
12
|
+
| 'active'
|
|
13
|
+
/** Another call is in progress; this one was ignored. */
|
|
14
|
+
| 'busy'
|
|
15
|
+
/** The push is stale; nothing rings. */
|
|
16
|
+
| 'expired'
|
|
17
|
+
/** Another tab already accepted, declined or ended this call; nothing to do. */
|
|
18
|
+
| 'handled'
|
|
19
|
+
/** Held until the chat config and the user are ready. */
|
|
20
|
+
| 'held'
|
|
21
|
+
/** The push carries no LiveKit token, so it cannot ring. */
|
|
22
|
+
| 'no-token';
|
|
23
|
+
export declare const markCallRaisedFromPush: (key: string | null | undefined) => void;
|
|
24
|
+
export declare const unmarkCallRaisedFromPush: (key: string | null | undefined) => void;
|
|
25
|
+
export declare const wasCallRaisedFromPush: (key: string | null | undefined) => boolean;
|
|
26
|
+
interface PendingCallPush {
|
|
27
|
+
data: Record<string, any>;
|
|
28
|
+
answer: boolean;
|
|
29
|
+
heldAt: number;
|
|
30
|
+
/** The worker is showing this call's notification (see raisedFromPush). */
|
|
31
|
+
swShows: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const holdCallPush: (data: Record<string, any>, answer: boolean, swShows?: boolean) => void;
|
|
34
|
+
export declare const takePendingCallPush: (now?: number) => PendingCallPush | null;
|
|
35
|
+
export declare const dropPendingCallPush: (callId: string | null | undefined) => void;
|
|
36
|
+
export declare const resetCallPushState: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Everything the call push flow holds that belongs to the session: a call push
|
|
39
|
+
* held for the config, the pushed-ring marks, the decline dedupe, the click the
|
|
40
|
+
* worker keeps for the next page load, and the call notifications on screen.
|
|
41
|
+
* Logout (and an account switch) clears it, so the next user never replays or
|
|
42
|
+
* answers the previous one's call.
|
|
43
|
+
*/
|
|
44
|
+
export declare const clearCallPushSession: (scope?: string) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Several tabs get the same tap or Answer from the worker. Only one may act on
|
|
47
|
+
* it: the first to take the lock for this call does, the rest leave it. This
|
|
48
|
+
* only routes the click. Whether THIS tab may then accept or decline the call
|
|
49
|
+
* is the per-call claim in callClaim (shared with the ring screen's buttons).
|
|
50
|
+
*/
|
|
51
|
+
export declare const claimCallAction: (action: "click", key: string) => boolean | Promise<boolean>;
|
|
52
|
+
/**
|
|
53
|
+
* Puts the ring up from a call push (through the guarded reducer) and, for the
|
|
54
|
+
* Answer action, accepts it right away so LiveKit connects with the push's own
|
|
55
|
+
* token and no second click.
|
|
56
|
+
*/
|
|
57
|
+
export declare const raiseIncomingCallFromPush: (ctx: CallPushContext, data: Record<string, any>, options?: {
|
|
58
|
+
answer?: boolean;
|
|
59
|
+
swShows?: boolean;
|
|
60
|
+
}) => CallPushOutcome;
|
|
61
|
+
export declare const flushPendingCallPush: (ctx: CallPushContext) => CallPushOutcome | null;
|
|
62
|
+
/**
|
|
63
|
+
* CALL_PUSH from the worker: ring (or hold) and tell the worker what this page
|
|
64
|
+
* did, so it knows whether to add an OS notification:
|
|
65
|
+
* - ring shown and this page visible: ack, the worker shows nothing;
|
|
66
|
+
* - this call is already connecting or in progress here: ack whether the page
|
|
67
|
+
* is visible or not (a duplicate push must not ring again, nor end as a
|
|
68
|
+
* "Missed call" for a call that was answered);
|
|
69
|
+
* - a DIFFERENT call is in progress: ack with `busy`, the worker shows a plain
|
|
70
|
+
* "Missed call" instead of a ring that Answer could not take;
|
|
71
|
+
* - anything else (hidden page, held, expired, no token): no ack, the worker
|
|
72
|
+
* notifies. The hidden or held ring is then the worker's to announce, so it
|
|
73
|
+
* is marked and the page does not notify a second time.
|
|
74
|
+
*/
|
|
75
|
+
export declare const handleCallPushFromWorker: (ctx: CallPushContext, data: Record<string, any>) => CallPushOutcome;
|
|
76
|
+
/**
|
|
77
|
+
* Declines a call from a notification action. Both mounted hook instances get
|
|
78
|
+
* the worker's message, so a repeat for the same call is dropped. A call this
|
|
79
|
+
* page has already answered is left alone: a stale Decline must never hang up
|
|
80
|
+
* a live call.
|
|
81
|
+
*
|
|
82
|
+
* Tells the worker (CALL_PUSH_DECLINE_ACK) once the decline was actually
|
|
83
|
+
* handled, and only then: the worker waits for it and otherwise declines over
|
|
84
|
+
* REST itself. A page that cannot do the XMPP part (the chat config is not in
|
|
85
|
+
* Redux yet) still has the user token, so it does the REST decline and acks
|
|
86
|
+
* when the server took it.
|
|
87
|
+
*/
|
|
88
|
+
export declare const declineIncomingCallFromPush: (ctx: CallPushContext, data: Record<string, any>) => Promise<void>;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A push tap names the room the user wants. The address bar and the parked
|
|
3
|
+
* QR / deep-link id may still name another one: a host that redirects `/` to
|
|
4
|
+
* its saved last path lands the window on `/chat?chatId=<last room>`, and
|
|
5
|
+
* `useQRCodeChat` re-asserts that room for as long as it is parked, which
|
|
6
|
+
* used to undo the push a moment after it was applied.
|
|
7
|
+
*
|
|
8
|
+
* Call this right before opening the pushed room so every source of truth
|
|
9
|
+
* agrees: a `chatId` already in the url is rewritten to the pushed room (the
|
|
10
|
+
* way `useRoomUrl` writes it, without adding a history entry), and a parked
|
|
11
|
+
* id is dropped. A url with no `chatId` is left alone.
|
|
12
|
+
*/
|
|
13
|
+
export declare const claimRoomForPush: (roomJid: string) => void;
|
|
@@ -28,6 +28,8 @@ interface UsePushNotificationsOptions {
|
|
|
28
28
|
iconPath?: string;
|
|
29
29
|
/** Custom badge URL/path for browser OS notifications. */
|
|
30
30
|
badgePath?: string;
|
|
31
|
+
/** Same-origin path a cold-start push tap opens (default: the origin root). */
|
|
32
|
+
clickPath?: string;
|
|
31
33
|
/**
|
|
32
34
|
* Custom Firebase configuration object.
|
|
33
35
|
* If provided, it overrides the environment variables.
|