@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
@@ -15,26 +15,27 @@ import oe from "./states/ErrorState.js";
15
15
  import l from "./states/EmptyState.js";
16
16
  import se from "./WidgetErrorBoundary.js";
17
17
  import { hasCustomIframeConfig as ce, hasRenderableCustomConfig as le } from "./custom/config.js";
18
- import ue from "../../renderers/factory/WidgetRendererFactory.js";
19
- import de from "./widget-actions/WidgetActions.js";
18
+ import { getBindingForWidget as ue } from "../../utils/widgetBinding.js";
19
+ import de from "../../renderers/factory/WidgetRendererFactory.js";
20
+ import fe from "./widget-actions/WidgetActions.js";
20
21
  import "./widget-actions/index.js";
21
- import { Suspense as u, lazy as d, memo as f, useCallback as p, useEffect as fe, useMemo as m, useRef as h, useState as g } from "react";
22
- import { useApolloClient as pe } from "@apollo/client/react";
23
- import { jsx as _, jsxs as me } from "react/jsx-runtime";
22
+ import { Suspense as pe, lazy as u, memo as d, useCallback as f, useEffect as me, useMemo as p, useRef as m, useState as h } from "react";
23
+ import { useApolloClient as he } from "@apollo/client/react";
24
+ import { jsx as g, jsxs as ge } from "react/jsx-runtime";
24
25
  //#region src/bigconsole/components/widgets/WidgetWrapper.tsx
25
- var he = d(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), ge = d(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), _e = d(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), ve = d(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), ye = d(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), be = d(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), xe = d(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), Se = d(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Ce = d(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), we = d(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), Te = d(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Ee = d(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), De = d(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Oe = d(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), ke = d(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Ae = d(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), je = d(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Me = d(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), Ne = d(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
26
- function v(e, t) {
26
+ var _e = u(() => import("./metric-card/index.js").then((e) => ({ default: e.MetricCardWidget }))), ve = u(() => import("./chart/index.js").then((e) => ({ default: e.ChartWidget }))), ye = u(() => import("./table/index.js").then((e) => ({ default: e.TableWidget }))), be = u(() => import("./pivot-table/index.js").then((e) => ({ default: e.PivotTableWidget }))), xe = u(() => import("./gauge/index.js").then((e) => ({ default: e.GaugeWidget }))), Se = u(() => import("./progress/index.js").then((e) => ({ default: e.ProgressWidget }))), Ce = u(() => import("./list/index.js").then((e) => ({ default: e.ListWidget }))), we = u(() => import("./heatmap/index.js").then((e) => ({ default: e.HeatmapWidget }))), Te = u(() => import("./retention/index.js").then((e) => ({ default: e.RetentionWidget }))), Ee = u(() => import("./calendar/index.js").then((e) => ({ default: e.CalendarWidget }))), De = u(() => import("./kanban/index.js").then((e) => ({ default: e.KanbanWidget }))), Oe = u(() => import("./timeline/index.js").then((e) => ({ default: e.TimelineWidget }))), ke = u(() => import("./kpi-comparison/index.js").then((e) => ({ default: e.KPIComparisonWidget }))), Ae = u(() => import("./text-widget/index.js").then((e) => ({ default: e.TextWidget }))), je = u(() => import("./map-widget/index.js").then((e) => ({ default: e.MapWidget }))), Me = u(() => import("./iframe-widget/index.js").then((e) => ({ default: e.IframeWidget }))), Ne = u(() => import("./custom/index.js").then((e) => ({ default: e.CustomWidget }))), Pe = u(() => import("./adaptive-card/index.js").then((e) => ({ default: e.AdaptiveCardWidget }))), Fe = u(() => import("./comments/WidgetComments.js").then((e) => ({ default: e.WidgetComments })));
27
+ function _(e, t) {
27
28
  if (e.widget.id !== t.widget.id || e.widget.updatedAt !== t.widget.updatedAt || e.isLoading !== t.isLoading || e.error !== t.error || (e.actions?.length ?? 0) !== (t.actions?.length ?? 0)) return !1;
28
29
  if (e.actions && t.actions) {
29
30
  for (let n = 0; n < e.actions.length; n++) if (e.actions[n]?.id !== t.actions[n]?.id) return !1;
30
31
  }
31
32
  return !(e.data !== t.data || JSON.stringify(e.filterValues) !== JSON.stringify(t.filterValues));
32
33
  }
33
- var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoading: Pe, error: Fe, onRefresh: b, onDrilldown: Ie, actions: x, onAction: S, filterValues: C }) {
34
- let w = r((e) => e.viewMode === "edit"), T = t((e) => e.selectWidget), E = e(d.id), D = n(d.id), O = i(), Le = pe(), k = d.dashboardId, A = m(() => {
34
+ var v = d(function({ widget: u, children: d, data: _, className: v = "", isLoading: Ie, error: Le, onRefresh: y, onDrilldown: Re, actions: b, onAction: x, filterValues: S }) {
35
+ let C = r((e) => e.viewMode === "edit"), w = t((e) => e.selectWidget), T = e(u.id), E = n(u.id), D = i(), O = he(), k = u.dashboardId, A = p(() => {
35
36
  if (!k) return {};
36
37
  try {
37
- let e = Le.readQuery({
38
+ let e = O.readQuery({
38
39
  query: a,
39
40
  variables: { id: k }
40
41
  }), t = {};
@@ -46,10 +47,10 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
46
47
  } catch {
47
48
  return {};
48
49
  }
49
- }, [Le, k]), Re = !!d.dataSinkId || !!d.datasetId || !!d.parserId, { data: j, loading: ze } = o(d.id, {
50
- skip: !Re,
51
- pollInterval: (d.refreshInterval ?? 0) * 1e3 || 0
52
- }), M = m(() => {
50
+ }, [O, k]), j = p(() => ue(u), [u]), M = j.source.kind !== "DATASINK" || !!j.source.ref || !!j.parserId || !!u.datasetId, { data: N, loading: ze } = o(u.id, {
51
+ skip: !M,
52
+ pollInterval: (u.refreshInterval ?? 0) * 1e3 || 0
53
+ }), P = p(() => {
53
54
  if (typeof window > "u") return {};
54
55
  let e = new URLSearchParams(window.location.search), t = {};
55
56
  return e.forEach((e, n) => {
@@ -58,56 +59,56 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
58
59
  r.startsWith("__") || (t[r] = e);
59
60
  }
60
61
  }), t;
61
- }, []), N = m(() => {
62
+ }, []), F = p(() => {
62
63
  let e = {};
63
- return M && Object.keys(M).length > 0 && Object.assign(e, M), O && Object.keys(O).length > 0 && Object.assign(e, O), C && Object.keys(C).length > 0 && Object.assign(e, C), e;
64
+ return P && Object.keys(P).length > 0 && Object.assign(e, P), D && Object.keys(D).length > 0 && Object.assign(e, D), S && Object.keys(S).length > 0 && Object.assign(e, S), e;
64
65
  }, [
65
- M,
66
- O,
67
- C
68
- ]), P = Object.keys(N).length > 0, F = Pe ?? (ze && !j) ?? D.isLoading, I = Fe ?? D.errorMessage, Be = s(d.type), L = h(b);
69
- fe(() => {
70
- L.current = b;
71
- }, [b]);
72
- let Ve = p(async () => {
73
- L.current && await L.current();
66
+ P,
67
+ D,
68
+ S
69
+ ]), I = Object.keys(F).length > 0, L = Ie ?? (ze && !N) ?? E.isLoading, R = Le ?? E.errorMessage, Be = s(u.type), z = m(y);
70
+ me(() => {
71
+ z.current = y;
72
+ }, [y]);
73
+ let Ve = f(async () => {
74
+ z.current && await z.current();
74
75
  }, []), { timeUntilRefresh: He, isPaused: Ue } = te({
75
- widgetId: d.id,
76
- refreshInterval: d.refreshInterval,
76
+ widgetId: u.id,
77
+ refreshInterval: u.refreshInterval,
77
78
  onRefresh: Ve,
78
- enabled: !w && !!d.refreshInterval
79
- }), R = h(null), [z, B] = g(!1), [V, We] = g(!1), { count: Ge } = ne(d.id, V), Ke = p(() => {
80
- B((e) => {
79
+ enabled: !C && !!u.refreshInterval
80
+ }), B = m(null), [V, H] = h(!1), [U, We] = h(!1), { count: Ge } = ne(u.id, U), Ke = f(() => {
81
+ H((e) => {
81
82
  let t = !e;
82
83
  return t && We(!0), t;
83
84
  });
84
- }, []), H = m(() => {
85
- if (v && Array.isArray(v)) return v;
86
- let e = d.data;
85
+ }, []), W = p(() => {
86
+ if (_ && Array.isArray(_)) return _;
87
+ let e = u.data;
87
88
  if (e?.processed && Array.isArray(e.processed)) return e.processed;
88
89
  if (e?.raw) {
89
90
  let t = typeof e.raw == "string" ? JSON.parse(e.raw) : e.raw;
90
91
  if (Array.isArray(t)) return t;
91
92
  }
92
93
  return null;
93
- }, [v, d]), { exportCSV: qe, exportPNG: Je } = re(d, {
94
- data: H,
95
- containerRef: R
96
- }), U = p((e) => {
94
+ }, [_, u]), { exportCSV: qe, exportPNG: Je } = re(u, {
95
+ data: W,
96
+ containerRef: B
97
+ }), G = f((e) => {
97
98
  if (e == null) return !1;
98
99
  if (Array.isArray(e)) return e.length > 0;
99
100
  if (typeof e == "object") {
100
101
  let t = e, n = Object.keys(t);
101
102
  return n.length === 0 ? !1 : n.some((e) => {
102
103
  let n = t[e];
103
- return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? U(n) : !0;
104
+ return n == null || n === "" ? !1 : Array.isArray(n) ? n.length > 0 : typeof n == "object" ? G(n) : !0;
104
105
  });
105
106
  }
106
107
  return !0;
107
- }, []), W = p((e) => {
108
- if (!P || !e) return e;
108
+ }, []), Ye = f((e) => {
109
+ if (!I || !e) return e;
109
110
  let t = {}, n = {};
110
- Object.entries(N || {}).forEach(([e, r]) => {
111
+ Object.entries(F || {}).forEach(([e, r]) => {
111
112
  if (e.startsWith("ctx_")) {
112
113
  let n = e.slice(4);
113
114
  t[n] = r;
@@ -236,124 +237,124 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
236
237
  }
237
238
  return e;
238
239
  }, [
239
- P,
240
- N,
241
- d.id,
240
+ I,
241
+ F,
242
+ u.id,
242
243
  A
243
- ]), G = m(() => {
244
+ ]), K = p(() => {
244
245
  let e = null;
245
- if (v && U(v)) e = v;
246
- else if (j) {
247
- let t = j;
248
- if (t?.processed && U(t.processed)) e = t.processed;
246
+ if (_ && G(_)) e = _;
247
+ else if (N) {
248
+ let t = N;
249
+ if (t?.processed && G(t.processed)) e = t.processed;
249
250
  else if (t?.raw) try {
250
251
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
251
- U(n) && (e = n);
252
+ G(n) && (e = n);
252
253
  } catch {}
253
254
  } else {
254
- let t = d.data;
255
- if (t?.processed && U(t.processed)) e = t.processed;
255
+ let t = u.data;
256
+ if (t?.processed && G(t.processed)) e = t.processed;
256
257
  else if (t?.raw) try {
257
258
  let n = typeof t.raw == "string" ? JSON.parse(t.raw) : t.raw;
258
- U(n) && (e = n);
259
+ G(n) && (e = n);
259
260
  } catch {}
260
261
  }
261
262
  if (!e) {
262
- let t = d.config?.mockData;
263
+ let t = u.config?.mockData;
263
264
  if (t) try {
264
265
  let n = typeof t == "string" ? JSON.parse(t) : t;
265
- U(n) && (e = n);
266
+ G(n) && (e = n);
266
267
  } catch {}
267
268
  }
268
269
  if (e && typeof e == "object" && !Array.isArray(e)) {
269
- let t = d.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
270
+ let t = u.config, n = t?.dataKey ?? t?.dataPath ?? t?.seriesPath;
270
271
  if (n && typeof n == "string") {
271
272
  let t = n.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
272
- t != null && U(t) && (e = t);
273
+ t != null && G(t) && (e = t);
273
274
  }
274
275
  }
275
- return P && e ? W(e) : e;
276
+ return I && e ? Ye(e) : e;
276
277
  }, [
277
- v,
278
- d,
279
- j,
280
- P,
281
- W,
278
+ _,
279
+ u,
282
280
  N,
283
- U
284
- ]), K = m(() => G ?? null, [G]), { executeDrilldown: q, canDrilldown: J } = ie({ onDrilldown: (e, t) => {
285
- Ie?.(e);
286
- } }), Y = m(() => J(d), [d, J]), X = p((e) => {
287
- if (!d.drilldown?.enabled) return;
281
+ I,
282
+ Ye,
283
+ F,
284
+ G
285
+ ]), q = p(() => K ?? null, [K]), { executeDrilldown: Xe, canDrilldown: Ze } = ie({ onDrilldown: (e, t) => {
286
+ Re?.(e);
287
+ } }), J = p(() => Ze(u), [u, Ze]), Y = f((e) => {
288
+ if (!u.drilldown?.enabled) return;
288
289
  let t = {
289
290
  selectedData: e || {},
290
- globalFilters: O || {},
291
- widgetData: K || {},
291
+ globalFilters: D || {},
292
+ widgetData: q || {},
292
293
  metadata: {
293
- widgetId: d.id,
294
- widgetType: d.type,
295
- widgetTitle: d.title
294
+ widgetId: u.id,
295
+ widgetType: u.type,
296
+ widgetTitle: u.title
296
297
  },
297
- sourceDashboardId: d.dashboardId
298
+ sourceDashboardId: u.dashboardId
298
299
  };
299
- q(d.drilldown, t);
300
+ Xe(u.drilldown, t);
300
301
  }, [
301
- d,
302
- K,
303
- O,
304
- q
305
- ]), Z = h(null), Ye = p((e) => {
306
- Z.current = {
302
+ u,
303
+ q,
304
+ D,
305
+ Xe
306
+ ]), X = m(null), Qe = f((e) => {
307
+ X.current = {
307
308
  x: e.clientX,
308
309
  y: e.clientY
309
310
  };
310
- }, []), Xe = p((e) => {
311
- if (e.stopPropagation(), Z.current) {
312
- let t = Math.abs(e.clientX - Z.current.x), n = Math.abs(e.clientY - Z.current.y);
311
+ }, []), $e = f((e) => {
312
+ if (e.stopPropagation(), X.current) {
313
+ let t = Math.abs(e.clientX - X.current.x), n = Math.abs(e.clientY - X.current.y);
313
314
  if (t > 5 || n > 5) {
314
- Z.current = null;
315
+ X.current = null;
315
316
  return;
316
317
  }
317
318
  }
318
- Z.current = null, w && T(d.id);
319
+ X.current = null, C && w(u.id);
319
320
  }, [
321
+ C,
320
322
  w,
321
- T,
322
- d.id
323
- ]), Ze = p((e) => {
324
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), w && T(d.id));
323
+ u.id
324
+ ]), et = f((e) => {
325
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), C && w(u.id));
325
326
  }, [
327
+ C,
326
328
  w,
327
- T,
328
- d.id
329
- ]), Qe = m(() => d.type === "custom" && le(d.config), [d.type, d.config]), $e = m(() => d.type === "custom" && ce(d.config), [d.type, d.config]), Q = Y && !$e, et = !F && !I && !K && !Qe, $ = m(() => d.renderer, [d]), tt = m(() => $ && $ !== "BIGCONSOLE", [$]), nt = m(() => ({
330
- widgetId: d.id,
331
- data: K || {}
332
- }), [d.id, K]), rt = p((e, t) => {
333
- if (!S) return;
334
- let n = x?.find((t) => t.name === e.name);
335
- S(n || e, t);
336
- }, [S, x]), it = p(() => {
329
+ u.id
330
+ ]), tt = p(() => u.type === "custom" && le(u.config), [u.type, u.config]), nt = p(() => u.type === "custom" && ce(u.config), [u.type, u.config]), Z = J && !nt, rt = !L && !R && !q && !tt, Q = p(() => u.renderer, [u]), it = p(() => Q && Q !== "BIGCONSOLE", [Q]), at = p(() => ({
331
+ widgetId: u.id,
332
+ data: q || {}
333
+ }), [u.id, q]), $ = f((e, t) => {
334
+ if (!x) return;
335
+ let n = b?.find((t) => t.name === e.name);
336
+ x(n || e, t);
337
+ }, [x, b]), ot = f(() => {
337
338
  let e = {
338
- widget: d,
339
+ widget: u,
339
340
  data: (() => {
340
- if (!K) return K;
341
- if (d.type === "table" || d.type === "pivot_table") {
342
- if (Array.isArray(K)) return K;
343
- if (K && typeof K == "object" && "rows" in K) return K.rows;
341
+ if (!q) return q;
342
+ if (u.type === "table" || u.type === "pivot_table") {
343
+ if (Array.isArray(q)) return q;
344
+ if (q && typeof q == "object" && "rows" in q) return q.rows;
344
345
  }
345
- if (d.type === "list") {
346
- if (Array.isArray(K)) return K;
347
- if (K && typeof K == "object" && "items" in K) return K.items;
346
+ if (u.type === "list") {
347
+ if (Array.isArray(q)) return q;
348
+ if (q && typeof q == "object" && "items" in q) return q.items;
348
349
  }
349
- if (d.type === "funnel_chart") {
350
- if (Array.isArray(K)) return K;
351
- if (K && typeof K == "object" && "stages" in K) return K.stages;
350
+ if (u.type === "funnel_chart") {
351
+ if (Array.isArray(q)) return q;
352
+ if (q && typeof q == "object" && "stages" in q) return q.stages;
352
353
  }
353
- if (d.type === "chart") {
354
- if (Array.isArray(K)) return K;
355
- if (K && typeof K == "object" && "datasets" in K) {
356
- let e = K;
354
+ if (u.type === "chart") {
355
+ if (Array.isArray(q)) return q;
356
+ if (q && typeof q == "object" && "datasets" in q) {
357
+ let e = q;
357
358
  if (e.labels && e.datasets) return e.labels.map((t, n) => {
358
359
  let r = { name: t };
359
360
  return e.datasets?.forEach((e) => {
@@ -362,8 +363,8 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
362
363
  });
363
364
  }
364
365
  }
365
- if (d.type === "text" && K && typeof K == "object" && !("content" in K)) {
366
- let e = K, t = [];
366
+ if (u.type === "text" && q && typeof q == "object" && !("content" in q)) {
367
+ let e = q, t = [];
367
368
  for (let [n, r] of Object.entries(e)) if (r && typeof r == "object" && !Array.isArray(r)) {
368
369
  t.push(`### ${n}`);
369
370
  for (let [e, n] of Object.entries(r)) t.push(`- **${e}:** ${n}`);
@@ -378,174 +379,174 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
378
379
  format: "markdown"
379
380
  };
380
381
  }
381
- if (d.type === "custom") {
382
- let e = d.config?.valueField;
383
- if (e && K && typeof K == "object" && !Array.isArray(K)) {
384
- let t = K;
382
+ if (u.type === "custom") {
383
+ let e = u.config?.valueField;
384
+ if (e && q && typeof q == "object" && !Array.isArray(q)) {
385
+ let t = q;
385
386
  if (e in t) return {
386
387
  value: t[e],
387
- label: d.title,
388
+ label: u.title,
388
389
  data: t
389
390
  };
390
391
  }
391
392
  }
392
- return K;
393
+ return q;
393
394
  })(),
394
- onDrilldown: Y ? X : void 0
395
+ onDrilldown: J ? Y : void 0
395
396
  };
396
- if (tt) {
397
+ if (it) {
397
398
  let e = {};
398
- if (G && typeof G == "object" && !Array.isArray(G) && Object.keys(G).length > 0 && (e = { ...G }), d.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
399
- let t = d.config?.valueField;
399
+ if (K && typeof K == "object" && !Array.isArray(K) && Object.keys(K).length > 0 && (e = { ...K }), u.config?._internalWidgetType === "custom" && Object.keys(e).length > 0) {
400
+ let t = u.config?.valueField;
400
401
  if (t && t in e) {
401
402
  let n = e[t], r = typeof n == "number" ? n.toLocaleString() : String(n);
402
403
  e = {
403
404
  ...e,
404
405
  value: n,
405
406
  title: e.title || r,
406
- description: e.description || d.title || "",
407
+ description: e.description || u.title || "",
407
408
  text: e.text || r
408
409
  };
409
410
  }
410
411
  }
411
- return /* @__PURE__ */ _(ue, {
412
- widget: d,
412
+ return /* @__PURE__ */ g(de, {
413
+ widget: u,
413
414
  data: e,
414
- isEditMode: w,
415
- isSelected: E,
416
- isLoading: F,
417
- error: I,
418
- onDrilldown: Y ? X : void 0,
419
- onAction: rt
415
+ isEditMode: C,
416
+ isSelected: T,
417
+ isLoading: L,
418
+ error: R,
419
+ onDrilldown: J ? Y : void 0,
420
+ onAction: $
420
421
  });
421
422
  }
422
- switch (d.type?.toLowerCase() || "") {
423
- case "metric_card": return /* @__PURE__ */ _(he, { ...e });
424
- case "kpi_card_comparison": return /* @__PURE__ */ _(De, { ...e });
423
+ switch (u.type?.toLowerCase() || "") {
424
+ case "metric_card": return /* @__PURE__ */ g(_e, { ...e });
425
+ case "kpi_card_comparison": return /* @__PURE__ */ g(ke, { ...e });
425
426
  case "chart":
426
- case "funnel_chart": return /* @__PURE__ */ _(ge, { ...e });
427
- case "table": return /* @__PURE__ */ _(_e, { ...e });
428
- case "pivot_table": return /* @__PURE__ */ _(ve, { ...e });
429
- case "gauge": return /* @__PURE__ */ _(ye, { ...e });
430
- case "progress": return /* @__PURE__ */ _(be, { ...e });
431
- case "list": return /* @__PURE__ */ _(xe, { ...e });
432
- case "heatmap": return /* @__PURE__ */ _(Se, { ...e });
433
- case "retention": return /* @__PURE__ */ _(Ce, { ...e });
434
- case "calendar": return /* @__PURE__ */ _(we, { ...e });
435
- case "timeline": return /* @__PURE__ */ _(Ee, { ...e });
436
- case "kanban": return /* @__PURE__ */ _(Te, { ...e });
437
- case "form": return /* @__PURE__ */ _(Me, { ...e });
438
- case "text": return /* @__PURE__ */ _(Oe, { ...e });
439
- case "iframe": return /* @__PURE__ */ _(Ae, { ...e });
440
- case "map": return /* @__PURE__ */ _(ke, { ...e });
441
- case "custom": return /* @__PURE__ */ _(je, { ...e });
442
- default: return f || /* @__PURE__ */ _(l, { widgetType: d.type });
427
+ case "funnel_chart": return /* @__PURE__ */ g(ve, { ...e });
428
+ case "table": return /* @__PURE__ */ g(ye, { ...e });
429
+ case "pivot_table": return /* @__PURE__ */ g(be, { ...e });
430
+ case "gauge": return /* @__PURE__ */ g(xe, { ...e });
431
+ case "progress": return /* @__PURE__ */ g(Se, { ...e });
432
+ case "list": return /* @__PURE__ */ g(Ce, { ...e });
433
+ case "heatmap": return /* @__PURE__ */ g(we, { ...e });
434
+ case "retention": return /* @__PURE__ */ g(Te, { ...e });
435
+ case "calendar": return /* @__PURE__ */ g(Ee, { ...e });
436
+ case "timeline": return /* @__PURE__ */ g(Oe, { ...e });
437
+ case "kanban": return /* @__PURE__ */ g(De, { ...e });
438
+ case "form": return /* @__PURE__ */ g(Pe, { ...e });
439
+ case "text": return /* @__PURE__ */ g(Ae, { ...e });
440
+ case "iframe": return /* @__PURE__ */ g(Me, { ...e });
441
+ case "map": return /* @__PURE__ */ g(je, { ...e });
442
+ case "custom": return /* @__PURE__ */ g(Ne, { ...e });
443
+ default: return d || /* @__PURE__ */ g(l, { widgetType: u.type });
443
444
  }
444
445
  }, [
446
+ u,
447
+ q,
445
448
  d,
446
- K,
447
- f,
449
+ J,
448
450
  Y,
449
- X,
450
- tt,
451
- w,
452
- E,
453
- F,
454
- I,
455
- rt,
456
- G
451
+ it,
452
+ C,
453
+ T,
454
+ L,
455
+ R,
456
+ $,
457
+ K
457
458
  ]);
458
- return /* @__PURE__ */ me("div", {
459
- ref: R,
459
+ return /* @__PURE__ */ ge("div", {
460
+ ref: B,
460
461
  className: `
461
462
  group relative flex flex-col
462
463
  h-full w-full
463
464
  rounded-lg border
464
465
  bg-bg-surface
465
466
  transition-all duration-200
466
- ${E && w ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
467
- ${w ? "cursor-pointer" : ""}
468
- ${y}
467
+ ${T && C ? "border-action-primary-border ring-2 ring-action-primary-border/30" : "border-border-default hover:border-action-primary-bg"}
468
+ ${C ? "cursor-pointer" : ""}
469
+ ${v}
469
470
  `,
470
- onMouseDown: Ye,
471
- onClick: Xe,
472
- onKeyDown: Ze,
473
- tabIndex: w ? 0 : -1,
474
- role: w ? "button" : void 0,
475
- "aria-selected": E,
476
- "aria-label": `Widget: ${d.title}`,
477
- "data-widget-id": d.id,
478
- "data-widget-type": d.type,
471
+ onMouseDown: Qe,
472
+ onClick: $e,
473
+ onKeyDown: et,
474
+ tabIndex: C ? 0 : -1,
475
+ role: C ? "button" : void 0,
476
+ "aria-selected": T,
477
+ "aria-label": `Widget: ${u.title}`,
478
+ "data-widget-id": u.id,
479
+ "data-widget-type": u.type,
479
480
  children: [
480
- /* @__PURE__ */ _(ae, {
481
- widget: d,
481
+ /* @__PURE__ */ g(ae, {
482
+ widget: u,
482
483
  definition: Be,
483
- isSelected: E,
484
- isEditMode: w,
485
- isLoading: F,
486
- timeUntilRefresh: d.refreshInterval && !Ue ? ee(He) : void 0,
487
- hasDrilldown: Y,
488
- onRefresh: b,
489
- onExportCSV: H ? qe : void 0,
484
+ isSelected: T,
485
+ isEditMode: C,
486
+ isLoading: L,
487
+ timeUntilRefresh: u.refreshInterval && !Ue ? ee(He) : void 0,
488
+ hasDrilldown: J,
489
+ onRefresh: y,
490
+ onExportCSV: W ? qe : void 0,
490
491
  onExportPNG: Je,
491
- onDrilldown: Y ? () => X() : void 0,
492
+ onDrilldown: J ? () => Y() : void 0,
492
493
  onToggleComments: Ke,
493
- commentsOpen: z,
494
- commentCount: V ? Ge : void 0
494
+ commentsOpen: V,
495
+ commentCount: U ? Ge : void 0
495
496
  }),
496
- /* @__PURE__ */ _("div", {
497
+ /* @__PURE__ */ g("div", {
497
498
  className: `
498
499
  flex-1 overflow-hidden p-4 min-h-0
499
- ${Q && !w ? "cursor-pointer" : ""}
500
+ ${Z && !C ? "cursor-pointer" : ""}
500
501
  `,
501
- title: Q && !w ? "Click data to drill down" : void 0,
502
- children: /* @__PURE__ */ _("div", {
502
+ title: Z && !C ? "Click data to drill down" : void 0,
503
+ children: /* @__PURE__ */ g("div", {
503
504
  className: "h-full overflow-auto",
504
505
  children: (() => {
505
- if (F) return /* @__PURE__ */ _(c, {});
506
- if (I) return /* @__PURE__ */ _(oe, {
507
- error: I,
508
- onRetry: b
506
+ if (L) return /* @__PURE__ */ g(c, {});
507
+ if (R) return /* @__PURE__ */ g(oe, {
508
+ error: R,
509
+ onRetry: y
509
510
  });
510
- if (et && !f) return /* @__PURE__ */ _(l, {
511
- widgetType: d.type,
512
- hasDataSource: !!d.parserId || !!d.dataSinkId
511
+ if (rt && !d) return /* @__PURE__ */ g(l, {
512
+ widgetType: u.type,
513
+ hasDataSource: M
513
514
  });
514
- let e = `${d.parserId ?? ""}|${d.dataSinkId ?? ""}|${d.updatedAt ?? ""}`;
515
- return /* @__PURE__ */ _(se, {
516
- widgetId: d.id,
517
- widgetType: d.type,
518
- widgetTitle: d.title,
515
+ let e = `${j.source.kind}|${j.source.ref ?? ""}|${j.parserId ?? ""}|${u.updatedAt ?? ""}`;
516
+ return /* @__PURE__ */ g(se, {
517
+ widgetId: u.id,
518
+ widgetType: u.type,
519
+ widgetTitle: u.title,
519
520
  resetKey: e,
520
- children: f ?? /* @__PURE__ */ _(u, {
521
- fallback: /* @__PURE__ */ _(c, {}),
522
- children: it()
521
+ children: d ?? /* @__PURE__ */ g(pe, {
522
+ fallback: /* @__PURE__ */ g(c, {}),
523
+ children: ot()
523
524
  })
524
525
  });
525
526
  })()
526
527
  })
527
528
  }),
528
- x && x.length > 0 && !F && !I && /* @__PURE__ */ _("div", {
529
+ b && b.length > 0 && !L && !R && /* @__PURE__ */ g("div", {
529
530
  className: "px-4 py-3 border-t border-border-default bg-bg-sunken",
530
531
  style: { flexShrink: 0 },
531
- children: /* @__PURE__ */ _(de, {
532
- actions: x,
533
- context: nt,
534
- onAction: S,
535
- disabled: w,
532
+ children: /* @__PURE__ */ g(fe, {
533
+ actions: b,
534
+ context: at,
535
+ onAction: x,
536
+ disabled: C,
536
537
  layout: "horizontal",
537
538
  size: "sm"
538
539
  })
539
540
  }),
540
- Q && !w && /* @__PURE__ */ _("div", {
541
+ Z && !C && /* @__PURE__ */ g("div", {
541
542
  className: "\n absolute bottom-2 right-2\n opacity-0 group-hover:opacity-100\n transition-opacity duration-200\n ",
542
543
  title: "Click to drill down",
543
- children: /* @__PURE__ */ _("svg", {
544
+ children: /* @__PURE__ */ g("svg", {
544
545
  className: "w-4 h-4 text-text-secondary",
545
546
  fill: "none",
546
547
  stroke: "currentColor",
547
548
  viewBox: "0 0 24 24",
548
- children: /* @__PURE__ */ _("path", {
549
+ children: /* @__PURE__ */ g("path", {
549
550
  strokeLinecap: "round",
550
551
  strokeLinejoin: "round",
551
552
  strokeWidth: 2,
@@ -553,17 +554,17 @@ var y = f(function({ widget: d, children: f, data: v, className: y = "", isLoadi
553
554
  })
554
555
  })
555
556
  }),
556
- z && /* @__PURE__ */ _(u, {
557
+ V && /* @__PURE__ */ g(pe, {
557
558
  fallback: null,
558
- children: /* @__PURE__ */ _(Ne, {
559
- widgetId: d.id,
560
- onClose: () => B(!1)
559
+ children: /* @__PURE__ */ g(Fe, {
560
+ widgetId: u.id,
561
+ onClose: () => H(!1)
561
562
  })
562
563
  })
563
564
  ]
564
565
  });
565
- }, v);
566
+ }, _);
566
567
  //#endregion
567
- export { y as default };
568
+ export { v as default };
568
569
 
569
570
  //# sourceMappingURL=WidgetWrapper.js.map