@ethora/chat-component 26.7.5 → 26.7.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 +72 -16
- package/dist/ChatProfileModal-DehQM4Bo.js +2135 -0
- package/dist/FilePreviewModal-BcZLtVAy.js +743 -0
- package/dist/ManageDataModal-DWabKhSC.js +178 -0
- package/dist/MarkdownBody-CSY3YKDh.js +16874 -0
- package/dist/SideDrawer-DewJ-iPn.js +270 -0
- package/dist/UserProfileModal-BHZ0TULc.js +574 -0
- package/dist/UserSettingsModal-BxwVWNKo.js +50 -0
- package/dist/{VideoCallOverlay-C4M2I9oV.js → VideoCallOverlay-D5SuimGP.js} +9 -10
- package/dist/VisibilityModal-Bd67b4EM.js +132 -0
- package/dist/assets/icons.d.ts +30 -0
- package/dist/components/ContextMenu/ContextMenuComponents.d.ts +1 -3
- package/dist/components/EmojiPicker/LazyEmojiPicker.d.ts +3 -0
- package/dist/components/ExampleComponents/CustomMessage.d.ts +3 -3
- package/dist/components/Files/FilesList.d.ts +12 -0
- package/dist/components/Files/FilesPanel.d.ts +3 -0
- package/dist/components/Files/fileCategory.d.ts +13 -0
- package/dist/components/InputComponents/AttachmentPreview.d.ts +17 -0
- package/dist/components/InputComponents/MentionDropdown.d.ts +13 -0
- package/dist/components/InputComponents/MentionPickerModal.d.ts +19 -0
- package/dist/components/MainComponents/AttachmentList.d.ts +7 -0
- package/dist/components/MainComponents/ChatErrorBoundary.d.ts +53 -0
- package/dist/components/MainComponents/ChatErrorScreen.d.ts +24 -0
- package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
- package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
- package/dist/components/MainComponents/HeaderLogo.d.ts +18 -0
- package/dist/components/MainComponents/MediaMessage.d.ts +5 -0
- package/dist/components/MainComponents/MessageContainer.d.ts +2 -2
- package/dist/components/MainComponents/ReduxWrapper.d.ts +1 -2
- package/dist/components/MainComponents/SystemMessage.d.ts +1 -2
- package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
- package/dist/components/MessageBubble/CustomDivider.d.ts +3 -3
- package/dist/components/MessageBubble/Message.d.ts +2 -2
- package/dist/components/MessageBubble/MessageTranslate.d.ts +28 -10
- package/dist/components/MessageBubble/QuickReplies.d.ts +6 -5
- package/dist/components/Modals/ChatProfileModal/ChatProfileMemberRow.d.ts +18 -0
- package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +17 -0
- package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +35 -0
- package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +14 -3
- package/dist/components/Modals/Modal/Modal.d.ts +10 -0
- package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
- package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
- package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
- package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
- package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +12 -0
- package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
- package/dist/components/Modals/SettingsModals/Visibility/StyledComponents.d.ts +1 -1
- package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +42 -0
- package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +64 -0
- package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
- package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
- package/dist/components/Modals/modalComponents.d.ts +6 -0
- package/dist/components/Modals/motionVariants.d.ts +37 -0
- package/dist/components/Modals/styledModalComponents.d.ts +13 -3
- package/dist/components/RoomComponents/ChatRoomItem.d.ts +0 -1
- package/dist/components/RoomComponents/OnlineUsersPopover.d.ts +0 -1
- package/dist/components/UsersList/StyledComponents.d.ts +5 -1
- package/dist/components/UsersList/UsersList.d.ts +23 -0
- package/dist/components/styled/Button.d.ts +11 -1
- package/dist/components/styled/ChatWrapperBox.d.ts +3 -1
- package/dist/components/styled/PdfMessage.d.ts +13 -0
- package/dist/components/styled/RoomListComponents/index.d.ts +22 -1
- package/dist/components/styled/SendInput.d.ts +19 -5
- package/dist/components/styled/StyledComponents.d.ts +1 -1
- package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +18 -0
- package/dist/components/styled/StyledInputComponents/StyledInputComponents.d.ts +21 -0
- package/dist/components/styled/TreadLabel.d.ts +2 -2
- package/dist/components/styled/UnsupportedType.d.ts +1 -1
- package/dist/context/ModalTransitionContext.d.ts +2 -0
- package/dist/examples/quiz/QuizDemo.d.ts +3 -0
- package/dist/examples/quiz/quizScript.d.ts +38 -0
- package/dist/examples/quiz/useDemoSession.d.ts +42 -0
- package/dist/examples/quiz/useQuizFlow.d.ts +47 -0
- package/dist/firebase-config.d.ts +2 -4
- package/dist/handleCopyClick-BoZWTBLC.js +108 -0
- package/dist/helpers/MarkdownBody.d.ts +7 -0
- package/dist/helpers/attachments.d.ts +33 -0
- package/dist/helpers/botMarkup.d.ts +30 -0
- package/dist/helpers/buildChatShareLink.d.ts +20 -0
- package/dist/helpers/cacheScope.d.ts +15 -1
- package/dist/helpers/constants/MODAL_TYPES.d.ts +13 -7
- package/dist/helpers/createRoomFromApi.d.ts +1 -1
- package/dist/helpers/ethoraLogger.d.ts +8 -0
- package/dist/helpers/fileKind.d.ts +17 -0
- package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
- package/dist/helpers/hiddenRooms.d.ts +1 -1
- package/dist/helpers/historyPreloadScheduler.d.ts +1 -0
- package/dist/helpers/lazyEmoji.d.ts +3 -0
- package/dist/helpers/localStorageUser.d.ts +1 -1
- package/dist/helpers/markdownSanitizeSchema.d.ts +3 -0
- package/dist/helpers/mentions.d.ts +63 -0
- package/dist/helpers/parseMessageBody.d.ts +12 -2
- package/dist/helpers/pdf/loadPdfjs.d.ts +64 -0
- package/dist/helpers/remarkLineBreaks.d.ts +42 -0
- package/dist/helpers/resolveMessageTranslation.d.ts +34 -0
- package/dist/helpers/roomImageGallery.d.ts +53 -0
- package/dist/helpers/secureFileUrl.d.ts +8 -0
- package/dist/helpers/sendFailureWatchdog.d.ts +62 -0
- package/dist/helpers/transformTranslatations.d.ts +1 -2
- package/dist/hooks/pushSubscriptionSweep.d.ts +41 -0
- package/dist/hooks/useChatOpenPhase.d.ts +21 -0
- package/dist/hooks/useChatWrapperInit.d.ts +1 -0
- package/dist/hooks/useDelayedAction.d.ts +22 -0
- package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
- package/dist/hooks/useExitTransition.d.ts +24 -0
- package/dist/hooks/useFilesEndpointSupport.d.ts +9 -0
- package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
- package/dist/hooks/useInView.d.ts +17 -0
- package/dist/hooks/useMentionComposer.d.ts +45 -0
- package/dist/hooks/useMessageHeapState.d.ts +1 -1
- package/dist/hooks/useMessageTranslation.d.ts +4 -3
- package/dist/hooks/useModalDismiss.d.ts +27 -0
- package/dist/hooks/useMyFiles.d.ts +16 -0
- package/dist/hooks/usePdfThumbnail.d.ts +22 -0
- package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
- package/dist/hooks/useRoomMute.d.ts +19 -0
- package/dist/hooks/useRoomState.d.ts +1 -1
- package/dist/hooks/useSendMessage.d.ts +4 -3
- package/dist/hooks/useTypography.d.ts +1 -1
- package/dist/hooks/useUnreadMessagesCounter.d.ts +11 -2
- package/dist/index.esm-B-3fyDHY.js +28 -0
- package/dist/index.esm-CRM4VCRa.js +943 -0
- package/dist/index.esm-msbp26WN.js +3352 -0
- package/dist/index.esm2017-CL0mvq6y.js +1578 -0
- package/dist/main-C2FKeV6y.js +32375 -0
- package/dist/main.css +1 -1
- package/dist/main.d.ts +14 -0
- package/dist/main.js +18 -18
- package/dist/module-DGXkb0R_.js +2960 -0
- package/dist/native-CDi4YD_s.js +13 -0
- package/dist/networking/api-requests/files.api.d.ts +19 -0
- package/dist/networking/api-requests/rooms.api.d.ts +10 -2
- package/dist/networking/api-requests/translate.api.d.ts +15 -0
- package/dist/networking/api-requests/user.api.d.ts +2 -0
- package/dist/networking/sharedRequest.d.ts +4 -0
- package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +3 -1
- package/dist/networking/xmpp/createTimeoutPromise.xmpp.d.ts +14 -0
- package/dist/networking/xmpp/sendTextMessage.xmpp.d.ts +2 -1
- package/dist/networking/xmpp/sendTextMessageWithTranslateTag.xmpp.d.ts +2 -1
- package/dist/networking/xmppClient.d.ts +12 -3
- package/dist/pdf-B5b7qHu6.js +17130 -0
- package/dist/pdf.worker.min-COYn-gId.js +24385 -0
- package/dist/roomStore/index.d.ts +20 -0
- package/dist/roomStore/persistEncryption.d.ts +51 -0
- package/dist/roomStore/roomsSlice.d.ts +49 -6
- package/dist/styles/classNames.d.ts +35 -0
- package/dist/styles/motion.d.ts +71 -0
- package/dist/styles/tokens.d.ts +27 -0
- package/dist/testIds.d.ts +1 -1
- package/dist/types/models/attachment.model.d.ts +33 -0
- package/dist/types/models/config.model.d.ts +160 -19
- package/dist/types/models/file.model.d.ts +20 -0
- package/dist/types/models/message.model.d.ts +15 -6
- package/dist/types/models/room.model.d.ts +40 -2
- package/dist/types/types.d.ts +3 -1
- package/dist/utils/resendMessage.d.ts +22 -1
- package/dist/utils/translateModePolicy.d.ts +1 -0
- package/dist/wavesurfer.esm-D_a19qBW.js +952 -0
- package/package.json +22 -2
- package/dist/VideoCallOverlay-C4M2I9oV.js.map +0 -1
- package/dist/components/MainComponents/VirtualList.d.ts +0 -10
- package/dist/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts +0 -6
- package/dist/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts +0 -6
- package/dist/components/Modals/SettingsModals/ManageDataModal/StyledComponents.d.ts +0 -0
- package/dist/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts +0 -6
- package/dist/components/Modals/SettingsModals/Referrals/Referrals.d.ts +0 -6
- package/dist/hooks/useMessageQueue.d.ts +0 -4
- package/dist/main-DeiuFYsl.js +0 -55812
- package/dist/main-DeiuFYsl.js.map +0 -1
- package/dist/main.js.map +0 -1
- package/dist/networking/xmpp/getHistory.xmpp.d.ts +0 -3
- package/dist/networking/xmpp/listenerManager.d.ts +0 -17
- package/dist/utils/xmppMemoryMonitor.d.ts +0 -16
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiFile } from '../types/types';
|
|
2
|
+
export interface UseMyFilesOptions {
|
|
3
|
+
roomName?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface UseMyFilesResult {
|
|
6
|
+
items: ApiFile[];
|
|
7
|
+
total: number;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
loadingMore: boolean;
|
|
10
|
+
error: string | null;
|
|
11
|
+
hasMore: boolean;
|
|
12
|
+
loadMore: () => void;
|
|
13
|
+
refresh: () => void;
|
|
14
|
+
remove: (id: string) => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function useMyFiles(options?: UseMyFilesOptions): UseMyFilesResult;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type PdfThumbnailStatus = 'idle' | 'loading' | 'ready' | 'error' | 'skipped';
|
|
2
|
+
interface UsePdfThumbnailParams {
|
|
3
|
+
url?: string;
|
|
4
|
+
/** Gate: keep false until the bubble is on screen. */
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
/** CSS pixels of the rendered bitmap's long edge. */
|
|
7
|
+
width?: number;
|
|
8
|
+
/** Files above this never auto-render; the card stays static. */
|
|
9
|
+
maxBytes?: number;
|
|
10
|
+
sizeInBytes?: number;
|
|
11
|
+
workerSrc?: string;
|
|
12
|
+
}
|
|
13
|
+
interface UsePdfThumbnailResult {
|
|
14
|
+
status: PdfThumbnailStatus;
|
|
15
|
+
/** Object URL - owned by this hook, revoked on unmount/url change. */
|
|
16
|
+
thumbnailUrl?: string;
|
|
17
|
+
pageCount?: number;
|
|
18
|
+
/** Re-runs a render that failed or was skipped for being too big. */
|
|
19
|
+
retry: () => void;
|
|
20
|
+
}
|
|
21
|
+
export declare const usePdfThumbnail: ({ url, enabled, width, maxBytes, sizeInBytes, workerSrc, }: UsePdfThumbnailParams) => UsePdfThumbnailResult;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,34 @@
|
|
|
1
1
|
export declare const handleQRChatId: () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Turns whatever the link carried into a room JID.
|
|
4
|
+
*
|
|
5
|
+
* Accepts a bare chat id (`<appId>_<chatId>`) or an already-qualified JID,
|
|
6
|
+
* so a QR that encodes either form lands in the same room.
|
|
7
|
+
*
|
|
8
|
+
* Returns '' when no conference server is known. That is deliberate: the
|
|
9
|
+
* hook used to fall back to the build-time `VITE_APP_XMPP_CONFERENCE`, which
|
|
10
|
+
* is baked into the published bundle and is empty in this package's own
|
|
11
|
+
* build. In a multi-tenant deploy that produced a JID for the wrong tenant
|
|
12
|
+
* (or the malformed `<id>@`), so an unknown conference now means "wait",
|
|
13
|
+
* never "guess".
|
|
14
|
+
*/
|
|
15
|
+
export declare const resolveQrChatRoomJid: (qrChatId?: string | null, conferenceServer?: string) => string;
|
|
16
|
+
interface QRCodeChatOptions {
|
|
17
|
+
/** Rooms currently known to the store, keyed by JID. */
|
|
18
|
+
rooms?: Record<string, unknown> | null;
|
|
19
|
+
/** The room the store currently has selected. */
|
|
20
|
+
activeRoomJID?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* True once the client is connected and the room list has settled, i.e.
|
|
23
|
+
* once "the room is still not here" is a real answer rather than "not
|
|
24
|
+
* loaded yet".
|
|
25
|
+
*/
|
|
26
|
+
isReady?: boolean;
|
|
27
|
+
}
|
|
2
28
|
export declare const useQRCodeChat: (setCurrentRoom: (params: {
|
|
3
29
|
roomJID: string;
|
|
4
|
-
}) => void, conferenceServer?: string) => {
|
|
30
|
+
}) => void, conferenceServer?: string, options?: QRCodeChatOptions) => {
|
|
5
31
|
wasAutoSelected: boolean;
|
|
32
|
+
notFoundRoomJID: string;
|
|
6
33
|
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseRoomMuteResult {
|
|
2
|
+
/** Current muted state for this room. `false` whenever the backend hasn't reported the field - see `isSupported`. */
|
|
3
|
+
muted: boolean;
|
|
4
|
+
/**
|
|
5
|
+
* True only once this room has an actual `muted` boolean - either fetched
|
|
6
|
+
* from a backend that supports per-chat mute (`/v1/chats/my` or
|
|
7
|
+
* `/v1/chats/my/{chatName}`), or because this client already toggled it
|
|
8
|
+
* successfully. Prod doesn't send `muted` yet, so UI should hide the mute
|
|
9
|
+
* control unless this is true - otherwise it offers a toggle that 404s.
|
|
10
|
+
*/
|
|
11
|
+
isSupported: boolean;
|
|
12
|
+
/** True while a toggle request is in flight. Disable the control to avoid a double submit. */
|
|
13
|
+
isPending: boolean;
|
|
14
|
+
/** Flips the current muted state - optimistic, with rollback + an error toast on failure. */
|
|
15
|
+
toggleMute: () => Promise<void>;
|
|
16
|
+
/** Sets the muted state directly - for controls with an explicit on/off state (e.g. a switch). */
|
|
17
|
+
setMuted: (nextMuted: boolean) => Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare const useRoomMute: (roomJid: string | undefined) => UseRoomMuteResult;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { IMentionSpan } from '../types/types';
|
|
2
|
+
export { shouldTagOutgoingTranslateSource } from '../utils/translateModePolicy';
|
|
2
3
|
export declare const useSendMessage: () => {
|
|
3
|
-
sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
|
|
4
|
-
sendMedia: (data: File, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
|
|
4
|
+
sendMessage: (message: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string, mentions?: IMentionSpan[]) => Promise<void>;
|
|
5
|
+
sendMedia: (data: File | File[] | Blob, type: string, activeRoomJID: string, isReply?: boolean, isChecked?: boolean, mainMessage?: string) => Promise<void>;
|
|
5
6
|
sendEditMessage: (message: string) => Promise<void>;
|
|
6
7
|
isLastMessageFromUserAndProcessing: (roomJID: string) => boolean;
|
|
7
8
|
};
|
|
@@ -2,7 +2,7 @@ import { TypographyConfig } from '../types/models/config.model';
|
|
|
2
2
|
/**
|
|
3
3
|
* Loads and applies the host-provided font configuration whenever it changes.
|
|
4
4
|
* Wired into the chat root (ReduxWrapper) so the font is in place before the
|
|
5
|
-
* UI paints. No-op when `typography` is undefined
|
|
5
|
+
* UI paints. No-op when `typography` is undefined - the default system font
|
|
6
6
|
* stack is kept, so existing integrations are unaffected.
|
|
7
7
|
*/
|
|
8
8
|
export declare function useTypography(typography?: TypographyConfig): void;
|
|
@@ -5,8 +5,17 @@ interface UnreadMessagesDisplayMap {
|
|
|
5
5
|
[roomJid: string]: string;
|
|
6
6
|
}
|
|
7
7
|
interface UnreadMessagesStats {
|
|
8
|
+
/** True when `totalCount > 0` - already excludes muted rooms, see `totalCount`. */
|
|
8
9
|
hasUnread: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Sum of unread counts across visible rooms, EXCLUDING any room the caller
|
|
12
|
+
* has muted (a muted room still counts its own unread - see
|
|
13
|
+
* `unreadByRoom` - it just doesn't inflate this aggregate, so a global
|
|
14
|
+
* unread badge/favicon built from this number doesn't light up for a
|
|
15
|
+
* muted chat).
|
|
16
|
+
*/
|
|
9
17
|
totalCount: number;
|
|
18
|
+
/** Per-room unread counts, including muted rooms - the room-list badge always shows its own count regardless of mute. */
|
|
10
19
|
unreadByRoom: UnreadMessagesMap;
|
|
11
20
|
displayTotal: string;
|
|
12
21
|
displayByRoom: UnreadMessagesDisplayMap;
|
|
@@ -16,10 +25,10 @@ interface UnreadMessagesStats {
|
|
|
16
25
|
* hook keeps `loading` true until the per-room counts have stopped changing
|
|
17
26
|
* for a short window, then latches it to false. After that first settle,
|
|
18
27
|
* live message increments update the counts immediately and never flip
|
|
19
|
-
* `loading` back on
|
|
28
|
+
* `loading` back on, it's a first-load indicator, not a per-update one.
|
|
20
29
|
*/
|
|
21
30
|
loading: boolean;
|
|
22
|
-
/** Alias of `loading
|
|
31
|
+
/** Alias of `loading`, matches the React Native SDK field name. */
|
|
23
32
|
isLoading: boolean;
|
|
24
33
|
}
|
|
25
34
|
export declare const useUnreadMessagesCounter: () => UnreadMessagesStats;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { B as p, D as o, r as e } from "./index.esm2017-CL0mvq6y.js";
|
|
2
|
+
import { F as n, S as _, G as v, H as m, I as A, J as g, K as d, M as S, a as b, N as l, e as E, _ as F, O as c, P as C, Q as L, b as N, R as O, T as f, U as D } from "./index.esm2017-CL0mvq6y.js";
|
|
3
|
+
var s = "firebase", a = "11.9.1";
|
|
4
|
+
e(s, a, "app");
|
|
5
|
+
export {
|
|
6
|
+
n as FirebaseError,
|
|
7
|
+
_ as SDK_VERSION,
|
|
8
|
+
v as _DEFAULT_ENTRY_NAME,
|
|
9
|
+
m as _addComponent,
|
|
10
|
+
A as _addOrOverwriteComponent,
|
|
11
|
+
g as _apps,
|
|
12
|
+
d as _clearComponents,
|
|
13
|
+
S as _components,
|
|
14
|
+
b as _getProvider,
|
|
15
|
+
l as _isFirebaseApp,
|
|
16
|
+
E as _isFirebaseServerApp,
|
|
17
|
+
F as _registerComponent,
|
|
18
|
+
c as _removeServiceInstance,
|
|
19
|
+
C as _serverApps,
|
|
20
|
+
L as deleteApp,
|
|
21
|
+
N as getApp,
|
|
22
|
+
o as getApps,
|
|
23
|
+
p as initializeApp,
|
|
24
|
+
O as initializeServerApp,
|
|
25
|
+
f as onLog,
|
|
26
|
+
e as registerVersion,
|
|
27
|
+
D as setLogLevel
|
|
28
|
+
};
|