@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,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
2
|
-
import { useState as m, useCallback as
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
5
|
-
t(
|
|
1
|
+
import { jsxs as o, Fragment as M, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useCallback as T } from "react";
|
|
3
|
+
import { aJ as I, E as t, aK as j, aL as w, B, u as E, x as z, Q as F, aM as R, S as U, D as x, aN as O, aO as $, aP as A, aQ as P } from "./main-CUB_w8AZ.js";
|
|
4
|
+
import { S as Q, D as f, a as u, b as D, e as v, f as b } from "./SideDrawer-CQPOf0ek.js";
|
|
5
|
+
t(j)`
|
|
6
6
|
display: flex;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
align-items: flex-start;
|
|
@@ -36,7 +36,7 @@ t(w)`
|
|
|
36
36
|
text-align: start;
|
|
37
37
|
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
38
38
|
`;
|
|
39
|
-
const y = t(
|
|
39
|
+
const y = t(B)`
|
|
40
40
|
min-height: 44px;
|
|
41
41
|
display: flex;
|
|
42
42
|
flex-direction: column;
|
|
@@ -65,29 +65,29 @@ const y = t(j)`
|
|
|
65
65
|
box-shadow: var(--ethora-shadow-sm, 0 1px 2px rgba(16, 24, 40, 0.06));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
${
|
|
69
|
-
`,
|
|
68
|
+
${I}
|
|
69
|
+
`, H = t.div`
|
|
70
70
|
display: flex;
|
|
71
71
|
align-items: flex-start;
|
|
72
72
|
background-color: ${({ bgColor: r }) => r};
|
|
73
73
|
padding: var(--ethora-space-4, 16px);
|
|
74
74
|
border-radius: var(--ethora-radius-md, 12px);
|
|
75
75
|
gap: var(--ethora-space-2, 8px);
|
|
76
|
-
`,
|
|
76
|
+
`, J = t.div`
|
|
77
77
|
font-size: var(--ethora-font-size-xs, 12px);
|
|
78
78
|
line-height: var(--ethora-line-height-normal, 1.5);
|
|
79
79
|
color: var(--ethora-color-text, #141414);
|
|
80
80
|
display: flex;
|
|
81
81
|
text-align: start;
|
|
82
|
-
`,
|
|
82
|
+
`, G = ({
|
|
83
83
|
handleCloseModal: r
|
|
84
84
|
}) => {
|
|
85
|
-
const { config: l } =
|
|
86
|
-
const p = (await
|
|
85
|
+
const { config: l } = E((s) => s.chatSettingStore), e = z(), { showToast: d } = F(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
|
|
86
|
+
const p = (await P()).data;
|
|
87
87
|
x.log(p);
|
|
88
88
|
const L = new Blob([p], { type: "text/plain" }), h = URL.createObjectURL(L), n = document.createElement("a");
|
|
89
89
|
n.href = h, n.download = "mydata.json", document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(h);
|
|
90
|
-
}, k =
|
|
90
|
+
}, k = T(async () => {
|
|
91
91
|
if (!i) {
|
|
92
92
|
g(!0);
|
|
93
93
|
try {
|
|
@@ -103,9 +103,9 @@ const y = t(j)`
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}, [i, d, e]);
|
|
106
|
-
return /* @__PURE__ */ o(
|
|
106
|
+
return /* @__PURE__ */ o(M, { children: [
|
|
107
107
|
/* @__PURE__ */ o(
|
|
108
|
-
|
|
108
|
+
Q,
|
|
109
109
|
{
|
|
110
110
|
title: e("settings.manageData.title"),
|
|
111
111
|
onClose: r,
|
|
@@ -131,13 +131,13 @@ const y = t(j)`
|
|
|
131
131
|
/* @__PURE__ */ a(D, { children: /* @__PURE__ */ o(v, { children: [
|
|
132
132
|
/* @__PURE__ */ a(b, { children: e("settings.manageData.deleteDescription") }),
|
|
133
133
|
/* @__PURE__ */ o(
|
|
134
|
-
|
|
134
|
+
H,
|
|
135
135
|
{
|
|
136
136
|
bgColor: l?.colors?.secondary || "var(--ethora-color-primary-soft, #E7EDF9)",
|
|
137
137
|
style: { marginTop: "var(--ethora-space-2, 8px)" },
|
|
138
138
|
children: [
|
|
139
|
-
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
140
|
-
/* @__PURE__ */ a(
|
|
139
|
+
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(O, { color: $(l) }) }),
|
|
140
|
+
/* @__PURE__ */ a(J, { children: e("settings.manageData.deleteDisclosure") })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
),
|
|
@@ -159,7 +159,7 @@ const y = t(j)`
|
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
C && /* @__PURE__ */ a(
|
|
162
|
-
|
|
162
|
+
A,
|
|
163
163
|
{
|
|
164
164
|
title: e("settings.manageData.deleteConfirmTitle"),
|
|
165
165
|
description: e("settings.manageData.deleteConfirmDescription"),
|
|
@@ -174,5 +174,5 @@ const y = t(j)`
|
|
|
174
174
|
] });
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
|
-
|
|
177
|
+
G as default
|
|
178
178
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as fs, jsx as ie, Fragment as hs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import {
|
|
3
|
+
import { w as ei } from "./main-CUB_w8AZ.js";
|
|
4
4
|
function zr(e) {
|
|
5
5
|
const t = [], n = String(e || "");
|
|
6
6
|
let r = n.indexOf(","), u = 0, i = !1;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { useRef as J, useState as h, useMemo as I, useEffect as
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
5
|
-
function
|
|
1
|
+
import { jsx as a, jsxs as i, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as J, useState as h, useMemo as I, useEffect as V } from "react";
|
|
3
|
+
import { x as Y, a as W, aT as X, u as z, at as K, as as Z, au as ee, aU as re, aV as te, aB as ae, aW as oe, aX as se, aY as ne, E as c, y as ie } from "./main-CUB_w8AZ.js";
|
|
4
|
+
import { S as ce, i as le, j as de, f as S } from "./SideDrawer-CQPOf0ek.js";
|
|
5
|
+
function he(t) {
|
|
6
6
|
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
|
|
7
7
|
if (!e) return;
|
|
8
|
-
const
|
|
8
|
+
const l = new Date(
|
|
9
9
|
Number(e[1]),
|
|
10
10
|
Number(e[2]) - 1,
|
|
11
11
|
Number(e[3]),
|
|
@@ -14,12 +14,12 @@ function oe(t) {
|
|
|
14
14
|
0,
|
|
15
15
|
0
|
|
16
16
|
);
|
|
17
|
-
return Number.isNaN(
|
|
17
|
+
return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function ue(t) {
|
|
20
20
|
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
|
|
21
21
|
if (!e) return;
|
|
22
|
-
const
|
|
22
|
+
const l = new Date(
|
|
23
23
|
Number(e[1]),
|
|
24
24
|
Number(e[2]) - 1,
|
|
25
25
|
Number(e[3]),
|
|
@@ -28,31 +28,31 @@ function se(t) {
|
|
|
28
28
|
59,
|
|
29
29
|
999
|
|
30
30
|
);
|
|
31
|
-
return Number.isNaN(
|
|
31
|
+
return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
33
|
+
const pe = (t, e) => !!(t && e && t > e), me = (t) => `${t.firstName || ""} ${t.lastName || ""}`.trim() || t.name || "";
|
|
34
|
+
function fe(t, e, l = 8) {
|
|
35
|
+
const k = e.trim().toLowerCase();
|
|
36
|
+
if (!k) return [];
|
|
37
|
+
const u = [], p = [], n = /* @__PURE__ */ new Set();
|
|
38
38
|
for (const x of t) {
|
|
39
|
-
const d = x._id, b =
|
|
40
|
-
if (!d || !b ||
|
|
41
|
-
const s = b.toLowerCase().indexOf(
|
|
42
|
-
if (s !== -1 && (
|
|
39
|
+
const d = x._id, b = me(x);
|
|
40
|
+
if (!d || !b || n.has(d)) continue;
|
|
41
|
+
const s = b.toLowerCase().indexOf(k);
|
|
42
|
+
if (s !== -1 && (n.add(d), (s === 0 ? u : p).push({ id: d, name: b }), u.length >= l))
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
return [...
|
|
45
|
+
return [...u, ...p].slice(0, l);
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const ge = c.div`
|
|
48
48
|
display: flex;
|
|
49
49
|
flex-direction: column;
|
|
50
50
|
gap: var(--ethora-space-3, 12px);
|
|
51
51
|
min-height: 0;
|
|
52
|
-
`,
|
|
52
|
+
`, xe = c.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
gap: var(--ethora-space-2, 8px);
|
|
55
|
-
`,
|
|
55
|
+
`, E = c.button`
|
|
56
56
|
flex: 1 1 0;
|
|
57
57
|
height: 32px;
|
|
58
58
|
border: 1px solid
|
|
@@ -65,7 +65,7 @@ const le = i.div`
|
|
|
65
65
|
font-weight: var(--ethora-font-weight-medium, 500);
|
|
66
66
|
cursor: pointer;
|
|
67
67
|
transition: background-color var(--ethora-motion-fast, 150ms);
|
|
68
|
-
`,
|
|
68
|
+
`, be = c.button`
|
|
69
69
|
align-self: flex-start;
|
|
70
70
|
display: inline-flex;
|
|
71
71
|
align-items: center;
|
|
@@ -87,14 +87,14 @@ const le = i.div`
|
|
|
87
87
|
font-size: var(--ethora-font-size-xs, 12px);
|
|
88
88
|
text-align: center;
|
|
89
89
|
}
|
|
90
|
-
`,
|
|
90
|
+
`, ve = c.div`
|
|
91
91
|
display: flex;
|
|
92
92
|
flex-direction: column;
|
|
93
93
|
gap: var(--ethora-space-2, 8px);
|
|
94
94
|
padding: var(--ethora-space-3, 12px);
|
|
95
95
|
border: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
96
96
|
border-radius: var(--ethora-radius-md, 12px);
|
|
97
|
-
`, $ =
|
|
97
|
+
`, $ = c.label`
|
|
98
98
|
display: flex;
|
|
99
99
|
flex-direction: column;
|
|
100
100
|
gap: 4px;
|
|
@@ -112,11 +112,11 @@ const le = i.div`
|
|
|
112
112
|
font: inherit;
|
|
113
113
|
font-size: var(--ethora-font-size-sm, 14px);
|
|
114
114
|
}
|
|
115
|
-
`,
|
|
115
|
+
`, ye = c.div`
|
|
116
116
|
display: grid;
|
|
117
117
|
grid-template-columns: 1fr 1fr;
|
|
118
118
|
gap: var(--ethora-space-2, 8px);
|
|
119
|
-
`,
|
|
119
|
+
`, Se = c.ul`
|
|
120
120
|
list-style: none;
|
|
121
121
|
margin: 0;
|
|
122
122
|
padding: 4px;
|
|
@@ -140,7 +140,7 @@ const le = i.div`
|
|
|
140
140
|
button:focus-visible {
|
|
141
141
|
background: var(--ethora-color-bg-hover, #f0f2f5);
|
|
142
142
|
}
|
|
143
|
-
`,
|
|
143
|
+
`, ke = c.span`
|
|
144
144
|
display: inline-flex;
|
|
145
145
|
align-items: center;
|
|
146
146
|
gap: 6px;
|
|
@@ -159,7 +159,7 @@ const le = i.div`
|
|
|
159
159
|
cursor: pointer;
|
|
160
160
|
padding: 0 6px;
|
|
161
161
|
}
|
|
162
|
-
`,
|
|
162
|
+
`, Ce = c.button`
|
|
163
163
|
align-self: flex-start;
|
|
164
164
|
border: none;
|
|
165
165
|
background: transparent;
|
|
@@ -169,76 +169,68 @@ const le = i.div`
|
|
|
169
169
|
text-decoration: underline;
|
|
170
170
|
cursor: pointer;
|
|
171
171
|
padding: 0;
|
|
172
|
-
`,
|
|
172
|
+
`, we = c.div`
|
|
173
173
|
font-size: var(--ethora-font-size-xs, 12px);
|
|
174
174
|
color: var(--ethora-color-text-muted, #6c6c6c);
|
|
175
|
-
`,
|
|
176
|
-
align-self: center;
|
|
177
|
-
margin-top: var(--ethora-space-2, 8px);
|
|
178
|
-
padding: 6px 14px;
|
|
179
|
-
border: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
180
|
-
border-radius: var(--ethora-radius-full, 999px);
|
|
181
|
-
background: transparent;
|
|
182
|
-
color: var(--ethora-color-text-secondary, #5a5f66);
|
|
183
|
-
font: inherit;
|
|
184
|
-
font-size: var(--ethora-font-size-sm, 14px);
|
|
185
|
-
cursor: pointer;
|
|
186
|
-
|
|
187
|
-
&:disabled {
|
|
188
|
-
opacity: 0.6;
|
|
189
|
-
cursor: default;
|
|
190
|
-
}
|
|
191
|
-
`, Ce = ({
|
|
175
|
+
`, Re = ({
|
|
192
176
|
handleCloseModal: t
|
|
193
177
|
}) => {
|
|
194
|
-
const e =
|
|
178
|
+
const e = Y(), l = W(), k = X(767), u = J(null), p = z((r) => r.rooms.rooms), n = z(
|
|
195
179
|
(r) => r.rooms.activeRoomJID
|
|
196
180
|
), x = z((r) => r.rooms.usersSet);
|
|
197
181
|
z(
|
|
198
182
|
(r) => r.chatSettingStore.user?.xmppUsername
|
|
199
183
|
);
|
|
200
184
|
const [d, b] = h(""), [s, O] = h(
|
|
201
|
-
|
|
202
|
-
),
|
|
185
|
+
n ? "chat" : "all"
|
|
186
|
+
), F = n ? n.split("@")[0] : void 0, [C, H] = h(!1), [m, T] = h(""), [f, B] = h(""), [g, M] = h(
|
|
203
187
|
null
|
|
204
|
-
), [
|
|
188
|
+
), [v, N] = h(""), y = pe(m, f), j = I(
|
|
205
189
|
() => ({
|
|
206
|
-
fromUserId:
|
|
207
|
-
since:
|
|
208
|
-
until:
|
|
190
|
+
fromUserId: g?.id,
|
|
191
|
+
since: y ? void 0 : he(m),
|
|
192
|
+
until: y ? void 0 : ue(f)
|
|
209
193
|
}),
|
|
210
|
-
[
|
|
211
|
-
),
|
|
212
|
-
M(null), N(""),
|
|
213
|
-
},
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
194
|
+
[g?.id, m, f, y]
|
|
195
|
+
), w = (g ? 1 : 0) + (m ? 1 : 0) + (f ? 1 : 0), Q = () => {
|
|
196
|
+
M(null), N(""), T(""), B("");
|
|
197
|
+
}, P = n ? p[n] : void 0, { members: D } = K(
|
|
198
|
+
n || void 0,
|
|
199
|
+
s === "chat" && Z(P) && (C || v.trim() !== "")
|
|
200
|
+
), L = I(() => {
|
|
201
|
+
if (!v.trim()) return [];
|
|
202
|
+
let r;
|
|
203
|
+
if (s === "chat") {
|
|
204
|
+
const A = n && p[n]?.members || [];
|
|
205
|
+
D.length > 0 ? r = ee([...A, ...D]) : r = A;
|
|
206
|
+
} else
|
|
207
|
+
r = Object.values(x || {});
|
|
208
|
+
return fe(r, v);
|
|
209
|
+
}, [v, s, p, n, x, D]), o = re(
|
|
210
|
+
y ? "" : d,
|
|
219
211
|
s,
|
|
220
|
-
|
|
221
|
-
|
|
212
|
+
F,
|
|
213
|
+
j
|
|
222
214
|
);
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
V(() => {
|
|
216
|
+
u.current?.focus();
|
|
225
217
|
}, []);
|
|
226
|
-
const { open:
|
|
227
|
-
|
|
228
|
-
},
|
|
218
|
+
const { open: _ } = te(), q = (r) => {
|
|
219
|
+
_(r) && k && l(ie(void 0));
|
|
220
|
+
}, R = I(() => o.items, [o.items]), U = d.trim();
|
|
229
221
|
return /* @__PURE__ */ a(
|
|
230
|
-
|
|
222
|
+
ce,
|
|
231
223
|
{
|
|
232
224
|
title: e("search.messages.title"),
|
|
233
225
|
onClose: t,
|
|
234
226
|
backLabel: e("action.close"),
|
|
235
|
-
children: /* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */ a(
|
|
227
|
+
children: /* @__PURE__ */ i(ge, { children: [
|
|
228
|
+
/* @__PURE__ */ i(le, { children: [
|
|
229
|
+
/* @__PURE__ */ a(ae, {}),
|
|
238
230
|
/* @__PURE__ */ a(
|
|
239
|
-
|
|
231
|
+
de,
|
|
240
232
|
{
|
|
241
|
-
ref:
|
|
233
|
+
ref: u,
|
|
242
234
|
"data-autofocus": !0,
|
|
243
235
|
type: "search",
|
|
244
236
|
value: d,
|
|
@@ -250,20 +242,20 @@ const le = i.div`
|
|
|
250
242
|
}
|
|
251
243
|
)
|
|
252
244
|
] }),
|
|
253
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ i(xe, { role: "group", "aria-label": e("search.messages.scope"), children: [
|
|
254
246
|
/* @__PURE__ */ a(
|
|
255
|
-
|
|
247
|
+
E,
|
|
256
248
|
{
|
|
257
249
|
type: "button",
|
|
258
250
|
$active: s === "chat",
|
|
259
251
|
"aria-pressed": s === "chat",
|
|
260
|
-
disabled: !
|
|
252
|
+
disabled: !F,
|
|
261
253
|
onClick: () => O("chat"),
|
|
262
254
|
children: e("search.messages.scopeChat")
|
|
263
255
|
}
|
|
264
256
|
),
|
|
265
257
|
/* @__PURE__ */ a(
|
|
266
|
-
|
|
258
|
+
E,
|
|
267
259
|
{
|
|
268
260
|
type: "button",
|
|
269
261
|
$active: s === "all",
|
|
@@ -273,24 +265,24 @@ const le = i.div`
|
|
|
273
265
|
}
|
|
274
266
|
)
|
|
275
267
|
] }),
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
|
|
268
|
+
/* @__PURE__ */ i(
|
|
269
|
+
be,
|
|
278
270
|
{
|
|
279
271
|
type: "button",
|
|
280
|
-
$active:
|
|
281
|
-
"aria-expanded":
|
|
282
|
-
onClick: () =>
|
|
272
|
+
$active: C || w > 0,
|
|
273
|
+
"aria-expanded": C,
|
|
274
|
+
onClick: () => H((r) => !r),
|
|
283
275
|
children: [
|
|
284
276
|
e("search.messages.filters"),
|
|
285
|
-
|
|
277
|
+
w > 0 && /* @__PURE__ */ a("span", { children: w })
|
|
286
278
|
]
|
|
287
279
|
}
|
|
288
280
|
),
|
|
289
|
-
|
|
290
|
-
/* @__PURE__ */
|
|
281
|
+
C && /* @__PURE__ */ i(ve, { children: [
|
|
282
|
+
/* @__PURE__ */ i($, { children: [
|
|
291
283
|
e("search.messages.filterSender"),
|
|
292
|
-
|
|
293
|
-
|
|
284
|
+
g ? /* @__PURE__ */ i(ke, { children: [
|
|
285
|
+
g.name,
|
|
294
286
|
/* @__PURE__ */ a(
|
|
295
287
|
"button",
|
|
296
288
|
{
|
|
@@ -304,13 +296,13 @@ const le = i.div`
|
|
|
304
296
|
"input",
|
|
305
297
|
{
|
|
306
298
|
type: "search",
|
|
307
|
-
value:
|
|
299
|
+
value: v,
|
|
308
300
|
onChange: (r) => N(r.target.value),
|
|
309
301
|
placeholder: e("search.messages.filterSenderPlaceholder")
|
|
310
302
|
}
|
|
311
303
|
)
|
|
312
304
|
] }),
|
|
313
|
-
!
|
|
305
|
+
!g && L.length > 0 && /* @__PURE__ */ a(Se, { role: "listbox", children: L.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
314
306
|
"button",
|
|
315
307
|
{
|
|
316
308
|
type: "button",
|
|
@@ -322,56 +314,56 @@ const le = i.div`
|
|
|
322
314
|
children: r.name
|
|
323
315
|
}
|
|
324
316
|
) }, r.id)) }),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ i(ye, { children: [
|
|
318
|
+
/* @__PURE__ */ i($, { children: [
|
|
327
319
|
e("search.messages.filterSince"),
|
|
328
320
|
/* @__PURE__ */ a(
|
|
329
321
|
"input",
|
|
330
322
|
{
|
|
331
323
|
type: "date",
|
|
332
|
-
value:
|
|
324
|
+
value: m,
|
|
333
325
|
max: f || void 0,
|
|
334
|
-
onChange: (r) =>
|
|
326
|
+
onChange: (r) => T(r.target.value)
|
|
335
327
|
}
|
|
336
328
|
)
|
|
337
329
|
] }),
|
|
338
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ i($, { children: [
|
|
339
331
|
e("search.messages.filterUntil"),
|
|
340
332
|
/* @__PURE__ */ a(
|
|
341
333
|
"input",
|
|
342
334
|
{
|
|
343
335
|
type: "date",
|
|
344
336
|
value: f,
|
|
345
|
-
min:
|
|
346
|
-
onChange: (r) =>
|
|
337
|
+
min: m || void 0,
|
|
338
|
+
onChange: (r) => B(r.target.value)
|
|
347
339
|
}
|
|
348
340
|
)
|
|
349
341
|
] })
|
|
350
342
|
] }),
|
|
351
|
-
|
|
352
|
-
|
|
343
|
+
y && /* @__PURE__ */ a(S, { role: "alert", children: e("search.messages.dateOrder") }),
|
|
344
|
+
w > 0 && /* @__PURE__ */ a(Ce, { type: "button", onClick: Q, children: e("search.messages.filterClearAll") })
|
|
353
345
|
] }),
|
|
354
|
-
!o.searchable && /* @__PURE__ */ a(
|
|
355
|
-
o.searchable && o.status === "loading" && /* @__PURE__ */ a(
|
|
356
|
-
o.status === "error" && /* @__PURE__ */
|
|
346
|
+
!o.searchable && /* @__PURE__ */ a(S, { children: U ? e("search.messages.tooShort", { count: oe }) : e("search.messages.hint") }),
|
|
347
|
+
o.searchable && o.status === "loading" && /* @__PURE__ */ a(S, { role: "status", children: e("search.messages.searching") }),
|
|
348
|
+
o.status === "error" && /* @__PURE__ */ i(S, { role: "alert", children: [
|
|
357
349
|
e("search.messages.error"),
|
|
358
350
|
" ",
|
|
359
351
|
/* @__PURE__ */ a("button", { type: "button", onClick: o.retry, children: e("search.messages.retry") })
|
|
360
352
|
] }),
|
|
361
|
-
o.searchable && o.status === "done" &&
|
|
362
|
-
|
|
363
|
-
/* @__PURE__ */ a(
|
|
353
|
+
o.searchable && o.status === "done" && R.length === 0 && /* @__PURE__ */ a(S, { children: e("search.messages.empty") }),
|
|
354
|
+
R.length > 0 && /* @__PURE__ */ i(G, { children: [
|
|
355
|
+
/* @__PURE__ */ a(we, { role: "status", children: e("search.messages.count", { count: o.total }) }),
|
|
364
356
|
/* @__PURE__ */ a(
|
|
365
|
-
|
|
357
|
+
se,
|
|
366
358
|
{
|
|
367
|
-
hits:
|
|
368
|
-
query:
|
|
359
|
+
hits: R,
|
|
360
|
+
query: U,
|
|
369
361
|
showRoom: s === "all",
|
|
370
|
-
onOpen:
|
|
362
|
+
onOpen: q
|
|
371
363
|
}
|
|
372
364
|
),
|
|
373
365
|
o.hasMore && /* @__PURE__ */ a(
|
|
374
|
-
|
|
366
|
+
ne,
|
|
375
367
|
{
|
|
376
368
|
type: "button",
|
|
377
369
|
onClick: o.loadMore,
|
|
@@ -385,5 +377,5 @@ const le = i.div`
|
|
|
385
377
|
);
|
|
386
378
|
};
|
|
387
379
|
export {
|
|
388
|
-
|
|
380
|
+
Re as default
|
|
389
381
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { useState as p, useRef as
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
2
|
+
import { useState as p, useRef as T, useCallback as E, useEffect as N, useMemo as z } from "react";
|
|
3
|
+
import { l as P, aZ as U, x as _, a as F, aT as H, u as A, aB as J, E as c, a7 as Z, y as q } from "./main-CUB_w8AZ.js";
|
|
4
|
+
import { S as G, i as V, j as K, f as S } from "./SideDrawer-CQPOf0ek.js";
|
|
5
5
|
const I = 50;
|
|
6
6
|
async function Q({
|
|
7
7
|
offset: r = 0,
|
|
8
8
|
limit: t = I,
|
|
9
9
|
signal: u
|
|
10
10
|
} = {}) {
|
|
11
|
-
const x =
|
|
11
|
+
const x = P.getState().chatSettingStore.user?.token || "", s = (await U.get("/v1/chats/public", {
|
|
12
12
|
params: { limit: Math.min(t, I), offset: r },
|
|
13
13
|
headers: { Authorization: x },
|
|
14
14
|
signal: u
|
|
@@ -103,9 +103,9 @@ const W = c.ul`
|
|
|
103
103
|
`, oe = (r) => (r.title || r.name).trim().charAt(0).toUpperCase() || "#", le = ({
|
|
104
104
|
handleCloseModal: r
|
|
105
105
|
}) => {
|
|
106
|
-
const t = _(), u =
|
|
106
|
+
const t = _(), u = F(), x = H(767), b = A((e) => e.rooms.rooms), s = A(
|
|
107
107
|
(e) => e.chatSettingStore.config?.xmppSettings?.conference
|
|
108
|
-
), [l, i] = p([]), [j, $] = p(0), [v, D] = p(0), [n, w] = p("loading"), [h, L] = p(""), m =
|
|
108
|
+
), [l, i] = p([]), [j, $] = p(0), [v, D] = p(0), [n, w] = p("loading"), [h, L] = p(""), m = T(0), f = E(async (e) => {
|
|
109
109
|
const o = ++m.current;
|
|
110
110
|
w(e ? "loadingMore" : "loading");
|
|
111
111
|
try {
|
|
@@ -119,7 +119,7 @@ const W = c.ul`
|
|
|
119
119
|
o === m.current && w("error");
|
|
120
120
|
}
|
|
121
121
|
}, []);
|
|
122
|
-
|
|
122
|
+
N(() => (f(0), () => {
|
|
123
123
|
m.current += 1;
|
|
124
124
|
}), [f]);
|
|
125
125
|
const O = z(
|
|
@@ -130,19 +130,19 @@ const W = c.ul`
|
|
|
130
130
|
return e ? l.filter(
|
|
131
131
|
(o) => o.title.toLowerCase().includes(e) || o.description.toLowerCase().includes(e)
|
|
132
132
|
) : l;
|
|
133
|
-
}, [l, h]),
|
|
133
|
+
}, [l, h]), B = (e) => {
|
|
134
134
|
const o = (s || "").trim();
|
|
135
|
-
o && (u(
|
|
135
|
+
o && (u(Z({ roomJID: `${e.name}@${o}` })), x && u(q(void 0)));
|
|
136
136
|
}, M = v < j;
|
|
137
137
|
return /* @__PURE__ */ d(
|
|
138
|
-
|
|
138
|
+
G,
|
|
139
139
|
{
|
|
140
140
|
title: t("publicChats.title"),
|
|
141
141
|
onClose: r,
|
|
142
142
|
backLabel: t("action.close"),
|
|
143
143
|
children: [
|
|
144
|
-
/* @__PURE__ */ d(
|
|
145
|
-
/* @__PURE__ */ a(
|
|
144
|
+
/* @__PURE__ */ d(V, { children: [
|
|
145
|
+
/* @__PURE__ */ a(J, {}),
|
|
146
146
|
/* @__PURE__ */ a(
|
|
147
147
|
K,
|
|
148
148
|
{
|
|
@@ -176,7 +176,7 @@ const W = c.ul`
|
|
|
176
176
|
{
|
|
177
177
|
type: "button",
|
|
178
178
|
$open: o,
|
|
179
|
-
onClick: () =>
|
|
179
|
+
onClick: () => B(e),
|
|
180
180
|
children: t(o ? "publicChats.open" : "publicChats.join")
|
|
181
181
|
}
|
|
182
182
|
)
|