@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
@@ -22,6 +22,13 @@ export interface AsOfProviderProps {
22
22
  }
23
23
  export declare const AsOfProvider: FC<AsOfProviderProps>;
24
24
  export declare function useAsOf(): AsOfState;
25
+ /**
26
+ * True while the board is shown as of a past time. The one question every "live only"
27
+ * surface asks (BOFF-15492): use it to disable a control, to return early from a handler
28
+ * that would write to the live board, or to stop a query. Register the surface in
29
+ * `liveOnlySurfaces.ts` so the guard test knows it was handled.
30
+ */
31
+ export declare function useIsPastView(): boolean;
25
32
  /**
26
33
  * Renders its children only for a live view. For parts of a board that describe
27
34
  * or act on current data (the AI digest, for one), which would contradict a past view.
@@ -91,8 +91,11 @@ var C = l({
91
91
  function D() {
92
92
  return d(C);
93
93
  }
94
- var O = ({ children: e }) => {
94
+ function O() {
95
+ return D().asOf !== null;
96
+ }
97
+ var k = ({ children: e }) => {
95
98
  let { asOf: t } = D();
96
99
  return t ? null : /* @__PURE__ */ x(b, { children: e });
97
100
  };
98
- export { E as AsOfProvider, O as HideWhenAsOf, D as useAsOf };
101
+ export { E as AsOfProvider, k as HideWhenAsOf, D as useAsOf, O as useIsPastView };
@@ -15,6 +15,11 @@ export declare const AS_OF_FEATURE_FLAG = "bigconsole.as-of-view";
15
15
  export declare function parseAsOf(value: string | null | undefined, now?: Date): Date | null;
16
16
  /** The URL value for a time: UTC, whole seconds. */
17
17
  export declare function formatAsOf(date: Date): string;
18
+ /**
19
+ * A file-name-safe tag for a time, UTC to the minute (for example `as-of-2026-11-19T08-45Z`), so a
20
+ * file saved from a past view says which time it shows (BOFF-15492).
21
+ */
22
+ export declare function asOfFileStamp(date: Date): string;
18
23
  /**
19
24
  * The value of a `datetime-local` input (local time, minutes) for a time.
20
25
  * An empty string when there is no time, so the input is cleared.
@@ -9,20 +9,23 @@ function i(e) {
9
9
  return e.toISOString().replace(/\.\d{3}Z$/, "Z");
10
10
  }
11
11
  function a(e) {
12
+ return `as-of-${e.toISOString().slice(0, 16).replace(":", "-")}Z`;
13
+ }
14
+ function o(e) {
12
15
  if (!e) return "";
13
16
  let t = (e) => String(e).padStart(2, "0");
14
17
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
15
18
  }
16
- function o(e, t = /* @__PURE__ */ new Date()) {
19
+ function s(e, t = /* @__PURE__ */ new Date()) {
17
20
  let n = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(e);
18
21
  if (!n) return null;
19
22
  let [r, i, a, o, s] = n.slice(1).map(Number), c = new Date(r, i - 1, a, o, s, 0, 0);
20
23
  return c.getFullYear() !== r || c.getMonth() !== i - 1 || c.getDate() !== a || c.getHours() !== o || c.getMinutes() !== s || c.getTime() > t.getTime() ? null : c;
21
24
  }
22
- function s(e, t, n = /* @__PURE__ */ new Date()) {
25
+ function c(e, t, n = /* @__PURE__ */ new Date()) {
23
26
  return !e && r(t, n) !== null;
24
27
  }
25
- function c(e, t) {
28
+ function l(e, t) {
26
29
  return e.workspaceId === t ? {
27
30
  ready: e.ready,
28
31
  enabled: e.enabled
@@ -31,4 +34,4 @@ function c(e, t) {
31
34
  enabled: !1
32
35
  };
33
36
  }
34
- export { t as AS_OF_FEATURE_FLAG, e as AS_OF_PARAM, c as flagStatusForScope, i as formatAsOf, o as fromLocalInputValue, r as parseAsOf, s as shouldWaitForFlag, a as toLocalInputValue };
37
+ export { t as AS_OF_FEATURE_FLAG, e as AS_OF_PARAM, a as asOfFileStamp, l as flagStatusForScope, i as formatAsOf, s as fromLocalInputValue, r as parseAsOf, c as shouldWaitForFlag, o as toLocalInputValue };
@@ -1,7 +1,7 @@
1
1
  export { AsOfBanner } from './AsOfBanner';
2
2
  export { AsOfControl, formatWhen } from './AsOfControl';
3
- export { AsOfProvider, HideWhenAsOf, useAsOf } from './AsOfProvider';
3
+ export { AsOfProvider, HideWhenAsOf, useAsOf, useIsPastView } from './AsOfProvider';
4
4
  export type { AsOfState } from './AsOfProvider';
5
- export { AS_OF_FEATURE_FLAG, AS_OF_PARAM, formatAsOf, fromLocalInputValue, parseAsOf, toLocalInputValue, } from './asOfParam';
5
+ export { AS_OF_FEATURE_FLAG, AS_OF_PARAM, asOfFileStamp, formatAsOf, fromLocalInputValue, parseAsOf, toLocalInputValue, } from './asOfParam';
6
6
  export { asOfUnavailableMessage } from './asOfMessage';
7
7
  export type { AsOfReadInfo } from './asOfMessage';
@@ -1,6 +1,6 @@
1
- import { AS_OF_PARAM as e, formatAsOf as t } from "./asOfParam.js";
2
- import { AsOfBanner as n } from "./AsOfBanner.js";
3
- import { AsOfControl as r, formatWhen as i } from "./AsOfControl.js";
4
- import { AsOfProvider as a, HideWhenAsOf as o, useAsOf as s } from "./AsOfProvider.js";
5
- import { asOfUnavailableMessage as c } from "./asOfMessage.js";
6
- export { e as AS_OF_PARAM, n as AsOfBanner, r as AsOfControl, a as AsOfProvider, o as HideWhenAsOf, c as asOfUnavailableMessage, t as formatAsOf, i as formatWhen, s as useAsOf };
1
+ import { AS_OF_PARAM as e, asOfFileStamp as t, formatAsOf as n } from "./asOfParam.js";
2
+ import { AsOfBanner as r } from "./AsOfBanner.js";
3
+ import { AsOfControl as i, formatWhen as a } from "./AsOfControl.js";
4
+ import { AsOfProvider as o, HideWhenAsOf as s, useAsOf as c, useIsPastView as l } from "./AsOfProvider.js";
5
+ import { asOfUnavailableMessage as u } from "./asOfMessage.js";
6
+ export { e as AS_OF_PARAM, r as AsOfBanner, i as AsOfControl, o as AsOfProvider, s as HideWhenAsOf, t as asOfFileStamp, u as asOfUnavailableMessage, n as formatAsOf, a as formatWhen, c as useAsOf, l as useIsPastView };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Every surface on the dashboard view page that reads or writes LIVE data, and what a past ("as of")
3
+ * view does about it (BOFF-15492).
4
+ *
5
+ * A past view is read-only and must never show live data. This list is the single place that records the
6
+ * decision for each surface. `tests/asOfLiveOnly.test.ts` reads it and fails when
7
+ *
8
+ * - a guard expression below is no longer in the file it protects (someone removed the guard), or
9
+ * - a file starts using a live-touching hook that no entry lists (a new live surface was added without
10
+ * a decision).
11
+ *
12
+ * To add a surface: gate it with `useIsPastView()` (or `HideWhenAsOf`, or an early return in its handler),
13
+ * then add an entry here. Paths are relative to `src/bigconsole`.
14
+ */
15
+ /** What a past view does with the surface. */
16
+ export type PastViewDecision =
17
+ /** The control is not rendered. */
18
+ 'hidden'
19
+ /** The control is rendered but cannot act, or its handler returns early. */
20
+ | 'blocked'
21
+ /** Works from the as-of read, or only reshapes data already loaded; the file or label says so. */
22
+ | 'supports-past-time';
23
+ export interface LiveOnlyGuard {
24
+ /** File the guard lives in. */
25
+ readonly file: string;
26
+ /** Text that must appear in that file. Copy the real expression, so removing it fails the test. */
27
+ readonly includes: string;
28
+ }
29
+ export interface LiveOnlySurface {
30
+ readonly id: string;
31
+ readonly surface: string;
32
+ readonly decision: PastViewDecision;
33
+ readonly why: string;
34
+ readonly guards: readonly LiveOnlyGuard[];
35
+ /**
36
+ * Hooks that read or write live data, with every file allowed to use each. A new file using one of these
37
+ * hooks fails the test until it is added here, which is the prompt to decide what a past view does.
38
+ */
39
+ readonly hooks?: Readonly<Record<string, readonly string[]>>;
40
+ }
41
+ export declare const LIVE_ONLY_SURFACES: readonly LiveOnlySurface[];
42
+ /** Hooks that touch live data, derived from the entries. */
43
+ export declare function liveTouchingHooks(): ReadonlySet<string>;
@@ -12,63 +12,65 @@ import l from "../../hooks/useWidgetCatalog.js";
12
12
  import u from "../../hooks/useDashboardImageExport.js";
13
13
  import "../../context/index.js";
14
14
  import "../common/index.js";
15
- import { useAsOf as ee } from "../../asof/AsOfProvider.js";
16
- import { AsOfBanner as te } from "../../asof/AsOfBanner.js";
17
- import { DashboardGrid as ne } from "./DashboardGrid.js";
15
+ import { asOfFileStamp as ee } from "../../asof/asOfParam.js";
16
+ import { useAsOf as te } from "../../asof/AsOfProvider.js";
17
+ import { formatWhen as ne } from "../../asof/AsOfControl.js";
18
+ import { AsOfBanner as re } from "../../asof/AsOfBanner.js";
19
+ import { DashboardGrid as ie } from "./DashboardGrid.js";
18
20
  import { loadBigConsoleSettings as d } from "../../hooks/useBigConsoleSettings.js";
19
- import { DashboardToolbar as re } from "./DashboardToolbar.js";
21
+ import { DashboardToolbar as ae } from "./DashboardToolbar.js";
20
22
  import "./GlobalFiltersBar/index.js";
21
- import { LiveBoardBanner as ie } from "./LiveBoardBanner.js";
23
+ import { LiveBoardBanner as oe } from "./LiveBoardBanner.js";
22
24
  import "../../asof/index.js";
23
- import { GlobalFiltersBar as ae } from "./GlobalFiltersBar/GlobalFiltersBar.js";
24
- import { TemplateSetupBanner as oe } from "./TemplateSetupBanner.js";
25
+ import { GlobalFiltersBar as se } from "./GlobalFiltersBar/GlobalFiltersBar.js";
26
+ import { TemplateSetupBanner as ce } from "./TemplateSetupBanner.js";
25
27
  import "./PageTabsManager/index.js";
26
28
  import "./ShareDialog/index.js";
27
- import { PageTabsManager as se } from "./PageTabsManager/PageTabsManager.js";
28
- import { WidgetPalette as ce } from "./WidgetPalette.js";
29
- import { ShareDialog as le } from "./ShareDialog/ShareDialog.js";
29
+ import { PageTabsManager as le } from "./PageTabsManager/PageTabsManager.js";
30
+ import { WidgetPalette as ue } from "./WidgetPalette.js";
31
+ import { ShareDialog as de } from "./ShareDialog/ShareDialog.js";
30
32
  import "../builder/index.js";
31
33
  import { getWidgetDefinition as f } from "../widgets/WidgetRegistry.js";
32
34
  import "../../contexts/index.js";
33
- import { WidgetInspector as ue } from "../builder/WidgetInspector.js";
34
- import { calculatePositionFromDrop as de, findNextAvailablePosition as fe, resolveNewWidgetHeight as p } from "../../utils/widgetPositioning.js";
35
- import { memo as m, useCallback as h, useEffect as pe, useMemo as me, useRef as g, useState as _ } from "react";
36
- import { usePermissions as he } from "@burdenoff/fe-libs/shared/providers/shell";
37
- import { Plus as ge } from "lucide-react";
38
- import { Button as v } from "@burdenoff/fe-libs/ui";
39
- import { useI18n as _e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
40
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
35
+ import { WidgetInspector as fe } from "../builder/WidgetInspector.js";
36
+ import { calculatePositionFromDrop as pe, findNextAvailablePosition as me, resolveNewWidgetHeight as p } from "../../utils/widgetPositioning.js";
37
+ import { memo as m, useCallback as h, useEffect as he, useMemo as ge, useRef as _e, useState as g } from "react";
38
+ import { usePermissions as ve } from "@burdenoff/fe-libs/shared/providers/shell";
39
+ import { Plus as ye } from "lucide-react";
40
+ import { Button as _ } from "@burdenoff/fe-libs/ui";
41
+ import { useI18n as be } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
42
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
41
43
  // src/bigconsole/components/dashboard/DashboardCanvas.tsx
42
- var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: ye, isSaving: be = !1, onReview: xe, onExport: Se, onPublishTemplate: Ce, pages: C = [], activePageId: we, onPageChange: Te, onPagesReorder: Ee, onPageAdd: De, onPageRename: Oe, onPageDuplicate: ke, onPageDelete: Ae, showFilters: je = !0, showPageTabs: Me = !0, enableCrossFilter: Ne = !0 }) {
43
- let { t: w } = _e(), T = g(null), E = g(null), [D, Pe] = _(1200), [Fe, O] = _(!1), [k, A] = _(null), [j, M] = _(!1), [Ie, N] = _(null), [P, Le] = _(null), F = t((e) => e.viewMode === "edit"), { asOf: I } = ee(), L = t((e) => e.currentDashboard), R = L?.pages.find((e) => e.id === x)?.gridColumns ?? 12, { updateDashboard: z } = a({ skipFetch: !0 }), { hasPermission: Re } = he(), ze = Re(n.DASHBOARD_UPDATE), Be = P?.id === m ? P.value : L?.id === m ? L.visibility : void 0, Ve = h(async (e) => {
44
+ var b = m(function({ dashboardId: m, pageId: b, title: x, onPaste: xe, onSave: Se, isSaving: Ce = !1, onReview: we, onExport: Te, onPublishTemplate: Ee, pages: S = [], activePageId: De, onPageChange: Oe, onPagesReorder: C, onPageAdd: ke, onPageRename: Ae, onPageDuplicate: je, onPageDelete: Me, showFilters: Ne = !0, showPageTabs: Pe = !0, enableCrossFilter: Fe = !0 }) {
45
+ let { t: w } = be(), T = _e(null), E = _e(null), [D, Ie] = g(1200), [Le, O] = g(!1), [k, A] = g(null), [j, M] = g(!1), [Re, N] = g(null), [P, ze] = g(null), F = t((e) => e.viewMode === "edit"), { asOf: I } = te(), L = t((e) => e.currentDashboard), R = L?.pages.find((e) => e.id === b)?.gridColumns ?? 12, { updateDashboard: z } = a({ skipFetch: !0 }), { hasPermission: Be } = ve(), Ve = Be(n.DASHBOARD_UPDATE), He = P?.id === m ? P.value : L?.id === m ? L.visibility : void 0, Ue = h(async (e) => {
44
46
  let t = await z({
45
47
  id: m,
46
48
  visibility: e
47
49
  });
48
50
  if (!t) throw Error("The dashboard service did not accept the change.");
49
- Le({
51
+ ze({
50
52
  id: m,
51
53
  value: t.visibility ?? e
52
54
  });
53
- }, [m, z]), { workspaceId: B, apiGatewayUrl: He, authToken: Ue } = i(), { installedWidgets: We, loading: Ge } = c({
55
+ }, [m, z]), { workspaceId: B, apiGatewayUrl: We, authToken: Ge } = i(), { installedWidgets: Ke, loading: qe } = c({
54
56
  workspaceId: B,
55
57
  enabled: F
56
- }), { definitions: Ke } = l({
58
+ }), { definitions: Je } = l({
57
59
  workspaceId: B,
58
- apiGatewayUrl: He,
59
- authToken: Ue,
60
+ apiGatewayUrl: We,
61
+ authToken: Ge,
60
62
  enabled: F
61
- }), V = t((e) => e.zoomLevel), H = t((e) => e.sidebarCollapsed), U = t((e) => e.toggleSidebar), W = !H, G = t((e) => e.setGlobalFilterValues), qe = h((e) => {
63
+ }), V = t((e) => e.zoomLevel), H = t((e) => e.sidebarCollapsed), U = t((e) => e.toggleSidebar), W = !H, G = t((e) => e.setGlobalFilterValues), Ye = h((e) => {
62
64
  G(e);
63
- }, [G]), { createWidget: K } = s(x, m, { skipFetch: !0 }), q = e((e) => e.widgets), J = me(() => {
65
+ }, [G]), { createWidget: K } = s(b, m, { skipFetch: !0 }), q = e((e) => e.widgets), J = ge(() => {
64
66
  let e = Array.from(q.values());
65
- return x ? e.filter((e) => e.pageId === x) : e;
66
- }, [q, x]), Je = e((e) => e.selectedWidgetId), Y = e((e) => e.selectWidget), X = e((e) => e.addWidget), Z = e((e) => e.updateWidgetPosition), Ye = e((e) => e.configPanelOpen), Xe = e((e) => e.closeConfigPanel), Q = Ye && !I;
67
- pe(() => {
67
+ return b ? e.filter((e) => e.pageId === b) : e;
68
+ }, [q, b]), Xe = e((e) => e.selectedWidgetId), Y = e((e) => e.selectWidget), X = e((e) => e.addWidget), Z = e((e) => e.updateWidgetPosition), Ze = e((e) => e.configPanelOpen), Qe = e((e) => e.closeConfigPanel), $e = Ze && !I;
69
+ he(() => {
68
70
  let e = T.current;
69
71
  if (!e) return;
70
72
  let t = () => {
71
- Pe(e.offsetWidth);
73
+ Ie(e.offsetWidth);
72
74
  };
73
75
  if (t(), typeof ResizeObserver < "u") {
74
76
  let n = new ResizeObserver(t);
@@ -76,7 +78,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
76
78
  }
77
79
  return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
78
80
  }, []);
79
- let Ze = h((e) => {
81
+ let et = h((e) => {
80
82
  e.forEach((e) => {
81
83
  Z(e.i, {
82
84
  x: e.x,
@@ -85,9 +87,9 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
85
87
  height: e.h
86
88
  });
87
89
  });
88
- }, [Z]), Qe = h((e) => {
90
+ }, [Z]), tt = h((e) => {
89
91
  Y(e);
90
- }, [Y]), $ = h(async (e, t) => {
92
+ }, [Y]), Q = h(async (e, t) => {
91
93
  A(null);
92
94
  let n = t?.definition || (e.type ? f(e.type) : null), r = d(), i = {
93
95
  width: Math.min(n?.defaultSize?.width ?? 4, R),
@@ -95,7 +97,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
95
97
  }, a;
96
98
  if (t?.position) a = t.position;
97
99
  else {
98
- let { x: e, y: t } = fe(J, i, { cols: R });
100
+ let { x: e, y: t } = me(J, i, { cols: R });
99
101
  a = {
100
102
  x: e,
101
103
  y: t,
@@ -104,9 +106,9 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
104
106
  };
105
107
  }
106
108
  let o = e;
107
- if (x) {
109
+ if (b) {
108
110
  let t = await K({
109
- pageId: x,
111
+ pageId: b,
110
112
  dashboardId: m,
111
113
  type: e.type,
112
114
  title: e.title || w("bigconsole.dashboards.canvas.untitledWidget", "Untitled Widget"),
@@ -129,7 +131,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
129
131
  let s = {
130
132
  id: crypto.randomUUID(),
131
133
  dashboardId: m,
132
- pageId: x || "local",
134
+ pageId: b || "local",
133
135
  type: e.type,
134
136
  title: e.title || w("bigconsole.dashboards.canvas.untitledWidget", "Untitled Widget"),
135
137
  description: e.description,
@@ -151,18 +153,18 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
151
153
  X(s), Y(s.id);
152
154
  }, [
153
155
  m,
154
- x,
156
+ b,
155
157
  K,
156
158
  X,
157
159
  Y,
158
160
  J,
159
161
  R,
160
162
  w
161
- ]), $e = h((e) => {
163
+ ]), nt = h((e) => {
162
164
  M(!0), N(e);
163
- }, []), et = h(() => {
165
+ }, []), rt = h(() => {
164
166
  M(!1), N(null);
165
- }, []), tt = h((e) => {
167
+ }, []), it = h((e) => {
166
168
  e.preventDefault(), M(!1), N(null);
167
169
  try {
168
170
  let t = e.dataTransfer.getData("application/json");
@@ -182,13 +184,13 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
182
184
  let s = {
183
185
  width: Math.min(i.defaultSize.width, R),
184
186
  height: p(i, d().defaultWidgetHeight)
185
- }, { x: c, y: l } = de(e.clientX, e.clientY, o, D, s, { cols: R }), u = {
187
+ }, { x: c, y: l } = pe(e.clientX, e.clientY, o, D, s, { cols: R }), u = {
186
188
  x: c,
187
189
  y: l,
188
190
  width: s.width,
189
191
  height: s.height
190
192
  };
191
- $({
193
+ Q({
192
194
  type: r.type,
193
195
  title: r.name || i.name,
194
196
  config: r.defaultConfig || i.defaultConfig
@@ -201,20 +203,20 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
201
203
  }
202
204
  }, [
203
205
  D,
204
- $,
206
+ Q,
205
207
  R
206
- ]), nt = h((e) => {
208
+ ]), at = h((e) => {
207
209
  e.preventDefault(), e.dataTransfer.dropEffect = "copy";
208
- }, []), rt = h((e, t) => {
210
+ }, []), ot = h((e, t) => {
209
211
  let n = t || f(e);
210
- $({
212
+ Q({
211
213
  type: e,
212
214
  title: n.name,
213
215
  config: n.defaultConfig
214
216
  });
215
- }, [$]), it = h(() => {
217
+ }, [Q]), st = h(() => {
216
218
  U();
217
- }, [U]), at = h(() => {
219
+ }, [U]), ct = h(() => {
218
220
  H && U(), window.requestAnimationFrame(() => {
219
221
  let e = w("bigconsole.dashboards.widgetPalette.searchPlaceholder", "Search widgets...");
220
222
  document.querySelector(`input[placeholder="${e}"]`)?.focus();
@@ -223,45 +225,45 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
223
225
  H,
224
226
  U,
225
227
  w
226
- ]), { exportPNG: ot, exportPDF: st, isExporting: ct } = u({
228
+ ]), { exportPNG: lt, exportPDF: $, isExporting: ut } = u({
227
229
  containerRef: E,
228
- name: S || "dashboard"
229
- }), lt = h(() => {
230
- ot();
231
- }, [ot]), ut = h(() => {
232
- st();
233
- }, [st]);
234
- return /* @__PURE__ */ b("div", {
230
+ name: I ? `${x || "dashboard"} ${ee(I)}` : x || "dashboard"
231
+ }), dt = h(() => {
232
+ lt();
233
+ }, [lt]), ft = h(() => {
234
+ $();
235
+ }, [$]);
236
+ return /* @__PURE__ */ y("div", {
235
237
  className: "flex flex-col h-full min-w-0 overflow-hidden",
236
238
  children: [
237
- /* @__PURE__ */ y(re, {
239
+ /* @__PURE__ */ v(ae, {
238
240
  dashboardId: m,
239
- title: S,
240
- onAddWidget: at,
241
- onTogglePalette: it,
241
+ title: x,
242
+ onAddWidget: ct,
243
+ onTogglePalette: st,
242
244
  isPaletteOpen: W,
243
- onPaste: ve,
244
- onSave: ye,
245
- isSaving: be,
246
- onReview: xe,
247
- onExport: Se,
248
- onPublishTemplate: Ce,
249
- onExportImage: lt,
250
- onExportPdf: ut,
251
- isExportingImage: ct,
245
+ onPaste: xe,
246
+ onSave: Se,
247
+ isSaving: Ce,
248
+ onReview: we,
249
+ onExport: Te,
250
+ onPublishTemplate: Ee,
251
+ onExportImage: dt,
252
+ onExportPdf: ft,
253
+ isExportingImage: ut,
252
254
  onShare: () => O(!0)
253
255
  }),
254
- k && /* @__PURE__ */ y("div", {
256
+ k && /* @__PURE__ */ v("div", {
255
257
  role: "alert",
256
258
  className: "mx-card-padding mt-control-gap flex-shrink-0",
257
- children: /* @__PURE__ */ y(o, {
259
+ children: /* @__PURE__ */ v(o, {
258
260
  tone: "danger",
259
261
  padding: "compact",
260
262
  headingLevel: 3,
261
263
  "data-testid": "widget-create-error",
262
264
  title: "Widget not created",
263
265
  description: k,
264
- actions: /* @__PURE__ */ y(v, {
266
+ actions: /* @__PURE__ */ v(_, {
265
267
  variant: "outline",
266
268
  size: "sm",
267
269
  onClick: () => A(null),
@@ -269,54 +271,54 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
269
271
  })
270
272
  })
271
273
  }),
272
- /* @__PURE__ */ y(oe, {
274
+ /* @__PURE__ */ v(ce, {
273
275
  widgets: J,
274
276
  isEditMode: F
275
277
  }),
276
- /* @__PURE__ */ y(te, {}),
277
- !I && /* @__PURE__ */ y(ie, {
278
+ /* @__PURE__ */ v(re, {}),
279
+ !I && /* @__PURE__ */ v(oe, {
278
280
  widgets: J,
279
281
  isEditMode: F
280
282
  }),
281
- je && /* @__PURE__ */ y(ae, {
283
+ Ne && /* @__PURE__ */ v(se, {
282
284
  dashboardId: m,
283
- onFilterChange: qe,
285
+ onFilterChange: Ye,
284
286
  collapsible: !0
285
287
  }),
286
- Me && (F || C.length > 0) && /* @__PURE__ */ y(se, {
287
- pages: C,
288
- activePageId: we || C[0]?.id,
288
+ Pe && (F || S.length > 0) && /* @__PURE__ */ v(le, {
289
+ pages: S,
290
+ activePageId: De || S[0]?.id,
289
291
  editable: F,
290
- onPageSelect: Te || (() => {}),
291
- onPagesReorder: Ee ? (e) => {
292
- Ee(e.map((e) => C.find((t) => t.id === e)).filter(Boolean));
292
+ onPageSelect: Oe || (() => {}),
293
+ onPagesReorder: C ? (e) => {
294
+ C(e.map((e) => S.find((t) => t.id === e)).filter(Boolean));
293
295
  } : void 0,
294
- onPageCreate: De,
295
- onPageRename: Oe,
296
- onPageDuplicate: ke,
297
- onPageDelete: Ae
296
+ onPageCreate: ke,
297
+ onPageRename: Ae,
298
+ onPageDuplicate: je,
299
+ onPageDelete: Me
298
300
  }),
299
- /* @__PURE__ */ b("div", {
301
+ /* @__PURE__ */ y("div", {
300
302
  "data-testid": "dashboard-canvas-panes",
301
- className: `flex flex-1 min-w-0 overflow-hidden ${Q ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
302
- children: [F && /* @__PURE__ */ y(ce, {
303
+ className: `flex flex-1 min-w-0 overflow-hidden ${$e ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
304
+ children: [F && /* @__PURE__ */ v(ue, {
303
305
  isOpen: W,
304
- onClose: it,
305
- onWidgetSelect: rt,
306
- onDragStart: $e,
307
- onDragEnd: et,
308
- installedWidgets: We,
309
- installedWidgetsLoading: Ge,
310
- definitions: Ke
311
- }), /* @__PURE__ */ b("div", {
306
+ onClose: st,
307
+ onWidgetSelect: ot,
308
+ onDragStart: nt,
309
+ onDragEnd: rt,
310
+ installedWidgets: Ke,
311
+ installedWidgetsLoading: qe,
312
+ definitions: Je
313
+ }), /* @__PURE__ */ y("div", {
312
314
  ref: T,
313
315
  role: "region",
314
316
  "aria-label": "Dashboard board",
315
317
  "data-section-emphasis": "primary",
316
318
  "data-testid": "dashboard-board",
317
319
  className: "relative min-w-0 flex-1 overflow-auto border-2 border-transparent bg-bg-sunken motion-safe:transition-[border-color,background-color]",
318
- onDrop: tt,
319
- onDragOver: nt,
320
+ onDrop: it,
321
+ onDragOver: at,
320
322
  onClick: () => {
321
323
  F && Y(null);
322
324
  },
@@ -325,7 +327,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
325
327
  borderColor: "var(--color-action-primary-bg)",
326
328
  backgroundColor: "var(--color-bg-accentSubtle)"
327
329
  } : void 0,
328
- children: [j && /* @__PURE__ */ y("div", {
330
+ children: [j && /* @__PURE__ */ v("div", {
329
331
  style: {
330
332
  position: "absolute",
331
333
  top: "50%",
@@ -339,7 +341,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
339
341
  pointerEvents: "none",
340
342
  zIndex: 100
341
343
  },
342
- children: /* @__PURE__ */ b("p", {
344
+ children: /* @__PURE__ */ y("p", {
343
345
  style: {
344
346
  fontSize: "var(--font-size-body-md)",
345
347
  color: "var(--color-text-primary)",
@@ -348,7 +350,7 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
348
350
  children: [
349
351
  w("bigconsole.dashboards.canvas.dropToAddBefore", "Drop to add"),
350
352
  " ",
351
- /* @__PURE__ */ y("strong", { children: Ie }),
353
+ /* @__PURE__ */ v("strong", { children: Re }),
352
354
  " ",
353
355
  w("bigconsole.dashboards.canvas.dropToAddAfter", "widget")
354
356
  ]
@@ -360,51 +362,55 @@ var x = m(function({ dashboardId: m, pageId: x, title: S, onPaste: ve, onSave: y
360
362
  transform: `scale(${V / 100})`,
361
363
  width: `${100 / (V / 100)}%`
362
364
  },
363
- children: J.length > 0 ? /* @__PURE__ */ y(r, {
364
- enabled: Ne,
365
+ children: [I && /* @__PURE__ */ v("p", {
366
+ className: "px-card-padding py-control-gap text-sm text-text-muted",
367
+ "data-testid": "as-of-board-stamp",
368
+ children: w("bigconsole.asOf.boardStamp", "Data as of {{date}}. Not live data.", { date: ne(I) })
369
+ }), J.length > 0 ? /* @__PURE__ */ v(r, {
370
+ enabled: Fe,
365
371
  onCrossFilter: (e) => {},
366
- children: /* @__PURE__ */ y(ne, {
372
+ children: /* @__PURE__ */ v(ie, {
367
373
  widgets: J,
368
374
  cols: R,
369
375
  isEditMode: F,
370
376
  width: D,
371
- onLayoutChange: Ze,
377
+ onLayoutChange: et,
372
378
  transformScale: V / 100,
373
- onWidgetSelect: Qe,
374
- selectedWidgetId: Je
379
+ onWidgetSelect: tt,
380
+ selectedWidgetId: Xe
375
381
  })
376
- }) : /* @__PURE__ */ y("div", {
382
+ }) : /* @__PURE__ */ v("div", {
377
383
  className: "flex min-h-[min(400px,60vh)] items-center justify-center p-card-padding",
378
- children: /* @__PURE__ */ y(o, {
384
+ children: /* @__PURE__ */ v(o, {
379
385
  headingLevel: 3,
380
386
  className: "w-full max-w-md",
381
387
  "data-testid": "dashboard-empty-board",
382
388
  headerClassName: "mb-form-gap",
383
389
  title: w("bigconsole.dashboards.canvas.noWidgetsTitle", "No widgets yet"),
384
390
  description: w("bigconsole.dashboards.canvas.noWidgetsDescription", "Add widgets to build your dashboard. Click the \"Add Widget\" button to get started."),
385
- children: F && /* @__PURE__ */ b(v, {
386
- onClick: at,
387
- children: [/* @__PURE__ */ y(ge, { className: "size-4" }), w("bigconsole.dashboards.canvas.addWidget", "Add Widget")]
391
+ children: F && /* @__PURE__ */ y(_, {
392
+ onClick: ct,
393
+ children: [/* @__PURE__ */ v(ye, { className: "size-4" }), w("bigconsole.dashboards.canvas.addWidget", "Add Widget")]
388
394
  })
389
395
  })
390
- })
396
+ })]
391
397
  })]
392
398
  })]
393
399
  }),
394
- /* @__PURE__ */ y(ue, {
395
- isOpen: Q,
396
- onClose: Xe
400
+ /* @__PURE__ */ v(fe, {
401
+ isOpen: $e,
402
+ onClose: Qe
397
403
  }),
398
- /* @__PURE__ */ y(le, {
404
+ /* @__PURE__ */ v(de, {
399
405
  dashboardId: m,
400
- dashboardName: S || w("bigconsole.dashboards.canvas.dashboardFallbackName", "Dashboard"),
401
- isOpen: Fe,
406
+ dashboardName: x || w("bigconsole.dashboards.canvas.dashboardFallbackName", "Dashboard"),
407
+ isOpen: Le,
402
408
  onClose: () => O(!1),
403
- visibility: Be,
404
- onVisibilityChange: Ve,
405
- canChangeVisibility: ze
409
+ visibility: He,
410
+ onVisibilityChange: Ue,
411
+ canChangeVisibility: Ve
406
412
  })
407
413
  ]
408
414
  });
409
415
  });
410
- export { x as DashboardCanvas, x as default };
416
+ export { b as DashboardCanvas, b as default };
@@ -0,0 +1,16 @@
1
+ import { FC } from 'react';
2
+ export interface DashboardAnchorWidgetOption {
3
+ id: string;
4
+ title: string;
5
+ }
6
+ export interface DashboardCommentsDrawerProps {
7
+ dashboardId: string;
8
+ isOpen: boolean;
9
+ onClose: () => void;
10
+ /** Widgets available on the dashboard so comments can anchor to them. */
11
+ widgets: readonly DashboardAnchorWidgetOption[];
12
+ /** Optional callback to select/focus a widget when its anchor chip is clicked. */
13
+ onSelectWidget?: (widgetId: string) => void;
14
+ }
15
+ export declare const DashboardCommentsDrawer: FC<DashboardCommentsDrawerProps>;
16
+ export default DashboardCommentsDrawer;