@burdenoff/microfe-bigconsole 2026.1122.2 → 2026.1122.4

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 (35) hide show
  1. package/dist/bigconsole/asof/AsOfProvider.d.ts +7 -0
  2. package/dist/bigconsole/asof/AsOfProvider.js +5 -2
  3. package/dist/bigconsole/asof/asOfParam.d.ts +5 -0
  4. package/dist/bigconsole/asof/asOfParam.js +7 -4
  5. package/dist/bigconsole/asof/index.d.ts +2 -2
  6. package/dist/bigconsole/asof/index.js +6 -6
  7. package/dist/bigconsole/asof/liveOnlySurfaces.d.ts +43 -0
  8. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +133 -127
  9. package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.d.ts +16 -0
  10. package/dist/bigconsole/components/dashboard/DashboardCommentsDrawer.js +308 -0
  11. package/dist/bigconsole/components/dashboard/DashboardPresenceBar.d.ts +8 -0
  12. package/dist/bigconsole/components/dashboard/DashboardPresenceBar.js +138 -0
  13. package/dist/bigconsole/components/dashboard/DashboardToolbar.js +51 -51
  14. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.d.ts +3 -1
  15. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/FilterChip.js +34 -34
  16. package/dist/bigconsole/components/dashboard/GlobalFiltersBar/GlobalFiltersBar.js +154 -145
  17. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +302 -294
  18. package/dist/bigconsole/components/dashboard/index.d.ts +2 -0
  19. package/dist/bigconsole/components/dashboard/index.js +3 -1
  20. package/dist/bigconsole/components/widgets/WidgetWrapper.js +165 -163
  21. package/dist/bigconsole/components/widgets/comments/WidgetComments.d.ts +13 -0
  22. package/dist/bigconsole/components/widgets/comments/WidgetComments.js +213 -117
  23. package/dist/bigconsole/components/widgets/comments/commentMentions.d.ts +58 -0
  24. package/dist/bigconsole/components/widgets/comments/commentMentions.js +66 -0
  25. package/dist/bigconsole/hooks/index.d.ts +2 -1
  26. package/dist/bigconsole/hooks/index.js +1 -0
  27. package/dist/bigconsole/hooks/useDashboardPresence.d.ts +44 -0
  28. package/dist/bigconsole/hooks/useDashboardPresence.js +147 -0
  29. package/dist/bigconsole/hooks/useWidgetComments.d.ts +12 -1
  30. package/dist/bigconsole/hooks/useWidgetComments.js +25 -13
  31. package/dist/bigconsole/pages/DashboardBuilderPage.js +88 -64
  32. package/dist/bigconsole/pages/DashboardViewPage.js +255 -221
  33. package/dist/generated/wspace-operations.d.ts +35 -0
  34. package/dist/generated/wspace-operations.js +353 -54
  35. package/package.json +1 -1
@@ -12,49 +12,51 @@ import { useReconcileAgentTool as c } from "../components/reconcile/useReconcile
12
12
  import "../components/common/index.js";
13
13
  import te from "../hooks/usePageOperations.js";
14
14
  import "../components/narrative/index.js";
15
- import { AsOfProvider as ne, HideWhenAsOf as l, useAsOf as re } from "../asof/AsOfProvider.js";
15
+ import { AsOfProvider as l, HideWhenAsOf as u, useAsOf as ne } from "../asof/AsOfProvider.js";
16
16
  import "../store/index.js";
17
17
  import "../hooks/index.js";
18
- import ie, { parseUrlToGlobalFilterValues as ae } from "../hooks/useFilterUrlSync.js";
19
- import oe from "../hooks/useActivePage.js";
20
- import { DashboardCanvas as se } from "../components/dashboard/DashboardCanvas.js";
21
- import { dashboardPageTabs as ce } from "../assistant/pageControls.js";
22
- import { LiveCanvasToggle as le } from "../components/dashboard/LiveCanvasToggle.js";
23
- import { ExportDashboardDialog as ue } from "../components/dashboard/ExportDashboardDialog.js";
24
- import { DrilldownBreadcrumb as de } from "../components/dashboard/DrilldownBreadcrumb.js";
25
- import { PublishToStoreDialog as fe } from "../components/dashboard/PublishToStoreDialog.js";
26
- import { DashboardReviewDialog as pe } from "../components/dashboard/DashboardReviewDialog.js";
27
- import { loadBigConsoleSettings as me } from "../hooks/useBigConsoleSettings.js";
28
- import { LIVE_STRUCTURE_POLL_MS as he, isLiveDataRefreshDue as ge } from "../utils/liveBoardRefresh.js";
29
- import { registerBreadcrumbName as _e, unregisterBreadcrumbName as ve } from "../utils/breadcrumbRegistry.js";
30
- import { DigestPanel as ye } from "../components/narrative/DigestPanel.js";
31
- import { GetWidgetDocument as be } from "../../generated/wspace-operations.js";
32
- import { dashboardSuggestAnchorProps as xe } from "../proactive/entities.js";
33
- import { memo as u, useCallback as d, useEffect as f, useMemo as p, useRef as Se, useState as m } from "react";
34
- import { useLocation as Ce, useParams as we } from "react-router";
35
- import { AccessDenied as Te } from "@burdenoff/fe-libs/shared/components";
36
- import { usePermissions as Ee } from "@burdenoff/fe-libs/shared/providers/shell";
37
- import { ArrowLeft as De, Sparkles as Oe } from "lucide-react";
38
- import { Button as h, IllustratedEmptyState as ke } from "@burdenoff/fe-libs/ui";
39
- import { useI18n as Ae } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
40
- import { useApolloClient as je } from "@apollo/client/react";
41
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
42
- import { useAssistantPageControls as Me } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
18
+ import re, { parseUrlToGlobalFilterValues as ie } from "../hooks/useFilterUrlSync.js";
19
+ import ae from "../hooks/useActivePage.js";
20
+ import { DashboardCanvas as oe } from "../components/dashboard/DashboardCanvas.js";
21
+ import { dashboardPageTabs as se } from "../assistant/pageControls.js";
22
+ import { LiveCanvasToggle as ce } from "../components/dashboard/LiveCanvasToggle.js";
23
+ import { ExportDashboardDialog as le } from "../components/dashboard/ExportDashboardDialog.js";
24
+ import { DrilldownBreadcrumb as ue } from "../components/dashboard/DrilldownBreadcrumb.js";
25
+ import { PublishToStoreDialog as de } from "../components/dashboard/PublishToStoreDialog.js";
26
+ import { DashboardReviewDialog as fe } from "../components/dashboard/DashboardReviewDialog.js";
27
+ import { DashboardPresenceBar as pe } from "../components/dashboard/DashboardPresenceBar.js";
28
+ import { DashboardCommentsDrawer as me } from "../components/dashboard/DashboardCommentsDrawer.js";
29
+ import { loadBigConsoleSettings as he } from "../hooks/useBigConsoleSettings.js";
30
+ import { LIVE_STRUCTURE_POLL_MS as ge, isLiveDataRefreshDue as _e } from "../utils/liveBoardRefresh.js";
31
+ import { registerBreadcrumbName as ve, unregisterBreadcrumbName as ye } from "../utils/breadcrumbRegistry.js";
32
+ import { DigestPanel as be } from "../components/narrative/DigestPanel.js";
33
+ import { GetWidgetDocument as xe } from "../../generated/wspace-operations.js";
34
+ import { dashboardSuggestAnchorProps as Se } from "../proactive/entities.js";
35
+ import { memo as d, useCallback as f, useEffect as p, useMemo as m, useRef as Ce, useState as h } from "react";
36
+ import { useLocation as we, useParams as Te } from "react-router";
37
+ import { AccessDenied as Ee } from "@burdenoff/fe-libs/shared/components";
38
+ import { usePermissions as De } from "@burdenoff/fe-libs/shared/providers/shell";
39
+ import { ArrowLeft as Oe, MessageSquare as ke, Sparkles as Ae } from "lucide-react";
40
+ import { Button as g, IllustratedEmptyState as je } from "@burdenoff/fe-libs/ui";
41
+ import { useI18n as Me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
42
+ import { useApolloClient as Ne } from "@apollo/client/react";
43
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
44
+ import { useAssistantPageControls as Pe } from "@burdenoff/fe-libs/shared/assistant/appControls/useAssistantControl";
43
45
  // src/bigconsole/pages/DashboardViewPage.tsx
44
- var y = u(function() {
45
- let { dashboardId: r } = we(), c = a(), ne = i(), { t: u } = Ae(), y = re().asOf !== null, b = je(), { hasPermission: x, isLoading: S } = Ee(), C = x(n.DASHBOARD_READ), w = x(n.DASHBOARD_UPDATE), Pe = x(n.DASHBOARD_EXPORT), Fe = x(n.DASHBOARD_PUBLISH), [Ie, T] = m(!1), [E, D] = m(!1), [Le, O] = m(!1), [k, Re] = m(!1), [A, ze] = m(!1), { isInDrilldown: j, getContextFromUrl: M, getDrilldownMetadata: N } = ie(), P = t((e) => e.currentDashboard), F = t((e) => e.setCurrentDashboard), I = t((e) => e.setGlobalFilterValue), L = t((e) => e.viewMode), Be = t((e) => e.setViewMode);
46
- f(() => {
47
- y && L === "edit" && Be("view");
46
+ var b = d(function() {
47
+ let { dashboardId: r } = Te(), c = a(), l = i(), { t: d } = Me(), b = ne().asOf !== null, x = Ne(), { hasPermission: S, isLoading: C } = De(), w = S(n.DASHBOARD_READ), Ie = S(n.DASHBOARD_UPDATE), Le = S(n.DASHBOARD_EXPORT), Re = S(n.DASHBOARD_PUBLISH), [ze, Be] = h(!1), [T, E] = h(!1), [Ve, He] = h(!1), [D, Ue] = h(!1), [O, k] = h(!1), [A, j] = h(!1), { isInDrilldown: M, getContextFromUrl: We, getDrilldownMetadata: N } = re(), P = t((e) => e.currentDashboard), F = t((e) => e.setCurrentDashboard), I = t((e) => e.setGlobalFilterValue), L = t((e) => e.viewMode), R = t((e) => e.setViewMode);
48
+ p(() => {
49
+ b && L === "edit" && R("view");
48
50
  }, [
49
- y,
51
+ b,
50
52
  L,
51
- Be
53
+ R
52
54
  ]);
53
- let Ve = e((e) => e.closeConfigPanel);
54
- f(() => {
55
- y && Ve();
56
- }, [y, Ve]);
57
- let R = t((e) => e.clearAllGlobalFilters), He = t((e) => e.setGlobalFilterValues), z = e((e) => e.widgets), Ue = Ce(), { activePageId: B, setActivePage: V } = oe(P?.id === r ? P?.pages : void 0), H = e((e) => e.clipboardWidgetId), U = e((e) => e.clipboardAction), W = e((e) => e.clearClipboard), G = e((e) => e.selectWidget), { loading: K, error: q, fetchDashboard: J, updateDashboard: Y } = ee(), { createWidget: We, deleteWidget: Ge, duplicateWidget: Ke, batchUpdatePositions: qe, refetch: Je } = s(B || void 0, r), { createPage: Ye, updatePage: Xe, deletePage: Ze, duplicatePage: Qe, reorderPages: $e } = te(), et = d((e) => {
55
+ let z = e((e) => e.closeConfigPanel);
56
+ p(() => {
57
+ b && z();
58
+ }, [b, z]);
59
+ let Ge = t((e) => e.clearAllGlobalFilters), Ke = t((e) => e.setGlobalFilterValues), B = e((e) => e.widgets), qe = we(), { activePageId: V, setActivePage: H } = ae(P?.id === r ? P?.pages : void 0), U = e((e) => e.clipboardWidgetId), W = e((e) => e.clipboardAction), G = e((e) => e.clearClipboard), K = e((e) => e.selectWidget), { loading: q, error: J, fetchDashboard: Y, updateDashboard: Je } = ee(), { createWidget: Ye, deleteWidget: Xe, duplicateWidget: Ze, batchUpdatePositions: Qe, refetch: $e } = s(V || void 0, r), { createPage: et, updatePage: tt, deletePage: nt, duplicatePage: rt, reorderPages: it } = te(), at = f((e) => {
58
60
  let t = e?.parentElement;
59
61
  if (!e || !t) return;
60
62
  let n = t;
@@ -73,100 +75,100 @@ var y = u(function() {
73
75
  a.disconnect(), s.disconnect();
74
76
  };
75
77
  }, []);
76
- f(() => {
78
+ p(() => {
77
79
  if (!r) c("/dashboards");
78
- else return He(ae(window.location.search, "filter_")), D(!1), J(r).then((e) => {
79
- e || D(!0);
80
+ else return Ke(ie(window.location.search, "filter_")), E(!1), Y(r).then((e) => {
81
+ e || E(!0);
80
82
  }), () => {
81
- F(null), R(), D(!1);
83
+ F(null), Ge(), E(!1);
82
84
  };
83
85
  }, [
84
86
  r,
85
87
  c,
86
- J,
88
+ Y,
87
89
  F,
88
- R,
89
- He
90
- ]), f(() => {
91
- if (!j) return;
92
- let e = M(), t = N();
90
+ Ge,
91
+ Ke
92
+ ]), p(() => {
93
+ if (!M) return;
94
+ let e = We(), t = N();
93
95
  Object.entries(e).forEach(([e, t]) => {
94
96
  I(`ctx_${e}`, t);
95
97
  }), t.depth > 0 && (I("__drilldown_depth", t.depth), I("__drilldown_parent", t.parent), I("__drilldown_path", t.path)), Object.keys(e).length;
96
98
  }, [
97
- j,
98
99
  M,
100
+ We,
99
101
  N,
100
102
  I,
101
- Ue.search
103
+ qe.search
102
104
  ]);
103
- let tt = Se(Je);
104
- tt.current = Je, f(() => {
105
- if (!k || !r || y) return;
105
+ let ot = Ce($e);
106
+ ot.current = $e, p(() => {
107
+ if (!D || !r || b) return;
106
108
  let e = null, n = () => {
107
109
  if (typeof document < "u" && document.visibilityState !== "visible" || t.getState().viewMode === "edit") return;
108
- J(r, { silent: !0 }), tt.current();
110
+ Y(r, { silent: !0 }), ot.current();
109
111
  let n = Date.now();
110
- ge(e, n) && (e = n, b.refetchQueries({ include: [be] }).catch((e) => {
112
+ _e(e, n) && (e = n, x.refetchQueries({ include: [xe] }).catch((e) => {
111
113
  console.warn("[DashboardViewPage] Live widget data refresh failed", e);
112
114
  }));
113
115
  };
114
116
  n();
115
- let i = window.setInterval(n, he), a = () => {
117
+ let i = window.setInterval(n, ge), a = () => {
116
118
  document.visibilityState === "visible" && (e = null, n());
117
119
  };
118
120
  return document.addEventListener("visibilitychange", a), () => {
119
121
  window.clearInterval(i), document.removeEventListener("visibilitychange", a);
120
122
  };
121
123
  }, [
122
- k,
124
+ D,
123
125
  r,
124
- y,
125
- J,
126
- b
126
+ b,
127
+ Y,
128
+ x
127
129
  ]);
128
- let nt = d(async () => {
129
- if (r && !y) {
130
- T(!0);
130
+ let st = f(async () => {
131
+ if (r && !b) {
132
+ Be(!0);
131
133
  try {
132
- let e = Array.from(z.values());
134
+ let e = Array.from(B.values());
133
135
  if (e.length > 0) {
134
136
  let t = e.map((e) => ({
135
137
  id: e.id,
136
138
  position: e.position
137
139
  }));
138
- await qe(t);
140
+ await Qe(t);
139
141
  }
140
- P && await Y({
142
+ P && await Je({
141
143
  id: r,
142
144
  name: P.name,
143
145
  description: P.description
144
146
  });
145
147
  } catch {} finally {
146
- T(!1);
148
+ Be(!1);
147
149
  }
148
150
  }
149
151
  }, [
150
152
  r,
151
- y,
152
- z,
153
+ b,
154
+ B,
153
155
  P,
154
- qe,
155
- Y
156
- ]), rt = d(() => {
156
+ Qe,
157
+ Je
158
+ ]), ct = f(() => {
157
159
  c("/dashboards");
158
- }, [c]), X = d((e) => {
159
- V(e);
160
- }, [V]), Z = p(() => (P?.pages || []).map((e, t) => ({
160
+ }, [c]), X = f((e) => {
161
+ H(e);
162
+ }, [H]), Z = m(() => (P?.pages || []).map((e, t) => ({
161
163
  id: e.id,
162
- name: e.name || u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
164
+ name: e.name || d("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: t + 1 }),
163
165
  order: e.order ?? 0
164
- })), [P?.pages, u]), Q = P && P.id === r ? P.name : null, $ = B || P?.pages?.[0]?.id || null;
165
- f(() => {
166
- if (r && Q) return _e(r, Q), () => ve(r);
166
+ })), [P?.pages, d]), Q = P && P.id === r ? P.name : null, $ = V || P?.pages?.[0]?.id || null;
167
+ p(() => {
168
+ if (r && Q) return ve(r, Q), () => ye(r);
167
169
  }, [r, Q]);
168
- let it = p(() => !S && C && !q && !E && !K && Q !== null ? ce({
169
- dashboardName: Q || u("bigconsole.dashboards.title", "Dashboards"),
170
+ let lt = m(() => !C && w && !J && !T && !q && Q !== null ? se({
171
+ dashboardName: Q || d("bigconsole.dashboards.title", "Dashboards"),
170
172
  tabs: Z.map((e) => ({
171
173
  id: e.id,
172
174
  label: e.name
@@ -174,39 +176,39 @@ var y = u(function() {
174
176
  current: $,
175
177
  select: X
176
178
  }) : null, [
177
- S,
178
179
  C,
180
+ w,
181
+ J,
182
+ T,
179
183
  q,
180
- E,
181
- K,
182
184
  Q,
183
185
  Z,
184
186
  $,
185
187
  X,
186
- u
188
+ d
187
189
  ]);
188
- Me(it);
189
- let at = d(async () => {
190
- let e = B || P?.pages?.[0]?.id;
191
- if (!H || !r || !e) return;
192
- let t = z.get(H);
190
+ Pe(lt);
191
+ let ut = f(async () => {
192
+ let e = V || P?.pages?.[0]?.id;
193
+ if (!U || !r || !e) return;
194
+ let t = B.get(U);
193
195
  if (!t) {
194
- W();
196
+ G();
195
197
  return;
196
198
  }
197
199
  let n = {
198
200
  x: 0,
199
- y: Array.from(z.values()).reduce((e, t) => {
201
+ y: Array.from(B.values()).reduce((e, t) => {
200
202
  let n = (t.positionY ?? 0) + (t.positionHeight ?? 4);
201
203
  return Math.max(e, n);
202
204
  }, 0),
203
205
  width: Math.min(t.positionWidth ?? 4, P?.pages.find((t) => t.id === e)?.gridColumns ?? 12),
204
206
  height: t.positionHeight ?? 4
205
- }, i = U === "copy" ? u("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
207
+ }, i = W === "copy" ? d("bigconsole.dashboards.view.widgetCopyTitle", "{{title}} (Copy)", { title: t.title }) : t.title, a = null;
206
208
  try {
207
- a = await Ke(H, n, i);
209
+ a = await Ze(U, n, i);
208
210
  } catch {}
209
- a ||= await We({
211
+ a ||= await Ye({
210
212
  pageId: e,
211
213
  dashboardId: r,
212
214
  type: t.type,
@@ -220,48 +222,49 @@ var y = u(function() {
220
222
  position: n,
221
223
  refreshInterval: t.refreshInterval ?? void 0,
222
224
  metadata: t.metadata
223
- }), a && (G(a.id), U === "cut" && await Ge(H)), W();
225
+ }), a && (K(a.id), W === "cut" && await Xe(U)), G();
224
226
  }, [
225
- H,
226
227
  U,
228
+ W,
227
229
  r,
228
- B,
230
+ V,
229
231
  P,
230
- z,
231
- Ke,
232
- We,
233
- Ge,
232
+ B,
233
+ Ze,
234
+ Ye,
235
+ Xe,
236
+ K,
234
237
  G,
235
- W,
236
- u
237
- ]), ot = d(() => {
238
- O(!0);
239
- }, []), [st, ct] = m(!1), lt = d(() => {
240
- ct(!0);
241
- }, []), ut = d(() => {
242
- ct(!1);
243
- }, []), dt = d(() => {
244
- O(!1);
245
- }, []), [ft, pt] = m(!1), mt = d(() => pt(!0), []), ht = d(() => pt(!1), []), gt = d(async () => {
246
- if (!P || !r) return;
247
- let e = (P.pages?.length || 0) + 1, t = u("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await Ye({
238
+ d
239
+ ]), dt = f(() => {
240
+ He(!0);
241
+ }, []), [ft, pt] = h(!1), mt = f(() => {
242
+ pt(!0);
243
+ }, []), ht = f(() => {
244
+ pt(!1);
245
+ }, []), gt = f(() => {
246
+ He(!1);
247
+ }, []), [_t, vt] = h(!1), yt = f(() => vt(!0), []), bt = f(() => vt(!1), []), xt = f(async () => {
248
+ if (!P || !r || b) return;
249
+ let e = (P.pages?.length || 0) + 1, t = d("bigconsole.dashboards.view.pageName", "Page {{count}}", { count: e }), n = await et({
248
250
  dashboardId: r,
249
251
  name: t,
250
- gridColumns: me().defaultGridColumns
252
+ gridColumns: he().defaultGridColumns
251
253
  });
252
254
  n && (F({
253
255
  ...P,
254
256
  pages: [...P.pages || [], n]
255
- }), V(n.id));
257
+ }), H(n.id));
256
258
  }, [
257
259
  P,
258
260
  r,
261
+ b,
259
262
  F,
260
- Ye,
261
- V,
262
- u
263
- ]), _t = d(async (e, t) => {
264
- P && await Xe({
263
+ et,
264
+ H,
265
+ d
266
+ ]), St = f(async (e, t) => {
267
+ P && !b && await tt({
265
268
  id: e,
266
269
  name: t
267
270
  }) && F({
@@ -273,26 +276,28 @@ var y = u(function() {
273
276
  });
274
277
  }, [
275
278
  P,
279
+ b,
276
280
  F,
277
- Xe
278
- ]), vt = d(async (e) => {
279
- if (!P || !r) return;
281
+ tt
282
+ ]), Ct = f(async (e) => {
283
+ if (!P || !r || b) return;
280
284
  let t = P.pages?.find((t) => t.id === e);
281
285
  if (!t) return;
282
- let n = await Qe(e, u("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
286
+ let n = await rt(e, d("bigconsole.dashboards.view.pageCopyName", "{{name}} (Copy)", { name: t.name ?? "" }));
283
287
  n && (F({
284
288
  ...P,
285
289
  pages: [...P.pages || [], n]
286
- }), V(n.id));
290
+ }), H(n.id));
287
291
  }, [
288
292
  P,
289
293
  r,
294
+ b,
290
295
  F,
291
- Qe,
292
- V,
293
- u
294
- ]), yt = d(async (e) => {
295
- if (!(!P || (P.pages?.length || 0) <= 1) && await Ze(e)) {
296
+ rt,
297
+ H,
298
+ d
299
+ ]), wt = f(async (e) => {
300
+ if (!(!P || b || (P.pages?.length || 0) <= 1) && await nt(e)) {
296
301
  let t = P.pages?.filter((t) => t.id !== e).map((e, t) => ({
297
302
  ...e,
298
303
  order: t
@@ -302,16 +307,17 @@ var y = u(function() {
302
307
  pages: t
303
308
  });
304
309
  let n = t?.[0]?.id;
305
- B === e && n && V(n, { replace: !0 });
310
+ V === e && n && H(n, { replace: !0 });
306
311
  }
307
312
  }, [
308
313
  P,
314
+ b,
309
315
  F,
310
- B,
311
- Ze,
312
- V
313
- ]), bt = d(async (e) => {
314
- if (!P || !r) return;
316
+ V,
317
+ nt,
318
+ H
319
+ ]), Tt = f(async (e) => {
320
+ if (!P || !r || b) return;
315
321
  F({
316
322
  ...P,
317
323
  pages: e.map((e, t) => ({
@@ -320,185 +326,213 @@ var y = u(function() {
320
326
  }))
321
327
  });
322
328
  let t = e.map((e) => e.id);
323
- await $e(r, t);
329
+ await it(r, t);
324
330
  }, [
325
331
  P,
326
332
  r,
333
+ b,
327
334
  F,
328
- $e
335
+ it
329
336
  ]);
330
- return S ? /* @__PURE__ */ _("div", {
337
+ return C ? /* @__PURE__ */ v("div", {
331
338
  className: "flex items-center justify-center h-full",
332
- children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
333
- }) : C ? q ? /* @__PURE__ */ _("div", {
339
+ children: /* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
340
+ }) : w ? J ? /* @__PURE__ */ v("div", {
334
341
  className: "flex h-full flex-col items-center justify-center",
335
342
  style: { padding: "var(--space-pagePadding)" },
336
- children: /* @__PURE__ */ _(o, {
343
+ children: /* @__PURE__ */ v(o, {
337
344
  headingLevel: 2,
338
345
  tone: "danger",
339
- title: u("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
340
- description: /* @__PURE__ */ _("span", {
346
+ title: d("bigconsole.dashboards.view.errorTitle", "Error loading dashboard"),
347
+ description: /* @__PURE__ */ v("span", {
341
348
  className: "break-words",
342
- children: q.message
349
+ children: J.message
343
350
  }),
344
351
  className: "w-full max-w-md",
345
352
  "data-testid": "dashboard-view-error",
346
- actions: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(h, {
353
+ actions: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(g, {
347
354
  size: "sm",
348
- onClick: () => J(r),
349
- children: u("bigconsole.dashboards.view.retry", "Retry")
350
- }), /* @__PURE__ */ _(h, {
355
+ onClick: () => Y(r),
356
+ children: d("bigconsole.dashboards.view.retry", "Retry")
357
+ }), /* @__PURE__ */ v(g, {
351
358
  size: "sm",
352
359
  variant: "outline",
353
360
  onClick: () => c("/dashboards"),
354
- children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
361
+ children: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
355
362
  })] })
356
363
  })
357
- }) : E ? /* @__PURE__ */ _("div", {
364
+ }) : T ? /* @__PURE__ */ v("div", {
358
365
  className: "flex flex-col items-center justify-center h-full",
359
366
  style: { padding: "var(--space-pagePadding)" },
360
- children: /* @__PURE__ */ _(ke, {
367
+ children: /* @__PURE__ */ v(je, {
361
368
  illustration: "empty-data",
362
- title: u("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
363
- description: /* @__PURE__ */ v(g, { children: [u("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ _("span", {
369
+ title: d("bigconsole.dashboards.view.notFoundTitle", "Dashboard not found"),
370
+ description: /* @__PURE__ */ y(_, { children: [d("bigconsole.dashboards.view.notFoundDescription", "The dashboard you're looking for doesn't exist or has been deleted."), /* @__PURE__ */ v("span", {
364
371
  className: "mt-2 block font-mono text-xs text-text-muted break-all",
365
- children: u("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
372
+ children: d("bigconsole.dashboards.view.idLabel", "ID: {{id}}", { id: r ?? "" })
366
373
  })] }),
367
- action: /* @__PURE__ */ _(h, {
374
+ action: /* @__PURE__ */ v(g, {
368
375
  onClick: () => c("/dashboards"),
369
- children: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
376
+ children: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards")
370
377
  })
371
378
  })
372
- }) : K || !P ? /* @__PURE__ */ _("div", {
379
+ }) : q || !P ? /* @__PURE__ */ v("div", {
373
380
  className: "flex items-center justify-center h-full",
374
381
  role: "status",
375
382
  "aria-live": "polite",
376
- children: /* @__PURE__ */ v("div", {
383
+ children: /* @__PURE__ */ y("div", {
377
384
  className: "flex flex-col items-center gap-4",
378
- children: [/* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ _("p", {
385
+ children: [/* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" }), /* @__PURE__ */ v("p", {
379
386
  className: "text-sm text-text-secondary",
380
- children: u("bigconsole.dashboards.view.loading", "Loading dashboard...")
387
+ children: d("bigconsole.dashboards.view.loading", "Loading dashboard...")
381
388
  })]
382
389
  })
383
- }) : /* @__PURE__ */ v(g, { children: [!y && /* @__PURE__ */ _(Ne, {}), /* @__PURE__ */ v("div", {
384
- ref: et,
390
+ }) : /* @__PURE__ */ y(_, { children: [!b && /* @__PURE__ */ v(Fe, {}), /* @__PURE__ */ y("div", {
391
+ ref: at,
385
392
  className: "h-full flex flex-col overflow-hidden",
386
393
  children: [
387
- /* @__PURE__ */ _(o, {
394
+ /* @__PURE__ */ v(o, {
388
395
  emphasis: "bare",
389
396
  padding: "none",
390
397
  "data-testid": "dashboard-route-header",
391
398
  "aria-label": "Dashboard",
392
399
  className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2",
393
400
  headerClassName: "",
394
- header: /* @__PURE__ */ v("div", {
401
+ header: /* @__PURE__ */ y("div", {
395
402
  className: "flex flex-wrap items-center gap-control-gap",
396
403
  children: [
397
- /* @__PURE__ */ v(h, {
398
- onClick: rt,
404
+ /* @__PURE__ */ y(g, {
405
+ onClick: ct,
399
406
  variant: "ghost",
400
407
  size: "sm",
401
- title: u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
402
- "aria-label": u("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
408
+ title: d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
409
+ "aria-label": d("bigconsole.dashboards.view.backToDashboards", "Back to Dashboards"),
403
410
  className: "flex-shrink-0",
404
- children: [/* @__PURE__ */ _(De, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.back", "Back")]
411
+ children: [/* @__PURE__ */ v(Oe, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboards.view.back", "Back")]
405
412
  }),
406
- /* @__PURE__ */ _("h1", {
413
+ /* @__PURE__ */ v("h1", {
407
414
  className: "min-w-0 flex-1 truncate text-sm font-semibold text-text-primary",
408
415
  title: P.name,
409
- ...xe(P.id),
416
+ ...Se(P.id),
410
417
  children: P.name
411
418
  }),
412
- !y && /* @__PURE__ */ _("div", {
419
+ !b && /* @__PURE__ */ v(pe, {
420
+ dashboardId: P.id,
421
+ enabled: !b
422
+ }),
423
+ /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
413
424
  className: "flex-shrink-0",
414
- children: /* @__PURE__ */ _(le, {
415
- isLive: k,
416
- onToggle: () => Re((e) => !e)
425
+ children: /* @__PURE__ */ y(g, {
426
+ onClick: () => j((e) => !e),
427
+ variant: A ? "secondary" : "ghost",
428
+ size: "sm",
429
+ "aria-pressed": A,
430
+ "data-testid": "dashboard-comments-button",
431
+ title: d("bigconsole.dashboard.comments.openButton", "Console comments"),
432
+ "aria-label": d("bigconsole.dashboard.comments.openButton", "Console comments"),
433
+ children: [/* @__PURE__ */ v(ke, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboard.comments.buttonLabel", "Comments")]
434
+ })
435
+ }) }),
436
+ !b && /* @__PURE__ */ v("div", {
437
+ className: "flex-shrink-0",
438
+ children: /* @__PURE__ */ v(ce, {
439
+ isLive: D,
440
+ onToggle: () => Ue((e) => !e)
417
441
  })
418
442
  }),
419
- /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
443
+ /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
420
444
  className: "flex-shrink-0",
421
- children: /* @__PURE__ */ v(h, {
422
- onClick: () => ze((e) => !e),
445
+ children: /* @__PURE__ */ y(g, {
446
+ onClick: () => k((e) => !e),
423
447
  variant: "ghost",
424
448
  size: "sm",
425
- "aria-pressed": A,
426
- title: u("bigconsole.dashboards.view.digest", "Console digest"),
427
- "aria-label": u("bigconsole.dashboards.view.digest", "Console digest"),
428
- children: [/* @__PURE__ */ _(Oe, { className: "w-4 h-4 mr-2" }), u("bigconsole.dashboards.view.digest", "Digest")]
449
+ "aria-pressed": O,
450
+ title: d("bigconsole.dashboards.view.digest", "Console digest"),
451
+ "aria-label": d("bigconsole.dashboards.view.digest", "Console digest"),
452
+ children: [/* @__PURE__ */ v(Ae, { className: "w-4 h-4 mr-2" }), d("bigconsole.dashboards.view.digest", "Digest")]
429
453
  })
430
454
  }) })
431
455
  ]
432
456
  })
433
457
  }),
434
- A && P && /* @__PURE__ */ _(l, { children: /* @__PURE__ */ _("div", {
458
+ O && P && /* @__PURE__ */ v(u, { children: /* @__PURE__ */ v("div", {
435
459
  className: "flex-shrink-0 border-b border-[var(--color-border-subtle)] bg-bg-surface px-3 py-2 sm:px-4",
436
- children: /* @__PURE__ */ _("div", {
460
+ children: /* @__PURE__ */ v("div", {
437
461
  className: "mx-auto max-w-3xl",
438
- children: /* @__PURE__ */ _(ye, {
462
+ children: /* @__PURE__ */ v(be, {
439
463
  dashboardId: P.id,
440
- onClose: () => ze(!1)
464
+ onClose: () => k(!1)
441
465
  })
442
466
  })
443
467
  }) }),
444
- j && /* @__PURE__ */ _(de, {
468
+ M && !b && /* @__PURE__ */ v(ue, {
445
469
  currentDashboardId: P.id,
446
470
  currentDashboardName: P.name,
447
- basePath: `${ne}/dashboards`
471
+ basePath: `${l}/dashboards`
448
472
  }),
449
- /* @__PURE__ */ _("div", {
473
+ /* @__PURE__ */ v("div", {
450
474
  className: "flex-1 min-w-0 overflow-hidden",
451
- children: /* @__PURE__ */ _(se, {
475
+ children: /* @__PURE__ */ v(oe, {
452
476
  dashboardId: P.id,
453
- pageId: B || P.pages?.[0]?.id,
477
+ pageId: V || P.pages?.[0]?.id,
454
478
  title: P.name,
455
- onPaste: at,
456
- onSave: w && !y ? nt : void 0,
457
- isSaving: Ie,
458
- onReview: y ? void 0 : mt,
459
- onExport: Pe ? ot : void 0,
460
- onPublishTemplate: Fe ? lt : void 0,
479
+ onPaste: ut,
480
+ onSave: Ie && !b ? st : void 0,
481
+ isSaving: ze,
482
+ onReview: b ? void 0 : yt,
483
+ onExport: Le && !b ? dt : void 0,
484
+ onPublishTemplate: Re && !b ? mt : void 0,
461
485
  pages: Z,
462
486
  activePageId: $ ?? void 0,
463
487
  onPageChange: X,
464
- onPageAdd: gt,
465
- onPageRename: _t,
466
- onPageDuplicate: vt,
467
- onPageDelete: yt,
468
- onPagesReorder: bt,
488
+ onPageAdd: xt,
489
+ onPageRename: St,
490
+ onPageDuplicate: Ct,
491
+ onPageDelete: wt,
492
+ onPagesReorder: Tt,
469
493
  showPageTabs: !0
470
494
  })
471
495
  }),
472
- /* @__PURE__ */ _(pe, {
473
- open: ft && !y,
474
- onClose: ht,
496
+ /* @__PURE__ */ v(fe, {
497
+ open: _t && !b,
498
+ onClose: bt,
475
499
  dashboardId: P.id,
476
500
  pages: Z,
477
- canFix: w && !y
501
+ canFix: Ie && !b
478
502
  }),
479
- /* @__PURE__ */ _(ue, {
480
- isOpen: Le,
503
+ /* @__PURE__ */ v(le, {
504
+ isOpen: Ve && !b,
481
505
  dashboardId: P.id,
482
506
  dashboardName: P.name,
483
- onClose: dt
507
+ onClose: gt
508
+ }),
509
+ !b && /* @__PURE__ */ v(me, {
510
+ dashboardId: P.id,
511
+ isOpen: A && !b,
512
+ onClose: () => j(!1),
513
+ widgets: Array.from(B.values()).map((e) => ({
514
+ id: e.id,
515
+ title: e.title || e.type
516
+ })),
517
+ onSelectWidget: (e) => K(e)
484
518
  }),
485
- /* @__PURE__ */ _(fe, {
486
- isOpen: st,
519
+ /* @__PURE__ */ v(de, {
520
+ isOpen: ft && !b,
487
521
  dashboardId: P.id,
488
522
  dashboardName: P.name,
489
523
  dashboardDescription: P.description,
490
- onClose: ut
524
+ onClose: ht
491
525
  })
492
526
  ]
493
- })] }) : /* @__PURE__ */ _(Te, {
494
- title: u("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
495
- description: u("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
527
+ })] }) : /* @__PURE__ */ v(Ee, {
528
+ title: d("bigconsole.dashboards.view.accessDeniedTitle", "Access Denied"),
529
+ description: d("bigconsole.dashboards.view.accessDeniedDescription", "You don't have permission to view this dashboard.")
496
530
  });
497
- }), Ne = () => (c(), null), b = u(function() {
531
+ }), Fe = () => (c(), null), x = d(function() {
498
532
  let { workspaceId: e } = r();
499
- return /* @__PURE__ */ _(ne, {
533
+ return /* @__PURE__ */ v(l, {
500
534
  workspaceId: e,
501
- children: /* @__PURE__ */ _(y, {})
535
+ children: /* @__PURE__ */ v(b, {})
502
536
  });
503
537
  });
504
- export { y as DashboardViewPage, b as default };
538
+ export { b as DashboardViewPage, x as default };