@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.
Files changed (25) hide show
  1. package/dist/bigconsole/components/embed/widgets/ChartEmbed.js +70 -66
  2. package/dist/bigconsole/components/insights/GeneratedFormattingReview.d.ts +21 -0
  3. package/dist/bigconsole/components/insights/GeneratedFormattingReview.js +90 -44
  4. package/dist/bigconsole/components/widgets/chart/ChartWidget.js +1 -0
  5. package/dist/bigconsole/components/widgets/chart/ReferenceLinesEditor.js +5 -1
  6. package/dist/bigconsole/components/widgets/chart/charts/AreaChart.js +4 -1
  7. package/dist/bigconsole/components/widgets/chart/charts/BarChart.js +53 -45
  8. package/dist/bigconsole/components/widgets/chart/charts/ComboChart.js +5 -1
  9. package/dist/bigconsole/components/widgets/chart/charts/LineChart.js +4 -1
  10. package/dist/bigconsole/components/widgets/chart/charts/referenceElements.d.ts +13 -11
  11. package/dist/bigconsole/components/widgets/chart/charts/referenceElements.js +58 -29
  12. package/dist/bigconsole/components/widgets/chart/charts/types.d.ts +8 -1
  13. package/dist/bigconsole/components/widgets/chart/referenceLineDraft.js +26 -23
  14. package/dist/bigconsole/components/widgets/utils/conditionalFormat.d.ts +41 -0
  15. package/dist/bigconsole/components/widgets/utils/conditionalFormat.js +80 -44
  16. package/dist/bigconsole/pages/InsightsPage.js +458 -451
  17. package/dist/bigconsole/types/index.d.ts +8 -0
  18. package/dist/bigconsole/utils/pipelineExecutionTimeline.d.ts +13 -1
  19. package/dist/bigconsole/utils/pipelineExecutionTimeline.js +26 -3
  20. package/dist/generated/global-operations.d.ts +45 -6
  21. package/dist/generated/global-types.d.ts +5839 -804
  22. package/dist/generated/wspace-operations.d.ts +30 -0
  23. package/dist/generated/wspace-operations.js +28 -0
  24. package/dist/generated/wspace-types.d.ts +1339 -6
  25. 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 { useCallback as g, useMemo as _, useState as v } from "react";
13
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
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 x = [
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
- ], S = [
25
+ ], C = [
25
26
  "monotone",
26
27
  "linear",
27
28
  "step",
28
29
  "stepAfter",
29
30
  "stepBefore",
30
31
  "natural"
31
- ], C = [
32
+ ], w = [
32
33
  "top",
33
34
  "bottom",
34
35
  "left",
35
36
  "right"
36
- ], w = [
37
+ ], T = [
37
38
  "success",
38
39
  "warning",
39
40
  "danger",
40
41
  "info",
41
42
  "neutral"
42
- ], T = [
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
- ], E = 1e3, D = 20;
49
- function O(e, t) {
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 k(e) {
53
+ function A(e) {
53
54
  return typeof e == "boolean" ? e : void 0;
54
55
  }
55
- function A(e) {
56
+ function j(e) {
56
57
  return typeof e == "string" && e.length > 0 && e.length <= 128 ? e : void 0;
57
58
  }
58
- function j(e, t) {
59
- let n = typeof e.chartType == "string" ? e.chartType.toLowerCase() : "", r = n === "doughnut" || n === "donut", i = t ? "funnel" : r ? "pie" : O(n, x) ?? "line", a = u(e.colors).map(h).filter((e) => !!e).slice(0, 12), o = {}, s = e.seriesLabels;
60
- if (Array.isArray(s)) for (let e of s.slice(0, D)) {
61
- let t = p(e), n = A(t.key ?? t.field), r = f(t.label, 80);
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, D)) A(e) && typeof t == "string" && (o[e] = t.slice(0, 80));
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
- return t === null ? null : {
68
- axis: O(e.axis, ["x", "y"]),
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: O(e.color, w),
73
- dashed: k(e.dashed)
76
+ color: k(e.color, T),
77
+ dashed: A(e.dashed)
74
78
  };
75
- }).filter((e) => e !== null), l = m(e.series, D).map((e) => {
76
- let t = A(e.field);
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: O(e.type, ["bar", "line"]),
81
- axis: O(e.axis, ["left", "right"]),
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: A(e.xAxisField) ?? "name",
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: k(e.showGrid),
92
- showLegend: k(e.showLegend),
93
- legendPosition: O(e.legendPosition, C),
94
- showDots: k(e.showDataPoints),
95
- curveType: O(e.curveType, S),
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: k(e.stacked),
99
- isDonut: r || k(e.showAsDonut),
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: k(e.dualAxis),
105
- logScale: k(e.logScale),
106
- startAtZero: k(e.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: A(e.valueField),
110
- labelField: A(e.labelField),
111
- showTotal: k(e.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: A(e.xField),
114
- yField: A(e.yField),
115
- sizeField: A(e.sizeField),
116
- colorField: A(e.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 M(e) {
120
- return m(p(e).rows, E).map((e) => {
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 N({ widget: d }) {
127
- let f = d.config, p = _(() => j(f, d.type === "funnel_chart"), [f, d.type]), m = _(() => M(d.data), [d.data]), [h, x] = v([]), S = _(() => u(f.selectedFields).map(A).filter((e) => !!e), [f.selectedFields]), C = _(() => {
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] || T[t % T.length],
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 = g((e) => {
149
- x((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
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__ */ y(l, {
155
+ if (m.length === 0) return /* @__PURE__ */ b(l, {
152
156
  title: d.title,
153
- children: /* @__PURE__ */ y("div", {
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 E = 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 = (() => {
159
- if (E) return /* @__PURE__ */ y(o, {
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__ */ y(s, {
169
+ case "waterfall": return /* @__PURE__ */ b(s, {
166
170
  data: m,
167
171
  config: p
168
172
  });
169
- case "scatter": return /* @__PURE__ */ y(c, {
173
+ case "scatter": return /* @__PURE__ */ b(c, {
170
174
  data: m,
171
175
  config: p
172
176
  });
173
- case "bar": return /* @__PURE__ */ y(n, {
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__ */ y(r, {
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__ */ y(i, {
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__ */ y(a, {
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__ */ y(t, {
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__ */ y(l, {
206
+ return /* @__PURE__ */ b(l, {
203
207
  title: d.title,
204
- children: /* @__PURE__ */ b("div", {
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__ */ y(e, {
211
+ O && p.legendPosition === "top" && /* @__PURE__ */ b(e, {
208
212
  items: C,
209
213
  position: "top",
210
214
  onItemClick: w
211
215
  }),
212
- /* @__PURE__ */ y("div", {
216
+ /* @__PURE__ */ b("div", {
213
217
  className: "min-h-0 flex-1",
214
218
  children: D
215
219
  }),
216
- O && p.legendPosition === "bottom" && /* @__PURE__ */ y(e, {
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 { N as ChartEmbed, N as default, j as toEmbedChartConfig, M as toEmbedChartRows };
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 { useI18n as e } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
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 r = {
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
- }, i = {
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
- }, a = {
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 o(e) {
35
+ function s(e) {
35
36
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
36
37
  }
37
- function s({ metadata: t }) {
38
- let { t: r } = e(), i = r("bigconsole.insights.preview.sourceUnknown", "Source unverified");
39
- return t?.executionReceiptVersion === 1 && typeof t.fallbackUsed == "boolean" && (t.executionPath === "llm" && t.provider === "openai" && t.fallbackUsed === !1 && typeof t.model == "string" && t.model.trim().length > 0 && t.model.length <= 128 && t.model !== "heuristic-v1" ? i = r("bigconsole.insights.preview.sourceModel", "Model draft") : t.provider === "local" && t.model === "heuristic-v1" && (t.executionPath === "heuristic" && (i = t.fallbackUsed ? r("bigconsole.insights.preview.sourceFallback", "Heuristic draft after provider fallback") : r("bigconsole.insights.preview.sourceHeuristic", "Heuristic draft")), t.executionPath === "local-refinement" && (i = t.fallbackUsed ? r("bigconsole.insights.preview.sourceRefinementFallback", "Local refinement after provider fallback") : r("bigconsole.insights.preview.sourceRefinement", "Local refinement")))), /* @__PURE__ */ n("p", {
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
- r("bigconsole.insights.preview.sourceLabel", "Generation source"),
43
+ n("bigconsole.insights.preview.sourceLabel", "Generation source"),
43
44
  ": ",
44
45
  i
45
46
  ]
46
47
  });
47
48
  }
48
- function c(e) {
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 l(e) {
52
- let t = o(e);
53
- if (!t || typeof t.operator != "string" || !Object.hasOwn(r, t.operator)) return "Unrecognized rule; refine the draft before approval.";
54
- let n = t.operator === "isEmpty" || t.operator === "isNotEmpty" ? "" : t.operator === "between" || t.operator === "outside" ? `${c(t.value)} and ${c(t.value2)}` : t.valueType === "field" && typeof t.fieldRef == "string" ? c(t.fieldRef) : c(t.value), a = o(t.style), s = a ? [
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) => a[e] !== void 0).map((e) => `${i[e]}: ${c(a[e])}`).join(", ") : "";
62
- return `${t.field === void 0 ? "This value" : c(t.field)} ${r[t.operator]} ${n} → ${s || "No supported style"}`;
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 u({ config: r }) {
65
- let { t: i } = e();
66
- if (!r) return null;
67
- let s = [], u = (e, t) => {
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(l) : ["Unrecognized rule list; refine the draft before approval."];
70
- Array.isArray(t) && t.length > 32 && n.push("More than 32 rules; refine the draft before approval."), n.length && s.push({
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 (u(i("bigconsole.insights.preview.tableRules", "Widget formatting"), r.conditionalRules), u(i("bigconsole.insights.preview.rowRules", "Whole-row formatting"), r.rowRules), Array.isArray(r.columns)) {
76
- for (let e of r.columns.slice(0, 64)) {
77
- let t = o(e);
78
- t && u(`${i("bigconsole.insights.preview.columnRules", "Column")}: ${c(t.key ?? t.field)}`, t.conditionalRules);
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
- r.columns.length > 64 && s.push({
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 (r.referenceLines !== void 0) {
86
- let e = Array.isArray(r.referenceLines) ? r.referenceLines.slice(0, 32).map((e) => {
87
- let t = o(e);
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: e
138
+ values: t
93
139
  });
94
140
  }
95
- let d = [
141
+ let u = [
96
142
  "xAxisField",
97
143
  "xAxisLabel",
98
144
  "yAxisLabel",
99
145
  "yAxisRightLabel",
100
146
  "dualAxis",
101
147
  "logScale"
102
- ].filter((e) => r[e] !== void 0).map((e) => `${a[e]}: ${c(r[e])}`);
103
- return d.length && s.push({
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: d
106
- }), s.length ? /* @__PURE__ */ n("section", {
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__ */ t("h4", { children: i("bigconsole.insights.preview.formatting", "Formatting to review") }),
116
- /* @__PURE__ */ t("p", { children: i("bigconsole.insights.preview.formattingHint", "Check the field, comparison and styling before creating the dashboard. > excludes the exact threshold; ≥ includes it.") }),
117
- s.map((e, r) => /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t("strong", { children: e.label }), /* @__PURE__ */ t("ul", { children: e.values.map((e, n) => /* @__PURE__ */ t("li", { children: e }, n)) })] }, r))
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 { u as GeneratedFormattingReview, s as GenerationExecutionStatus };
167
+ export { g as GeneratedFormattingReview, h as GeneratedSpecWarnings, c as GenerationExecutionStatus, p as referenceLineText, f as ruleText, m as warningText };
@@ -66,6 +66,7 @@ var w = [], T = {
66
66
  innerRadius: j?.innerRadius,
67
67
  outerRadius: j?.outerRadius,
68
68
  referenceLines: j?.referenceLines,
69
+ conditionalRules: j?.conditionalRules,
69
70
  series: j?.series,
70
71
  selectedFields: j?.selectedFields,
71
72
  dualAxis: j?.dualAxis,
@@ -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: [s("bigconsole.widget.config.chart.referenceLines.itemLegend", "Line {{number}}", { number: l }), t.axis === "x" ? ` · ${s("bigconsole.widget.config.chart.referenceLines.xAxis", "X axis")}` : ""]
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",
@@ -102,7 +102,10 @@ var g = [
102
102
  children: e
103
103
  })
104
104
  }),
105
- r(_.referenceLines),
105
+ r(_.referenceLines, {
106
+ data: i,
107
+ xAxisKey: _.xAxisKey || "name"
108
+ }),
106
109
  b.map((e, t) => /* @__PURE__ */ o(c, {
107
110
  type: _.curveType || "monotone",
108
111
  dataKey: e,