@burdenoff/microfe-bigconsole 2026.712.1 → 2026.713.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 (38) hide show
  1. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +144 -69
  2. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -1
  3. package/dist/bigconsole/components/builder/BuilderCanvas.js +21 -0
  4. package/dist/bigconsole/components/builder/BuilderCanvas.js.map +1 -0
  5. package/dist/bigconsole/components/builder/BuilderTopbar.js +33 -0
  6. package/dist/bigconsole/components/builder/BuilderTopbar.js.map +1 -0
  7. package/dist/bigconsole/components/builder/DashboardEditorShell.js +20 -0
  8. package/dist/bigconsole/components/builder/DashboardEditorShell.js.map +1 -0
  9. package/dist/bigconsole/components/builder/WidgetInspector.js +14 -0
  10. package/dist/bigconsole/components/builder/WidgetInspector.js.map +1 -0
  11. package/dist/bigconsole/components/builder/index.js +4 -0
  12. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js +45 -0
  13. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js.map +1 -0
  14. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +43 -0
  15. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js.map +1 -0
  16. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +124 -0
  17. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -0
  18. package/dist/bigconsole/components/builder/inspector/GeneralSection.js +50 -0
  19. package/dist/bigconsole/components/builder/inspector/GeneralSection.js.map +1 -0
  20. package/dist/bigconsole/components/builder/inspector/index.js +4 -0
  21. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +221 -199
  22. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  23. package/dist/bigconsole/components/dashboard/WidgetPalette.js +145 -102
  24. package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
  25. package/dist/bigconsole/components/dashboard/index.js +4 -0
  26. package/dist/bigconsole/components/widgets/PropertiesPanel.js +529 -742
  27. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  28. package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -226
  29. package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
  30. package/dist/bigconsole/pages/DashboardBuilderPage.js +221 -316
  31. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  32. package/dist/bigconsole/utils/widgetBinding.js +115 -0
  33. package/dist/bigconsole/utils/widgetBinding.js.map +1 -0
  34. package/package.json +2 -2
  35. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js +0 -883
  36. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js.map +0 -1
  37. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js +0 -311
  38. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js.map +0 -1
@@ -1,174 +1,151 @@
1
1
  import { useWidgetStore as e } from "../store/widgetStore.js";
2
2
  import { useDashboardStore as t } from "../store/dashboardStore.js";
3
3
  import "../store/index.js";
4
- import { useBigConsole as n, useBigConsoleNavigate as r } from "../context/BigConsoleContext.js";
4
+ import { useBigConsoleNavigate as n } from "../context/BigConsoleContext.js";
5
5
  import "../context/index.js";
6
- import { getWidgetDefinition as i } from "../components/widgets/WidgetRegistry.js";
7
- import a from "../hooks/useWidgetCatalog.js";
8
- import o from "../hooks/useWidgetOperations.js";
9
- import s from "../hooks/useDashboardOperations.js";
10
- import c from "../hooks/usePageOperations.js";
6
+ import r from "../hooks/useWidgetOperations.js";
7
+ import i from "../hooks/useDashboardOperations.js";
8
+ import a from "../hooks/usePageOperations.js";
11
9
  import "../hooks/index.js";
12
- import l from "../components/widgets/WidgetTypeSelector.js";
13
- import { findNextAvailablePosition as u } from "../utils/widgetPositioning.js";
14
- import d from "../components/dashboard/DashboardCanvas.js";
15
- import f from "../components/dashboard/ExportDashboardDialog.js";
10
+ import { BuilderCanvas as o } from "../components/builder/BuilderCanvas.js";
11
+ import { BuilderTopbar as s } from "../components/builder/BuilderTopbar.js";
12
+ import { DashboardEditorShell as c } from "../components/builder/DashboardEditorShell.js";
13
+ import "../components/builder/index.js";
14
+ import { findNextAvailablePosition as l } from "../utils/widgetPositioning.js";
15
+ import u from "../components/dashboard/DashboardCanvas.js";
16
+ import d from "../components/dashboard/ExportDashboardDialog.js";
16
17
  import "../components/dashboard/index.js";
17
- import { memo as p, useCallback as m, useEffect as h, useState as g } from "react";
18
- import { useParams as _ } from "react-router-dom";
19
- import { ArrowLeft as ee } from "lucide-react";
20
- import { Button as te } from "@burdenoff/fe-libs/ui";
21
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
18
+ import { memo as f, useCallback as p, useEffect as m, useState as h } from "react";
19
+ import { useParams as g } from "react-router-dom";
20
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
22
21
  //#region src/bigconsole/pages/DashboardBuilderPage.tsx
23
- function b() {
22
+ function y() {
24
23
  try {
25
24
  return window.__breadcrumbRegistry;
26
25
  } catch {
27
26
  return;
28
27
  }
29
28
  }
30
- function x(e, t) {
31
- let n = b();
29
+ function b(e, t) {
30
+ let n = y();
32
31
  n?.register && n.register(e, t);
33
32
  }
34
- function ne(e) {
35
- let t = b();
33
+ function x(e) {
34
+ let t = y();
36
35
  t?.unregister && t.unregister(e);
37
36
  }
38
- var S = p(function() {
39
- let { dashboardId: p } = _(), b = r(), { workspaceId: S, apiGatewayUrl: C, authToken: w } = n(), { definitions: T } = a({
40
- workspaceId: S,
41
- apiGatewayUrl: C,
42
- authToken: w
43
- }), [E, D] = g(!1), [re, O] = g(!1), [ie, k] = g(!1), [A, j] = g(null), { fetchDashboard: M, updateDashboard: N, loading: P, error: F } = s(), { createWidget: I, updateWidget: L, deleteWidget: R, duplicateWidget: z, batchUpdatePositions: B } = o(void 0, p), { createPage: V, updatePage: H, deletePage: U, reorderPages: W } = c(), G = t((e) => e.setCurrentDashboard), K = t((e) => e.currentDashboard), q = t((e) => e.setViewMode), J = e((e) => e.selectWidget), Y = e((e) => e.widgets), X = e((e) => e.clipboardWidgetId), Z = e((e) => e.clipboardAction), Q = e((e) => e.clearClipboard);
44
- h(() => (q("edit"), () => q("view")), [q]), h(() => {
45
- if (!p) {
46
- b("/dashboards");
37
+ var S = f(function() {
38
+ let { dashboardId: f } = g(), y = n(), [S, C] = h(!1), [w, T] = h(null), [E, D] = h(!1), [O, k] = h(null), { fetchDashboard: A, updateDashboard: j, loading: M, error: N } = i(), { createWidget: P, updateWidget: F, deleteWidget: I, duplicateWidget: L, batchUpdatePositions: R } = r(void 0, f), { createPage: z, updatePage: B, deletePage: V, reorderPages: H } = a(), U = t((e) => e.setCurrentDashboard), W = t((e) => e.currentDashboard), G = t((e) => e.setViewMode), K = e((e) => e.selectWidget), q = e((e) => e.widgets), J = e((e) => e.clipboardWidgetId), Y = e((e) => e.clipboardAction), X = e((e) => e.clearClipboard);
39
+ m(() => (G("edit"), () => G("view")), [G]), m(() => {
40
+ if (!f) {
41
+ y("/dashboards");
47
42
  return;
48
43
  }
49
- return M(p).then((e) => {
50
- e ? (G({
51
- id: e.id,
44
+ return A(f).then((e) => {
45
+ e ? (U({
46
+ ...e,
52
47
  title: e.name,
53
- description: e.description || "",
48
+ description: e.description ?? "",
54
49
  pages: e.pages.map((e, t) => ({
50
+ ...e,
55
51
  id: e.id,
56
- title: e.name || "",
52
+ title: e.name ?? "",
57
53
  index: t,
58
- layoutConfig: e.layoutConfig || {}
59
- })),
60
- createdAt: e.createdAt,
61
- updatedAt: e.updatedAt
62
- }), e.pages.length > 0 && !A && j(e.pages[0].id), e.name && x(p, e.name)) : b("/dashboards");
54
+ layoutConfig: e.layoutConfig ?? {}
55
+ }))
56
+ }), e.pages.length > 0 && !O && k(e.pages[0].id), e.name && b(f, e.name)) : y("/dashboards");
63
57
  }), () => {
64
- p && ne(p);
58
+ f && x(f);
65
59
  };
66
60
  }, [
67
- p,
68
- b,
69
- G,
70
- M,
71
- A
61
+ f,
62
+ y,
63
+ U,
64
+ A,
65
+ O
72
66
  ]);
73
- let ae = m(async () => {
74
- if (!X || !p || !K?.pages?.[0]?.id) return;
75
- let e = Y.get(X);
76
- if (!e) {
77
- Q();
67
+ let Z = p(async () => {
68
+ let e = O ?? W?.pages?.[0]?.id;
69
+ if (!J || !f || !e) return;
70
+ let t = q.get(J);
71
+ if (!t) {
72
+ X();
78
73
  return;
79
74
  }
80
- let t = K.pages[0].id, n = Array.from(Y.values()), r = {
81
- width: e.positionWidth ?? 4,
82
- height: e.positionHeight ?? 4
83
- }, { x: i, y: a } = u(n, r, { cols: 12 }), o = {
75
+ let n = Array.from(q.values()).filter((t) => t.pageId === e), r = {
76
+ width: t.positionWidth ?? 4,
77
+ height: t.positionHeight ?? 4
78
+ }, { x: i, y: a } = l(n, r, { cols: 12 }), o = {
84
79
  x: i,
85
80
  y: a,
86
81
  width: r.width,
87
82
  height: r.height
88
- }, s = Z === "copy" ? `${e.title} (Copy)` : e.title, c = null;
89
- try {
90
- c = await z(X, o, s);
91
- } catch {}
92
- c ||= await I({
93
- pageId: t,
94
- dashboardId: p,
95
- type: e.type,
83
+ }, s = Y === "copy" ? `${t.title} (Copy)` : t.title, c = await L(J, o, s).catch(() => null);
84
+ c ||= await P({
85
+ pageId: e,
86
+ dashboardId: f,
87
+ type: t.type,
96
88
  title: s,
97
- description: e.description,
98
- dataSinkId: e.dataSinkId ?? void 0,
99
- datasetId: e.datasetId ?? void 0,
100
- parserId: e.parserId ?? void 0,
101
- parserRules: e.parserRules ?? void 0,
102
- config: e.config || {},
89
+ description: t.description,
90
+ dataSinkId: t.dataSinkId ?? void 0,
91
+ datasetId: t.datasetId ?? void 0,
92
+ parserId: t.parserId ?? void 0,
93
+ parserRules: t.parserRules ?? void 0,
94
+ config: t.config || {},
103
95
  position: o,
104
- refreshInterval: e.refreshInterval ?? void 0,
105
- metadata: e.metadata
106
- }), c && (J(c.id), Z === "cut" && await R(X)), Q();
96
+ refreshInterval: t.refreshInterval ?? void 0,
97
+ metadata: t.metadata
98
+ }), c && (K(c.id), Y === "cut" && await I(J)), X();
107
99
  }, [
108
- X,
109
- Z,
110
- p,
111
- K,
100
+ J,
112
101
  Y,
113
- z,
102
+ f,
103
+ O,
104
+ W,
105
+ q,
106
+ L,
107
+ P,
114
108
  I,
115
- R,
116
- J,
117
- Q
118
- ]), oe = m(async (e) => {
119
- if (!p || !K?.pages?.[0]?.id) return;
120
- let t = K.pages[0].id, n = e.replace(/_/g, " ").toLowerCase().replace(/^\w/, (e) => e.toUpperCase()), r = Array.from(Y.values()), a = T.find((t) => t.type === e) ?? i(e), o = {
121
- width: a?.defaultSize?.width ?? 4,
122
- height: a?.defaultSize?.height ?? 4
123
- }, { x: s, y: c } = u(r, o, { cols: 12 }), l = await I({
124
- pageId: t,
125
- dashboardId: p,
126
- type: e,
127
- title: n,
128
- config: {},
129
- position: {
130
- x: s,
131
- y: c,
132
- width: o.width,
133
- height: o.height
134
- }
135
- });
136
- l && (J(l.id), D(!1));
137
- }, [
138
- p,
139
109
  K,
140
- I,
141
- J,
142
- Y,
143
- T
144
- ]), se = m(() => {
145
- b("/dashboards");
146
- }, [b]), $ = m(async () => {
147
- if (p) {
148
- O(!0);
110
+ X
111
+ ]);
112
+ m(() => {
113
+ let n = (n) => {
114
+ if (t.getState().viewMode !== "edit" || n.target?.closest("input, textarea, select, [contenteditable=\"true\"]") || document.querySelector("[data-slot=\"dialog-overlay\"]")) return;
115
+ let r = e.getState(), i = r.selectedWidgetId;
116
+ if (n.key === "Escape") {
117
+ r.selectWidget(null);
118
+ return;
119
+ }
120
+ if ((n.key === "Delete" || n.key === "Backspace") && i) {
121
+ n.preventDefault(), I(i), r.selectWidget(null);
122
+ return;
123
+ }
124
+ (n.metaKey || n.ctrlKey) && (n.key === "c" && i ? r.copyWidget(i) : n.key === "x" && i ? r.cutWidget(i) : n.key === "v" && (n.preventDefault(), Z()));
125
+ };
126
+ return document.addEventListener("keydown", n, !0), () => document.removeEventListener("keydown", n, !0);
127
+ }, [I, Z]);
128
+ let Q = p(() => {
129
+ y("/dashboards");
130
+ }, [y]), $ = p(async () => {
131
+ if (f) {
132
+ C(!0), T(null);
149
133
  try {
150
134
  let t = e.getState(), n = Array.from(t.widgets.values()), r = t.dirtyWidgetIds, i = n.filter((e) => r.has(e.id));
151
135
  if (i.length > 0) {
152
- let e = i.map(async (e) => {
153
- let t = {
154
- id: e.id,
155
- title: e.title,
156
- config: e.config,
157
- refreshInterval: e.refreshInterval ?? void 0,
158
- dataSinkId: e.dataSinkId ?? void 0,
159
- datasetId: e.datasetId ?? void 0,
160
- parserId: e.parserId ?? void 0,
161
- parserRules: e.parserRules ?? void 0
162
- };
163
- try {
164
- return await L(t);
165
- } catch (e) {
166
- throw e;
167
- }
168
- });
136
+ let e = i.map((e) => F({
137
+ id: e.id,
138
+ title: e.title,
139
+ config: e.config,
140
+ refreshInterval: e.refreshInterval ?? void 0,
141
+ dataSinkId: e.dataSinkId ?? void 0,
142
+ datasetId: e.datasetId ?? void 0,
143
+ parserId: e.parserId ?? void 0,
144
+ parserRules: e.parserRules ?? void 0
145
+ }));
169
146
  await Promise.all(e), t.clearAllDirty();
170
147
  }
171
- n.length > 0 && await B(n.map((e) => ({
148
+ n.length > 0 && await R(n.map((e) => ({
172
149
  id: e.id,
173
150
  position: e.position || {
174
151
  x: e.positionX ?? 0,
@@ -176,248 +153,176 @@ var S = p(function() {
176
153
  width: e.positionWidth ?? 4,
177
154
  height: e.positionHeight ?? 4
178
155
  }
179
- }))), K && await N({
180
- id: p,
181
- name: K.title,
182
- description: K.description
156
+ }))), W && await j({
157
+ id: f,
158
+ name: W.title,
159
+ description: W.description
183
160
  });
184
- } catch {} finally {
185
- O(!1);
161
+ } catch (e) {
162
+ T(e instanceof Error ? e.message : "Failed to save dashboard");
163
+ } finally {
164
+ C(!1);
186
165
  }
187
166
  }
188
167
  }, [
189
- p,
190
- K,
191
- L,
192
- B,
193
- N
194
- ]), ce = m(() => {
195
- k(!0);
196
- }, []), le = m(() => {
197
- k(!1);
198
- }, []), ue = m((e) => {
199
- j(e);
200
- }, []), de = m(async () => {
201
- if (!K || !p) return;
202
- let e = await V({
203
- dashboardId: p,
204
- name: `Page ${K.pages.length + 1}`
168
+ f,
169
+ W,
170
+ F,
171
+ R,
172
+ j
173
+ ]), ee = p(() => {
174
+ D(!0);
175
+ }, []), te = p(() => {
176
+ D(!1);
177
+ }, []), ne = p((e) => {
178
+ k(e);
179
+ }, []), re = p(async () => {
180
+ if (!W || !f) return;
181
+ let e = await z({
182
+ dashboardId: f,
183
+ name: `Page ${W.pages.length + 1}`
205
184
  });
206
- e && (G({
207
- ...K,
208
- pages: [...K.pages, {
185
+ e && (U({
186
+ ...W,
187
+ pages: [...W.pages, {
209
188
  id: e.id,
210
189
  title: e.name,
211
190
  index: e.order,
212
191
  layoutConfig: e.layoutConfig || {}
213
192
  }]
214
- }), j(e.id));
193
+ }), k(e.id));
215
194
  }, [
216
- K,
217
- p,
218
- G,
219
- V
220
- ]), fe = m(async (e, t) => {
221
- K && await H({
195
+ W,
196
+ f,
197
+ U,
198
+ z
199
+ ]), ie = p(async (e, t) => {
200
+ W && await B({
222
201
  id: e,
223
202
  name: t
224
- }) && G({
225
- ...K,
226
- pages: K.pages.map((n) => n.id === e ? {
203
+ }) && U({
204
+ ...W,
205
+ pages: W.pages.map((n) => n.id === e ? {
227
206
  ...n,
228
207
  title: t
229
208
  } : n)
230
209
  });
231
210
  }, [
232
- K,
233
- G,
234
- H
235
- ]), pe = m(async (e) => {
236
- if (!K || !p) return;
237
- let t = K.pages.find((t) => t.id === e);
211
+ W,
212
+ U,
213
+ B
214
+ ]), ae = p(async (e) => {
215
+ if (!W || !f) return;
216
+ let t = W.pages.find((t) => t.id === e);
238
217
  if (!t) return;
239
- let n = await V({
240
- dashboardId: p,
218
+ let n = await z({
219
+ dashboardId: f,
241
220
  name: `${t.title} (Copy)`
242
221
  });
243
- n && (G({
244
- ...K,
245
- pages: [...K.pages, {
222
+ n && (U({
223
+ ...W,
224
+ pages: [...W.pages, {
246
225
  id: n.id,
247
226
  title: n.name,
248
227
  index: n.order,
249
228
  layoutConfig: n.layoutConfig || {}
250
229
  }]
251
- }), j(n.id));
230
+ }), k(n.id));
252
231
  }, [
253
- K,
254
- p,
255
- G,
256
- V
257
- ]), me = m(async (e) => {
258
- if (!(!K || K.pages.length <= 1) && await U(e)) {
259
- let t = K.pages.filter((t) => t.id !== e).map((e, t) => ({
232
+ W,
233
+ f,
234
+ U,
235
+ z
236
+ ]), oe = p(async (e) => {
237
+ if (!(!W || W.pages.length <= 1) && await V(e)) {
238
+ let t = W.pages.filter((t) => t.id !== e).map((e, t) => ({
260
239
  ...e,
261
240
  index: t
262
241
  }));
263
- G({
264
- ...K,
242
+ U({
243
+ ...W,
265
244
  pages: t
266
- }), A === e && j(t[0]?.id || null);
245
+ }), O === e && k(t[0]?.id || null);
267
246
  }
268
247
  }, [
269
- K,
270
- G,
271
- A,
272
- U
273
- ]), he = m(async (e) => {
274
- !K || !p || (G({
275
- ...K,
248
+ W,
249
+ U,
250
+ O,
251
+ V
252
+ ]), se = p(async (e) => {
253
+ !W || !f || (U({
254
+ ...W,
276
255
  pages: e.map((e, t) => ({
277
256
  ...e,
278
257
  index: t
279
258
  }))
280
- }), await W(p, e.map((e) => e.id)));
259
+ }), await H(f, e.map((e) => e.id)));
281
260
  }, [
282
- K,
283
- p,
284
- G,
285
- W
261
+ W,
262
+ f,
263
+ U,
264
+ H
286
265
  ]);
287
- return P || !K ? /* @__PURE__ */ v("div", {
288
- className: "flex items-center justify-center h-full",
289
- children: /* @__PURE__ */ v("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
290
- }) : F ? /* @__PURE__ */ v("div", {
266
+ return N ? /* @__PURE__ */ _("div", {
291
267
  className: "flex flex-col items-center justify-center h-full p-6",
292
- children: /* @__PURE__ */ y("div", {
268
+ children: /* @__PURE__ */ v("div", {
293
269
  className: "bg-status-error-bg border border-status-error-border rounded-lg p-4 max-w-md",
294
270
  children: [
295
- /* @__PURE__ */ v("h3", {
271
+ /* @__PURE__ */ _("h3", {
296
272
  className: "text-sm font-medium text-status-error-text",
297
273
  children: "Failed to load dashboard"
298
274
  }),
299
- /* @__PURE__ */ v("p", {
275
+ /* @__PURE__ */ _("p", {
300
276
  className: "text-sm text-text-secondary mt-1",
301
- children: F.message
277
+ children: N.message
302
278
  }),
303
- /* @__PURE__ */ v("button", {
279
+ /* @__PURE__ */ _("button", {
304
280
  type: "button",
305
- onClick: () => b("/dashboards"),
281
+ onClick: () => y("/dashboards"),
306
282
  className: "mt-3 px-3 py-1.5 text-sm font-medium text-action-primary-fg bg-action-primary-bg hover:bg-action-primary-bgHover rounded-md",
307
283
  children: "Back to Dashboards"
308
284
  })
309
285
  ]
310
286
  })
311
- }) : /* @__PURE__ */ y("div", {
312
- className: "flex flex-col h-full",
313
- children: [/* @__PURE__ */ y("div", {
314
- className: "flex items-center gap-3 px-3 py-2 border-b border-border-default bg-bg-surface flex-shrink-0",
315
- children: [/* @__PURE__ */ y(te, {
316
- onClick: se,
317
- variant: "ghost",
318
- size: "sm",
319
- title: "Back to Dashboards",
320
- "aria-label": "Back to Dashboards",
321
- children: [/* @__PURE__ */ v(ee, { className: "w-4 h-4 mr-2" }), "Back"]
322
- }), /* @__PURE__ */ v("h2", {
323
- className: "text-sm font-semibold text-text-primary truncate",
324
- children: K.title
325
- })]
326
- }), /* @__PURE__ */ y("div", {
327
- className: "flex flex-1 min-h-0 relative",
328
- children: [
329
- /* @__PURE__ */ v("div", {
330
- className: `
331
- ${E ? "w-72" : "w-0"}
332
- flex-shrink-0
333
- bg-bg-surface
334
- border-r border-border-default
335
- transition-all duration-300
336
- overflow-hidden
337
- `,
338
- children: E && /* @__PURE__ */ y("div", {
339
- className: "h-full flex flex-col",
340
- children: [/* @__PURE__ */ y("div", {
341
- className: "flex items-center justify-between p-3 border-b border-border-default",
342
- children: [/* @__PURE__ */ v("h3", {
343
- className: "text-sm font-semibold text-text-primary",
344
- children: "Widgets"
345
- }), /* @__PURE__ */ v("button", {
346
- type: "button",
347
- onClick: () => D(!1),
348
- className: "\n p-1 rounded-md\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-sunken\n ",
349
- children: /* @__PURE__ */ v("svg", {
350
- className: "w-4 h-4",
351
- fill: "none",
352
- stroke: "currentColor",
353
- viewBox: "0 0 24 24",
354
- children: /* @__PURE__ */ v("path", {
355
- strokeLinecap: "round",
356
- strokeLinejoin: "round",
357
- strokeWidth: 2,
358
- d: "M6 18L18 6M6 6l12 12"
359
- })
360
- })
361
- })]
362
- }), /* @__PURE__ */ v("div", {
363
- className: "flex-1 overflow-auto",
364
- children: /* @__PURE__ */ v(l, {
365
- onSelect: oe,
366
- definitions: T
367
- })
368
- })]
369
- })
370
- }),
371
- !E && /* @__PURE__ */ v("button", {
372
- type: "button",
373
- onClick: () => D(!0),
374
- className: "\n absolute left-0 top-1/2 -translate-y-1/2 z-20\n w-8 h-24\n bg-bg-surface\n border border-l-0 border-border-default\n rounded-r-lg\n flex items-center justify-center\n text-text-secondary\n hover:text-text-primary\n hover:bg-bg-sunken\n transition-colors\n ",
375
- title: "Open widget panel",
376
- children: /* @__PURE__ */ v("svg", {
377
- className: "w-4 h-4",
378
- fill: "none",
379
- stroke: "currentColor",
380
- viewBox: "0 0 24 24",
381
- children: /* @__PURE__ */ v("path", {
382
- strokeLinecap: "round",
383
- strokeLinejoin: "round",
384
- strokeWidth: 2,
385
- d: "M9 5l7 7-7 7"
386
- })
387
- })
388
- }),
389
- /* @__PURE__ */ v("div", {
390
- className: "flex-1 relative",
391
- children: /* @__PURE__ */ v(d, {
392
- dashboardId: K.id,
393
- pageId: A || K.pages?.[0]?.id,
394
- title: K.title,
395
- onPaste: ae,
396
- onSave: $,
397
- isSaving: re,
398
- onExport: ce,
399
- pages: K.pages.map((e) => ({
400
- id: e.id,
401
- name: e.title || `Page ${(e.index ?? 0) + 1}`,
402
- order: e.index ?? 0
403
- })),
404
- activePageId: A || K.pages?.[0]?.id,
405
- onPageChange: ue,
406
- onPageAdd: de,
407
- onPageRename: fe,
408
- onPageDuplicate: pe,
409
- onPageDelete: me,
410
- onPagesReorder: he,
411
- showPageTabs: !0
412
- })
413
- }),
414
- /* @__PURE__ */ v(f, {
415
- isOpen: ie,
416
- dashboardId: K.id,
417
- dashboardName: K.title,
418
- onClose: le
419
- })
420
- ]
287
+ }) : M || !W ? /* @__PURE__ */ _("div", {
288
+ className: "flex items-center justify-center h-full",
289
+ children: /* @__PURE__ */ _("div", { className: "animate-spin w-8 h-8 border-4 border-action-primary-bg border-t-transparent rounded-full" })
290
+ }) : /* @__PURE__ */ v(c, {
291
+ topbar: /* @__PURE__ */ _(s, {
292
+ title: W.title || "Untitled dashboard",
293
+ onBack: Q,
294
+ actions: w ? /* @__PURE__ */ _("span", {
295
+ className: "text-xs font-medium text-status-error-text",
296
+ role: "alert",
297
+ children: w
298
+ }) : void 0
299
+ }),
300
+ children: [/* @__PURE__ */ _(o, { canvas: /* @__PURE__ */ _(u, {
301
+ dashboardId: W.id,
302
+ pageId: O || W.pages?.[0]?.id,
303
+ title: W.title,
304
+ onPaste: Z,
305
+ onSave: $,
306
+ isSaving: S,
307
+ onExport: ee,
308
+ pages: W.pages.map((e) => ({
309
+ id: e.id,
310
+ name: e.title || `Page ${(e.index ?? 0) + 1}`,
311
+ order: e.index ?? 0
312
+ })),
313
+ activePageId: O || W.pages?.[0]?.id,
314
+ onPageChange: ne,
315
+ onPageAdd: re,
316
+ onPageRename: ie,
317
+ onPageDuplicate: ae,
318
+ onPageDelete: oe,
319
+ onPagesReorder: se,
320
+ showPageTabs: !0
321
+ }) }), /* @__PURE__ */ _(d, {
322
+ isOpen: E,
323
+ dashboardId: W.id,
324
+ dashboardName: W.title,
325
+ onClose: te
421
326
  })]
422
327
  });
423
328
  });