@linktr.ee/messaging-react 1.28.0 → 1.28.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/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as i, Fragment as he } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import A from "classnames";
|
|
3
3
|
import F, { createContext as ft, useContext as gt, useCallback as U, useState as k, useRef as Q, useEffect as X, useMemo as Le, Suspense as je } from "react";
|
|
4
4
|
import { StreamChatService as xt } from "@linktr.ee/messaging-core";
|
|
5
5
|
import { Chat as bt, ChannelList as Ct, DateSeparator as Nt, useChannelStateContext as Ie, useChatContext as Ke, areMessageUIPropsEqual as pt, useMessageReminder as yt, useComponentContext as vt, Attachment as wt, EditMessageModal as _t, MessageBlocked as Et, MessageBouncePrompt as St, MessageDeleted as It, MessageIsThreadReplyInChannelButtonIndicator as Mt, MessageRepliesCountButton as kt, ReminderNotification as Tt, StreamedMessageText as Dt, messageHasAttachments as Rt, messageHasReactions as At, isDateSeparatorMessage as Lt, isMessageBlocked as Ut, isMessageBounced as Pt, MessageBounceModal as Ft, MessageText as ze, Poll as Ot, MessageErrorIcon as Bt, useMessageContext as Qe, useMessageComposer as Gt, useStateStore as $t, MessageInput as jt, useMessageInputContext as zt, useMessageComposerHasSendableData as Ht, SimpleAttachmentSelector as Vt, QuotedMessagePreview as Yt, AttachmentPreviewList as Wt, TextareaComposer as qt, MessageTimestamp as De, Channel as Zt, WithComponents as Jt, Window as Xt, MessageList as Kt } from "stream-chat-react";
|
|
@@ -153,7 +153,7 @@ const et = ft({
|
|
|
153
153
|
isConnected: C
|
|
154
154
|
});
|
|
155
155
|
}), [c, C, a]);
|
|
156
|
-
const
|
|
156
|
+
const L = U(async () => {
|
|
157
157
|
if (a("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!c,
|
|
159
159
|
hasUser: !!s
|
|
@@ -189,7 +189,7 @@ const et = ft({
|
|
|
189
189
|
isLoading: m,
|
|
190
190
|
error: o,
|
|
191
191
|
capabilities: l,
|
|
192
|
-
refreshConnection:
|
|
192
|
+
refreshConnection: L,
|
|
193
193
|
debug: d
|
|
194
194
|
}), [
|
|
195
195
|
c,
|
|
@@ -198,7 +198,7 @@ const et = ft({
|
|
|
198
198
|
m,
|
|
199
199
|
o,
|
|
200
200
|
l,
|
|
201
|
-
|
|
201
|
+
L,
|
|
202
202
|
d,
|
|
203
203
|
a
|
|
204
204
|
]);
|
|
@@ -305,7 +305,7 @@ function us(t) {
|
|
|
305
305
|
const n = ms(t) % Ze.length;
|
|
306
306
|
return Ze[n];
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const ie = ({
|
|
309
309
|
id: t,
|
|
310
310
|
image: s,
|
|
311
311
|
size: n = 40,
|
|
@@ -320,7 +320,7 @@ const le = ({
|
|
|
320
320
|
return /* @__PURE__ */ i(
|
|
321
321
|
"div",
|
|
322
322
|
{
|
|
323
|
-
className:
|
|
323
|
+
className: A("relative flex-shrink-0", r),
|
|
324
324
|
style: {
|
|
325
325
|
width: `${n}px`,
|
|
326
326
|
height: `${n}px`
|
|
@@ -345,7 +345,7 @@ const le = ({
|
|
|
345
345
|
"div",
|
|
346
346
|
{
|
|
347
347
|
"aria-hidden": "true",
|
|
348
|
-
className:
|
|
348
|
+
className: A(
|
|
349
349
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
350
350
|
g
|
|
351
351
|
),
|
|
@@ -420,13 +420,13 @@ const le = ({
|
|
|
420
420
|
] }) });
|
|
421
421
|
}, at = F.memo(
|
|
422
422
|
({ channel: t, unread: s }) => {
|
|
423
|
-
var
|
|
423
|
+
var L, x, u, f;
|
|
424
424
|
const { selectedChannel: n, onChannelSelect: r, debug: l, renderMessagePreview: d } = is(), a = (n == null ? void 0 : n.id) === (t == null ? void 0 : t.id), c = () => {
|
|
425
425
|
t && r(t);
|
|
426
426
|
}, g = (_) => {
|
|
427
427
|
const p = _.key === "Enter" || _.key === " ", D = _.repeat;
|
|
428
428
|
!p || D || (_.preventDefault(), c());
|
|
429
|
-
}, b = Object.values(((
|
|
429
|
+
}, b = Object.values(((L = t == null ? void 0 : t.state) == null ? void 0 : L.members) || {}).find(
|
|
430
430
|
(_) => {
|
|
431
431
|
var p, D;
|
|
432
432
|
return ((p = _.user) == null ? void 0 : p.id) && _.user.id !== ((D = t == null ? void 0 : t._client) == null ? void 0 : D.userID);
|
|
@@ -458,7 +458,7 @@ const le = ({
|
|
|
458
458
|
tabIndex: 0,
|
|
459
459
|
onClick: c,
|
|
460
460
|
onKeyDown: g,
|
|
461
|
-
className:
|
|
461
|
+
className: A(
|
|
462
462
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
463
463
|
{
|
|
464
464
|
"bg-primary-alt/10 border-l-4 border-l-primary": a,
|
|
@@ -467,7 +467,7 @@ const le = ({
|
|
|
467
467
|
),
|
|
468
468
|
children: /* @__PURE__ */ i("div", { className: "flex items-start gap-3", children: [
|
|
469
469
|
/* @__PURE__ */ e(
|
|
470
|
-
|
|
470
|
+
ie,
|
|
471
471
|
{
|
|
472
472
|
id: ((f = b == null ? void 0 : b.user) == null ? void 0 : f.id) || t.id || "unknown",
|
|
473
473
|
name: C,
|
|
@@ -482,7 +482,7 @@ const le = ({
|
|
|
482
482
|
/* @__PURE__ */ i(
|
|
483
483
|
"h3",
|
|
484
484
|
{
|
|
485
|
-
className:
|
|
485
|
+
className: A(
|
|
486
486
|
"text-sm font-medium truncate",
|
|
487
487
|
a ? "text-primary" : "text-charcoal"
|
|
488
488
|
),
|
|
@@ -539,7 +539,7 @@ const Cs = { last_message_at: -1 }, rt = F.memo(
|
|
|
539
539
|
return /* @__PURE__ */ e(
|
|
540
540
|
"div",
|
|
541
541
|
{
|
|
542
|
-
className:
|
|
542
|
+
className: A(
|
|
543
543
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
544
544
|
g
|
|
545
545
|
),
|
|
@@ -572,7 +572,7 @@ const we = ({
|
|
|
572
572
|
"button",
|
|
573
573
|
{
|
|
574
574
|
type: "button",
|
|
575
|
-
className:
|
|
575
|
+
className: A(
|
|
576
576
|
"flex w-full items-center gap-3 rounded-lg px-4 py-3 text-left text-sm transition-colors focus-ring disabled:cursor-not-allowed disabled:opacity-60",
|
|
577
577
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
578
578
|
s
|
|
@@ -586,7 +586,7 @@ function ot({ label: t, className: s, children: n, ...r }) {
|
|
|
586
586
|
"button",
|
|
587
587
|
{
|
|
588
588
|
type: "button",
|
|
589
|
-
className:
|
|
589
|
+
className: A(
|
|
590
590
|
"rounded-full p-2 transition-colors focus-ring",
|
|
591
591
|
{
|
|
592
592
|
"cursor-not-allowed opacity-50": r.disabled,
|
|
@@ -620,8 +620,8 @@ const Ns = ({
|
|
|
620
620
|
customProfileContent: C,
|
|
621
621
|
customChannelActions: E
|
|
622
622
|
}) => {
|
|
623
|
-
var Z, J, P, V, z,
|
|
624
|
-
const { service: m, debug: S } = Me(), [o, y] = k(!1), [M, N] = k(!1), [v, w] = k(!1),
|
|
623
|
+
var Z, J, P, V, z, ce, de;
|
|
624
|
+
const { service: m, debug: S } = Me(), [o, y] = k(!1), [M, N] = k(!1), [v, w] = k(!1), L = U(async () => {
|
|
625
625
|
var R;
|
|
626
626
|
if (!(!m || !((R = n == null ? void 0 : n.user) != null && R.id)))
|
|
627
627
|
try {
|
|
@@ -640,8 +640,8 @@ const Ns = ({
|
|
|
640
640
|
}
|
|
641
641
|
}, [m, (Z = n == null ? void 0 : n.user) == null ? void 0 : Z.id]);
|
|
642
642
|
X(() => {
|
|
643
|
-
|
|
644
|
-
}, [
|
|
643
|
+
L();
|
|
644
|
+
}, [L]);
|
|
645
645
|
const x = async () => {
|
|
646
646
|
var R;
|
|
647
647
|
if (!M) {
|
|
@@ -687,7 +687,7 @@ const Ns = ({
|
|
|
687
687
|
);
|
|
688
688
|
};
|
|
689
689
|
if (!n) return null;
|
|
690
|
-
const p = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (
|
|
690
|
+
const p = ((J = n.user) == null ? void 0 : J.name) || ((P = n.user) == null ? void 0 : P.id) || "Unknown member", D = (V = n.user) == null ? void 0 : V.image, G = (z = n.user) == null ? void 0 : z.email, T = (ce = n.user) == null ? void 0 : ce.username, $ = G || (T ? `linktr.ee/${T}` : void 0), se = ((de = n.user) == null ? void 0 : de.id) || "unknown";
|
|
691
691
|
return (
|
|
692
692
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
|
|
693
693
|
/* @__PURE__ */ e(
|
|
@@ -712,7 +712,7 @@ const Ns = ({
|
|
|
712
712
|
style: { backgroundColor: "#FBFAF9" },
|
|
713
713
|
children: /* @__PURE__ */ i("div", { className: "flex items-center gap-3 w-full", children: [
|
|
714
714
|
/* @__PURE__ */ e(
|
|
715
|
-
|
|
715
|
+
ie,
|
|
716
716
|
{
|
|
717
717
|
id: se,
|
|
718
718
|
name: p,
|
|
@@ -875,7 +875,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
875
875
|
}
|
|
876
876
|
)
|
|
877
877
|
] }), ks = (t) => {
|
|
878
|
-
var ge, xe, be,
|
|
878
|
+
var ge, xe, be, le, K, Ce, Ne, pe;
|
|
879
879
|
const {
|
|
880
880
|
additionalMessageInputProps: s,
|
|
881
881
|
chatbotVotingEnabled: n,
|
|
@@ -894,7 +894,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
894
894
|
message: o,
|
|
895
895
|
renderText: y,
|
|
896
896
|
threadList: M
|
|
897
|
-
} = t, { client: N } = Ke("CustomMessage"), { channel: v } = Ie("CustomMessage"), [w,
|
|
897
|
+
} = t, { client: N } = Ke("CustomMessage"), { channel: v } = Ie("CustomMessage"), [w, L] = k(!1), x = yt(o.id), { selected: u, voteUp: f, voteDown: _ } = vs(o), {
|
|
898
898
|
Attachment: p = wt,
|
|
899
899
|
EditMessageModal: D = _t,
|
|
900
900
|
MessageBlocked: G = Et,
|
|
@@ -905,7 +905,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
905
905
|
ReminderNotification: J = Tt,
|
|
906
906
|
StreamedMessageText: P = Dt,
|
|
907
907
|
PinIndicator: V
|
|
908
|
-
} = vt("CustomMessage"), z = Rt(o),
|
|
908
|
+
} = vt("CustomMessage"), z = Rt(o), ce = At(o), de = Le(
|
|
909
909
|
() => m == null ? void 0 : m(o),
|
|
910
910
|
[m, o]
|
|
911
911
|
), R = Le(
|
|
@@ -920,25 +920,25 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
920
920
|
return /* @__PURE__ */ e(G, {});
|
|
921
921
|
const O = !M && !!o.reply_count, Y = !M && o.show_in_channel && o.parent_id, W = o.status === "failed" && ((ge = o.error) == null ? void 0 : ge.status) !== 403, ne = Pt(o);
|
|
922
922
|
let ee;
|
|
923
|
-
W ? ee = () => C(o) : ne && (ee = () =>
|
|
924
|
-
const
|
|
923
|
+
W ? ee = () => C(o) : ne && (ee = () => L(!0));
|
|
924
|
+
const ae = S(), Ge = A(
|
|
925
925
|
"str-chat__message str-chat__message-simple",
|
|
926
926
|
`str-chat__message--${o.type}`,
|
|
927
927
|
`str-chat__message--${o.status}`,
|
|
928
|
-
|
|
928
|
+
ae ? "str-chat__message--me str-chat__message-simple--me" : "str-chat__message--other",
|
|
929
929
|
o.text ? "str-chat__message--has-text" : "has-no-text",
|
|
930
930
|
{
|
|
931
931
|
"str-chat__message--has-attachment": z,
|
|
932
932
|
"str-chat__message--highlighted": E,
|
|
933
933
|
"str-chat__message--pinned pinned-message": o.pinned,
|
|
934
|
-
"str-chat__message--with-reactions":
|
|
934
|
+
"str-chat__message--with-reactions": ce,
|
|
935
935
|
"str-chat__message-send-can-be-retried": (o == null ? void 0 : o.status) === "failed" && ((xe = o == null ? void 0 : o.error) == null ? void 0 : xe.status) !== 403,
|
|
936
936
|
"str-chat__message-with-thread-link": O || Y,
|
|
937
937
|
"str-chat__virtual-message__wrapper--end": a,
|
|
938
938
|
"str-chat__virtual-message__wrapper--first": c,
|
|
939
939
|
"str-chat__virtual-message__wrapper--group": g
|
|
940
940
|
}
|
|
941
|
-
), q = o.poll_id && N.polls.fromState(o.poll_id), me = bs(o),
|
|
941
|
+
), q = o.poll_id && N.polls.fromState(o.poll_id), me = bs(o), re = Be(o), oe = xs(o), te = !!(R != null && R.length && !o.quoted_message), fe = re && ae && te;
|
|
942
942
|
return /* @__PURE__ */ i(he, { children: [
|
|
943
943
|
d && /* @__PURE__ */ e(
|
|
944
944
|
D,
|
|
@@ -950,7 +950,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
950
950
|
Ft,
|
|
951
951
|
{
|
|
952
952
|
MessageBouncePrompt: T,
|
|
953
|
-
onClose: () =>
|
|
953
|
+
onClose: () => L(!1),
|
|
954
954
|
open: w
|
|
955
955
|
}
|
|
956
956
|
),
|
|
@@ -958,7 +958,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
958
958
|
V && /* @__PURE__ */ e(V, {}),
|
|
959
959
|
!!x && /* @__PURE__ */ e(J, { reminder: x }),
|
|
960
960
|
o.user && /* @__PURE__ */ e(
|
|
961
|
-
|
|
961
|
+
ie,
|
|
962
962
|
{
|
|
963
963
|
className: "str-chat__avatar str-chat__message-sender-avatar",
|
|
964
964
|
id: o.user.id,
|
|
@@ -969,7 +969,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
969
969
|
/* @__PURE__ */ e(
|
|
970
970
|
"div",
|
|
971
971
|
{
|
|
972
|
-
className:
|
|
972
|
+
className: A("str-chat__message-inner", {
|
|
973
973
|
"str-chat__simple-message--error-failed": W || ne
|
|
974
974
|
}),
|
|
975
975
|
"data-testid": "message-inner",
|
|
@@ -983,12 +983,12 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
983
983
|
marginInlineEnd: 0,
|
|
984
984
|
marginInlineStart: 0
|
|
985
985
|
},
|
|
986
|
-
children:
|
|
986
|
+
children: oe ? /* @__PURE__ */ i("div", { className: A("flex flex-col gap-1", ae ? "items-end" : "items-start"), children: [
|
|
987
987
|
/* @__PURE__ */ e(
|
|
988
988
|
Es,
|
|
989
989
|
{
|
|
990
990
|
title: (be = o.metadata) == null ? void 0 : be.attachment_title,
|
|
991
|
-
mimeType: (
|
|
991
|
+
mimeType: (le = o.metadata) == null ? void 0 : le.attachment_mime_type,
|
|
992
992
|
thumbnail: (K = o.metadata) == null ? void 0 : K.attachment_thumbnail,
|
|
993
993
|
amountText: (Ce = o.metadata) == null ? void 0 : Ce.amount_text,
|
|
994
994
|
detail: (Ne = o.metadata) == null ? void 0 : Ne.attachment_detail,
|
|
@@ -1003,12 +1003,12 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1003
1003
|
/* @__PURE__ */ e(Re, { message: o, standalone: !0 })
|
|
1004
1004
|
) : /* @__PURE__ */ i("div", { className: "str-chat__message-bubble-wrapper", children: [
|
|
1005
1005
|
/* @__PURE__ */ i("div", { className: "str-chat__message-bubble", children: [
|
|
1006
|
-
|
|
1006
|
+
re && !fe && /* @__PURE__ */ e(
|
|
1007
1007
|
Re,
|
|
1008
1008
|
{
|
|
1009
1009
|
message: o,
|
|
1010
1010
|
hasAttachment: te,
|
|
1011
|
-
isMyMessage:
|
|
1011
|
+
isMyMessage: ae
|
|
1012
1012
|
}
|
|
1013
1013
|
),
|
|
1014
1014
|
q && /* @__PURE__ */ e(Ot, { poll: q }),
|
|
@@ -1019,7 +1019,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1019
1019
|
attachments: R
|
|
1020
1020
|
}
|
|
1021
1021
|
) : null,
|
|
1022
|
-
|
|
1022
|
+
de ? /* @__PURE__ */ e(
|
|
1023
1023
|
P,
|
|
1024
1024
|
{
|
|
1025
1025
|
message: o,
|
|
@@ -1028,15 +1028,15 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1028
1028
|
) : /* @__PURE__ */ e(ze, { message: o, renderText: y }),
|
|
1029
1029
|
/* @__PURE__ */ e(Bt, {})
|
|
1030
1030
|
] }),
|
|
1031
|
-
(!
|
|
1031
|
+
(!re || fe) && /* @__PURE__ */ e(
|
|
1032
1032
|
Re,
|
|
1033
1033
|
{
|
|
1034
1034
|
message: o,
|
|
1035
1035
|
hasAttachment: te,
|
|
1036
|
-
isMyMessage:
|
|
1036
|
+
isMyMessage: ae
|
|
1037
1037
|
}
|
|
1038
1038
|
),
|
|
1039
|
-
n &&
|
|
1039
|
+
n && re && /* @__PURE__ */ e(
|
|
1040
1040
|
Ms,
|
|
1041
1041
|
{
|
|
1042
1042
|
selected: u,
|
|
@@ -1276,7 +1276,7 @@ const ws = F.lazy(() => import("./Creator-VyMyIk2b.js")), _s = F.lazy(() => impo
|
|
|
1276
1276
|
}, Ys = () => null, Ws = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1277
1277
|
"div",
|
|
1278
1278
|
{
|
|
1279
|
-
className:
|
|
1279
|
+
className: A("flex items-center justify-center h-full", t),
|
|
1280
1280
|
children: [
|
|
1281
1281
|
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1282
1282
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1359,7 +1359,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1359
1359
|
) }),
|
|
1360
1360
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
1361
1361
|
/* @__PURE__ */ e(
|
|
1362
|
-
|
|
1362
|
+
ie,
|
|
1363
1363
|
{
|
|
1364
1364
|
id: ((S = a == null ? void 0 : a.user) == null ? void 0 : S.id) || d.id || "unknown",
|
|
1365
1365
|
name: c,
|
|
@@ -1381,7 +1381,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1381
1381
|
children: /* @__PURE__ */ e(
|
|
1382
1382
|
Ue,
|
|
1383
1383
|
{
|
|
1384
|
-
className:
|
|
1384
|
+
className: A("size-5", {
|
|
1385
1385
|
"text-yellow-600": h,
|
|
1386
1386
|
"text-black/90": !h
|
|
1387
1387
|
}),
|
|
@@ -1415,7 +1415,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1415
1415
|
}
|
|
1416
1416
|
),
|
|
1417
1417
|
/* @__PURE__ */ e(
|
|
1418
|
-
|
|
1418
|
+
ie,
|
|
1419
1419
|
{
|
|
1420
1420
|
id: ((o = a == null ? void 0 : a.user) == null ? void 0 : o.id) || d.id || "unknown",
|
|
1421
1421
|
name: c,
|
|
@@ -1437,7 +1437,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1437
1437
|
children: /* @__PURE__ */ e(
|
|
1438
1438
|
Ue,
|
|
1439
1439
|
{
|
|
1440
|
-
className:
|
|
1440
|
+
className: A("size-5", {
|
|
1441
1441
|
"text-yellow-600": h,
|
|
1442
1442
|
"text-black/90": !h
|
|
1443
1443
|
}),
|
|
@@ -1484,7 +1484,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1484
1484
|
var p;
|
|
1485
1485
|
return ((p = _.user) == null ? void 0 : p.id) && _.user.id !== N._client.userID;
|
|
1486
1486
|
}
|
|
1487
|
-
), [N._client.userID, N.state.members]),
|
|
1487
|
+
), [N._client.userID, N.state.members]), L = F.useMemo(() => {
|
|
1488
1488
|
const f = N.data ?? {};
|
|
1489
1489
|
if (f.followerStatus)
|
|
1490
1490
|
return String(f.followerStatus);
|
|
@@ -1552,7 +1552,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1552
1552
|
onClose: u,
|
|
1553
1553
|
participant: w,
|
|
1554
1554
|
channel: N,
|
|
1555
|
-
followerStatusLabel:
|
|
1555
|
+
followerStatusLabel: L,
|
|
1556
1556
|
onLeaveConversation: l,
|
|
1557
1557
|
onBlockParticipant: d,
|
|
1558
1558
|
showDeleteConversation: a,
|
|
@@ -1587,7 +1587,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1587
1587
|
onAttachmentUnlock: N,
|
|
1588
1588
|
onAttachmentDownload: v,
|
|
1589
1589
|
renderChannelBanner: w,
|
|
1590
|
-
customProfileContent:
|
|
1590
|
+
customProfileContent: L,
|
|
1591
1591
|
customChannelActions: x,
|
|
1592
1592
|
renderMessage: u
|
|
1593
1593
|
}) => {
|
|
@@ -1614,7 +1614,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1614
1614
|
return /* @__PURE__ */ e(
|
|
1615
1615
|
"div",
|
|
1616
1616
|
{
|
|
1617
|
-
className:
|
|
1617
|
+
className: A(
|
|
1618
1618
|
"messaging-channel-view h-full flex flex-col",
|
|
1619
1619
|
c
|
|
1620
1620
|
),
|
|
@@ -1646,7 +1646,7 @@ const ue = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1646
1646
|
onAttachmentUnlock: N,
|
|
1647
1647
|
onAttachmentDownload: v,
|
|
1648
1648
|
renderChannelBanner: w,
|
|
1649
|
-
customProfileContent:
|
|
1649
|
+
customProfileContent: L,
|
|
1650
1650
|
customChannelActions: x,
|
|
1651
1651
|
renderMessage: u
|
|
1652
1652
|
}
|
|
@@ -1756,10 +1756,10 @@ const Xs = ({
|
|
|
1756
1756
|
}
|
|
1757
1757
|
},
|
|
1758
1758
|
[s, y]
|
|
1759
|
-
),
|
|
1759
|
+
), L = (x, u) => {
|
|
1760
1760
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), w(u));
|
|
1761
1761
|
};
|
|
1762
|
-
return /* @__PURE__ */ i("div", { className:
|
|
1762
|
+
return /* @__PURE__ */ i("div", { className: A("flex flex-col h-full", a), children: [
|
|
1763
1763
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1764
1764
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1765
1765
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
@@ -1807,12 +1807,12 @@ const Xs = ({
|
|
|
1807
1807
|
{
|
|
1808
1808
|
type: "button",
|
|
1809
1809
|
onClick: () => w(x),
|
|
1810
|
-
onKeyDown: (_) =>
|
|
1810
|
+
onKeyDown: (_) => L(_, x),
|
|
1811
1811
|
className: "w-full px-4 py-3 hover:bg-sand transition-colors border-b border-sand text-left focus-ring",
|
|
1812
1812
|
children: /* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
1813
1813
|
/* @__PURE__ */ i("div", { className: "flex items-center space-x-3 flex-1 min-w-0", children: [
|
|
1814
1814
|
/* @__PURE__ */ e(
|
|
1815
|
-
|
|
1815
|
+
ie,
|
|
1816
1816
|
{
|
|
1817
1817
|
id: x.id,
|
|
1818
1818
|
name: u,
|
|
@@ -2017,7 +2017,7 @@ const cn = ({
|
|
|
2017
2017
|
onMessageSent: N,
|
|
2018
2018
|
showStarButton: v = !1,
|
|
2019
2019
|
chatbotVotingEnabled: w = !1,
|
|
2020
|
-
renderMessagePreview:
|
|
2020
|
+
renderMessagePreview: L,
|
|
2021
2021
|
renderChannelBanner: x,
|
|
2022
2022
|
customProfileContent: u,
|
|
2023
2023
|
customChannelActions: f,
|
|
@@ -2033,7 +2033,7 @@ const cn = ({
|
|
|
2033
2033
|
error: Z,
|
|
2034
2034
|
refreshConnection: J,
|
|
2035
2035
|
debug: P
|
|
2036
|
-
} = os(), [V, z] = k(null), [
|
|
2036
|
+
} = os(), [V, z] = k(null), [ce, de] = k(!1), [R, O] = k(!1), [Y, W] = k(!1), [ne, ee] = k(/* @__PURE__ */ new Set()), [ae, Ge] = k(0), [q, me] = k(!1), [re, oe] = k(null), te = Q(null), {
|
|
2037
2037
|
participantSource: fe,
|
|
2038
2038
|
participantLabel: ge = "participants",
|
|
2039
2039
|
showDeleteConversation: xe = !0
|
|
@@ -2050,7 +2050,7 @@ const cn = ({
|
|
|
2050
2050
|
},
|
|
2051
2051
|
...b
|
|
2052
2052
|
};
|
|
2053
|
-
}, [b, T == null ? void 0 : T.userID]),
|
|
2053
|
+
}, [b, T == null ? void 0 : T.userID]), le = Q(null), K = U(async () => {
|
|
2054
2054
|
if (!T || !$) return;
|
|
2055
2055
|
const I = T.userID;
|
|
2056
2056
|
if (I)
|
|
@@ -2071,7 +2071,7 @@ const cn = ({
|
|
|
2071
2071
|
const Te = ($e = ht.user) == null ? void 0 : $e.id;
|
|
2072
2072
|
Te && Te !== I && B.add(Te);
|
|
2073
2073
|
});
|
|
2074
|
-
}), ee((j) => j.size === B.size && [...j].every((ke) => B.has(ke)) ? j : B),
|
|
2074
|
+
}), ee((j) => j.size === B.size && [...j].every((ke) => B.has(ke)) ? j : B), de(H.length > 0), O(!0), le.current = I, P && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2075
2075
|
channelCount: H.length,
|
|
2076
2076
|
memberCount: B.size
|
|
2077
2077
|
});
|
|
@@ -2082,7 +2082,7 @@ const cn = ({
|
|
|
2082
2082
|
X(() => {
|
|
2083
2083
|
if (!T || !$) return;
|
|
2084
2084
|
const I = T.userID;
|
|
2085
|
-
I &&
|
|
2085
|
+
I && le.current !== I && K();
|
|
2086
2086
|
}, [T, $, K]), X(() => {
|
|
2087
2087
|
if (!a || !T || !$) return;
|
|
2088
2088
|
(async () => {
|
|
@@ -2102,7 +2102,7 @@ const cn = ({
|
|
|
2102
2102
|
{ limit: 1 }
|
|
2103
2103
|
);
|
|
2104
2104
|
if (B.length > 0)
|
|
2105
|
-
z(B[0]), me(!0),
|
|
2105
|
+
z(B[0]), me(!0), oe(null), l && l(B[0]), P && console.log(
|
|
2106
2106
|
"[MessagingShell] Initial conversation loaded:",
|
|
2107
2107
|
B[0].id
|
|
2108
2108
|
);
|
|
@@ -2118,7 +2118,7 @@ const cn = ({
|
|
|
2118
2118
|
email: c.email,
|
|
2119
2119
|
phone: c.phone
|
|
2120
2120
|
});
|
|
2121
|
-
z(j), me(!0),
|
|
2121
|
+
z(j), me(!0), oe(null), l && l(j), P && console.log(
|
|
2122
2122
|
"[MessagingShell] Channel created and loaded:",
|
|
2123
2123
|
j.id
|
|
2124
2124
|
);
|
|
@@ -2126,10 +2126,10 @@ const cn = ({
|
|
|
2126
2126
|
console.error(
|
|
2127
2127
|
"[MessagingShell] Failed to create conversation:",
|
|
2128
2128
|
j
|
|
2129
|
-
),
|
|
2129
|
+
), oe("Failed to create conversation");
|
|
2130
2130
|
}
|
|
2131
2131
|
} else
|
|
2132
|
-
|
|
2132
|
+
oe(
|
|
2133
2133
|
"No conversation found with this account"
|
|
2134
2134
|
), P && console.log(
|
|
2135
2135
|
"[MessagingShell] No conversation found for:",
|
|
@@ -2139,7 +2139,7 @@ const cn = ({
|
|
|
2139
2139
|
console.error(
|
|
2140
2140
|
"[MessagingShell] Failed to load initial conversation:",
|
|
2141
2141
|
B
|
|
2142
|
-
),
|
|
2142
|
+
), oe("Failed to load conversation");
|
|
2143
2143
|
}
|
|
2144
2144
|
})();
|
|
2145
2145
|
}, [
|
|
@@ -2194,25 +2194,25 @@ const cn = ({
|
|
|
2194
2194
|
[ye]
|
|
2195
2195
|
), mt = U(
|
|
2196
2196
|
async (I) => {
|
|
2197
|
-
P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1),
|
|
2197
|
+
P && console.log("[MessagingShell] Leaving conversation:", I.id), z(null), me(!1), le.current = null, await K();
|
|
2198
2198
|
},
|
|
2199
2199
|
[K, P]
|
|
2200
2200
|
), ut = U(
|
|
2201
2201
|
async (I) => {
|
|
2202
|
-
P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1),
|
|
2202
|
+
P && console.log("[MessagingShell] Blocking participant:", I), z(null), me(!1), le.current = null, await K();
|
|
2203
2203
|
},
|
|
2204
2204
|
[K, P]
|
|
2205
2205
|
), ve = !!V;
|
|
2206
|
-
return se ? /* @__PURE__ */ e("div", { className:
|
|
2206
|
+
return se ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Se, {}) }) : Z ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ee, { message: Z, onBack: J }) }) : !$ || !T ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(
|
|
2207
2207
|
Ee,
|
|
2208
2208
|
{
|
|
2209
2209
|
message: "Not connected to messaging service",
|
|
2210
2210
|
onBack: J
|
|
2211
2211
|
}
|
|
2212
|
-
) }) :
|
|
2212
|
+
) }) : re ? /* @__PURE__ */ e("div", { className: A("h-full", s), children: /* @__PURE__ */ e(Ee, { message: re }) }) : /* @__PURE__ */ i(
|
|
2213
2213
|
"div",
|
|
2214
2214
|
{
|
|
2215
|
-
className:
|
|
2215
|
+
className: A(
|
|
2216
2216
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2217
2217
|
s
|
|
2218
2218
|
),
|
|
@@ -2221,7 +2221,7 @@ const cn = ({
|
|
|
2221
2221
|
/* @__PURE__ */ e(
|
|
2222
2222
|
"div",
|
|
2223
2223
|
{
|
|
2224
|
-
className:
|
|
2224
|
+
className: A(
|
|
2225
2225
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2226
2226
|
{
|
|
2227
2227
|
"!hidden": h === !1 || q,
|
|
@@ -2239,7 +2239,7 @@ const cn = ({
|
|
|
2239
2239
|
filters: be,
|
|
2240
2240
|
channelRenderFilterFn: C,
|
|
2241
2241
|
customEmptyStateIndicator: E,
|
|
2242
|
-
renderMessagePreview:
|
|
2242
|
+
renderMessagePreview: L
|
|
2243
2243
|
}
|
|
2244
2244
|
)
|
|
2245
2245
|
}
|
|
@@ -2247,7 +2247,7 @@ const cn = ({
|
|
|
2247
2247
|
/* @__PURE__ */ e(
|
|
2248
2248
|
"div",
|
|
2249
2249
|
{
|
|
2250
|
-
className:
|
|
2250
|
+
className: A(
|
|
2251
2251
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2252
2252
|
{
|
|
2253
2253
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
@@ -2290,7 +2290,7 @@ const cn = ({
|
|
|
2290
2290
|
) : /* @__PURE__ */ e(
|
|
2291
2291
|
ct,
|
|
2292
2292
|
{
|
|
2293
|
-
hasChannels:
|
|
2293
|
+
hasChannels: ce,
|
|
2294
2294
|
channelsLoaded: R
|
|
2295
2295
|
}
|
|
2296
2296
|
)
|
|
@@ -2315,7 +2315,7 @@ const cn = ({
|
|
|
2315
2315
|
participantLabel: ge,
|
|
2316
2316
|
searchPlaceholder: `Search ${ge}...`
|
|
2317
2317
|
},
|
|
2318
|
-
|
|
2318
|
+
ae
|
|
2319
2319
|
) })
|
|
2320
2320
|
}
|
|
2321
2321
|
)
|
|
@@ -2334,7 +2334,7 @@ const cn = ({
|
|
|
2334
2334
|
onClick: s,
|
|
2335
2335
|
disabled: n,
|
|
2336
2336
|
style: { backgroundColor: "#E6E5E3" },
|
|
2337
|
-
className:
|
|
2337
|
+
className: A(
|
|
2338
2338
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2339
2339
|
{
|
|
2340
2340
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2356,7 +2356,7 @@ const cn = ({
|
|
|
2356
2356
|
const c = t.filter((g) => g.enabled).sort((g, h) => (g.order ?? 0) - (h.order ?? 0));
|
|
2357
2357
|
return c.length === 0 ? null : /* @__PURE__ */ e("div", { className: l, children: /* @__PURE__ */ i("div", { className: "flex gap-3 items-end", children: [
|
|
2358
2358
|
(d || a) && /* @__PURE__ */ e("div", { className: "flex-none", children: /* @__PURE__ */ e(
|
|
2359
|
-
|
|
2359
|
+
ie,
|
|
2360
2360
|
{
|
|
2361
2361
|
id: a || "account",
|
|
2362
2362
|
name: a || "Account",
|
|
@@ -2386,9 +2386,9 @@ const cn = ({
|
|
|
2386
2386
|
)
|
|
2387
2387
|
] }) });
|
|
2388
2388
|
}, mn = (t, s = {}) => {
|
|
2389
|
-
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [E, m] = k(!0), [S, o] = k(), y = U(async (w = !1,
|
|
2389
|
+
const { initialSearch: n = "", pageSize: r = 20 } = s, [l, d] = k([]), [a, c] = k(!1), [g, h] = k(null), [b, C] = k(n), [E, m] = k(!0), [S, o] = k(), y = U(async (w = !1, L) => {
|
|
2390
2390
|
if (a) return;
|
|
2391
|
-
const x =
|
|
2391
|
+
const x = L !== void 0 ? L : b;
|
|
2392
2392
|
c(!0), h(null);
|
|
2393
2393
|
try {
|
|
2394
2394
|
const u = await t.loadParticipants({
|
|
@@ -2428,7 +2428,7 @@ const cn = ({
|
|
|
2428
2428
|
};
|
|
2429
2429
|
export {
|
|
2430
2430
|
we as ActionButton,
|
|
2431
|
-
|
|
2431
|
+
ie as Avatar,
|
|
2432
2432
|
Ys as ChannelEmptyState,
|
|
2433
2433
|
rt as ChannelList,
|
|
2434
2434
|
it as ChannelView,
|