@burdenoff/microfe-bigconsole 2026.1119.2 → 2026.1119.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
  2. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.d.ts +15 -0
  3. package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +62 -0
  4. package/dist/bigconsole/components/widgets/WidgetWrapper.js +353 -351
  5. package/dist/bigconsole/components/widgets/chart/ChartWidget.js +131 -126
  6. package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +16 -0
  7. package/dist/bigconsole/components/widgets/chart/chartRows.js +33 -1
  8. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.d.ts +2 -20
  9. package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +4 -3
  10. package/dist/bigconsole/components/widgets/metric-card/metricCardData.d.ts +48 -0
  11. package/dist/bigconsole/components/widgets/metric-card/metricCardData.js +96 -0
  12. package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +9 -2
  13. package/dist/bigconsole/components/widgets/metric-card/metricData.js +10 -69
  14. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
  15. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
  16. package/dist/bigconsole/customWidget/index.d.ts +2 -1
  17. package/dist/bigconsole/customWidget/index.js +1 -0
  18. package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
  19. package/dist/bigconsole/customWidget/proposalContract.js +37 -14
  20. package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
  21. package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
  22. package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
  23. package/dist/bigconsole/customWidget/proposalSource.js +197 -51
  24. package/dist/bigconsole/hooks/useParserOperations.js +80 -74
  25. package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
  26. package/dist/bigconsole/store/parserScope.d.ts +24 -0
  27. package/dist/bigconsole/store/parserScope.js +17 -0
  28. package/dist/bigconsole/store/parserStore.d.ts +3 -0
  29. package/dist/bigconsole/store/parserStore.js +70 -68
  30. package/dist/bigconsole/utils/applyGlobalFilters.d.ts +3 -1
  31. package/dist/bigconsole/utils/applyGlobalFilters.js +53 -4
  32. package/dist/bigconsole/utils/globalFilterMatching.d.ts +21 -3
  33. package/dist/bigconsole/utils/globalFilterMatching.js +14 -9
  34. package/dist/generated/wspace-operations.d.ts +10 -0
  35. package/dist/generated/wspace-operations.js +180 -110
  36. package/package.json +1 -1
@@ -1,17 +1,17 @@
1
- import { firstObjectRow as e, inferValueField as t, unwrapRows as n } from "../utils/inferFields.js";
1
+ import { resolveMetricCardData as e } from "./metricCardData.js";
2
2
  // src/bigconsole/components/widgets/metric-card/metricData.ts
3
- function r(e) {
3
+ function t(e) {
4
4
  return e !== void 0 && /^[a-z]{3}$/i.test(e) ? e.toUpperCase() : void 0;
5
5
  }
6
- function i(e, t) {
7
- let n = e?.format, i = n !== void 0 && n !== "auto" ? n === "currency" || n === "percentage" || n === "compact" ? n : "number" : t?.isCurrency === !0 ? "currency" : "number";
6
+ function n(e, n) {
7
+ let r = e?.format, i = r !== void 0 && r !== "auto" ? r === "currency" || r === "percentage" || r === "compact" ? r : "number" : n?.isCurrency === !0 ? "currency" : "number";
8
8
  return {
9
9
  style: i,
10
- currency: r(t?.unit) ?? "USD",
11
- unitSuffix: i === "currency" || e?.suffix ? void 0 : t?.unit
10
+ currency: t(n?.unit) ?? "USD",
11
+ unitSuffix: i === "currency" || e?.suffix ? void 0 : n?.unit
12
12
  };
13
13
  }
14
- function a(e, t, n) {
14
+ function r(e, t, n) {
15
15
  if (typeof e == "string") return e;
16
16
  let { prefix: r, suffix: i, decimalPlaces: a } = t || {}, o = n.style, s = typeof a == "number" && Number.isFinite(a) ? Math.min(Math.max(Math.trunc(a), 0), 20) : void 0, c;
17
17
  switch (o) {
@@ -40,66 +40,7 @@ function a(e, t, n) {
40
40
  }
41
41
  return r && (c = `${r}${c}`), i && (c = `${c}${i}`), n.unitSuffix && !c.endsWith(n.unitSuffix) && (c = `${c} ${n.unitSuffix}`), c;
42
42
  }
43
- function o(r, i) {
44
- if (!r) return;
45
- let a = (e, t) => t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e);
46
- if (typeof r == "number" || typeof r == "string") return { value: r };
47
- let o = i?.valueField;
48
- if (o && typeof r == "object") {
49
- let e = r, t = a(e, o);
50
- if (t !== void 0) {
51
- let n = i?.previousValueField, o = n ? a(e, n) : void 0, s = o !== void 0 && o !== 0 && Number.isFinite(o) && typeof t == "number" ? (t - o) / o * 100 : void 0, c = r.changePercent, l = o === void 0 ? {} : {
52
- previousValue: o,
53
- changePercent: s ?? (Number.isFinite(c) ? c : void 0)
54
- };
55
- return {
56
- ...r,
57
- value: t,
58
- ...l
59
- };
60
- }
61
- }
62
- if (typeof r == "object" && "value" in r && r.value !== void 0) return r;
63
- let s = [
64
- "value",
65
- "total",
66
- "amount",
67
- "count",
68
- "sum",
69
- "totalSales",
70
- "totalRevenue",
71
- "totalOrders"
72
- ];
73
- for (let e of s) if (typeof r == "object" && e in r) {
74
- let t = r[e];
75
- if (typeof t == "number" || typeof t == "string") return { value: t };
76
- }
77
- if (typeof r == "object" && "summary" in r) {
78
- let e = r.summary;
79
- if (e && typeof e == "object") {
80
- for (let t of s) if (t in e) {
81
- let n = e[t];
82
- if (typeof n == "number" || typeof n == "string") return { value: n };
83
- }
84
- }
85
- }
86
- if (typeof r == "number" || typeof r == "string") return { value: r };
87
- let c = e(r);
88
- if (c) {
89
- let e = i?.valueField;
90
- if (e) {
91
- let t = n(r) ?? [c];
92
- for (let n of t) if (n && typeof n == "object") {
93
- let t = a(n, e);
94
- if (typeof t == "number" || typeof t == "string") return { value: t };
95
- }
96
- return;
97
- }
98
- let o = t(c);
99
- if (o) {
100
- let e = c[o];
101
- if (typeof e == "number" || typeof e == "string") return { value: e };
102
- }
103
- }
43
+ function i(t, n) {
44
+ return e(t, n).data;
104
45
  }
105
- export { a as formatValue, o as normalizeMetricData, i as resolveFormat };
46
+ export { r as formatValue, i as normalizeMetricData, n as resolveFormat };
@@ -6,46 +6,47 @@ import r from "../hooks/useParserOperations.js";
6
6
  import "../hooks/index.js";
7
7
  import { CustomWidgetProposalPanel as i } from "./CustomWidgetProposalPanel.js";
8
8
  import { loadDirectProposalPreview as a } from "./proposalPreview.js";
9
- import { selectActiveProposalSinks as o } from "./proposalSource.js";
10
- import { memo as s, useCallback as c, useMemo as l } from "react";
11
- import { Sheet as u, SheetContent as d, SheetDescription as f, SheetHeader as p, SheetTitle as m } from "@burdenoff/fe-libs/ui";
12
- import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
- import { useApolloClient as g } from "@apollo/client/react";
14
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
9
+ import { mappedFields as o } from "./proposalContract.js";
10
+ import { selectActiveProposalSinks as s } from "./proposalSource.js";
11
+ import { memo as c, useCallback as l, useMemo as u } from "react";
12
+ import { Sheet as d, SheetContent as f, SheetDescription as p, SheetHeader as m, SheetTitle as h } from "@burdenoff/fe-libs/ui";
13
+ import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
+ import { useApolloClient as _ } from "@apollo/client/react";
15
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
16
  // src/bigconsole/customWidget/CustomWidgetBuilderSheet.tsx
16
- var y = {
17
+ var b = {
17
18
  x: 0,
18
19
  y: 0,
19
20
  width: 6,
20
21
  height: 4
21
- }, b = "default", x = s(function({ isOpen: s, onClose: x, dashboardId: S, pageId: C, source: w }) {
22
- let { t: T } = h(), E = g(), { workspaceId: D } = e(), { dataSinks: O } = n({ skipFetch: !s }), { createWidget: k } = t(C, S, { skipFetch: !0 }), A = S === b, { parsers: j, executeParser: M } = r({
23
- consoleId: S,
24
- skipFetch: !s
25
- }), { parsers: N } = r({
26
- consoleId: b,
27
- skipFetch: !s || A
28
- }), P = l(() => o(O), [O]), F = l(() => {
29
- let e = new Set(j.map((e) => e.id));
30
- return [...j, ...N.filter((t) => !e.has(t.id))].map((e) => ({
22
+ }, x = "default", S = c(function({ isOpen: c, onClose: S, dashboardId: C, pageId: w, source: T }) {
23
+ let { t: E } = g(), D = _(), { workspaceId: O } = e(), { dataSinks: k } = n({ skipFetch: !c }), { createWidget: A } = t(w, C, { skipFetch: !0 }), j = C === x, { parsers: M, executeParser: N } = r({
24
+ consoleId: C,
25
+ skipFetch: !c
26
+ }), { parsers: P } = r({
27
+ consoleId: x,
28
+ skipFetch: !c || j
29
+ }), F = u(() => s(k), [k]), I = u(() => {
30
+ let e = new Set(M.map((e) => e.id));
31
+ return [...M, ...P.filter((t) => !e.has(t.id))].map((e) => ({
31
32
  id: e.id,
32
33
  name: e.name,
33
34
  inputSinkKey: e.inputSinkKey
34
35
  }));
35
- }, [j, N]), I = c(async (e) => {
36
- if (!e.binding.parserId) return a(E, e.binding, D);
37
- let t = await M(e.binding.parserId);
38
- if (!t || !t.success) throw Error(t?.error || T("bigconsole.widget.customWidget.error.couldNotResolveBinding", "Could not resolve the binding."));
36
+ }, [M, P]), L = l(async (e) => {
37
+ if (!e.binding.parserId) return a(D, e.binding, O);
38
+ let t = await N(e.binding.parserId);
39
+ if (!t || !t.success) throw Error(t?.error || E("bigconsole.widget.customWidget.error.couldNotResolveBinding", "Could not resolve the binding."));
39
40
  return t.output;
40
41
  }, [
42
+ D,
43
+ N,
41
44
  E,
42
- M,
43
- T,
44
- D
45
- ]), L = c(async (e) => {
46
- if (!await k({
47
- pageId: C,
48
- dashboardId: S,
45
+ O
46
+ ]), R = l(async (e) => {
47
+ if (!await A({
48
+ pageId: w,
49
+ dashboardId: C,
49
50
  type: e.widgetType,
50
51
  title: e.presentation.title,
51
52
  description: e.presentation.description,
@@ -53,23 +54,23 @@ var y = {
53
54
  parserId: e.binding.parserId,
54
55
  config: {
55
56
  ...e.presentation.config,
56
- ...e.fieldMapping,
57
+ ...o(e.fieldMapping),
57
58
  generatedBy: e.generatedBy,
58
59
  sourcePrompt: e.sourcePrompt,
59
60
  proposalVersion: e.version
60
61
  },
61
- position: { ...y }
62
- })) throw Error(T("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
62
+ position: { ...b }
63
+ })) throw Error(E("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
63
64
  }, [
64
- k,
65
+ A,
66
+ w,
65
67
  C,
66
- S,
67
- T
68
+ E
68
69
  ]);
69
- return /* @__PURE__ */ _(u, {
70
- open: s,
71
- onOpenChange: (e) => !e && x(),
72
- children: /* @__PURE__ */ v(d, {
70
+ return /* @__PURE__ */ v(d, {
71
+ open: c,
72
+ onOpenChange: (e) => !e && S(),
73
+ children: /* @__PURE__ */ y(f, {
73
74
  style: {
74
75
  width: "min(480px, 100vw)",
75
76
  maxWidth: "100vw",
@@ -77,29 +78,29 @@ var y = {
77
78
  display: "flex",
78
79
  flexDirection: "column"
79
80
  },
80
- children: [/* @__PURE__ */ v(p, {
81
+ children: [/* @__PURE__ */ y(m, {
81
82
  style: {
82
83
  padding: "var(--space-cardPadding)",
83
84
  borderBottom: "1px solid var(--color-border-subtle)",
84
85
  backgroundColor: "var(--color-bg-surface)",
85
86
  flexShrink: 0
86
87
  },
87
- children: [/* @__PURE__ */ _(m, { children: T("bigconsole.widget.customWidget.sheet.title", "AI custom widget") }), /* @__PURE__ */ _(f, { children: T("bigconsole.widget.customWidget.sheet.description", "Describe a widget, review the proposal, then approve it onto the dashboard.") })]
88
- }), /* @__PURE__ */ _("div", {
88
+ children: [/* @__PURE__ */ v(h, { children: E("bigconsole.widget.customWidget.sheet.title", "AI custom widget") }), /* @__PURE__ */ v(p, { children: E("bigconsole.widget.customWidget.sheet.description", "Describe a widget, review the proposal, then approve it onto the dashboard.") })]
89
+ }), /* @__PURE__ */ v("div", {
89
90
  style: {
90
91
  flex: 1,
91
92
  minHeight: 0
92
93
  },
93
- children: /* @__PURE__ */ _(i, {
94
- sinks: P,
95
- parsers: F,
96
- resolvePreviewData: I,
97
- onApprove: L,
98
- onClose: x,
99
- source: w
94
+ children: /* @__PURE__ */ v(i, {
95
+ sinks: F,
96
+ parsers: I,
97
+ resolvePreviewData: L,
98
+ onApprove: R,
99
+ onClose: S,
100
+ source: T
100
101
  })
101
102
  })]
102
103
  })
103
104
  });
104
105
  });
105
- export { x as CustomWidgetBuilderSheet, x as default };
106
+ export { S as CustomWidgetBuilderSheet, S as default };