@ethora/chat-component 26.8.1 → 26.9.0
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 +1 -0
- package/dist/{ChatProfileModal-DZVi2WRb.js → ChatProfileModal-DfXEnzJf.js} +6 -3
- package/dist/{FilePreviewModal-BelSYN5e.js → FilePreviewModal-Cs1tij9R.js} +35 -35
- package/dist/{ManageDataModal-Bs_0SHBL.js → ManageDataModal-BBOui09n.js} +3 -3
- package/dist/{MarkdownBody-BYUK4GVM.js → MarkdownBody-DttRXyAK.js} +3 -3
- package/dist/{SideDrawer-C_nWZRwH.js → SideDrawer-DLqEOqAi.js} +35 -35
- package/dist/UserProfileModal-DEtLQxkJ.js +594 -0
- package/dist/{UserSettingsModal-J7uJfki1.js → UserSettingsModal-Ddht5fc0.js} +9 -9
- package/dist/{VideoCallOverlay-BXHNEhdX.js → VideoCallOverlay-BJMarThf.js} +2673 -2662
- package/dist/VisibilityModal-CckTnGKB.js +138 -0
- package/dist/assets/icons.d.ts +8 -0
- package/dist/components/MainComponents/AttachmentList.d.ts +5 -0
- package/dist/components/MainComponents/SealedAttachmentList.d.ts +14 -0
- package/dist/components/RoomComponents/styled/LastMessageSealed.d.ts +14 -0
- package/dist/components/styled/AudioMessage.d.ts +38 -0
- package/dist/components/styled/MessageImage.d.ts +10 -0
- package/dist/e2ee/crypto.d.ts +32 -0
- package/dist/e2ee/fileEnvelope.d.ts +48 -0
- package/dist/e2ee/index.d.ts +53 -0
- package/dist/e2ee/omemo.d.ts +130 -0
- package/dist/e2ee/protobuf.d.ts +25 -0
- package/dist/e2ee/ratchet.d.ts +54 -0
- package/dist/e2ee/stanza.d.ts +24 -0
- package/dist/e2ee/store.d.ts +12 -0
- package/dist/{handleCopyClick-Bj2V_brV.js → handleCopyClick-CWw4UAlT.js} +2 -2
- package/dist/helpers/findMessagesForFile.d.ts +25 -0
- package/dist/helpers/sealedAttachments.d.ts +25 -0
- package/dist/helpers/xmppIdShape.d.ts +9 -0
- package/dist/helpers/xmppUsername.d.ts +1 -1
- package/dist/hooks/useChatWrapperInit.d.ts +5 -1
- package/dist/{main-DmtEeYji.js → main-BHtKhpBZ.js} +21004 -16820
- package/dist/main.d.ts +2 -0
- package/dist/main.js +23 -20
- package/dist/networking/api-requests/auth.api.d.ts +10 -1
- package/dist/networking/api-requests/rooms.api.d.ts +1 -1
- package/dist/networking/authRefresh.d.ts +6 -0
- package/dist/networking/xmpp/sendMediaMessage.xmpp.d.ts +12 -1
- package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +1 -1
- package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +1 -1
- package/dist/networking/xmppClient.d.ts +39 -0
- package/dist/roomStore/storage.d.ts +2 -1
- package/dist/styles/tokens.d.ts +14 -4
- package/dist/types/models/config.model.d.ts +33 -0
- package/dist/types/models/message.model.d.ts +27 -0
- package/dist/types/models/room.model.d.ts +10 -0
- package/package.json +4 -1
- package/dist/UserProfileModal-CD2IB5SD.js +0 -574
- package/dist/VisibilityModal-4QJnWpAL.js +0 -132
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IRoom } from '../types/types';
|
|
2
|
+
export interface FileMessageMatch {
|
|
3
|
+
roomJID: string;
|
|
4
|
+
messageId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface DeletableFileRef {
|
|
7
|
+
_id: string;
|
|
8
|
+
roomName?: string;
|
|
9
|
+
location?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Finds every locally loaded message that carries the given file, so
|
|
13
|
+
* deleting a file from the Files panel can also tombstone its chat
|
|
14
|
+
* message(s) instead of leaving a broken-image bubble behind.
|
|
15
|
+
*
|
|
16
|
+
* `file.roomName` is checked first: sent-media messages stamp `attachmentId`
|
|
17
|
+
* on the message (see useSendMessage.tsx / sendMediaMessage.xmpp.ts) with
|
|
18
|
+
* the same id the backend gives the file, and the Files API's `roomName`
|
|
19
|
+
* field actually holds the room's JID (see FilesList.tsx / bug 3), so most
|
|
20
|
+
* of the time the right room is known outright. When that doesn't resolve
|
|
21
|
+
* anything - a different backend shape, or the id genuinely isn't on the
|
|
22
|
+
* message - every locally loaded room is searched by attachment location as
|
|
23
|
+
* a fallback, since a matching URL is still a correct match.
|
|
24
|
+
*/
|
|
25
|
+
export declare const findMessagesForFile: (rooms: Record<string, IRoom>, file: DeletableFileRef) => FileMessageMatch[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FileEnvelopeMeta } from '../e2ee/fileEnvelope';
|
|
2
|
+
export interface OpenedAttachment {
|
|
3
|
+
bytes: Uint8Array;
|
|
4
|
+
meta: FileEnvelopeMeta;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Fetch and decrypt one sealed attachment.
|
|
8
|
+
*
|
|
9
|
+
* `url` must already carry the viewer's `?ft=` token where the file is
|
|
10
|
+
* membership-gated - this is a plain fetch of whatever it is given.
|
|
11
|
+
*/
|
|
12
|
+
export declare function openSealedAttachment(url: string, keyMaterial: string, fetchImpl?: typeof fetch): Promise<OpenedAttachment>;
|
|
13
|
+
/** Hands a blob to the browser as a download. Injectable for tests. */
|
|
14
|
+
export type SaveBlob = (blob: Blob, fileName: string) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Fetch, decrypt and save one sealed attachment under its real filename.
|
|
17
|
+
*
|
|
18
|
+
* Returns the recovered metadata so the caller can label the card with the
|
|
19
|
+
* real name once it is known - before the first download there is no way to
|
|
20
|
+
* know it, because it lives inside the seal.
|
|
21
|
+
*/
|
|
22
|
+
export declare function saveSealedAttachment(url: string, keyMaterial: string, deps?: {
|
|
23
|
+
fetchImpl?: typeof fetch;
|
|
24
|
+
save?: SaveBlob;
|
|
25
|
+
}): Promise<FileEnvelopeMeta>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const toLocalPart: (value?: string) => string;
|
|
2
|
+
/**
|
|
3
|
+
* True when `value` (a full JID or already-bare local part) is a
|
|
4
|
+
* machine-generated Ethora id rather than anything a human would recognize
|
|
5
|
+
* as their own name - `<24 hex>_<24 hex>` (appId_userId) or a bare 24-hex
|
|
6
|
+
* id. Kept narrow on purpose: a handle a person actually picked is never
|
|
7
|
+
* this shape, so it is never mistaken for one.
|
|
8
|
+
*/
|
|
9
|
+
export declare const isOpaqueXmppUserId: (value: string | undefined | null) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { toLocalPart, isOpaqueXmppUserId } from './xmppIdShape';
|
|
2
2
|
export declare const normalizeXmppUsername: (value: string | undefined | null) => string;
|
|
3
3
|
export declare const isSameXmppUsername: (a: string | undefined | null, b: string | undefined | null) => boolean;
|
|
@@ -17,6 +17,10 @@ interface useChatWrapperInitResult {
|
|
|
17
17
|
}
|
|
18
18
|
export declare const resolveLegacyTranslatesLangSource: (translatesConfig?: IConfig["translates"]) => Iso639_1Codes | undefined;
|
|
19
19
|
export declare const resolveExternalReaderLocaleLangSource: (readerLocale?: string) => Iso639_1Codes | undefined;
|
|
20
|
-
export declare const isStatusConnectionLost: (status?: string | null) => boolean;
|
|
20
|
+
export declare const isStatusConnectionLost: (status?: string | null, isRecoveringAuth?: boolean, hasEverBeenOnline?: boolean) => boolean;
|
|
21
|
+
export declare const hasHostRefreshedSession: (user: {
|
|
22
|
+
xmppUsername?: string;
|
|
23
|
+
xmppPassword?: string;
|
|
24
|
+
}) => boolean;
|
|
21
25
|
declare const useChatWrapperInit: ({ roomJID, wasAutoSelected, config, }: useChatWrapperInitProps) => useChatWrapperInitResult;
|
|
22
26
|
export default useChatWrapperInit;
|