@burdenoff/microfe-bigconsole 2026.1118.10 → 2026.1119.2

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