@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.
- package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.d.ts +15 -0
- package/dist/bigconsole/components/widgets/FilterNotAppliedNotice.js +62 -0
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +353 -351
- package/dist/bigconsole/components/widgets/chart/ChartWidget.js +131 -126
- package/dist/bigconsole/components/widgets/chart/chartRows.d.ts +16 -0
- package/dist/bigconsole/components/widgets/chart/chartRows.js +33 -1
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.d.ts +2 -20
- package/dist/bigconsole/components/widgets/metric-card/MetricCardWidget.js +4 -3
- package/dist/bigconsole/components/widgets/metric-card/metricCardData.d.ts +48 -0
- package/dist/bigconsole/components/widgets/metric-card/metricCardData.js +96 -0
- package/dist/bigconsole/components/widgets/metric-card/metricData.d.ts +9 -2
- package/dist/bigconsole/components/widgets/metric-card/metricData.js +10 -69
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
- package/dist/bigconsole/customWidget/index.d.ts +2 -1
- package/dist/bigconsole/customWidget/index.js +1 -0
- package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
- package/dist/bigconsole/customWidget/proposalContract.js +37 -14
- package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
- package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
- package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
- package/dist/bigconsole/customWidget/proposalSource.js +197 -51
- package/dist/bigconsole/hooks/useParserOperations.js +80 -74
- package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
- package/dist/bigconsole/store/parserScope.d.ts +24 -0
- package/dist/bigconsole/store/parserScope.js +17 -0
- package/dist/bigconsole/store/parserStore.d.ts +3 -0
- package/dist/bigconsole/store/parserStore.js +70 -68
- package/dist/bigconsole/utils/applyGlobalFilters.d.ts +3 -1
- package/dist/bigconsole/utils/applyGlobalFilters.js +53 -4
- package/dist/bigconsole/utils/globalFilterMatching.d.ts +21 -3
- package/dist/bigconsole/utils/globalFilterMatching.js +14 -9
- package/dist/generated/wspace-operations.d.ts +10 -0
- package/dist/generated/wspace-operations.js +180 -110
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { resolveMetricCardData as e } from "./metricCardData.js";
|
|
2
2
|
// src/bigconsole/components/widgets/metric-card/metricData.ts
|
|
3
|
-
function
|
|
3
|
+
function t(e) {
|
|
4
4
|
return e !== void 0 && /^[a-z]{3}$/i.test(e) ? e.toUpperCase() : void 0;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
let
|
|
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:
|
|
11
|
-
unitSuffix: i === "currency" || e?.suffix ? void 0 :
|
|
10
|
+
currency: t(n?.unit) ?? "USD",
|
|
11
|
+
unitSuffix: i === "currency" || e?.suffix ? void 0 : n?.unit
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
function
|
|
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
|
|
44
|
-
|
|
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 {
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
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
|
|
17
|
+
var b = {
|
|
17
18
|
x: 0,
|
|
18
19
|
y: 0,
|
|
19
20
|
width: 6,
|
|
20
21
|
height: 4
|
|
21
|
-
},
|
|
22
|
-
let { t:
|
|
23
|
-
consoleId:
|
|
24
|
-
skipFetch: !
|
|
25
|
-
}), { parsers:
|
|
26
|
-
consoleId:
|
|
27
|
-
skipFetch: !
|
|
28
|
-
}),
|
|
29
|
-
let e = new Set(
|
|
30
|
-
return [...
|
|
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
|
-
}, [
|
|
36
|
-
if (!e.binding.parserId) return a(
|
|
37
|
-
let t = await
|
|
38
|
-
if (!t || !t.success) throw Error(t?.error ||
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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: { ...
|
|
62
|
-
})) throw Error(
|
|
62
|
+
position: { ...b }
|
|
63
|
+
})) throw Error(E("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
|
|
63
64
|
}, [
|
|
64
|
-
|
|
65
|
+
A,
|
|
66
|
+
w,
|
|
65
67
|
C,
|
|
66
|
-
|
|
67
|
-
T
|
|
68
|
+
E
|
|
68
69
|
]);
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
open:
|
|
71
|
-
onOpenChange: (e) => !e &&
|
|
72
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
88
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
94
|
-
sinks:
|
|
95
|
-
parsers:
|
|
96
|
-
resolvePreviewData:
|
|
97
|
-
onApprove:
|
|
98
|
-
onClose:
|
|
99
|
-
source:
|
|
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 {
|
|
106
|
+
export { S as CustomWidgetBuilderSheet, S as default };
|