@linktr.ee/messaging-react 1.12.1 → 1.12.2-rc-1765326466
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.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as e, jsxs as i, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as i, Fragment as ve } from "react/jsx-runtime";
|
|
2
2
|
import p from "classnames";
|
|
3
3
|
import P, { createContext as Ue, useContext as Oe, useCallback as D, useState as y, useRef as z, useEffect as G } from "react";
|
|
4
4
|
import { StreamChatService as je } from "@linktr.ee/messaging-core";
|
|
5
|
-
import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as
|
|
6
|
-
import { XIcon as ue, ArrowUpIcon as es, ArrowLeftIcon as
|
|
7
|
-
import { LinkPreviewsManager as
|
|
8
|
-
const
|
|
5
|
+
import { Chat as Ae, ChannelList as ze, useMessageComposer as Be, useStateStore as $e, MessageInput as Ge, useMessageInputContext as He, useMessageComposerHasSendableData as Ve, SimpleAttachmentSelector as We, QuotedMessagePreview as Ze, AttachmentPreviewList as qe, TextareaComposer as Ye, MessageTimestamp as Je, Channel as Qe, useChannelStateContext as we, Window as Xe, MessageList as Ke } from "stream-chat-react";
|
|
6
|
+
import { XIcon as ue, ArrowUpIcon as es, ArrowLeftIcon as fe, DotsThreeIcon as ge, SpinnerGapIcon as re, SignOutIcon as ss, ProhibitInsetIcon as xe, FlagIcon as ts, MagnifyingGlassIcon as ns, ChatCircleDotsIcon as Ne } from "@phosphor-icons/react";
|
|
7
|
+
import { LinkPreviewsManager as be } from "stream-chat";
|
|
8
|
+
const ye = Ue({
|
|
9
9
|
service: null,
|
|
10
10
|
client: null,
|
|
11
11
|
isConnected: !1,
|
|
@@ -15,7 +15,7 @@ const we = Ue({
|
|
|
15
15
|
refreshConnection: async () => {
|
|
16
16
|
},
|
|
17
17
|
debug: !1
|
|
18
|
-
}), ae = () => Oe(
|
|
18
|
+
}), ae = () => Oe(ye), Ms = ({
|
|
19
19
|
children: t,
|
|
20
20
|
user: s,
|
|
21
21
|
serviceConfig: n,
|
|
@@ -206,7 +206,7 @@ const we = Ue({
|
|
|
206
206
|
renderCount: k.current,
|
|
207
207
|
willRenderChat: !!(g && f),
|
|
208
208
|
contextValueReady: !!o
|
|
209
|
-
}), /* @__PURE__ */ e(
|
|
209
|
+
}), /* @__PURE__ */ e(ye.Provider, { value: o, children: g && f ? /* @__PURE__ */ e(
|
|
210
210
|
Ae,
|
|
211
211
|
{
|
|
212
212
|
client: g,
|
|
@@ -236,7 +236,7 @@ const we = Ue({
|
|
|
236
236
|
day: "numeric",
|
|
237
237
|
year: "2-digit"
|
|
238
238
|
});
|
|
239
|
-
},
|
|
239
|
+
}, Ce = [
|
|
240
240
|
"🍎",
|
|
241
241
|
// Apple
|
|
242
242
|
"🍌",
|
|
@@ -273,8 +273,8 @@ function os(t) {
|
|
|
273
273
|
return Math.abs(s);
|
|
274
274
|
}
|
|
275
275
|
function is(t) {
|
|
276
|
-
const n = os(t) %
|
|
277
|
-
return
|
|
276
|
+
const n = os(t) % Ce.length;
|
|
277
|
+
return Ce[n];
|
|
278
278
|
}
|
|
279
279
|
const q = ({
|
|
280
280
|
id: t,
|
|
@@ -316,7 +316,7 @@ const q = ({
|
|
|
316
316
|
)
|
|
317
317
|
}
|
|
318
318
|
);
|
|
319
|
-
},
|
|
319
|
+
}, Ee = P.memo(
|
|
320
320
|
({ channel: t, selectedChannel: s, onChannelSelect: n, debug: r = !1, unread: a }) => {
|
|
321
321
|
var N, E, I, k, x, R;
|
|
322
322
|
const d = (s == null ? void 0 : s.id) === (t == null ? void 0 : t.id), l = () => {
|
|
@@ -385,8 +385,8 @@ const q = ({
|
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
387
|
);
|
|
388
|
-
|
|
389
|
-
const
|
|
388
|
+
Ee.displayName = "CustomChannelPreview";
|
|
389
|
+
const Ie = P.memo(
|
|
390
390
|
({
|
|
391
391
|
onChannelSelect: t,
|
|
392
392
|
selectedChannel: s,
|
|
@@ -403,7 +403,7 @@ const Ee = P.memo(
|
|
|
403
403
|
filters: n
|
|
404
404
|
});
|
|
405
405
|
const m = P.useMemo(() => (g) => /* @__PURE__ */ e(
|
|
406
|
-
|
|
406
|
+
Ee,
|
|
407
407
|
{
|
|
408
408
|
...g,
|
|
409
409
|
selectedChannel: s,
|
|
@@ -433,7 +433,7 @@ const Ee = P.memo(
|
|
|
433
433
|
);
|
|
434
434
|
}
|
|
435
435
|
);
|
|
436
|
-
|
|
436
|
+
Ie.displayName = "ChannelList";
|
|
437
437
|
const ne = ({
|
|
438
438
|
variant: t = "default",
|
|
439
439
|
className: s,
|
|
@@ -452,7 +452,7 @@ const ne = ({
|
|
|
452
452
|
children: n
|
|
453
453
|
}
|
|
454
454
|
);
|
|
455
|
-
function
|
|
455
|
+
function Se({ label: t, className: s, children: n, ...r }) {
|
|
456
456
|
return /* @__PURE__ */ i(
|
|
457
457
|
"button",
|
|
458
458
|
{
|
|
@@ -473,12 +473,12 @@ function Ie({ label: t, className: s, children: n, ...r }) {
|
|
|
473
473
|
}
|
|
474
474
|
);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
477
|
-
return /* @__PURE__ */ e(
|
|
476
|
+
function pe({ onClick: t }) {
|
|
477
|
+
return /* @__PURE__ */ e(Se, { label: "Close", onClick: t, className: "p-1", children: /* @__PURE__ */ e(ue, { className: "h-5 w-5 text-stone", weight: "bold" }) });
|
|
478
478
|
}
|
|
479
479
|
const cs = (t) => ({
|
|
480
480
|
linkPreviews: Array.from(t.previews.values()).filter(
|
|
481
|
-
(s) =>
|
|
481
|
+
(s) => be.previewIsLoaded(s) || be.previewIsLoading(s)
|
|
482
482
|
)
|
|
483
483
|
}), ds = ({
|
|
484
484
|
link: t,
|
|
@@ -537,7 +537,7 @@ const cs = (t) => ({
|
|
|
537
537
|
)) }) : null;
|
|
538
538
|
}, ms = () => {
|
|
539
539
|
const { handleSubmit: t } = He(), s = Ve();
|
|
540
|
-
return /* @__PURE__ */ i(
|
|
540
|
+
return /* @__PURE__ */ i(ve, { children: [
|
|
541
541
|
/* @__PURE__ */ e("div", { className: "left-container", children: /* @__PURE__ */ e(We, {}) }),
|
|
542
542
|
/* @__PURE__ */ i("div", { className: "central-container min-w-0 w-full p-2 bg-white rounded-[1.5rem] shadow-[0_4px_16px_0_rgba(0,0,0,0.08),0_1px_2px_0_rgba(0,0,0,0.04),0_0_0_1px_rgba(0,0,0,0.04)]", children: [
|
|
543
543
|
/* @__PURE__ */ e(Ze, {}),
|
|
@@ -581,9 +581,57 @@ const cs = (t) => ({
|
|
|
581
581
|
] }),
|
|
582
582
|
!s && /* @__PURE__ */ e(Je, { message: t.message })
|
|
583
583
|
] });
|
|
584
|
-
}, gs = () => null, xs = ({
|
|
584
|
+
}, gs = () => null, xs = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
585
|
+
"div",
|
|
586
|
+
{
|
|
587
|
+
className: p("flex items-center justify-center h-full", t),
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
590
|
+
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
591
|
+
"animateTransform",
|
|
592
|
+
{
|
|
593
|
+
attributeName: "transform",
|
|
594
|
+
dur: "1s",
|
|
595
|
+
type: "translate",
|
|
596
|
+
values: "0 15 ; 0 -15; 0 15",
|
|
597
|
+
repeatCount: "indefinite",
|
|
598
|
+
begin: "0.1"
|
|
599
|
+
}
|
|
600
|
+
) }),
|
|
601
|
+
/* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
602
|
+
"animateTransform",
|
|
603
|
+
{
|
|
604
|
+
attributeName: "transform",
|
|
605
|
+
dur: "1s",
|
|
606
|
+
type: "translate",
|
|
607
|
+
values: "0 10 ; 0 -10; 0 10",
|
|
608
|
+
repeatCount: "indefinite",
|
|
609
|
+
begin: "0.2"
|
|
610
|
+
}
|
|
611
|
+
) }),
|
|
612
|
+
/* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
613
|
+
"animateTransform",
|
|
614
|
+
{
|
|
615
|
+
attributeName: "transform",
|
|
616
|
+
dur: "1s",
|
|
617
|
+
type: "translate",
|
|
618
|
+
values: "0 5 ; 0 -5; 0 5",
|
|
619
|
+
repeatCount: "indefinite",
|
|
620
|
+
begin: "0.3"
|
|
621
|
+
}
|
|
622
|
+
) })
|
|
623
|
+
] }),
|
|
624
|
+
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
625
|
+
]
|
|
626
|
+
}
|
|
627
|
+
), me = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
628
|
+
/* @__PURE__ */ e(xs, { className: "w-6 h-6" }),
|
|
629
|
+
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
630
|
+
] }) }));
|
|
631
|
+
me.displayName = "LoadingState";
|
|
632
|
+
const Ns = ({ onBack: t, showBackButton: s, onShowInfo: n, canShowInfo: r }) => {
|
|
585
633
|
var h, g, w, f, S;
|
|
586
|
-
const { channel: a } =
|
|
634
|
+
const { channel: a } = we(), d = P.useMemo(() => Object.values(a.state.members || {}).find(
|
|
587
635
|
(v) => {
|
|
588
636
|
var c;
|
|
589
637
|
return ((c = v.user) == null ? void 0 : c.id) && v.user.id !== a._client.userID;
|
|
@@ -602,7 +650,7 @@ const cs = (t) => ({
|
|
|
602
650
|
}),
|
|
603
651
|
type: "button",
|
|
604
652
|
"aria-label": "Back to conversations",
|
|
605
|
-
children: /* @__PURE__ */ e(
|
|
653
|
+
children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
|
|
606
654
|
}
|
|
607
655
|
),
|
|
608
656
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-1 items-center", children: [
|
|
@@ -626,7 +674,7 @@ const cs = (t) => ({
|
|
|
626
674
|
onClick: n,
|
|
627
675
|
type: "button",
|
|
628
676
|
"aria-label": "Show info",
|
|
629
|
-
children: /* @__PURE__ */ e(
|
|
677
|
+
children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
|
|
630
678
|
}
|
|
631
679
|
)
|
|
632
680
|
] }),
|
|
@@ -639,7 +687,7 @@ const cs = (t) => ({
|
|
|
639
687
|
onClick: t,
|
|
640
688
|
className: "size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center",
|
|
641
689
|
"aria-label": "Back to conversations",
|
|
642
|
-
children: /* @__PURE__ */ e(
|
|
690
|
+
children: /* @__PURE__ */ e(fe, { className: "size-5 text-black/90" })
|
|
643
691
|
}
|
|
644
692
|
),
|
|
645
693
|
/* @__PURE__ */ e(
|
|
@@ -660,12 +708,12 @@ const cs = (t) => ({
|
|
|
660
708
|
"size-10 rounded-full bg-[#F1F0EE] flex items-center justify-center"
|
|
661
709
|
),
|
|
662
710
|
onClick: n,
|
|
663
|
-
children: /* @__PURE__ */ e(
|
|
711
|
+
children: /* @__PURE__ */ e(ge, { className: "size-5 text-black/90" })
|
|
664
712
|
}
|
|
665
713
|
)
|
|
666
714
|
] })
|
|
667
715
|
] });
|
|
668
|
-
},
|
|
716
|
+
}, bs = ({
|
|
669
717
|
dialogRef: t,
|
|
670
718
|
onClose: s,
|
|
671
719
|
participant: n,
|
|
@@ -760,7 +808,7 @@ const cs = (t) => ({
|
|
|
760
808
|
children: /* @__PURE__ */ i("div", { className: "ml-auto flex h-full w-full flex-col bg-white shadow-none transition-shadow duration-200 group-open:shadow-max-elevation-light", children: [
|
|
761
809
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between border-b border-sand px-4 py-3", children: [
|
|
762
810
|
/* @__PURE__ */ e("h2", { className: "text-base font-semibold text-charcoal", children: "Chat info" }),
|
|
763
|
-
/* @__PURE__ */ e(
|
|
811
|
+
/* @__PURE__ */ e(pe, { onClick: s })
|
|
764
812
|
] }),
|
|
765
813
|
/* @__PURE__ */ i("div", { className: "flex-1 px-2 overflow-y-auto w-full", children: [
|
|
766
814
|
/* @__PURE__ */ e(
|
|
@@ -820,7 +868,7 @@ const cs = (t) => ({
|
|
|
820
868
|
disabled: E,
|
|
821
869
|
"aria-busy": E,
|
|
822
870
|
children: [
|
|
823
|
-
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
871
|
+
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
|
|
824
872
|
/* @__PURE__ */ e("span", { children: "Unblock" })
|
|
825
873
|
]
|
|
826
874
|
}
|
|
@@ -831,7 +879,7 @@ const cs = (t) => ({
|
|
|
831
879
|
disabled: E,
|
|
832
880
|
"aria-busy": E,
|
|
833
881
|
children: [
|
|
834
|
-
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(
|
|
882
|
+
E ? /* @__PURE__ */ e(re, { className: "h-5 w-5 animate-spin" }) : /* @__PURE__ */ e(xe, { className: "h-5 w-5" }),
|
|
835
883
|
/* @__PURE__ */ e("span", { children: "Block" })
|
|
836
884
|
]
|
|
837
885
|
}
|
|
@@ -846,7 +894,7 @@ const cs = (t) => ({
|
|
|
846
894
|
}
|
|
847
895
|
)
|
|
848
896
|
);
|
|
849
|
-
},
|
|
897
|
+
}, Cs = ({
|
|
850
898
|
onBack: t,
|
|
851
899
|
showBackButton: s,
|
|
852
900
|
renderMessageInputActions: n,
|
|
@@ -857,7 +905,7 @@ const cs = (t) => ({
|
|
|
857
905
|
onBlockParticipantClick: m,
|
|
858
906
|
onReportParticipantClick: h
|
|
859
907
|
}) => {
|
|
860
|
-
const { channel: g } =
|
|
908
|
+
const { channel: g } = we(), w = z(null), f = P.useMemo(() => Object.values(g.state.members || {}).find(
|
|
861
909
|
(N) => {
|
|
862
910
|
var E;
|
|
863
911
|
return ((E = N.user) == null ? void 0 : E.id) && N.user.id !== g._client.userID;
|
|
@@ -875,10 +923,10 @@ const cs = (t) => ({
|
|
|
875
923
|
var c;
|
|
876
924
|
(c = w.current) == null || c.close();
|
|
877
925
|
}, []);
|
|
878
|
-
return /* @__PURE__ */ i(
|
|
926
|
+
return /* @__PURE__ */ i(ve, { children: [
|
|
879
927
|
/* @__PURE__ */ i(Xe, { children: [
|
|
880
928
|
/* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ e(
|
|
881
|
-
|
|
929
|
+
Ns,
|
|
882
930
|
{
|
|
883
931
|
onBack: t,
|
|
884
932
|
showBackButton: s,
|
|
@@ -902,7 +950,7 @@ const cs = (t) => ({
|
|
|
902
950
|
)
|
|
903
951
|
] }),
|
|
904
952
|
/* @__PURE__ */ e(
|
|
905
|
-
|
|
953
|
+
bs,
|
|
906
954
|
{
|
|
907
955
|
dialogRef: w,
|
|
908
956
|
onClose: v,
|
|
@@ -918,7 +966,7 @@ const cs = (t) => ({
|
|
|
918
966
|
}
|
|
919
967
|
)
|
|
920
968
|
] });
|
|
921
|
-
},
|
|
969
|
+
}, ke = P.memo(
|
|
922
970
|
({
|
|
923
971
|
channel: t,
|
|
924
972
|
onBack: s,
|
|
@@ -945,8 +993,9 @@ const cs = (t) => ({
|
|
|
945
993
|
channel: t,
|
|
946
994
|
MessageSystem: fs,
|
|
947
995
|
EmptyStateIndicator: m,
|
|
996
|
+
LoadingIndicator: me,
|
|
948
997
|
children: /* @__PURE__ */ e(
|
|
949
|
-
|
|
998
|
+
Cs,
|
|
950
999
|
{
|
|
951
1000
|
onBack: s,
|
|
952
1001
|
showBackButton: n,
|
|
@@ -965,8 +1014,8 @@ const cs = (t) => ({
|
|
|
965
1014
|
}
|
|
966
1015
|
)
|
|
967
1016
|
);
|
|
968
|
-
|
|
969
|
-
function
|
|
1017
|
+
ke.displayName = "ChannelView";
|
|
1018
|
+
function vs({
|
|
970
1019
|
searchQuery: t,
|
|
971
1020
|
setSearchQuery: s,
|
|
972
1021
|
placeholder: n
|
|
@@ -992,7 +1041,7 @@ function Cs({
|
|
|
992
1041
|
}
|
|
993
1042
|
),
|
|
994
1043
|
t && /* @__PURE__ */ e(
|
|
995
|
-
|
|
1044
|
+
Se,
|
|
996
1045
|
{
|
|
997
1046
|
label: "Clear search",
|
|
998
1047
|
onClick: () => {
|
|
@@ -1005,7 +1054,7 @@ function Cs({
|
|
|
1005
1054
|
)
|
|
1006
1055
|
] });
|
|
1007
1056
|
}
|
|
1008
|
-
const
|
|
1057
|
+
const ws = ({
|
|
1009
1058
|
participantSource: t,
|
|
1010
1059
|
onSelectParticipant: s,
|
|
1011
1060
|
onClose: n,
|
|
@@ -1069,7 +1118,7 @@ const vs = ({
|
|
|
1069
1118
|
/* @__PURE__ */ i("div", { className: "px-4 py-4 border-b border-sand bg-chalk", children: [
|
|
1070
1119
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1071
1120
|
/* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-charcoal", children: "Start a new Conversation" }),
|
|
1072
|
-
/* @__PURE__ */ e(
|
|
1121
|
+
/* @__PURE__ */ e(pe, { onClick: n })
|
|
1073
1122
|
] }),
|
|
1074
1123
|
/* @__PURE__ */ i("p", { className: "text-xs text-stone mb-3", children: [
|
|
1075
1124
|
"Select a ",
|
|
@@ -1080,7 +1129,7 @@ const vs = ({
|
|
|
1080
1129
|
t.totalCount !== void 0 && ` • ${t.totalCount} ${a} total`
|
|
1081
1130
|
] }),
|
|
1082
1131
|
/* @__PURE__ */ e(
|
|
1083
|
-
|
|
1132
|
+
vs,
|
|
1084
1133
|
{
|
|
1085
1134
|
searchQuery: h,
|
|
1086
1135
|
setSearchQuery: g,
|
|
@@ -1102,7 +1151,7 @@ const vs = ({
|
|
|
1102
1151
|
"..."
|
|
1103
1152
|
] })
|
|
1104
1153
|
] }) }) : k.length === 0 ? /* @__PURE__ */ i("div", { className: "p-6 text-center", children: [
|
|
1105
|
-
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(
|
|
1154
|
+
/* @__PURE__ */ e("div", { className: "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-sand", children: /* @__PURE__ */ e(Ne, { className: "h-8 w-8 text-charcoal" }) }),
|
|
1106
1155
|
/* @__PURE__ */ e("h3", { className: "text-sm font-semibold text-charcoal mb-2", children: h ? `No ${a} found` : w.length > 0 ? `Already chatting with all ${a}` : `No ${a} yet` }),
|
|
1107
1156
|
/* @__PURE__ */ e("p", { className: "text-xs text-stone", children: h ? "Try a different search term" : w.length > 0 ? `You have existing conversations with all your ${a}` : `${a.charAt(0).toUpperCase() + a.slice(1)} will appear here` })
|
|
1108
1157
|
] }) : /* @__PURE__ */ i("ul", { className: "space-y-0", children: [
|
|
@@ -1131,7 +1180,7 @@ const vs = ({
|
|
|
1131
1180
|
b && /* @__PURE__ */ e("p", { className: "text-xs text-stone truncate", children: b })
|
|
1132
1181
|
] })
|
|
1133
1182
|
] }),
|
|
1134
|
-
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(
|
|
1183
|
+
/* @__PURE__ */ e("div", { className: "flex-shrink-0", children: N === o.id ? /* @__PURE__ */ e(re, { className: "h-5 w-5 text-primary animate-spin" }) : /* @__PURE__ */ e(Ne, { className: "h-5 w-5 text-stone" }) })
|
|
1135
1184
|
] })
|
|
1136
1185
|
}
|
|
1137
1186
|
) }, o.id);
|
|
@@ -1142,7 +1191,7 @@ const vs = ({
|
|
|
1142
1191
|
] }) })
|
|
1143
1192
|
] }) })
|
|
1144
1193
|
] });
|
|
1145
|
-
},
|
|
1194
|
+
}, ys = ({ className: t }) => /* @__PURE__ */ i(
|
|
1146
1195
|
"svg",
|
|
1147
1196
|
{
|
|
1148
1197
|
width: "140",
|
|
@@ -1276,16 +1325,16 @@ const vs = ({
|
|
|
1276
1325
|
] })
|
|
1277
1326
|
]
|
|
1278
1327
|
}
|
|
1279
|
-
),
|
|
1328
|
+
), Re = P.memo(
|
|
1280
1329
|
({ hasChannels: t, channelsLoaded: s }) => /* @__PURE__ */ e("div", { className: "messaging-empty-state flex items-center justify-center h-full p-8 text-balance", children: /* @__PURE__ */ i("div", { className: "flex flex-col items-center max-w-sm text-center", children: [
|
|
1281
|
-
/* @__PURE__ */ e(
|
|
1330
|
+
/* @__PURE__ */ e(ys, {}),
|
|
1282
1331
|
s && !t && /* @__PURE__ */ i("div", { className: "mt-8", children: [
|
|
1283
1332
|
/* @__PURE__ */ e("h2", { className: "font-medium text-black text-[18px] mb-2", children: "Your inbox is empty" }),
|
|
1284
1333
|
/* @__PURE__ */ e("p", { className: "text-[#676B5F] text-sm mb-6", children: "Share with your followers to start receiving messages" })
|
|
1285
1334
|
] })
|
|
1286
1335
|
] }) })
|
|
1287
1336
|
);
|
|
1288
|
-
|
|
1337
|
+
Re.displayName = "EmptyState";
|
|
1289
1338
|
const le = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { className: "messaging-error-state flex items-center justify-center h-full p-8", children: /* @__PURE__ */ i("div", { className: "text-center max-w-sm", children: [
|
|
1290
1339
|
/* @__PURE__ */ e("div", { className: "w-24 h-24 bg-danger-alt/20 rounded-full flex items-center justify-center mx-auto mb-6", children: /* @__PURE__ */ e("span", { className: "text-4xl", children: "⚠️" }) }),
|
|
1291
1340
|
/* @__PURE__ */ e("h2", { className: "font-semibold text-charcoal mb-2", children: "Oops!" }),
|
|
@@ -1301,54 +1350,6 @@ const le = P.memo(({ message: t, onBack: s }) => /* @__PURE__ */ e("div", { clas
|
|
|
1301
1350
|
)
|
|
1302
1351
|
] }) }));
|
|
1303
1352
|
le.displayName = "ErrorState";
|
|
1304
|
-
const ys = ({ className: t, message: s }) => /* @__PURE__ */ i(
|
|
1305
|
-
"div",
|
|
1306
|
-
{
|
|
1307
|
-
className: p("flex items-center justify-center h-full", t),
|
|
1308
|
-
children: [
|
|
1309
|
-
/* @__PURE__ */ i("svg", { viewBox: "0 0 100 100", className: "size-8 fill-pebble", stroke: "none", children: [
|
|
1310
|
-
/* @__PURE__ */ e("circle", { cx: "6", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1311
|
-
"animateTransform",
|
|
1312
|
-
{
|
|
1313
|
-
attributeName: "transform",
|
|
1314
|
-
dur: "1s",
|
|
1315
|
-
type: "translate",
|
|
1316
|
-
values: "0 15 ; 0 -15; 0 15",
|
|
1317
|
-
repeatCount: "indefinite",
|
|
1318
|
-
begin: "0.1"
|
|
1319
|
-
}
|
|
1320
|
-
) }),
|
|
1321
|
-
/* @__PURE__ */ e("circle", { cx: "30", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1322
|
-
"animateTransform",
|
|
1323
|
-
{
|
|
1324
|
-
attributeName: "transform",
|
|
1325
|
-
dur: "1s",
|
|
1326
|
-
type: "translate",
|
|
1327
|
-
values: "0 10 ; 0 -10; 0 10",
|
|
1328
|
-
repeatCount: "indefinite",
|
|
1329
|
-
begin: "0.2"
|
|
1330
|
-
}
|
|
1331
|
-
) }),
|
|
1332
|
-
/* @__PURE__ */ e("circle", { cx: "54", cy: "50", r: "6", children: /* @__PURE__ */ e(
|
|
1333
|
-
"animateTransform",
|
|
1334
|
-
{
|
|
1335
|
-
attributeName: "transform",
|
|
1336
|
-
dur: "1s",
|
|
1337
|
-
type: "translate",
|
|
1338
|
-
values: "0 5 ; 0 -5; 0 5",
|
|
1339
|
-
repeatCount: "indefinite",
|
|
1340
|
-
begin: "0.3"
|
|
1341
|
-
}
|
|
1342
|
-
) })
|
|
1343
|
-
] }),
|
|
1344
|
-
s && /* @__PURE__ */ e("span", { className: "text-stone", children: s })
|
|
1345
|
-
]
|
|
1346
|
-
}
|
|
1347
|
-
), Re = P.memo(() => /* @__PURE__ */ e("div", { className: "messaging-loading-state flex items-center justify-center h-full", children: /* @__PURE__ */ i("div", { className: "flex items-center", children: [
|
|
1348
|
-
/* @__PURE__ */ e(ys, { className: "w-6 h-6" }),
|
|
1349
|
-
/* @__PURE__ */ e("span", { className: "text-sm text-stone", children: "Loading messages" })
|
|
1350
|
-
] }) }));
|
|
1351
|
-
Re.displayName = "LoadingState";
|
|
1352
1353
|
const Fs = ({
|
|
1353
1354
|
capabilities: t = {},
|
|
1354
1355
|
className: s,
|
|
@@ -1407,8 +1408,8 @@ const Fs = ({
|
|
|
1407
1408
|
U.forEach((L) => {
|
|
1408
1409
|
const ce = L.state.members;
|
|
1409
1410
|
Object.values(ce).forEach((Pe) => {
|
|
1410
|
-
var
|
|
1411
|
-
const de = (
|
|
1411
|
+
var he;
|
|
1412
|
+
const de = (he = Pe.user) == null ? void 0 : he.id;
|
|
1412
1413
|
de && de !== C && F.add(de);
|
|
1413
1414
|
});
|
|
1414
1415
|
}), Q((L) => L.size === F.size && [...L].every((ce) => F.has(ce)) ? L : F), b(U.length > 0), j(!0), ee.current = C, x && console.log("[MessagingShell] Channels synced successfully:", {
|
|
@@ -1543,7 +1544,7 @@ const Fs = ({
|
|
|
1543
1544
|
},
|
|
1544
1545
|
[Z, x]
|
|
1545
1546
|
), te = !!R;
|
|
1546
|
-
return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
|
|
1547
|
+
return E ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(me, {}) }) : I ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(le, { message: I, onBack: k }) }) : !N || !c ? /* @__PURE__ */ e("div", { className: p("h-full", s), children: /* @__PURE__ */ e(
|
|
1547
1548
|
le,
|
|
1548
1549
|
{
|
|
1549
1550
|
message: "Not connected to messaging service",
|
|
@@ -1564,16 +1565,15 @@ const Fs = ({
|
|
|
1564
1565
|
className: p(
|
|
1565
1566
|
"messaging-channel-list-sidebar min-h-0 min-w-0 lg:flex lg:flex-col",
|
|
1566
1567
|
{
|
|
1567
|
-
// Explicitly hidden via prop or in direct conversation mode
|
|
1568
1568
|
"!hidden": h === !1 || O,
|
|
1569
|
-
//
|
|
1569
|
+
// Hide on mobile when channel selected, show on desktop with consistent narrow width
|
|
1570
1570
|
"hidden lg:flex lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && te,
|
|
1571
|
-
//
|
|
1572
|
-
"flex flex-col w-full lg:
|
|
1571
|
+
// Show on mobile when no channel selected, use same narrow width on desktop
|
|
1572
|
+
"flex flex-col w-full lg:w-80 lg:min-w-[280px] lg:max-w-[360px]": h !== !1 && !O && !te
|
|
1573
1573
|
}
|
|
1574
1574
|
),
|
|
1575
1575
|
children: /* @__PURE__ */ e(
|
|
1576
|
-
|
|
1576
|
+
Ie,
|
|
1577
1577
|
{
|
|
1578
1578
|
onChannelSelect: _e,
|
|
1579
1579
|
selectedChannel: R || void 0,
|
|
@@ -1596,7 +1596,7 @@ const Fs = ({
|
|
|
1596
1596
|
}
|
|
1597
1597
|
),
|
|
1598
1598
|
children: R ? /* @__PURE__ */ e("div", { className: "flex-1 min-h-0 flex flex-col", children: /* @__PURE__ */ e(
|
|
1599
|
-
|
|
1599
|
+
ke,
|
|
1600
1600
|
{
|
|
1601
1601
|
channel: R,
|
|
1602
1602
|
onBack: De,
|
|
@@ -1612,7 +1612,7 @@ const Fs = ({
|
|
|
1612
1612
|
},
|
|
1613
1613
|
R.id
|
|
1614
1614
|
) }) : /* @__PURE__ */ e(
|
|
1615
|
-
|
|
1615
|
+
Re,
|
|
1616
1616
|
{
|
|
1617
1617
|
hasChannels: u,
|
|
1618
1618
|
channelsLoaded: B
|
|
@@ -1630,7 +1630,7 @@ const Fs = ({
|
|
|
1630
1630
|
onClick: Fe,
|
|
1631
1631
|
onClose: se,
|
|
1632
1632
|
children: /* @__PURE__ */ e("div", { className: "h-full w-full bg-white shadow-max-elevation-light", children: /* @__PURE__ */ e(
|
|
1633
|
-
|
|
1633
|
+
ws,
|
|
1634
1634
|
{
|
|
1635
1635
|
participantSource: T,
|
|
1636
1636
|
onSelectParticipant: Me,
|
|
@@ -1753,13 +1753,13 @@ const Fs = ({
|
|
|
1753
1753
|
export {
|
|
1754
1754
|
q as Avatar,
|
|
1755
1755
|
gs as ChannelEmptyState,
|
|
1756
|
-
|
|
1757
|
-
|
|
1756
|
+
Ie as ChannelList,
|
|
1757
|
+
ke as ChannelView,
|
|
1758
1758
|
Ts as FaqList,
|
|
1759
1759
|
Es as FaqListItem,
|
|
1760
1760
|
Ms as MessagingProvider,
|
|
1761
1761
|
Fs as MessagingShell,
|
|
1762
|
-
|
|
1762
|
+
ws as ParticipantPicker,
|
|
1763
1763
|
as as formatRelativeTime,
|
|
1764
1764
|
rs as useMessaging,
|
|
1765
1765
|
Ls as useParticipants
|