@ethora/chat-component 26.7.6 → 26.7.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/dist/ChatProfileModal-k4_0ol-1.js +2135 -0
- package/dist/FilePreviewModal-BYoSZ4d1.js +743 -0
- package/dist/{ManageDataModal-CDPXcC93.js → ManageDataModal-Dje7zTG4.js} +68 -49
- package/dist/{MarkdownBody-DBJGraWM.js → MarkdownBody-Cm3GPQGA.js} +1 -1
- package/dist/{SideDrawer-Dr_lkaOW.js → SideDrawer-DWeOHKWM.js} +110 -66
- package/dist/UserProfileModal-CUcGYJb9.js +574 -0
- package/dist/{UserSettingsModal-OcAJao-d.js → UserSettingsModal-LWwOt5TY.js} +2 -2
- package/dist/{VideoCallOverlay-CC4sShdK.js → VideoCallOverlay-Dw_ydJ2K.js} +1 -1
- package/dist/{VisibilityModal-DkMhx_2k.js → VisibilityModal-D06gXwjS.js} +2 -2
- package/dist/components/MainComponents/ChatRoomOpeningPreview.d.ts +24 -0
- package/dist/components/MainComponents/ChatWrapper.d.ts +1 -0
- package/dist/components/MainComponents/ChooseChatMessage.d.ts +11 -1
- package/dist/components/Modals/Modal/Modal.d.ts +10 -0
- package/dist/components/Modals/Modal/ModalContent.d.ts +21 -0
- package/dist/components/Modals/ModalBox/ModalBox.d.ts +9 -0
- package/dist/components/Modals/ModalReportChat/ModalReportChat.d.ts +6 -1
- package/dist/components/Modals/ModalWrapper/ModalWrapper.d.ts +8 -0
- package/dist/components/Modals/SettingsModals/SharedStyledComponents.d.ts +12 -0
- package/dist/components/Modals/SideDrawer/DrawerProfileParts.d.ts +29 -0
- package/dist/components/Modals/SideDrawer/SideDrawer.d.ts +21 -1
- package/dist/components/Modals/SidePanel/SidePanel.d.ts +31 -0
- package/dist/components/Modals/UserProfileModal/EditUserModal.d.ts +5 -1
- package/dist/components/Modals/motionVariants.d.ts +37 -0
- package/dist/components/Modals/styledModalComponents.d.ts +0 -1
- package/dist/context/ModalTransitionContext.d.ts +2 -0
- package/dist/handleCopyClick-BOESIBUL.js +108 -0
- package/dist/helpers/buildChatShareLink.d.ts +20 -0
- package/dist/helpers/cacheScope.d.ts +15 -1
- package/dist/helpers/constants/MODAL_TYPES.d.ts +6 -4
- package/dist/helpers/createRoomFromApi.d.ts +1 -1
- package/dist/helpers/formatNumberWithCommas.d.ts +1 -1
- package/dist/hooks/useChatOpenPhase.d.ts +21 -0
- package/dist/hooks/useDelayedAction.d.ts +22 -0
- package/dist/hooks/useExclusiveRightPane.d.ts +25 -0
- package/dist/hooks/useExitTransition.d.ts +24 -0
- package/dist/hooks/useGetNewArchRoom.d.ts +3 -1
- package/dist/hooks/useQRCodeChatHandler.d.ts +29 -1
- package/dist/hooks/useRoomState.d.ts +2 -0
- package/dist/{main-B-8IhwaP.js → main-SdAeI1xI.js} +8449 -7889
- package/dist/main.css +1 -1
- package/dist/main.js +5 -5
- package/dist/roomStore/roomsSlice.d.ts +5 -1
- package/dist/styles/motion.d.ts +27 -0
- package/dist/types/models/room.model.d.ts +28 -0
- package/package.json +10 -2
- package/dist/ChatProfileModal-hxsWI8cx.js +0 -2139
- package/dist/FilePreviewModal-CwWnHsB1.js +0 -736
- package/dist/UserProfileModal-Q_jhXpsX.js +0 -568
- package/dist/handleCopyClick-CpmPa6VI.js +0 -32
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
import { jsxs as f, Fragment as B, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as me, useState as D, useCallback as S, useImperativeHandle as he, useRef as ee, useMemo as H } from "react";
|
|
3
|
+
import { a as fe, n as J, p as ue, q as ge, t as ve, P as oe, I as M, v as I, w as be, x as ye, y as xe, z as ae, C as we, D as Ce, E as Se, F as De, u as q, G as Ie, J as Ne, L as Ue, K as ke, N as _, o as Q, O as Ae, Q as Pe, R as Re, s as ze, B as X, S as je, T as Fe, U as Be, W as Y, X as F, Y as $e, V as Oe, A as Ee, Z as Te, _ as Le, $ as He, a0 as Me } from "./main-SdAeI1xI.js";
|
|
4
|
+
import { D as $, a as W, b as Xe, e as We, f as Je, S as Ke } from "./SideDrawer-DWeOHKWM.js";
|
|
5
|
+
import { P as re, a as Ve, D as Ge, b as qe, h as _e } from "./handleCopyClick-BOESIBUL.js";
|
|
6
|
+
const Qe = (c, s) => {
|
|
7
|
+
const i = atob(c.split(",")[1]), u = new ArrayBuffer(i.length), e = new Uint8Array(u);
|
|
8
|
+
for (let r = 0; r < i.length; r++)
|
|
9
|
+
e[r] = i.charCodeAt(r);
|
|
10
|
+
const l = new Blob([e], { type: "image/jpeg" });
|
|
11
|
+
return new File([l], s, { type: "image/jpeg" });
|
|
12
|
+
}, Ye = I.div`
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--ethora-space-4, 16px);
|
|
16
|
+
width: 100%;
|
|
17
|
+
`, te = me(
|
|
18
|
+
({ setIsEditing: c, modalUser: s, config: i }, u) => {
|
|
19
|
+
const e = fe(), l = J(), [r, t] = D(s?.firstName || ""), [h, k] = D(s?.lastName || ""), [b, w] = D(s?.description || ""), [g, y] = D(
|
|
20
|
+
s?.profileImage
|
|
21
|
+
), x = S(async () => {
|
|
22
|
+
try {
|
|
23
|
+
let n = new FormData();
|
|
24
|
+
if (typeof g == "string" && g.startsWith("data:image/")) {
|
|
25
|
+
const U = Qe(g, "profileImage.jpg");
|
|
26
|
+
n.append("file", U);
|
|
27
|
+
} else g instanceof File && n.append("file", g);
|
|
28
|
+
n.append("firstName", r), n.append("lastName", h), n.append("description", b);
|
|
29
|
+
const { user: A } = await ue(n);
|
|
30
|
+
e(
|
|
31
|
+
ge({
|
|
32
|
+
updates: {
|
|
33
|
+
firstName: r,
|
|
34
|
+
lastName: h,
|
|
35
|
+
description: b,
|
|
36
|
+
profileImage: A?.profileImage
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
), c(!1);
|
|
40
|
+
} catch (n) {
|
|
41
|
+
ve.log("error", n);
|
|
42
|
+
}
|
|
43
|
+
}, [
|
|
44
|
+
e,
|
|
45
|
+
b,
|
|
46
|
+
r,
|
|
47
|
+
h,
|
|
48
|
+
g,
|
|
49
|
+
c
|
|
50
|
+
]);
|
|
51
|
+
he(u, () => ({ save: x }), [x]);
|
|
52
|
+
const C = (n) => {
|
|
53
|
+
y(n);
|
|
54
|
+
};
|
|
55
|
+
return /* @__PURE__ */ f(B, { children: [
|
|
56
|
+
/* @__PURE__ */ o(re, { children: /* @__PURE__ */ o(
|
|
57
|
+
oe,
|
|
58
|
+
{
|
|
59
|
+
icon: g,
|
|
60
|
+
name: `${r} ${h}`,
|
|
61
|
+
size: 96,
|
|
62
|
+
upload: {
|
|
63
|
+
onUpload: C,
|
|
64
|
+
active: !0
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
) }),
|
|
68
|
+
/* @__PURE__ */ o($, { children: /* @__PURE__ */ f(Ye, { children: [
|
|
69
|
+
/* @__PURE__ */ o(
|
|
70
|
+
M,
|
|
71
|
+
{
|
|
72
|
+
color: i?.colors?.primary,
|
|
73
|
+
colorBg: i?.colors?.colorInput,
|
|
74
|
+
placeholder: l("field.firstName"),
|
|
75
|
+
label: l("field.firstName"),
|
|
76
|
+
value: r,
|
|
77
|
+
onChange: (n) => t(n.target.value)
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ o(
|
|
81
|
+
M,
|
|
82
|
+
{
|
|
83
|
+
color: i?.colors?.primary,
|
|
84
|
+
colorBg: i?.colors?.colorInput,
|
|
85
|
+
placeholder: l("field.lastName"),
|
|
86
|
+
label: l("field.lastName"),
|
|
87
|
+
value: h,
|
|
88
|
+
onChange: (n) => k(n.target.value)
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ o(
|
|
92
|
+
M,
|
|
93
|
+
{
|
|
94
|
+
color: i?.colors?.primary,
|
|
95
|
+
colorBg: i?.colors?.colorInput,
|
|
96
|
+
placeholder: l("modal.profile.about"),
|
|
97
|
+
label: l("modal.profile.about"),
|
|
98
|
+
value: b,
|
|
99
|
+
onChange: (n) => w(n.target.value)
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
] }) })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
te.displayName = "EditUserModal";
|
|
107
|
+
const Ze = ae`
|
|
108
|
+
from {
|
|
109
|
+
transform: rotate(0deg);
|
|
110
|
+
}
|
|
111
|
+
to {
|
|
112
|
+
transform: rotate(180deg);
|
|
113
|
+
}
|
|
114
|
+
`, eo = ae`
|
|
115
|
+
from {
|
|
116
|
+
transform: rotate(180deg);
|
|
117
|
+
}
|
|
118
|
+
to {
|
|
119
|
+
transform: rotate(0deg);
|
|
120
|
+
}
|
|
121
|
+
`, oo = I.div`
|
|
122
|
+
position: relative;
|
|
123
|
+
width: 100%;
|
|
124
|
+
`, ao = I.div`
|
|
125
|
+
border: 1px solid
|
|
126
|
+
${({ $borderColor: c, $isOpen: s }) => s ? c || "var(--ethora-color-primary, #0052cd)" : c || "var(--ethora-color-border, #e6e8ec)"};
|
|
127
|
+
padding: 0 16px;
|
|
128
|
+
height: 48px;
|
|
129
|
+
box-sizing: border-box;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
align-items: center;
|
|
133
|
+
cursor: pointer;
|
|
134
|
+
background-color: var(--ethora-color-bg, #fff);
|
|
135
|
+
color: var(--ethora-color-text, #141414);
|
|
136
|
+
font-size: var(--ethora-font-size, 16px);
|
|
137
|
+
border-radius: var(--ethora-radius-md, 16px);
|
|
138
|
+
transition:
|
|
139
|
+
border-color var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease),
|
|
140
|
+
box-shadow var(--ethora-motion-fast, 150ms) var(--ethora-motion-ease, ease);
|
|
141
|
+
|
|
142
|
+
${({ $isOpen: c }) => c && ye`
|
|
143
|
+
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
144
|
+
outline-offset: 1px;
|
|
145
|
+
`}
|
|
146
|
+
|
|
147
|
+
&:focus-visible {
|
|
148
|
+
outline: 2px solid var(--ethora-color-primary, #0052cd);
|
|
149
|
+
outline-offset: 1px;
|
|
150
|
+
}
|
|
151
|
+
`, ro = I.span`
|
|
152
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
153
|
+
`, to = I.span`
|
|
154
|
+
margin-left: 10px;
|
|
155
|
+
display: inline-block;
|
|
156
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
157
|
+
font-size: 12px;
|
|
158
|
+
animation: ${(c) => c.$isOpen ? Ze : eo} 0.3s ease
|
|
159
|
+
forwards;
|
|
160
|
+
`, no = I.div`
|
|
161
|
+
position: absolute;
|
|
162
|
+
top: 100%;
|
|
163
|
+
left: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
border: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
166
|
+
background-color: var(--ethora-color-bg, #fff);
|
|
167
|
+
max-height: 200px;
|
|
168
|
+
overflow-y: auto;
|
|
169
|
+
margin-top: 4px;
|
|
170
|
+
border-radius: var(--ethora-radius-md, 16px);
|
|
171
|
+
box-shadow: var(--ethora-shadow-md, 0 4px 12px rgba(16, 24, 40, 0.1));
|
|
172
|
+
z-index: 100;
|
|
173
|
+
${xe}
|
|
174
|
+
`, so = I.input`
|
|
175
|
+
width: 100%;
|
|
176
|
+
padding: 12px 16px;
|
|
177
|
+
border: none;
|
|
178
|
+
border-bottom: 1px solid var(--ethora-color-border, #e6e8ec);
|
|
179
|
+
outline: none;
|
|
180
|
+
box-sizing: border-box;
|
|
181
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
182
|
+
background: transparent;
|
|
183
|
+
color: var(--ethora-color-text, #141414);
|
|
184
|
+
|
|
185
|
+
&::placeholder {
|
|
186
|
+
color: var(--ethora-color-text-muted, #8c8c8c);
|
|
187
|
+
}
|
|
188
|
+
`, Z = I.div`
|
|
189
|
+
padding: 12px 16px;
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
font-size: var(--ethora-font-size-sm, 14px);
|
|
192
|
+
color: var(--ethora-color-text, #141414);
|
|
193
|
+
background-color: ${({ $selected: c }) => c ? "var(--ethora-color-primary-soft, #e7edf9)" : "transparent"};
|
|
194
|
+
transition: background-color var(--ethora-motion-fast, 150ms);
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background-color: ${({ $selected: c }) => c ? "var(--ethora-color-primary-soft, #e7edf9)" : "var(--ethora-color-bg-hover, #f0f2f5)"};
|
|
198
|
+
}
|
|
199
|
+
`, io = ({
|
|
200
|
+
options: c,
|
|
201
|
+
placeholder: s,
|
|
202
|
+
onSelect: i,
|
|
203
|
+
accentColor: u,
|
|
204
|
+
selectedValue: e
|
|
205
|
+
}) => {
|
|
206
|
+
const l = J(), [r, t] = D(!1), [h, k] = D(
|
|
207
|
+
e
|
|
208
|
+
), [b, w] = D(""), g = ee(null), y = () => t((a) => !a), x = (a) => {
|
|
209
|
+
k(a), i(a), t(!1), w("");
|
|
210
|
+
}, C = c.filter(
|
|
211
|
+
(a) => a.name.toLowerCase().includes(b.toLowerCase())
|
|
212
|
+
), n = S(() => t(!1), []);
|
|
213
|
+
be({
|
|
214
|
+
enabled: r,
|
|
215
|
+
onClose: n,
|
|
216
|
+
kind: "menu",
|
|
217
|
+
insideRefs: [g],
|
|
218
|
+
closeOnOutsidePress: !0
|
|
219
|
+
});
|
|
220
|
+
const A = (a) => {
|
|
221
|
+
a.key === "Enter" || a.key === " " ? (a.preventDefault(), y()) : a.key === "Escape" && r && t(!1);
|
|
222
|
+
}, U = (a, P) => {
|
|
223
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), x(P));
|
|
224
|
+
};
|
|
225
|
+
return /* @__PURE__ */ f(oo, { ref: g, children: [
|
|
226
|
+
/* @__PURE__ */ f(
|
|
227
|
+
ao,
|
|
228
|
+
{
|
|
229
|
+
$isOpen: r,
|
|
230
|
+
onClick: y,
|
|
231
|
+
onKeyDown: A,
|
|
232
|
+
$borderColor: u,
|
|
233
|
+
role: "button",
|
|
234
|
+
tabIndex: 0,
|
|
235
|
+
"aria-haspopup": "listbox",
|
|
236
|
+
"aria-expanded": r,
|
|
237
|
+
children: [
|
|
238
|
+
h ? /* @__PURE__ */ o("span", { children: h.name }) : /* @__PURE__ */ o(ro, { children: s }),
|
|
239
|
+
/* @__PURE__ */ o(to, { style: { color: u }, $isOpen: r, children: "▼" })
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
),
|
|
243
|
+
r && /* @__PURE__ */ f(no, { role: "listbox", children: [
|
|
244
|
+
/* @__PURE__ */ o(
|
|
245
|
+
so,
|
|
246
|
+
{
|
|
247
|
+
type: "text",
|
|
248
|
+
placeholder: l("search.placeholder"),
|
|
249
|
+
value: b,
|
|
250
|
+
onChange: (a) => w(a.target.value)
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
C.length > 0 ? C.map((a) => /* @__PURE__ */ o(
|
|
254
|
+
Z,
|
|
255
|
+
{
|
|
256
|
+
onClick: () => x(a),
|
|
257
|
+
onKeyDown: (P) => U(P, a),
|
|
258
|
+
role: "option",
|
|
259
|
+
tabIndex: 0,
|
|
260
|
+
"aria-selected": h?.id === a.id,
|
|
261
|
+
$selected: h?.id === a.id,
|
|
262
|
+
children: a.name
|
|
263
|
+
},
|
|
264
|
+
a.id
|
|
265
|
+
)) : /* @__PURE__ */ o(Z, { children: l("select.noOptions") })
|
|
266
|
+
] })
|
|
267
|
+
] });
|
|
268
|
+
}, fo = ({
|
|
269
|
+
handleCloseModal: c
|
|
270
|
+
}) => {
|
|
271
|
+
const s = we(), { client: i } = Ce();
|
|
272
|
+
Se();
|
|
273
|
+
const { showToast: u } = De(), e = J(), { config: l, user: r, selectedUser: t, langSource: h } = q(
|
|
274
|
+
(d) => d.chatSettingStore
|
|
275
|
+
), k = q((d) => d.call.phase), [b, w] = D(!1), g = ee(null), y = l?.videoCalls, x = y?.enabled === !0 && !!y?.livekitUrl?.trim() && (y?.allowedRoomTypes || ["private"]).includes("private"), C = x && y?.enableAudioCalls === !0, n = k !== "idle", A = S(() => {
|
|
276
|
+
s(Ie()), c();
|
|
277
|
+
}, []), U = S(() => {
|
|
278
|
+
Ne.performLogout();
|
|
279
|
+
}, []), a = H(
|
|
280
|
+
() => [
|
|
281
|
+
{
|
|
282
|
+
label: e("action.logOut"),
|
|
283
|
+
icon: /* @__PURE__ */ o(Ue, {}),
|
|
284
|
+
onClick: () => {
|
|
285
|
+
U();
|
|
286
|
+
},
|
|
287
|
+
styles: { color: "var(--ethora-color-danger, #D92D20)" }
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
[U, e]
|
|
291
|
+
), P = (d) => {
|
|
292
|
+
s(Me(d.id));
|
|
293
|
+
}, ne = S(() => {
|
|
294
|
+
w(!0);
|
|
295
|
+
}, []), se = async (d, p) => {
|
|
296
|
+
try {
|
|
297
|
+
const v = Te(
|
|
298
|
+
d,
|
|
299
|
+
l?.xmppSettings?.conference,
|
|
300
|
+
p
|
|
301
|
+
);
|
|
302
|
+
if (!v || !v.jid)
|
|
303
|
+
return console.error(
|
|
304
|
+
"handleRoomCreation: failed to normalize new private room",
|
|
305
|
+
d
|
|
306
|
+
), u({
|
|
307
|
+
id: Date.now().toString(),
|
|
308
|
+
title: e("toast.error"),
|
|
309
|
+
message: e("toast.couldNotOpenPrivateChat"),
|
|
310
|
+
type: "error",
|
|
311
|
+
duration: 4e3
|
|
312
|
+
}), null;
|
|
313
|
+
if (s(
|
|
314
|
+
Le({
|
|
315
|
+
room: v,
|
|
316
|
+
xmpp: i
|
|
317
|
+
})
|
|
318
|
+
), i && v.jid) {
|
|
319
|
+
try {
|
|
320
|
+
await i.presenceInRoomStanza(v.jid);
|
|
321
|
+
} catch (N) {
|
|
322
|
+
console.warn("presenceInRoomStanza failed (non-fatal):", N);
|
|
323
|
+
}
|
|
324
|
+
try {
|
|
325
|
+
i.getHistoryStanza(v.jid, 10);
|
|
326
|
+
} catch (N) {
|
|
327
|
+
console.warn("getHistoryStanza failed (non-fatal):", N);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return s(He({ roomJID: v.jid })), u({
|
|
331
|
+
id: Date.now().toString(),
|
|
332
|
+
title: e("toast.success"),
|
|
333
|
+
message: e("toast.roomCreatedSuccess"),
|
|
334
|
+
type: "success",
|
|
335
|
+
duration: 3e3
|
|
336
|
+
}), { jid: v.jid };
|
|
337
|
+
} catch (v) {
|
|
338
|
+
return console.error("Error handling room creation:", v), null;
|
|
339
|
+
}
|
|
340
|
+
}, z = S(async () => {
|
|
341
|
+
const d = String(
|
|
342
|
+
t?.name || `${t?.firstName || ""} ${t?.lastName || ""}`
|
|
343
|
+
).trim() || "";
|
|
344
|
+
if (l?.newArch !== !1) {
|
|
345
|
+
const T = t?.xmppUsername || t?.userJID || t?.id;
|
|
346
|
+
if (!T)
|
|
347
|
+
return u({
|
|
348
|
+
id: Date.now().toString(),
|
|
349
|
+
title: e("toast.error"),
|
|
350
|
+
message: e("toast.couldNotResolveRecipient"),
|
|
351
|
+
type: "error",
|
|
352
|
+
duration: 4e3
|
|
353
|
+
}), null;
|
|
354
|
+
try {
|
|
355
|
+
const j = await ke(T), L = await se(j, 2);
|
|
356
|
+
return L?.jid ? {
|
|
357
|
+
jid: L.jid,
|
|
358
|
+
bareName: L.jid.split("@")[0],
|
|
359
|
+
peerXmppUsername: String(T).split("@")[0],
|
|
360
|
+
peerDisplay: d
|
|
361
|
+
} : null;
|
|
362
|
+
} catch (j) {
|
|
363
|
+
return console.error("postPrivateRoom failed:", j), u({
|
|
364
|
+
id: Date.now().toString(),
|
|
365
|
+
title: e("toast.error"),
|
|
366
|
+
message: j?.message || e("toast.failedToCreatePrivateChat"),
|
|
367
|
+
type: "error",
|
|
368
|
+
duration: 4e3
|
|
369
|
+
}), null;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const p = _(t.id), E = [_(r.defaultWallet.walletAddress), p].sort().join(".").toLowerCase(), G = [r.firstName, t.name?.split(" ")?.[0]].sort().join(" and "), R = await i.createPrivateRoomStanza(
|
|
373
|
+
G,
|
|
374
|
+
`Private chat ${G}`,
|
|
375
|
+
E
|
|
376
|
+
);
|
|
377
|
+
return R && (await i.inviteRoomRequestStanza(p, R), await i.getRoomsStanza()), R ? {
|
|
378
|
+
jid: R,
|
|
379
|
+
bareName: String(R).split("@")[0],
|
|
380
|
+
peerXmppUsername: p,
|
|
381
|
+
peerDisplay: d
|
|
382
|
+
} : null;
|
|
383
|
+
}, [t, l?.newArch, i, r]), K = S(async () => {
|
|
384
|
+
u({
|
|
385
|
+
id: Date.now().toString(),
|
|
386
|
+
title: e("toast.roomCreationTitle"),
|
|
387
|
+
message: e("toast.roomCreating"),
|
|
388
|
+
type: "info",
|
|
389
|
+
duration: 3e3
|
|
390
|
+
}), await z(), s(Q());
|
|
391
|
+
}, [z, s, u, e]), O = S(
|
|
392
|
+
async (d) => {
|
|
393
|
+
const p = await z();
|
|
394
|
+
if (!p) return;
|
|
395
|
+
const v = p.peerDisplay || p.bareName;
|
|
396
|
+
s(
|
|
397
|
+
Ae({
|
|
398
|
+
roomJid: p.jid,
|
|
399
|
+
roomName: v,
|
|
400
|
+
roomBareName: p.bareName,
|
|
401
|
+
kind: d,
|
|
402
|
+
peerXmppUsername: p.peerXmppUsername || null
|
|
403
|
+
})
|
|
404
|
+
), p.peerXmppUsername && Pe(d, {
|
|
405
|
+
peerXmppUsername: p.peerXmppUsername,
|
|
406
|
+
roomBareName: p.bareName
|
|
407
|
+
}), s(Q());
|
|
408
|
+
try {
|
|
409
|
+
await Re(p.bareName, { kind: d });
|
|
410
|
+
} catch (N) {
|
|
411
|
+
const E = N instanceof Error ? N.message : e("toast.failedToCreateCall");
|
|
412
|
+
s(ze(E));
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
[z, s, e]
|
|
416
|
+
), m = t ?? r, ie = () => {
|
|
417
|
+
if (h)
|
|
418
|
+
return Y.find((d) => d.id === h);
|
|
419
|
+
}, le = t ? void 0 : /* @__PURE__ */ f(B, { children: [
|
|
420
|
+
/* @__PURE__ */ o(X, { onClick: ne, "aria-label": e("action.editProfile"), children: /* @__PURE__ */ o(je, { color: "var(--ethora-color-text-muted, #8C8C8C)" }) }),
|
|
421
|
+
/* @__PURE__ */ o(
|
|
422
|
+
Fe,
|
|
423
|
+
{
|
|
424
|
+
options: a,
|
|
425
|
+
position: "left",
|
|
426
|
+
menuIcon: /* @__PURE__ */ o(Be, {})
|
|
427
|
+
}
|
|
428
|
+
)
|
|
429
|
+
] }), ce = /* @__PURE__ */ f(B, { children: [
|
|
430
|
+
/* @__PURE__ */ o(
|
|
431
|
+
X,
|
|
432
|
+
{
|
|
433
|
+
variant: "ghost",
|
|
434
|
+
onClick: () => w(!1),
|
|
435
|
+
style: { width: "auto", padding: "0 var(--ethora-space-3, 12px)" },
|
|
436
|
+
children: e("action.cancel")
|
|
437
|
+
}
|
|
438
|
+
),
|
|
439
|
+
/* @__PURE__ */ o(
|
|
440
|
+
X,
|
|
441
|
+
{
|
|
442
|
+
variant: "filled",
|
|
443
|
+
onClick: () => {
|
|
444
|
+
g.current?.save();
|
|
445
|
+
},
|
|
446
|
+
style: { width: "auto", padding: "0 var(--ethora-space-4, 16px)" },
|
|
447
|
+
children: e("action.save")
|
|
448
|
+
}
|
|
449
|
+
)
|
|
450
|
+
] }), V = t && t.xmppUsername !== r.xmppUsername && !l?.disableProfilesInteractions, de = H(
|
|
451
|
+
() => /* @__PURE__ */ f(B, { children: [
|
|
452
|
+
/* @__PURE__ */ f(re, { children: [
|
|
453
|
+
/* @__PURE__ */ o(
|
|
454
|
+
oe,
|
|
455
|
+
{
|
|
456
|
+
icon: m?.profileImage ?? null,
|
|
457
|
+
name: m?.name ?? m?.firstName,
|
|
458
|
+
size: 96
|
|
459
|
+
}
|
|
460
|
+
),
|
|
461
|
+
/* @__PURE__ */ o(Ve, { children: m?.name ? `${m?.name}` : `${m?.firstName} ${m?.lastName}` })
|
|
462
|
+
] }),
|
|
463
|
+
/* @__PURE__ */ f($, { children: [
|
|
464
|
+
/* @__PURE__ */ o(W, { children: e("modal.profile.about") }),
|
|
465
|
+
/* @__PURE__ */ o(
|
|
466
|
+
Ge,
|
|
467
|
+
{
|
|
468
|
+
$empty: !(m?.description && m?.description?.length > 4),
|
|
469
|
+
children: m?.description && m?.description?.length > 4 ? m.description : e("modal.profile.noDescription")
|
|
470
|
+
}
|
|
471
|
+
)
|
|
472
|
+
] }),
|
|
473
|
+
!t && l?.translates?.enabled && /* @__PURE__ */ f($, { children: [
|
|
474
|
+
/* @__PURE__ */ o(W, { children: e("modal.profile.preferences") }),
|
|
475
|
+
/* @__PURE__ */ o(Xe, { children: /* @__PURE__ */ f(We, { children: [
|
|
476
|
+
/* @__PURE__ */ o(Je, { children: e("modal.profile.languageHint") }),
|
|
477
|
+
/* @__PURE__ */ o(
|
|
478
|
+
io,
|
|
479
|
+
{
|
|
480
|
+
options: Y,
|
|
481
|
+
placeholder: e("language.select"),
|
|
482
|
+
onSelect: P,
|
|
483
|
+
accentColor: l?.colors?.primary,
|
|
484
|
+
selectedValue: ie()
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
] }) })
|
|
488
|
+
] }),
|
|
489
|
+
V && /* @__PURE__ */ f($, { children: [
|
|
490
|
+
/* @__PURE__ */ o(W, { children: e("modal.profile.actions") }),
|
|
491
|
+
/* @__PURE__ */ f(qe, { children: [
|
|
492
|
+
/* @__PURE__ */ o(
|
|
493
|
+
F,
|
|
494
|
+
{
|
|
495
|
+
StartIcon: /* @__PURE__ */ o($e, {}),
|
|
496
|
+
onClick: K,
|
|
497
|
+
variant: "filled",
|
|
498
|
+
children: e("action.message")
|
|
499
|
+
}
|
|
500
|
+
),
|
|
501
|
+
x && /* @__PURE__ */ o(
|
|
502
|
+
F,
|
|
503
|
+
{
|
|
504
|
+
StartIcon: /* @__PURE__ */ o(Oe, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
505
|
+
onClick: () => {
|
|
506
|
+
O("video");
|
|
507
|
+
},
|
|
508
|
+
disabled: n,
|
|
509
|
+
variant: "filled",
|
|
510
|
+
children: e(C ? "action.videoCall" : "action.call")
|
|
511
|
+
}
|
|
512
|
+
),
|
|
513
|
+
C && /* @__PURE__ */ o(
|
|
514
|
+
F,
|
|
515
|
+
{
|
|
516
|
+
StartIcon: /* @__PURE__ */ o(Ee, { color: "var(--ethora-color-text-on-primary, #FFFFFF)" }),
|
|
517
|
+
onClick: () => {
|
|
518
|
+
O("audio");
|
|
519
|
+
},
|
|
520
|
+
disabled: n,
|
|
521
|
+
variant: "filled",
|
|
522
|
+
children: e("action.audioCall")
|
|
523
|
+
}
|
|
524
|
+
),
|
|
525
|
+
/* @__PURE__ */ o(
|
|
526
|
+
F,
|
|
527
|
+
{
|
|
528
|
+
onClick: () => _e(t.id),
|
|
529
|
+
variant: "outlined",
|
|
530
|
+
children: e("action.copyUserId")
|
|
531
|
+
}
|
|
532
|
+
)
|
|
533
|
+
] })
|
|
534
|
+
] })
|
|
535
|
+
] }),
|
|
536
|
+
[
|
|
537
|
+
m,
|
|
538
|
+
x,
|
|
539
|
+
C,
|
|
540
|
+
n,
|
|
541
|
+
O,
|
|
542
|
+
K,
|
|
543
|
+
t,
|
|
544
|
+
V,
|
|
545
|
+
r,
|
|
546
|
+
l,
|
|
547
|
+
h,
|
|
548
|
+
e
|
|
549
|
+
]
|
|
550
|
+
), pe = H(
|
|
551
|
+
() => /* @__PURE__ */ o(
|
|
552
|
+
te,
|
|
553
|
+
{
|
|
554
|
+
ref: g,
|
|
555
|
+
setIsEditing: w,
|
|
556
|
+
modalUser: m,
|
|
557
|
+
config: l
|
|
558
|
+
}
|
|
559
|
+
),
|
|
560
|
+
[m]
|
|
561
|
+
);
|
|
562
|
+
return /* @__PURE__ */ o(
|
|
563
|
+
Ke,
|
|
564
|
+
{
|
|
565
|
+
title: e("modal.profile.title"),
|
|
566
|
+
onClose: A,
|
|
567
|
+
headerActions: b ? ce : le,
|
|
568
|
+
children: b ? pe : de
|
|
569
|
+
}
|
|
570
|
+
);
|
|
571
|
+
};
|
|
572
|
+
export {
|
|
573
|
+
fo as default
|
|
574
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as i, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import m, { useCallback as D, useMemo as h } from "react";
|
|
3
|
-
import { n as g, a as p, o as w, M as r } from "./main-
|
|
4
|
-
import { S as b, D as u, a as k, b as y, c as S, d as f } from "./SideDrawer-
|
|
3
|
+
import { n as g, a as p, o as w, M as r } from "./main-SdAeI1xI.js";
|
|
4
|
+
import { S as b, D as u, a as k, b as y, c as S, d as f } from "./SideDrawer-DWeOHKWM.js";
|
|
5
5
|
const T = ({
|
|
6
6
|
handleCloseModal: l
|
|
7
7
|
}) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as z, jsx as M, Fragment as xi } from "react/jsx-runtime";
|
|
2
2
|
import * as F from "react";
|
|
3
3
|
import { useState as zt, useRef as be, useEffect as ge, useMemo as ln, useCallback as mi } from "react";
|
|
4
|
-
import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as mo, i as $d, j as Xd, r as go, k as Qd, l as Zd, A as vo, V as bo, B as eu } from "./main-
|
|
4
|
+
import { u as Qi, P as Kn, H as Oi, a as Hd, b as zd, s as po, c as Kd, d as Gd, e as fo, f as Jd, g as Yd, h as mo, i as $d, j as Xd, r as go, k as Qd, l as Zd, A as vo, V as bo, B as eu } from "./main-SdAeI1xI.js";
|
|
5
5
|
function tu(n, e) {
|
|
6
6
|
return e.forEach(function(t) {
|
|
7
7
|
t && typeof t != "string" && !Array.isArray(t) && Object.keys(t).forEach(function(i) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as b, useEffect as x } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { S as N, D as C, a as w, b as O, e as S, f as p } from "./SideDrawer-
|
|
3
|
+
import { v as o, a as L, n as P, u as z, aD as D, aE as I } from "./main-SdAeI1xI.js";
|
|
4
|
+
import { S as N, D as C, a as w, b as O, e as S, f as p } from "./SideDrawer-DWeOHKWM.js";
|
|
5
5
|
o.div``;
|
|
6
6
|
o.div`
|
|
7
7
|
font-size: 16px;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { IConfig, IMessage } from '../../types/types';
|
|
3
|
+
interface ChatRoomOpeningPreviewProps {
|
|
4
|
+
seedMessage: IMessage;
|
|
5
|
+
config?: IConfig;
|
|
6
|
+
xmppUsername: string;
|
|
7
|
+
isReply: boolean;
|
|
8
|
+
CustomMessage?: React.ComponentType<{
|
|
9
|
+
message: IMessage;
|
|
10
|
+
isUser: boolean;
|
|
11
|
+
$isUser?: boolean;
|
|
12
|
+
isReply: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Whether history is still on its way. The loader above the seeded message
|
|
16
|
+
* stands in for the rest of the conversation, so it must disappear once the
|
|
17
|
+
* room has settled. Some rooms keep the seed forever: `chats/my` reports a
|
|
18
|
+
* last message while their MAM archive is empty, and a permanent spinner
|
|
19
|
+
* there would promise messages that are never going to arrive.
|
|
20
|
+
*/
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare const ChatRoomOpeningPreview: React.FC<ChatRoomOpeningPreviewProps>;
|
|
24
|
+
export default ChatRoomOpeningPreview;
|
|
@@ -2,4 +2,14 @@ export declare const ChooseChatMessageContainer: import('styled-components/dist/
|
|
|
2
2
|
export declare const ChooseChatMessageContainerBoxText: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
3
|
export declare const ChooseChatTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
4
|
export declare const ChooseChatDescription: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components').FastOmit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
5
|
-
|
|
5
|
+
interface ChooseChatMessageProps {
|
|
6
|
+
/**
|
|
7
|
+
* True when a specific room WAS requested (a QR code, a shared link, a
|
|
8
|
+
* `roomJID` prop) but is not available to this user. Without this the
|
|
9
|
+
* failure rendered as the ordinary "pick a chat" placeholder, so a dead
|
|
10
|
+
* or members-only link looked exactly like an idle chat pane.
|
|
11
|
+
*/
|
|
12
|
+
unavailable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const ChooseChatMessage: ({ unavailable }?: ChooseChatMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -5,5 +5,15 @@ interface ModalProps {
|
|
|
5
5
|
modal?: string;
|
|
6
6
|
setOpenModal: (value?: ModalType) => any;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Host for the store-driven modals that really are centred dialogs: the file
|
|
10
|
+
* preview / lightbox. The profile, user, settings, Manage Data and Visibility
|
|
11
|
+
* panels used to render here too, parked against the right edge of this same
|
|
12
|
+
* full-viewport overlay, which is exactly why they covered the conversation.
|
|
13
|
+
* They are rendered by `SidePanel` instead now, as a column of the chat's own
|
|
14
|
+
* flex row, so opening one shrinks the chat rather than hiding it. This
|
|
15
|
+
* component deliberately renders nothing for those types so they can never be
|
|
16
|
+
* painted twice.
|
|
17
|
+
*/
|
|
8
18
|
declare const Modal: React.FC<ModalProps>;
|
|
9
19
|
export default Modal;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ModalType } from '../../../types/types';
|
|
3
|
+
/**
|
|
4
|
+
* The store-driven modal router, minus any opinion about WHERE the panel is
|
|
5
|
+
* painted.
|
|
6
|
+
*
|
|
7
|
+
* There are two hosts for it now and they place their content very
|
|
8
|
+
* differently: `Modal.tsx` paints a centred dialog on top of everything
|
|
9
|
+
* inside a scrim, while `SidePanel.tsx` paints a column that takes part in
|
|
10
|
+
* the chat's flex row (so opening a profile shrinks the chat instead of
|
|
11
|
+
* covering it). Everything else - which component is open, stepping a
|
|
12
|
+
* settings sub-panel back to Settings, Escape, and moving focus into a
|
|
13
|
+
* lazily-loaded chunk once it actually mounts - is identical, so it lives
|
|
14
|
+
* here once rather than being copied into both hosts.
|
|
15
|
+
*/
|
|
16
|
+
interface ModalContentProps {
|
|
17
|
+
modal: string;
|
|
18
|
+
setOpenModal: (value?: ModalType) => any;
|
|
19
|
+
}
|
|
20
|
+
declare const ModalContent: React.FC<ModalContentProps>;
|
|
21
|
+
export default ModalContent;
|