@nivaro/react 0.3.66 → 0.3.68
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +836 -835
- package/dist/shared/components/ActivityEntry.js +28 -28
- package/dist/shared/components/CollectionBrowserView.js +584 -585
- package/dist/shared/components/ConformanceView.js +34 -34
- package/dist/shared/components/ItemEditForm.js +1758 -1758
- package/dist/shared/components/RecordCompare.js +149 -129
- package/dist/shared/components/ReportView.js +196 -196
- package/dist/shared/components/SlaRulesView.js +36 -36
- package/dist/shared/components/bulk/BulkCompareButton.js +16 -16
- package/dist/shared/components/chat/ChatPanel.js +484 -487
- package/dist/shared/components/chat/ChatViews.js +66 -66
- package/dist/shared/components/chat/RoomParts.js +159 -157
- package/dist/shared/components/help-videos/editor/StatsTab.js +48 -47
- package/dist/shared/components/help-videos/editor/VersionsTab.js +17 -16
- package/dist/shared/components/imports/CollectionImportPanel.js +72 -72
- package/dist/shared/components/integrations/IntegrationObligationsView.js +199 -187
- package/dist/shared/components/integrations/console/EventsView.js +22 -24
- package/dist/shared/components/integrations/console/SubmissionRow.js +6 -13
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +29 -28
- package/dist/shared/components/integrations/console/tone.js +22 -21
- package/dist/shared/components/item-edit/FieldRow.js +188 -188
- package/dist/shared/components/item-edit/FilePickerField.js +281 -297
- package/dist/shared/components/item-edit/GroupSection.js +209 -209
- package/dist/shared/components/item-edit/RecordInsights.js +101 -101
- package/dist/shared/components/item-edit/SummaryPanel.js +31 -31
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +12 -12
- package/dist/shared/components/panels/AddendumPanel.js +409 -411
- package/dist/shared/components/panels/BranchLanes.js +7 -7
- package/dist/shared/components/panels/CommentPanel.js +204 -197
- package/dist/shared/components/panels/PipelinePanel.js +264 -264
- package/dist/shared/components/panels/RecordIntegrityBanner.js +78 -78
- package/dist/shared/components/panels/RevisionsPanel.js +229 -229
- package/dist/shared/components/panels/TaskPanel.js +75 -75
- package/dist/shared/components/queue/QueueWorklist.js +591 -589
- package/dist/shared/lib/compare-value.js +73 -0
- package/dist/shared/lib/format-value.js +18 -17
- package/dist/shared/lib/utils.js +87 -80
- package/package.json +1 -1
|
@@ -1,110 +1,111 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import { Users as
|
|
3
|
-
import { useState as f, useRef as
|
|
4
|
-
import { useNivaroClient as
|
|
2
|
+
import { Users as I, Link2 as K, ChevronLeft as W, Sparkles as B, Pin as X, X as Z, FileText as A, ExternalLink as ee } from "lucide-react";
|
|
3
|
+
import { useState as f, useRef as te, useEffect as ae } from "react";
|
|
4
|
+
import { useNivaroClient as re } from "../../context.js";
|
|
5
5
|
import { safeLinkKind as T } from "../../lib/safe-href.js";
|
|
6
|
-
import { cn as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
6
|
+
import { cn as x, formatFileSize as le, formatRelative as Q } from "../../lib/utils.js";
|
|
7
|
+
import { useFileDownload as se } from "../item-edit/file-download.js";
|
|
8
|
+
import { Popover as ne, PopoverTrigger as de, PopoverContent as ie } from "../ui/popover.js";
|
|
9
|
+
import { openDmWith as oe, useChatThread as ce, useDebouncedMemberQuery as me, usePagedMembers as xe, canOpenDm as he } from "./chat-core.js";
|
|
10
|
+
import { useRoomInfo as j, useRoomSummary as q, useRoomShared as pe } from "./chat-hooks.js";
|
|
11
|
+
import { MemberSearchBox as ue, memberCountLabel as be, MemberOnlineDot as fe, MemberLoadMore as ge } from "./MemberPaging.js";
|
|
12
|
+
function ze({
|
|
12
13
|
room: d,
|
|
13
14
|
rootId: l,
|
|
14
15
|
th: n,
|
|
15
|
-
onClose:
|
|
16
|
-
renderRow:
|
|
17
|
-
renderComposer:
|
|
16
|
+
onClose: o,
|
|
17
|
+
renderRow: m,
|
|
18
|
+
renderComposer: h,
|
|
18
19
|
renderOutbox: s
|
|
19
20
|
}) {
|
|
20
|
-
const { root:
|
|
21
|
-
return
|
|
21
|
+
const { root: b, replies: u, loading: k } = ce(d, l), i = q(), [a, c] = f(null), C = te(null);
|
|
22
|
+
return ae(() => {
|
|
22
23
|
var p;
|
|
23
|
-
(p =
|
|
24
|
-
}, [
|
|
24
|
+
(p = C.current) == null || p.scrollIntoView({ block: "end" });
|
|
25
|
+
}, [u.length]), /* @__PURE__ */ r(
|
|
25
26
|
"div",
|
|
26
27
|
{
|
|
27
|
-
className:
|
|
28
|
+
className: x("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
|
|
28
29
|
"data-chat-thread": l,
|
|
29
30
|
children: [
|
|
30
|
-
/* @__PURE__ */ r("div", { className:
|
|
31
|
+
/* @__PURE__ */ r("div", { className: x("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
|
|
31
32
|
/* @__PURE__ */ e(
|
|
32
33
|
"button",
|
|
33
34
|
{
|
|
34
35
|
type: "button",
|
|
35
|
-
onClick:
|
|
36
|
+
onClick: o,
|
|
36
37
|
className: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
37
38
|
"aria-label": "Back to the conversation",
|
|
38
|
-
children: /* @__PURE__ */ e(
|
|
39
|
+
children: /* @__PURE__ */ e(W, { className: "h-4 w-4", strokeWidth: 2 })
|
|
39
40
|
}
|
|
40
41
|
),
|
|
41
42
|
/* @__PURE__ */ r("p", { className: "flex-1 text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
42
43
|
"Thread",
|
|
43
44
|
/* @__PURE__ */ r("span", { className: "ml-1.5 text-[11px] font-normal text-slate-500 dark:text-slate-400", children: [
|
|
44
|
-
|
|
45
|
+
u.length,
|
|
45
46
|
" ",
|
|
46
|
-
|
|
47
|
+
u.length === 1 ? "reply" : "replies"
|
|
47
48
|
] })
|
|
48
49
|
] }),
|
|
49
|
-
|
|
50
|
+
u.length >= 2 && /* @__PURE__ */ r(
|
|
50
51
|
"button",
|
|
51
52
|
{
|
|
52
53
|
type: "button",
|
|
53
|
-
disabled:
|
|
54
|
-
onClick: () =>
|
|
54
|
+
disabled: i.isPending,
|
|
55
|
+
onClick: () => i.mutate(
|
|
55
56
|
{ room: d, thread: l },
|
|
56
|
-
{ onSuccess: (p) =>
|
|
57
|
+
{ onSuccess: (p) => c(p.summary ?? "Not enough to summarize yet.") }
|
|
57
58
|
),
|
|
58
|
-
className:
|
|
59
|
+
className: x(
|
|
59
60
|
"flex items-center gap-1 rounded-md px-1.5 py-1 text-[11px] font-medium hover:bg-slate-100 disabled:opacity-50 dark:hover:bg-muted",
|
|
60
61
|
n.accentText
|
|
61
62
|
),
|
|
62
63
|
"data-chat-thread-summarize": !0,
|
|
63
64
|
children: [
|
|
64
|
-
/* @__PURE__ */ e(
|
|
65
|
-
|
|
65
|
+
/* @__PURE__ */ e(B, { className: "h-3.5 w-3.5" }),
|
|
66
|
+
i.isPending ? "Summarizing…" : "Summarize"
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
69
|
)
|
|
69
70
|
] }),
|
|
70
|
-
|
|
71
|
+
a && /* @__PURE__ */ e(
|
|
71
72
|
"div",
|
|
72
73
|
{
|
|
73
|
-
className:
|
|
74
|
+
className: x(
|
|
74
75
|
"shrink-0 border-b px-3 py-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200",
|
|
75
76
|
n.divider
|
|
76
77
|
),
|
|
77
|
-
children:
|
|
78
|
+
children: a
|
|
78
79
|
}
|
|
79
80
|
),
|
|
80
81
|
/* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-2.5 overflow-y-auto px-3 py-3", children: [
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
k ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r($, { children: [
|
|
83
|
+
b && /* @__PURE__ */ e("div", { className: x("border-b pb-2.5", n.divider), children: m(b, { inThread: !0 }) }),
|
|
84
|
+
u.map((p) => /* @__PURE__ */ e("div", { children: m(p, { inThread: !0 }) }, p.id)),
|
|
84
85
|
s(l)
|
|
85
86
|
] }),
|
|
86
|
-
/* @__PURE__ */ e("div", { ref:
|
|
87
|
+
/* @__PURE__ */ e("div", { ref: C })
|
|
87
88
|
] }),
|
|
88
|
-
|
|
89
|
+
h(l)
|
|
89
90
|
]
|
|
90
91
|
}
|
|
91
92
|
);
|
|
92
93
|
}
|
|
93
|
-
function
|
|
94
|
+
function Te({
|
|
94
95
|
description: d,
|
|
95
96
|
links: l,
|
|
96
97
|
th: n,
|
|
97
|
-
navigate:
|
|
98
|
+
navigate: o
|
|
98
99
|
}) {
|
|
99
|
-
const [
|
|
100
|
-
return !d && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className:
|
|
100
|
+
const [m, h] = f(!1);
|
|
101
|
+
return !d && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className: x("shrink-0 border-b px-3 py-1.5", n.divider), "data-chat-channel-intro": !0, children: [
|
|
101
102
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
102
103
|
d && /* @__PURE__ */ e(
|
|
103
104
|
"p",
|
|
104
105
|
{
|
|
105
|
-
className:
|
|
106
|
+
className: x(
|
|
106
107
|
"min-w-0 flex-1 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
|
|
107
|
-
!
|
|
108
|
+
!m && "line-clamp-1"
|
|
108
109
|
),
|
|
109
110
|
children: d
|
|
110
111
|
}
|
|
@@ -113,9 +114,9 @@ function Le({
|
|
|
113
114
|
"button",
|
|
114
115
|
{
|
|
115
116
|
type: "button",
|
|
116
|
-
onClick: () =>
|
|
117
|
+
onClick: () => h((s) => !s),
|
|
117
118
|
className: "shrink-0 text-[11px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
|
|
118
|
-
children:
|
|
119
|
+
children: m ? "Less" : "More"
|
|
119
120
|
}
|
|
120
121
|
)
|
|
121
122
|
] }),
|
|
@@ -125,13 +126,13 @@ function Le({
|
|
|
125
126
|
href: s.url,
|
|
126
127
|
target: T(s.url) === "internal" ? void 0 : "_blank",
|
|
127
128
|
rel: "noopener noreferrer",
|
|
128
|
-
onClick: (
|
|
129
|
-
T(s.url) === "internal" &&
|
|
129
|
+
onClick: (b) => {
|
|
130
|
+
T(s.url) === "internal" && o && (b.preventDefault(), o(s.url));
|
|
130
131
|
},
|
|
131
132
|
className: "inline-flex max-w-[200px] items-center gap-1 rounded-full border border-slate-200 bg-white px-2 py-0.5 text-[11px] text-slate-700 hover:border-slate-300 dark:border-border dark:bg-card dark:text-slate-200",
|
|
132
133
|
"data-chat-channel-link": !0,
|
|
133
134
|
children: [
|
|
134
|
-
/* @__PURE__ */ e(
|
|
135
|
+
/* @__PURE__ */ e(K, { className: "h-3 w-3 shrink-0 opacity-60" }),
|
|
135
136
|
/* @__PURE__ */ e("span", { className: "truncate", children: s.label })
|
|
136
137
|
]
|
|
137
138
|
},
|
|
@@ -139,18 +140,18 @@ function Le({
|
|
|
139
140
|
)) })
|
|
140
141
|
] });
|
|
141
142
|
}
|
|
142
|
-
function
|
|
143
|
+
function Oe({
|
|
143
144
|
note: d,
|
|
144
145
|
channelName: l,
|
|
145
146
|
onDismiss: n,
|
|
146
|
-
th:
|
|
147
|
+
th: o
|
|
147
148
|
}) {
|
|
148
149
|
return /* @__PURE__ */ e(
|
|
149
150
|
"div",
|
|
150
151
|
{
|
|
151
|
-
className:
|
|
152
|
+
className: x(
|
|
152
153
|
"mx-3 mt-3 rounded-xl border px-3 py-2.5",
|
|
153
|
-
|
|
154
|
+
o.divider,
|
|
154
155
|
"bg-slate-50 dark:bg-muted/40"
|
|
155
156
|
),
|
|
156
157
|
"data-chat-welcome": !0,
|
|
@@ -176,11 +177,11 @@ function Me({
|
|
|
176
177
|
}
|
|
177
178
|
);
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function De({
|
|
180
181
|
onJump: d,
|
|
181
182
|
onDone: l
|
|
182
183
|
}) {
|
|
183
|
-
const [n,
|
|
184
|
+
const [n, o] = f("");
|
|
184
185
|
return /* @__PURE__ */ r($, { children: [
|
|
185
186
|
/* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Jump to a date" }),
|
|
186
187
|
/* @__PURE__ */ e(
|
|
@@ -189,7 +190,7 @@ function ze({
|
|
|
189
190
|
type: "date",
|
|
190
191
|
value: n,
|
|
191
192
|
max: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
192
|
-
onChange: (
|
|
193
|
+
onChange: (m) => o(m.target.value),
|
|
193
194
|
className: "h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12px] outline-none dark:border-border dark:bg-background dark:text-slate-100",
|
|
194
195
|
"aria-label": "Date"
|
|
195
196
|
}
|
|
@@ -198,18 +199,18 @@ function ze({
|
|
|
198
199
|
["Yesterday", 1],
|
|
199
200
|
["Last week", 7],
|
|
200
201
|
["Last month", 30]
|
|
201
|
-
].map(([
|
|
202
|
+
].map(([m, h]) => /* @__PURE__ */ e(
|
|
202
203
|
"button",
|
|
203
204
|
{
|
|
204
205
|
type: "button",
|
|
205
206
|
onClick: () => {
|
|
206
|
-
const s = new Date(Date.now() -
|
|
207
|
+
const s = new Date(Date.now() - h * 864e5);
|
|
207
208
|
s.setHours(0, 0, 0, 0), d(s.toISOString()), l == null || l();
|
|
208
209
|
},
|
|
209
210
|
className: "flex-1 rounded-md border border-slate-200 px-1 py-1 text-[10.5px] text-slate-600 hover:bg-muted dark:border-border dark:text-slate-300",
|
|
210
|
-
children:
|
|
211
|
+
children: m
|
|
211
212
|
},
|
|
212
|
-
|
|
213
|
+
m
|
|
213
214
|
)) }),
|
|
214
215
|
/* @__PURE__ */ e(
|
|
215
216
|
"button",
|
|
@@ -217,8 +218,8 @@ function ze({
|
|
|
217
218
|
type: "button",
|
|
218
219
|
disabled: !n,
|
|
219
220
|
onClick: () => {
|
|
220
|
-
const [
|
|
221
|
-
d(new Date(
|
|
221
|
+
const [m, h, s] = n.split("-").map(Number);
|
|
222
|
+
d(new Date(m, h - 1, s).toISOString()), l == null || l();
|
|
222
223
|
},
|
|
223
224
|
className: "mt-2 h-8 w-full rounded-md bg-nvr-cyan text-[12px] font-medium text-white disabled:opacity-40",
|
|
224
225
|
children: "Go"
|
|
@@ -226,43 +227,43 @@ function ze({
|
|
|
226
227
|
)
|
|
227
228
|
] });
|
|
228
229
|
}
|
|
229
|
-
function
|
|
230
|
+
function Pe({
|
|
230
231
|
room: d,
|
|
231
232
|
label: l,
|
|
232
233
|
th: n,
|
|
233
|
-
pins:
|
|
234
|
-
onClose:
|
|
235
|
-
onOpenMessage:
|
|
234
|
+
pins: o,
|
|
235
|
+
onClose: m,
|
|
236
|
+
onOpenMessage: h,
|
|
236
237
|
renderAvatar: s,
|
|
237
|
-
onUnpin:
|
|
238
|
-
navigate:
|
|
238
|
+
onUnpin: b,
|
|
239
|
+
navigate: u
|
|
239
240
|
}) {
|
|
240
|
-
const
|
|
241
|
+
const k = re(), i = se(), a = j(d), [c, C] = f("members"), p = pe(d, c === "files" || c === "links"), [O, E] = f(""), S = O.trim().toLowerCase(), D = S ? p.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : p.files, P = S ? p.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : p.links, [L, G] = f(""), H = me(L, 250), _ = L.trim().toLowerCase(), v = !!a && a.members.length >= a.member_count, y = xe(
|
|
241
242
|
d,
|
|
242
243
|
`/chat/rooms/${encodeURIComponent(d)}/members`,
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
), M =
|
|
244
|
+
H,
|
|
245
|
+
c === "members" && !!a && !v
|
|
246
|
+
), M = v ? _ ? a.members.filter((t) => t.name.toLowerCase().includes(_.replace(/^@/, ""))) : a.members : y.members, V = v ? M.length : y.total, w = q(), [z, Y] = f(""), [R, U] = f(null), J = [
|
|
246
247
|
["members", `Members${a ? ` · ${a.member_count}` : ""}`],
|
|
247
|
-
["pinned", `Pinned${
|
|
248
|
+
["pinned", `Pinned${o.length ? ` · ${o.length}` : ""}`],
|
|
248
249
|
["files", `Files${a != null && a.file_count ? ` · ${a.file_count}` : ""}`],
|
|
249
250
|
["links", "Links"]
|
|
250
251
|
];
|
|
251
252
|
return /* @__PURE__ */ r(
|
|
252
253
|
"div",
|
|
253
254
|
{
|
|
254
|
-
className:
|
|
255
|
+
className: x("absolute inset-0 z-20 flex min-h-0 flex-col", n.surface),
|
|
255
256
|
"data-chat-room-info": !0,
|
|
256
257
|
children: [
|
|
257
|
-
/* @__PURE__ */ r("div", { className:
|
|
258
|
+
/* @__PURE__ */ r("div", { className: x("flex shrink-0 items-center gap-2 border-b px-3 py-2", n.divider), children: [
|
|
258
259
|
/* @__PURE__ */ e(
|
|
259
260
|
"button",
|
|
260
261
|
{
|
|
261
262
|
type: "button",
|
|
262
|
-
onClick:
|
|
263
|
+
onClick: m,
|
|
263
264
|
className: "rounded-md p-1 text-slate-400 hover:bg-slate-100 hover:text-slate-600 dark:hover:bg-white/10 dark:hover:text-slate-100",
|
|
264
265
|
"aria-label": "Back to the conversation",
|
|
265
|
-
children: /* @__PURE__ */ e(
|
|
266
|
+
children: /* @__PURE__ */ e(W, { className: "h-4 w-4", strokeWidth: 2 })
|
|
266
267
|
}
|
|
267
268
|
),
|
|
268
269
|
/* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l })
|
|
@@ -271,7 +272,7 @@ function Te({
|
|
|
271
272
|
/* @__PURE__ */ r(
|
|
272
273
|
"dl",
|
|
273
274
|
{
|
|
274
|
-
className:
|
|
275
|
+
className: x(
|
|
275
276
|
"grid grid-cols-2 gap-x-3 gap-y-2 border-b px-3 py-3 text-[11.5px]",
|
|
276
277
|
n.divider
|
|
277
278
|
),
|
|
@@ -298,7 +299,7 @@ function Te({
|
|
|
298
299
|
]
|
|
299
300
|
}
|
|
300
301
|
),
|
|
301
|
-
/* @__PURE__ */ r("div", { className:
|
|
302
|
+
/* @__PURE__ */ r("div", { className: x("border-b px-3 py-2.5", n.divider), "data-chat-summarize-range": !0, children: [
|
|
302
303
|
/* @__PURE__ */ e("p", { className: "text-[11.5px] font-semibold text-slate-700 dark:text-slate-200", children: "Summarize" }),
|
|
303
304
|
/* @__PURE__ */ r("div", { className: "mt-1.5 flex flex-wrap items-center gap-1.5", children: [
|
|
304
305
|
[
|
|
@@ -308,14 +309,14 @@ function Te({
|
|
|
308
309
|
"button",
|
|
309
310
|
{
|
|
310
311
|
type: "button",
|
|
311
|
-
disabled:
|
|
312
|
-
onClick: () =>
|
|
312
|
+
disabled: w.isPending,
|
|
313
|
+
onClick: () => w.mutate(
|
|
313
314
|
{
|
|
314
315
|
room: d,
|
|
315
316
|
since: new Date(Date.now() - N * 864e5).toISOString()
|
|
316
317
|
},
|
|
317
318
|
{
|
|
318
|
-
onSuccess: (g) =>
|
|
319
|
+
onSuccess: (g) => U(
|
|
319
320
|
g.summary ?? `Only ${g.count} messages — nothing to summarize.`
|
|
320
321
|
)
|
|
321
322
|
}
|
|
@@ -330,7 +331,7 @@ function Te({
|
|
|
330
331
|
{
|
|
331
332
|
type: "date",
|
|
332
333
|
value: z,
|
|
333
|
-
onChange: (t) =>
|
|
334
|
+
onChange: (t) => Y(t.target.value),
|
|
334
335
|
className: "h-6 rounded-md border border-slate-200 bg-white px-1.5 text-[11px] outline-none dark:border-border dark:bg-background dark:text-slate-100",
|
|
335
336
|
"aria-label": "Summarize since"
|
|
336
337
|
}
|
|
@@ -339,42 +340,42 @@ function Te({
|
|
|
339
340
|
"button",
|
|
340
341
|
{
|
|
341
342
|
type: "button",
|
|
342
|
-
disabled: !z ||
|
|
343
|
+
disabled: !z || w.isPending,
|
|
343
344
|
onClick: () => {
|
|
344
345
|
const [t, N, g] = z.split("-").map(Number);
|
|
345
|
-
|
|
346
|
+
w.mutate(
|
|
346
347
|
{ room: d, since: new Date(t, N - 1, g).toISOString() },
|
|
347
348
|
{
|
|
348
|
-
onSuccess: (
|
|
349
|
-
|
|
349
|
+
onSuccess: (F) => U(
|
|
350
|
+
F.summary ?? `Only ${F.count} messages — nothing to summarize.`
|
|
350
351
|
)
|
|
351
352
|
}
|
|
352
353
|
);
|
|
353
354
|
},
|
|
354
|
-
className:
|
|
355
|
+
className: x(
|
|
355
356
|
"inline-flex items-center gap-1 text-[11px] font-medium disabled:opacity-40",
|
|
356
357
|
n.accentText
|
|
357
358
|
),
|
|
358
359
|
children: [
|
|
359
|
-
/* @__PURE__ */ e(
|
|
360
|
+
/* @__PURE__ */ e(B, { className: "h-3 w-3" }),
|
|
360
361
|
" ",
|
|
361
|
-
|
|
362
|
+
w.isPending ? "Summarizing…" : "Since then"
|
|
362
363
|
]
|
|
363
364
|
}
|
|
364
365
|
)
|
|
365
366
|
] }),
|
|
366
|
-
|
|
367
|
+
R && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: R })
|
|
367
368
|
] }),
|
|
368
|
-
/* @__PURE__ */ e("div", { className:
|
|
369
|
+
/* @__PURE__ */ e("div", { className: x("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children: J.map(([t, N]) => /* @__PURE__ */ e(
|
|
369
370
|
"button",
|
|
370
371
|
{
|
|
371
372
|
type: "button",
|
|
372
373
|
role: "tab",
|
|
373
|
-
"aria-selected":
|
|
374
|
-
onClick: () =>
|
|
375
|
-
className:
|
|
374
|
+
"aria-selected": c === t,
|
|
375
|
+
onClick: () => C(t),
|
|
376
|
+
className: x(
|
|
376
377
|
"-mb-px border-b-2 px-2 pb-1.5 text-[11.5px] font-medium",
|
|
377
|
-
|
|
378
|
+
c === t ? "border-slate-800 text-slate-800 dark:border-slate-100 dark:text-slate-100" : "border-transparent text-slate-500 hover:text-slate-700 dark:text-slate-400"
|
|
378
379
|
),
|
|
379
380
|
"data-chat-info-tab": t,
|
|
380
381
|
children: N
|
|
@@ -382,15 +383,15 @@ function Te({
|
|
|
382
383
|
t
|
|
383
384
|
)) }),
|
|
384
385
|
/* @__PURE__ */ r("div", { className: "px-3 py-2", children: [
|
|
385
|
-
|
|
386
|
+
c === "members" && /* @__PURE__ */ r($, { children: [
|
|
386
387
|
a && a.member_count > 10 && /* @__PURE__ */ r("div", { className: "mb-2 space-y-1", children: [
|
|
387
|
-
/* @__PURE__ */ e(
|
|
388
|
+
/* @__PURE__ */ e(ue, { value: L, onChange: G }),
|
|
388
389
|
/* @__PURE__ */ e(
|
|
389
390
|
"p",
|
|
390
391
|
{
|
|
391
392
|
className: "text-[10.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
392
393
|
"data-chat-member-count": !0,
|
|
393
|
-
children:
|
|
394
|
+
children: be(V, !!_)
|
|
394
395
|
}
|
|
395
396
|
)
|
|
396
397
|
] }),
|
|
@@ -401,12 +402,12 @@ function Te({
|
|
|
401
402
|
t.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500", children: t.title })
|
|
402
403
|
] }),
|
|
403
404
|
t.online && /* @__PURE__ */ r("span", { className: "flex items-center gap-1 text-[10.5px] text-emerald-700 dark:text-emerald-400", children: [
|
|
404
|
-
/* @__PURE__ */ e(
|
|
405
|
+
/* @__PURE__ */ e(fe, { online: !0 }),
|
|
405
406
|
"Online"
|
|
406
407
|
] })
|
|
407
|
-
] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: !a || !
|
|
408
|
-
!
|
|
409
|
-
|
|
408
|
+
] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: !a || !v && y.loading ? "Loading…" : _ ? "No one matches." : "Anyone who can open this room can read it." }),
|
|
409
|
+
!v && /* @__PURE__ */ e(
|
|
410
|
+
ge,
|
|
410
411
|
{
|
|
411
412
|
hasMore: y.hasMore,
|
|
412
413
|
loading: y.loadingMore,
|
|
@@ -414,13 +415,13 @@ function Te({
|
|
|
414
415
|
}
|
|
415
416
|
)
|
|
416
417
|
] }),
|
|
417
|
-
|
|
418
|
-
/* @__PURE__ */ e(
|
|
418
|
+
c === "pinned" && (o.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: o.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
|
|
419
|
+
/* @__PURE__ */ e(X, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
|
|
419
420
|
/* @__PURE__ */ r(
|
|
420
421
|
"button",
|
|
421
422
|
{
|
|
422
423
|
type: "button",
|
|
423
|
-
onClick: () =>
|
|
424
|
+
onClick: () => h(t.id),
|
|
424
425
|
className: "min-w-0 flex-1 text-left text-slate-700 hover:underline dark:text-slate-200",
|
|
425
426
|
children: [
|
|
426
427
|
/* @__PURE__ */ r("span", { className: "font-medium", children: [
|
|
@@ -435,50 +436,51 @@ function Te({
|
|
|
435
436
|
"button",
|
|
436
437
|
{
|
|
437
438
|
type: "button",
|
|
438
|
-
onClick: () =>
|
|
439
|
+
onClick: () => b(t.id),
|
|
439
440
|
className: "shrink-0 text-slate-400 hover:text-red-500",
|
|
440
441
|
"aria-label": "Unpin",
|
|
441
|
-
children: /* @__PURE__ */ e(
|
|
442
|
+
children: /* @__PURE__ */ e(Z, { className: "h-3 w-3" })
|
|
442
443
|
}
|
|
443
444
|
)
|
|
444
445
|
] }, t.pin_id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Nothing pinned. Hover a message and use the pin to keep it here." })),
|
|
445
|
-
(
|
|
446
|
+
(c === "files" || c === "links") && /* @__PURE__ */ e(
|
|
446
447
|
"input",
|
|
447
448
|
{
|
|
448
|
-
value:
|
|
449
|
-
onChange: (t) =>
|
|
450
|
-
placeholder:
|
|
449
|
+
value: O,
|
|
450
|
+
onChange: (t) => E(t.target.value),
|
|
451
|
+
placeholder: c === "files" ? "Search files or people" : "Search links or people",
|
|
451
452
|
"aria-label": "Search shared items",
|
|
452
453
|
"data-chat-shared-search": !0,
|
|
453
454
|
className: "mb-2 h-7 w-full rounded-md border border-slate-200 bg-transparent px-2 text-[11.5px] outline-none focus:border-slate-400 dark:border-slate-700"
|
|
454
455
|
}
|
|
455
456
|
),
|
|
456
|
-
|
|
457
|
+
c === "files" && (p.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : D.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: D.map((t) => /* @__PURE__ */ r(
|
|
457
458
|
"li",
|
|
458
459
|
{
|
|
459
460
|
className: "flex items-center gap-2 text-[11.5px]",
|
|
460
461
|
children: [
|
|
461
|
-
/* @__PURE__ */ e(
|
|
462
|
+
/* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
462
463
|
/* @__PURE__ */ e(
|
|
463
464
|
"a",
|
|
464
465
|
{
|
|
465
|
-
href:
|
|
466
|
-
|
|
467
|
-
|
|
466
|
+
href: `${k.fileUrl(t.file_id)}?download=1`,
|
|
467
|
+
download: t.name || !0,
|
|
468
|
+
onClick: i(`${k.fileUrl(t.file_id)}?download=1`, t.name),
|
|
469
|
+
title: "Download",
|
|
468
470
|
className: "min-w-0 flex-1 truncate text-slate-800 hover:underline dark:text-slate-100",
|
|
469
471
|
children: t.name
|
|
470
472
|
}
|
|
471
473
|
),
|
|
472
474
|
/* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
|
|
473
475
|
t.sender_name ? `${t.sender_name} · ` : "",
|
|
474
|
-
t.size != null ? `${
|
|
475
|
-
|
|
476
|
+
t.size != null ? `${le(t.size)} · ` : "",
|
|
477
|
+
Q(t.date_created)
|
|
476
478
|
] }),
|
|
477
479
|
/* @__PURE__ */ e(
|
|
478
480
|
"button",
|
|
479
481
|
{
|
|
480
482
|
type: "button",
|
|
481
|
-
onClick: () =>
|
|
483
|
+
onClick: () => h(t.message_id),
|
|
482
484
|
className: "shrink-0 text-[10.5px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
|
|
483
485
|
children: "Show"
|
|
484
486
|
}
|
|
@@ -487,12 +489,12 @@ function Te({
|
|
|
487
489
|
},
|
|
488
490
|
`${t.message_id}:${t.file_id}`
|
|
489
491
|
)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "No files shared here yet." })),
|
|
490
|
-
|
|
492
|
+
c === "links" && (p.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : P.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: P.map((t) => /* @__PURE__ */ r(
|
|
491
493
|
"li",
|
|
492
494
|
{
|
|
493
495
|
className: "flex items-center gap-2 text-[11.5px]",
|
|
494
496
|
children: [
|
|
495
|
-
/* @__PURE__ */ e(
|
|
497
|
+
/* @__PURE__ */ e(ee, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
496
498
|
/* @__PURE__ */ e(
|
|
497
499
|
"a",
|
|
498
500
|
{
|
|
@@ -502,7 +504,7 @@ function Te({
|
|
|
502
504
|
onClick: (N) => {
|
|
503
505
|
try {
|
|
504
506
|
const g = new URL(t.url);
|
|
505
|
-
g.origin === window.location.origin &&
|
|
507
|
+
g.origin === window.location.origin && u && (N.preventDefault(), u(`${g.pathname}${g.search}`));
|
|
506
508
|
} catch {
|
|
507
509
|
}
|
|
508
510
|
},
|
|
@@ -512,13 +514,13 @@ function Te({
|
|
|
512
514
|
),
|
|
513
515
|
/* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
|
|
514
516
|
t.sender_name ?? "",
|
|
515
|
-
t.date_created ? ` · ${
|
|
517
|
+
t.date_created ? ` · ${Q(t.date_created)}` : ""
|
|
516
518
|
] }),
|
|
517
519
|
/* @__PURE__ */ e(
|
|
518
520
|
"button",
|
|
519
521
|
{
|
|
520
522
|
type: "button",
|
|
521
|
-
onClick: () =>
|
|
523
|
+
onClick: () => h(t.message_id),
|
|
522
524
|
className: "shrink-0 text-[10.5px] font-medium text-slate-500 hover:text-slate-800 dark:hover:text-slate-100",
|
|
523
525
|
children: "Show"
|
|
524
526
|
}
|
|
@@ -533,31 +535,31 @@ function Te({
|
|
|
533
535
|
}
|
|
534
536
|
);
|
|
535
537
|
}
|
|
536
|
-
function
|
|
538
|
+
function Re({
|
|
537
539
|
room: d,
|
|
538
540
|
renderAvatar: l,
|
|
539
541
|
me: n
|
|
540
542
|
}) {
|
|
541
|
-
const
|
|
542
|
-
if (!
|
|
543
|
-
const s = `${
|
|
544
|
-
if (!
|
|
543
|
+
const o = j(d), [m, h] = f(!1);
|
|
544
|
+
if (!o) return null;
|
|
545
|
+
const s = `${o.member_count} ${o.member_count === 1 ? "member" : "members"} · ${o.online_count} online`;
|
|
546
|
+
if (!o.members.length)
|
|
545
547
|
return /* @__PURE__ */ r(
|
|
546
548
|
"p",
|
|
547
549
|
{
|
|
548
550
|
className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
549
551
|
"data-chat-member-count": !0,
|
|
550
552
|
children: [
|
|
551
|
-
/* @__PURE__ */ e(
|
|
553
|
+
/* @__PURE__ */ e(I, { className: "h-3 w-3" }),
|
|
552
554
|
s
|
|
553
555
|
]
|
|
554
556
|
}
|
|
555
557
|
);
|
|
556
|
-
const
|
|
557
|
-
(
|
|
558
|
-
),
|
|
559
|
-
return /* @__PURE__ */ r(
|
|
560
|
-
/* @__PURE__ */ e(
|
|
558
|
+
const b = n ? n.toUpperCase() : null, u = [...o.members].sort(
|
|
559
|
+
(i, a) => Number(a.online) - Number(i.online) || i.name.localeCompare(a.name)
|
|
560
|
+
), k = he();
|
|
561
|
+
return /* @__PURE__ */ r(ne, { open: m, onOpenChange: h, children: [
|
|
562
|
+
/* @__PURE__ */ e(de, { asChild: !0, children: /* @__PURE__ */ r(
|
|
561
563
|
"button",
|
|
562
564
|
{
|
|
563
565
|
type: "button",
|
|
@@ -565,55 +567,55 @@ function Oe({
|
|
|
565
567
|
"aria-label": `${s} — show members`,
|
|
566
568
|
"data-chat-member-count": !0,
|
|
567
569
|
children: [
|
|
568
|
-
/* @__PURE__ */ e(
|
|
570
|
+
/* @__PURE__ */ e(I, { className: "h-3 w-3 shrink-0" }),
|
|
569
571
|
/* @__PURE__ */ e("span", { className: "truncate", children: s })
|
|
570
572
|
]
|
|
571
573
|
}
|
|
572
574
|
) }),
|
|
573
|
-
/* @__PURE__ */ r(
|
|
575
|
+
/* @__PURE__ */ r(ie, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
|
|
574
576
|
/* @__PURE__ */ e("p", { className: "border-b border-slate-100 px-3 py-2 text-[11.5px] font-semibold text-slate-800 dark:border-border dark:text-slate-100", children: s }),
|
|
575
|
-
/* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children:
|
|
576
|
-
const
|
|
577
|
-
l == null ? void 0 : l(
|
|
577
|
+
/* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children: u.map((i) => {
|
|
578
|
+
const a = !!b && i.id.toUpperCase() === b, c = /* @__PURE__ */ r($, { children: [
|
|
579
|
+
l == null ? void 0 : l(i.id, i.name),
|
|
578
580
|
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
|
|
579
581
|
/* @__PURE__ */ r("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: [
|
|
580
|
-
|
|
581
|
-
|
|
582
|
+
i.name,
|
|
583
|
+
a && /* @__PURE__ */ e("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: "(you)" })
|
|
582
584
|
] }),
|
|
583
|
-
|
|
585
|
+
i.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500 dark:text-slate-400", children: i.title })
|
|
584
586
|
] }),
|
|
585
587
|
/* @__PURE__ */ e(
|
|
586
588
|
"span",
|
|
587
589
|
{
|
|
588
|
-
className:
|
|
590
|
+
className: x(
|
|
589
591
|
"shrink-0 text-[10.5px]",
|
|
590
|
-
|
|
592
|
+
i.online ? "text-emerald-700 dark:text-emerald-400" : "text-slate-500 dark:text-slate-400"
|
|
591
593
|
),
|
|
592
|
-
children:
|
|
594
|
+
children: i.online ? "Online" : "Offline"
|
|
593
595
|
}
|
|
594
596
|
)
|
|
595
597
|
] });
|
|
596
|
-
return /* @__PURE__ */ e("li", { "data-chat-member":
|
|
598
|
+
return /* @__PURE__ */ e("li", { "data-chat-member": i.online ? "online" : "offline", children: k && !a ? /* @__PURE__ */ e(
|
|
597
599
|
"button",
|
|
598
600
|
{
|
|
599
601
|
type: "button",
|
|
600
602
|
onClick: () => {
|
|
601
|
-
|
|
603
|
+
h(!1), oe(i.id, i.name);
|
|
602
604
|
},
|
|
603
|
-
title: `Message ${
|
|
605
|
+
title: `Message ${i.name}`,
|
|
604
606
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted",
|
|
605
|
-
children:
|
|
607
|
+
children: c
|
|
606
608
|
}
|
|
607
|
-
) : /* @__PURE__ */ e("div", { className: "flex items-center gap-2 px-2 py-1.5", children:
|
|
609
|
+
) : /* @__PURE__ */ e("div", { className: "flex items-center gap-2 px-2 py-1.5", children: c }) }, i.id);
|
|
608
610
|
}) })
|
|
609
611
|
] })
|
|
610
612
|
] });
|
|
611
613
|
}
|
|
612
614
|
export {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
615
|
+
Te as ChannelIntro,
|
|
616
|
+
De as JumpToDateForm,
|
|
617
|
+
Re as MemberCountLine,
|
|
618
|
+
Pe as RoomInfoDrawer,
|
|
619
|
+
ze as ThreadPane,
|
|
620
|
+
Oe as WelcomeNote
|
|
619
621
|
};
|