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