@burdenoff/microfe-conversations 2026.522.1 → 2026.523.2
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/conversations/ConversationsUserRoutes.d.ts.map +1 -1
- package/dist/conversations/ConversationsUserRoutes.js +17 -19
- package/dist/conversations/ConversationsUserRoutes.js.map +1 -1
- package/dist/conversations/components/ConversationCard.d.ts.map +1 -1
- package/dist/conversations/components/ConversationCard.js +2 -1
- package/dist/conversations/components/ConversationCard.js.map +1 -1
- package/dist/conversations/components/LazyPageBoundary.d.ts +3 -3
- package/dist/conversations/components/LazyPageBoundary.d.ts.map +1 -1
- package/dist/conversations/components/LazyPageBoundary.js.map +1 -1
- package/dist/conversations/components/MessageBubble.d.ts.map +1 -1
- package/dist/conversations/components/MessageBubble.js +22 -16
- package/dist/conversations/components/MessageBubble.js.map +1 -1
- package/dist/conversations/components/PageLayout.d.ts +3 -1
- package/dist/conversations/components/PageLayout.d.ts.map +1 -1
- package/dist/conversations/components/PageLayout.js +2 -1
- package/dist/conversations/components/PageLayout.js.map +1 -1
- package/dist/conversations/hooks/useConversationQueries.js +1 -1
- package/dist/conversations/hooks/useConversationQueries.js.map +1 -1
- package/dist/conversations/hooks/useMessageQueries.d.ts +1 -0
- package/dist/conversations/hooks/useMessageQueries.d.ts.map +1 -1
- package/dist/conversations/hooks/useMessageQueries.js +48 -42
- package/dist/conversations/hooks/useMessageQueries.js.map +1 -1
- package/dist/conversations/index.js +1 -1
- package/dist/conversations/pages/ConversationAdminPages.d.ts.map +1 -1
- package/dist/conversations/pages/ConversationAdminPages.js +139 -138
- package/dist/conversations/pages/ConversationAdminPages.js.map +1 -1
- package/dist/conversations/pages/ConversationDetailPage.d.ts.map +1 -1
- package/dist/conversations/pages/ConversationDetailPage.js +256 -230
- package/dist/conversations/pages/ConversationDetailPage.js.map +1 -1
- package/dist/conversations/pages/ConversationListPage.d.ts +1 -2
- package/dist/conversations/pages/ConversationListPage.d.ts.map +1 -1
- package/dist/conversations/pages/ConversationListPage.js +138 -125
- package/dist/conversations/pages/ConversationListPage.js.map +1 -1
- package/dist/conversations/pages/ConversationsLandingPage.d.ts.map +1 -1
- package/dist/conversations/pages/ConversationsLandingPage.js +3 -1
- package/dist/conversations/pages/ConversationsLandingPage.js.map +1 -1
- package/dist/conversations/pages/ConversationsSettingsPage.d.ts.map +1 -1
- package/dist/conversations/pages/ConversationsSettingsPage.js +5 -4
- package/dist/conversations/pages/ConversationsSettingsPage.js.map +1 -1
- package/dist/conversations/pages/NewConversationPage.d.ts.map +1 -1
- package/dist/conversations/pages/NewConversationPage.js +4 -0
- package/dist/conversations/pages/NewConversationPage.js.map +1 -1
- package/dist/conversations/providers/ConversationsProvider.d.ts.map +1 -1
- package/dist/conversations/providers/ConversationsProvider.js +10 -8
- package/dist/conversations/providers/ConversationsProvider.js.map +1 -1
- package/dist/index.js +5 -5
- package/package.json +1 -1
|
@@ -1,240 +1,263 @@
|
|
|
1
1
|
import { useConversations as e } from "../providers/ConversationsProvider.js";
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { useCallback as
|
|
12
|
-
import { Archive as
|
|
13
|
-
import { useNavigate as
|
|
14
|
-
import { useEventBus as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { useI18n as
|
|
3
|
+
import { useConversationsStore as n } from "../store/conversationsStore.js";
|
|
4
|
+
import { MessageBubble as r } from "../components/MessageBubble.js";
|
|
5
|
+
import { useConversationActions as i, useGetConversation as a } from "../hooks/useConversationQueries.js";
|
|
6
|
+
import { useEditMessage as ee, useGetMessages as te, useMessageActions as ne, useSendMessage as re } from "../hooks/useMessageQueries.js";
|
|
7
|
+
import { useMessageStreamForConversation as ie } from "../hooks/useMessageSubscriptions.js";
|
|
8
|
+
import { PermissionGuard as o } from "../components/PermissionGuard.js";
|
|
9
|
+
import { CONVERSATIONS_PERMISSIONS as s } from "../constants/permissions.js";
|
|
10
|
+
import { nativeImpact as ae, nativeNotify as c } from "../../utils/nativeBridge.js";
|
|
11
|
+
import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
|
|
12
|
+
import { Archive as oe, ArrowLeft as se, Bell as ce, BellOff as le, ExternalLink as ue, Hash as de, Loader2 as fe, MessageCircle as pe, MoreVertical as me, Pin as he, PinOff as ge, SendHorizontal as _e, Users as ve, X as ye } from "lucide-react";
|
|
13
|
+
import { useNavigate as be, useParams as xe } from "react-router-dom";
|
|
14
|
+
import { useEventBus as Se } from "@burdenoff/fe-libs/shared/events";
|
|
15
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
16
|
+
import { useI18n as Ce } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
17
17
|
//#region src/conversations/pages/ConversationDetailPage.tsx
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
var g = 100;
|
|
19
|
+
function _() {
|
|
20
|
+
let { conversationId: o } = xe(), s = be(), { basePath: _, currentUser: we } = e(), b = Se(), { t: Te } = Ce(), x = (e, t) => {
|
|
21
|
+
let n = Te(e);
|
|
21
22
|
return n === e ? t : n;
|
|
22
|
-
}, { clearMessageDraft:
|
|
23
|
-
|
|
24
|
-
let { sendMessage:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
}, { clearMessageDraft: S, isParticipantsPanelOpen: C, messageDrafts: Ee, setMessageDraft: w, toggleParticipantsPanel: T } = n(), [E, D] = p(Ee[o ?? ""] ?? ""), [O, k] = p([]), A = f(null), { conversation: j, loading: De, error: M } = a(o ?? ""), { messages: N, loading: P, error: F } = te(o ?? "", { first: g });
|
|
24
|
+
ie(o);
|
|
25
|
+
let { sendMessage: I, loading: L } = re(), { editMessage: R, loading: z } = ee(), { deleteMessage: B, addReaction: V, removeReaction: Oe, pinMessage: ke, unpinMessage: Ae } = ne(), { archiveConversation: je, pinConversation: Me, unpinConversation: Ne, muteConversation: Pe, unmuteConversation: Fe } = i(), [H, U] = p(!1), [W, G] = p(null), [K, q] = p(""), [J, Y] = p(null), X = f(null), Ie = we?.id ?? "", Z = j?.sourceContext, Q = d(() => {
|
|
26
|
+
let e = /* @__PURE__ */ new Map();
|
|
27
|
+
for (let t of O) t.conversationId === o && e.set(t.id, t);
|
|
28
|
+
for (let t of N) e.set(t.id, t);
|
|
29
|
+
return Array.from(e.values()).sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime());
|
|
30
|
+
}, [
|
|
31
|
+
o,
|
|
32
|
+
O,
|
|
33
|
+
N
|
|
34
|
+
]);
|
|
35
|
+
u(() => {
|
|
36
|
+
A.current?.scrollIntoView({ behavior: "smooth" });
|
|
37
|
+
}, [Q.length]), u(() => {
|
|
38
|
+
k([]);
|
|
39
|
+
}, [o]), u(() => {
|
|
40
|
+
if (O.length === 0 || N.length === 0) return;
|
|
41
|
+
let e = new Set(N.map((e) => e.id));
|
|
42
|
+
k((t) => {
|
|
43
|
+
let n = t.filter((t) => !e.has(t.id));
|
|
44
|
+
return n.length === t.length ? t : n;
|
|
45
|
+
});
|
|
46
|
+
}, [O.length, N]), u(() => {
|
|
47
|
+
if (o) {
|
|
48
|
+
if (E.trim()) {
|
|
49
|
+
w(o, E);
|
|
31
50
|
return;
|
|
32
51
|
}
|
|
33
|
-
|
|
52
|
+
S(o);
|
|
34
53
|
}
|
|
35
54
|
}, [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
55
|
+
E,
|
|
56
|
+
o,
|
|
57
|
+
w,
|
|
58
|
+
S
|
|
40
59
|
]);
|
|
41
|
-
let
|
|
60
|
+
let Le = d(() => {
|
|
42
61
|
let e = /* @__PURE__ */ new Map();
|
|
43
|
-
for (let t of
|
|
62
|
+
for (let t of Q) !t.authorId || e.has(t.authorId) || e.set(t.authorId, {
|
|
44
63
|
id: t.authorId,
|
|
45
64
|
name: t.sender.name || t.authorId
|
|
46
65
|
});
|
|
47
66
|
return Array.from(e.values());
|
|
48
|
-
}, [
|
|
49
|
-
if (!
|
|
50
|
-
let e = await
|
|
51
|
-
conversationId:
|
|
52
|
-
content:
|
|
67
|
+
}, [Q]), $ = l(async () => {
|
|
68
|
+
if (!o || !E.trim() || L) return;
|
|
69
|
+
let e = await I({
|
|
70
|
+
conversationId: o,
|
|
71
|
+
content: E.trim(),
|
|
53
72
|
type: "TEXT",
|
|
54
|
-
parentMessageId: J?.id
|
|
73
|
+
parentMessageId: J?.id,
|
|
74
|
+
refetchFirst: g
|
|
55
75
|
});
|
|
56
|
-
e && (
|
|
76
|
+
e && (k((t) => [...t, e]), b.emit("conversations.message.sent", {
|
|
57
77
|
messageId: e.id,
|
|
58
|
-
conversationId:
|
|
59
|
-
}),
|
|
78
|
+
conversationId: o
|
|
79
|
+
}), D(""), Y(null), S(o));
|
|
60
80
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
b,
|
|
82
|
+
o,
|
|
83
|
+
E,
|
|
84
|
+
L,
|
|
85
|
+
I,
|
|
86
|
+
S,
|
|
67
87
|
J
|
|
68
|
-
]),
|
|
69
|
-
e.key !== "Enter" || e.shiftKey || (e.preventDefault(),
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
88
|
+
]), Re = l((e) => {
|
|
89
|
+
e.key !== "Enter" || e.shiftKey || (e.preventDefault(), $());
|
|
90
|
+
}, [$]);
|
|
91
|
+
u(() => {
|
|
92
|
+
o && b.emit("conversations.conversation.opened", { conversationId: o });
|
|
93
|
+
}, [b, o]), u(() => {
|
|
74
94
|
if (!H) return;
|
|
75
95
|
let e = (e) => {
|
|
76
96
|
X.current && !X.current.contains(e.target) && U(!1);
|
|
77
97
|
};
|
|
78
98
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
79
99
|
}, [H]);
|
|
80
|
-
let
|
|
100
|
+
let ze = l((e) => {
|
|
81
101
|
Y({
|
|
82
102
|
id: e.id,
|
|
83
103
|
content: e.content,
|
|
84
104
|
sender: e.sender.name
|
|
85
105
|
});
|
|
86
|
-
}, []),
|
|
106
|
+
}, []), Be = l(async (e, t) => {
|
|
87
107
|
try {
|
|
88
|
-
await
|
|
108
|
+
await V(e, t);
|
|
89
109
|
} catch {
|
|
90
|
-
await
|
|
110
|
+
await Oe(e, t).catch(() => {});
|
|
91
111
|
}
|
|
92
|
-
}, [
|
|
112
|
+
}, [V, Oe]), Ve = l((e) => {
|
|
93
113
|
G(e.id), q(e.content);
|
|
94
|
-
}, []),
|
|
95
|
-
!W || !K.trim() ||
|
|
114
|
+
}, []), He = l(async () => {
|
|
115
|
+
!W || !K.trim() || z || (await R(W, K.trim()), G(null), q(""));
|
|
96
116
|
}, [
|
|
97
117
|
W,
|
|
98
118
|
K,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]),
|
|
119
|
+
z,
|
|
120
|
+
R
|
|
121
|
+
]), Ue = l(() => {
|
|
102
122
|
G(null), q("");
|
|
103
|
-
}, []),
|
|
104
|
-
|
|
123
|
+
}, []), We = l(async (e) => {
|
|
124
|
+
ae("medium");
|
|
105
125
|
try {
|
|
106
|
-
await
|
|
126
|
+
await B(e), c("success");
|
|
107
127
|
} catch (e) {
|
|
108
|
-
throw
|
|
128
|
+
throw c("error"), e;
|
|
109
129
|
}
|
|
110
|
-
}, [
|
|
130
|
+
}, [B]), Ge = l(async (e, t) => {
|
|
111
131
|
if (t) {
|
|
112
|
-
await
|
|
132
|
+
await Ae(e);
|
|
113
133
|
return;
|
|
114
134
|
}
|
|
115
|
-
await
|
|
116
|
-
}, [
|
|
117
|
-
|
|
135
|
+
await ke(e);
|
|
136
|
+
}, [ke, Ae]), Ke = l(async () => {
|
|
137
|
+
o && (j?.isPinned ? await Ne(o) : await Me(o), U(!1));
|
|
118
138
|
}, [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
]),
|
|
124
|
-
|
|
139
|
+
o,
|
|
140
|
+
j?.isPinned,
|
|
141
|
+
Me,
|
|
142
|
+
Ne
|
|
143
|
+
]), qe = l(async () => {
|
|
144
|
+
o && (j?.isMuted ? await Fe(o) : await Pe(o), U(!1));
|
|
125
145
|
}, [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
]),
|
|
131
|
-
|
|
146
|
+
o,
|
|
147
|
+
j?.isMuted,
|
|
148
|
+
Pe,
|
|
149
|
+
Fe
|
|
150
|
+
]), Je = l(async () => {
|
|
151
|
+
o && (await je(o), b.emit("conversations.conversation.archived", { conversationId: o }), U(!1), s(_ || "/conversations"));
|
|
132
152
|
}, [
|
|
133
|
-
|
|
134
|
-
m,
|
|
153
|
+
je,
|
|
135
154
|
_,
|
|
136
|
-
|
|
137
|
-
o
|
|
138
|
-
|
|
155
|
+
b,
|
|
156
|
+
o,
|
|
157
|
+
s
|
|
158
|
+
]), Ye = l(() => {
|
|
139
159
|
if (Z?.contextHref) {
|
|
140
160
|
try {
|
|
141
161
|
let e = new URL(Z.contextHref);
|
|
142
162
|
if (e.origin === window.location.origin) {
|
|
143
|
-
|
|
163
|
+
s(`${e.pathname}${e.search}${e.hash}`);
|
|
144
164
|
return;
|
|
145
165
|
}
|
|
146
166
|
} catch {}
|
|
147
167
|
window.location.assign(Z.contextHref);
|
|
148
168
|
}
|
|
149
|
-
}, [
|
|
150
|
-
return !
|
|
169
|
+
}, [s, Z?.contextHref]);
|
|
170
|
+
return !j && De ? /* @__PURE__ */ m("div", {
|
|
151
171
|
className: "flex items-center justify-center h-[calc(100vh-64px)] text-sm text-muted-foreground",
|
|
152
|
-
children:
|
|
153
|
-
}) : !
|
|
172
|
+
children: x("conversations.loading", "Loading conversation...")
|
|
173
|
+
}) : !j || M ? /* @__PURE__ */ h("div", {
|
|
154
174
|
className: "flex flex-col items-center justify-center h-[calc(100vh-64px)] text-center gap-3 px-4",
|
|
155
175
|
children: [
|
|
156
|
-
/* @__PURE__ */
|
|
157
|
-
/* @__PURE__ */
|
|
176
|
+
/* @__PURE__ */ m(pe, { className: "h-8 w-8 text-muted-foreground" }),
|
|
177
|
+
/* @__PURE__ */ m("p", {
|
|
158
178
|
className: "text-sm text-muted-foreground",
|
|
159
|
-
children:
|
|
179
|
+
children: M ? x("conversations.unavailable", "We couldn't load this conversation. Please try again.") : x("conversations.notFound", "Conversation not found")
|
|
160
180
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ m("button", {
|
|
162
182
|
type: "button",
|
|
163
|
-
onClick: () =>
|
|
183
|
+
onClick: () => s(_ || "/conversations"),
|
|
164
184
|
className: "px-3 py-2 text-sm font-medium rounded-lg border border-border hover:bg-muted/50",
|
|
165
|
-
children:
|
|
185
|
+
children: x("conversations.back", "Back to conversations")
|
|
166
186
|
})
|
|
167
187
|
]
|
|
168
|
-
}) : /* @__PURE__ */
|
|
169
|
-
className: "flex h-[calc(100vh-64px)] bg-background",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
188
|
+
}) : /* @__PURE__ */ h("div", {
|
|
189
|
+
className: "relative flex h-[calc(100vh-64px)] bg-background",
|
|
190
|
+
children: [/* @__PURE__ */ h("div", {
|
|
171
191
|
className: "flex-1 flex flex-col min-w-0",
|
|
172
192
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ h("header", {
|
|
194
|
+
"data-tour": "conversation-detail-header",
|
|
174
195
|
className: "flex items-center justify-between px-4 py-3 border-b border-border bg-background/95 backdrop-blur-sm",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ h("div", {
|
|
176
197
|
className: "flex items-center gap-3 min-w-0",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
198
|
+
children: [/* @__PURE__ */ m("button", {
|
|
178
199
|
type: "button",
|
|
179
|
-
onClick: () =>
|
|
180
|
-
className: "
|
|
181
|
-
children: /* @__PURE__ */
|
|
182
|
-
}), /* @__PURE__ */
|
|
200
|
+
onClick: () => s(_ || "/conversations"),
|
|
201
|
+
className: "flex min-h-10 min-w-10 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground",
|
|
202
|
+
children: /* @__PURE__ */ m(se, { size: 18 })
|
|
203
|
+
}), /* @__PURE__ */ h("div", {
|
|
183
204
|
className: "min-w-0",
|
|
184
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ h("div", {
|
|
185
206
|
className: "flex items-center gap-1.5",
|
|
186
|
-
children: [
|
|
207
|
+
children: [j.type === "CHANNEL" && /* @__PURE__ */ m(de, {
|
|
187
208
|
size: 14,
|
|
188
209
|
className: "text-muted-foreground flex-shrink-0"
|
|
189
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ m("h2", {
|
|
190
211
|
className: "text-sm font-semibold text-foreground truncate",
|
|
191
|
-
children:
|
|
212
|
+
children: j.title
|
|
192
213
|
})]
|
|
193
|
-
}), /* @__PURE__ */
|
|
214
|
+
}), /* @__PURE__ */ m("p", {
|
|
194
215
|
className: "text-xs text-muted-foreground",
|
|
195
|
-
children:
|
|
216
|
+
children: j.type === "DIRECT" ? x("conversations.directConversation", "Direct conversation") : j.type === "CHANNEL" ? `${x("conversations.channel", "Channel")} · ${j.memberCount} ${x("conversations.membersCountLabel", "members")}` : j.type === "ANNOUNCEMENT" ? `${x("conversations.announcement", "Announcement")} · ${j.memberCount} ${x("conversations.membersCountLabel", "members")}` : `${j.memberCount} ${x("conversations.membersCountLabel", "members")}`
|
|
196
217
|
})]
|
|
197
218
|
})]
|
|
198
|
-
}), /* @__PURE__ */
|
|
199
|
-
className: "flex items-center gap-1",
|
|
219
|
+
}), /* @__PURE__ */ h("div", {
|
|
220
|
+
className: "flex shrink-0 items-center gap-1",
|
|
200
221
|
children: [
|
|
201
|
-
Z?.contextHref && /* @__PURE__ */
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
222
|
+
Z?.contextHref && /* @__PURE__ */ m(y, {
|
|
223
|
+
dataTour: "conversation-open-context",
|
|
224
|
+
icon: /* @__PURE__ */ m(ue, { size: 16 }),
|
|
225
|
+
label: x("conversations.openContext", "Open context"),
|
|
226
|
+
onClick: Ye
|
|
205
227
|
}),
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
228
|
+
j.isGroup && /* @__PURE__ */ m(y, {
|
|
229
|
+
dataTour: "conversation-participants-button",
|
|
230
|
+
icon: /* @__PURE__ */ m(ve, { size: 16 }),
|
|
231
|
+
label: x("conversations.participants", "Participants"),
|
|
232
|
+
active: C,
|
|
233
|
+
onClick: T
|
|
211
234
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ h("div", {
|
|
213
236
|
className: "relative",
|
|
214
237
|
ref: X,
|
|
215
|
-
children: [/* @__PURE__ */
|
|
216
|
-
icon: /* @__PURE__ */
|
|
217
|
-
label:
|
|
238
|
+
children: [/* @__PURE__ */ m(y, {
|
|
239
|
+
icon: /* @__PURE__ */ m(me, { size: 16 }),
|
|
240
|
+
label: x("conversations.moreOptions", "More options"),
|
|
218
241
|
active: H,
|
|
219
242
|
onClick: () => U((e) => !e)
|
|
220
|
-
}), H && /* @__PURE__ */
|
|
243
|
+
}), H && /* @__PURE__ */ h("div", {
|
|
221
244
|
className: "absolute right-0 top-full mt-1 w-48 bg-popover border border-border rounded-lg shadow-lg z-50 py-1 animate-in fade-in-0 zoom-in-95 duration-100",
|
|
222
245
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
icon:
|
|
225
|
-
label:
|
|
226
|
-
onClick: () => void
|
|
246
|
+
/* @__PURE__ */ m(v, {
|
|
247
|
+
icon: j.isPinned ? /* @__PURE__ */ m(ge, { size: 14 }) : /* @__PURE__ */ m(he, { size: 14 }),
|
|
248
|
+
label: j.isPinned ? x("conversations.unpinConversation", "Unpin conversation") : x("conversations.pinConversation", "Pin conversation"),
|
|
249
|
+
onClick: () => void Ke()
|
|
227
250
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
-
icon:
|
|
230
|
-
label:
|
|
231
|
-
onClick: () => void
|
|
251
|
+
/* @__PURE__ */ m(v, {
|
|
252
|
+
icon: j.isMuted ? /* @__PURE__ */ m(ce, { size: 14 }) : /* @__PURE__ */ m(le, { size: 14 }),
|
|
253
|
+
label: j.isMuted ? x("conversations.unmuteConversation", "Unmute conversation") : x("conversations.muteConversation", "Mute conversation"),
|
|
254
|
+
onClick: () => void qe()
|
|
232
255
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
icon: /* @__PURE__ */
|
|
236
|
-
label:
|
|
237
|
-
onClick: () => void
|
|
256
|
+
/* @__PURE__ */ m("div", { className: "h-px bg-border my-1" }),
|
|
257
|
+
/* @__PURE__ */ m(v, {
|
|
258
|
+
icon: /* @__PURE__ */ m(oe, { size: 14 }),
|
|
259
|
+
label: x("conversations.archiveConversation", "Archive conversation"),
|
|
260
|
+
onClick: () => void Je(),
|
|
238
261
|
destructive: !0
|
|
239
262
|
})
|
|
240
263
|
]
|
|
@@ -243,106 +266,108 @@ function m() {
|
|
|
243
266
|
]
|
|
244
267
|
})]
|
|
245
268
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ h("div", {
|
|
247
270
|
className: "flex-1 overflow-y-auto py-4 space-y-0.5",
|
|
248
271
|
children: [
|
|
249
|
-
Z?.pagePath && /* @__PURE__ */
|
|
272
|
+
Z?.pagePath && /* @__PURE__ */ h("div", {
|
|
250
273
|
className: "mx-4 mb-4 rounded-lg border border-border bg-muted/20 px-3 py-2 text-xs text-muted-foreground",
|
|
251
|
-
children: [/* @__PURE__ */
|
|
274
|
+
children: [/* @__PURE__ */ m("span", {
|
|
252
275
|
className: "font-medium text-foreground",
|
|
253
276
|
children: Z.contextTitle || Z.pagePath
|
|
254
277
|
}), Z.entityType && Z.entityId ? ` · ${Z.entityType} ${Z.entityId}` : ""]
|
|
255
278
|
}),
|
|
256
|
-
|
|
279
|
+
F && /* @__PURE__ */ m("div", {
|
|
257
280
|
className: "mx-4 mb-4 rounded-lg border border-status-warning-border bg-status-warning-bg px-3 py-2 text-sm text-status-warning-text",
|
|
258
|
-
children:
|
|
281
|
+
children: x("conversations.messagesUnavailable", "Messages couldn't be loaded right now. The conversation header and actions are still available.")
|
|
259
282
|
}),
|
|
260
|
-
|
|
283
|
+
P && /* @__PURE__ */ h("div", {
|
|
261
284
|
className: "mx-4 mb-4 flex items-center gap-2 rounded-lg border border-border bg-muted/20 px-3 py-2 text-sm text-muted-foreground",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ m(fe, {
|
|
263
286
|
size: 14,
|
|
264
287
|
className: "animate-spin"
|
|
265
|
-
}),
|
|
288
|
+
}), x("conversations.loadingMessages", "Loading messages...")]
|
|
266
289
|
}),
|
|
267
|
-
!
|
|
290
|
+
!P && !F && Q.length === 0 && /* @__PURE__ */ m("div", {
|
|
268
291
|
className: "mx-4 mb-4 rounded-lg border border-dashed border-border bg-muted/20 px-3 py-6 text-center text-sm text-muted-foreground",
|
|
269
|
-
children:
|
|
292
|
+
children: x("conversations.noMessagesYet", "No messages yet. Start the conversation below.")
|
|
270
293
|
}),
|
|
271
|
-
|
|
272
|
-
let n =
|
|
273
|
-
return /* @__PURE__ */
|
|
294
|
+
Q.map((e, t) => {
|
|
295
|
+
let n = Q[t - 1], i = !n || n.authorId !== e.authorId || n.type === "SYSTEM";
|
|
296
|
+
return /* @__PURE__ */ m("div", { children: W === e.id ? /* @__PURE__ */ h("div", {
|
|
274
297
|
className: "px-4 py-2",
|
|
275
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ h("div", {
|
|
276
299
|
className: "flex items-center gap-2 text-xs text-muted-foreground mb-1",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
300
|
+
children: [/* @__PURE__ */ m("span", { children: x("conversations.editingMessage", "Editing message") }), /* @__PURE__ */ m("button", {
|
|
278
301
|
type: "button",
|
|
279
|
-
onClick:
|
|
302
|
+
onClick: Ue,
|
|
280
303
|
className: "hover:text-foreground",
|
|
281
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ m(ye, { size: 12 })
|
|
282
305
|
})]
|
|
283
|
-
}), /* @__PURE__ */
|
|
306
|
+
}), /* @__PURE__ */ h("div", {
|
|
284
307
|
className: "flex items-end gap-2",
|
|
285
|
-
children: [/* @__PURE__ */
|
|
308
|
+
children: [/* @__PURE__ */ m("textarea", {
|
|
286
309
|
value: K,
|
|
287
310
|
onChange: (e) => q(e.target.value),
|
|
288
311
|
onKeyDown: (e) => {
|
|
289
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
312
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), He()), e.key === "Escape" && Ue();
|
|
290
313
|
},
|
|
291
314
|
className: "flex-1 px-3 py-2 text-sm rounded-lg border border-border bg-muted/30 resize-none focus:outline-none focus:ring-2 focus:ring-ring",
|
|
292
315
|
rows: 2
|
|
293
|
-
}), /* @__PURE__ */
|
|
316
|
+
}), /* @__PURE__ */ m("button", {
|
|
294
317
|
type: "button",
|
|
295
|
-
onClick: () => void
|
|
296
|
-
disabled: !K.trim() ||
|
|
318
|
+
onClick: () => void He(),
|
|
319
|
+
disabled: !K.trim() || z,
|
|
297
320
|
className: "px-3 py-2 text-xs font-medium rounded-lg bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",
|
|
298
|
-
children:
|
|
321
|
+
children: x("conversations.save", "Save")
|
|
299
322
|
})]
|
|
300
323
|
})]
|
|
301
|
-
}) : /* @__PURE__ */
|
|
324
|
+
}) : /* @__PURE__ */ m(r, {
|
|
302
325
|
message: e,
|
|
303
|
-
isOwnMessage: e.authorId ===
|
|
304
|
-
showAvatar:
|
|
305
|
-
showSender:
|
|
306
|
-
onReply:
|
|
307
|
-
onReact: (e, t) => void
|
|
308
|
-
onEdit:
|
|
309
|
-
onDelete: (e) => void
|
|
310
|
-
onTogglePin: (e, t) => void
|
|
326
|
+
isOwnMessage: e.authorId === Ie,
|
|
327
|
+
showAvatar: i,
|
|
328
|
+
showSender: i,
|
|
329
|
+
onReply: ze,
|
|
330
|
+
onReact: (e, t) => void Be(e, t),
|
|
331
|
+
onEdit: Ve,
|
|
332
|
+
onDelete: (e) => void We(e),
|
|
333
|
+
onTogglePin: (e, t) => void Ge(e, t)
|
|
311
334
|
}) }, e.id);
|
|
312
335
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ m("div", { ref: A })
|
|
314
337
|
]
|
|
315
338
|
}),
|
|
316
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ h("div", {
|
|
340
|
+
"data-tour": "conversation-message-composer",
|
|
317
341
|
className: "border-t border-border px-4 py-3 bg-background",
|
|
318
|
-
children: [J && /* @__PURE__ */
|
|
342
|
+
children: [J && /* @__PURE__ */ h("div", {
|
|
319
343
|
className: "flex items-center gap-2 mb-2 px-3 py-1.5 rounded-lg bg-muted/50 text-xs text-muted-foreground",
|
|
320
|
-
children: [/* @__PURE__ */
|
|
321
|
-
|
|
344
|
+
children: [/* @__PURE__ */ h("span", { children: [
|
|
345
|
+
x("conversations.replyingTo", "Replying to"),
|
|
322
346
|
" ",
|
|
323
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ m("strong", {
|
|
324
348
|
className: "text-foreground",
|
|
325
349
|
children: J.sender
|
|
326
350
|
}),
|
|
327
351
|
": ",
|
|
328
352
|
J.content.slice(0, 80),
|
|
329
353
|
J.content.length > 80 ? "…" : ""
|
|
330
|
-
] }), /* @__PURE__ */
|
|
354
|
+
] }), /* @__PURE__ */ m("button", {
|
|
331
355
|
type: "button",
|
|
332
356
|
onClick: () => Y(null),
|
|
333
|
-
|
|
334
|
-
|
|
357
|
+
"aria-label": x("conversations.cancelReply", "Cancel reply"),
|
|
358
|
+
className: "ml-auto flex min-h-9 min-w-9 items-center justify-center rounded-md hover:bg-muted/70 hover:text-foreground",
|
|
359
|
+
children: /* @__PURE__ */ m(ye, { size: 12 })
|
|
335
360
|
})]
|
|
336
|
-
}), /* @__PURE__ */
|
|
361
|
+
}), /* @__PURE__ */ h("div", {
|
|
337
362
|
className: "flex items-end gap-2",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
363
|
+
children: [/* @__PURE__ */ m("div", {
|
|
339
364
|
className: "flex-1 relative",
|
|
340
|
-
children: /* @__PURE__ */
|
|
341
|
-
"aria-label":
|
|
342
|
-
value:
|
|
343
|
-
onChange: (e) =>
|
|
344
|
-
onKeyDown:
|
|
345
|
-
placeholder: `${
|
|
365
|
+
children: /* @__PURE__ */ m("textarea", {
|
|
366
|
+
"aria-label": x("conversations.messageComposer", "Message composer"),
|
|
367
|
+
value: E,
|
|
368
|
+
onChange: (e) => D(e.target.value),
|
|
369
|
+
onKeyDown: Re,
|
|
370
|
+
placeholder: `${x("conversations.messageConversationPrefix", "Message")} ${j.title}...`,
|
|
346
371
|
rows: 1,
|
|
347
372
|
className: t("w-full px-4 py-2.5 text-sm rounded-xl border border-border bg-muted/30", "resize-none overflow-hidden placeholder:text-muted-foreground", "focus:outline-none focus:ring-2 focus:ring-ring focus:border-transparent max-h-32"),
|
|
348
373
|
style: {
|
|
@@ -354,55 +379,55 @@ function m() {
|
|
|
354
379
|
t.style.height = "auto", t.style.height = `${Math.min(t.scrollHeight, 128)}px`;
|
|
355
380
|
}
|
|
356
381
|
})
|
|
357
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ m("button", {
|
|
358
383
|
type: "button",
|
|
359
|
-
"aria-label":
|
|
360
|
-
onClick: () => void
|
|
361
|
-
disabled: !
|
|
362
|
-
className: t("p-2.5 rounded-xl transition-all duration-150",
|
|
363
|
-
children:
|
|
384
|
+
"aria-label": x("conversations.sendMessage", "Send message"),
|
|
385
|
+
onClick: () => void $(),
|
|
386
|
+
disabled: !E.trim() || L,
|
|
387
|
+
className: t("p-2.5 rounded-xl transition-all duration-150", E.trim() && !L ? "bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm" : "bg-muted text-muted-foreground cursor-not-allowed"),
|
|
388
|
+
children: L ? /* @__PURE__ */ m(fe, {
|
|
364
389
|
size: 18,
|
|
365
390
|
className: "animate-spin"
|
|
366
|
-
}) : /* @__PURE__ */
|
|
391
|
+
}) : /* @__PURE__ */ m(_e, { size: 18 })
|
|
367
392
|
})]
|
|
368
393
|
})]
|
|
369
394
|
})
|
|
370
395
|
]
|
|
371
|
-
}),
|
|
372
|
-
className: "w-
|
|
373
|
-
children: /* @__PURE__ */
|
|
396
|
+
}), C && j.isGroup && /* @__PURE__ */ m("aside", {
|
|
397
|
+
className: "absolute inset-y-0 right-0 z-20 w-full max-w-72 border-l border-border bg-background shadow-lg animate-in slide-in-from-right-4 duration-200 md:relative md:z-auto md:w-64 md:shadow-none",
|
|
398
|
+
children: /* @__PURE__ */ h("div", {
|
|
374
399
|
className: "p-4",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
400
|
+
children: [/* @__PURE__ */ h("div", {
|
|
376
401
|
className: "flex items-center justify-between mb-4",
|
|
377
|
-
children: [/* @__PURE__ */
|
|
402
|
+
children: [/* @__PURE__ */ h("h3", {
|
|
378
403
|
className: "text-sm font-semibold text-foreground",
|
|
379
404
|
children: [
|
|
380
|
-
|
|
405
|
+
x("conversations.members", "Members"),
|
|
381
406
|
" (",
|
|
382
|
-
|
|
407
|
+
Le.length || j.memberCount,
|
|
383
408
|
")"
|
|
384
409
|
]
|
|
385
|
-
}), /* @__PURE__ */
|
|
410
|
+
}), /* @__PURE__ */ m("button", {
|
|
386
411
|
type: "button",
|
|
387
|
-
onClick:
|
|
412
|
+
onClick: T,
|
|
388
413
|
className: "p-1 rounded text-muted-foreground hover:text-foreground",
|
|
389
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ m(he, { size: 14 })
|
|
390
415
|
})]
|
|
391
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ m("div", {
|
|
392
417
|
className: "space-y-1",
|
|
393
|
-
children:
|
|
418
|
+
children: Le.map((e) => /* @__PURE__ */ h("div", {
|
|
394
419
|
className: "flex items-center gap-2.5 px-2 py-1.5 rounded-lg hover:bg-muted/50",
|
|
395
|
-
children: [/* @__PURE__ */
|
|
420
|
+
children: [/* @__PURE__ */ m("div", {
|
|
396
421
|
className: "w-7 h-7 rounded-full bg-muted flex items-center justify-center text-xs font-medium text-muted-foreground",
|
|
397
422
|
children: e.name.split(" ").map((e) => e[0]).join("").slice(0, 2)
|
|
398
|
-
}), /* @__PURE__ */
|
|
423
|
+
}), /* @__PURE__ */ h("div", {
|
|
399
424
|
className: "min-w-0",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ m("p", {
|
|
401
426
|
className: "text-xs font-medium text-foreground truncate",
|
|
402
427
|
children: e.name
|
|
403
|
-
}), /* @__PURE__ */
|
|
428
|
+
}), /* @__PURE__ */ m("p", {
|
|
404
429
|
className: "text-[10px] text-muted-foreground",
|
|
405
|
-
children:
|
|
430
|
+
children: x("conversations.member", "Member")
|
|
406
431
|
})]
|
|
407
432
|
})]
|
|
408
433
|
}, e.id))
|
|
@@ -411,29 +436,30 @@ function m() {
|
|
|
411
436
|
})]
|
|
412
437
|
});
|
|
413
438
|
}
|
|
414
|
-
function
|
|
415
|
-
return /* @__PURE__ */
|
|
439
|
+
function v({ icon: e, label: n, onClick: r, destructive: i }) {
|
|
440
|
+
return /* @__PURE__ */ h("button", {
|
|
416
441
|
type: "button",
|
|
417
442
|
onClick: r,
|
|
418
443
|
className: t("flex items-center gap-2.5 w-full px-3 py-2 text-sm transition-colors text-left", i ? "text-destructive hover:bg-destructive/10" : "text-foreground hover:bg-muted/50"),
|
|
419
|
-
children: [e, /* @__PURE__ */
|
|
444
|
+
children: [e, /* @__PURE__ */ m("span", { children: n })]
|
|
420
445
|
});
|
|
421
446
|
}
|
|
422
|
-
function
|
|
423
|
-
return /* @__PURE__ */
|
|
424
|
-
permission:
|
|
447
|
+
function y({ icon: e, label: n, active: r, dataTour: i, onClick: a }) {
|
|
448
|
+
return /* @__PURE__ */ m(o, {
|
|
449
|
+
permission: s.CONVERSATION_READ,
|
|
425
450
|
allowUnavailablePermissions: !0,
|
|
426
|
-
children: /* @__PURE__ */
|
|
451
|
+
children: /* @__PURE__ */ m("button", {
|
|
452
|
+
"data-tour": i,
|
|
427
453
|
type: "button",
|
|
428
|
-
onClick:
|
|
454
|
+
onClick: a,
|
|
429
455
|
"aria-label": n,
|
|
430
456
|
title: n,
|
|
431
|
-
className: t("
|
|
457
|
+
className: t("flex min-h-10 min-w-10 items-center justify-center rounded-lg transition-colors", r ? "bg-primary/10 text-primary" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"),
|
|
432
458
|
children: e
|
|
433
459
|
})
|
|
434
460
|
});
|
|
435
461
|
}
|
|
436
462
|
//#endregion
|
|
437
|
-
export {
|
|
463
|
+
export { _ as ConversationDetailPage };
|
|
438
464
|
|
|
439
465
|
//# sourceMappingURL=ConversationDetailPage.js.map
|