@nivaro/react 0.3.40 → 0.3.42
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/components/LayoutForm.js +100 -98
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +645 -16
- package/dist/index.js +814 -775
- package/dist/shared/components/ActivityEntry.js +154 -0
- package/dist/shared/components/AudienceConfirmPanel.js +98 -0
- package/dist/shared/components/BackgroundRunOffer.js +43 -31
- package/dist/shared/components/BroadcastView.js +225 -204
- package/dist/shared/components/CollectionBrowserView.js +3924 -3584
- package/dist/shared/components/ConfigHistory.js +153 -0
- package/dist/shared/components/ConfigReadBack.js +65 -0
- package/dist/shared/components/DataTable.js +379 -346
- package/dist/shared/components/ForceReloadBanner.js +47 -40
- package/dist/shared/components/IdleReloadWatcher.js +69 -0
- package/dist/shared/components/ItemEditForm.js +4041 -3853
- package/dist/shared/components/MyWorkView.js +278 -213
- package/dist/shared/components/NotificationBell.js +130 -121
- package/dist/shared/components/PickerExcludedRows.js +3 -3
- package/dist/shared/components/ProfileView.js +776 -1003
- package/dist/shared/components/RecentRecordsRail.js +34 -16
- package/dist/shared/components/RecordReadView.js +500 -477
- package/dist/shared/components/Skeletons.js +199 -0
- package/dist/shared/components/SlowNotice.js +63 -0
- package/dist/shared/components/Term.js +23 -0
- package/dist/shared/components/WidgetSlot.js +350 -353
- package/dist/shared/components/access/PermissionSummary.js +106 -0
- package/dist/shared/components/bulk/BulkActionButtons.js +76 -73
- package/dist/shared/components/chat/ChatPanel.js +902 -886
- package/dist/shared/components/chat/MemberPaging.js +70 -0
- package/dist/shared/components/chat/RoomParts.js +147 -117
- package/dist/shared/components/chat/ScreenClip.js +73 -69
- package/dist/shared/components/chat/chat-core.js +449 -396
- package/dist/shared/components/chat/huddle/huddle-store.js +48 -43
- package/dist/shared/components/help-videos/api.js +2 -5
- package/dist/shared/components/help-videos/viewer/HelpVideoMatchChip.js +79 -0
- package/dist/shared/components/help-videos/viewer/matchChip.js +50 -0
- package/dist/shared/components/imports/CollectionImportPanel.js +139 -133
- package/dist/shared/components/imports/RunDetailSheet.js +222 -227
- package/dist/shared/components/integrations/console/ErrorExplanation.js +121 -0
- package/dist/shared/components/integrations/console/PartnerDetail.js +175 -174
- package/dist/shared/components/integrations/console/SubmissionRow.js +36 -34
- package/dist/shared/components/integrations/console/drill/SubmissionDrill.js +50 -48
- package/dist/shared/components/item-edit/FieldComments.js +212 -0
- package/dist/shared/components/item-edit/FieldRow.js +340 -336
- package/dist/shared/components/item-edit/RecordGrantTools.js +28 -28
- package/dist/shared/components/item-edit/RecordHeaderActions.js +23 -22
- package/dist/shared/components/item-edit/RelationCombobox.js +231 -222
- package/dist/shared/components/item-edit/RuleHiddenNotes.js +55 -0
- package/dist/shared/components/item-edit/field-comments-context.js +6 -0
- package/dist/shared/components/item-edit/field-sources.js +33 -0
- package/dist/shared/components/item-edit/rule-hidden.js +30 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +113 -96
- package/dist/shared/components/layout-editor/editors/cascade-filters.js +170 -145
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +22 -18
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +177 -159
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +35 -34
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +124 -111
- package/dist/shared/components/layout-editor/inspector/kit.js +292 -277
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/settings/settings-registry.js +1 -1
- package/dist/shared/components/list/CopyListLinkButton.js +41 -0
- package/dist/shared/components/list/InlineEdit.js +363 -0
- package/dist/shared/components/notifications/NotificationCenterView.js +213 -181
- package/dist/shared/components/notifications/NotificationDetailBits.js +205 -82
- package/dist/shared/components/notifications/NotificationRulesEditor.js +515 -0
- package/dist/shared/components/notifications/TestMyRules.js +137 -0
- package/dist/shared/components/notifications/changes-lines.js +24 -0
- package/dist/shared/components/notifications/why-lines.js +64 -0
- package/dist/shared/components/panels/CommentPanel.js +316 -281
- package/dist/shared/components/panels/LegalHoldBanner.js +38 -0
- package/dist/shared/components/panels/PipelinePanel.js +201 -196
- package/dist/shared/components/panels/RevisionsPanel.js +496 -479
- package/dist/shared/components/pipeline/PipelineEditorView.js +1587 -1560
- package/dist/shared/components/pipeline/PipelineStateOwners.js +116 -103
- package/dist/shared/components/profile/PersonDidPanel.js +188 -0
- package/dist/shared/components/profile/PersonProfile.js +57 -52
- package/dist/shared/components/queue/QueueWorklist.js +1526 -1365
- package/dist/shared/hooks/useSlowReason.js +39 -0
- package/dist/shared/lib/activity-sentence.js +670 -0
- package/dist/shared/lib/config-sentences.js +418 -0
- package/dist/shared/lib/core-glossary.js +229 -0
- package/dist/shared/lib/error-hints.js +159 -0
- package/dist/shared/lib/error-message.js +105 -0
- package/dist/shared/lib/error-toast.js +22 -0
- package/dist/shared/lib/field-comments.js +25 -0
- package/dist/shared/lib/filter-sentence.js +261 -0
- package/dist/shared/lib/glossary.js +55 -48
- package/dist/shared/lib/idle-reload.js +138 -0
- package/dist/shared/lib/layout-resolve.js +42 -29
- package/dist/shared/lib/list-inline-edit.js +190 -0
- package/dist/shared/lib/list-link.js +147 -0
- package/dist/shared/lib/prefetch.js +259 -106
- package/dist/shared/lib/record-ref.js +72 -0
- package/dist/shared/lib/reload-holds.js +25 -0
- package/dist/shared/lib/safe-error.js +52 -24
- package/dist/shared/lib/skeleton-shapes.js +72 -0
- package/dist/shared/lib/slow-reason.js +63 -0
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import { jsxs as r, jsx as e, Fragment as
|
|
2
|
-
import { Users as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useNivaroClient as
|
|
5
|
-
import { safeLinkKind as
|
|
6
|
-
import { cn as m, formatFileSize as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { openDmWith as
|
|
9
|
-
import { useRoomInfo as
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as r, jsx as e, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
+
import { Users as U, Link2 as J, ChevronLeft as Q, Sparkles as W, Pin as K, X, FileText as Z, ExternalLink as A } from "lucide-react";
|
|
3
|
+
import { useState as f, useRef as ee, useEffect as te } from "react";
|
|
4
|
+
import { useNivaroClient as ae } from "../../context.js";
|
|
5
|
+
import { safeLinkKind as T } from "../../lib/safe-href.js";
|
|
6
|
+
import { cn as m, formatFileSize as re, formatRelative as F } from "../../lib/utils.js";
|
|
7
|
+
import { Popover as le, PopoverTrigger as se, PopoverContent as ne } from "../ui/popover.js";
|
|
8
|
+
import { openDmWith as de, useChatThread as ie, useDebouncedMemberQuery as ce, usePagedMembers as oe, canOpenDm as me } from "./chat-core.js";
|
|
9
|
+
import { useRoomInfo as B, useRoomSummary as j, useRoomShared as xe } from "./chat-hooks.js";
|
|
10
|
+
import { MemberSearchBox as he, memberCountLabel as pe, MemberOnlineDot as ue, MemberLoadMore as be } from "./MemberPaging.js";
|
|
11
|
+
function $e({
|
|
12
|
+
room: d,
|
|
12
13
|
rootId: l,
|
|
13
14
|
th: n,
|
|
14
|
-
onClose:
|
|
15
|
+
onClose: c,
|
|
15
16
|
renderRow: o,
|
|
16
17
|
renderComposer: x,
|
|
17
18
|
renderOutbox: s
|
|
18
19
|
}) {
|
|
19
|
-
const { root: u, replies: h, loading:
|
|
20
|
-
return
|
|
20
|
+
const { root: u, replies: h, loading: v } = ie(d, l), a = j(), [i, k] = f(null), b = ee(null);
|
|
21
|
+
return te(() => {
|
|
21
22
|
var p;
|
|
22
23
|
(p = b.current) == null || p.scrollIntoView({ block: "end" });
|
|
23
24
|
}, [h.length]), /* @__PURE__ */ r(
|
|
@@ -31,10 +32,10 @@ function xe({
|
|
|
31
32
|
"button",
|
|
32
33
|
{
|
|
33
34
|
type: "button",
|
|
34
|
-
onClick:
|
|
35
|
+
onClick: c,
|
|
35
36
|
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",
|
|
36
37
|
"aria-label": "Back to the conversation",
|
|
37
|
-
children: /* @__PURE__ */ e(
|
|
38
|
+
children: /* @__PURE__ */ e(Q, { className: "h-4 w-4", strokeWidth: 2 })
|
|
38
39
|
}
|
|
39
40
|
),
|
|
40
41
|
/* @__PURE__ */ r("p", { className: "flex-1 text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: [
|
|
@@ -51,7 +52,7 @@ function xe({
|
|
|
51
52
|
type: "button",
|
|
52
53
|
disabled: a.isPending,
|
|
53
54
|
onClick: () => a.mutate(
|
|
54
|
-
{ room:
|
|
55
|
+
{ room: d, thread: l },
|
|
55
56
|
{ onSuccess: (p) => k(p.summary ?? "Not enough to summarize yet.") }
|
|
56
57
|
),
|
|
57
58
|
className: m(
|
|
@@ -60,24 +61,24 @@ function xe({
|
|
|
60
61
|
),
|
|
61
62
|
"data-chat-thread-summarize": !0,
|
|
62
63
|
children: [
|
|
63
|
-
/* @__PURE__ */ e(
|
|
64
|
+
/* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
|
|
64
65
|
a.isPending ? "Summarizing…" : "Summarize"
|
|
65
66
|
]
|
|
66
67
|
}
|
|
67
68
|
)
|
|
68
69
|
] }),
|
|
69
|
-
|
|
70
|
+
i && /* @__PURE__ */ e(
|
|
70
71
|
"div",
|
|
71
72
|
{
|
|
72
73
|
className: m(
|
|
73
74
|
"shrink-0 border-b px-3 py-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200",
|
|
74
75
|
n.divider
|
|
75
76
|
),
|
|
76
|
-
children:
|
|
77
|
+
children: i
|
|
77
78
|
}
|
|
78
79
|
),
|
|
79
80
|
/* @__PURE__ */ r("div", { className: "min-h-0 flex-1 space-y-2.5 overflow-y-auto px-3 py-3", children: [
|
|
80
|
-
|
|
81
|
+
v ? /* @__PURE__ */ e("p", { className: "py-6 text-center text-[12px] text-slate-500", children: "Loading…" }) : /* @__PURE__ */ r($, { children: [
|
|
81
82
|
u && /* @__PURE__ */ e("div", { className: m("border-b pb-2.5", n.divider), children: o(u, { inThread: !0 }) }),
|
|
82
83
|
h.map((p) => /* @__PURE__ */ e("div", { children: o(p, { inThread: !0 }) }, p.id)),
|
|
83
84
|
s(l)
|
|
@@ -89,26 +90,26 @@ function xe({
|
|
|
89
90
|
}
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
description:
|
|
93
|
+
function Le({
|
|
94
|
+
description: d,
|
|
94
95
|
links: l,
|
|
95
96
|
th: n,
|
|
96
|
-
navigate:
|
|
97
|
+
navigate: c
|
|
97
98
|
}) {
|
|
98
|
-
const [o, x] =
|
|
99
|
-
return !
|
|
99
|
+
const [o, x] = f(!1);
|
|
100
|
+
return !d && !(l != null && l.length) ? null : /* @__PURE__ */ r("div", { className: m("shrink-0 border-b px-3 py-1.5", n.divider), "data-chat-channel-intro": !0, children: [
|
|
100
101
|
/* @__PURE__ */ r("div", { className: "flex items-start gap-2", children: [
|
|
101
|
-
|
|
102
|
+
d && /* @__PURE__ */ e(
|
|
102
103
|
"p",
|
|
103
104
|
{
|
|
104
105
|
className: m(
|
|
105
106
|
"min-w-0 flex-1 text-[11.5px] leading-snug text-slate-600 dark:text-slate-300",
|
|
106
107
|
!o && "line-clamp-1"
|
|
107
108
|
),
|
|
108
|
-
children:
|
|
109
|
+
children: d
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
|
-
|
|
112
|
+
d && d.length > 80 && /* @__PURE__ */ e(
|
|
112
113
|
"button",
|
|
113
114
|
{
|
|
114
115
|
type: "button",
|
|
@@ -118,19 +119,19 @@ function he({
|
|
|
118
119
|
}
|
|
119
120
|
)
|
|
120
121
|
] }),
|
|
121
|
-
!!(l != null && l.length) && /* @__PURE__ */ e("div", { className: "mt-1 flex flex-wrap gap-1.5", children: l.filter((s) =>
|
|
122
|
+
!!(l != null && l.length) && /* @__PURE__ */ e("div", { className: "mt-1 flex flex-wrap gap-1.5", children: l.filter((s) => T(s.url) !== null).map((s) => /* @__PURE__ */ r(
|
|
122
123
|
"a",
|
|
123
124
|
{
|
|
124
125
|
href: s.url,
|
|
125
|
-
target:
|
|
126
|
+
target: T(s.url) === "internal" ? void 0 : "_blank",
|
|
126
127
|
rel: "noopener noreferrer",
|
|
127
128
|
onClick: (u) => {
|
|
128
|
-
|
|
129
|
+
T(s.url) === "internal" && c && (u.preventDefault(), c(s.url));
|
|
129
130
|
},
|
|
130
131
|
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",
|
|
131
132
|
"data-chat-channel-link": !0,
|
|
132
133
|
children: [
|
|
133
|
-
/* @__PURE__ */ e(
|
|
134
|
+
/* @__PURE__ */ e(J, { className: "h-3 w-3 shrink-0 opacity-60" }),
|
|
134
135
|
/* @__PURE__ */ e("span", { className: "truncate", children: s.label })
|
|
135
136
|
]
|
|
136
137
|
},
|
|
@@ -138,18 +139,18 @@ function he({
|
|
|
138
139
|
)) })
|
|
139
140
|
] });
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
-
note:
|
|
142
|
+
function Me({
|
|
143
|
+
note: d,
|
|
143
144
|
channelName: l,
|
|
144
145
|
onDismiss: n,
|
|
145
|
-
th:
|
|
146
|
+
th: c
|
|
146
147
|
}) {
|
|
147
148
|
return /* @__PURE__ */ e(
|
|
148
149
|
"div",
|
|
149
150
|
{
|
|
150
151
|
className: m(
|
|
151
152
|
"mx-3 mt-3 rounded-xl border px-3 py-2.5",
|
|
152
|
-
|
|
153
|
+
c.divider,
|
|
153
154
|
"bg-slate-50 dark:bg-muted/40"
|
|
154
155
|
),
|
|
155
156
|
"data-chat-welcome": !0,
|
|
@@ -159,7 +160,7 @@ function pe({
|
|
|
159
160
|
"Welcome to ",
|
|
160
161
|
l
|
|
161
162
|
] }),
|
|
162
|
-
/* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children:
|
|
163
|
+
/* @__PURE__ */ e("p", { className: "mt-0.5 whitespace-pre-wrap text-[11.5px] leading-snug text-slate-600 dark:text-slate-300", children: d })
|
|
163
164
|
] }),
|
|
164
165
|
/* @__PURE__ */ e(
|
|
165
166
|
"button",
|
|
@@ -175,12 +176,12 @@ function pe({
|
|
|
175
176
|
}
|
|
176
177
|
);
|
|
177
178
|
}
|
|
178
|
-
function
|
|
179
|
-
onJump:
|
|
179
|
+
function ze({
|
|
180
|
+
onJump: d,
|
|
180
181
|
onDone: l
|
|
181
182
|
}) {
|
|
182
|
-
const [n,
|
|
183
|
-
return /* @__PURE__ */ r(
|
|
183
|
+
const [n, c] = f("");
|
|
184
|
+
return /* @__PURE__ */ r($, { children: [
|
|
184
185
|
/* @__PURE__ */ e("p", { className: "pb-1.5 text-[12px] font-semibold text-slate-800 dark:text-slate-100", children: "Jump to a date" }),
|
|
185
186
|
/* @__PURE__ */ e(
|
|
186
187
|
"input",
|
|
@@ -188,7 +189,7 @@ function ue({
|
|
|
188
189
|
type: "date",
|
|
189
190
|
value: n,
|
|
190
191
|
max: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
|
|
191
|
-
onChange: (o) =>
|
|
192
|
+
onChange: (o) => c(o.target.value),
|
|
192
193
|
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",
|
|
193
194
|
"aria-label": "Date"
|
|
194
195
|
}
|
|
@@ -203,7 +204,7 @@ function ue({
|
|
|
203
204
|
type: "button",
|
|
204
205
|
onClick: () => {
|
|
205
206
|
const s = new Date(Date.now() - x * 864e5);
|
|
206
|
-
s.setHours(0, 0, 0, 0),
|
|
207
|
+
s.setHours(0, 0, 0, 0), d(s.toISOString()), l == null || l();
|
|
207
208
|
},
|
|
208
209
|
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",
|
|
209
210
|
children: o
|
|
@@ -217,7 +218,7 @@ function ue({
|
|
|
217
218
|
disabled: !n,
|
|
218
219
|
onClick: () => {
|
|
219
220
|
const [o, x, s] = n.split("-").map(Number);
|
|
220
|
-
|
|
221
|
+
d(new Date(o, x - 1, s).toISOString()), l == null || l();
|
|
221
222
|
},
|
|
222
223
|
className: "mt-2 h-8 w-full rounded-md bg-nvr-cyan text-[12px] font-medium text-white disabled:opacity-40",
|
|
223
224
|
children: "Go"
|
|
@@ -225,20 +226,25 @@ function ue({
|
|
|
225
226
|
)
|
|
226
227
|
] });
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
-
room:
|
|
229
|
+
function Te({
|
|
230
|
+
room: d,
|
|
230
231
|
label: l,
|
|
231
232
|
th: n,
|
|
232
|
-
pins:
|
|
233
|
+
pins: c,
|
|
233
234
|
onClose: o,
|
|
234
235
|
onOpenMessage: x,
|
|
235
236
|
renderAvatar: s,
|
|
236
237
|
onUnpin: u,
|
|
237
238
|
navigate: h
|
|
238
239
|
}) {
|
|
239
|
-
const
|
|
240
|
+
const v = ae(), a = B(d), [i, k] = f("members"), b = xe(d, i === "files" || i === "links"), [p, q] = f(""), S = p.trim().toLowerCase(), O = S ? b.files.filter((t) => `${t.name} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : b.files, P = S ? b.links.filter((t) => `${t.url} ${t.sender_name ?? ""}`.toLowerCase().includes(S)) : b.links, [L, E] = f(""), G = ce(L, 250), _ = L.trim().toLowerCase(), w = !!a && a.members.length >= a.member_count, y = oe(
|
|
241
|
+
d,
|
|
242
|
+
`/chat/rooms/${encodeURIComponent(d)}/members`,
|
|
243
|
+
G,
|
|
244
|
+
i === "members" && !!a && !w
|
|
245
|
+
), M = w ? _ ? a.members.filter((t) => t.name.toLowerCase().includes(_.replace(/^@/, ""))) : a.members : y.members, H = w ? M.length : y.total, C = j(), [z, V] = f(""), [D, R] = f(null), Y = [
|
|
240
246
|
["members", `Members${a ? ` · ${a.member_count}` : ""}`],
|
|
241
|
-
["pinned", `Pinned${
|
|
247
|
+
["pinned", `Pinned${c.length ? ` · ${c.length}` : ""}`],
|
|
242
248
|
["files", `Files${a != null && a.file_count ? ` · ${a.file_count}` : ""}`],
|
|
243
249
|
["links", "Links"]
|
|
244
250
|
];
|
|
@@ -256,7 +262,7 @@ function be({
|
|
|
256
262
|
onClick: o,
|
|
257
263
|
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",
|
|
258
264
|
"aria-label": "Back to the conversation",
|
|
259
|
-
children: /* @__PURE__ */ e(
|
|
265
|
+
children: /* @__PURE__ */ e(Q, { className: "h-4 w-4", strokeWidth: 2 })
|
|
260
266
|
}
|
|
261
267
|
),
|
|
262
268
|
/* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[13px] font-semibold text-slate-800 dark:text-slate-100", children: l })
|
|
@@ -302,15 +308,15 @@ function be({
|
|
|
302
308
|
"button",
|
|
303
309
|
{
|
|
304
310
|
type: "button",
|
|
305
|
-
disabled:
|
|
306
|
-
onClick: () =>
|
|
311
|
+
disabled: C.isPending,
|
|
312
|
+
onClick: () => C.mutate(
|
|
307
313
|
{
|
|
308
|
-
room:
|
|
314
|
+
room: d,
|
|
309
315
|
since: new Date(Date.now() - N * 864e5).toISOString()
|
|
310
316
|
},
|
|
311
317
|
{
|
|
312
|
-
onSuccess: (
|
|
313
|
-
|
|
318
|
+
onSuccess: (g) => R(
|
|
319
|
+
g.summary ?? `Only ${g.count} messages — nothing to summarize.`
|
|
314
320
|
)
|
|
315
321
|
}
|
|
316
322
|
),
|
|
@@ -323,8 +329,8 @@ function be({
|
|
|
323
329
|
"input",
|
|
324
330
|
{
|
|
325
331
|
type: "date",
|
|
326
|
-
value:
|
|
327
|
-
onChange: (t) =>
|
|
332
|
+
value: z,
|
|
333
|
+
onChange: (t) => V(t.target.value),
|
|
328
334
|
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",
|
|
329
335
|
"aria-label": "Summarize since"
|
|
330
336
|
}
|
|
@@ -333,14 +339,14 @@ function be({
|
|
|
333
339
|
"button",
|
|
334
340
|
{
|
|
335
341
|
type: "button",
|
|
336
|
-
disabled: !
|
|
342
|
+
disabled: !z || C.isPending,
|
|
337
343
|
onClick: () => {
|
|
338
|
-
const [t, N,
|
|
339
|
-
|
|
340
|
-
{ room:
|
|
344
|
+
const [t, N, g] = z.split("-").map(Number);
|
|
345
|
+
C.mutate(
|
|
346
|
+
{ room: d, since: new Date(t, N - 1, g).toISOString() },
|
|
341
347
|
{
|
|
342
|
-
onSuccess: (
|
|
343
|
-
|
|
348
|
+
onSuccess: (I) => R(
|
|
349
|
+
I.summary ?? `Only ${I.count} messages — nothing to summarize.`
|
|
344
350
|
)
|
|
345
351
|
}
|
|
346
352
|
);
|
|
@@ -350,25 +356,25 @@ function be({
|
|
|
350
356
|
n.accentText
|
|
351
357
|
),
|
|
352
358
|
children: [
|
|
353
|
-
/* @__PURE__ */ e(
|
|
359
|
+
/* @__PURE__ */ e(W, { className: "h-3 w-3" }),
|
|
354
360
|
" ",
|
|
355
|
-
|
|
361
|
+
C.isPending ? "Summarizing…" : "Since then"
|
|
356
362
|
]
|
|
357
363
|
}
|
|
358
364
|
)
|
|
359
365
|
] }),
|
|
360
|
-
|
|
366
|
+
D && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] leading-snug text-slate-700 dark:text-slate-200", children: D })
|
|
361
367
|
] }),
|
|
362
|
-
/* @__PURE__ */ e("div", { className: m("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children:
|
|
368
|
+
/* @__PURE__ */ e("div", { className: m("flex gap-1 border-b px-2 pt-1.5", n.divider), role: "tablist", children: Y.map(([t, N]) => /* @__PURE__ */ e(
|
|
363
369
|
"button",
|
|
364
370
|
{
|
|
365
371
|
type: "button",
|
|
366
372
|
role: "tab",
|
|
367
|
-
"aria-selected":
|
|
373
|
+
"aria-selected": i === t,
|
|
368
374
|
onClick: () => k(t),
|
|
369
375
|
className: m(
|
|
370
376
|
"-mb-px border-b-2 px-2 pb-1.5 text-[11.5px] font-medium",
|
|
371
|
-
|
|
377
|
+
i === 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"
|
|
372
378
|
),
|
|
373
379
|
"data-chat-info-tab": t,
|
|
374
380
|
children: N
|
|
@@ -376,16 +382,40 @@ function be({
|
|
|
376
382
|
t
|
|
377
383
|
)) }),
|
|
378
384
|
/* @__PURE__ */ r("div", { className: "px-3 py-2", children: [
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
/* @__PURE__ */ e(
|
|
383
|
-
|
|
385
|
+
i === "members" && /* @__PURE__ */ r($, { children: [
|
|
386
|
+
a && a.member_count > 10 && /* @__PURE__ */ r("div", { className: "mb-2 space-y-1", children: [
|
|
387
|
+
/* @__PURE__ */ e(he, { value: L, onChange: E }),
|
|
388
|
+
/* @__PURE__ */ e(
|
|
389
|
+
"p",
|
|
390
|
+
{
|
|
391
|
+
className: "text-[10.5px] tabular-nums text-slate-500 dark:text-slate-400",
|
|
392
|
+
"data-chat-member-count": !0,
|
|
393
|
+
children: pe(H, !!_)
|
|
394
|
+
}
|
|
395
|
+
)
|
|
384
396
|
] }),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
397
|
+
M.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: M.map((t) => /* @__PURE__ */ r("li", { className: "flex items-center gap-2 py-0.5", children: [
|
|
398
|
+
s(t.id, t.name),
|
|
399
|
+
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
|
|
400
|
+
/* @__PURE__ */ e("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: t.name }),
|
|
401
|
+
t.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500", children: t.title })
|
|
402
|
+
] }),
|
|
403
|
+
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(ue, { online: !0 }),
|
|
405
|
+
"Online"
|
|
406
|
+
] })
|
|
407
|
+
] }, t.id)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: !a || !w && y.loading ? "Loading…" : _ ? "No one matches." : "Anyone who can open this room can read it." }),
|
|
408
|
+
!w && /* @__PURE__ */ e(
|
|
409
|
+
be,
|
|
410
|
+
{
|
|
411
|
+
hasMore: y.hasMore,
|
|
412
|
+
loading: y.loadingMore,
|
|
413
|
+
onLoad: y.loadMore
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
] }),
|
|
417
|
+
i === "pinned" && (c.length ? /* @__PURE__ */ e("ul", { className: "space-y-1.5", children: c.map((t) => /* @__PURE__ */ r("li", { className: "flex items-start gap-1.5 text-[11.5px]", children: [
|
|
418
|
+
/* @__PURE__ */ e(K, { className: "mt-0.5 h-3 w-3 shrink-0 text-slate-400" }),
|
|
389
419
|
/* @__PURE__ */ r(
|
|
390
420
|
"button",
|
|
391
421
|
{
|
|
@@ -408,31 +438,31 @@ function be({
|
|
|
408
438
|
onClick: () => u(t.id),
|
|
409
439
|
className: "shrink-0 text-slate-400 hover:text-red-500",
|
|
410
440
|
"aria-label": "Unpin",
|
|
411
|
-
children: /* @__PURE__ */ e(
|
|
441
|
+
children: /* @__PURE__ */ e(X, { className: "h-3 w-3" })
|
|
412
442
|
}
|
|
413
443
|
)
|
|
414
444
|
] }, 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." })),
|
|
415
|
-
(
|
|
445
|
+
(i === "files" || i === "links") && /* @__PURE__ */ e(
|
|
416
446
|
"input",
|
|
417
447
|
{
|
|
418
448
|
value: p,
|
|
419
|
-
onChange: (t) =>
|
|
420
|
-
placeholder:
|
|
449
|
+
onChange: (t) => q(t.target.value),
|
|
450
|
+
placeholder: i === "files" ? "Search files or people" : "Search links or people",
|
|
421
451
|
"aria-label": "Search shared items",
|
|
422
452
|
"data-chat-shared-search": !0,
|
|
423
453
|
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"
|
|
424
454
|
}
|
|
425
455
|
),
|
|
426
|
-
|
|
456
|
+
i === "files" && (b.loading ? /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "Loading…" }) : O.length ? /* @__PURE__ */ e("ul", { className: "space-y-1", children: O.map((t) => /* @__PURE__ */ r(
|
|
427
457
|
"li",
|
|
428
458
|
{
|
|
429
459
|
className: "flex items-center gap-2 text-[11.5px]",
|
|
430
460
|
children: [
|
|
431
|
-
/* @__PURE__ */ e(
|
|
461
|
+
/* @__PURE__ */ e(Z, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
432
462
|
/* @__PURE__ */ e(
|
|
433
463
|
"a",
|
|
434
464
|
{
|
|
435
|
-
href:
|
|
465
|
+
href: v.fileUrl(t.file_id),
|
|
436
466
|
target: "_blank",
|
|
437
467
|
rel: "noopener noreferrer",
|
|
438
468
|
className: "min-w-0 flex-1 truncate text-slate-800 hover:underline dark:text-slate-100",
|
|
@@ -441,8 +471,8 @@ function be({
|
|
|
441
471
|
),
|
|
442
472
|
/* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
|
|
443
473
|
t.sender_name ? `${t.sender_name} · ` : "",
|
|
444
|
-
t.size != null ? `${
|
|
445
|
-
|
|
474
|
+
t.size != null ? `${re(t.size)} · ` : "",
|
|
475
|
+
F(t.date_created)
|
|
446
476
|
] }),
|
|
447
477
|
/* @__PURE__ */ e(
|
|
448
478
|
"button",
|
|
@@ -457,12 +487,12 @@ function be({
|
|
|
457
487
|
},
|
|
458
488
|
`${t.message_id}:${t.file_id}`
|
|
459
489
|
)) }) : /* @__PURE__ */ e("p", { className: "py-4 text-center text-[11.5px] text-slate-500", children: "No files shared here yet." })),
|
|
460
|
-
|
|
490
|
+
i === "links" && (b.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(
|
|
461
491
|
"li",
|
|
462
492
|
{
|
|
463
493
|
className: "flex items-center gap-2 text-[11.5px]",
|
|
464
494
|
children: [
|
|
465
|
-
/* @__PURE__ */ e(
|
|
495
|
+
/* @__PURE__ */ e(A, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
|
|
466
496
|
/* @__PURE__ */ e(
|
|
467
497
|
"a",
|
|
468
498
|
{
|
|
@@ -471,8 +501,8 @@ function be({
|
|
|
471
501
|
rel: "noopener noreferrer",
|
|
472
502
|
onClick: (N) => {
|
|
473
503
|
try {
|
|
474
|
-
const
|
|
475
|
-
|
|
504
|
+
const g = new URL(t.url);
|
|
505
|
+
g.origin === window.location.origin && h && (N.preventDefault(), h(`${g.pathname}${g.search}`));
|
|
476
506
|
} catch {
|
|
477
507
|
}
|
|
478
508
|
},
|
|
@@ -482,7 +512,7 @@ function be({
|
|
|
482
512
|
),
|
|
483
513
|
/* @__PURE__ */ r("span", { className: "shrink-0 text-[10.5px] text-slate-500", children: [
|
|
484
514
|
t.sender_name ?? "",
|
|
485
|
-
t.date_created ? ` · ${
|
|
515
|
+
t.date_created ? ` · ${F(t.date_created)}` : ""
|
|
486
516
|
] }),
|
|
487
517
|
/* @__PURE__ */ e(
|
|
488
518
|
"button",
|
|
@@ -503,31 +533,31 @@ function be({
|
|
|
503
533
|
}
|
|
504
534
|
);
|
|
505
535
|
}
|
|
506
|
-
function
|
|
507
|
-
room:
|
|
536
|
+
function Oe({
|
|
537
|
+
room: d,
|
|
508
538
|
renderAvatar: l,
|
|
509
539
|
me: n
|
|
510
540
|
}) {
|
|
511
|
-
const
|
|
512
|
-
if (!
|
|
513
|
-
const s = `${
|
|
514
|
-
if (!
|
|
541
|
+
const c = B(d), [o, x] = f(!1);
|
|
542
|
+
if (!c) return null;
|
|
543
|
+
const s = `${c.member_count} ${c.member_count === 1 ? "member" : "members"} · ${c.online_count} online`;
|
|
544
|
+
if (!c.members.length)
|
|
515
545
|
return /* @__PURE__ */ r(
|
|
516
546
|
"p",
|
|
517
547
|
{
|
|
518
548
|
className: "flex items-center gap-1 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
519
549
|
"data-chat-member-count": !0,
|
|
520
550
|
children: [
|
|
521
|
-
/* @__PURE__ */ e(
|
|
551
|
+
/* @__PURE__ */ e(U, { className: "h-3 w-3" }),
|
|
522
552
|
s
|
|
523
553
|
]
|
|
524
554
|
}
|
|
525
555
|
);
|
|
526
|
-
const u = n ? n.toUpperCase() : null, h = [...
|
|
527
|
-
(a,
|
|
528
|
-
),
|
|
529
|
-
return /* @__PURE__ */ r(
|
|
530
|
-
/* @__PURE__ */ e(
|
|
556
|
+
const u = n ? n.toUpperCase() : null, h = [...c.members].sort(
|
|
557
|
+
(a, i) => Number(i.online) - Number(a.online) || a.name.localeCompare(i.name)
|
|
558
|
+
), v = me();
|
|
559
|
+
return /* @__PURE__ */ r(le, { open: o, onOpenChange: x, children: [
|
|
560
|
+
/* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ r(
|
|
531
561
|
"button",
|
|
532
562
|
{
|
|
533
563
|
type: "button",
|
|
@@ -535,20 +565,20 @@ function fe({
|
|
|
535
565
|
"aria-label": `${s} — show members`,
|
|
536
566
|
"data-chat-member-count": !0,
|
|
537
567
|
children: [
|
|
538
|
-
/* @__PURE__ */ e(
|
|
568
|
+
/* @__PURE__ */ e(U, { className: "h-3 w-3 shrink-0" }),
|
|
539
569
|
/* @__PURE__ */ e("span", { className: "truncate", children: s })
|
|
540
570
|
]
|
|
541
571
|
}
|
|
542
572
|
) }),
|
|
543
|
-
/* @__PURE__ */ r(
|
|
573
|
+
/* @__PURE__ */ r(ne, { align: "start", className: "w-[260px] p-0", "data-chat-member-popover": !0, children: [
|
|
544
574
|
/* @__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 }),
|
|
545
575
|
/* @__PURE__ */ e("ul", { className: "max-h-[320px] overflow-y-auto p-1", children: h.map((a) => {
|
|
546
|
-
const
|
|
576
|
+
const i = !!u && a.id.toUpperCase() === u, k = /* @__PURE__ */ r($, { children: [
|
|
547
577
|
l == null ? void 0 : l(a.id, a.name),
|
|
548
578
|
/* @__PURE__ */ r("span", { className: "min-w-0 flex-1", children: [
|
|
549
579
|
/* @__PURE__ */ r("span", { className: "block truncate text-[12px] text-slate-800 dark:text-slate-100", children: [
|
|
550
580
|
a.name,
|
|
551
|
-
|
|
581
|
+
i && /* @__PURE__ */ e("span", { className: "ml-1 text-slate-500 dark:text-slate-400", children: "(you)" })
|
|
552
582
|
] }),
|
|
553
583
|
a.title && /* @__PURE__ */ e("span", { className: "block truncate text-[10.5px] text-slate-500 dark:text-slate-400", children: a.title })
|
|
554
584
|
] }),
|
|
@@ -563,12 +593,12 @@ function fe({
|
|
|
563
593
|
}
|
|
564
594
|
)
|
|
565
595
|
] });
|
|
566
|
-
return /* @__PURE__ */ e("li", { "data-chat-member": a.online ? "online" : "offline", children:
|
|
596
|
+
return /* @__PURE__ */ e("li", { "data-chat-member": a.online ? "online" : "offline", children: v && !i ? /* @__PURE__ */ e(
|
|
567
597
|
"button",
|
|
568
598
|
{
|
|
569
599
|
type: "button",
|
|
570
600
|
onClick: () => {
|
|
571
|
-
x(!1),
|
|
601
|
+
x(!1), de(a.id, a.name);
|
|
572
602
|
},
|
|
573
603
|
title: `Message ${a.name}`,
|
|
574
604
|
className: "flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left hover:bg-muted",
|
|
@@ -580,10 +610,10 @@ function fe({
|
|
|
580
610
|
] });
|
|
581
611
|
}
|
|
582
612
|
export {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
613
|
+
Le as ChannelIntro,
|
|
614
|
+
ze as JumpToDateForm,
|
|
615
|
+
Oe as MemberCountLine,
|
|
616
|
+
Te as RoomInfoDrawer,
|
|
617
|
+
$e as ThreadPane,
|
|
618
|
+
Me as WelcomeNote
|
|
589
619
|
};
|