@burdenoff/microfe-bigconsole 2026.825.1 → 2026.827.1

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 (34) hide show
  1. package/dist/bigconsole/components/builder/inspector/LayoutSection.js +71 -0
  2. package/dist/bigconsole/components/builder/inspector/LayoutSection.js.map +1 -0
  3. package/dist/bigconsole/components/builder/inspector/index.js +1 -0
  4. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +137 -121
  5. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  6. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +204 -93
  7. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js.map +1 -1
  8. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +259 -133
  9. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
  10. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js +87 -39
  11. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js.map +1 -1
  12. package/dist/bigconsole/components/datasink/DataSinkCard.js +88 -68
  13. package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
  14. package/dist/bigconsole/components/widgets/PropertiesPanel.js +213 -199
  15. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  16. package/dist/bigconsole/components/workflow/WorkflowCard.js +46 -27
  17. package/dist/bigconsole/components/workflow/WorkflowCard.js.map +1 -1
  18. package/dist/bigconsole/hooks/useDashboardOperations.js +74 -64
  19. package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
  20. package/dist/bigconsole/pages/DashboardBuilderPage.js +1 -1
  21. package/dist/bigconsole/pages/DashboardsPage.js +386 -316
  22. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  23. package/dist/bigconsole/pages/DataSinksPage.js +251 -206
  24. package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
  25. package/dist/bigconsole/pages/InsightsPage.js +646 -378
  26. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  27. package/dist/bigconsole/pages/WorkflowsPage.js +153 -108
  28. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  29. package/dist/bigconsole/utils/format.js +18 -0
  30. package/dist/bigconsole/utils/format.js.map +1 -0
  31. package/dist/bigconsole/utils/widgetPositioning.js +1 -1
  32. package/dist/generated/wspace-operations.js +1 -0
  33. package/dist/generated/wspace-operations.js.map +1 -1
  34. package/package.json +1 -1
@@ -0,0 +1,71 @@
1
+ import { Section as e } from "../../common/Section.js";
2
+ import "../../common/index.js";
3
+ import { memo as t, useCallback as n } from "react";
4
+ import { Input as r } from "@burdenoff/fe-libs/ui";
5
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
+ //#region src/bigconsole/components/builder/inspector/LayoutSection.tsx
7
+ var o = {
8
+ x: "Column (X)",
9
+ y: "Row (Y)",
10
+ width: "Width",
11
+ height: "Height"
12
+ }, s = t(function({ position: t, columns: s, onChange: c }) {
13
+ let l = n((e, n) => {
14
+ let r = Number.parseInt(n, 10);
15
+ if (Number.isNaN(r)) return;
16
+ let i = {
17
+ ...t,
18
+ [e]: r
19
+ };
20
+ i.width = Math.min(Math.max(i.width, 1), s), i.x = Math.min(Math.max(i.x, 0), Math.max(s - i.width, 0)), i.height = Math.max(i.height, 1), i.y = Math.max(i.y, 0), !(i.x === t.x && i.y === t.y && i.width === t.width && i.height === t.height) && c(i);
21
+ }, [
22
+ s,
23
+ c,
24
+ t
25
+ ]), u = [
26
+ {
27
+ field: "x",
28
+ min: 0,
29
+ max: Math.max(s - t.width, 0)
30
+ },
31
+ {
32
+ field: "y",
33
+ min: 0
34
+ },
35
+ {
36
+ field: "width",
37
+ min: 1,
38
+ max: s
39
+ },
40
+ {
41
+ field: "height",
42
+ min: 1
43
+ }
44
+ ];
45
+ return /* @__PURE__ */ i(e, {
46
+ title: "Position & size",
47
+ description: `Grid placement on the ${s}-column board. Saved with the dashboard.`,
48
+ "data-testid": "widget-inspector-layout",
49
+ children: /* @__PURE__ */ i("div", {
50
+ className: "grid grid-cols-2 gap-form-gap",
51
+ children: u.map(({ field: e, min: n, max: s }) => /* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("label", {
52
+ htmlFor: `widget-inspector-position-${e}`,
53
+ className: "mb-1 block text-sm font-medium text-text-primary",
54
+ children: o[e]
55
+ }), /* @__PURE__ */ i(r, {
56
+ id: `widget-inspector-position-${e}`,
57
+ type: "number",
58
+ inputMode: "numeric",
59
+ value: t[e],
60
+ min: n,
61
+ max: s,
62
+ onChange: (t) => l(e, t.target.value),
63
+ className: "h-control-md text-sm"
64
+ })] }, e))
65
+ })
66
+ });
67
+ });
68
+ //#endregion
69
+ export { s as default };
70
+
71
+ //# sourceMappingURL=LayoutSection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutSection.js","names":[],"sources":["../../../../../src/bigconsole/components/builder/inspector/LayoutSection.tsx"],"sourcesContent":["import { type FC, memo, useCallback } from 'react';\nimport { Input } from '@burdenoff/fe-libs/ui';\nimport { Section } from '../../common';\nimport type { WidgetPosition } from '../../../utils/widgetPositioning';\n\nexport interface LayoutSectionProps {\n /** Current grid placement of the selected widget. */\n position: WidgetPosition;\n /** Columns in the board's grid — the ceiling for `x + width`. */\n columns: number;\n /** Commit a new placement. The caller persists it with the dashboard. */\n onChange: (position: WidgetPosition) => void;\n}\n\n/** Which of the four numbers an input edits. */\ntype PositionField = keyof WidgetPosition;\n\nconst FIELD_LABELS: Record<PositionField, string> = {\n x: 'Column (X)',\n y: 'Row (Y)',\n width: 'Width',\n height: 'Height',\n};\n\n/**\n * Numeric grid placement for the selected widget.\n *\n * Drag-and-resize on the canvas is the only way a widget could be placed until\n * now, which makes precise alignment guesswork and leaves keyboard-only users\n * with no way to move a widget at all. The four numbers here are the SAME ones\n * the canvas writes (`Widget.position` / `positionX|Y|Width|Height`), committed\n * through the same store action, so the board and this panel can never disagree\n * and the dashboard's Save persists them exactly as a drag would.\n *\n * The mockup also shows Min W / Min H fields. Those are deliberately absent:\n * `WidgetPosition` on the service carries only x/y/width/height, so a minimum\n * would have nowhere to be stored and would silently reset on reload.\n */\nexport const LayoutSection: FC<LayoutSectionProps> = memo(function LayoutSection({ position, columns, onChange }) {\n const labelClassName = 'mb-1 block text-sm font-medium text-text-primary';\n\n const commit = useCallback(\n (field: PositionField, raw: string) => {\n const parsed = Number.parseInt(raw, 10);\n if (Number.isNaN(parsed)) return;\n\n const next: WidgetPosition = { ...position, [field]: parsed };\n\n // Clamp to a placement the grid can actually hold. Letting a widget be\n // 0 columns wide, or start past the last column, produces a widget that\n // renders nowhere — an input that appears to work and then loses content.\n next.width = Math.min(Math.max(next.width, 1), columns);\n next.x = Math.min(Math.max(next.x, 0), Math.max(columns - next.width, 0));\n next.height = Math.max(next.height, 1);\n next.y = Math.max(next.y, 0);\n\n if (\n next.x === position.x &&\n next.y === position.y &&\n next.width === position.width &&\n next.height === position.height\n ) {\n return;\n }\n\n onChange(next);\n },\n [columns, onChange, position]\n );\n\n const fields: Array<{ field: PositionField; min: number; max?: number }> = [\n { field: 'x', min: 0, max: Math.max(columns - position.width, 0) },\n { field: 'y', min: 0 },\n { field: 'width', min: 1, max: columns },\n { field: 'height', min: 1 },\n ];\n\n return (\n <Section\n title=\"Position & size\"\n description={`Grid placement on the ${columns}-column board. Saved with the dashboard.`}\n data-testid=\"widget-inspector-layout\"\n >\n <div className=\"grid grid-cols-2 gap-form-gap\">\n {fields.map(({ field, min, max }) => (\n <div key={field}>\n <label htmlFor={`widget-inspector-position-${field}`} className={labelClassName}>\n {FIELD_LABELS[field]}\n </label>\n <Input\n id={`widget-inspector-position-${field}`}\n type=\"number\"\n inputMode=\"numeric\"\n value={position[field]}\n min={min}\n max={max}\n onChange={(event) => commit(field, event.target.value)}\n className=\"h-control-md text-sm\"\n />\n </div>\n ))}\n </div>\n </Section>\n );\n});\n\nexport default LayoutSection;\n"],"mappings":";;;;;;AAiBA,IAAM,IAA8C;CAClD,GAAG;CACH,GAAG;CACH,OAAO;CACP,QAAQ;CACT,EAgBY,IAAwC,EAAK,SAAuB,EAAE,aAAU,YAAS,eAAY;CAChH,IAEM,IAAS,GACZ,GAAsB,MAAgB;EACrC,IAAM,IAAS,OAAO,SAAS,GAAK,GAAG;AACvC,MAAI,OAAO,MAAM,EAAO,CAAE;EAE1B,IAAM,IAAuB;GAAE,GAAG;IAAW,IAAQ;GAAQ;AAK7D,IAAK,QAAQ,KAAK,IAAI,KAAK,IAAI,EAAK,OAAO,EAAE,EAAE,EAAQ,EACvD,EAAK,IAAI,KAAK,IAAI,KAAK,IAAI,EAAK,GAAG,EAAE,EAAE,KAAK,IAAI,IAAU,EAAK,OAAO,EAAE,CAAC,EACzE,EAAK,SAAS,KAAK,IAAI,EAAK,QAAQ,EAAE,EACtC,EAAK,IAAI,KAAK,IAAI,EAAK,GAAG,EAAE,EAG1B,IAAK,MAAM,EAAS,KACpB,EAAK,MAAM,EAAS,KACpB,EAAK,UAAU,EAAS,SACxB,EAAK,WAAW,EAAS,WAK3B,EAAS,EAAK;IAEhB;EAAC;EAAS;EAAU;EAAS,CAC9B,EAEK,IAAqE;EACzE;GAAE,OAAO;GAAK,KAAK;GAAG,KAAK,KAAK,IAAI,IAAU,EAAS,OAAO,EAAE;GAAE;EAClE;GAAE,OAAO;GAAK,KAAK;GAAG;EACtB;GAAE,OAAO;GAAS,KAAK;GAAG,KAAK;GAAS;EACxC;GAAE,OAAO;GAAU,KAAK;GAAG;EAC5B;AAED,QACE,kBAAC,GAAD;EACE,OAAM;EACN,aAAa,yBAAyB,EAAQ;EAC9C,eAAY;YAEZ,kBAAC,OAAD;GAAK,WAAU;aACZ,EAAO,KAAK,EAAE,UAAO,QAAK,aACzB,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,SAAD;IAAO,SAAS,6BAA6B;IAAS,WAAW;cAC9D,EAAa;IACR,CAAA,EACR,kBAAC,GAAD;IACE,IAAI,6BAA6B;IACjC,MAAK;IACL,WAAU;IACV,OAAO,EAAS;IACX;IACA;IACL,WAAW,MAAU,EAAO,GAAO,EAAM,OAAO,MAAM;IACtD,WAAU;IACV,CAAA,CACE,EAAA,EAdI,EAcJ,CACN;GACE,CAAA;EACE,CAAA;EAEZ"}
@@ -2,3 +2,4 @@ import "./AdvancedSection.js";
2
2
  import "./AppearanceSection.js";
3
3
  import "./GeneralSection.js";
4
4
  import "./DataBindingSection.js";
5
+ import "./LayoutSection.js";
@@ -10,50 +10,63 @@ import "../../context/index.js";
10
10
  import { getWidgetDefinition as a } from "../widgets/WidgetRegistry.js";
11
11
  import o from "../../hooks/useWidgetCatalog.js";
12
12
  import s from "../../hooks/useWidgetOperations.js";
13
- import c from "../../hooks/useDashboardImageExport.js";
14
- import { useInstalledWidgets as l } from "../../hooks/useInstalledWidgets.js";
15
- import u from "./DashboardGrid.js";
16
- import d from "./DashboardToolbar.js";
17
- import ee from "./GlobalFiltersBar/GlobalFiltersBar.js";
13
+ import c from "../../hooks/useDashboardOperations.js";
14
+ import l from "../../hooks/useDashboardImageExport.js";
15
+ import { BIGCONSOLE_PERMISSIONS as u } from "../../../constants/permissions.js";
16
+ import { useInstalledWidgets as d } from "../../hooks/useInstalledWidgets.js";
17
+ import ee from "./DashboardGrid.js";
18
+ import te from "./DashboardToolbar.js";
19
+ import ne from "./GlobalFiltersBar/GlobalFiltersBar.js";
18
20
  import "./GlobalFiltersBar/index.js";
19
- import te from "./LiveBoardBanner.js";
20
- import ne from "./TemplateSetupBanner.js";
21
- import re from "./PageTabsManager/PageTabsManager.js";
21
+ import re from "./LiveBoardBanner.js";
22
+ import ie from "./TemplateSetupBanner.js";
23
+ import ae from "./PageTabsManager/PageTabsManager.js";
22
24
  import "./PageTabsManager/index.js";
23
- import ie from "./ShareDialog/ShareDialog.js";
25
+ import oe from "./ShareDialog/ShareDialog.js";
24
26
  import "./ShareDialog/index.js";
25
- import ae from "./WidgetPalette.js";
26
- import { WidgetInspector as oe } from "../builder/WidgetInspector.js";
27
+ import se from "./WidgetPalette.js";
28
+ import { calculatePositionFromDrop as ce, findNextAvailablePosition as le } from "../../utils/widgetPositioning.js";
29
+ import { WidgetInspector as ue } from "../builder/WidgetInspector.js";
27
30
  import "../builder/index.js";
28
- import { calculatePositionFromDrop as se, findNextAvailablePosition as ce } from "../../utils/widgetPositioning.js";
29
- import { memo as f, useCallback as p, useEffect as le, useMemo as ue, useRef as m, useState as h } from "react";
30
- import { Plus as de } from "lucide-react";
31
- import { useI18n as fe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
31
+ import { memo as f, useCallback as p, useEffect as de, useMemo as fe, useRef as m, useState as h } from "react";
32
+ import { usePermissions as pe } from "@burdenoff/fe-libs/shared/providers/shell";
33
+ import { Plus as me } from "lucide-react";
34
+ import { useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
32
35
  import { Button as g } from "@burdenoff/fe-libs/ui";
33
36
  import { jsx as _, jsxs as v } from "react/jsx-runtime";
34
37
  //#region src/bigconsole/components/dashboard/DashboardCanvas.tsx
35
- var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: me, isSaving: he = !1, onExport: ge, onPublishTemplate: _e, pages: x = [], activePageId: ve, onPageChange: ye, onPagesReorder: S, onPageAdd: be, onPageRename: xe, onPageDuplicate: Se, onPageDelete: Ce, showFilters: we = !0, showPageTabs: Te = !0, enableCrossFilter: Ee = !0 }) {
36
- let { t: C } = fe(), w = m(null), T = m(null), [E, De] = h(1200), [Oe, D] = h(!1), [O, k] = h(null), [A, j] = h(!1), [ke, M] = h(null), N = t((e) => e.viewMode === "edit"), { workspaceId: P, apiGatewayUrl: F, authToken: I } = i(), { installedWidgets: Ae, loading: je } = l({
37
- workspaceId: P,
38
- apiGatewayUrl: F,
39
- authToken: I,
40
- enabled: N
41
- }), { definitions: Me } = o({
42
- workspaceId: P,
43
- apiGatewayUrl: F,
44
- authToken: I,
45
- enabled: N
46
- }), L = t((e) => e.zoomLevel), R = t((e) => e.sidebarCollapsed), z = t((e) => e.toggleSidebar), B = !R, V = t((e) => e.setGlobalFilterValues), Ne = p((e) => {
47
- V(e);
48
- }, [V]), { createWidget: H } = s(y, f, { skipFetch: !0 }), U = e((e) => e.widgets), W = ue(() => {
49
- let e = Array.from(U.values());
38
+ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: ge, onSave: _e, isSaving: ve = !1, onExport: ye, onPublishTemplate: be, pages: x = [], activePageId: xe, onPageChange: Se, onPagesReorder: S, onPageAdd: Ce, onPageRename: we, onPageDuplicate: Te, onPageDelete: Ee, showFilters: De = !0, showPageTabs: Oe = !0, enableCrossFilter: ke = !0 }) {
39
+ let { t: C } = he(), w = m(null), T = m(null), [E, Ae] = h(1200), [je, D] = h(!1), [O, k] = h(null), [A, j] = h(!1), [Me, M] = h(null), [N, Ne] = h(null), P = t((e) => e.viewMode === "edit"), F = t((e) => e.currentDashboard), { updateDashboard: I } = c({ skipFetch: !0 }), { hasPermission: Pe } = pe(), Fe = Pe(u.DASHBOARD_UPDATE), Ie = N?.id === f ? N.value : F?.id === f ? F.visibility : void 0, Le = p(async (e) => {
40
+ let t = await I({
41
+ id: f,
42
+ visibility: e
43
+ });
44
+ if (!t) throw Error("The dashboard service did not accept the change.");
45
+ Ne({
46
+ id: f,
47
+ value: t.visibility ?? e
48
+ });
49
+ }, [f, I]), { workspaceId: L, apiGatewayUrl: R, authToken: z } = i(), { installedWidgets: Re, loading: ze } = d({
50
+ workspaceId: L,
51
+ apiGatewayUrl: R,
52
+ authToken: z,
53
+ enabled: P
54
+ }), { definitions: Be } = o({
55
+ workspaceId: L,
56
+ apiGatewayUrl: R,
57
+ authToken: z,
58
+ enabled: P
59
+ }), B = t((e) => e.zoomLevel), V = t((e) => e.sidebarCollapsed), H = t((e) => e.toggleSidebar), U = !V, W = t((e) => e.setGlobalFilterValues), Ve = p((e) => {
60
+ W(e);
61
+ }, [W]), { createWidget: G } = s(y, f, { skipFetch: !0 }), K = e((e) => e.widgets), q = fe(() => {
62
+ let e = Array.from(K.values());
50
63
  return y ? e.filter((e) => e.pageId === y) : e;
51
- }, [U, y]), Pe = e((e) => e.selectedWidgetId), G = e((e) => e.selectWidget), K = e((e) => e.addWidget), q = e((e) => e.updateWidgetPosition), J = e((e) => e.configPanelOpen), Fe = e((e) => e.closeConfigPanel);
52
- le(() => {
64
+ }, [K, y]), He = e((e) => e.selectedWidgetId), J = e((e) => e.selectWidget), Y = e((e) => e.addWidget), X = e((e) => e.updateWidgetPosition), Z = e((e) => e.configPanelOpen), Ue = e((e) => e.closeConfigPanel);
65
+ de(() => {
53
66
  let e = w.current;
54
67
  if (!e) return;
55
68
  let t = () => {
56
- De(e.offsetWidth);
69
+ Ae(e.offsetWidth);
57
70
  };
58
71
  if (t(), typeof ResizeObserver < "u") {
59
72
  let n = new ResizeObserver(t);
@@ -61,18 +74,18 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
61
74
  }
62
75
  return window.addEventListener("resize", t), () => window.removeEventListener("resize", t);
63
76
  }, []);
64
- let Ie = p((e) => {
77
+ let We = p((e) => {
65
78
  e.forEach((e) => {
66
- q(e.i, {
79
+ X(e.i, {
67
80
  x: e.x,
68
81
  y: e.y,
69
82
  width: e.w,
70
83
  height: e.h
71
84
  });
72
85
  });
73
- }, [q]), Le = p((e) => {
74
- G(e);
75
- }, [G]), Y = p(async (e, t) => {
86
+ }, [X]), Ge = p((e) => {
87
+ J(e);
88
+ }, [J]), Q = p(async (e, t) => {
76
89
  k(null);
77
90
  let n = t?.definition || (e.type ? a(e.type) : null), r = {
78
91
  width: n?.defaultSize?.width ?? 4,
@@ -80,7 +93,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
80
93
  }, i;
81
94
  if (t?.position) i = t.position;
82
95
  else {
83
- let { x: e, y: t } = ce(W, r, { cols: 12 });
96
+ let { x: e, y: t } = le(q, r, { cols: 12 });
84
97
  i = {
85
98
  x: e,
86
99
  y: t,
@@ -90,7 +103,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
90
103
  }
91
104
  let o = e;
92
105
  if (y) {
93
- let t = await H({
106
+ let t = await G({
94
107
  pageId: y,
95
108
  dashboardId: f,
96
109
  type: e.type,
@@ -105,7 +118,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
105
118
  parserId: o.parserId
106
119
  });
107
120
  if (t) {
108
- G(t.id);
121
+ J(t.id);
109
122
  return;
110
123
  }
111
124
  k(C("bigconsole.dashboards.canvas.widgetCreateError", "Could not create the widget. Check the connection and try again."));
@@ -133,20 +146,20 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
133
146
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
134
147
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
135
148
  };
136
- K(s), G(s.id);
149
+ Y(s), J(s.id);
137
150
  }, [
138
151
  f,
139
152
  y,
140
- H,
141
- K,
142
153
  G,
143
- W,
154
+ Y,
155
+ J,
156
+ q,
144
157
  C
145
- ]), Re = p((e) => {
158
+ ]), Ke = p((e) => {
146
159
  j(!0), M(e);
147
- }, []), ze = p(() => {
160
+ }, []), qe = p(() => {
148
161
  j(!1), M(null);
149
- }, []), Be = p((e) => {
162
+ }, []), Je = p((e) => {
150
163
  e.preventDefault(), j(!1), M(null);
151
164
  try {
152
165
  let t = e.dataTransfer.getData("application/json");
@@ -166,13 +179,13 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
166
179
  let c = {
167
180
  width: i.defaultSize.width,
168
181
  height: i.defaultSize.height
169
- }, { x: l, y: u } = se(e.clientX, e.clientY, s, E, c, { cols: 12 }), d = {
182
+ }, { x: l, y: u } = ce(e.clientX, e.clientY, s, E, c, { cols: 12 }), d = {
170
183
  x: l,
171
184
  y: u,
172
185
  width: c.width,
173
186
  height: c.height
174
187
  };
175
- Y({
188
+ Q({
176
189
  type: r.type,
177
190
  title: r.name || i.name,
178
191
  config: r.defaultConfig || i.defaultConfig
@@ -183,51 +196,51 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
183
196
  } catch (e) {
184
197
  console.error("Failed to handle widget drop:", e);
185
198
  }
186
- }, [E, Y]), Ve = p((e) => {
199
+ }, [E, Q]), Ye = p((e) => {
187
200
  e.preventDefault(), e.dataTransfer.dropEffect = "copy";
188
- }, []), He = p((e, t) => {
201
+ }, []), Xe = p((e, t) => {
189
202
  let n = t || a(e);
190
- Y({
203
+ Q({
191
204
  type: e,
192
205
  title: n.name,
193
206
  config: n.defaultConfig
194
207
  });
195
- }, [Y]), X = p(() => {
196
- z();
197
- }, [z]), Z = p(() => {
198
- R && z(), window.requestAnimationFrame(() => {
208
+ }, [Q]), Ze = p(() => {
209
+ H();
210
+ }, [H]), Qe = p(() => {
211
+ V && H(), window.requestAnimationFrame(() => {
199
212
  let e = C("bigconsole.dashboards.widgetPalette.searchPlaceholder", "Search widgets...");
200
213
  document.querySelector(`input[placeholder="${e}"]`)?.focus();
201
214
  });
202
215
  }, [
203
- R,
204
- z,
216
+ V,
217
+ H,
205
218
  C
206
- ]), { exportPNG: Q, exportPDF: $, isExporting: Ue } = c({
219
+ ]), { exportPNG: $e, exportPDF: $, isExporting: et } = l({
207
220
  containerRef: T,
208
221
  name: b || "dashboard"
209
222
  });
210
223
  return /* @__PURE__ */ v("div", {
211
224
  className: "flex flex-col h-full min-w-0 overflow-hidden",
212
225
  children: [
213
- /* @__PURE__ */ _(d, {
226
+ /* @__PURE__ */ _(te, {
214
227
  dashboardId: f,
215
228
  title: b,
216
- onAddWidget: Z,
217
- onTogglePalette: X,
218
- isPaletteOpen: B,
219
- onPaste: pe,
220
- onSave: me,
221
- isSaving: he,
222
- onExport: ge,
223
- onPublishTemplate: _e,
229
+ onAddWidget: Qe,
230
+ onTogglePalette: Ze,
231
+ isPaletteOpen: U,
232
+ onPaste: ge,
233
+ onSave: _e,
234
+ isSaving: ve,
235
+ onExport: ye,
236
+ onPublishTemplate: be,
224
237
  onExportImage: p(() => {
225
- Q();
226
- }, [Q]),
238
+ $e();
239
+ }, [$e]),
227
240
  onExportPdf: p(() => {
228
241
  $();
229
242
  }, [$]),
230
- isExportingImage: Ue,
243
+ isExportingImage: et,
231
244
  onShare: () => D(!0)
232
245
  }),
233
246
  O && /* @__PURE__ */ _("div", {
@@ -248,44 +261,44 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
248
261
  })
249
262
  })
250
263
  }),
251
- /* @__PURE__ */ _(ne, {
252
- widgets: W,
253
- isEditMode: N
264
+ /* @__PURE__ */ _(ie, {
265
+ widgets: q,
266
+ isEditMode: P
254
267
  }),
255
- /* @__PURE__ */ _(te, {
256
- widgets: W,
257
- isEditMode: N
268
+ /* @__PURE__ */ _(re, {
269
+ widgets: q,
270
+ isEditMode: P
258
271
  }),
259
- we && /* @__PURE__ */ _(ee, {
272
+ De && /* @__PURE__ */ _(ne, {
260
273
  dashboardId: f,
261
- onFilterChange: Ne,
274
+ onFilterChange: Ve,
262
275
  collapsible: !0
263
276
  }),
264
- Te && (N || x.length > 0) && /* @__PURE__ */ _(re, {
277
+ Oe && (P || x.length > 0) && /* @__PURE__ */ _(ae, {
265
278
  pages: x,
266
- activePageId: ve || x[0]?.id,
267
- editable: N,
268
- onPageSelect: ye || (() => {}),
279
+ activePageId: xe || x[0]?.id,
280
+ editable: P,
281
+ onPageSelect: Se || (() => {}),
269
282
  onPagesReorder: S ? (e) => {
270
283
  S(e.map((e) => x.find((t) => t.id === e)).filter(Boolean));
271
284
  } : void 0,
272
- onPageCreate: be,
273
- onPageRename: xe,
274
- onPageDuplicate: Se,
275
- onPageDelete: Ce
285
+ onPageCreate: Ce,
286
+ onPageRename: we,
287
+ onPageDuplicate: Te,
288
+ onPageDelete: Ee
276
289
  }),
277
290
  /* @__PURE__ */ v("div", {
278
291
  "data-testid": "dashboard-canvas-panes",
279
- className: `flex flex-1 min-w-0 overflow-hidden ${J ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
280
- children: [N && /* @__PURE__ */ _(ae, {
281
- isOpen: B,
282
- onClose: X,
283
- onWidgetSelect: He,
284
- onDragStart: Re,
285
- onDragEnd: ze,
286
- installedWidgets: Ae,
287
- installedWidgetsLoading: je,
288
- definitions: Me
292
+ className: `flex flex-1 min-w-0 overflow-hidden ${Z ? "lg:mr-[var(--bc-inspector-width,420px)]" : ""}`,
293
+ children: [P && /* @__PURE__ */ _(se, {
294
+ isOpen: U,
295
+ onClose: Ze,
296
+ onWidgetSelect: Xe,
297
+ onDragStart: Ke,
298
+ onDragEnd: qe,
299
+ installedWidgets: Re,
300
+ installedWidgetsLoading: ze,
301
+ definitions: Be
289
302
  }), /* @__PURE__ */ v("div", {
290
303
  ref: w,
291
304
  role: "region",
@@ -293,10 +306,10 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
293
306
  "data-section-emphasis": "primary",
294
307
  "data-testid": "dashboard-board",
295
308
  className: "relative min-w-0 flex-1 overflow-auto border-2 border-transparent bg-bg-sunken motion-safe:transition-[border-color,background-color]",
296
- onDrop: Be,
297
- onDragOver: Ve,
309
+ onDrop: Je,
310
+ onDragOver: Ye,
298
311
  onClick: () => {
299
- N && G(null);
312
+ P && J(null);
300
313
  },
301
314
  style: A ? {
302
315
  borderStyle: "dashed",
@@ -326,7 +339,7 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
326
339
  children: [
327
340
  C("bigconsole.dashboards.canvas.dropToAddBefore", "Drop to add"),
328
341
  " ",
329
- /* @__PURE__ */ _("strong", { children: ke }),
342
+ /* @__PURE__ */ _("strong", { children: Me }),
330
343
  " ",
331
344
  C("bigconsole.dashboards.canvas.dropToAddAfter", "widget")
332
345
  ]
@@ -335,19 +348,19 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
335
348
  ref: T,
336
349
  className: "min-h-full origin-top-left transition-transform",
337
350
  style: {
338
- transform: `scale(${L / 100})`,
339
- width: `${100 / (L / 100)}%`
351
+ transform: `scale(${B / 100})`,
352
+ width: `${100 / (B / 100)}%`
340
353
  },
341
- children: W.length > 0 ? /* @__PURE__ */ _(n, {
342
- enabled: Ee,
354
+ children: q.length > 0 ? /* @__PURE__ */ _(n, {
355
+ enabled: ke,
343
356
  onCrossFilter: (e) => {},
344
- children: /* @__PURE__ */ _(u, {
345
- widgets: W,
346
- isEditMode: N,
357
+ children: /* @__PURE__ */ _(ee, {
358
+ widgets: q,
359
+ isEditMode: P,
347
360
  width: E,
348
- onLayoutChange: Ie,
349
- onWidgetSelect: Le,
350
- selectedWidgetId: Pe
361
+ onLayoutChange: We,
362
+ onWidgetSelect: Ge,
363
+ selectedWidgetId: He
351
364
  })
352
365
  }) : /* @__PURE__ */ _("div", {
353
366
  className: "flex min-h-[min(400px,60vh)] items-center justify-center p-card-padding",
@@ -358,24 +371,27 @@ var y = f(function({ dashboardId: f, pageId: y, title: b, onPaste: pe, onSave: m
358
371
  headerClassName: "mb-form-gap",
359
372
  title: C("bigconsole.dashboards.canvas.noWidgetsTitle", "No widgets yet"),
360
373
  description: C("bigconsole.dashboards.canvas.noWidgetsDescription", "Add widgets to build your dashboard. Click the \"Add Widget\" button to get started."),
361
- children: N && /* @__PURE__ */ v(g, {
362
- onClick: Z,
363
- children: [/* @__PURE__ */ _(de, { className: "size-4" }), C("bigconsole.dashboards.canvas.addWidget", "Add Widget")]
374
+ children: P && /* @__PURE__ */ v(g, {
375
+ onClick: Qe,
376
+ children: [/* @__PURE__ */ _(me, { className: "size-4" }), C("bigconsole.dashboards.canvas.addWidget", "Add Widget")]
364
377
  })
365
378
  })
366
379
  })
367
380
  })]
368
381
  })]
369
382
  }),
370
- /* @__PURE__ */ _(oe, {
371
- isOpen: J,
372
- onClose: Fe
383
+ /* @__PURE__ */ _(ue, {
384
+ isOpen: Z,
385
+ onClose: Ue
373
386
  }),
374
- /* @__PURE__ */ _(ie, {
387
+ /* @__PURE__ */ _(oe, {
375
388
  dashboardId: f,
376
389
  dashboardName: b || C("bigconsole.dashboards.canvas.dashboardFallbackName", "Dashboard"),
377
- isOpen: Oe,
378
- onClose: () => D(!1)
390
+ isOpen: je,
391
+ onClose: () => D(!1),
392
+ visibility: Ie,
393
+ onVisibilityChange: Le,
394
+ canChangeVisibility: Fe
379
395
  })
380
396
  ]
381
397
  });