@burdenoff/microfe-bigconsole 2026.1124.1 → 2026.1124.3

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