@linktr.ee/messaging-react 1.35.0-rc-1777517685 → 1.35.0
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/{Card-CZKDL56E.js → Card-DVzWMbDc.js} +2 -2
- package/dist/{Card-CZKDL56E.js.map → Card-DVzWMbDc.js.map} +1 -1
- package/dist/{Card-CH2whznD.js → Card-lN2Z0Z5p.js} +2 -2
- package/dist/{Card-CH2whznD.js.map → Card-lN2Z0Z5p.js.map} +1 -1
- package/dist/{index-BJxgpf27.js → index-BsSqs61X.js} +70 -70
- package/dist/index-BsSqs61X.js.map +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/ChannelList/CustomChannelPreview.stories.tsx +16 -0
- package/src/components/CustomTypingIndicator/index.tsx +3 -3
- package/dist/index-BJxgpf27.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as c, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import z, { createContext as ot, useContext as ct, useCallback as
|
|
2
|
+
import O from "classnames";
|
|
3
|
+
import z, { createContext as ot, useContext as ct, useCallback as A, useState as k, useRef as X, useEffect as q, useMemo as Be, Suspense as dt } from "react";
|
|
4
4
|
import { StreamChatService as Dt } from "@linktr.ee/messaging-core";
|
|
5
|
-
import { Chat as Rt, ChannelList as Pt, DateSeparator as Lt, useChannelStateContext as me, useChatContext as Ye, areMessageUIPropsEqual as Ft, useMessageReminder as
|
|
5
|
+
import { Chat as Rt, ChannelList as Pt, DateSeparator as Lt, useChannelStateContext as me, useChatContext as Ye, areMessageUIPropsEqual as Ft, useMessageReminder as At, useComponentContext as ut, Attachment as Ot, EditMessageModal as Ut, MessageBlocked as $t, MessageBouncePrompt as zt, MessageDeleted as Bt, MessageIsThreadReplyInChannelButtonIndicator as jt, MessageRepliesCountButton as Gt, ReminderNotification as Vt, StreamedMessageText as Ht, messageHasAttachments as Yt, messageHasReactions as Wt, isDateSeparatorMessage as qt, isMessageBlocked as Zt, isMessageBounced as Xt, MessageBounceModal as Kt, MessageText as Ke, Poll as Jt, MessageErrorIcon as Qt, useMessageContext as mt, useMessageComposer as es, useStateStore as ts, MessageInput as ss, useMessageInputContext as ns, useMessageComposerHasSendableData as as, SimpleAttachmentSelector as rs, QuotedMessagePreview as is, AttachmentPreviewList as ls, TextareaComposer as os, MessageTimestamp as Oe, useTypingContext as cs, Channel as ds, WithComponents as us, Window as ms, MessageList as hs } from "stream-chat-react";
|
|
6
6
|
import { StarIcon as je, GiftIcon as fs, XIcon as Re, SpinnerGapIcon as ke, SignOutIcon as gs, ProhibitInsetIcon as Je, FlagIcon as bs, ArrowUpIcon as ps, SparkleIcon as xs, ProhibitIcon as vs, ArrowLeftIcon as Qe, CaretRightIcon as et, DotsThreeIcon as tt, MagnifyingGlassIcon as ws, ChatCircleDotsIcon as st, FileIcon as ht, ImageIcon as Ns, SpeakerHighIcon as ys, VideoCameraIcon as Cs, FileMdIcon as _s, FileTextIcon as Es, FileZipIcon as Ss, FilePptIcon as Is, FileCsvIcon as ks, FileXlsIcon as Ts, FileDocIcon as Ms, FilePdfIcon as Ds, CircleNotchIcon as ft, PlayIcon as nt, PauseIcon as Rs, LinkIcon as Ps, DownloadSimpleIcon as Ls } from "@phosphor-icons/react";
|
|
7
7
|
import { LinkPreviewsManager as at } from "stream-chat";
|
|
8
8
|
const gt = ot({
|
|
@@ -23,7 +23,7 @@ const gt = ot({
|
|
|
23
23
|
capabilities: l = {},
|
|
24
24
|
debug: u = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const r =
|
|
26
|
+
const r = A(
|
|
27
27
|
(m, ...b) => {
|
|
28
28
|
u && console.log(`🔥 [MessagingProvider] ${m}`, ...b);
|
|
29
29
|
},
|
|
@@ -153,7 +153,7 @@ const gt = ot({
|
|
|
153
153
|
isConnected: f
|
|
154
154
|
});
|
|
155
155
|
}), [d, f, r]);
|
|
156
|
-
const L =
|
|
156
|
+
const L = A(async () => {
|
|
157
157
|
if (r("🔄 REFRESH CONNECTION CALLED", {
|
|
158
158
|
hasService: !!d,
|
|
159
159
|
hasUser: !!s
|
|
@@ -217,7 +217,7 @@ const gt = ot({
|
|
|
217
217
|
}
|
|
218
218
|
) : t });
|
|
219
219
|
}, Fs = () => Pe();
|
|
220
|
-
function
|
|
220
|
+
function As(t) {
|
|
221
221
|
const s = t.state.pending_messages;
|
|
222
222
|
if (s != null && s.length)
|
|
223
223
|
for (const n of s)
|
|
@@ -229,7 +229,7 @@ const bt = z.createContext({
|
|
|
229
229
|
},
|
|
230
230
|
debug: !1,
|
|
231
231
|
renderMessagePreview: void 0
|
|
232
|
-
}),
|
|
232
|
+
}), Os = bt.Provider, Us = () => z.useContext(bt), pt = (t) => {
|
|
233
233
|
var i, l;
|
|
234
234
|
const [s, n] = k(
|
|
235
235
|
!!((l = (i = t == null ? void 0 : t.state) == null ? void 0 : i.membership) != null && l.pinned_at)
|
|
@@ -335,7 +335,7 @@ const ae = ({
|
|
|
335
335
|
"div",
|
|
336
336
|
{
|
|
337
337
|
"aria-hidden": "true",
|
|
338
|
-
className:
|
|
338
|
+
className: O(
|
|
339
339
|
"avatar-fallback flex h-full w-full items-center justify-center bg-[#E6E5E3] font-semibold select-none transition-colors",
|
|
340
340
|
o
|
|
341
341
|
),
|
|
@@ -345,7 +345,7 @@ const ae = ({
|
|
|
345
345
|
return /* @__PURE__ */ c(
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
|
-
className:
|
|
348
|
+
className: O(
|
|
349
349
|
"relative flex-shrink-0 !bg-transparent",
|
|
350
350
|
i
|
|
351
351
|
),
|
|
@@ -365,7 +365,7 @@ const ae = ({
|
|
|
365
365
|
/* @__PURE__ */ e(
|
|
366
366
|
"div",
|
|
367
367
|
{
|
|
368
|
-
className:
|
|
368
|
+
className: O(
|
|
369
369
|
"h-full w-full",
|
|
370
370
|
r ? "bg-[linear-gradient(135deg,#A855F7_0%,#8B5CF6_45%,#6D28D9_100%)]" : "bg-transparent"
|
|
371
371
|
),
|
|
@@ -482,7 +482,7 @@ const ae = ({
|
|
|
482
482
|
tabIndex: 0,
|
|
483
483
|
onClick: d,
|
|
484
484
|
onKeyDown: x,
|
|
485
|
-
className:
|
|
485
|
+
className: O(
|
|
486
486
|
"group w-full px-4 py-3 transition-colors text-left max-w-full overflow-hidden focus-ring",
|
|
487
487
|
{
|
|
488
488
|
"bg-primary-alt/10 border-l-4 border-l-primary": r,
|
|
@@ -506,7 +506,7 @@ const ae = ({
|
|
|
506
506
|
/* @__PURE__ */ c(
|
|
507
507
|
"h3",
|
|
508
508
|
{
|
|
509
|
-
className:
|
|
509
|
+
className: O(
|
|
510
510
|
"text-sm font-medium truncate",
|
|
511
511
|
r ? "text-primary" : "text-charcoal"
|
|
512
512
|
),
|
|
@@ -548,7 +548,7 @@ const qs = { last_message_at: -1 }, wt = z.memo(
|
|
|
548
548
|
const { debug: N = !1 } = Pe(), a = z.useCallback(
|
|
549
549
|
(w) => {
|
|
550
550
|
for (const g of w)
|
|
551
|
-
|
|
551
|
+
As(g);
|
|
552
552
|
return r ? r(w) : w;
|
|
553
553
|
},
|
|
554
554
|
[r]
|
|
@@ -570,11 +570,11 @@ const qs = { last_message_at: -1 }, wt = z.memo(
|
|
|
570
570
|
return /* @__PURE__ */ e(
|
|
571
571
|
"div",
|
|
572
572
|
{
|
|
573
|
-
className:
|
|
573
|
+
className: O(
|
|
574
574
|
"messaging-channel-list h-full flex flex-col min-w-0 overflow-hidden",
|
|
575
575
|
x
|
|
576
576
|
),
|
|
577
|
-
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(
|
|
577
|
+
children: /* @__PURE__ */ e("div", { className: "flex-1 overflow-hidden min-w-0", children: /* @__PURE__ */ e(Os, { value: _, children: /* @__PURE__ */ e(
|
|
578
578
|
Pt,
|
|
579
579
|
{
|
|
580
580
|
filters: n,
|
|
@@ -603,7 +603,7 @@ const Ie = ({
|
|
|
603
603
|
"button",
|
|
604
604
|
{
|
|
605
605
|
type: "button",
|
|
606
|
-
className:
|
|
606
|
+
className: O(
|
|
607
607
|
"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",
|
|
608
608
|
t === "danger" ? "text-danger hover:bg-danger/50" : "text-charcoal hover:bg-sand",
|
|
609
609
|
s
|
|
@@ -617,7 +617,7 @@ function Nt({ label: t, className: s, children: n, ...i }) {
|
|
|
617
617
|
"button",
|
|
618
618
|
{
|
|
619
619
|
type: "button",
|
|
620
|
-
className:
|
|
620
|
+
className: O(
|
|
621
621
|
"inline-flex items-center justify-center rounded-full transition-colors focus-ring p-2",
|
|
622
622
|
{
|
|
623
623
|
"cursor-not-allowed opacity-50": i.disabled,
|
|
@@ -652,7 +652,7 @@ const Zs = ({
|
|
|
652
652
|
customChannelActions: N
|
|
653
653
|
}) => {
|
|
654
654
|
var V, F, H, Z, re, K, p;
|
|
655
|
-
const { service: a, debug: _ } = Pe(), [w, g] = k(!1), [y, I] = k(!1), [C, S] = k(!1), L =
|
|
655
|
+
const { service: a, debug: _ } = Pe(), [w, g] = k(!1), [y, I] = k(!1), [C, S] = k(!1), L = A(async () => {
|
|
656
656
|
var E;
|
|
657
657
|
if (!(!a || !((E = n == null ? void 0 : n.user) != null && E.id)))
|
|
658
658
|
try {
|
|
@@ -831,7 +831,7 @@ function Js(t) {
|
|
|
831
831
|
const { channel: s } = me(), { client: n } = Ye("useMessageVote"), i = Be(
|
|
832
832
|
() => Ks(t.own_reactions),
|
|
833
833
|
[t.own_reactions]
|
|
834
|
-
), l =
|
|
834
|
+
), l = A(async () => {
|
|
835
835
|
if (n != null && n.userID)
|
|
836
836
|
try {
|
|
837
837
|
i === "up" ? await s.deleteReaction(t.id, Ge) : await s.sendReaction(
|
|
@@ -841,7 +841,7 @@ function Js(t) {
|
|
|
841
841
|
);
|
|
842
842
|
} catch {
|
|
843
843
|
}
|
|
844
|
-
}, [s, n == null ? void 0 : n.userID, t.id, i]), u =
|
|
844
|
+
}, [s, n == null ? void 0 : n.userID, t.id, i]), u = A(async () => {
|
|
845
845
|
if (n != null && n.userID)
|
|
846
846
|
try {
|
|
847
847
|
i === "down" ? await s.deleteReaction(t.id, Ve) : await s.sendReaction(
|
|
@@ -854,7 +854,7 @@ function Js(t) {
|
|
|
854
854
|
}, [s, n == null ? void 0 : n.userID, t.id, i]);
|
|
855
855
|
return { selected: i, voteUp: l, voteDown: u };
|
|
856
856
|
}
|
|
857
|
-
const Qs = z.lazy(() => import("./Card-
|
|
857
|
+
const Qs = z.lazy(() => import("./Card-lN2Z0Z5p.js")), en = z.lazy(() => import("./Card-DVzWMbDc.js")), Ct = () => /* @__PURE__ */ e(
|
|
858
858
|
"div",
|
|
859
859
|
{
|
|
860
860
|
className: "w-[280px] min-h-[200px] animate-pulse rounded-[24px] bg-black/[0.06] shadow-[0_0_0_1px_rgba(0,0,0,0.04),0_4px_8px_rgba(0,0,0,0.06)]",
|
|
@@ -933,8 +933,8 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
933
933
|
message: a,
|
|
934
934
|
renderText: _,
|
|
935
935
|
threadList: w
|
|
936
|
-
} = t, { client: g } = Ye("CustomMessage"), { channel: y } = me("CustomMessage"), { isUnlocking: I, onUnlockClick: C, onFetchSource: S, onDownloadClick: L } = rn("LockedAttachment"), [v, m] = k(!1), b =
|
|
937
|
-
Attachment: R =
|
|
936
|
+
} = t, { client: g } = Ye("CustomMessage"), { channel: y } = me("CustomMessage"), { isUnlocking: I, onUnlockClick: C, onFetchSource: S, onDownloadClick: L } = rn("LockedAttachment"), [v, m] = k(!1), b = At(a.id), { selected: T, voteUp: M, voteDown: P } = Js(a), {
|
|
937
|
+
Attachment: R = Ot,
|
|
938
938
|
EditMessageModal: B = Ut,
|
|
939
939
|
MessageBlocked: Q = $t,
|
|
940
940
|
MessageBouncePrompt: J = zt,
|
|
@@ -960,7 +960,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
960
960
|
const ee = !w && !!a.reply_count, le = !w && a.show_in_channel && a.parent_id, pe = a.status === "failed" && ((ce = a.error) == null ? void 0 : ce.status) !== 403, Le = Xt(a);
|
|
961
961
|
let Y;
|
|
962
962
|
pe ? Y = () => o(a) : Le && (Y = () => m(!0));
|
|
963
|
-
const te = N(), xe =
|
|
963
|
+
const te = N(), xe = O(
|
|
964
964
|
"str-chat__message str-chat__message-simple",
|
|
965
965
|
`str-chat__message--${a.type}`,
|
|
966
966
|
`str-chat__message--${a.status}`,
|
|
@@ -1008,7 +1008,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1008
1008
|
/* @__PURE__ */ e(
|
|
1009
1009
|
"div",
|
|
1010
1010
|
{
|
|
1011
|
-
className:
|
|
1011
|
+
className: O("str-chat__message-inner", {
|
|
1012
1012
|
"str-chat__simple-message--error-failed": pe || Le
|
|
1013
1013
|
}),
|
|
1014
1014
|
"data-testid": "message-inner",
|
|
@@ -1316,7 +1316,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1316
1316
|
]
|
|
1317
1317
|
}
|
|
1318
1318
|
),
|
|
1319
|
-
!s && /* @__PURE__ */ e(
|
|
1319
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1320
1320
|
] });
|
|
1321
1321
|
}
|
|
1322
1322
|
if ((n == null ? void 0 : n.kind) === "age-safety") {
|
|
@@ -1343,7 +1343,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1343
1343
|
]
|
|
1344
1344
|
}
|
|
1345
1345
|
),
|
|
1346
|
-
!s && /* @__PURE__ */ e(
|
|
1346
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1347
1347
|
] });
|
|
1348
1348
|
}
|
|
1349
1349
|
return /* @__PURE__ */ c("div", { className: "str-chat__message--system", "data-testid": "message-system", children: [
|
|
@@ -1352,9 +1352,9 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1352
1352
|
/* @__PURE__ */ e("p", { children: t.message.text }),
|
|
1353
1353
|
/* @__PURE__ */ e("div", { className: "str-chat__message--system__line" })
|
|
1354
1354
|
] }),
|
|
1355
|
-
!s && /* @__PURE__ */ e(
|
|
1355
|
+
!s && /* @__PURE__ */ e(Oe, { message: t.message })
|
|
1356
1356
|
] });
|
|
1357
|
-
}, ze = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", {
|
|
1357
|
+
}, ze = ({ cx: t, index: s }) => /* @__PURE__ */ e("circle", { cx: t, cy: "4", r: "3.9", fill: "#A0A0A0", children: /* @__PURE__ */ e(
|
|
1358
1358
|
"animateTransform",
|
|
1359
1359
|
{
|
|
1360
1360
|
attributeName: "transform",
|
|
@@ -1386,7 +1386,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1386
1386
|
return /* @__PURE__ */ c(
|
|
1387
1387
|
"div",
|
|
1388
1388
|
{
|
|
1389
|
-
className: "str-chat__typing-indicator !items-end",
|
|
1389
|
+
className: "str-chat__typing-indicator !items-end !bg-transparent",
|
|
1390
1390
|
"data-testid": "typing-indicator",
|
|
1391
1391
|
style: { insetInlineStart: 0, insetInlineEnd: "auto" },
|
|
1392
1392
|
children: [
|
|
@@ -1400,7 +1400,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1400
1400
|
shape: "circle"
|
|
1401
1401
|
}
|
|
1402
1402
|
) }),
|
|
1403
|
-
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#
|
|
1403
|
+
/* @__PURE__ */ e("div", { className: "px-4 py-3 rounded-lg bg-[#E9EAED] h-12 flex flex-col justify-end", children: /* @__PURE__ */ c(
|
|
1404
1404
|
"svg",
|
|
1405
1405
|
{
|
|
1406
1406
|
"aria-hidden": "true",
|
|
@@ -1422,7 +1422,7 @@ const ln = ({ filled: t }) => /* @__PURE__ */ e("svg", { width: "16", height: "1
|
|
|
1422
1422
|
}, Tn = () => null, Mn = ({ className: t, message: s }) => /* @__PURE__ */ c(
|
|
1423
1423
|
"div",
|
|
1424
1424
|
{
|
|
1425
|
-
className:
|
|
1425
|
+
className: O("flex items-center justify-center h-full", t),
|
|
1426
1426
|
children: [
|
|
1427
1427
|
/* @__PURE__ */ c("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1428
1428
|
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
@@ -1539,7 +1539,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1539
1539
|
children: /* @__PURE__ */ e(
|
|
1540
1540
|
je,
|
|
1541
1541
|
{
|
|
1542
|
-
className:
|
|
1542
|
+
className: O("size-5", {
|
|
1543
1543
|
"text-yellow-600": o,
|
|
1544
1544
|
"text-black/90": !o
|
|
1545
1545
|
}),
|
|
@@ -1607,7 +1607,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1607
1607
|
children: /* @__PURE__ */ e(
|
|
1608
1608
|
je,
|
|
1609
1609
|
{
|
|
1610
|
-
className:
|
|
1610
|
+
className: O("size-5", {
|
|
1611
1611
|
"text-yellow-600": o,
|
|
1612
1612
|
"text-black/90": !o
|
|
1613
1613
|
}),
|
|
@@ -1658,13 +1658,13 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1658
1658
|
return String(m.followerStatus);
|
|
1659
1659
|
if (m.isFollower !== void 0)
|
|
1660
1660
|
return m.isFollower ? "Subscribed to you" : "Not subscribed";
|
|
1661
|
-
}, [g.data]), S =
|
|
1661
|
+
}, [g.data]), S = A(() => {
|
|
1662
1662
|
var m;
|
|
1663
1663
|
(m = y.current) == null || m.showModal();
|
|
1664
|
-
}, []), L =
|
|
1664
|
+
}, []), L = A(() => {
|
|
1665
1665
|
var m;
|
|
1666
1666
|
(m = y.current) == null || m.close();
|
|
1667
|
-
}, []), v =
|
|
1667
|
+
}, []), v = A(
|
|
1668
1668
|
(m) => {
|
|
1669
1669
|
const { message: b } = mt("ChannelView"), T = /* @__PURE__ */ e(mn, { ...m, chatbotVotingEnabled: f });
|
|
1670
1670
|
return !w || !b ? T : w(T, b);
|
|
@@ -1745,7 +1745,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1745
1745
|
renderMessage: L,
|
|
1746
1746
|
sendButton: v
|
|
1747
1747
|
}) => {
|
|
1748
|
-
const m =
|
|
1748
|
+
const m = A(
|
|
1749
1749
|
async (b, T, M) => {
|
|
1750
1750
|
var V;
|
|
1751
1751
|
const P = ((V = t.data) == null ? void 0 : V.chatbot_paused) === !0, R = a && !P, B = {
|
|
@@ -1768,7 +1768,7 @@ const fe = "size-10 rounded-full bg-[#F1F0EE] hover:bg-[#E5E4E1] flex items-cent
|
|
|
1768
1768
|
return /* @__PURE__ */ e(
|
|
1769
1769
|
"div",
|
|
1770
1770
|
{
|
|
1771
|
-
className:
|
|
1771
|
+
className: O(
|
|
1772
1772
|
"messaging-channel-view h-full flex flex-col",
|
|
1773
1773
|
d
|
|
1774
1774
|
),
|
|
@@ -1898,7 +1898,7 @@ const Ln = ({
|
|
|
1898
1898
|
if (!x) return !0;
|
|
1899
1899
|
const m = x.toLowerCase();
|
|
1900
1900
|
return v.name.toLowerCase().includes(m) || ((b = v.email) == null ? void 0 : b.toLowerCase().includes(m)) || !1;
|
|
1901
|
-
}), S =
|
|
1901
|
+
}), S = A(
|
|
1902
1902
|
async (v) => {
|
|
1903
1903
|
if (!g) {
|
|
1904
1904
|
y(v.id);
|
|
@@ -1913,7 +1913,7 @@ const Ln = ({
|
|
|
1913
1913
|
), L = (v, m) => {
|
|
1914
1914
|
(v.key === "Enter" || v.key === " ") && (v.preventDefault(), S(m));
|
|
1915
1915
|
};
|
|
1916
|
-
return /* @__PURE__ */ c("div", { className:
|
|
1916
|
+
return /* @__PURE__ */ c("div", { className: O("flex flex-col h-full", r), children: [
|
|
1917
1917
|
/* @__PURE__ */ c("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1918
1918
|
/* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1919
1919
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
@@ -2203,7 +2203,7 @@ const la = ({
|
|
|
2203
2203
|
},
|
|
2204
2204
|
...h
|
|
2205
2205
|
};
|
|
2206
|
-
}, [h, R == null ? void 0 : R.userID]), ce = X(null), ne =
|
|
2206
|
+
}, [h, R == null ? void 0 : R.userID]), ce = X(null), ne = A(async () => {
|
|
2207
2207
|
if (!R || !B) return;
|
|
2208
2208
|
const D = R.userID;
|
|
2209
2209
|
if (D)
|
|
@@ -2221,8 +2221,8 @@ const la = ({
|
|
|
2221
2221
|
const Fe = G.state.members;
|
|
2222
2222
|
Object.values(Fe).forEach((Mt) => {
|
|
2223
2223
|
var Xe;
|
|
2224
|
-
const
|
|
2225
|
-
|
|
2224
|
+
const Ae = (Xe = Mt.user) == null ? void 0 : Xe.id;
|
|
2225
|
+
Ae && Ae !== D && $.add(Ae);
|
|
2226
2226
|
});
|
|
2227
2227
|
}), le((G) => G.size === $.size && [...G].every((Fe) => $.has(Fe)) ? G : $), K(W.length > 0), E(!0), ce.current = D, F && console.log("[MessagingShell] Channels synced successfully:", {
|
|
2228
2228
|
channelCount: W.length,
|
|
@@ -2304,14 +2304,14 @@ const la = ({
|
|
|
2304
2304
|
F,
|
|
2305
2305
|
l
|
|
2306
2306
|
]);
|
|
2307
|
-
const Ne =
|
|
2307
|
+
const Ne = A(
|
|
2308
2308
|
(D) => {
|
|
2309
2309
|
Z(D), l == null || l(D);
|
|
2310
2310
|
},
|
|
2311
2311
|
[l]
|
|
2312
|
-
), ye =
|
|
2312
|
+
), ye = A(() => {
|
|
2313
2313
|
Y || Z(null);
|
|
2314
|
-
}, [Y]), Ce =
|
|
2314
|
+
}, [Y]), Ce = A(
|
|
2315
2315
|
async (D) => {
|
|
2316
2316
|
var W;
|
|
2317
2317
|
if (P)
|
|
@@ -2337,35 +2337,35 @@ const la = ({
|
|
|
2337
2337
|
}
|
|
2338
2338
|
},
|
|
2339
2339
|
[P, u, F]
|
|
2340
|
-
), de =
|
|
2340
|
+
), de = A(() => {
|
|
2341
2341
|
var D;
|
|
2342
2342
|
j(!1), (D = he.current) == null || D.close();
|
|
2343
|
-
}, []), _e =
|
|
2343
|
+
}, []), _e = A(
|
|
2344
2344
|
(D) => {
|
|
2345
2345
|
D.target === he.current && de();
|
|
2346
2346
|
},
|
|
2347
2347
|
[de]
|
|
2348
|
-
), Ee =
|
|
2348
|
+
), Ee = A(
|
|
2349
2349
|
async (D) => {
|
|
2350
2350
|
F && console.log("[MessagingShell] Leaving conversation:", D.id), Z(null), te(!1), ce.current = null, await ne();
|
|
2351
2351
|
},
|
|
2352
2352
|
[ne, F]
|
|
2353
|
-
), Se =
|
|
2353
|
+
), Se = A(
|
|
2354
2354
|
async (D) => {
|
|
2355
2355
|
F && console.log("[MessagingShell] Blocking participant:", D), Z(null), te(!1), ce.current = null, await ne();
|
|
2356
2356
|
},
|
|
2357
2357
|
[ne, F]
|
|
2358
2358
|
), ue = !!H;
|
|
2359
|
-
return Q ? /* @__PURE__ */ e("div", { className:
|
|
2359
|
+
return Q ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(De, {}) }) : J ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: J, onBack: V }) }) : !B || !R ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(
|
|
2360
2360
|
Te,
|
|
2361
2361
|
{
|
|
2362
2362
|
message: "Not connected to messaging service",
|
|
2363
2363
|
onBack: V
|
|
2364
2364
|
}
|
|
2365
|
-
) }) : xe ? /* @__PURE__ */ e("div", { className:
|
|
2365
|
+
) }) : xe ? /* @__PURE__ */ e("div", { className: O("h-full", s), children: /* @__PURE__ */ e(Te, { message: xe }) }) : /* @__PURE__ */ c(
|
|
2366
2366
|
"div",
|
|
2367
2367
|
{
|
|
2368
|
-
className:
|
|
2368
|
+
className: O(
|
|
2369
2369
|
"messaging-shell h-full bg-background-primary overflow-hidden",
|
|
2370
2370
|
s
|
|
2371
2371
|
),
|
|
@@ -2374,7 +2374,7 @@ const la = ({
|
|
|
2374
2374
|
/* @__PURE__ */ e(
|
|
2375
2375
|
"div",
|
|
2376
2376
|
{
|
|
2377
|
-
className:
|
|
2377
|
+
className: O(
|
|
2378
2378
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
2379
2379
|
{
|
|
2380
2380
|
"!hidden": o === !1 || Y,
|
|
@@ -2400,7 +2400,7 @@ const la = ({
|
|
|
2400
2400
|
/* @__PURE__ */ e(
|
|
2401
2401
|
"div",
|
|
2402
2402
|
{
|
|
2403
|
-
className:
|
|
2403
|
+
className: O(
|
|
2404
2404
|
"messaging-conversation-view flex-1 flex-col min-w-0 min-h-0",
|
|
2405
2405
|
{
|
|
2406
2406
|
// In direct conversation mode (or waiting for it), always show (full width)
|
|
@@ -2474,7 +2474,7 @@ const la = ({
|
|
|
2474
2474
|
]
|
|
2475
2475
|
}
|
|
2476
2476
|
);
|
|
2477
|
-
},
|
|
2477
|
+
}, An = ({
|
|
2478
2478
|
question: t,
|
|
2479
2479
|
onClick: s,
|
|
2480
2480
|
loading: n = !1,
|
|
@@ -2486,7 +2486,7 @@ const la = ({
|
|
|
2486
2486
|
onClick: s,
|
|
2487
2487
|
disabled: n,
|
|
2488
2488
|
style: { backgroundColor: "#E6E5E3" },
|
|
2489
|
-
className:
|
|
2489
|
+
className: O(
|
|
2490
2490
|
"w-full text-center p-4 rounded-xl text-charcoal font-medium transition-colors focus-ring",
|
|
2491
2491
|
{
|
|
2492
2492
|
"hover:brightness-95 active:brightness-90": !n,
|
|
@@ -2525,7 +2525,7 @@ const la = ({
|
|
|
2525
2525
|
children: [
|
|
2526
2526
|
i && /* @__PURE__ */ e("p", { className: "text-md text-charcoal mb-4", children: i }),
|
|
2527
2527
|
d.map((x) => /* @__PURE__ */ e(
|
|
2528
|
-
|
|
2528
|
+
An,
|
|
2529
2529
|
{
|
|
2530
2530
|
question: x.question,
|
|
2531
2531
|
onClick: () => s(x.id),
|
|
@@ -2537,7 +2537,7 @@ const la = ({
|
|
|
2537
2537
|
}
|
|
2538
2538
|
)
|
|
2539
2539
|
] }) });
|
|
2540
|
-
},
|
|
2540
|
+
}, On = [
|
|
2541
2541
|
[/pdf/, "pdf"],
|
|
2542
2542
|
[/wordprocessingml|msword|\.doc/, "doc"],
|
|
2543
2543
|
[/spreadsheetml|ms-excel|\.xls/, "xls"],
|
|
@@ -2551,7 +2551,7 @@ function qe(t) {
|
|
|
2551
2551
|
return t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("image/") ? "image" : "document";
|
|
2552
2552
|
}
|
|
2553
2553
|
function Un(t) {
|
|
2554
|
-
const s =
|
|
2554
|
+
const s = On.find(
|
|
2555
2555
|
([n]) => n.test(t)
|
|
2556
2556
|
);
|
|
2557
2557
|
return s ? s[1] : "generic";
|
|
@@ -2594,9 +2594,9 @@ const jn = (t) => {
|
|
|
2594
2594
|
muted: x = !1,
|
|
2595
2595
|
onContainerClick: o
|
|
2596
2596
|
}) => {
|
|
2597
|
-
const h = qe(s), f = X(null), N = X(null), a = X(null), _ = X(l), [w, g] = k(i), [y, I] = k(0), [C, S] = k(!1), [L, v] = k(!1), [m, b] = k(!1), [T, M] = k(!1), [P, R] = k(!0), [B, Q] = k(null), J =
|
|
2597
|
+
const h = qe(s), f = X(null), N = X(null), a = X(null), _ = X(l), [w, g] = k(i), [y, I] = k(0), [C, S] = k(!1), [L, v] = k(!1), [m, b] = k(!1), [T, M] = k(!1), [P, R] = k(!0), [B, Q] = k(null), J = A(() => {
|
|
2598
2598
|
b(!1), g(!0);
|
|
2599
|
-
}, []), V =
|
|
2599
|
+
}, []), V = A((p) => {
|
|
2600
2600
|
const E = N.current;
|
|
2601
2601
|
if (!E) return 0;
|
|
2602
2602
|
const U = E.getBoundingClientRect();
|
|
@@ -2604,7 +2604,7 @@ const jn = (t) => {
|
|
|
2604
2604
|
0,
|
|
2605
2605
|
Math.min(1, (jn(p) - U.left) / U.width)
|
|
2606
2606
|
);
|
|
2607
|
-
}, []), F =
|
|
2607
|
+
}, []), F = A((p) => {
|
|
2608
2608
|
const E = f.current;
|
|
2609
2609
|
E && E.duration && (E.currentTime = p * E.duration);
|
|
2610
2610
|
}, []), H = (p) => {
|
|
@@ -3143,7 +3143,7 @@ const qn = ({
|
|
|
3143
3143
|
)
|
|
3144
3144
|
] });
|
|
3145
3145
|
}, da = (t, s = {}) => {
|
|
3146
|
-
const { initialSearch: n = "", pageSize: i = 20 } = s, [l, u] = k([]), [r, d] = k(!1), [x, o] = k(null), [h, f] = k(n), [N, a] = k(!0), [_, w] = k(), g =
|
|
3146
|
+
const { initialSearch: n = "", pageSize: i = 20 } = s, [l, u] = k([]), [r, d] = k(!1), [x, o] = k(null), [h, f] = k(n), [N, a] = k(!0), [_, w] = k(), g = A(async (S = !1, L) => {
|
|
3147
3147
|
if (r) return;
|
|
3148
3148
|
const v = L !== void 0 ? L : h;
|
|
3149
3149
|
d(!0), o(null);
|
|
@@ -3162,11 +3162,11 @@ const qn = ({
|
|
|
3162
3162
|
} finally {
|
|
3163
3163
|
d(!1);
|
|
3164
3164
|
}
|
|
3165
|
-
}, [t, h, _, i, r]), y =
|
|
3165
|
+
}, [t, h, _, i, r]), y = A(() => {
|
|
3166
3166
|
N && !r && g(!1);
|
|
3167
|
-
}, [N, r, g]), I =
|
|
3167
|
+
}, [N, r, g]), I = A((S) => {
|
|
3168
3168
|
f(S), w(void 0), g(!0, S);
|
|
3169
|
-
}, [g]), C =
|
|
3169
|
+
}, [g]), C = A(() => {
|
|
3170
3170
|
w(void 0), g(!0);
|
|
3171
3171
|
}, [g]);
|
|
3172
3172
|
return q(() => {
|
|
@@ -3194,7 +3194,7 @@ export {
|
|
|
3194
3194
|
wt as b,
|
|
3195
3195
|
Et as c,
|
|
3196
3196
|
ia as d,
|
|
3197
|
-
|
|
3197
|
+
An as e,
|
|
3198
3198
|
ca as f,
|
|
3199
3199
|
qe as g,
|
|
3200
3200
|
cn as h,
|
|
@@ -3207,4 +3207,4 @@ export {
|
|
|
3207
3207
|
Ze as r,
|
|
3208
3208
|
rn as u
|
|
3209
3209
|
};
|
|
3210
|
-
//# sourceMappingURL=index-
|
|
3210
|
+
//# sourceMappingURL=index-BsSqs61X.js.map
|