@burdenoff/microfe-bigconsole 2026.1119.7 → 2026.1119.8
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/embed/widgets/ChartEmbed.js +70 -66
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.d.ts +21 -0
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.js +90 -44
- package/dist/bigconsole/components/widgets/chart/ChartWidget.js +1 -0
- package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +5 -1
- package/dist/bigconsole/components/widgets/chart/charts/AreaChart.js +4 -1
- package/dist/bigconsole/components/widgets/chart/charts/BarChart.js +53 -45
- package/dist/bigconsole/components/widgets/chart/charts/ComboChart.js +5 -1
- package/dist/bigconsole/components/widgets/chart/charts/LineChart.js +4 -1
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.d.ts +13 -11
- package/dist/bigconsole/components/widgets/chart/charts/referenceElements.js +58 -29
- package/dist/bigconsole/components/widgets/chart/charts/types.d.ts +8 -1
- package/dist/bigconsole/components/widgets/chart/referenceLineDraft.js +26 -23
- package/dist/bigconsole/components/widgets/utils/conditionalFormat.d.ts +41 -0
- package/dist/bigconsole/components/widgets/utils/conditionalFormat.js +80 -44
- package/dist/bigconsole/pages/InsightsPage.js +458 -451
- package/dist/bigconsole/types/index.d.ts +8 -0
- package/dist/bigconsole/utils/pipelineExecutionTimeline.d.ts +13 -1
- package/dist/bigconsole/utils/pipelineExecutionTimeline.js +26 -3
- package/dist/generated/global-operations.d.ts +45 -6
- package/dist/generated/global-types.d.ts +5839 -804
- package/dist/generated/wspace-operations.d.ts +30 -0
- package/dist/generated/wspace-operations.js +28 -0
- package/dist/generated/wspace-types.d.ts +1339 -6
- package/package.json +1 -1
|
@@ -9,10 +9,11 @@ import { WaterfallChart as s } from "../../widgets/chart/charts/WaterfallChart.j
|
|
|
9
9
|
import { ScatterChart as c } from "../../widgets/chart/charts/ScatterChart.js";
|
|
10
10
|
import { EmbedFrame as l } from "./EmbedFrame.js";
|
|
11
11
|
import { asArray as u, asFiniteNumber as d, asOptionalString as f, asRecord as p, asRecordArray as m, safeColor as h } from "./shared.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { parseComparison as g } from "../../widgets/utils/conditionalFormat.js";
|
|
13
|
+
import { useCallback as _, useMemo as v, useState as y } from "react";
|
|
14
|
+
import { jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
14
15
|
// src/bigconsole/components/embed/widgets/ChartEmbed.tsx
|
|
15
|
-
var
|
|
16
|
+
var S = [
|
|
16
17
|
"line",
|
|
17
18
|
"bar",
|
|
18
19
|
"area",
|
|
@@ -21,110 +22,113 @@ var x = [
|
|
|
21
22
|
"combo",
|
|
22
23
|
"waterfall",
|
|
23
24
|
"scatter"
|
|
24
|
-
],
|
|
25
|
+
], C = [
|
|
25
26
|
"monotone",
|
|
26
27
|
"linear",
|
|
27
28
|
"step",
|
|
28
29
|
"stepAfter",
|
|
29
30
|
"stepBefore",
|
|
30
31
|
"natural"
|
|
31
|
-
],
|
|
32
|
+
], w = [
|
|
32
33
|
"top",
|
|
33
34
|
"bottom",
|
|
34
35
|
"left",
|
|
35
36
|
"right"
|
|
36
|
-
],
|
|
37
|
+
], T = [
|
|
37
38
|
"success",
|
|
38
39
|
"warning",
|
|
39
40
|
"danger",
|
|
40
41
|
"info",
|
|
41
42
|
"neutral"
|
|
42
|
-
],
|
|
43
|
+
], E = [
|
|
43
44
|
"var(--color-chart-1)",
|
|
44
45
|
"var(--color-chart-2)",
|
|
45
46
|
"var(--color-chart-3)",
|
|
46
47
|
"var(--color-chart-4)",
|
|
47
48
|
"var(--color-chart-5)"
|
|
48
|
-
],
|
|
49
|
-
function
|
|
49
|
+
], D = 1e3, O = 20;
|
|
50
|
+
function k(e, t) {
|
|
50
51
|
return typeof e == "string" && t.includes(e) ? e : void 0;
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function A(e) {
|
|
53
54
|
return typeof e == "boolean" ? e : void 0;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function j(e) {
|
|
56
57
|
return typeof e == "string" && e.length > 0 && e.length <= 128 ? e : void 0;
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let n = typeof e.chartType == "string" ? e.chartType.toLowerCase() : "", r = n === "doughnut" || n === "donut", i = t ? "funnel" : r ? "pie" :
|
|
60
|
-
if (Array.isArray(s)) for (let e of s.slice(0,
|
|
61
|
-
let t = p(e), n =
|
|
59
|
+
function M(e, t) {
|
|
60
|
+
let n = typeof e.chartType == "string" ? e.chartType.toLowerCase() : "", r = n === "doughnut" || n === "donut", i = t ? "funnel" : r ? "pie" : k(n, S) ?? "line", a = u(e.colors).map(h).filter((e) => !!e).slice(0, 12), o = {}, s = e.seriesLabels;
|
|
61
|
+
if (Array.isArray(s)) for (let e of s.slice(0, O)) {
|
|
62
|
+
let t = p(e), n = j(t.key ?? t.field), r = f(t.label, 80);
|
|
62
63
|
n && r && (o[n] = r);
|
|
63
64
|
}
|
|
64
|
-
else for (let [e, t] of Object.entries(p(s)).slice(0,
|
|
65
|
+
else for (let [e, t] of Object.entries(p(s)).slice(0, O)) j(e) && typeof t == "string" && (o[e] = t.slice(0, 80));
|
|
65
66
|
let c = m(e.referenceLines, 10).map((e) => {
|
|
66
67
|
let t = d(e.value);
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
if (t === null) return null;
|
|
69
|
+
let n = g(e.relativeTo);
|
|
70
|
+
return n === null ? null : {
|
|
71
|
+
relativeTo: n,
|
|
72
|
+
axis: k(e.axis, ["x", "y"]),
|
|
69
73
|
value: t,
|
|
70
74
|
value2: d(e.value2) ?? void 0,
|
|
71
75
|
label: f(e.label, 80),
|
|
72
|
-
color:
|
|
73
|
-
dashed:
|
|
76
|
+
color: k(e.color, T),
|
|
77
|
+
dashed: A(e.dashed)
|
|
74
78
|
};
|
|
75
|
-
}).filter((e) => e !== null), l = m(e.series,
|
|
76
|
-
let t =
|
|
79
|
+
}).filter((e) => e !== null), l = m(e.series, O).map((e) => {
|
|
80
|
+
let t = j(e.field);
|
|
77
81
|
return t ? {
|
|
78
82
|
field: t,
|
|
79
83
|
label: f(e.label, 80),
|
|
80
|
-
type:
|
|
81
|
-
axis:
|
|
84
|
+
type: k(e.type, ["bar", "line"]),
|
|
85
|
+
axis: k(e.axis, ["left", "right"]),
|
|
82
86
|
color: h(e.color)
|
|
83
87
|
} : null;
|
|
84
88
|
}).filter((e) => e !== null);
|
|
85
89
|
return {
|
|
86
90
|
type: i,
|
|
87
|
-
xAxisKey:
|
|
91
|
+
xAxisKey: j(e.xAxisField) ?? "name",
|
|
88
92
|
xAxisLabel: f(e.xAxisLabel, 80),
|
|
89
93
|
yAxisLabel: f(e.yAxisLabel, 80),
|
|
90
94
|
yAxisRightLabel: f(e.yAxisRightLabel, 80),
|
|
91
|
-
showGrid:
|
|
92
|
-
showLegend:
|
|
93
|
-
legendPosition:
|
|
94
|
-
showDots:
|
|
95
|
-
curveType:
|
|
95
|
+
showGrid: A(e.showGrid),
|
|
96
|
+
showLegend: A(e.showLegend),
|
|
97
|
+
legendPosition: k(e.legendPosition, w),
|
|
98
|
+
showDots: A(e.showDataPoints),
|
|
99
|
+
curveType: k(e.curveType, C),
|
|
96
100
|
colors: a.length > 0 ? a : void 0,
|
|
97
101
|
seriesNames: Object.keys(o).length > 0 ? o : void 0,
|
|
98
|
-
stacked:
|
|
99
|
-
isDonut: r ||
|
|
102
|
+
stacked: A(e.stacked),
|
|
103
|
+
isDonut: r || A(e.showAsDonut),
|
|
100
104
|
innerRadius: d(e.innerRadius) ?? void 0,
|
|
101
105
|
outerRadius: d(e.outerRadius) ?? void 0,
|
|
102
106
|
referenceLines: c.length > 0 ? c : void 0,
|
|
103
107
|
series: l.length > 0 ? l : void 0,
|
|
104
|
-
dualAxis:
|
|
105
|
-
logScale:
|
|
106
|
-
startAtZero:
|
|
108
|
+
dualAxis: A(e.dualAxis),
|
|
109
|
+
logScale: A(e.logScale),
|
|
110
|
+
startAtZero: A(e.startAtZero),
|
|
107
111
|
yMin: d(e.yMin) ?? void 0,
|
|
108
112
|
yMax: d(e.yMax) ?? void 0,
|
|
109
|
-
valueField:
|
|
110
|
-
labelField:
|
|
111
|
-
showTotal:
|
|
113
|
+
valueField: j(e.valueField),
|
|
114
|
+
labelField: j(e.labelField),
|
|
115
|
+
showTotal: A(e.showTotal),
|
|
112
116
|
totalLabel: f(e.totalLabel, 80),
|
|
113
|
-
xField:
|
|
114
|
-
yField:
|
|
115
|
-
sizeField:
|
|
116
|
-
colorField:
|
|
117
|
+
xField: j(e.xField),
|
|
118
|
+
yField: j(e.yField),
|
|
119
|
+
sizeField: j(e.sizeField),
|
|
120
|
+
colorField: j(e.colorField)
|
|
117
121
|
};
|
|
118
122
|
}
|
|
119
|
-
function
|
|
120
|
-
return m(p(e).rows,
|
|
123
|
+
function N(e) {
|
|
124
|
+
return m(p(e).rows, D).map((e) => {
|
|
121
125
|
let t = {};
|
|
122
126
|
for (let [n, r] of Object.entries(e).slice(0, 24)) typeof r == "string" ? t[n] = r.slice(0, 200) : typeof r == "number" && Number.isFinite(r) && (t[n] = r);
|
|
123
127
|
return t;
|
|
124
128
|
});
|
|
125
129
|
}
|
|
126
|
-
function
|
|
127
|
-
let f = d.config, p =
|
|
130
|
+
function P({ widget: d }) {
|
|
131
|
+
let f = d.config, p = v(() => M(f, d.type === "funnel_chart"), [f, d.type]), m = v(() => N(d.data), [d.data]), [h, g] = y([]), S = v(() => u(f.selectedFields).map(j).filter((e) => !!e), [f.selectedFields]), C = v(() => {
|
|
128
132
|
let e = m[0];
|
|
129
133
|
return !e || [
|
|
130
134
|
"pie",
|
|
@@ -137,7 +141,7 @@ function N({ widget: d }) {
|
|
|
137
141
|
}).map((e, t) => ({
|
|
138
142
|
dataKey: e,
|
|
139
143
|
name: p.seriesNames?.[e] || e,
|
|
140
|
-
color: p.colors?.[t] ||
|
|
144
|
+
color: p.colors?.[t] || E[t % E.length],
|
|
141
145
|
hidden: h.includes(e)
|
|
142
146
|
}));
|
|
143
147
|
}, [
|
|
@@ -145,75 +149,75 @@ function N({ widget: d }) {
|
|
|
145
149
|
p,
|
|
146
150
|
h,
|
|
147
151
|
S
|
|
148
|
-
]), w =
|
|
149
|
-
|
|
152
|
+
]), w = _((e) => {
|
|
153
|
+
g((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
150
154
|
}, []);
|
|
151
|
-
if (m.length === 0) return /* @__PURE__ */
|
|
155
|
+
if (m.length === 0) return /* @__PURE__ */ b(l, {
|
|
152
156
|
title: d.title,
|
|
153
|
-
children: /* @__PURE__ */
|
|
157
|
+
children: /* @__PURE__ */ b("div", {
|
|
154
158
|
className: "flex h-full w-full items-center justify-center p-4 text-sm text-text-tertiary",
|
|
155
159
|
children: "No data"
|
|
156
160
|
})
|
|
157
161
|
});
|
|
158
|
-
let
|
|
159
|
-
if (
|
|
162
|
+
let T = p.type === "combo" || p.dualAxis === !0 || ((p.series?.some((e) => e.axis === "right" || e.type === "bar") && p.series?.some((e) => e.type === "line")) ?? !1), D = (() => {
|
|
163
|
+
if (T) return /* @__PURE__ */ b(o, {
|
|
160
164
|
data: m,
|
|
161
165
|
config: p,
|
|
162
166
|
hiddenSeries: h
|
|
163
167
|
});
|
|
164
168
|
switch (p.type) {
|
|
165
|
-
case "waterfall": return /* @__PURE__ */
|
|
169
|
+
case "waterfall": return /* @__PURE__ */ b(s, {
|
|
166
170
|
data: m,
|
|
167
171
|
config: p
|
|
168
172
|
});
|
|
169
|
-
case "scatter": return /* @__PURE__ */
|
|
173
|
+
case "scatter": return /* @__PURE__ */ b(c, {
|
|
170
174
|
data: m,
|
|
171
175
|
config: p
|
|
172
176
|
});
|
|
173
|
-
case "bar": return /* @__PURE__ */
|
|
177
|
+
case "bar": return /* @__PURE__ */ b(n, {
|
|
174
178
|
data: m,
|
|
175
179
|
config: p,
|
|
176
180
|
hiddenSeries: h
|
|
177
181
|
});
|
|
178
|
-
case "area": return /* @__PURE__ */
|
|
182
|
+
case "area": return /* @__PURE__ */ b(r, {
|
|
179
183
|
data: m,
|
|
180
184
|
config: p,
|
|
181
185
|
hiddenSeries: h
|
|
182
186
|
});
|
|
183
|
-
case "pie": return /* @__PURE__ */
|
|
187
|
+
case "pie": return /* @__PURE__ */ b(i, {
|
|
184
188
|
data: m,
|
|
185
189
|
config: p,
|
|
186
190
|
dataKey: p.valueField || "value",
|
|
187
191
|
nameKey: p.labelField || "name"
|
|
188
192
|
});
|
|
189
|
-
case "funnel": return /* @__PURE__ */
|
|
193
|
+
case "funnel": return /* @__PURE__ */ b(a, {
|
|
190
194
|
data: m,
|
|
191
195
|
config: p,
|
|
192
196
|
dataKey: p.valueField || "value",
|
|
193
197
|
nameKey: p.labelField || "name"
|
|
194
198
|
});
|
|
195
|
-
default: return /* @__PURE__ */
|
|
199
|
+
default: return /* @__PURE__ */ b(t, {
|
|
196
200
|
data: m,
|
|
197
201
|
config: p,
|
|
198
202
|
hiddenSeries: h
|
|
199
203
|
});
|
|
200
204
|
}
|
|
201
205
|
})(), O = p.showLegend !== !1 && C.length > 0;
|
|
202
|
-
return /* @__PURE__ */
|
|
206
|
+
return /* @__PURE__ */ b(l, {
|
|
203
207
|
title: d.title,
|
|
204
|
-
children: /* @__PURE__ */
|
|
208
|
+
children: /* @__PURE__ */ x("div", {
|
|
205
209
|
className: "flex h-full w-full flex-col p-4",
|
|
206
210
|
children: [
|
|
207
|
-
O && p.legendPosition === "top" && /* @__PURE__ */
|
|
211
|
+
O && p.legendPosition === "top" && /* @__PURE__ */ b(e, {
|
|
208
212
|
items: C,
|
|
209
213
|
position: "top",
|
|
210
214
|
onItemClick: w
|
|
211
215
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ b("div", {
|
|
213
217
|
className: "min-h-0 flex-1",
|
|
214
218
|
children: D
|
|
215
219
|
}),
|
|
216
|
-
O && p.legendPosition === "bottom" && /* @__PURE__ */
|
|
220
|
+
O && p.legendPosition === "bottom" && /* @__PURE__ */ b(e, {
|
|
217
221
|
items: C,
|
|
218
222
|
position: "bottom",
|
|
219
223
|
onItemClick: w
|
|
@@ -222,4 +226,4 @@ function N({ widget: d }) {
|
|
|
222
226
|
})
|
|
223
227
|
});
|
|
224
228
|
}
|
|
225
|
-
export {
|
|
229
|
+
export { P as ChartEmbed, P as default, M as toEmbedChartConfig, N as toEmbedChartRows };
|
|
@@ -1,8 +1,29 @@
|
|
|
1
|
+
import { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';
|
|
2
|
+
type Translate = ReturnType<typeof useI18n>['t'];
|
|
1
3
|
/** Legacy enablement-only metadata never establishes which provider produced a draft. */
|
|
2
4
|
export declare function GenerationExecutionStatus({ metadata }: {
|
|
3
5
|
metadata?: Record<string, unknown> | null;
|
|
4
6
|
}): import('react').JSX.Element;
|
|
7
|
+
export declare function ruleText(value: unknown, t: Translate): string;
|
|
8
|
+
/** One reference line or band as review text; relative lines name their base field. */
|
|
9
|
+
export declare function referenceLineText(value: unknown, t: Translate): string;
|
|
10
|
+
export interface GeneratedSpecWarning {
|
|
11
|
+
code: string;
|
|
12
|
+
message: string;
|
|
13
|
+
threshold?: number | null;
|
|
14
|
+
reference?: string | null;
|
|
15
|
+
}
|
|
16
|
+
/** Translated text for a server warning; an unknown code falls back to the server's English message. */
|
|
17
|
+
export declare function warningText(warning: GeneratedSpecWarning, t: Translate): string;
|
|
18
|
+
/**
|
|
19
|
+
* Requests the draft could not express (BOFF-10145). Shown above the widget
|
|
20
|
+
* list so a missing "over budget by 10%" rule is not mistaken for an applied one.
|
|
21
|
+
*/
|
|
22
|
+
export declare function GeneratedSpecWarnings({ warnings }: {
|
|
23
|
+
warnings?: GeneratedSpecWarning[] | null;
|
|
24
|
+
}): import('react').JSX.Element | null;
|
|
5
25
|
/** Read-only proposal details; creation and server validation retain their existing owners. */
|
|
6
26
|
export declare function GeneratedFormattingReview({ config }: {
|
|
7
27
|
config?: Record<string, unknown> | null;
|
|
8
28
|
}): import('react').JSX.Element | null;
|
|
29
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { parseComparison as e } from "../widgets/utils/conditionalFormat.js";
|
|
2
|
+
import { useI18n as t } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
4
|
// src/bigconsole/components/insights/GeneratedFormattingReview.tsx
|
|
4
|
-
var
|
|
5
|
+
var i = {
|
|
5
6
|
gt: ">",
|
|
6
7
|
gte: "≥",
|
|
7
8
|
lt: "<",
|
|
@@ -16,14 +17,14 @@ var r = {
|
|
|
16
17
|
endsWith: "ends with",
|
|
17
18
|
isEmpty: "is empty",
|
|
18
19
|
isNotEmpty: "is not empty"
|
|
19
|
-
},
|
|
20
|
+
}, a = {
|
|
20
21
|
textColor: "Text color",
|
|
21
22
|
bgColor: "Background",
|
|
22
23
|
bold: "Bold",
|
|
23
24
|
icon: "Icon",
|
|
24
25
|
dataBar: "Data bar",
|
|
25
26
|
dataBarColor: "Data bar color"
|
|
26
|
-
},
|
|
27
|
+
}, o = {
|
|
27
28
|
xAxisField: "Horizontal field",
|
|
28
29
|
xAxisLabel: "Horizontal label",
|
|
29
30
|
yAxisLabel: "Vertical label",
|
|
@@ -31,79 +32,124 @@ var r = {
|
|
|
31
32
|
dualAxis: "Two vertical axes",
|
|
32
33
|
logScale: "Logarithmic scale"
|
|
33
34
|
};
|
|
34
|
-
function
|
|
35
|
+
function s(e) {
|
|
35
36
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
let { t:
|
|
39
|
-
return
|
|
38
|
+
function c({ metadata: e }) {
|
|
39
|
+
let { t: n } = t(), i = n("bigconsole.insights.preview.sourceUnknown", "Source unverified");
|
|
40
|
+
return e?.executionReceiptVersion === 1 && typeof e.fallbackUsed == "boolean" && (e.executionPath === "llm" && e.provider === "openai" && e.fallbackUsed === !1 && typeof e.model == "string" && e.model.trim().length > 0 && e.model.length <= 128 && e.model !== "heuristic-v1" ? i = n("bigconsole.insights.preview.sourceModel", "Model draft") : e.provider === "local" && e.model === "heuristic-v1" && (e.executionPath === "heuristic" && (i = e.fallbackUsed ? n("bigconsole.insights.preview.sourceFallback", "Heuristic draft after provider fallback") : n("bigconsole.insights.preview.sourceHeuristic", "Heuristic draft")), e.executionPath === "local-refinement" && (i = e.fallbackUsed ? n("bigconsole.insights.preview.sourceRefinementFallback", "Local refinement after provider fallback") : n("bigconsole.insights.preview.sourceRefinement", "Local refinement")))), /* @__PURE__ */ r("p", {
|
|
40
41
|
"data-testid": "preview-generation-source",
|
|
41
42
|
children: [
|
|
42
|
-
|
|
43
|
+
n("bigconsole.insights.preview.sourceLabel", "Generation source"),
|
|
43
44
|
": ",
|
|
44
45
|
i
|
|
45
46
|
]
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function l(e) {
|
|
49
50
|
return typeof e == "string" ? e.slice(0, 128) : typeof e == "number" && Number.isFinite(e) || typeof e == "boolean" ? String(e) : "—";
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
function u(e, t, n) {
|
|
53
|
+
let r = {
|
|
54
|
+
field: l(e),
|
|
55
|
+
base: l(t.field)
|
|
56
|
+
};
|
|
57
|
+
return t.mode === "percentChange" ? n("bigconsole.insights.preview.percentChangeFrom", "{{field}} % change from {{base}}", r) : n("bigconsole.insights.preview.differenceFrom", "{{field}} minus {{base}}", r);
|
|
58
|
+
}
|
|
59
|
+
function d(e, t, n) {
|
|
60
|
+
let r = {
|
|
61
|
+
base: l(t.field),
|
|
62
|
+
value: l(e)
|
|
63
|
+
};
|
|
64
|
+
return t.mode === "percentChange" ? n("bigconsole.insights.preview.relativePercentLine", "{{base}} + {{value}}% per category", r) : n("bigconsole.insights.preview.relativeDifferenceLine", "{{base}} + {{value}} per category", r);
|
|
65
|
+
}
|
|
66
|
+
function f(t, n) {
|
|
67
|
+
let r = s(t);
|
|
68
|
+
if (!r || typeof r.operator != "string" || !Object.hasOwn(i, r.operator)) return "Unrecognized rule; refine the draft before approval.";
|
|
69
|
+
let o = e(r.compareTo);
|
|
70
|
+
if (o === null) return "Unrecognized rule; refine the draft before approval.";
|
|
71
|
+
let c = r.operator === "isEmpty" || r.operator === "isNotEmpty" ? "" : r.operator === "between" || r.operator === "outside" ? `${l(r.value)} and ${l(r.value2)}` : r.valueType === "field" && typeof r.fieldRef == "string" ? l(r.fieldRef) : l(r.value), d = s(r.style), f = d ? [
|
|
55
72
|
"textColor",
|
|
56
73
|
"bgColor",
|
|
57
74
|
"bold",
|
|
58
75
|
"icon",
|
|
59
76
|
"dataBar",
|
|
60
77
|
"dataBarColor"
|
|
61
|
-
].filter((e) =>
|
|
62
|
-
return `${
|
|
78
|
+
].filter((e) => d[e] !== void 0).map((e) => `${a[e]}: ${l(d[e])}`).join(", ") : "";
|
|
79
|
+
return `${o ? u(r.field, o, n) : r.field === void 0 ? "This value" : l(r.field)} ${i[r.operator]} ${c} → ${f || "No supported style"}`;
|
|
80
|
+
}
|
|
81
|
+
function p(t, n) {
|
|
82
|
+
let r = s(t);
|
|
83
|
+
if (!r) return "Unrecognized reference; refine the draft before approval.";
|
|
84
|
+
let i = e(r.relativeTo);
|
|
85
|
+
return i === null ? "Unrecognized reference; refine the draft before approval." : `${i ? `${l(r.axis ?? "y")} = ${d(r.value, i, n)}` : `${l(r.axis ?? "y")} = ${l(r.value)}${r.value2 === void 0 ? "" : ` to ${l(r.value2)}`}`} · ${l(r.color ?? "neutral")}${r.label === void 0 ? "" : ` · ${l(r.label)}`}`;
|
|
86
|
+
}
|
|
87
|
+
function m(e, t) {
|
|
88
|
+
return e.code === "RELATIVE_RULE_NOT_EXPRESSED" && typeof e.threshold == "number" && typeof e.reference == "string" ? t("bigconsole.insights.preview.warning.relativeRuleNotExpressed", "The request asks to flag values {{threshold}}% relative to {{reference}}, but no widget compares them with {{reference}} as a percentage, so this draft does not apply that rule. Refine the draft or add the rule before creating the dashboard.", {
|
|
89
|
+
threshold: e.threshold,
|
|
90
|
+
reference: e.reference
|
|
91
|
+
}) : e.message;
|
|
92
|
+
}
|
|
93
|
+
function h({ warnings: e }) {
|
|
94
|
+
let { t: i } = t();
|
|
95
|
+
return e?.length ? /* @__PURE__ */ r("section", {
|
|
96
|
+
role: "status",
|
|
97
|
+
"aria-label": i("bigconsole.insights.preview.warningsTitle", "Not applied in this draft"),
|
|
98
|
+
"data-testid": "preview-generation-warnings",
|
|
99
|
+
style: {
|
|
100
|
+
minWidth: 0,
|
|
101
|
+
overflowWrap: "anywhere",
|
|
102
|
+
fontSize: "var(--font-size-body-sm)",
|
|
103
|
+
borderLeft: "4px solid var(--color-status-warning-border)",
|
|
104
|
+
paddingLeft: "var(--space-controlGap)",
|
|
105
|
+
color: "var(--color-text-primary)"
|
|
106
|
+
},
|
|
107
|
+
children: [/* @__PURE__ */ n("h4", {
|
|
108
|
+
style: { color: "var(--color-status-warning-text)" },
|
|
109
|
+
children: i("bigconsole.insights.preview.warningsTitle", "Not applied in this draft")
|
|
110
|
+
}), /* @__PURE__ */ n("ul", { children: e.map((e, t) => /* @__PURE__ */ n("li", { children: m(e, i) }, t)) })]
|
|
111
|
+
}) : null;
|
|
63
112
|
}
|
|
64
|
-
function
|
|
65
|
-
let { t: i } =
|
|
66
|
-
if (!
|
|
67
|
-
let
|
|
113
|
+
function g({ config: e }) {
|
|
114
|
+
let { t: i } = t();
|
|
115
|
+
if (!e) return null;
|
|
116
|
+
let a = [], c = (e, t) => {
|
|
68
117
|
if (t === void 0) return;
|
|
69
|
-
let n = Array.isArray(t) ? t.slice(0, 32).map(
|
|
70
|
-
Array.isArray(t) && t.length > 32 && n.push("More than 32 rules; refine the draft before approval."), n.length &&
|
|
118
|
+
let n = Array.isArray(t) ? t.slice(0, 32).map((e) => f(e, i)) : ["Unrecognized rule list; refine the draft before approval."];
|
|
119
|
+
Array.isArray(t) && t.length > 32 && n.push("More than 32 rules; refine the draft before approval."), n.length && a.push({
|
|
71
120
|
label: e,
|
|
72
121
|
values: n
|
|
73
122
|
});
|
|
74
123
|
};
|
|
75
|
-
if (
|
|
76
|
-
for (let
|
|
77
|
-
let
|
|
78
|
-
|
|
124
|
+
if (c(i("bigconsole.insights.preview.tableRules", "Widget formatting"), e.conditionalRules), c(i("bigconsole.insights.preview.rowRules", "Whole-row formatting"), e.rowRules), Array.isArray(e.columns)) {
|
|
125
|
+
for (let t of e.columns.slice(0, 64)) {
|
|
126
|
+
let e = s(t);
|
|
127
|
+
e && c(`${i("bigconsole.insights.preview.columnRules", "Column")}: ${l(e.key ?? e.field)}`, e.conditionalRules);
|
|
79
128
|
}
|
|
80
|
-
|
|
129
|
+
e.columns.length > 64 && a.push({
|
|
81
130
|
label: i("bigconsole.insights.preview.columnRules", "Column"),
|
|
82
131
|
values: [i("bigconsole.insights.preview.columnLimit", "Only the first 64 columns are shown. Review the remaining columns before approval.")]
|
|
83
132
|
});
|
|
84
133
|
}
|
|
85
|
-
if (
|
|
86
|
-
let
|
|
87
|
-
|
|
88
|
-
return t ? `${c(t.axis ?? "y")} = ${c(t.value)}${t.value2 === void 0 ? "" : ` to ${c(t.value2)}`} · ${c(t.color ?? "neutral")}${t.label === void 0 ? "" : ` · ${c(t.label)}`}` : "Unrecognized reference; refine the draft before approval.";
|
|
89
|
-
}) : ["Unrecognized references; refine the draft before approval."];
|
|
90
|
-
Array.isArray(r.referenceLines) && r.referenceLines.length > 32 && e.push("More than 32 references; refine the draft before approval."), e.length && s.push({
|
|
134
|
+
if (e.referenceLines !== void 0) {
|
|
135
|
+
let t = Array.isArray(e.referenceLines) ? e.referenceLines.slice(0, 32).map((e) => p(e, i)) : ["Unrecognized references; refine the draft before approval."];
|
|
136
|
+
Array.isArray(e.referenceLines) && e.referenceLines.length > 32 && t.push("More than 32 references; refine the draft before approval."), t.length && a.push({
|
|
91
137
|
label: i("bigconsole.insights.preview.references", "Chart references"),
|
|
92
|
-
values:
|
|
138
|
+
values: t
|
|
93
139
|
});
|
|
94
140
|
}
|
|
95
|
-
let
|
|
141
|
+
let u = [
|
|
96
142
|
"xAxisField",
|
|
97
143
|
"xAxisLabel",
|
|
98
144
|
"yAxisLabel",
|
|
99
145
|
"yAxisRightLabel",
|
|
100
146
|
"dualAxis",
|
|
101
147
|
"logScale"
|
|
102
|
-
].filter((
|
|
103
|
-
return
|
|
148
|
+
].filter((t) => e[t] !== void 0).map((t) => `${o[t]}: ${l(e[t])}`);
|
|
149
|
+
return u.length && a.push({
|
|
104
150
|
label: i("bigconsole.insights.preview.axes", "Chart axes"),
|
|
105
|
-
values:
|
|
106
|
-
}),
|
|
151
|
+
values: u
|
|
152
|
+
}), a.length ? /* @__PURE__ */ r("section", {
|
|
107
153
|
"aria-label": i("bigconsole.insights.preview.formatting", "Formatting to review"),
|
|
108
154
|
"data-testid": "preview-formatting-rules",
|
|
109
155
|
style: {
|
|
@@ -112,10 +158,10 @@ function u({ config: r }) {
|
|
|
112
158
|
fontSize: "var(--font-size-body-sm)"
|
|
113
159
|
},
|
|
114
160
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
|
|
161
|
+
/* @__PURE__ */ n("h4", { children: i("bigconsole.insights.preview.formatting", "Formatting to review") }),
|
|
162
|
+
/* @__PURE__ */ n("p", { children: i("bigconsole.insights.preview.formattingHint", "Check the field, comparison and styling before creating the dashboard. > excludes the exact threshold; ≥ includes it.") }),
|
|
163
|
+
a.map((e, t) => /* @__PURE__ */ r("div", { children: [/* @__PURE__ */ n("strong", { children: e.label }), /* @__PURE__ */ n("ul", { children: e.values.map((e, t) => /* @__PURE__ */ n("li", { children: e }, t)) })] }, t))
|
|
118
164
|
]
|
|
119
165
|
}) : null;
|
|
120
166
|
}
|
|
121
|
-
export {
|
|
167
|
+
export { g as GeneratedFormattingReview, h as GeneratedSpecWarnings, c as GenerationExecutionStatus, p as referenceLineText, f as ruleText, m as warningText };
|
|
@@ -51,7 +51,11 @@ var m = a(function({ lines: n, onChange: a }) {
|
|
|
51
51
|
children: [
|
|
52
52
|
/* @__PURE__ */ d("legend", {
|
|
53
53
|
className: "px-1 text-xs font-medium text-text-secondary",
|
|
54
|
-
children: [
|
|
54
|
+
children: [
|
|
55
|
+
s("bigconsole.widget.config.chart.referenceLines.itemLegend", "Line {{number}}", { number: l }),
|
|
56
|
+
t.axis === "x" ? ` · ${s("bigconsole.widget.config.chart.referenceLines.xAxis", "X axis")}` : "",
|
|
57
|
+
t.relativeTo ? ` · ${t.relativeTo.mode === "percentChange" ? s("bigconsole.widget.config.chart.referenceLines.relativePercent", "% from {{field}}", { field: t.relativeTo.field }) : s("bigconsole.widget.config.chart.referenceLines.relativeDifference", "Difference from {{field}}", { field: t.relativeTo.field })}` : ""
|
|
58
|
+
]
|
|
55
59
|
}),
|
|
56
60
|
/* @__PURE__ */ d("div", {
|
|
57
61
|
className: "grid grid-cols-1 gap-2 sm:grid-cols-2",
|