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