@burdenoff/microfe-bigconsole 2026.1122.3 → 2026.1122.5

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.
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ export interface DashboardAnchorWidgetOption {
3
+ id: string;
4
+ title: string;
5
+ }
6
+ export interface DashboardCommentsDrawerProps {
7
+ dashboardId: string;
8
+ isOpen: boolean;
9
+ onClose: () => void;
10
+ /** Widgets available on the dashboard so comments can anchor to them. */
11
+ widgets: readonly DashboardAnchorWidgetOption[];
12
+ /** Optional callback to select/focus a widget when its anchor chip is clicked. */
13
+ onSelectWidget?: (widgetId: string) => void;
14
+ }
15
+ export declare const DashboardCommentsDrawer: FC<DashboardCommentsDrawerProps>;
16
+ export default DashboardCommentsDrawer;
@@ -0,0 +1,308 @@
1
+ import { useDashboardComments as e } from "../../hooks/useWidgetComments.js";
2
+ import { useShareRecipients as t } from "../../hooks/useShareRecipients.js";
3
+ import { CommentComposer as n } from "../widgets/comments/WidgetComments.js";
4
+ import { parseCommentAnchor as r, parseCommentMentionNames as i, splitTextWithMentions as a } from "../widgets/comments/commentMentions.js";
5
+ import { memo as o, useCallback as s, useMemo as c, useState as l } from "react";
6
+ import { Check as u, CornerDownRight as d, LayoutGrid as f, Loader2 as p, MapPin as m, MessageSquare as h, RotateCcw as g, Trash2 as _, X as v } from "lucide-react";
7
+ import { useI18n as y } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
8
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
9
+ // src/bigconsole/components/dashboard/DashboardCommentsDrawer.tsx
10
+ function S(e) {
11
+ let t = new Date(e);
12
+ return Number.isNaN(t.getTime()) ? "" : new Intl.DateTimeFormat(void 0, {
13
+ dateStyle: "medium",
14
+ timeStyle: "short"
15
+ }).format(t);
16
+ }
17
+ var C = ({ comment: e, isReply: t, busy: n, memberNames: o, onResolve: s, onDelete: l, onReply: p, onSelectWidget: h }) => {
18
+ let { t: v } = y(), C = !!e.resolvedAt, w = e.content.text ?? e.content.markdown ?? "", T = c(() => r(e.metadata), [e.metadata]), E = c(() => i(e.metadata), [e.metadata]), D = c(() => a(w, E), [w, E]), O = o.get(e.authorId) ?? v("bigconsole.widget.comments.authorLabel", "User {{id}}", { id: e.authorId.slice(0, 6) });
19
+ return /* @__PURE__ */ b("div", {
20
+ className: t ? "pl-5" : "",
21
+ "data-testid": t ? "dashboard-comment-reply" : "dashboard-comment-item",
22
+ children: /* @__PURE__ */ x("div", {
23
+ className: "rounded-md border border-[var(--color-border-default)] bg-bg-surface p-2.5",
24
+ children: [
25
+ /* @__PURE__ */ x("div", {
26
+ className: "flex items-center justify-between gap-2",
27
+ children: [/* @__PURE__ */ b("span", {
28
+ className: "truncate text-xs font-medium text-text-primary",
29
+ children: O
30
+ }), /* @__PURE__ */ b("span", {
31
+ className: "shrink-0 text-[10px] text-text-muted tabular-nums",
32
+ children: S(e.createdAt)
33
+ })]
34
+ }),
35
+ !t && T && T.anchorType !== "dashboard" && /* @__PURE__ */ b("div", {
36
+ className: "mt-1",
37
+ children: T.anchorType === "widget" && T.widgetId ? /* @__PURE__ */ x("button", {
38
+ type: "button",
39
+ "data-testid": "dashboard-comment-anchor-badge",
40
+ onClick: () => h?.(T.widgetId),
41
+ className: "inline-flex items-center gap-1 rounded-full border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-0.5 text-[10px] font-medium text-text-secondary hover:text-text-primary",
42
+ children: [/* @__PURE__ */ b(f, {
43
+ className: "h-3 w-3 shrink-0",
44
+ "aria-hidden": "true"
45
+ }), T.widgetTitle || T.widgetId.slice(0, 8)]
46
+ }) : T.anchorType === "region" && T.regionLabel ? /* @__PURE__ */ x("span", {
47
+ "data-testid": "dashboard-comment-anchor-badge",
48
+ className: "inline-flex items-center gap-1 rounded-full border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-0.5 text-[10px] font-medium text-text-secondary",
49
+ children: [/* @__PURE__ */ b(m, {
50
+ className: "h-3 w-3 shrink-0",
51
+ "aria-hidden": "true"
52
+ }), T.regionLabel]
53
+ }) : null
54
+ }),
55
+ /* @__PURE__ */ b("p", {
56
+ className: "mt-1 whitespace-pre-wrap break-words text-sm text-text-secondary",
57
+ children: D.map((e, t) => e.isMention ? /* @__PURE__ */ b("span", {
58
+ className: "rounded bg-bg-sunken px-1 py-0.5 text-xs font-medium text-action-primary-bg",
59
+ children: e.text
60
+ }, t) : /* @__PURE__ */ b("span", { children: e.text }, t))
61
+ }),
62
+ /* @__PURE__ */ x("div", {
63
+ className: "mt-1.5 flex flex-wrap items-center gap-2",
64
+ children: [
65
+ C && /* @__PURE__ */ x("span", {
66
+ className: "inline-flex items-center gap-1 rounded bg-status-success-bg px-1.5 py-0.5 text-[10px] font-medium text-status-success-text",
67
+ children: [
68
+ /* @__PURE__ */ b(u, { className: "h-3 w-3" }),
69
+ " ",
70
+ v("bigconsole.widget.comments.resolvedBadge", "Resolved")
71
+ ]
72
+ }),
73
+ p && /* @__PURE__ */ x("button", {
74
+ type: "button",
75
+ disabled: n,
76
+ onClick: () => p(e.id),
77
+ className: "inline-flex items-center gap-1 text-[11px] text-text-muted hover:text-text-primary disabled:opacity-50",
78
+ children: [
79
+ /* @__PURE__ */ b(d, { className: "h-3 w-3" }),
80
+ " ",
81
+ v("bigconsole.widget.comments.reply", "Reply")
82
+ ]
83
+ }),
84
+ /* @__PURE__ */ x("button", {
85
+ type: "button",
86
+ disabled: n,
87
+ onClick: () => s(e.id, !C),
88
+ className: "inline-flex items-center gap-1 text-[11px] text-text-muted hover:text-text-primary disabled:opacity-50",
89
+ children: [b(C ? g : u, { className: "h-3 w-3" }), C ? v("bigconsole.widget.comments.reopen", "Reopen") : v("bigconsole.widget.comments.resolve", "Resolve")]
90
+ }),
91
+ /* @__PURE__ */ x("button", {
92
+ type: "button",
93
+ disabled: n,
94
+ onClick: () => l(e.id),
95
+ className: "inline-flex items-center gap-1 text-[11px] text-status-error-text hover:opacity-80 disabled:opacity-50",
96
+ children: [
97
+ /* @__PURE__ */ b(_, { className: "h-3 w-3" }),
98
+ " ",
99
+ v("bigconsole.widget.comments.delete", "Delete")
100
+ ]
101
+ })
102
+ ]
103
+ })
104
+ ]
105
+ })
106
+ });
107
+ }, w = o(function({ dashboardId: r, isOpen: i, onClose: a, widgets: o, onSelectWidget: u }) {
108
+ let { t: d } = y(), { threads: f, count: m, loading: g, error: _, mutating: S, addComment: w, resolveComment: T, deleteComment: E } = e(r, i), { results: D } = t(i, ""), [O, k] = l("all"), [A, j] = l(null), [M, N] = l("dashboard"), [P, F] = l(""), [I, L] = l(""), R = c(() => D.filter((e) => e.type === "USER").map((e) => ({
109
+ id: e.id,
110
+ name: e.name,
111
+ ...e.email ? { email: e.email } : {}
112
+ })), [D]), z = c(() => {
113
+ let e = /* @__PURE__ */ new Map();
114
+ for (let t of R) e.set(t.id, t.name);
115
+ return e;
116
+ }, [R]), B = c(() => O === "all" ? f : f.filter(({ comment: e }) => {
117
+ let t = !!e.resolvedAt;
118
+ return O === "resolved" ? t : !t;
119
+ }), [O, f]), V = s(() => {
120
+ if (M === "widget" && P) {
121
+ let e = o.find((e) => e.id === P);
122
+ return {
123
+ anchorType: "widget",
124
+ widgetId: P,
125
+ ...e?.title ? { widgetTitle: e.title } : {}
126
+ };
127
+ }
128
+ return M === "region" && I.trim() ? {
129
+ anchorType: "region",
130
+ regionLabel: I.trim()
131
+ } : { anchorType: "dashboard" };
132
+ }, [
133
+ I,
134
+ M,
135
+ P,
136
+ o
137
+ ]), H = s(async (e, t, n, r) => {
138
+ let i = {
139
+ ...r ? { parentCommentId: r } : { anchor: V() },
140
+ ...t.length > 0 ? {
141
+ mentionUserIds: t,
142
+ mentionNames: n
143
+ } : {}
144
+ }, a = await w(e, i);
145
+ return a && r && j(null), a;
146
+ }, [w, V]);
147
+ return i ? /* @__PURE__ */ x("aside", {
148
+ role: "dialog",
149
+ "aria-label": d("bigconsole.dashboard.comments.drawerAriaLabel", "Console comments"),
150
+ "data-testid": "dashboard-comments-drawer",
151
+ onKeyDown: (e) => {
152
+ e.key === "Escape" && (e.stopPropagation(), a());
153
+ },
154
+ className: "fixed bottom-0 right-0 top-14 z-40 flex w-full max-w-sm flex-col border-l border-[var(--color-border-default)] bg-bg-surface shadow-xl",
155
+ children: [
156
+ /* @__PURE__ */ x("div", {
157
+ className: "flex items-center justify-between gap-2 border-b border-[var(--color-border-subtle)] px-4 py-3",
158
+ children: [/* @__PURE__ */ x("h2", {
159
+ className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
160
+ children: [
161
+ /* @__PURE__ */ b(h, {
162
+ className: "h-4 w-4 text-text-secondary",
163
+ "aria-hidden": "true"
164
+ }),
165
+ d("bigconsole.dashboard.comments.title", "Console comments"),
166
+ /* @__PURE__ */ b("span", {
167
+ "data-testid": "dashboard-comments-count",
168
+ className: "rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] font-medium text-text-secondary tabular-nums",
169
+ children: m
170
+ })
171
+ ]
172
+ }), /* @__PURE__ */ b("button", {
173
+ type: "button",
174
+ onClick: a,
175
+ "aria-label": d("bigconsole.dashboard.comments.close", "Close comments"),
176
+ className: "rounded-md p-1 text-text-muted hover:bg-bg-sunken hover:text-text-primary",
177
+ children: /* @__PURE__ */ b(v, { className: "h-4 w-4" })
178
+ })]
179
+ }),
180
+ /* @__PURE__ */ b("div", {
181
+ className: "flex items-center gap-1 border-b border-[var(--color-border-subtle)] px-4 py-2",
182
+ children: [
183
+ "all",
184
+ "open",
185
+ "resolved"
186
+ ].map((e) => /* @__PURE__ */ b("button", {
187
+ type: "button",
188
+ onClick: () => k(e),
189
+ className: O === e ? "rounded-full bg-action-primary-bg px-2.5 py-0.5 text-xs font-medium text-action-primary-text" : "rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary hover:text-text-primary",
190
+ children: e === "all" ? d("bigconsole.dashboard.comments.filterAll", "All") : e === "open" ? d("bigconsole.dashboard.comments.filterOpen", "Open") : d("bigconsole.dashboard.comments.filterResolved", "Resolved")
191
+ }, e))
192
+ }),
193
+ /* @__PURE__ */ x("div", {
194
+ className: "flex-1 space-y-3 overflow-auto p-3",
195
+ children: [
196
+ g && f.length === 0 && /* @__PURE__ */ b("div", {
197
+ className: "flex items-center justify-center py-8 text-text-muted",
198
+ children: /* @__PURE__ */ b(p, { className: "h-5 w-5 animate-spin" })
199
+ }),
200
+ _ && !g && /* @__PURE__ */ b("p", {
201
+ role: "alert",
202
+ className: "rounded-md border border-[var(--color-status-error-border)] bg-status-error-bg-subtle px-2.5 py-2 text-xs text-status-error-text",
203
+ children: d("bigconsole.widget.comments.loadError", "Couldn’t load comments.")
204
+ }),
205
+ !g && !_ && B.length === 0 && /* @__PURE__ */ b("p", {
206
+ className: "py-8 text-center text-sm text-text-muted",
207
+ children: d("bigconsole.dashboard.comments.empty", "No comments in this view yet. Anchor a note below.")
208
+ }),
209
+ B.map(({ comment: e, replies: t }) => /* @__PURE__ */ x("div", {
210
+ className: "space-y-2",
211
+ children: [
212
+ /* @__PURE__ */ b(C, {
213
+ comment: e,
214
+ busy: S,
215
+ memberNames: z,
216
+ onResolve: (e, t) => void T(e, t),
217
+ onDelete: (e) => void E(e),
218
+ onReply: (e) => j((t) => t === e ? null : e),
219
+ onSelectWidget: u
220
+ }),
221
+ t.map((e) => /* @__PURE__ */ b(C, {
222
+ comment: e,
223
+ isReply: !0,
224
+ busy: S,
225
+ memberNames: z,
226
+ onResolve: (e, t) => void T(e, t),
227
+ onDelete: (e) => void E(e)
228
+ }, e.id)),
229
+ A === e.id && /* @__PURE__ */ b("div", {
230
+ className: "pl-5",
231
+ children: /* @__PURE__ */ b(n, {
232
+ placeholder: d("bigconsole.widget.comments.replyPlaceholder", "Write a reply… (type @ to mention)"),
233
+ busy: S,
234
+ autoFocus: !0,
235
+ candidates: R,
236
+ onSubmit: (t, n, r) => H(t, n, r, e.id),
237
+ onCancel: () => j(null)
238
+ })
239
+ })
240
+ ]
241
+ }, e.id))
242
+ ]
243
+ }),
244
+ /* @__PURE__ */ x("div", {
245
+ className: "space-y-2 border-t border-[var(--color-border-default)] p-3",
246
+ children: [/* @__PURE__ */ x("div", {
247
+ className: "flex flex-wrap items-center gap-1.5 text-xs",
248
+ children: [
249
+ /* @__PURE__ */ b("span", {
250
+ className: "text-text-muted",
251
+ children: d("bigconsole.dashboard.comments.anchorLabel", "Anchor:")
252
+ }),
253
+ /* @__PURE__ */ x("select", {
254
+ "aria-label": d("bigconsole.dashboard.comments.anchorTypeAria", "Comment anchor target"),
255
+ "data-testid": "dashboard-comment-anchor-type",
256
+ value: M,
257
+ onChange: (e) => N(e.target.value),
258
+ className: "rounded border border-[var(--color-border-default)] bg-bg-surface px-2 py-1 text-xs text-text-primary",
259
+ children: [
260
+ /* @__PURE__ */ b("option", {
261
+ value: "dashboard",
262
+ children: d("bigconsole.dashboard.comments.anchorDashboard", "Whole dashboard")
263
+ }),
264
+ o.length > 0 && /* @__PURE__ */ b("option", {
265
+ value: "widget",
266
+ children: d("bigconsole.dashboard.comments.anchorWidget", "Widget")
267
+ }),
268
+ /* @__PURE__ */ b("option", {
269
+ value: "region",
270
+ children: d("bigconsole.dashboard.comments.anchorRegion", "Region")
271
+ })
272
+ ]
273
+ }),
274
+ M === "widget" && o.length > 0 && /* @__PURE__ */ x("select", {
275
+ "aria-label": d("bigconsole.dashboard.comments.anchorWidgetSelectAria", "Select widget"),
276
+ "data-testid": "dashboard-comment-anchor-widget",
277
+ value: P,
278
+ onChange: (e) => F(e.target.value),
279
+ className: "min-w-0 flex-1 rounded border border-[var(--color-border-default)] bg-bg-surface px-2 py-1 text-xs text-text-primary",
280
+ children: [/* @__PURE__ */ b("option", {
281
+ value: "",
282
+ children: d("bigconsole.dashboard.comments.selectWidgetPlaceholder", "Choose widget…")
283
+ }), o.map((e) => /* @__PURE__ */ b("option", {
284
+ value: e.id,
285
+ children: e.title
286
+ }, e.id))]
287
+ }),
288
+ M === "region" && /* @__PURE__ */ b("input", {
289
+ type: "text",
290
+ "data-testid": "dashboard-comment-anchor-region",
291
+ value: I,
292
+ onChange: (e) => L(e.target.value),
293
+ maxLength: 60,
294
+ placeholder: d("bigconsole.dashboard.comments.regionPlaceholder", "e.g. Revenue KPI row"),
295
+ className: "min-w-0 flex-1 rounded border border-[var(--color-border-default)] bg-bg-surface px-2 py-1 text-xs text-text-primary placeholder:text-text-muted"
296
+ })
297
+ ]
298
+ }), /* @__PURE__ */ b(n, {
299
+ placeholder: d("bigconsole.dashboard.comments.addPlaceholder", "Comment on this console… (@ to mention)"),
300
+ busy: S,
301
+ candidates: R,
302
+ onSubmit: (e, t, n) => H(e, t, n)
303
+ })]
304
+ })
305
+ ]
306
+ }) : null;
307
+ });
308
+ export { w as DashboardCommentsDrawer, w as default };
@@ -0,0 +1,8 @@
1
+ import { FC } from 'react';
2
+ export interface DashboardPresenceBarProps {
3
+ dashboardId: string;
4
+ /** Disable presence when viewing a historical ("as of") snapshot. */
5
+ enabled?: boolean;
6
+ }
7
+ export declare const DashboardPresenceBar: FC<DashboardPresenceBarProps>;
8
+ export default DashboardPresenceBar;
@@ -0,0 +1,138 @@
1
+ import e from "../../hooks/useDashboardPresence.js";
2
+ import { memo as t, useEffect as n, useRef as r, useState as i } from "react";
3
+ import { Users as a, WifiOff as o } from "lucide-react";
4
+ import { useI18n as s } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
+ // src/bigconsole/components/dashboard/DashboardPresenceBar.tsx
7
+ var u = 4;
8
+ function d(e) {
9
+ let t = e.trim();
10
+ if (!t) return "?";
11
+ let n = t.split(/\s+/).filter(Boolean);
12
+ return n.length >= 2 ? `${n[0]?.[0] ?? ""}${n[1]?.[0] ?? ""}`.toUpperCase() : t.slice(0, 2).toUpperCase();
13
+ }
14
+ function f(e) {
15
+ let t = Date.parse(e);
16
+ if (Number.isNaN(t)) return "";
17
+ let n = Math.max(0, Math.round((Date.now() - t) / 1e3));
18
+ return n < 10 ? "just now" : n < 60 ? `${n}s ago` : `${Math.floor(n / 60)}m ago`;
19
+ }
20
+ var p = t(function({ dashboardId: t, enabled: p = !0 }) {
21
+ let { t: m } = s(), { viewers: h, activeCount: g, unavailable: _, loading: v } = e(t, p), [y, b] = i(!1), x = r(null);
22
+ if (n(() => {
23
+ if (!y) return;
24
+ let e = (e) => {
25
+ x.current && !x.current.contains(e.target) && b(!1);
26
+ }, t = (e) => {
27
+ e.key === "Escape" && b(!1);
28
+ };
29
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
30
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
31
+ };
32
+ }, [y]), !p) return null;
33
+ if (_) return /* @__PURE__ */ l("div", {
34
+ role: "status",
35
+ "data-testid": "dashboard-presence-unavailable",
36
+ title: m("bigconsole.presence.unavailableTooltip", "Live viewer presence is temporarily unavailable"),
37
+ className: "inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-0.5 text-[11px] text-text-muted",
38
+ children: [/* @__PURE__ */ c(o, {
39
+ className: "h-3 w-3 shrink-0",
40
+ "aria-hidden": "true"
41
+ }), /* @__PURE__ */ c("span", {
42
+ className: "hidden sm:inline",
43
+ children: m("bigconsole.presence.unavailable", "Presence offline")
44
+ })]
45
+ });
46
+ if (v && g === 0) return null;
47
+ let S = h.slice(0, u), C = Math.max(0, g - S.length), w = g === 1 ? m("bigconsole.presence.oneViewer", "1 viewing") : m("bigconsole.presence.manyViewers", "{{count}} viewing", { count: g });
48
+ return /* @__PURE__ */ l("div", {
49
+ ref: x,
50
+ className: "relative flex-shrink-0",
51
+ "data-testid": "dashboard-presence-bar",
52
+ children: [/* @__PURE__ */ l("button", {
53
+ type: "button",
54
+ onClick: () => b((e) => !e),
55
+ "aria-expanded": y,
56
+ "aria-haspopup": "dialog",
57
+ "aria-label": m("bigconsole.presence.rosterAriaLabel", "Active viewers ({{count}})", { count: g }),
58
+ "data-testid": "dashboard-presence-trigger",
59
+ className: "inline-flex items-center gap-1.5 rounded-full border border-[var(--color-border-subtle)] bg-bg-surface px-2 py-1 text-xs text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
60
+ children: [
61
+ /* @__PURE__ */ c("span", {
62
+ "aria-hidden": "true",
63
+ className: "h-2 w-2 rounded-full bg-status-success-text"
64
+ }),
65
+ /* @__PURE__ */ l("span", {
66
+ className: "flex -space-x-1.5",
67
+ children: [S.map((e) => /* @__PURE__ */ c("span", {
68
+ "data-testid": "dashboard-presence-avatar",
69
+ title: e.isCurrentUser ? m("bigconsole.presence.viewerSelf", "{{name}} (You)", { name: e.displayName }) : e.displayName,
70
+ className: e.isCurrentUser ? "inline-flex h-5 w-5 items-center justify-center rounded-full border border-bg-surface bg-action-primary-bg text-[10px] font-semibold text-action-primary-text" : "inline-flex h-5 w-5 items-center justify-center rounded-full border border-bg-surface bg-bg-sunken text-[10px] font-semibold text-text-primary",
71
+ children: d(e.displayName)
72
+ }, e.actorId)), C > 0 && /* @__PURE__ */ l("span", {
73
+ className: "inline-flex h-5 w-5 items-center justify-center rounded-full border border-bg-surface bg-bg-sunken text-[10px] font-medium text-text-secondary tabular-nums",
74
+ children: ["+", C]
75
+ })]
76
+ }),
77
+ /* @__PURE__ */ c("span", {
78
+ className: "hidden text-[11px] font-medium tabular-nums sm:inline",
79
+ children: w
80
+ })
81
+ ]
82
+ }), y && /* @__PURE__ */ l("div", {
83
+ role: "dialog",
84
+ "aria-label": m("bigconsole.presence.rosterDialogTitle", "Currently viewing this dashboard"),
85
+ "data-testid": "dashboard-presence-popover",
86
+ className: "absolute right-0 top-full z-50 mt-1.5 w-64 rounded-lg border border-[var(--color-border-default)] bg-bg-surface p-3 shadow-lg",
87
+ children: [/* @__PURE__ */ l("div", {
88
+ className: "mb-2 flex items-center justify-between gap-2 border-b border-[var(--color-border-subtle)] pb-1.5",
89
+ children: [/* @__PURE__ */ l("span", {
90
+ className: "inline-flex items-center gap-1.5 text-xs font-semibold text-text-primary",
91
+ children: [/* @__PURE__ */ c(a, {
92
+ className: "h-3.5 w-3.5 text-text-secondary",
93
+ "aria-hidden": "true"
94
+ }), m("bigconsole.presence.activeViewersHeading", "Active viewers")]
95
+ }), /* @__PURE__ */ c("span", {
96
+ className: "rounded-full bg-bg-sunken px-1.5 py-0.5 text-[10px] font-medium text-text-secondary tabular-nums",
97
+ children: g
98
+ })]
99
+ }), h.length === 0 ? /* @__PURE__ */ c("p", {
100
+ className: "py-2 text-xs text-text-muted",
101
+ children: m("bigconsole.presence.empty", "No other active viewers right now.")
102
+ }) : /* @__PURE__ */ c("ul", {
103
+ className: "max-h-56 space-y-1.5 overflow-auto",
104
+ children: h.map((e) => /* @__PURE__ */ l("li", {
105
+ "data-testid": "dashboard-presence-viewer",
106
+ className: "flex items-center justify-between gap-2 rounded-md px-1.5 py-1 hover:bg-bg-sunken/60",
107
+ children: [/* @__PURE__ */ l("div", {
108
+ className: "flex min-w-0 items-center gap-2",
109
+ children: [/* @__PURE__ */ c("span", {
110
+ className: e.isCurrentUser ? "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-action-primary-bg text-[10px] font-semibold text-action-primary-text" : "inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-[10px] font-semibold text-text-primary",
111
+ children: d(e.displayName)
112
+ }), /* @__PURE__ */ l("div", {
113
+ className: "min-w-0",
114
+ children: [/* @__PURE__ */ l("p", {
115
+ className: "truncate text-xs font-medium text-text-primary",
116
+ children: [e.displayName, e.isCurrentUser && /* @__PURE__ */ l("span", {
117
+ className: "ml-1 text-[10px] font-normal text-text-muted",
118
+ children: [
119
+ "(",
120
+ m("bigconsole.presence.you", "You"),
121
+ ")"
122
+ ]
123
+ })]
124
+ }), /* @__PURE__ */ l("p", {
125
+ className: "text-[10px] text-text-muted tabular-nums",
126
+ children: [f(e.lastSeenAt), e.connectionCount > 1 ? ` · ${m("bigconsole.presence.tabsCount", "{{count}} tabs", { count: e.connectionCount })}` : ""]
127
+ })]
128
+ })]
129
+ }), /* @__PURE__ */ c("span", {
130
+ "aria-hidden": "true",
131
+ className: "h-2 w-2 shrink-0 rounded-full bg-status-success-text"
132
+ })]
133
+ }, e.actorId))
134
+ })]
135
+ })]
136
+ });
137
+ });
138
+ export { p as DashboardPresenceBar, p as default };
@@ -24,3 +24,5 @@ export { DrilldownBreadcrumb } from './DrilldownBreadcrumb';
24
24
  export { BuilderCanvas, BuilderTopbar, DashboardEditorShell } from '../builder';
25
25
  export { PublishToStoreDialog } from './PublishToStoreDialog';
26
26
  export { DashboardReviewDialog, type DashboardReviewDialogProps } from './DashboardReviewDialog';
27
+ export { DashboardPresenceBar, type DashboardPresenceBarProps } from './DashboardPresenceBar';
28
+ export { DashboardCommentsDrawer, type DashboardCommentsDrawerProps, type DashboardAnchorWidgetOption, } from './DashboardCommentsDrawer';
@@ -28,4 +28,6 @@ import { DrilldownBreadcrumb as r } from "./DrilldownBreadcrumb.js";
28
28
  import "../builder/index.js";
29
29
  import { PublishToStoreDialog as i } from "./PublishToStoreDialog.js";
30
30
  import { DashboardReviewDialog as a } from "./DashboardReviewDialog.js";
31
- export { e as DashboardCanvas, a as DashboardReviewDialog, r as DrilldownBreadcrumb, n as ExportDashboardDialog, t as LiveCanvasToggle, i as PublishToStoreDialog };
31
+ import { DashboardPresenceBar as o } from "./DashboardPresenceBar.js";
32
+ import { DashboardCommentsDrawer as s } from "./DashboardCommentsDrawer.js";
33
+ export { e as DashboardCanvas, s as DashboardCommentsDrawer, o as DashboardPresenceBar, a as DashboardReviewDialog, r as DrilldownBreadcrumb, n as ExportDashboardDialog, t as LiveCanvasToggle, i as PublishToStoreDialog };
@@ -579,6 +579,7 @@ var vt = u(function({ widget: a, children: l, data: u, className: _t = "", isLoa
579
579
  fallback: null,
580
580
  children: /* @__PURE__ */ h(ht, {
581
581
  widgetId: a.id,
582
+ widgetTitle: a.title,
582
583
  onClose: () => Bt(!1)
583
584
  })
584
585
  }),
@@ -1,8 +1,21 @@
1
1
  import { FC } from 'react';
2
+ import { MentionCandidate } from './commentMentions';
2
3
  export interface WidgetCommentsProps {
3
4
  widgetId: string;
5
+ /** Optional widget title stored as anchor context on new comments. */
6
+ widgetTitle?: string;
4
7
  /** Close the panel. */
5
8
  onClose: () => void;
6
9
  }
10
+ export interface CommentComposerProps {
11
+ placeholder: string;
12
+ busy: boolean;
13
+ autoFocus?: boolean;
14
+ candidates: readonly MentionCandidate[];
15
+ /** Returns false when the post failed — the draft is kept so it isn't lost. */
16
+ onSubmit: (text: string, mentionUserIds: string[], mentionNames: string[]) => boolean | void | Promise<boolean | void>;
17
+ onCancel?: () => void;
18
+ }
19
+ export declare const CommentComposer: FC<CommentComposerProps>;
7
20
  export declare const WidgetComments: FC<WidgetCommentsProps>;
8
21
  export default WidgetComments;