@burdenoff/microfe-bigconsole 2026.1012.8 → 2026.1013.1
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/assistant/assistantRunStore.js +5 -5
- package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +5 -5
- package/dist/bigconsole/components/DrilldownDashboardRenderer.d.ts +3 -0
- package/dist/bigconsole/components/DrilldownDashboardRenderer.js +106 -88
- package/dist/bigconsole/components/embed/widgets/ChartEmbed.js +1 -1
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.d.ts +8 -0
- package/dist/bigconsole/components/insights/GeneratedFormattingReview.js +122 -0
- package/dist/bigconsole/components/preview/AiPreviewContent.d.ts +4 -2
- package/dist/bigconsole/components/preview/AiPreviewContent.js +121 -93
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +103 -100
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.d.ts +5 -0
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.js +27 -0
- package/dist/bigconsole/components/widgets/gauge/CircularGauge.js +4 -6
- package/dist/bigconsole/pages/InsightsPage.js +325 -317
- package/dist/bigconsole/utils/quota.js +1 -1
- package/dist/node_modules/@e965/xlsx/xlsx.js +32 -32
- package/dist/node_modules/pdfjs-dist/build/pdf.js +17 -14
- package/package.json +30 -12
|
@@ -87,7 +87,7 @@ var _ = i()((r, i) => ({
|
|
|
87
87
|
}),
|
|
88
88
|
applyProgress: (e) => r((t) => {
|
|
89
89
|
let n = { ...t.steps }, r = { ...t.entityIds }, i = (e, t) => {
|
|
90
|
-
n[e] = m(n[e], "done"), t && e !== "widget" && (r[e] = t);
|
|
90
|
+
n[e] = m(n[e], "done"), t && e !== "widget" && (e === "dashboard" && r.dashboard !== t && (delete r.widget, n.widget = "pending"), r[e] = t);
|
|
91
91
|
};
|
|
92
92
|
for (let t of e.matchAll(c)) {
|
|
93
93
|
let e = d[t[1] ?? ""];
|
|
@@ -110,11 +110,11 @@ var _ = i()((r, i) => ({
|
|
|
110
110
|
if (r.completedResultIds.includes(t)) return r;
|
|
111
111
|
let a = e(n);
|
|
112
112
|
if (a.length === 0) return r;
|
|
113
|
-
let o = { ...r.steps }, s = { ...r.entityIds }, c = { ...r.entityResultOrder }, l = !1, u = (e, t) => {
|
|
114
|
-
let
|
|
115
|
-
i !== void 0 &&
|
|
113
|
+
let o = { ...r.steps }, s = { ...r.entityIds }, c = { ...r.entityResultOrder }, l = !1, u = (e, t, n = !1) => {
|
|
114
|
+
let r = c[e];
|
|
115
|
+
i !== void 0 && r !== void 0 && i < r || (e === "dashboard" && !n && s.dashboard !== t && (delete s.widget, delete c.widget, o.widget = "pending"), i !== void 0 && (c[e] = i), o[e] = "done", s[e] = t, l = !0);
|
|
116
116
|
};
|
|
117
|
-
for (let e of a) u(e.step, e.id), e.dashboardId && u("dashboard", e.dashboardId), e.parserId && u("parser", e.parserId);
|
|
117
|
+
for (let e of a) u(e.step, e.id), e.dashboardId && u("dashboard", e.dashboardId, e.step === "widget"), e.parserId && u("parser", e.parserId);
|
|
118
118
|
let d = [...r.completedResultIds, t];
|
|
119
119
|
return l ? {
|
|
120
120
|
steps: o,
|
|
@@ -7,7 +7,7 @@ import { gatherPageContext as te } from "./pageContext.js";
|
|
|
7
7
|
import { useCallback as v, useMemo as y, useRef as b } from "react";
|
|
8
8
|
import { useAuthToken as x } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
9
9
|
//#region src/bigconsole/assistant/createSandboxAssistantTransport.ts
|
|
10
|
-
var S = "api-calls", ne = 42e4, re = 1500, ie = 3e4, C = 200, w = 25,
|
|
10
|
+
var S = "api-calls", ne = 42e4, re = 1500, ie = 3e4, C = 200, w = 25, T = "bc-assistant-conversation-id", ae = {
|
|
11
11
|
isCachedAssistantSandboxReusable: o,
|
|
12
12
|
findExistingSandbox: i,
|
|
13
13
|
createAssistantSandbox: t,
|
|
@@ -131,7 +131,7 @@ function z(e, t, n, r) {
|
|
|
131
131
|
function B(e) {
|
|
132
132
|
return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function oe(e) {
|
|
135
135
|
let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
136
136
|
return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 : [
|
|
137
137
|
"sandbox not found",
|
|
@@ -171,7 +171,7 @@ function V() {
|
|
|
171
171
|
workspaceId: e,
|
|
172
172
|
mode: S,
|
|
173
173
|
authContext: n,
|
|
174
|
-
api:
|
|
174
|
+
api: ae,
|
|
175
175
|
hasAccessToken: () => !!t(),
|
|
176
176
|
store: {
|
|
177
177
|
getSandboxId: () => N.current,
|
|
@@ -271,7 +271,7 @@ function V() {
|
|
|
271
271
|
stack: t instanceof Error ? t.stack : void 0,
|
|
272
272
|
sandboxId: N.current,
|
|
273
273
|
sessionId: P.current
|
|
274
|
-
}), e === 1 &&
|
|
274
|
+
}), e === 1 && oe(t)) return R(null), V(null), g(2);
|
|
275
275
|
throw t;
|
|
276
276
|
}
|
|
277
277
|
};
|
|
@@ -302,7 +302,7 @@ function V() {
|
|
|
302
302
|
]), K = v((e) => e.length === 0 ? null : [
|
|
303
303
|
"You are resuming an earlier conversation. What follows is what was said in it — treat it as your own memory and continue seamlessly. Do not mention this replay, and do not redo work that was already completed.",
|
|
304
304
|
"--- earlier in this conversation ---",
|
|
305
|
-
e.map((e) => `${e.role === "user" ? "User" : "Assistant"}: ${e.content}`).join("\n\n").slice(-
|
|
305
|
+
e.map((e) => `${e.role === "user" ? "User" : "Assistant"}: ${e.content}`).join("\n\n").slice(-6e3),
|
|
306
306
|
"--- end ---"
|
|
307
307
|
].join("\n\n"), []), q = v((e) => e.map((e) => ({
|
|
308
308
|
id: e.id,
|
|
@@ -5,6 +5,9 @@ export interface DrilldownDashboardRendererProps {
|
|
|
5
5
|
dashboardId: string;
|
|
6
6
|
live?: boolean;
|
|
7
7
|
refreshRevision?: number;
|
|
8
|
+
/** AI preview read-after-write expectation; ordinary drilldowns leave this unset. */
|
|
9
|
+
expectedWidgetId?: string;
|
|
10
|
+
requestWorkspaceId?: string;
|
|
8
11
|
/** Parameters passed from drilldown (can be used for filtering) */
|
|
9
12
|
params: Record<string, unknown>;
|
|
10
13
|
}
|
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
import { GetDashboardDocument as e, ListWidgetsByDashboardDocument as t } from "../../generated/wspace-operations.js";
|
|
2
|
-
import {
|
|
2
|
+
import { loadConfirmedPreviewWidgets as n } from "./preview/confirmedPreviewWidgets.js";
|
|
3
|
+
import { Section as r, SectionStack as i } from "./common/Section.js";
|
|
3
4
|
import "./common/index.js";
|
|
4
|
-
import { mapFromFederationWidgetType as
|
|
5
|
-
import { MODAL_TARGET_PAGE_PARAM as
|
|
6
|
-
import
|
|
7
|
-
import { getVisibleDrilldownParams as
|
|
8
|
-
import { memo as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { mapFromFederationWidgetType as a } from "../utils/widgetTypeMapping.js";
|
|
6
|
+
import { MODAL_TARGET_PAGE_PARAM as o } from "../hooks/useDrilldown.js";
|
|
7
|
+
import s from "./widgets/WidgetWrapper.js";
|
|
8
|
+
import { getVisibleDrilldownParams as c } from "../utils/drilldownParams.js";
|
|
9
|
+
import { memo as l, useEffect as u, useState as d } from "react";
|
|
10
|
+
import { Button as f } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
12
|
+
import { useApolloClient as m } from "@apollo/client/react";
|
|
13
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
14
|
//#region src/bigconsole/components/DrilldownDashboardRenderer.tsx
|
|
12
|
-
function
|
|
15
|
+
function _(e, t) {
|
|
13
16
|
let n = t * 4, r = {
|
|
14
17
|
x: 0,
|
|
15
18
|
y: n,
|
|
16
19
|
width: 12,
|
|
17
20
|
height: 4
|
|
18
|
-
},
|
|
21
|
+
}, i = e.config || {}, o = i._internalWidgetType || a(e.type || "KPI");
|
|
19
22
|
return {
|
|
20
23
|
id: e.id ?? "",
|
|
21
24
|
pageId: e.pageId || "",
|
|
@@ -28,7 +31,7 @@ function m(e, t) {
|
|
|
28
31
|
datasetId: e.datasetId || null,
|
|
29
32
|
parserId: e.parserId || null,
|
|
30
33
|
parserRules: e.parserRules || null,
|
|
31
|
-
config:
|
|
34
|
+
config: i,
|
|
32
35
|
position: r,
|
|
33
36
|
positionX: 0,
|
|
34
37
|
positionY: n,
|
|
@@ -49,7 +52,7 @@ function m(e, t) {
|
|
|
49
52
|
updatedAt: e.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
50
53
|
};
|
|
51
54
|
}
|
|
52
|
-
function
|
|
55
|
+
function v(e, t) {
|
|
53
56
|
let n = {
|
|
54
57
|
x: 0,
|
|
55
58
|
y: t * 4,
|
|
@@ -65,163 +68,178 @@ function h(e, t) {
|
|
|
65
68
|
positionHeight: 4
|
|
66
69
|
};
|
|
67
70
|
}
|
|
68
|
-
var
|
|
69
|
-
let
|
|
70
|
-
if (
|
|
71
|
-
if (!
|
|
72
|
-
|
|
71
|
+
var y = l(function({ dashboardId: a, params: s, live: l = !1, refreshRevision: y = 0, expectedWidgetId: x, requestWorkspaceId: S }) {
|
|
72
|
+
let C = m(), { t: w } = p(), [T, E] = d(0), [D, O] = d(!0), [k, A] = d(null), [j, M] = d(null), [N, P] = d([]);
|
|
73
|
+
if (u(() => {
|
|
74
|
+
if (!a) {
|
|
75
|
+
O(!1);
|
|
73
76
|
return;
|
|
74
77
|
}
|
|
75
|
-
let
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
let r = !1, i = new AbortController(), o = S ? {
|
|
79
|
+
requiredWorkspaceAuth: !0,
|
|
80
|
+
requiredWorkspaceId: S,
|
|
81
|
+
queryDeduplication: !1,
|
|
82
|
+
fetchOptions: { signal: i.signal }
|
|
83
|
+
} : void 0, s = !1, c = !1;
|
|
84
|
+
O(!0);
|
|
85
|
+
async function u() {
|
|
86
|
+
if (!(s || c)) {
|
|
87
|
+
s = !0, A(null);
|
|
80
88
|
try {
|
|
81
|
-
let
|
|
89
|
+
let s = await C.query({
|
|
82
90
|
query: e,
|
|
83
|
-
variables: { id:
|
|
84
|
-
fetchPolicy: "network-only"
|
|
91
|
+
variables: { id: a },
|
|
92
|
+
fetchPolicy: S ? "no-cache" : "network-only",
|
|
93
|
+
...o ? { context: o } : {}
|
|
85
94
|
});
|
|
86
|
-
if (
|
|
87
|
-
let
|
|
88
|
-
if (!
|
|
89
|
-
|
|
95
|
+
if (r) return;
|
|
96
|
+
let c = s.data?.getDashboard;
|
|
97
|
+
if (!c) {
|
|
98
|
+
A("Dashboard not found"), O(!1);
|
|
90
99
|
return;
|
|
91
100
|
}
|
|
92
|
-
let
|
|
101
|
+
let l = c.pages?.edges?.map((e) => ({
|
|
93
102
|
id: e.node.id,
|
|
94
103
|
name: e.node.name || "Page 1"
|
|
95
104
|
})) || [];
|
|
96
|
-
|
|
97
|
-
id:
|
|
98
|
-
name:
|
|
99
|
-
description:
|
|
100
|
-
pages:
|
|
105
|
+
M({
|
|
106
|
+
id: c.id,
|
|
107
|
+
name: c.name,
|
|
108
|
+
description: c.description,
|
|
109
|
+
pages: l
|
|
101
110
|
});
|
|
102
|
-
let
|
|
111
|
+
let u = await n(async () => ((await C.query({
|
|
103
112
|
query: t,
|
|
104
|
-
variables: { dashboardId:
|
|
105
|
-
fetchPolicy: "network-only"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
113
|
+
variables: { dashboardId: a },
|
|
114
|
+
fetchPolicy: S ? "no-cache" : "network-only",
|
|
115
|
+
...o ? { context: o } : {}
|
|
116
|
+
})).data?.listWidgetsByDashboard || []).map((e, t) => _(e, t)), x, i.signal);
|
|
117
|
+
if (r) return;
|
|
118
|
+
P(u);
|
|
109
119
|
} catch (e) {
|
|
110
|
-
|
|
120
|
+
r || A(e instanceof Error ? e.message : "Failed to load dashboard"), x && (c = !0);
|
|
111
121
|
} finally {
|
|
112
|
-
|
|
122
|
+
s = !1, r || O(!1);
|
|
113
123
|
}
|
|
114
124
|
}
|
|
115
125
|
}
|
|
116
|
-
|
|
117
|
-
let
|
|
118
|
-
document.visibilityState === "visible" &&
|
|
126
|
+
u();
|
|
127
|
+
let d = l ? window.setInterval(() => {
|
|
128
|
+
document.visibilityState === "visible" && u();
|
|
119
129
|
}, 4e3) : void 0;
|
|
120
130
|
return () => {
|
|
121
|
-
|
|
131
|
+
r = !0, i.abort(), d !== void 0 && window.clearInterval(d);
|
|
122
132
|
};
|
|
123
133
|
}, [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
134
|
+
a,
|
|
135
|
+
C,
|
|
136
|
+
l,
|
|
137
|
+
y,
|
|
138
|
+
x,
|
|
139
|
+
S,
|
|
140
|
+
T
|
|
141
|
+
]), D) return /* @__PURE__ */ h("div", {
|
|
129
142
|
className: "flex items-center justify-center h-full",
|
|
130
|
-
children: /* @__PURE__ */
|
|
143
|
+
children: /* @__PURE__ */ g("div", {
|
|
131
144
|
className: "flex flex-col items-center gap-3",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
145
|
+
children: [/* @__PURE__ */ h("div", { className: "w-8 h-8 border-2 border-action-primary-bg border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ h("p", {
|
|
133
146
|
className: "text-sm text-text-secondary",
|
|
134
147
|
children: "Loading dashboard..."
|
|
135
148
|
})]
|
|
136
149
|
})
|
|
137
150
|
});
|
|
138
|
-
if (
|
|
139
|
-
className: "flex h-full items-center justify-center",
|
|
151
|
+
if (k) return /* @__PURE__ */ g("div", {
|
|
152
|
+
className: "flex h-full flex-col items-center justify-center gap-3",
|
|
140
153
|
role: "alert",
|
|
141
|
-
children: /* @__PURE__ */
|
|
154
|
+
children: [/* @__PURE__ */ h(r, {
|
|
142
155
|
headingLevel: 3,
|
|
143
156
|
tone: "danger",
|
|
144
157
|
className: "w-full max-w-md",
|
|
145
158
|
"data-testid": "drilldown-error",
|
|
146
159
|
title: "Could not load this dashboard",
|
|
147
|
-
description:
|
|
148
|
-
icon: /* @__PURE__ */
|
|
160
|
+
description: k,
|
|
161
|
+
icon: /* @__PURE__ */ h("svg", {
|
|
149
162
|
className: "h-icon-md w-icon-md",
|
|
150
163
|
fill: "none",
|
|
151
164
|
stroke: "currentColor",
|
|
152
165
|
viewBox: "0 0 24 24",
|
|
153
|
-
children: /* @__PURE__ */
|
|
166
|
+
children: /* @__PURE__ */ h("path", {
|
|
154
167
|
strokeLinecap: "round",
|
|
155
168
|
strokeLinejoin: "round",
|
|
156
169
|
strokeWidth: 1.5,
|
|
157
170
|
d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
|
|
158
171
|
})
|
|
159
172
|
})
|
|
160
|
-
})
|
|
173
|
+
}), x && S ? /* @__PURE__ */ h(f, {
|
|
174
|
+
onClick: () => E((e) => e + 1),
|
|
175
|
+
variant: "outline",
|
|
176
|
+
size: "sm",
|
|
177
|
+
children: w("bigconsole.widget.customWidget.action.retry", "Retry")
|
|
178
|
+
}) : null]
|
|
161
179
|
});
|
|
162
|
-
if (!
|
|
180
|
+
if (!j || N.length === 0) return /* @__PURE__ */ h("div", {
|
|
163
181
|
className: "flex items-center justify-center h-full",
|
|
164
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ g("div", {
|
|
165
183
|
className: "flex flex-col items-center gap-3 text-center",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ h("svg", {
|
|
167
185
|
className: "w-12 h-12 text-text-muted",
|
|
168
186
|
fill: "none",
|
|
169
187
|
stroke: "currentColor",
|
|
170
188
|
viewBox: "0 0 24 24",
|
|
171
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ h("path", {
|
|
172
190
|
strokeLinecap: "round",
|
|
173
191
|
strokeLinejoin: "round",
|
|
174
192
|
strokeWidth: 1.5,
|
|
175
193
|
d: "M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"
|
|
176
194
|
})
|
|
177
|
-
}), /* @__PURE__ */
|
|
195
|
+
}), /* @__PURE__ */ h("p", {
|
|
178
196
|
className: "text-sm text-text-secondary",
|
|
179
|
-
children:
|
|
197
|
+
children: j ? "This dashboard has no widgets" : "Dashboard not found"
|
|
180
198
|
})]
|
|
181
199
|
})
|
|
182
200
|
});
|
|
183
|
-
let
|
|
184
|
-
return /* @__PURE__ */
|
|
201
|
+
let F = c(s), I = s[o], L = j.pages.find((e) => e.id === I) ?? j.pages[0] ?? null, R = (L ? N.filter((e) => !e.pageId || e.pageId === L.id) : N).map((e, t) => v(e, t));
|
|
202
|
+
return /* @__PURE__ */ g(i, {
|
|
185
203
|
className: "w-full",
|
|
186
204
|
children: [
|
|
187
|
-
/* @__PURE__ */
|
|
205
|
+
/* @__PURE__ */ h(r, {
|
|
188
206
|
emphasis: "bare",
|
|
189
207
|
padding: "none",
|
|
190
208
|
headingLevel: 3,
|
|
191
|
-
title:
|
|
192
|
-
description:
|
|
209
|
+
title: j.name,
|
|
210
|
+
description: j.pages.length > 1 && L ? /* @__PURE__ */ h("span", {
|
|
193
211
|
"data-testid": "drilldown-dashboard-page",
|
|
194
|
-
children:
|
|
195
|
-
}) :
|
|
212
|
+
children: L.name
|
|
213
|
+
}) : j.description,
|
|
196
214
|
"data-testid": "drilldown-dashboard-header"
|
|
197
215
|
}),
|
|
198
|
-
|
|
216
|
+
F.length > 0 && /* @__PURE__ */ h(r, {
|
|
199
217
|
emphasis: "muted",
|
|
200
218
|
padding: "compact",
|
|
201
219
|
headingLevel: 3,
|
|
202
220
|
title: "Filtered by",
|
|
203
221
|
"data-testid": "drilldown-params",
|
|
204
222
|
bodyClassName: "flex flex-wrap gap-control-gap",
|
|
205
|
-
children:
|
|
223
|
+
children: F.map(([e, t]) => /* @__PURE__ */ g("span", {
|
|
206
224
|
className: "inline-flex items-center rounded-pill bg-bg-surface px-2 py-1 text-xs text-text-secondary",
|
|
207
|
-
children: [/* @__PURE__ */
|
|
225
|
+
children: [/* @__PURE__ */ g("span", {
|
|
208
226
|
className: "font-medium text-text-primary",
|
|
209
227
|
children: [e, ":"]
|
|
210
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ h("span", {
|
|
211
229
|
className: "ml-1",
|
|
212
230
|
children: typeof t == "object" && t ? JSON.stringify(t) : String(t)
|
|
213
231
|
})]
|
|
214
232
|
}, e))
|
|
215
233
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ g("div", {
|
|
217
235
|
className: "flex flex-col gap-form-gap",
|
|
218
|
-
children: [
|
|
236
|
+
children: [R.length === 0 && /* @__PURE__ */ h("p", {
|
|
219
237
|
className: "text-sm text-text-secondary",
|
|
220
238
|
"data-testid": "drilldown-page-empty",
|
|
221
239
|
children: "This page has no widgets"
|
|
222
|
-
}),
|
|
240
|
+
}), R.map((e) => {
|
|
223
241
|
let t = e.config?._internalWidgetType, n = e.type;
|
|
224
|
-
return /* @__PURE__ */
|
|
242
|
+
return /* @__PURE__ */ h("div", {
|
|
225
243
|
className: "min-w-0 overflow-hidden rounded-card border border-[var(--color-border-subtle)] bg-bg-surface",
|
|
226
244
|
style: n === "LINE_CHART" || n === "chart" || t === "chart" || t === "funnel_chart" ? { height: "clamp(220px, 45vh, 350px)" } : n === "TABLE" || n === "table" || t === "table" || t === "list" || t === "pivot_table" ? {
|
|
227
245
|
minHeight: "min(250px, 40vh)",
|
|
@@ -230,19 +248,19 @@ var g = c(function({ dashboardId: i, params: o, live: c = !1, refreshRevision: g
|
|
|
230
248
|
minHeight: "min(120px, 25vh)",
|
|
231
249
|
maxHeight: "min(300px, 50vh)"
|
|
232
250
|
},
|
|
233
|
-
children: /* @__PURE__ */
|
|
251
|
+
children: /* @__PURE__ */ h(b, {
|
|
234
252
|
widget: e,
|
|
235
|
-
filterValues:
|
|
253
|
+
filterValues: s
|
|
236
254
|
})
|
|
237
255
|
}, e.id);
|
|
238
256
|
})]
|
|
239
257
|
})
|
|
240
258
|
]
|
|
241
259
|
});
|
|
242
|
-
}),
|
|
243
|
-
return /* @__PURE__ */
|
|
260
|
+
}), b = l(function({ widget: e, filterValues: t }) {
|
|
261
|
+
return /* @__PURE__ */ h("div", {
|
|
244
262
|
className: "h-full [&_[data-widget-id]]:border-transparent [&_[data-widget-id]:hover]:border-transparent",
|
|
245
|
-
children: /* @__PURE__ */
|
|
263
|
+
children: /* @__PURE__ */ h(s, {
|
|
246
264
|
widget: e,
|
|
247
265
|
isLoading: !1,
|
|
248
266
|
error: null,
|
|
@@ -251,4 +269,4 @@ var g = c(function({ dashboardId: i, params: o, live: c = !1, refreshRevision: g
|
|
|
251
269
|
});
|
|
252
270
|
});
|
|
253
271
|
//#endregion
|
|
254
|
-
export {
|
|
272
|
+
export { y as default };
|
|
@@ -116,7 +116,7 @@ function j(o, s) {
|
|
|
116
116
|
function M(e) {
|
|
117
117
|
return i(r(e).rows, E).map((e) => {
|
|
118
118
|
let t = {};
|
|
119
|
-
for (let [n, r] of Object.entries(e).slice(0,
|
|
119
|
+
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);
|
|
120
120
|
return t;
|
|
121
121
|
});
|
|
122
122
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Legacy enablement-only metadata never establishes which provider produced a draft. */
|
|
2
|
+
export declare function GenerationExecutionStatus({ metadata }: {
|
|
3
|
+
metadata?: Record<string, unknown> | null;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
/** Read-only proposal details; creation and server validation retain their existing owners. */
|
|
6
|
+
export declare function GeneratedFormattingReview({ config }: {
|
|
7
|
+
config?: Record<string, unknown> | null;
|
|
8
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,122 @@
|
|
|
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";
|
|
3
|
+
//#region src/bigconsole/components/insights/GeneratedFormattingReview.tsx
|
|
4
|
+
var r = {
|
|
5
|
+
gt: ">",
|
|
6
|
+
gte: "≥",
|
|
7
|
+
lt: "<",
|
|
8
|
+
lte: "≤",
|
|
9
|
+
eq: "=",
|
|
10
|
+
neq: "≠",
|
|
11
|
+
between: "between",
|
|
12
|
+
outside: "outside",
|
|
13
|
+
contains: "contains",
|
|
14
|
+
notContains: "does not contain",
|
|
15
|
+
startsWith: "starts with",
|
|
16
|
+
endsWith: "ends with",
|
|
17
|
+
isEmpty: "is empty",
|
|
18
|
+
isNotEmpty: "is not empty"
|
|
19
|
+
}, i = {
|
|
20
|
+
textColor: "Text color",
|
|
21
|
+
bgColor: "Background",
|
|
22
|
+
bold: "Bold",
|
|
23
|
+
icon: "Icon",
|
|
24
|
+
dataBar: "Data bar",
|
|
25
|
+
dataBarColor: "Data bar color"
|
|
26
|
+
}, a = {
|
|
27
|
+
xAxisField: "Horizontal field",
|
|
28
|
+
xAxisLabel: "Horizontal label",
|
|
29
|
+
yAxisLabel: "Vertical label",
|
|
30
|
+
yAxisRightLabel: "Right vertical label",
|
|
31
|
+
dualAxis: "Two vertical axes",
|
|
32
|
+
logScale: "Logarithmic scale"
|
|
33
|
+
};
|
|
34
|
+
function o(e) {
|
|
35
|
+
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
36
|
+
}
|
|
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", {
|
|
40
|
+
"data-testid": "preview-generation-source",
|
|
41
|
+
children: [
|
|
42
|
+
r("bigconsole.insights.preview.sourceLabel", "Generation source"),
|
|
43
|
+
": ",
|
|
44
|
+
i
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function c(e) {
|
|
49
|
+
return typeof e == "string" ? e.slice(0, 128) : typeof e == "number" && Number.isFinite(e) || typeof e == "boolean" ? String(e) : "—";
|
|
50
|
+
}
|
|
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)}` : c(t.value), a = o(t.style), s = a ? [
|
|
55
|
+
"textColor",
|
|
56
|
+
"bgColor",
|
|
57
|
+
"bold",
|
|
58
|
+
"icon",
|
|
59
|
+
"dataBar",
|
|
60
|
+
"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"}`;
|
|
63
|
+
}
|
|
64
|
+
function u({ config: r }) {
|
|
65
|
+
let { t: i } = e();
|
|
66
|
+
if (!r) return null;
|
|
67
|
+
let s = [], u = (e, t) => {
|
|
68
|
+
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({
|
|
71
|
+
label: e,
|
|
72
|
+
values: n
|
|
73
|
+
});
|
|
74
|
+
};
|
|
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);
|
|
79
|
+
}
|
|
80
|
+
r.columns.length > 64 && s.push({
|
|
81
|
+
label: i("bigconsole.insights.preview.columnRules", "Column"),
|
|
82
|
+
values: [i("bigconsole.insights.preview.columnLimit", "Only the first 64 columns are shown. Review the remaining columns before approval.")]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
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({
|
|
91
|
+
label: i("bigconsole.insights.preview.references", "Chart references"),
|
|
92
|
+
values: e
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
let d = [
|
|
96
|
+
"xAxisField",
|
|
97
|
+
"xAxisLabel",
|
|
98
|
+
"yAxisLabel",
|
|
99
|
+
"yAxisRightLabel",
|
|
100
|
+
"dualAxis",
|
|
101
|
+
"logScale"
|
|
102
|
+
].filter((e) => r[e] !== void 0).map((e) => `${a[e]}: ${c(r[e])}`);
|
|
103
|
+
return d.length && s.push({
|
|
104
|
+
label: i("bigconsole.insights.preview.axes", "Chart axes"),
|
|
105
|
+
values: d
|
|
106
|
+
}), s.length ? /* @__PURE__ */ n("section", {
|
|
107
|
+
"aria-label": i("bigconsole.insights.preview.formatting", "Formatting to review"),
|
|
108
|
+
"data-testid": "preview-formatting-rules",
|
|
109
|
+
style: {
|
|
110
|
+
minWidth: 0,
|
|
111
|
+
overflowWrap: "anywhere",
|
|
112
|
+
fontSize: "var(--font-size-body-sm)"
|
|
113
|
+
},
|
|
114
|
+
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))
|
|
118
|
+
]
|
|
119
|
+
}) : null;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { u as GeneratedFormattingReview, s as GenerationExecutionStatus };
|
|
@@ -2,9 +2,10 @@ export declare function DataSinkContent({ id, live }: {
|
|
|
2
2
|
id?: string;
|
|
3
3
|
live: boolean;
|
|
4
4
|
}): import("react").JSX.Element;
|
|
5
|
-
export declare function DashboardContent({ dashboardId, live }: {
|
|
5
|
+
export declare function DashboardContent({ dashboardId, live, expectedWidgetId, }: {
|
|
6
6
|
dashboardId?: string;
|
|
7
7
|
live?: boolean;
|
|
8
|
+
expectedWidgetId?: string;
|
|
8
9
|
}): import("react").JSX.Element;
|
|
9
10
|
/**
|
|
10
11
|
* Read-only evaluation of the saved expression against up to 50 current source
|
|
@@ -15,7 +16,8 @@ export declare function ParserContent({ parserId, live }: {
|
|
|
15
16
|
parserId?: string;
|
|
16
17
|
live: boolean;
|
|
17
18
|
}): import("react").JSX.Element;
|
|
18
|
-
export declare function WidgetsContent({ dashboardId, live }: {
|
|
19
|
+
export declare function WidgetsContent({ dashboardId, live, expectedWidgetId, }: {
|
|
19
20
|
dashboardId?: string;
|
|
20
21
|
live: boolean;
|
|
22
|
+
expectedWidgetId?: string;
|
|
21
23
|
}): import("react").JSX.Element;
|