@ethora/chat-component 26.9.6 → 26.10.1
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 +45 -3
- package/dist/{ChatProfileModal-DKuxJsdM.js → ChatProfileModal-Bf5jGPBZ.js} +566 -562
- package/dist/FilePreviewModal-Bwx0RZZw.js +1763 -0
- package/dist/{ManageDataModal-Dw4dCQll.js → ManageDataModal-Dhkp0LWH.js} +20 -20
- package/dist/{MarkdownBody-xtKDMR0h.js → MarkdownBody-_sUhW2O8.js} +1 -1
- package/dist/{MessageSearchModal-BVKU6H3v.js → MessageSearchModal-rwwWrILl.js} +106 -114
- package/dist/{PublicChatsModal-CscOnVaQ.js → PublicChatsModal-Byso6_vt.js} +13 -13
- package/dist/{SideDrawer-WneDrrWG.js → SideDrawer-CQPOf0ek.js} +38 -38
- package/dist/{UserProfileModal-CMHFq1I9.js → UserProfileModal-Vj2kICvc.js} +10 -10
- package/dist/{UserSettingsModal-BoZXZ0oR.js → UserSettingsModal-CioX4ZIV.js} +5 -5
- package/dist/{VideoCallOverlay-CQNi7wp5.js → VideoCallOverlay-DodAkiam.js} +3824 -3708
- package/dist/{VisibilityModal-BPsNiMzJ.js → VisibilityModal-CIl7rkBM.js} +12 -12
- package/dist/assets/icons.d.ts +2 -3
- package/dist/components/Files/fileCategory.d.ts +4 -2
- package/dist/components/InputComponents/MentionDropdown.d.ts +2 -0
- package/dist/components/MainComponents/AlbumGrid.d.ts +22 -0
- package/dist/components/MainComponents/AttachmentList.d.ts +6 -6
- package/dist/components/MainComponents/ImageUnavailable.d.ts +21 -0
- package/dist/components/MainComponents/MediaUploadOverlay.d.ts +31 -0
- package/dist/components/MainComponents/MessageContainer.d.ts +3 -0
- package/dist/components/MainComponents/scrollAnchor.d.ts +19 -0
- package/dist/components/MainComponents/useJumpToMessage.d.ts +42 -11
- package/dist/components/MainComponents/useScrollAnchor.d.ts +29 -0
- package/dist/components/MessageBubble/MediaCaption.d.ts +9 -0
- package/dist/components/MessageBubble/MessageAvatarPhoto.d.ts +17 -0
- package/dist/components/MessageBubble/MessageReaction.d.ts +6 -0
- package/dist/components/MessageBubble/QuickReplies.d.ts +2 -0
- package/dist/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +8 -10
- package/dist/components/Modals/FilePreviewModal/ImageLightbox.d.ts +4 -0
- package/dist/components/Modals/FilePreviewModal/PdfView.d.ts +4 -0
- package/dist/components/Modals/FilePreviewModal/ViewerChrome.d.ts +64 -0
- package/dist/components/Modals/MessageSearchModal/MessageHitResults.d.ts +5 -0
- package/dist/components/Modals/styledModalComponents.d.ts +0 -8
- package/dist/components/RoomComponents/LastMessageItem.d.ts +2 -0
- package/dist/components/RoomComponents/styled/LastMessageMedia.d.ts +19 -0
- package/dist/components/RoomComponents/styled/LastTextMessage.d.ts +2 -2
- package/dist/components/RoomComponents/styled/StyledRoomComponents.d.ts +10 -3
- package/dist/components/VideoCalls/VideoCallSession.d.ts +13 -0
- package/dist/components/styled/FileCard.d.ts +20 -0
- package/dist/components/styled/MediaSurface.d.ts +50 -0
- package/dist/components/styled/MessageImage.d.ts +9 -10
- package/dist/components/styled/SendInput.d.ts +12 -2
- package/dist/components/styled/StyledComponents.d.ts +69 -2
- package/dist/components/styled/StyledInputComponents/MediaComponents.d.ts +36 -24
- package/dist/components/styled/UnsupportedType.d.ts +1 -0
- package/dist/components/styled/VideoMessage.d.ts +11 -6
- package/dist/e2ee/callKey.d.ts +32 -0
- package/dist/e2ee/fileEnvelope.d.ts +16 -5
- package/dist/e2ee/omemo.d.ts +18 -0
- package/dist/firebase-messaging-sw.js +20 -3
- package/dist/{handleCopyClick-B70vLjJD.js → handleCopyClick-DGaZhy_u.js} +1 -1
- package/dist/helpers/albumLayout.d.ts +53 -0
- package/dist/helpers/attachments.d.ts +22 -1
- package/dist/helpers/avatarImageCache.d.ts +9 -0
- package/dist/helpers/caption.d.ts +63 -0
- package/dist/helpers/checkUniqueUsers.d.ts +2 -2
- package/dist/helpers/composerFocus.d.ts +22 -0
- package/dist/helpers/createMainMessageForThread.d.ts +1 -1
- package/dist/helpers/dedupeMembers.d.ts +10 -0
- package/dist/helpers/downloadFile.d.ts +19 -0
- package/dist/helpers/fileKind.d.ts +17 -0
- package/dist/helpers/historyPreloadConfig.d.ts +25 -0
- package/dist/helpers/historyPreloadScheduler.d.ts +3 -0
- package/dist/helpers/insertMessageWithDelimiter.d.ts +1 -0
- package/dist/helpers/isMessageSearchEnabled.d.ts +9 -0
- package/dist/helpers/jumpThread.d.ts +56 -0
- package/dist/helpers/jumpWindow.d.ts +73 -0
- package/dist/helpers/lastMessagePreview.d.ts +55 -0
- package/dist/helpers/mapWithConcurrency.d.ts +8 -0
- package/dist/helpers/mediaBox.d.ts +110 -0
- package/dist/helpers/mediaBubble.d.ts +39 -0
- package/dist/helpers/mediaLabel.d.ts +10 -0
- package/dist/helpers/mediaSendRetry.d.ts +25 -0
- package/dist/helpers/messageRuns.d.ts +10 -0
- package/dist/helpers/openThreadForJump.d.ts +26 -0
- package/dist/helpers/pdf/loadPdfjs.d.ts +8 -1
- package/dist/helpers/repairFilenameEncoding.d.ts +11 -0
- package/dist/helpers/roomImageGallery.d.ts +34 -0
- package/dist/helpers/roomUserCount.d.ts +19 -0
- package/dist/helpers/safeUrl.d.ts +15 -0
- package/dist/helpers/secureFileUrl.d.ts +4 -1
- package/dist/helpers/userResolver.d.ts +57 -0
- package/dist/helpers/viewerSender.d.ts +47 -0
- package/dist/helpers/xmppIdShape.d.ts +1 -1
- package/dist/hooks/useAvatarImage.d.ts +21 -0
- package/dist/hooks/useChatWrapperInit.d.ts +6 -0
- package/dist/hooks/useIsMobileViewport.d.ts +5 -0
- package/dist/hooks/useMediaProbe.d.ts +40 -0
- package/dist/hooks/usePaneWidthVar.d.ts +11 -0
- package/dist/hooks/usePdfThumbnail.d.ts +2 -2
- package/dist/hooks/usePrefersReducedMotion.d.ts +2 -0
- package/dist/hooks/useRoomDirectory.d.ts +11 -0
- package/dist/hooks/useSendMessage.d.ts +4 -1
- package/dist/{main-rJpE4hh-.js → main-CUB_w8AZ.js} +29136 -24217
- package/dist/main.css +1 -1
- package/dist/main.js +16 -16
- package/dist/networking/api-requests/auth.api.d.ts +2 -0
- package/dist/networking/api-requests/roomMembers.api.d.ts +18 -0
- package/dist/networking/callKeyStanza.d.ts +7 -0
- package/dist/networking/ethoraEvents.d.ts +44 -0
- package/dist/networking/stanzaHandlers.d.ts +6 -4
- package/dist/networking/xmpp/allRoomPresences.xmpp.d.ts +18 -1
- package/dist/networking/xmpp/presenceInRoom.xmpp.d.ts +1 -1
- package/dist/networking/xmpp/sendDisplayedMarker.xmpp.d.ts +2 -0
- package/dist/networking/xmpp/sendMediaMessage.xmpp.d.ts +8 -0
- package/dist/networking/xmpp/sendReceivedReceipt.xmpp.d.ts +2 -0
- package/dist/networking/xmppClient.d.ts +61 -2
- package/dist/roomStore/Middleware/jumpThreadMiddleware.d.ts +2 -0
- package/dist/roomStore/callSlice.d.ts +6 -1
- package/dist/roomStore/index.d.ts +22 -0
- package/dist/roomStore/roomsSlice.d.ts +51 -4
- package/dist/roomStore/safeKey.d.ts +12 -0
- package/dist/roomStore/usersSetCap.d.ts +15 -0
- package/dist/styles/motion.d.ts +22 -2
- package/dist/types/models/attachment.model.d.ts +19 -0
- package/dist/types/models/config.model.d.ts +98 -5
- package/dist/types/models/customComponents.model.d.ts +2 -0
- package/dist/types/models/message.model.d.ts +9 -0
- package/dist/types/models/modal.model.d.ts +19 -0
- package/dist/types/models/room.model.d.ts +30 -0
- package/dist/types/models/xmpp.model.d.ts +24 -1
- package/dist/utils/messageNotificationContent.d.ts +34 -0
- package/dist/version.d.ts +1 -1
- package/package.json +2 -1
- package/public/firebase-messaging-sw.js +20 -3
- package/dist/FilePreviewModal-BcaSoO3-.js +0 -743
- package/dist/components/MainComponents/computeAnchoredScrollTop.d.ts +0 -9
- package/dist/components/Modals/NewChatModal/UpdNewChatModal.d.ts +0 -3
- package/dist/components/RoomComponents/styled/LastAudioMessage.d.ts +0 -6
- package/dist/components/RoomComponents/styled/LastMessageFile.d.ts +0 -6
- package/dist/components/RoomComponents/styled/LastMessagePhoto.d.ts +0 -6
- package/dist/components/RoomComponents/styled/LastMessageVideo.d.ts +0 -6
- package/dist/components/SortDropDown/index.d.ts +0 -8
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b, useEffect as x } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
3
|
+
import { E as o, a as L, x as P, u as R, aR as D, aS as z } from "./main-CUB_w8AZ.js";
|
|
4
|
+
import { S as I, D as C, a as $, b as k, e as S, f as p } from "./SideDrawer-CQPOf0ek.js";
|
|
5
5
|
o.div``;
|
|
6
6
|
o.div`
|
|
7
7
|
font-size: 16px;
|
|
@@ -13,7 +13,7 @@ o.p`
|
|
|
13
13
|
color: var(--ethora-color-text-muted, #6b7280);
|
|
14
14
|
margin-bottom: 32px;
|
|
15
15
|
`;
|
|
16
|
-
const
|
|
16
|
+
const w = o.div`
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
gap: 6px;
|
|
@@ -25,7 +25,7 @@ const O = o.div`
|
|
|
25
25
|
`, u = o.input`
|
|
26
26
|
accent-color: ${({ $radioColor: i }) => i || "var(--ethora-color-primary, #0052CD)"};
|
|
27
27
|
margin: 0px;
|
|
28
|
-
`,
|
|
28
|
+
`, N = o.div`
|
|
29
29
|
padding: 10px 15px;
|
|
30
30
|
margin-top: 16px;
|
|
31
31
|
color: ${({ type: i }) => i === "success" ? "#10b981" : "#ef4444"};
|
|
@@ -39,12 +39,12 @@ const O = o.div`
|
|
|
39
39
|
background: ${({ type: i }) => i === "success" ? "rgba(16, 185, 129, 0.15)" : "rgba(242, 118, 107, 0.15)"};
|
|
40
40
|
border-color: ${({ type: i }) => i === "success" ? "var(--ethora-color-success, #10b981)" : "var(--ethora-color-danger, #ef4444)"};
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`, M = ({
|
|
43
43
|
handleCloseModal: i
|
|
44
44
|
}) => {
|
|
45
|
-
const
|
|
45
|
+
const O = L(), e = P(), { user: n, config: l } = R(
|
|
46
46
|
(t) => t.chatSettingStore
|
|
47
|
-
), g = (t) =>
|
|
47
|
+
), g = (t) => O(z(t)), [a, m] = b(n?.isProfileOpen), [c, v] = b(n?.isAssetsOpen), [f, y] = b(null), d = (t, A) => {
|
|
48
48
|
y({ message: t, type: A }), setTimeout(() => y(null), 3e3);
|
|
49
49
|
};
|
|
50
50
|
return x(() => {
|
|
@@ -56,7 +56,7 @@ const O = o.div`
|
|
|
56
56
|
g(t.user), d(e("notification.saved"), "success");
|
|
57
57
|
}).catch(() => d(e("toast.error"), "error"));
|
|
58
58
|
}, [c]), /* @__PURE__ */ r(
|
|
59
|
-
|
|
59
|
+
I,
|
|
60
60
|
{
|
|
61
61
|
title: e("settings.visibility.title"),
|
|
62
62
|
onClose: i,
|
|
@@ -64,7 +64,7 @@ const O = o.div`
|
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ r(C, { children: [
|
|
66
66
|
/* @__PURE__ */ s($, { children: e("settings.visibility.profileLabel") }),
|
|
67
|
-
/* @__PURE__ */ s(k, { children: /* @__PURE__ */ s(
|
|
67
|
+
/* @__PURE__ */ s(k, { children: /* @__PURE__ */ s(S, { children: /* @__PURE__ */ r(w, { children: [
|
|
68
68
|
/* @__PURE__ */ r(h, { children: [
|
|
69
69
|
/* @__PURE__ */ s(
|
|
70
70
|
u,
|
|
@@ -97,7 +97,7 @@ const O = o.div`
|
|
|
97
97
|
] }),
|
|
98
98
|
/* @__PURE__ */ r(C, { children: [
|
|
99
99
|
/* @__PURE__ */ s($, { children: e("settings.visibility.documentsLabel") }),
|
|
100
|
-
/* @__PURE__ */ s(k, { children: /* @__PURE__ */ s(
|
|
100
|
+
/* @__PURE__ */ s(k, { children: /* @__PURE__ */ s(S, { children: /* @__PURE__ */ r(w, { children: [
|
|
101
101
|
/* @__PURE__ */ r(h, { children: [
|
|
102
102
|
/* @__PURE__ */ s(
|
|
103
103
|
u,
|
|
@@ -128,11 +128,11 @@ const O = o.div`
|
|
|
128
128
|
/* @__PURE__ */ s(p, { children: e("settings.visibility.individualDescription") })
|
|
129
129
|
] }) }) })
|
|
130
130
|
] }),
|
|
131
|
-
f && /* @__PURE__ */ s(
|
|
131
|
+
f && /* @__PURE__ */ s(N, { type: f.type, children: f.message })
|
|
132
132
|
]
|
|
133
133
|
}
|
|
134
134
|
);
|
|
135
135
|
};
|
|
136
136
|
export {
|
|
137
|
-
|
|
137
|
+
M as default
|
|
138
138
|
};
|
package/dist/assets/icons.d.ts
CHANGED
|
@@ -148,10 +148,9 @@ export declare const InSendingIcon: ({ fill, color, ...props }: {
|
|
|
148
148
|
fill?: string;
|
|
149
149
|
color?: string;
|
|
150
150
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
151
|
-
export declare const DoubleTick: ({
|
|
151
|
+
export declare const DoubleTick: ({ stroke, ...props }: {
|
|
152
152
|
[x: string]: any;
|
|
153
|
-
|
|
154
|
-
color?: string;
|
|
153
|
+
stroke?: string;
|
|
155
154
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
156
155
|
export declare const RedCross: ({ color, ...props }: {
|
|
157
156
|
[x: string]: any;
|
|
@@ -7,7 +7,9 @@ export type FileCategory = 'media' | 'documents' | 'audio';
|
|
|
7
7
|
* with thumbnails); audio/* gets its own chip; everything else falls back
|
|
8
8
|
* to "Documents".
|
|
9
9
|
*/
|
|
10
|
-
export declare function getFileCategory(mimetype?: string | null): FileCategory;
|
|
11
|
-
export declare function isPreviewable(file: Pick<ApiFile, 'mimetype'>
|
|
10
|
+
export declare function getFileCategory(mimetype?: string | null, name?: string | null): FileCategory;
|
|
11
|
+
export declare function isPreviewable(file: Pick<ApiFile, 'mimetype'> & {
|
|
12
|
+
originalname?: string;
|
|
13
|
+
}): boolean;
|
|
12
14
|
/** Human-readable byte size, e.g. formatBytes(1536) -> "1.5 KB". */
|
|
13
15
|
export declare function formatBytes(bytes?: number | null): string;
|
|
@@ -8,6 +8,8 @@ interface MentionDropdownProps {
|
|
|
8
8
|
onSelect: (candidate: MentionCandidate) => void;
|
|
9
9
|
onShowAll: () => void;
|
|
10
10
|
onHoverIndex: (index: number) => void;
|
|
11
|
+
/** More people are still being loaded in the background. */
|
|
12
|
+
loading?: boolean;
|
|
11
13
|
}
|
|
12
14
|
export declare const MentionDropdown: React.FC<MentionDropdownProps>;
|
|
13
15
|
export default MentionDropdown;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IAttachment, ModalFile } from '../../types/types';
|
|
3
|
+
export interface AlbumGridItem {
|
|
4
|
+
attachment: IAttachment;
|
|
5
|
+
/** Position in the message's `attachments`, used for retry. */
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
interface AlbumGridProps {
|
|
9
|
+
items: AlbumGridItem[];
|
|
10
|
+
/** Called with the failed tile's index when the user asks to retry it. */
|
|
11
|
+
onRetry?: (index: number) => void;
|
|
12
|
+
/** Who posted the album and when, handed to the viewer header. */
|
|
13
|
+
sender?: ModalFile['sender'];
|
|
14
|
+
date?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Photo/video album for a message with several media files. Layout comes
|
|
18
|
+
* from getAlbumLayout; a tile tap opens that file in the preview modal, and
|
|
19
|
+
* a tile still in flight or failed shows its state over the thumbnail.
|
|
20
|
+
*/
|
|
21
|
+
declare const AlbumGrid: React.FC<AlbumGridProps>;
|
|
22
|
+
export default AlbumGrid;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { IAttachment } from '../../types/types';
|
|
2
|
+
import { IAttachment, ModalFile } from '../../types/types';
|
|
3
3
|
interface AttachmentListProps {
|
|
4
4
|
attachments: IAttachment[];
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
/** Re-sends the file at this index of `attachments` after a failed upload. */
|
|
6
|
+
onRetryAttachment?: (index: number) => void;
|
|
7
|
+
/** Who posted the message and when; the viewer header shows both. */
|
|
8
|
+
sender?: ModalFile['sender'];
|
|
9
|
+
date?: string;
|
|
10
10
|
}
|
|
11
11
|
declare const AttachmentList: React.FC<AttachmentListProps>;
|
|
12
12
|
export default AttachmentList;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface ImageUnavailableArtProps {
|
|
3
|
+
/** Rendered width and height in CSS pixels. The viewBox scales crisply. */
|
|
4
|
+
size?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const ImageUnavailableArt: React.FC<ImageUnavailableArtProps>;
|
|
7
|
+
export interface ImageUnavailableStateProps {
|
|
8
|
+
/**
|
|
9
|
+
* Compact: the glyph only, about 28px, for album grid tiles. Full: the
|
|
10
|
+
* illustration, the caption and a hint, for a solo bubble or the viewer.
|
|
11
|
+
*/
|
|
12
|
+
compact?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Shows a "Try again" action. The picture sits inside the bubble's open
|
|
15
|
+
* button, so the action is a span with button semantics, not a <button>.
|
|
16
|
+
*/
|
|
17
|
+
onRetry?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/** Self-contained "could not load" state that fills its positioned parent. */
|
|
20
|
+
export declare const ImageUnavailableState: React.FC<ImageUnavailableStateProps>;
|
|
21
|
+
export default ImageUnavailableState;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** How long the scrim takes to fade once the upload is done. */
|
|
3
|
+
export declare const SCRIM_FADE_MS = 180;
|
|
4
|
+
/** The circular-arrow retry mark, shared by the failed tile and the "+N" badge. */
|
|
5
|
+
export declare const RetryIcon: React.FC<{
|
|
6
|
+
size?: number;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* Thin circular progress ring. The SVG is a fixed 40px square with a
|
|
10
|
+
* viewBox, so it can never stretch; the arc is drawn by moving the dash
|
|
11
|
+
* offset from the full circumference (empty) down to zero (complete).
|
|
12
|
+
*/
|
|
13
|
+
export declare const ProgressRing: React.FC<{
|
|
14
|
+
percent: number;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}>;
|
|
17
|
+
interface MediaUploadOverlayProps {
|
|
18
|
+
/** `uploading` covers "waiting for the siblings" too; `failed` is a retry prompt. */
|
|
19
|
+
status: 'uploading' | 'failed';
|
|
20
|
+
progress?: number;
|
|
21
|
+
/** Upload is done: fade the scrim out instead of leaving it up. */
|
|
22
|
+
leaving?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* State layer over an outgoing attachment: a frosted scrim with a progress
|
|
26
|
+
* ring while it goes up, and a tinted scrim with a retry glyph once it has
|
|
27
|
+
* failed. The parent owns the click, so this stays pointer-transparent and
|
|
28
|
+
* can sit inside a button without nesting interactive elements.
|
|
29
|
+
*/
|
|
30
|
+
export declare const MediaUploadOverlay: React.FC<MediaUploadOverlayProps>;
|
|
31
|
+
export default MediaUploadOverlay;
|
|
@@ -6,6 +6,7 @@ interface MessageContainerProps {
|
|
|
6
6
|
isUser: boolean;
|
|
7
7
|
$isUser?: boolean;
|
|
8
8
|
isReply: boolean;
|
|
9
|
+
isLastInGroup?: boolean;
|
|
9
10
|
}>;
|
|
10
11
|
message: IMessage;
|
|
11
12
|
activeMessage: IMessage;
|
|
@@ -13,6 +14,8 @@ interface MessageContainerProps {
|
|
|
13
14
|
xmppUsername: string;
|
|
14
15
|
isReply: boolean;
|
|
15
16
|
showDateLabel: boolean;
|
|
17
|
+
/** False when the next row is the same sender's message (a run continues). */
|
|
18
|
+
isLastInGroup?: boolean;
|
|
16
19
|
className?: string;
|
|
17
20
|
}
|
|
18
21
|
export declare const MessageContainer: React.NamedExoticComponent<MessageContainerProps>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface AnchorRowRect {
|
|
2
|
+
id: string;
|
|
3
|
+
top: number;
|
|
4
|
+
bottom: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ScrollAnchor {
|
|
7
|
+
id: string;
|
|
8
|
+
/** Row top relative to the scroller's top edge. */
|
|
9
|
+
offset: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The row to hold still while content changes around it: the first row that
|
|
13
|
+
* is fully inside the viewport, or, when none is (a row taller than the
|
|
14
|
+
* viewport, or the viewport cuts every row), the first one that intersects it.
|
|
15
|
+
* `rows` must be in document order.
|
|
16
|
+
*/
|
|
17
|
+
export declare function pickAnchorRow(viewTop: number, viewBottom: number, rows: AnchorRowRect[]): ScrollAnchor | null;
|
|
18
|
+
/** How far scrollTop must move for the anchor row to sit at its old offset. */
|
|
19
|
+
export declare function anchorScrollDelta(anchor: ScrollAnchor, rowTop: number, viewTop: number): number;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { MutableRefObject, RefObject } from 'react';
|
|
2
|
+
import { PendingJump } from '../../roomStore/roomsSlice';
|
|
2
3
|
import { IMessage } from '../../types/types';
|
|
4
|
+
import { findMessageIndex } from '../../helpers/jumpThread';
|
|
5
|
+
export { findMessageIndex };
|
|
6
|
+
export declare const NEAR_LIVE_MESSAGES = 300;
|
|
3
7
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* rows, by content: same text, sent within a few seconds of the same time.
|
|
8
|
+
* How the attempt to open a window around the target went:
|
|
9
|
+
* - found: the window is in the store; the list now renders it;
|
|
10
|
+
* - missing: the server answered and the target is not in its archive;
|
|
11
|
+
* - unavailable: could not ask (no archive id, request failed): page instead.
|
|
9
12
|
*/
|
|
10
|
-
export
|
|
11
|
-
createdAt?: string;
|
|
12
|
-
body?: string;
|
|
13
|
-
}) => number;
|
|
13
|
+
export type WindowFetchResult = 'found' | 'missing' | 'unavailable';
|
|
14
14
|
/** What the server said about one page of older history. */
|
|
15
15
|
export interface OlderPage {
|
|
16
16
|
/** False when the request failed or timed out. */
|
|
@@ -47,6 +47,38 @@ interface Options {
|
|
|
47
47
|
* bottom, undoing the jump the moment the target loads.
|
|
48
48
|
*/
|
|
49
49
|
isUserScrolledUpRef: MutableRefObject<boolean>;
|
|
50
|
+
/** `messages` is a jump window around an earlier target, not the live list. */
|
|
51
|
+
jumpWindowActive?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Opens a window around a far target (and puts it in the store). Omitted
|
|
54
|
+
* where windows do not apply (threads); the paging path is used then.
|
|
55
|
+
*/
|
|
56
|
+
fetchWindow?: (jump: PendingJump) => Promise<WindowFetchResult>;
|
|
57
|
+
/**
|
|
58
|
+
* Which list this instance is. A jump is fulfilled by exactly one list: the
|
|
59
|
+
* main list, or the thread its target is a reply in. The other instances
|
|
60
|
+
* stay inert for it, so one of them cannot give up (and show the archived
|
|
61
|
+
* card) while the owner is still working.
|
|
62
|
+
*/
|
|
63
|
+
scope?: 'main' | {
|
|
64
|
+
threadId: string;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* The room's messages BEFORE the main list's filter (which hides thread
|
|
68
|
+
* replies). Lets the main list recognise a target that is a thread reply.
|
|
69
|
+
*/
|
|
70
|
+
allMessages?: IMessage[];
|
|
71
|
+
/**
|
|
72
|
+
* Opens the thread a reply target belongs to (main list only). Resolves true
|
|
73
|
+
* when the thread is open and owns the jump from now on.
|
|
74
|
+
*/
|
|
75
|
+
resolveReply?: (jump: PendingJump, reply: IMessage) => Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* The room is still opening (joining, loading its first history). While it
|
|
78
|
+
* is, a request that cannot be answered yet is waited out, not counted as a
|
|
79
|
+
* failure: the card is for "the server answered and the message is absent".
|
|
80
|
+
*/
|
|
81
|
+
roomOpening?: boolean;
|
|
50
82
|
}
|
|
51
83
|
/**
|
|
52
84
|
* Fulfils a pending "scroll to this message" request for this room.
|
|
@@ -59,5 +91,4 @@ interface Options {
|
|
|
59
91
|
* up, bounded by MAX_HISTORY_PAGES and by the end of the archive.
|
|
60
92
|
* If it cannot be reached, say so rather than leaving the tap looking dead.
|
|
61
93
|
*/
|
|
62
|
-
export declare function useJumpToMessage({ roomJID, messages, visibleCount, setRenderWindow, fetchOlderPage, containerRef, historyComplete, isUserScrolledUpRef, }: Options): void;
|
|
63
|
-
export {};
|
|
94
|
+
export declare function useJumpToMessage({ roomJID, messages, visibleCount, setRenderWindow, fetchOlderPage, containerRef, historyComplete, isUserScrolledUpRef, jumpWindowActive, fetchWindow, scope, allMessages, resolveReply, roomOpening, }: Options): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/** The reader counts as still after this long without scrolling. */
|
|
3
|
+
export declare const ANCHOR_IDLE_MS = 100;
|
|
4
|
+
interface Options {
|
|
5
|
+
containerRef: RefObject<HTMLElement>;
|
|
6
|
+
/** The element whose height changes as rows grow. */
|
|
7
|
+
flowRef: RefObject<HTMLElement>;
|
|
8
|
+
/** Identity changes whenever the mounted rows can change. */
|
|
9
|
+
rows: unknown;
|
|
10
|
+
/** True when the reader follows the bottom: nothing is anchored then. */
|
|
11
|
+
isStuckToBottom: () => boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Keeps the rows the reader is looking at perfectly still while content is
|
|
15
|
+
* added or resized above or below them (older history prepended, a jump
|
|
16
|
+
* window paged either way, the render window widened, rows trimmed).
|
|
17
|
+
*
|
|
18
|
+
* - Just before a commit that can change the rows, the anchor is captured from
|
|
19
|
+
* the live DOM (the render phase still sees the previous layout).
|
|
20
|
+
* - The layout effect puts it back before paint, by the anchor ROW's own
|
|
21
|
+
* movement, so a row that gained a date divider or header is absorbed too.
|
|
22
|
+
* - Rows keep changing height after a commit (images, embeds, waveforms).
|
|
23
|
+
* Whenever the content resizes and the reader has been still for
|
|
24
|
+
* ANCHOR_IDLE_MS, the anchor is re-applied by a ResizeObserver. The anchor
|
|
25
|
+
* is re-taken ANCHOR_IDLE_MS after any scroll this hook did not make (the
|
|
26
|
+
* reader, a jump) and dropped while that scroll is going on.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useScrollAnchor({ containerRef, flowRef, rows, isStuckToBottom, }: Options): void;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MentionClickHandler } from '../../helpers/parseMessageBody';
|
|
3
|
+
interface MediaCaptionProps {
|
|
4
|
+
/** The message: its caption, or the text a legacy sender put in `body`. */
|
|
5
|
+
message: object;
|
|
6
|
+
onMentionClick?: MentionClickHandler;
|
|
7
|
+
}
|
|
8
|
+
declare const MediaCaption: React.FC<MediaCaptionProps>;
|
|
9
|
+
export default MediaCaption;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React, CSSProperties } from 'react';
|
|
2
|
+
interface MessageAvatarPhotoProps {
|
|
3
|
+
/** Sender photo URL; empty renders the initials circle alone. */
|
|
4
|
+
src?: string | null;
|
|
5
|
+
/** Display name, used for the initials. */
|
|
6
|
+
username?: string;
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Sender avatar in a message bubble. The initials circle is always rendered
|
|
11
|
+
* (no layout shift, nothing waits on the network); the photo is layered over
|
|
12
|
+
* it and faded in once it has loaded. A photo that fails to load leaves the
|
|
13
|
+
* initials, where the old bare <img> showed a broken-image glyph. A sender
|
|
14
|
+
* with many bubbles shares one load through useAvatarImage's cache.
|
|
15
|
+
*/
|
|
16
|
+
export declare const MessageAvatarPhoto: React.FC<MessageAvatarPhotoProps>;
|
|
17
|
+
export {};
|
|
@@ -5,6 +5,12 @@ interface MessageReactionProps {
|
|
|
5
5
|
reaction: Record<string, ReactionMessage>;
|
|
6
6
|
changeReaction: (reaction: string) => void;
|
|
7
7
|
userName?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Reports how far the chip rows hang below the bubble's bottom edge, in px,
|
|
10
|
+
* whenever their rendered height changes (one row hangs REACTION_HANG_PX).
|
|
11
|
+
* The message row uses it to reserve room for every wrapped row.
|
|
12
|
+
*/
|
|
13
|
+
onHangChange?: (hangPx: number) => void;
|
|
8
14
|
}
|
|
9
15
|
export declare const MessageReaction: FC<MessageReactionProps>;
|
|
10
16
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { QuickReply } from '../../helpers/quickReplies';
|
|
3
|
+
import { ChatColorScheme } from '../../types/types';
|
|
3
4
|
interface QuickRepliesProps {
|
|
4
5
|
replies: QuickReply[];
|
|
5
6
|
messageId: string;
|
|
6
7
|
accentColor?: string;
|
|
8
|
+
colorScheme?: ChatColorScheme;
|
|
7
9
|
/** Already answered - the chips are gone for good. */
|
|
8
10
|
answered?: boolean;
|
|
9
11
|
onSelect: (reply: QuickReply, questionId: string) => void;
|
|
@@ -7,17 +7,15 @@ interface FilePreviewModalProps {
|
|
|
7
7
|
*
|
|
8
8
|
* Images get a real lightbox: previous/next across every image loaded for
|
|
9
9
|
* the room (see helpers/roomImageGallery for exactly what that set is),
|
|
10
|
-
* wheel/pinch zoom with bounded panning, double-click
|
|
11
|
-
* fit, arrow
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* a thumbnail strip, wheel/pinch zoom with bounded panning, double-click or
|
|
11
|
+
* double-tap to toggle fit, arrow and swipe navigation, and a blurred
|
|
12
|
+
* low-resolution stand-in while the full picture loads. Video, audio, PDF and
|
|
13
|
+
* other files each get their own view; none of them get gallery chrome.
|
|
14
14
|
*
|
|
15
|
-
* Escape
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* so the only key listener below is for the arrows, and it explicitly leaves
|
|
20
|
-
* every other key (Escape included) alone.
|
|
15
|
+
* Escape and initial focus are handled by useModalDismiss at the modal layer
|
|
16
|
+
* (Modals/Modal/ModalContent.tsx), which also restores focus to the opener on
|
|
17
|
+
* close. This component adds the Tab trap and the arrow and zoom keys, and it
|
|
18
|
+
* leaves Escape alone so the key is not handled twice.
|
|
21
19
|
*/
|
|
22
20
|
declare const FilePreviewModal: React.FC<FilePreviewModalProps>;
|
|
23
21
|
export default FilePreviewModal;
|
|
@@ -11,6 +11,10 @@ export interface ImageLightboxHandle {
|
|
|
11
11
|
interface ImageLightboxProps {
|
|
12
12
|
src: string;
|
|
13
13
|
alt: string;
|
|
14
|
+
/** Low-res stand-in painted blurred until `src` has loaded. */
|
|
15
|
+
previewSrc?: string;
|
|
16
|
+
/** Visually hidden label for the loading spinner (screen readers). */
|
|
17
|
+
loadingLabel?: string;
|
|
14
18
|
/** Swipe (touch) navigation; also used to report gesture direction. */
|
|
15
19
|
onSwipeLeft?: () => void;
|
|
16
20
|
onSwipeRight?: () => void;
|
|
@@ -10,6 +10,10 @@ interface PdfViewerProps {
|
|
|
10
10
|
* opened was handed to a third-party host - and broke outright whenever that
|
|
11
11
|
* page changed or was unreachable. Rendering locally keeps the file URL
|
|
12
12
|
* inside the app and works offline-ish (the PDF itself still has to load).
|
|
13
|
+
*
|
|
14
|
+
* All pages stack in one scroll container. Every page has a placeholder sized
|
|
15
|
+
* from its real aspect, but only the few near the viewport render a canvas,
|
|
16
|
+
* so a 200-page document costs about as much as a 7-page one.
|
|
13
17
|
*/
|
|
14
18
|
declare const PdfViewer: React.FC<PdfViewerProps>;
|
|
15
19
|
export default PdfViewer;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export declare const VIEWER_TEXT = "#f5f7fa";
|
|
3
|
+
export declare const VIEWER_MUTED = "rgba(245, 247, 250, 0.68)";
|
|
4
|
+
export declare const VIEWER_SURFACE = "rgba(255, 255, 255, 0.08)";
|
|
5
|
+
export declare const VIEWER_SURFACE_HOVER = "rgba(255, 255, 255, 0.18)";
|
|
6
|
+
export declare const ViewerSurface: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
|
+
$closing: boolean;
|
|
8
|
+
}>> & string;
|
|
9
|
+
export declare const TopBar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
|
|
10
|
+
export declare const TopIdentity: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const SenderText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
+
export declare const SenderName: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
13
|
+
export declare const SubLine: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
14
|
+
export declare const ActionGroup: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
15
|
+
export declare const IconButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
16
|
+
export declare const Stage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
17
|
+
export declare const MediaFrame: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
18
|
+
$fit: "media" | "content";
|
|
19
|
+
}>> & string;
|
|
20
|
+
export declare const NavButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
21
|
+
$side: "left" | "right";
|
|
22
|
+
}>> & string;
|
|
23
|
+
export declare const BottomBar: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
24
|
+
export declare const ThumbStrip: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
25
|
+
export declare const Thumb: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {
|
|
26
|
+
$active: boolean;
|
|
27
|
+
}>> & string;
|
|
28
|
+
export declare const ThumbImage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, never>> & string;
|
|
29
|
+
/** Small play triangle over a video's thumbnail. */
|
|
30
|
+
export declare const ThumbPlayBadge: () => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/** Stand-in thumbnail for a video that has no poster image. */
|
|
32
|
+
export declare const ThumbVideoGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const ControlRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
34
|
+
export declare const Counter: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
35
|
+
export declare const ZoomGroup: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
36
|
+
interface ErrorPanelProps {
|
|
37
|
+
onRetry: () => void;
|
|
38
|
+
onDownload: () => void;
|
|
39
|
+
}
|
|
40
|
+
/** Shown in place of an image that cannot be loaded. No remote fallback image. */
|
|
41
|
+
export declare const ErrorPanel: React.FC<ErrorPanelProps>;
|
|
42
|
+
interface FileCardProps {
|
|
43
|
+
fileName: string;
|
|
44
|
+
unsupportedText: string;
|
|
45
|
+
onDownload: () => void;
|
|
46
|
+
}
|
|
47
|
+
/** Large card for files the viewer cannot render (anything but image/video/audio/PDF). */
|
|
48
|
+
export declare const FileCard: React.FC<FileCardProps>;
|
|
49
|
+
interface AudioCardProps {
|
|
50
|
+
fileName: string;
|
|
51
|
+
src: string;
|
|
52
|
+
}
|
|
53
|
+
/** Audio gets a native player inside a card, so it reads as a clip, not a broken image. */
|
|
54
|
+
export declare const AudioCard: React.FC<AudioCardProps>;
|
|
55
|
+
export declare const ExternalLinkGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const RetryGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
export declare const DownloadGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export declare const FileGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare const AudioGlyph: () => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
/** Format a message timestamp for the viewer header; empty when unknown. */
|
|
61
|
+
export declare const formatViewerDate: (iso?: string) => string;
|
|
62
|
+
/** Returns the URL with a retry marker, so a retry is not served from the failed cache entry. */
|
|
63
|
+
export declare const withRetryMarker: (url: string, attempt: number) => string;
|
|
64
|
+
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MessageSearchHit } from '../../../networking/api-requests/messageSearch.api';
|
|
3
|
+
/**
|
|
4
|
+
* Secondary pill button used for "Show more" and "Retry" under search
|
|
5
|
+
* results, in the search panel and in the room list.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SecondaryPillButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
3
8
|
/**
|
|
4
9
|
* What a tap on a search hit does, shared by the search panel and the room
|
|
5
10
|
* list's search box: switch to the hit's room and ask it to scroll to, load
|
|
@@ -9,8 +9,6 @@ export declare const ModalContainer: import('styled-components/dist/types').ISty
|
|
|
9
9
|
export declare const ModalTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
10
10
|
/** Small uppercase-weight label above a field/list inside a modal - e.g. "Select Users (max 20)". */
|
|
11
11
|
export declare const ModalSectionLabel: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
12
|
-
/** 48px-min-height row used for members/blocked-users/etc. lists inside modals. */
|
|
13
|
-
export declare const ModalListRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
14
12
|
export declare const ModalDescription: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
15
13
|
export declare const GroupContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
16
14
|
export declare const ModalContainerFullScreen: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('styled-components').FastOmit<import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
@@ -24,15 +22,9 @@ export declare const HeaderRight: import('styled-components/dist/types').IStyled
|
|
|
24
22
|
export declare const CenterContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, "ref"> & {
|
|
25
23
|
ref?: import('react').Ref<HTMLDivElement>;
|
|
26
24
|
}, never>> & string;
|
|
27
|
-
export declare const ProfileImage: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
28
|
-
export declare const UserInfo: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
29
25
|
export declare const UserName: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
30
|
-
export declare const UserStatus: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
31
|
-
export declare const BorderedContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
32
|
-
export declare const LabelData: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
33
26
|
export declare const Label: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
34
27
|
export declare const ActionButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<Omit<ButtonProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
35
28
|
ref?: import('react').Ref<HTMLButtonElement>;
|
|
36
29
|
}, never>> & string & Omit<import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>, keyof import('react').Component<any, {}, any>>;
|
|
37
|
-
export declare const EmptySection: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
38
30
|
export declare const Divider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -2,6 +2,8 @@ import { FC } from 'react';
|
|
|
2
2
|
import { LastMessage } from '../../types/types';
|
|
3
3
|
interface LastMessageItemProps {
|
|
4
4
|
lastMessage: LastMessage;
|
|
5
|
+
/** The room is end-to-end encrypted: media shows an icon and label only. */
|
|
6
|
+
sealed?: boolean;
|
|
5
7
|
}
|
|
6
8
|
declare const LastMessageItem: FC<LastMessageItemProps>;
|
|
7
9
|
export default LastMessageItem;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { MediaPreview } from '../../../helpers/lastMessagePreview';
|
|
3
|
+
/** Edge of the thumbnail tile, and so the height of a thumbnail row. */
|
|
4
|
+
export declare const MEDIA_THUMB_PX = 18;
|
|
5
|
+
interface LastMessageMediaProps {
|
|
6
|
+
preview: MediaPreview;
|
|
7
|
+
/** Sender line, already resolved by ChatRoomItem; empty omits it. */
|
|
8
|
+
name?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Room-list preview for a media last message: a thumbnail (images, videos
|
|
12
|
+
* with a poster) or an inline icon, then a localized label. Thumbnails come
|
|
13
|
+
* from the message's own preview URL only, with the viewer's file token
|
|
14
|
+
* appended; a thumbnail that fails (a secure URL that 404s, an expired
|
|
15
|
+
* token) drops to the icon instead of a broken image, and nothing is ever
|
|
16
|
+
* fetched from a placeholder host.
|
|
17
|
+
*/
|
|
18
|
+
declare const LastMessageMedia: FC<LastMessageMediaProps>;
|
|
19
|
+
export default LastMessageMedia;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { LastMessage } from '../../../types/types';
|
|
3
|
-
interface
|
|
3
|
+
interface LastTextMessageProps extends Pick<LastMessage, 'user' | 'body'> {
|
|
4
4
|
}
|
|
5
|
-
declare const LastTextMessage: FC<
|
|
5
|
+
declare const LastTextMessage: FC<LastTextMessageProps>;
|
|
6
6
|
export default LastTextMessage;
|