@ethora/chat-component 26.7.5 → 26.7.6
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-hxsWI8cx.js +2139 -0
- package/dist/FilePreviewModal-CwWnHsB1.js +736 -0
- package/dist/ManageDataModal-CDPXcC93.js +159 -0
- package/dist/MarkdownBody-DBJGraWM.js +16874 -0
- package/dist/SideDrawer-Dr_lkaOW.js +226 -0
- package/dist/UserProfileModal-Q_jhXpsX.js +568 -0
- package/dist/UserSettingsModal-OcAJao-d.js +50 -0
- package/dist/{VideoCallOverlay-C4M2I9oV.js → VideoCallOverlay-CC4sShdK.js} +9 -10
- package/dist/VisibilityModal-DkMhx_2k.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/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/NewChatModal/styledNewChatComponents.d.ts +12 -0
- package/dist/components/Modals/SettingsModals/Visibility/StyledComponents.d.ts +1 -1
- package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +13 -0
- package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +44 -0
- package/dist/components/Modals/modalComponents.d.ts +6 -0
- package/dist/components/Modals/styledModalComponents.d.ts +14 -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/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-CpmPa6VI.js +32 -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/constants/MODAL_TYPES.d.ts +11 -7
- package/dist/helpers/ethoraLogger.d.ts +8 -0
- package/dist/helpers/fileKind.d.ts +17 -0
- 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/useChatWrapperInit.d.ts +1 -0
- package/dist/hooks/useFilesEndpointSupport.d.ts +9 -0
- 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/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-B-8IhwaP.js +31837 -0
- package/dist/main.css +1 -1
- package/dist/main.d.ts +14 -0
- package/dist/main.js +21 -21
- 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 +44 -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 +12 -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,132 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as x } from "react";
|
|
3
|
+
import { x as o, a as L, n as P, u as z, aF as D, aG as I } from "./main-B-8IhwaP.js";
|
|
4
|
+
import { S as N, D as C, a as w, b as O, e as S, f as p } from "./SideDrawer-Dr_lkaOW.js";
|
|
5
|
+
o.div``;
|
|
6
|
+
o.div`
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
font-weight: bold;
|
|
9
|
+
color: var(--ethora-color-text, #141414);
|
|
10
|
+
`;
|
|
11
|
+
o.p`
|
|
12
|
+
font-size: 14px;
|
|
13
|
+
color: var(--ethora-color-text-muted, #6b7280);
|
|
14
|
+
margin-bottom: 32px;
|
|
15
|
+
`;
|
|
16
|
+
const $ = o.div`
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
gap: 6px;
|
|
20
|
+
`, h = o.label`
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
gap: 8px;
|
|
25
|
+
`, f = o.input`
|
|
26
|
+
accent-color: ${({ $radioColor: t }) => t || "var(--ethora-color-primary, #0052CD)"};
|
|
27
|
+
margin: 0px;
|
|
28
|
+
`, R = o.div`
|
|
29
|
+
padding: 10px 15px;
|
|
30
|
+
margin-top: 16px;
|
|
31
|
+
color: ${({ type: t }) => t === "success" ? "#10b981" : "#ef4444"};
|
|
32
|
+
background: ${({ type: t }) => t === "success" ? "#d1fae5" : "#fee2e2"};
|
|
33
|
+
border: 1px solid
|
|
34
|
+
${({ type: t }) => t === "success" ? "#10b981" : "#ef4444"};
|
|
35
|
+
border-radius: 4px;
|
|
36
|
+
`, M = ({
|
|
37
|
+
handleCloseModal: t
|
|
38
|
+
}) => {
|
|
39
|
+
const k = L(), i = P(), { user: c, config: l } = z(
|
|
40
|
+
(s) => s.chatSettingStore
|
|
41
|
+
), y = (s) => k(I(s)), [n, m] = b(c?.isProfileOpen), [a, g] = b(c?.isAssetsOpen), [u, v] = b(null), d = (s, A) => {
|
|
42
|
+
v({ message: s, type: A }), setTimeout(() => v(null), 3e3);
|
|
43
|
+
};
|
|
44
|
+
return x(() => {
|
|
45
|
+
n !== c.isProfileOpen && D({ isProfileOpen: n }).then(({ data: s }) => {
|
|
46
|
+
y(s.user), d(i("notification.saved"), "success");
|
|
47
|
+
}).catch(() => d(i("toast.error"), "error"));
|
|
48
|
+
}, [n]), x(() => {
|
|
49
|
+
a !== c?.isAssetsOpen && D({ isAssetsOpen: a }).then(({ data: s }) => {
|
|
50
|
+
y(s.user), d(i("notification.saved"), "success");
|
|
51
|
+
}).catch(() => d(i("toast.error"), "error"));
|
|
52
|
+
}, [a]), /* @__PURE__ */ r(
|
|
53
|
+
N,
|
|
54
|
+
{
|
|
55
|
+
title: i("settings.visibility.title"),
|
|
56
|
+
onClose: t,
|
|
57
|
+
backLabel: i("action.back"),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ r(C, { children: [
|
|
60
|
+
/* @__PURE__ */ e(w, { children: i("settings.visibility.profileLabel") }),
|
|
61
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ r($, { children: [
|
|
62
|
+
/* @__PURE__ */ r(h, { children: [
|
|
63
|
+
/* @__PURE__ */ e(
|
|
64
|
+
f,
|
|
65
|
+
{
|
|
66
|
+
$radioColor: l?.colors?.primary,
|
|
67
|
+
type: "radio",
|
|
68
|
+
name: "ethora-profile-visibility",
|
|
69
|
+
checked: n === !0,
|
|
70
|
+
onChange: () => m(!0)
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
i("settings.visibility.open")
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ e(p, { children: i("settings.visibility.openDescription") }),
|
|
76
|
+
/* @__PURE__ */ r(h, { children: [
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
f,
|
|
79
|
+
{
|
|
80
|
+
$radioColor: l?.colors?.primary,
|
|
81
|
+
type: "radio",
|
|
82
|
+
name: "ethora-profile-visibility",
|
|
83
|
+
checked: n === !1,
|
|
84
|
+
onChange: () => m(!1)
|
|
85
|
+
}
|
|
86
|
+
),
|
|
87
|
+
i("settings.visibility.restricted")
|
|
88
|
+
] }),
|
|
89
|
+
/* @__PURE__ */ e(p, { children: i("settings.visibility.restrictedDescription") })
|
|
90
|
+
] }) }) })
|
|
91
|
+
] }),
|
|
92
|
+
/* @__PURE__ */ r(C, { children: [
|
|
93
|
+
/* @__PURE__ */ e(w, { children: i("settings.visibility.documentsLabel") }),
|
|
94
|
+
/* @__PURE__ */ e(O, { children: /* @__PURE__ */ e(S, { children: /* @__PURE__ */ r($, { children: [
|
|
95
|
+
/* @__PURE__ */ r(h, { children: [
|
|
96
|
+
/* @__PURE__ */ e(
|
|
97
|
+
f,
|
|
98
|
+
{
|
|
99
|
+
$radioColor: l?.colors?.primary,
|
|
100
|
+
type: "radio",
|
|
101
|
+
name: "ethora-documents-visibility",
|
|
102
|
+
checked: a === !0,
|
|
103
|
+
onChange: () => g(!0)
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
i("settings.visibility.full")
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ e(p, { children: i("settings.visibility.fullDescription") }),
|
|
109
|
+
/* @__PURE__ */ r(h, { children: [
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
f,
|
|
112
|
+
{
|
|
113
|
+
$radioColor: l?.colors?.primary,
|
|
114
|
+
type: "radio",
|
|
115
|
+
name: "ethora-documents-visibility",
|
|
116
|
+
checked: a === !1,
|
|
117
|
+
onChange: () => g(!1)
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
i("settings.visibility.individual")
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ e(p, { children: i("settings.visibility.individualDescription") })
|
|
123
|
+
] }) }) })
|
|
124
|
+
] }),
|
|
125
|
+
u && /* @__PURE__ */ e(R, { type: u.type, children: u.message })
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
M as default
|
|
132
|
+
};
|
package/dist/assets/icons.d.ts
CHANGED
|
@@ -7,9 +7,11 @@ export declare const AddNewIcon: ({ color, ...props }: {
|
|
|
7
7
|
color?: string;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export declare const AttachIcon: ({ color, bgcolor, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const EmojiIcon: ({ color, bgcolor, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export declare const CloseIcon: ({ color, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export declare const DownloadIcon: ({ color, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export declare const RecordIcon: ({ color, bgcolor, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const PdfIcon: ({ fill, color, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export declare const RemoveIcon: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export declare const SendIcon: ({ color, bgcolor, ...props }: {
|
|
15
17
|
[x: string]: any;
|
|
@@ -47,6 +49,14 @@ export declare const ReportIcon: ({ color, ...props }: {
|
|
|
47
49
|
[x: string]: any;
|
|
48
50
|
color?: string;
|
|
49
51
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
export declare const BellIcon: ({ color, ...props }: {
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
color?: string;
|
|
55
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const BellOffIcon: ({ color, ...props }: {
|
|
57
|
+
[x: string]: any;
|
|
58
|
+
color?: string;
|
|
59
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
50
60
|
export declare const DeleteIcon: ({ fill, color, width, height, ...props }: {
|
|
51
61
|
[x: string]: any;
|
|
52
62
|
fill?: string;
|
|
@@ -142,3 +152,23 @@ export declare const SingleTick: ({ color, ...props }: {
|
|
|
142
152
|
[x: string]: any;
|
|
143
153
|
color?: string;
|
|
144
154
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
155
|
+
export declare const ChevronLeftIcon: ({ color, ...props }: {
|
|
156
|
+
[x: string]: any;
|
|
157
|
+
color?: string;
|
|
158
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
159
|
+
export declare const ChevronRightIcon: ({ color, ...props }: {
|
|
160
|
+
[x: string]: any;
|
|
161
|
+
color?: string;
|
|
162
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
163
|
+
export declare const ZoomInIcon: ({ color, ...props }: {
|
|
164
|
+
[x: string]: any;
|
|
165
|
+
color?: string;
|
|
166
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
167
|
+
export declare const ZoomOutIcon: ({ color, ...props }: {
|
|
168
|
+
[x: string]: any;
|
|
169
|
+
color?: string;
|
|
170
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
171
|
+
export declare const ZoomResetIcon: ({ color, ...props }: {
|
|
172
|
+
[x: string]: any;
|
|
173
|
+
color?: string;
|
|
174
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { default as Picker } from '@emoji-mart/react';
|
|
2
1
|
export declare const ContainerInteractions: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
2
|
export declare const ReactionContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
3
|
export declare const ReactionBadge: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
5
4
|
export declare const ArrowButton: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
6
|
-
isRotated: boolean;
|
|
5
|
+
$isRotated: boolean;
|
|
7
6
|
}>> & string;
|
|
8
|
-
export declare const StyledPicker: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<any, never>> & string & Omit<typeof Picker, keyof import('react').Component<any, {}, any>>;
|
|
9
7
|
export declare const ContextMenu: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
8
|
export declare const MenuItem: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
9
|
export declare const Overlay: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MessageProps } from '../../types/types';
|
|
3
3
|
export declare const MessageContainer: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
4
|
-
isUser: boolean;
|
|
4
|
+
$isUser: boolean;
|
|
5
5
|
}>> & string;
|
|
6
6
|
export declare const MessageBubble: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
7
|
-
isUser: boolean;
|
|
7
|
+
$isUser: boolean;
|
|
8
8
|
}>> & string;
|
|
9
9
|
export declare const MessageText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
10
10
|
export declare const UserName: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
11
|
-
isUser: boolean;
|
|
11
|
+
$isUser: boolean;
|
|
12
12
|
color?: string;
|
|
13
13
|
}>> & string;
|
|
14
14
|
export declare const MessageTimestamp: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ApiFile } from '../../types/types';
|
|
3
|
+
export interface FilesListProps {
|
|
4
|
+
items: ApiFile[];
|
|
5
|
+
fileToken?: string;
|
|
6
|
+
onPreview: (file: ApiFile) => void;
|
|
7
|
+
onDownload: (file: ApiFile) => void;
|
|
8
|
+
onDelete: (file: ApiFile) => void;
|
|
9
|
+
compact?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const FilesList: React.FC<FilesListProps>;
|
|
12
|
+
export default FilesList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiFile } from '../../types/types';
|
|
2
|
+
export type FileCategory = 'media' | 'documents' | 'audio';
|
|
3
|
+
/**
|
|
4
|
+
* Category derivation for the filter chips - purely mimetype-driven since
|
|
5
|
+
* that is the one field the backend always sends alongside originalname.
|
|
6
|
+
* image/* and video/* both live under "Media" (they share the grid layout
|
|
7
|
+
* with thumbnails); audio/* gets its own chip; everything else falls back
|
|
8
|
+
* to "Documents".
|
|
9
|
+
*/
|
|
10
|
+
export declare function getFileCategory(mimetype?: string | null): FileCategory;
|
|
11
|
+
export declare function isPreviewable(file: Pick<ApiFile, 'mimetype'>): boolean;
|
|
12
|
+
/** Human-readable byte size, e.g. formatBytes(1536) -> "1.5 KB". */
|
|
13
|
+
export declare function formatBytes(bytes?: number | null): string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IConfig } from '../../types/types';
|
|
3
|
+
interface AttachmentPreviewProps {
|
|
4
|
+
file: File;
|
|
5
|
+
/** Blob URL for this file, owned by the composer. */
|
|
6
|
+
objectUrl?: string;
|
|
7
|
+
onRemove: (file: File) => void;
|
|
8
|
+
config?: IConfig;
|
|
9
|
+
removeLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* One picked-but-not-yet-sent file. PDFs get the same first-page render the
|
|
13
|
+
* bubble does - the file is already local, so it costs one blob read and
|
|
14
|
+
* makes "did I attach the right document?" answerable before sending.
|
|
15
|
+
*/
|
|
16
|
+
declare const AttachmentPreview: React.FC<AttachmentPreviewProps>;
|
|
17
|
+
export default AttachmentPreview;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MentionCandidate } from '../../helpers/mentions';
|
|
3
|
+
interface MentionDropdownProps {
|
|
4
|
+
candidates: MentionCandidate[];
|
|
5
|
+
totalCount: number;
|
|
6
|
+
hasOverflow: boolean;
|
|
7
|
+
highlightedIndex: number;
|
|
8
|
+
onSelect: (candidate: MentionCandidate) => void;
|
|
9
|
+
onShowAll: () => void;
|
|
10
|
+
onHoverIndex: (index: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const MentionDropdown: React.FC<MentionDropdownProps>;
|
|
13
|
+
export default MentionDropdown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RoomMember } from '../../types/types';
|
|
3
|
+
import { MentionCandidate } from '../../helpers/mentions';
|
|
4
|
+
interface MentionPickerModalProps {
|
|
5
|
+
members: RoomMember[];
|
|
6
|
+
selfId?: string;
|
|
7
|
+
onSelect: (candidate: MentionCandidate) => void;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Overflow picker for @-mentions, shown from the inline dropdown's
|
|
12
|
+
* "Show all N..." row when a room has more members than the inline list can
|
|
13
|
+
* display. Deliberately reuses UsersList - the same windowed member list the
|
|
14
|
+
* New Chat / add-members flows already use - in its single-select mode
|
|
15
|
+
* (see UsersList's `singleSelect`/`onSingleSelect` props) instead of
|
|
16
|
+
* building a second member list with its own windowing/search/empty-state.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MentionPickerModal: React.FC<MentionPickerModalProps>;
|
|
19
|
+
export default MentionPickerModal;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ChatErrorScope, IConfig } from '../../types/models/config.model';
|
|
3
|
+
interface ChatErrorBoundaryProps {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Host config: supplies `fallbackScreens.error` and `eventHandlers.onError`. */
|
|
6
|
+
config?: IConfig;
|
|
7
|
+
/** Which part of the SDK crashed. Reported to the host and logged. */
|
|
8
|
+
scope?: ChatErrorScope;
|
|
9
|
+
/**
|
|
10
|
+
* Render nothing at all after a crash instead of the default screen. Used
|
|
11
|
+
* for the call overlay, where a full-size "something went wrong" panel
|
|
12
|
+
* would sit on top of the host application forever.
|
|
13
|
+
*/
|
|
14
|
+
silent?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface ChatErrorBoundaryState {
|
|
17
|
+
error: Error | null;
|
|
18
|
+
componentStack?: string;
|
|
19
|
+
/** Bumped by "try again"; keying the subtree on it forces a re-mount. */
|
|
20
|
+
resetCount: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The SDK's crash barrier.
|
|
24
|
+
*
|
|
25
|
+
* `@ethora/chat-component` renders inside somebody else's application. Without
|
|
26
|
+
* a boundary, one uncaught render error anywhere in the chat tree unmounts the
|
|
27
|
+
* host's whole React root - the customer's app white-screens because of a bug
|
|
28
|
+
* in ours. That has already happened twice in the field (a router crash on an
|
|
29
|
+
* undefined `config.colors.primary`, and "Cannot destructure property
|
|
30
|
+
* 'composing'" when leaving a room), so the barrier is not hypothetical.
|
|
31
|
+
*
|
|
32
|
+
* Behaviour:
|
|
33
|
+
* - the error is never swallowed: it is always logged through
|
|
34
|
+
* `ethoraLogger.criticalError` together with the React component stack;
|
|
35
|
+
* - the host can be notified via `config.eventHandlers.onError` (wrapped so a
|
|
36
|
+
* throw inside the host's own handler cannot crash the boundary, the same
|
|
37
|
+
* defence useEventHandlers applies to the message handlers);
|
|
38
|
+
* - the host can replace the screen via `config.fallbackScreens.error`, which
|
|
39
|
+
* follows the same shape as `noUser` / `noConnection` / `noRoom` (string =
|
|
40
|
+
* centered text, React node = rendered as-is) and additionally accepts a
|
|
41
|
+
* render function receiving `{ error, componentStack, scope, reset }`;
|
|
42
|
+
* - "try again" clears the error and re-mounts the subtree, because most of
|
|
43
|
+
* these crashes are transient state problems that a fresh mount fixes.
|
|
44
|
+
*/
|
|
45
|
+
declare class ChatErrorBoundary extends React.Component<ChatErrorBoundaryProps, ChatErrorBoundaryState> {
|
|
46
|
+
state: ChatErrorBoundaryState;
|
|
47
|
+
static getDerivedStateFromError(error: Error): Partial<ChatErrorBoundaryState>;
|
|
48
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
49
|
+
reset: () => void;
|
|
50
|
+
private renderFallback;
|
|
51
|
+
render(): React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
export default ChatErrorBoundary;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Stable test ids for the default crash screen. */
|
|
3
|
+
export declare const ChatErrorScreenTestIds: {
|
|
4
|
+
readonly screen: "chat_error_screen";
|
|
5
|
+
readonly retryButton: "chat_error_retry_button";
|
|
6
|
+
};
|
|
7
|
+
interface ChatErrorScreenProps {
|
|
8
|
+
/** Re-mounts the crashed subtree. */
|
|
9
|
+
onRetry: () => void;
|
|
10
|
+
style?: React.CSSProperties;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Default fallback rendered by <ChatErrorBoundary> when the chat tree throws.
|
|
14
|
+
*
|
|
15
|
+
* Deliberately calm and small: no stack traces, no red alarm state - an end
|
|
16
|
+
* user of the host application sees this, not a developer. Every caption goes
|
|
17
|
+
* through useT() so it follows the same locale as the rest of the chat, and
|
|
18
|
+
* the accent colour comes from the host's own `config.colors` (via
|
|
19
|
+
* resolveIconColor) plus the `--ethora-font-*` variables the typography
|
|
20
|
+
* config publishes, so it never looks like a foreign screen dropped into a
|
|
21
|
+
* themed app.
|
|
22
|
+
*/
|
|
23
|
+
declare const ChatErrorScreen: React.FC<ChatErrorScreenProps>;
|
|
24
|
+
export default ChatErrorScreen;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface HeaderLogoProps {
|
|
3
|
+
/**
|
|
4
|
+
* A plain string is treated as an image URL and rendered as an `<img>`;
|
|
5
|
+
* any other node is rendered as-is. Same string-or-node duality as
|
|
6
|
+
* `config.fallbackScreens` (see FallbackScreen).
|
|
7
|
+
*/
|
|
8
|
+
logo: string | React.ReactElement;
|
|
9
|
+
/** Rendered height in pixels. Default 32. */
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const HEADER_LOGO_TEST_ID = "ethora-header-logo";
|
|
13
|
+
/**
|
|
14
|
+
* Host-provided logo shown at the left of the chat header, for white-label
|
|
15
|
+
* embedding. See IConfig.headerLogo.
|
|
16
|
+
*/
|
|
17
|
+
declare const HeaderLogo: React.FC<HeaderLogoProps>;
|
|
18
|
+
export default HeaderLogo;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { IMessage } from '../../types/types';
|
|
3
3
|
interface MediaMessageProps {
|
|
4
|
+
/**
|
|
5
|
+
* Legacy props. They describe attachment #0 only and are kept because
|
|
6
|
+
* hosts pass them when overriding the message renderer; `message` is the
|
|
7
|
+
* source of truth whenever it is present.
|
|
8
|
+
*/
|
|
4
9
|
mimeType?: string;
|
|
5
10
|
message?: IMessage;
|
|
6
11
|
location?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
import { IConfig, IMessage } from '../../types/types';
|
|
3
3
|
interface MessageContainerProps {
|
|
4
4
|
CustomMessage?: React.ComponentType<{
|
|
@@ -15,5 +15,5 @@ interface MessageContainerProps {
|
|
|
15
15
|
showDateLabel: boolean;
|
|
16
16
|
className?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare const MessageContainer:
|
|
18
|
+
export declare const MessageContainer: React.NamedExoticComponent<MessageContainerProps>;
|
|
19
19
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ConfigUser, IConfig } from '../../types/types';
|
|
3
3
|
import { CustomComponentsContextValue } from '../../types/models/customComponents.model';
|
|
4
|
-
interface ChatWrapperProps extends Pick<CustomComponentsContextValue, 'CustomMessageComponent' | 'CustomInputComponent' | 'CustomScrollableArea' | 'CustomDaySeparator' | 'CustomNewMessageLabel'> {
|
|
4
|
+
export interface ChatWrapperProps extends Pick<CustomComponentsContextValue, 'CustomMessageComponent' | 'CustomInputComponent' | 'CustomScrollableArea' | 'CustomDaySeparator' | 'CustomNewMessageLabel'> {
|
|
5
5
|
token?: string;
|
|
6
6
|
roomJID?: string;
|
|
7
7
|
user?: ConfigUser;
|
|
@@ -13,4 +13,3 @@ interface ChatWrapperProps extends Pick<CustomComponentsContextValue, 'CustomMes
|
|
|
13
13
|
config?: IConfig;
|
|
14
14
|
}
|
|
15
15
|
export declare const ReduxWrapper: React.FC<ChatWrapperProps>;
|
|
16
|
-
export {};
|
|
@@ -7,8 +7,7 @@ interface SystemMessageProps {
|
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
export declare const CustomSystemMessageText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
10
|
-
primary?: string;
|
|
11
|
-
secondary?: string;
|
|
10
|
+
$primary?: string;
|
|
12
11
|
}>> & string;
|
|
13
12
|
declare const SystemMessage: React.FC<SystemMessageProps>;
|
|
14
13
|
export default SystemMessage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CustomDivider: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Substitute<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
2
|
-
configColor: string;
|
|
3
|
-
configColorUser: string;
|
|
4
|
-
isUser: boolean;
|
|
2
|
+
$configColor: string;
|
|
3
|
+
$configColorUser: string;
|
|
4
|
+
$isUser: boolean;
|
|
5
5
|
}>> & string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { MessageProps } from '../../types/types';
|
|
3
|
-
declare const
|
|
4
|
-
export { Message };
|
|
3
|
+
declare const MemoizedMessage: React.NamedExoticComponent<MessageProps>;
|
|
4
|
+
export { MemoizedMessage as Message };
|
|
@@ -7,19 +7,37 @@ interface MessageTranslateProps {
|
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Manual-mode message translation (LinkedIn-style). Renders a "Translate"
|
|
10
|
-
* link under an incoming message; on click it
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* link under an incoming message; on click it resolves a translation in
|
|
11
|
+
* this order:
|
|
12
|
+
*
|
|
13
|
+
* 1. `config.translates.onTranslate` (host-provided) - wins whenever set;
|
|
14
|
+
* 2. whatever translation already arrived attached to the stanza
|
|
15
|
+
* (`message.translations`), read through the SAME shared resolver
|
|
16
|
+
* `resolveMessageTranslation` that auto mode uses - free, no request,
|
|
17
|
+
* and guaranteed to show exactly what auto mode would have rendered
|
|
18
|
+
* automatically for this message;
|
|
19
|
+
* 3. a fetch from the translate service, ONLY when the host has explicitly
|
|
20
|
+
* set `config.translates.endpoint` - the built-in HTTP call is opt-in,
|
|
21
|
+
* never a default. The result is cached onto the message in the store
|
|
22
|
+
* (setMessageTranslation) so a second click - and 'auto' mode, if the
|
|
23
|
+
* reader switches to it - see it for free, even after this bubble
|
|
24
|
+
* unmounts and remounts (long rooms remount bubbles on scroll).
|
|
25
|
+
*
|
|
26
|
+
* A message with nothing attached, no host `onTranslate`, and no explicit
|
|
27
|
+
* `endpoint` simply has nothing to reveal - and in that case the link itself
|
|
28
|
+
* does not render at all (see `shouldShow` below), rather than offering a
|
|
29
|
+
* click that can only ever end in `translation.failed`. That retry link is
|
|
30
|
+
* reserved for a genuine attempt that came back empty or threw (host
|
|
31
|
+
* `onTranslate`, or an explicitly configured `endpoint`).
|
|
17
32
|
*
|
|
18
33
|
* Visibility: `config.translates.showTranslateForMessage(message)` if the host
|
|
19
34
|
* supplies it (they keep the locale logic and just tell us yes/no); otherwise
|
|
20
|
-
*
|
|
21
|
-
* (
|
|
22
|
-
*
|
|
35
|
+
* the link shows only when the message actually needs translating for this
|
|
36
|
+
* reader (same gate as auto mode: known source language, base-language
|
|
37
|
+
* mismatch, actual translatable text) AND there is something that could
|
|
38
|
+
* reveal a translation - an attached one, a host `onTranslate`, or an
|
|
39
|
+
* explicit `endpoint`. The reader's FULL locale (fr-CA vs fr-FR) is still
|
|
40
|
+
* forwarded to `onTranslate` as `targetLocale`.
|
|
23
41
|
*/
|
|
24
42
|
declare const MessageTranslate: FC<MessageTranslateProps>;
|
|
25
43
|
export default MessageTranslate;
|
|
@@ -4,15 +4,16 @@ interface QuickRepliesProps {
|
|
|
4
4
|
replies: QuickReply[];
|
|
5
5
|
messageId: string;
|
|
6
6
|
accentColor?: string;
|
|
7
|
-
/** Already answered
|
|
7
|
+
/** Already answered - the chips are gone for good. */
|
|
8
8
|
answered?: boolean;
|
|
9
9
|
onSelect: (reply: QuickReply, questionId: string) => void;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Buttons offered by a bot message. Tapping one answers the message
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* Buttons offered by a bot message. Tapping one answers the message and the
|
|
13
|
+
* whole row disappears: the answer is already in the transcript as the
|
|
14
|
+
* user's own message, so leaving spent options on screen only invites a
|
|
15
|
+
* second tap on a question that is closed. Removing them is also what makes
|
|
16
|
+
* a double tap impossible rather than merely refused.
|
|
16
17
|
*/
|
|
17
18
|
declare const QuickReplies: React.FC<QuickRepliesProps>;
|
|
18
19
|
export default QuickReplies;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RoomMember } from '../../../types/types';
|
|
3
|
+
interface ChatProfileMemberRowProps {
|
|
4
|
+
member: RoomMember;
|
|
5
|
+
isLast: boolean;
|
|
6
|
+
disableClick: boolean;
|
|
7
|
+
online: boolean;
|
|
8
|
+
showMenu: boolean;
|
|
9
|
+
menuOptions: {
|
|
10
|
+
label: string;
|
|
11
|
+
icon: any;
|
|
12
|
+
onClick: (e?: any) => void;
|
|
13
|
+
}[];
|
|
14
|
+
moreOptionsLabel: string;
|
|
15
|
+
onAvatarClick: (user: RoomMember) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: React.NamedExoticComponent<ChatProfileMemberRowProps>;
|
|
18
|
+
export default _default;
|
|
@@ -2,5 +2,22 @@ import { default as React } from 'react';
|
|
|
2
2
|
interface FilePreviewModalProps {
|
|
3
3
|
handleCloseModal: any;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Full-screen media viewer.
|
|
7
|
+
*
|
|
8
|
+
* Images get a real lightbox: previous/next across every image loaded for
|
|
9
|
+
* the room (see helpers/roomImageGallery for exactly what that set is),
|
|
10
|
+
* wheel/pinch zoom with bounded panning, double-click/double-tap to toggle
|
|
11
|
+
* fit, arrow-key and swipe navigation. Video, PDF and unsupported files take
|
|
12
|
+
* the same paths they always did and get no navigation chrome, so opening a
|
|
13
|
+
* PDF is the experience it was before.
|
|
14
|
+
*
|
|
15
|
+
* Escape, initial focus and focus restore are NOT handled here: the modal
|
|
16
|
+
* layer (Modals/Modal/Modal.tsx) already runs `useModalDismiss` around every
|
|
17
|
+
* entry in MODAL_COMPONENTS, this one included. Adding a second Escape
|
|
18
|
+
* listener would double-handle the key and fight that hook's focus restore,
|
|
19
|
+
* so the only key listener below is for the arrows, and it explicitly leaves
|
|
20
|
+
* every other key (Escape included) alone.
|
|
21
|
+
*/
|
|
5
22
|
declare const FilePreviewModal: React.FC<FilePreviewModalProps>;
|
|
6
23
|
export default FilePreviewModal;
|