@ethora/chat-component 26.10.6 → 26.10.8
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 +102 -3
- package/dist/ChatProfileModal-83t5BRkI.js +2298 -0
- package/dist/{FilePreviewModal-DwNUEHei.js → FilePreviewModal-DxUGjSHe.js} +135 -135
- package/dist/{ManageDataModal-CaQ2VBPn.js → ManageDataModal-DFE_Wegj.js} +24 -24
- package/dist/{MarkdownBody-BeoG2cpo.js → MarkdownBody-uFITrPjT.js} +1 -1
- package/dist/{MessageSearchModal-DMw9o49-.js → MessageSearchModal-CsbTWgNm.js} +46 -46
- package/dist/{PublicChatsModal-CWdYILv_.js → PublicChatsModal-bDOp3IL9.js} +18 -18
- package/dist/{SideDrawer-Cl-vbuIG.js → SideDrawer-A_1ECqD2.js} +29 -29
- package/dist/UserProfileModal-Ca5wHYvr.js +639 -0
- package/dist/{UserSettingsModal-DgCAHmNh.js → UserSettingsModal-CAyyQGV6.js} +4 -4
- package/dist/{VideoCallOverlay-Cq2cECWj.js → VideoCallOverlay-BMiQh8kI.js} +6605 -4726
- package/dist/{VisibilityModal-D7vqGbrA.js → VisibilityModal-BXyIy7_J.js} +12 -12
- package/dist/assets/icons.d.ts +4 -0
- package/dist/calls/callDisplay.d.ts +22 -0
- package/dist/calls/callMode.d.ts +105 -0
- package/dist/calls/openScheduledCall.d.ts +20 -0
- package/dist/calls/p2p/P2PCallController.d.ts +160 -0
- package/dist/calls/p2p/icePolicy.d.ts +36 -0
- package/dist/calls/p2p/negotiator.d.ts +56 -0
- package/dist/calls/p2p/p2pRuntime.d.ts +35 -0
- package/dist/calls/p2p/signalInbox.d.ts +34 -0
- package/dist/calls/p2p/signalStanza.d.ts +51 -0
- package/dist/calls/placeCall.d.ts +20 -0
- package/dist/calls/scheduledCall.d.ts +101 -0
- package/dist/calls/scheduledCallActions.d.ts +12 -0
- package/dist/calls/scheduledCallFormat.d.ts +13 -0
- package/dist/calls/scheduledCallsConfig.d.ts +27 -0
- package/dist/calls/senderTrust.d.ts +7 -0
- package/dist/calls/startCall.d.ts +16 -0
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
- package/dist/components/MainComponents/LoginWrapper.d.ts +1 -0
- package/dist/components/MainComponents/ProfileImagePlaceholder.d.ts +1 -0
- package/dist/components/MainComponents/ReduxWrapper.d.ts +6 -0
- package/dist/components/MenuRoom/MenuRoom.d.ts +1 -0
- package/dist/components/Modals/NewChatModal/styledNewChatComponents.d.ts +27 -0
- package/dist/components/Modals/styledModalComponents.d.ts +25 -4
- package/dist/components/ScheduledCalls/ScheduleCallModal.d.ts +3 -0
- package/dist/components/ScheduledCalls/ScheduledCallCancelConfirm.d.ts +8 -0
- package/dist/components/ScheduledCalls/ScheduledCallCard.d.ts +7 -0
- package/dist/components/ScheduledCalls/ScheduledCallLayer.d.ts +15 -0
- package/dist/components/ScheduledCalls/ScheduledCallPreJoin.d.ts +3 -0
- package/dist/components/VideoCalls/P2PCallRunner.d.ts +1 -0
- package/dist/components/VideoCalls/P2PCallSession.d.ts +14 -0
- package/dist/components/VideoCalls/VideoCallSession.d.ts +39 -0
- package/dist/firebase-messaging-sw.js +918 -96
- package/dist/{handleCopyClick-Crn2jEEu.js → handleCopyClick-BX1fcFGN.js} +1 -1
- package/dist/helpers/callClaim.d.ts +17 -0
- package/dist/helpers/callOutcomeSync.d.ts +23 -0
- package/dist/helpers/callPush.d.ts +25 -0
- package/dist/helpers/canLeaveRoom.d.ts +3 -0
- package/dist/helpers/chatComponentConfigEvents.d.ts +16 -0
- package/dist/helpers/incomingCallPush.d.ts +89 -0
- package/dist/helpers/liveConfig.d.ts +46 -0
- package/dist/helpers/pushRoomHandoff.d.ts +13 -0
- package/dist/helpers/reportRoom.d.ts +18 -0
- package/dist/helpers/scheduledCallMessage.d.ts +23 -0
- package/dist/helpers/storeConsole.d.ts +1 -0
- package/dist/hooks/useChatSettingState.d.ts +1 -0
- package/dist/hooks/useNow.d.ts +6 -0
- package/dist/hooks/usePushNotifications.d.ts +2 -0
- package/dist/hooks/useRemoteAppearance.d.ts +21 -0
- package/dist/hooks/useTypography.d.ts +4 -0
- package/dist/{main-36gqdbJ8.js → main-B25iFKAC.js} +16623 -13399
- package/dist/main.d.ts +3 -1
- package/dist/main.js +25 -23
- package/dist/networking/api-requests/callState.api.d.ts +24 -0
- package/dist/networking/api-requests/remoteAppearance.api.d.ts +20 -0
- package/dist/networking/api-requests/rooms.api.d.ts +11 -1
- package/dist/networking/api-requests/scheduledCalls.api.d.ts +19 -0
- package/dist/networking/ethoraEvents.d.ts +14 -1
- package/dist/networking/xmpp/notifyXmppEvent.d.ts +6 -0
- package/dist/networking/xmpp/sendMessageReaction.xmpp.d.ts +13 -1
- package/dist/networking/xmppClient.d.ts +2 -1
- package/dist/roomStore/Middleware/blockedHydrationMiddleware.d.ts +2 -0
- package/dist/roomStore/callSlice.d.ts +23 -1
- package/dist/roomStore/chatSettingsSlice.d.ts +11 -2
- package/dist/roomStore/index.d.ts +4 -0
- package/dist/roomStore/scheduledCallSlice.d.ts +47 -0
- package/dist/types/models/config.model.d.ts +78 -1
- package/dist/types/models/message.model.d.ts +2 -0
- package/dist/types/models/room.model.d.ts +2 -0
- package/dist/types/models/scheduledCall.model.d.ts +116 -0
- package/dist/types/models/xmpp.model.d.ts +2 -1
- package/dist/utils/callAuthMirror.d.ts +1 -0
- package/dist/utils/callBroadcast.d.ts +12 -0
- package/dist/utils/callNotifications.d.ts +67 -0
- package/dist/utils/firebasePushNotifications.d.ts +14 -0
- package/dist/utils/handledCalls.d.ts +5 -0
- package/dist/utils/pushServiceWorkerBridge.d.ts +19 -0
- package/dist/utils/webLock.d.ts +13 -0
- package/package.json +1 -1
- package/public/firebase-messaging-sw.js +918 -96
- package/dist/ChatProfileModal-OJCKwdNp.js +0 -2168
- package/dist/UserProfileModal-B8KtGnwZ.js +0 -594
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as o, Fragment as
|
|
2
|
-
import { useState as m, useCallback as
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
1
|
+
import { jsxs as o, Fragment as T, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as m, useCallback as M } from "react";
|
|
3
|
+
import { b8 as I, a4 as t, b9 as j, ba as w, U as B, u as U, Z as z, ac as E, bb as F, af as R, a2 as x, bc as $, bd as A, be as O, bf as H } from "./main-B25iFKAC.js";
|
|
4
|
+
import { S as P, D as f, a as b, b as u, e as D, f as v } from "./SideDrawer-A_1ECqD2.js";
|
|
5
5
|
t(j)`
|
|
6
6
|
display: flex;
|
|
7
7
|
box-sizing: border-box;
|
|
@@ -66,32 +66,32 @@ const y = t(B)`
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
${I}
|
|
69
|
-
`,
|
|
69
|
+
`, W = 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
|
+
`, Z = 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
|
+
`, N = ({
|
|
83
83
|
handleCloseModal: r
|
|
84
84
|
}) => {
|
|
85
|
-
const { config: l } =
|
|
86
|
-
const p = (await
|
|
85
|
+
const { config: l } = U((s) => s.chatSettingStore), e = z(), { showToast: d } = E(), [C, c] = m(!1), [i, g] = m(!1), S = async () => {
|
|
86
|
+
const p = (await H()).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 = M(async () => {
|
|
91
91
|
if (!i) {
|
|
92
92
|
g(!0);
|
|
93
93
|
try {
|
|
94
|
-
await F(), c(!1), await
|
|
94
|
+
await F(), c(!1), await R.performLogout();
|
|
95
95
|
} catch (s) {
|
|
96
96
|
x.error("Failed to delete account", s), d({
|
|
97
97
|
id: Date.now().toString(),
|
|
@@ -103,18 +103,18 @@ const y = t(B)`
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}, [i, d, e]);
|
|
106
|
-
return /* @__PURE__ */ o(
|
|
106
|
+
return /* @__PURE__ */ o(T, { children: [
|
|
107
107
|
/* @__PURE__ */ o(
|
|
108
|
-
|
|
108
|
+
P,
|
|
109
109
|
{
|
|
110
110
|
title: e("settings.manageData.title"),
|
|
111
111
|
onClose: r,
|
|
112
112
|
backLabel: e("action.back"),
|
|
113
113
|
children: [
|
|
114
114
|
/* @__PURE__ */ o(f, { children: [
|
|
115
|
-
/* @__PURE__ */ a(
|
|
116
|
-
/* @__PURE__ */ a(
|
|
117
|
-
/* @__PURE__ */ a(
|
|
115
|
+
/* @__PURE__ */ a(b, { children: e("settings.manageData.section.export") }),
|
|
116
|
+
/* @__PURE__ */ a(u, { children: /* @__PURE__ */ o(D, { children: [
|
|
117
|
+
/* @__PURE__ */ a(v, { children: e("settings.manageData.downloadDescription") }),
|
|
118
118
|
/* @__PURE__ */ a(
|
|
119
119
|
y,
|
|
120
120
|
{
|
|
@@ -127,17 +127,17 @@ const y = t(B)`
|
|
|
127
127
|
] }) })
|
|
128
128
|
] }),
|
|
129
129
|
/* @__PURE__ */ o(f, { children: [
|
|
130
|
-
/* @__PURE__ */ a(
|
|
131
|
-
/* @__PURE__ */ a(
|
|
132
|
-
/* @__PURE__ */ a(
|
|
130
|
+
/* @__PURE__ */ a(b, { children: e("settings.manageData.deleteLabel") }),
|
|
131
|
+
/* @__PURE__ */ a(u, { children: /* @__PURE__ */ o(D, { children: [
|
|
132
|
+
/* @__PURE__ */ a(v, { children: e("settings.manageData.deleteDescription") }),
|
|
133
133
|
/* @__PURE__ */ o(
|
|
134
|
-
|
|
134
|
+
W,
|
|
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($, { color: A(l) }) }),
|
|
140
|
+
/* @__PURE__ */ a(Z, { children: e("settings.manageData.deleteDisclosure") })
|
|
141
141
|
]
|
|
142
142
|
}
|
|
143
143
|
),
|
|
@@ -159,7 +159,7 @@ const y = t(B)`
|
|
|
159
159
|
}
|
|
160
160
|
),
|
|
161
161
|
C && /* @__PURE__ */ a(
|
|
162
|
-
|
|
162
|
+
O,
|
|
163
163
|
{
|
|
164
164
|
title: e("settings.manageData.deleteConfirmTitle"),
|
|
165
165
|
description: e("settings.manageData.deleteConfirmDescription"),
|
|
@@ -174,5 +174,5 @@ const y = t(B)`
|
|
|
174
174
|
] });
|
|
175
175
|
};
|
|
176
176
|
export {
|
|
177
|
-
|
|
177
|
+
N 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 { Y as ei } from "./main-B25iFKAC.js";
|
|
4
4
|
function zr(e) {
|
|
5
5
|
const t = [], n = String(e || "");
|
|
6
6
|
let r = n.indexOf(","), u = 0, i = !1;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as i, Fragment as G } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as J, useState as h, useMemo as I, useEffect as V } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { S as ce, i as le, j as de, f as S } from "./SideDrawer-
|
|
3
|
+
import { Z as Y, a as Z, bi as K, u as z, aS as W, aR as X, aT as ee, bj as re, bk as te, a_ as ae, bl as oe, bm as se, bn as ne, a4 as c, _ as ie } from "./main-B25iFKAC.js";
|
|
4
|
+
import { S as ce, i as le, j as de, f as S } from "./SideDrawer-A_1ECqD2.js";
|
|
5
5
|
function he(t) {
|
|
6
6
|
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
|
|
7
7
|
if (!e) return;
|
|
@@ -16,7 +16,7 @@ function he(t) {
|
|
|
16
16
|
);
|
|
17
17
|
return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function pe(t) {
|
|
20
20
|
const e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t || "");
|
|
21
21
|
if (!e) return;
|
|
22
22
|
const l = new Date(
|
|
@@ -30,29 +30,29 @@ function ue(t) {
|
|
|
30
30
|
);
|
|
31
31
|
return Number.isNaN(l.getTime()) ? void 0 : l.toISOString();
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const ue = (t, e) => !!(t && e && t > e), me = (t) => `${t.firstName || ""} ${t.lastName || ""}`.trim() || t.name || "";
|
|
34
34
|
function fe(t, e, l = 8) {
|
|
35
35
|
const k = e.trim().toLowerCase();
|
|
36
36
|
if (!k) return [];
|
|
37
|
-
const
|
|
38
|
-
for (const
|
|
39
|
-
const d =
|
|
40
|
-
if (!d || !
|
|
41
|
-
const s =
|
|
42
|
-
if (s !== -1 && (n.add(d), (s === 0 ?
|
|
37
|
+
const p = [], u = [], n = /* @__PURE__ */ new Set();
|
|
38
|
+
for (const b of t) {
|
|
39
|
+
const d = b._id, x = me(b);
|
|
40
|
+
if (!d || !x || n.has(d)) continue;
|
|
41
|
+
const s = x.toLowerCase().indexOf(k);
|
|
42
|
+
if (s !== -1 && (n.add(d), (s === 0 ? p : u).push({ id: d, name: x }), p.length >= l))
|
|
43
43
|
break;
|
|
44
44
|
}
|
|
45
|
-
return [...
|
|
45
|
+
return [...p, ...u].slice(0, l);
|
|
46
46
|
}
|
|
47
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
|
+
`, be = c.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
gap: var(--ethora-space-2, 8px);
|
|
55
|
-
`,
|
|
55
|
+
`, H = c.button`
|
|
56
56
|
flex: 1 1 0;
|
|
57
57
|
height: 32px;
|
|
58
58
|
border: 1px solid
|
|
@@ -65,7 +65,7 @@ const ge = c.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
|
+
`, xe = c.button`
|
|
69
69
|
align-self: flex-start;
|
|
70
70
|
display: inline-flex;
|
|
71
71
|
align-items: center;
|
|
@@ -175,49 +175,49 @@ const ge = c.div`
|
|
|
175
175
|
`, Re = ({
|
|
176
176
|
handleCloseModal: t
|
|
177
177
|
}) => {
|
|
178
|
-
const e = Y(), l =
|
|
178
|
+
const e = Y(), l = Z(), k = K(767), p = J(null), u = z((r) => r.rooms.rooms), n = z(
|
|
179
179
|
(r) => r.rooms.activeRoomJID
|
|
180
|
-
),
|
|
180
|
+
), b = z((r) => r.rooms.usersSet);
|
|
181
181
|
z(
|
|
182
182
|
(r) => r.chatSettingStore.user?.xmppUsername
|
|
183
183
|
);
|
|
184
|
-
const [d,
|
|
184
|
+
const [d, x] = h(""), [s, O] = h(
|
|
185
185
|
n ? "chat" : "all"
|
|
186
|
-
), F = n ? n.split("@")[0] : void 0, [C,
|
|
186
|
+
), F = n ? n.split("@")[0] : void 0, [C, U] = h(!1), [m, T] = h(""), [f, L] = h(""), [g, M] = h(
|
|
187
187
|
null
|
|
188
|
-
), [v, N] = h(""), y =
|
|
188
|
+
), [v, N] = h(""), y = ue(m, f), _ = I(
|
|
189
189
|
() => ({
|
|
190
190
|
fromUserId: g?.id,
|
|
191
191
|
since: y ? void 0 : he(m),
|
|
192
|
-
until: y ? void 0 :
|
|
192
|
+
until: y ? void 0 : pe(f)
|
|
193
193
|
}),
|
|
194
194
|
[g?.id, m, f, y]
|
|
195
|
-
), w = (g ? 1 : 0) + (m ? 1 : 0) + (f ? 1 : 0),
|
|
196
|
-
M(null), N(""),
|
|
197
|
-
},
|
|
195
|
+
), w = (g ? 1 : 0) + (m ? 1 : 0) + (f ? 1 : 0), E = () => {
|
|
196
|
+
M(null), N(""), T(""), L("");
|
|
197
|
+
}, Q = n ? u[n] : void 0, { members: D } = W(
|
|
198
198
|
n || void 0,
|
|
199
|
-
s === "chat" &&
|
|
200
|
-
),
|
|
199
|
+
s === "chat" && X(Q) && (C || v.trim() !== "")
|
|
200
|
+
), j = I(() => {
|
|
201
201
|
if (!v.trim()) return [];
|
|
202
202
|
let r;
|
|
203
203
|
if (s === "chat") {
|
|
204
|
-
const
|
|
205
|
-
D.length > 0 ? r = ee([...
|
|
204
|
+
const B = n && u[n]?.members || [];
|
|
205
|
+
D.length > 0 ? r = ee([...B, ...D]) : r = B;
|
|
206
206
|
} else
|
|
207
|
-
r = Object.values(
|
|
207
|
+
r = Object.values(b || {});
|
|
208
208
|
return fe(r, v);
|
|
209
|
-
}, [v, s,
|
|
209
|
+
}, [v, s, u, n, b, D]), o = re(
|
|
210
210
|
y ? "" : d,
|
|
211
211
|
s,
|
|
212
212
|
F,
|
|
213
|
-
|
|
213
|
+
_
|
|
214
214
|
);
|
|
215
215
|
V(() => {
|
|
216
|
-
|
|
216
|
+
p.current?.focus();
|
|
217
217
|
}, []);
|
|
218
|
-
const { open:
|
|
219
|
-
|
|
220
|
-
}, R = I(() => o.items, [o.items]),
|
|
218
|
+
const { open: P } = te(), q = (r) => {
|
|
219
|
+
P(r) && k && l(ie(void 0));
|
|
220
|
+
}, R = I(() => o.items, [o.items]), A = d.trim();
|
|
221
221
|
return /* @__PURE__ */ a(
|
|
222
222
|
ce,
|
|
223
223
|
{
|
|
@@ -230,11 +230,11 @@ const ge = c.div`
|
|
|
230
230
|
/* @__PURE__ */ a(
|
|
231
231
|
de,
|
|
232
232
|
{
|
|
233
|
-
ref:
|
|
233
|
+
ref: p,
|
|
234
234
|
"data-autofocus": !0,
|
|
235
235
|
type: "search",
|
|
236
236
|
value: d,
|
|
237
|
-
onChange: (r) =>
|
|
237
|
+
onChange: (r) => x(r.target.value),
|
|
238
238
|
placeholder: e(
|
|
239
239
|
s === "chat" ? "search.messages.placeholderChat" : "search.messages.placeholderAll"
|
|
240
240
|
),
|
|
@@ -242,9 +242,9 @@ const ge = c.div`
|
|
|
242
242
|
}
|
|
243
243
|
)
|
|
244
244
|
] }),
|
|
245
|
-
/* @__PURE__ */ i(
|
|
245
|
+
/* @__PURE__ */ i(be, { role: "group", "aria-label": e("search.messages.scope"), children: [
|
|
246
246
|
/* @__PURE__ */ a(
|
|
247
|
-
|
|
247
|
+
H,
|
|
248
248
|
{
|
|
249
249
|
type: "button",
|
|
250
250
|
$active: s === "chat",
|
|
@@ -255,7 +255,7 @@ const ge = c.div`
|
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
/* @__PURE__ */ a(
|
|
258
|
-
|
|
258
|
+
H,
|
|
259
259
|
{
|
|
260
260
|
type: "button",
|
|
261
261
|
$active: s === "all",
|
|
@@ -266,12 +266,12 @@ const ge = c.div`
|
|
|
266
266
|
)
|
|
267
267
|
] }),
|
|
268
268
|
/* @__PURE__ */ i(
|
|
269
|
-
|
|
269
|
+
xe,
|
|
270
270
|
{
|
|
271
271
|
type: "button",
|
|
272
272
|
$active: C || w > 0,
|
|
273
273
|
"aria-expanded": C,
|
|
274
|
-
onClick: () =>
|
|
274
|
+
onClick: () => U((r) => !r),
|
|
275
275
|
children: [
|
|
276
276
|
e("search.messages.filters"),
|
|
277
277
|
w > 0 && /* @__PURE__ */ a("span", { children: w })
|
|
@@ -302,7 +302,7 @@ const ge = c.div`
|
|
|
302
302
|
}
|
|
303
303
|
)
|
|
304
304
|
] }),
|
|
305
|
-
!g &&
|
|
305
|
+
!g && j.length > 0 && /* @__PURE__ */ a(Se, { role: "listbox", children: j.map((r) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a(
|
|
306
306
|
"button",
|
|
307
307
|
{
|
|
308
308
|
type: "button",
|
|
@@ -323,7 +323,7 @@ const ge = c.div`
|
|
|
323
323
|
type: "date",
|
|
324
324
|
value: m,
|
|
325
325
|
max: f || void 0,
|
|
326
|
-
onChange: (r) =>
|
|
326
|
+
onChange: (r) => T(r.target.value)
|
|
327
327
|
}
|
|
328
328
|
)
|
|
329
329
|
] }),
|
|
@@ -341,9 +341,9 @@ const ge = c.div`
|
|
|
341
341
|
] })
|
|
342
342
|
] }),
|
|
343
343
|
y && /* @__PURE__ */ a(S, { role: "alert", children: e("search.messages.dateOrder") }),
|
|
344
|
-
w > 0 && /* @__PURE__ */ a(Ce, { type: "button", onClick:
|
|
344
|
+
w > 0 && /* @__PURE__ */ a(Ce, { type: "button", onClick: E, children: e("search.messages.filterClearAll") })
|
|
345
345
|
] }),
|
|
346
|
-
!o.searchable && /* @__PURE__ */ a(S, { children:
|
|
346
|
+
!o.searchable && /* @__PURE__ */ a(S, { children: A ? e("search.messages.tooShort", { count: oe }) : e("search.messages.hint") }),
|
|
347
347
|
o.searchable && o.status === "loading" && /* @__PURE__ */ a(S, { role: "status", children: e("search.messages.searching") }),
|
|
348
348
|
o.status === "error" && /* @__PURE__ */ i(S, { role: "alert", children: [
|
|
349
349
|
e("search.messages.error"),
|
|
@@ -357,7 +357,7 @@ const ge = c.div`
|
|
|
357
357
|
se,
|
|
358
358
|
{
|
|
359
359
|
hits: R,
|
|
360
|
-
query:
|
|
360
|
+
query: A,
|
|
361
361
|
showRoom: s === "all",
|
|
362
362
|
onOpen: q
|
|
363
363
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
4
|
-
import { S as
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useState as d, useRef as B, useCallback as N, useEffect as P, useMemo as z } from "react";
|
|
3
|
+
import { c as T, bo as E, Z as U, a as F, bi as H, u as A, a_ as J, a4 as c, ap as Z, _ as q } from "./main-B25iFKAC.js";
|
|
4
|
+
import { S as G, i as V, j as K, f as S } from "./SideDrawer-A_1ECqD2.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 = T.getState().chatSettingStore.user?.token || "", s = (await
|
|
11
|
+
const x = T.getState().chatSettingStore.user?.token || "", s = (await E.get("/v1/chats/public", {
|
|
12
12
|
params: { limit: Math.min(t, I), offset: r },
|
|
13
13
|
headers: { Authorization: x },
|
|
14
14
|
signal: u
|
|
@@ -103,17 +103,17 @@ 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 =
|
|
106
|
+
const t = U(), u = F(), x = H(767), b = A((e) => e.rooms.rooms), s = A(
|
|
107
107
|
(e) => e.chatSettingStore.config?.xmppSettings?.conference
|
|
108
|
-
), [l, i] =
|
|
108
|
+
), [l, i] = d([]), [j, $] = d(0), [v, D] = d(0), [n, w] = d("loading"), [h, L] = d(""), m = B(0), f = N(async (e) => {
|
|
109
109
|
const o = ++m.current;
|
|
110
110
|
w(e ? "loadingMore" : "loading");
|
|
111
111
|
try {
|
|
112
112
|
const g = await Q({ offset: e });
|
|
113
113
|
if (o !== m.current) return;
|
|
114
114
|
i((k) => {
|
|
115
|
-
const
|
|
116
|
-
return e ? [...k, ...g.items.filter((C) => !
|
|
115
|
+
const _ = new Set(k.map((C) => C.name));
|
|
116
|
+
return e ? [...k, ...g.items.filter((C) => !_.has(C.name))] : g.items;
|
|
117
117
|
}), $(g.total), D(g.nextOffset), w("done");
|
|
118
118
|
} catch {
|
|
119
119
|
o === m.current && w("error");
|
|
@@ -130,18 +130,18 @@ 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]), R = (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
|
-
return /* @__PURE__ */
|
|
138
|
-
|
|
137
|
+
return /* @__PURE__ */ p(
|
|
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__ */
|
|
144
|
+
/* @__PURE__ */ p(V, { children: [
|
|
145
145
|
/* @__PURE__ */ a(J, {}),
|
|
146
146
|
/* @__PURE__ */ a(
|
|
147
147
|
K,
|
|
@@ -155,7 +155,7 @@ const W = c.ul`
|
|
|
155
155
|
)
|
|
156
156
|
] }),
|
|
157
157
|
n === "loading" && /* @__PURE__ */ a(S, { role: "status", children: t("publicChats.loading") }),
|
|
158
|
-
n === "error" && /* @__PURE__ */
|
|
158
|
+
n === "error" && /* @__PURE__ */ p(S, { role: "alert", children: [
|
|
159
159
|
t("publicChats.error"),
|
|
160
160
|
" ",
|
|
161
161
|
/* @__PURE__ */ a("button", { type: "button", onClick: () => {
|
|
@@ -165,9 +165,9 @@ const W = c.ul`
|
|
|
165
165
|
n !== "loading" && n !== "error" && y.length === 0 && /* @__PURE__ */ a(S, { children: h.trim() && M ? t("publicChats.emptyFilterMore") : t("publicChats.empty") }),
|
|
166
166
|
y.length > 0 && /* @__PURE__ */ a(W, { children: y.map((e) => {
|
|
167
167
|
const o = O.has(e.name);
|
|
168
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ p(X, { children: [
|
|
169
169
|
/* @__PURE__ */ a(Y, { $src: e.picture, "aria-hidden": "true", children: !e.picture && oe(e) }),
|
|
170
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ p(ee, { children: [
|
|
171
171
|
/* @__PURE__ */ a("strong", { children: e.title || t("search.messages.chat") }),
|
|
172
172
|
e.description && /* @__PURE__ */ a("span", { children: e.description })
|
|
173
173
|
] }),
|
|
@@ -176,7 +176,7 @@ const W = c.ul`
|
|
|
176
176
|
{
|
|
177
177
|
type: "button",
|
|
178
178
|
$open: o,
|
|
179
|
-
onClick: () =>
|
|
179
|
+
onClick: () => R(e),
|
|
180
180
|
children: t(o ? "publicChats.open" : "publicChats.join")
|
|
181
181
|
}
|
|
182
182
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import { useId as f, useRef as v } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Z as g, a5 as u, bi as m, bp as b, U as w, bq as y, a4 as e, br as D, bs as k } from "./main-B25iFKAC.js";
|
|
4
4
|
const c = 767, R = `${c}px`, z = e.div`
|
|
5
5
|
position: relative;
|
|
6
6
|
pointer-events: auto;
|
|
@@ -58,7 +58,7 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
58
58
|
padding-left: var(--ethora-space-4, 16px);
|
|
59
59
|
padding-right: var(--ethora-space-4, 16px);
|
|
60
60
|
}
|
|
61
|
-
`,
|
|
61
|
+
`, $ = e.section`
|
|
62
62
|
display: flex;
|
|
63
63
|
flex-direction: column;
|
|
64
64
|
gap: var(--ethora-space-2, 8px);
|
|
@@ -84,12 +84,12 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
84
84
|
flex-direction: column;
|
|
85
85
|
gap: var(--ethora-space-1, 4px);
|
|
86
86
|
padding: var(--ethora-space-3, 12px) var(--ethora-space-4, 16px);
|
|
87
|
-
`,
|
|
87
|
+
`, K = e.div`
|
|
88
88
|
display: flex;
|
|
89
89
|
align-items: baseline;
|
|
90
90
|
justify-content: space-between;
|
|
91
91
|
gap: var(--ethora-space-2, 8px);
|
|
92
|
-
`,
|
|
92
|
+
`, q = e.button`
|
|
93
93
|
border: none;
|
|
94
94
|
background: transparent;
|
|
95
95
|
padding: var(--ethora-space-2, 8px) 0;
|
|
@@ -109,11 +109,11 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
109
109
|
outline-offset: 2px;
|
|
110
110
|
border-radius: var(--ethora-radius-sm, 8px);
|
|
111
111
|
}
|
|
112
|
-
`,
|
|
112
|
+
`, F = e.div`
|
|
113
113
|
height: 1px;
|
|
114
114
|
margin: 0 var(--ethora-space-4, 16px);
|
|
115
115
|
background-color: var(--ethora-color-border, #e6e8ec);
|
|
116
|
-
`,
|
|
116
|
+
`, U = e.div`
|
|
117
117
|
display: flex;
|
|
118
118
|
align-items: center;
|
|
119
119
|
gap: var(--ethora-space-2, 8px);
|
|
@@ -135,7 +135,7 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
135
135
|
& > svg {
|
|
136
136
|
flex: 0 0 auto;
|
|
137
137
|
}
|
|
138
|
-
`,
|
|
138
|
+
`, V = e.input`
|
|
139
139
|
flex: 1 1 auto;
|
|
140
140
|
min-width: 0;
|
|
141
141
|
border: none;
|
|
@@ -148,22 +148,22 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
148
148
|
&::placeholder {
|
|
149
149
|
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
150
150
|
}
|
|
151
|
-
`,
|
|
151
|
+
`, X = e.div`
|
|
152
152
|
display: flex;
|
|
153
153
|
flex-direction: column;
|
|
154
154
|
width: 100%;
|
|
155
|
-
`,
|
|
155
|
+
`, T = e.div`
|
|
156
156
|
font-size: var(--ethora-font-size-sm, 14px);
|
|
157
157
|
font-weight: var(--ethora-font-weight-medium, 500);
|
|
158
158
|
color: var(--ethora-color-text, #141414);
|
|
159
159
|
text-align: start;
|
|
160
|
-
`,
|
|
160
|
+
`, C = e.div`
|
|
161
161
|
font-size: var(--ethora-font-size-xs, 12px);
|
|
162
162
|
font-weight: var(--ethora-font-weight-regular, 400);
|
|
163
163
|
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
164
164
|
text-align: start;
|
|
165
165
|
line-height: 1.4;
|
|
166
|
-
`,
|
|
166
|
+
`, E = e.button`
|
|
167
167
|
display: flex;
|
|
168
168
|
align-items: center;
|
|
169
169
|
gap: var(--ethora-space-3, 12px);
|
|
@@ -205,17 +205,17 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
205
205
|
strokeLinecap: "round",
|
|
206
206
|
strokeLinejoin: "round"
|
|
207
207
|
}
|
|
208
|
-
) }),
|
|
208
|
+
) }), Z = ({
|
|
209
209
|
label: r,
|
|
210
210
|
hint: a,
|
|
211
211
|
onClick: t
|
|
212
|
-
}) => /* @__PURE__ */ i(
|
|
212
|
+
}) => /* @__PURE__ */ i(E, { type: "button", onClick: t, children: [
|
|
213
213
|
/* @__PURE__ */ i(L, { children: [
|
|
214
|
-
/* @__PURE__ */ o(
|
|
215
|
-
a && /* @__PURE__ */ o(
|
|
214
|
+
/* @__PURE__ */ o(T, { children: r }),
|
|
215
|
+
a && /* @__PURE__ */ o(C, { children: a })
|
|
216
216
|
] }),
|
|
217
217
|
/* @__PURE__ */ o(j, { "aria-hidden": "true", children: /* @__PURE__ */ o(M, {}) })
|
|
218
|
-
] }),
|
|
218
|
+
] }), G = ({
|
|
219
219
|
title: r,
|
|
220
220
|
onClose: a,
|
|
221
221
|
headerActions: t,
|
|
@@ -224,7 +224,7 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
224
224
|
}) => {
|
|
225
225
|
const h = g(), n = f(), s = v(null);
|
|
226
226
|
u({ onClose: a, containerRef: s });
|
|
227
|
-
const p = m(c), x =
|
|
227
|
+
const p = m(c), x = b();
|
|
228
228
|
return /* @__PURE__ */ i(
|
|
229
229
|
z,
|
|
230
230
|
{
|
|
@@ -237,7 +237,7 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
237
237
|
children: [
|
|
238
238
|
/* @__PURE__ */ i(B, { children: [
|
|
239
239
|
/* @__PURE__ */ o(
|
|
240
|
-
|
|
240
|
+
w,
|
|
241
241
|
{
|
|
242
242
|
EndIcon: /* @__PURE__ */ o(y, {}),
|
|
243
243
|
onClick: a,
|
|
@@ -253,18 +253,18 @@ const c = 767, R = `${c}px`, z = e.div`
|
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
export {
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
$ as D,
|
|
257
|
+
G as S,
|
|
258
258
|
O as a,
|
|
259
259
|
W as b,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
F as c,
|
|
261
|
+
Z as d,
|
|
262
262
|
_ as e,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
263
|
+
C as f,
|
|
264
|
+
T as g,
|
|
265
|
+
K as h,
|
|
266
|
+
U as i,
|
|
267
|
+
V as j,
|
|
268
|
+
X as k,
|
|
269
|
+
q as l
|
|
270
270
|
};
|