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