@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
|
@@ -1,180 +1,208 @@
|
|
|
1
1
|
import { ListWidgetsByDashboardDocument as e } from "../../../generated/wspace-operations.js";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
2
|
+
import { useBigConsole as t } from "../../context/BigConsoleContext.js";
|
|
3
|
+
import "../../context/index.js";
|
|
4
|
+
import { useAssistantRunStore as n } from "../../assistant/assistantRunStore.js";
|
|
5
|
+
import { loadConfirmedPreviewWidgets as r } from "./confirmedPreviewWidgets.js";
|
|
6
|
+
import i from "../datasink/DataSinkTableViewer.js";
|
|
7
|
+
import { normalizeWidget as a } from "../../hooks/useWidgetOperations.js";
|
|
8
|
+
import o from "../../hooks/useDataSinkOperations.js";
|
|
9
|
+
import s from "../widgets/WidgetWrapper.js";
|
|
10
|
+
import c from "../DrilldownDashboardRenderer.js";
|
|
11
|
+
import { loadParserPreview as l, parserSampleCaption as u } from "./parserPreview.js";
|
|
12
|
+
import { useEffect as d, useRef as f, useState as p } from "react";
|
|
13
|
+
import { Button as m, Spinner as h } from "@burdenoff/fe-libs/ui";
|
|
14
|
+
import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { useApolloClient as _ } from "@apollo/client/react";
|
|
16
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
13
17
|
//#region src/bigconsole/components/preview/AiPreviewContent.tsx
|
|
14
|
-
var
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
className:
|
|
18
|
+
var b = 4e3, x = "flex min-h-[6rem] min-w-0 items-center justify-center gap-2 rounded-card bg-bg-sunken px-3 py-6 text-center text-sm text-text-muted";
|
|
19
|
+
function S({ label: e, testId: t }) {
|
|
20
|
+
return /* @__PURE__ */ y("div", {
|
|
21
|
+
className: x,
|
|
18
22
|
"data-testid": t,
|
|
19
|
-
children: [/* @__PURE__ */
|
|
23
|
+
children: [/* @__PURE__ */ v(h, { className: "size-4 shrink-0" }), e]
|
|
20
24
|
});
|
|
21
25
|
}
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
24
|
-
className:
|
|
26
|
+
function C({ text: e, testId: t }) {
|
|
27
|
+
return /* @__PURE__ */ v("p", {
|
|
28
|
+
className: x,
|
|
25
29
|
"data-testid": t,
|
|
26
30
|
children: e
|
|
27
31
|
});
|
|
28
32
|
}
|
|
29
|
-
function
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className: `${
|
|
33
|
+
function w({ text: e, testId: t }) {
|
|
34
|
+
return /* @__PURE__ */ v("p", {
|
|
35
|
+
className: `${x} text-status-error-text`,
|
|
32
36
|
"data-testid": t,
|
|
33
37
|
children: e
|
|
34
38
|
});
|
|
35
39
|
}
|
|
36
|
-
function
|
|
37
|
-
let
|
|
38
|
-
return
|
|
39
|
-
if (!
|
|
40
|
-
let e = !1,
|
|
41
|
-
if (!
|
|
42
|
-
|
|
40
|
+
function T(e, t, r, i, a = !1) {
|
|
41
|
+
let o = n((e) => e.contentRevision), [s, c] = p(0), [l, u] = p(null), [m, h] = p(!!t), [g, _] = p(null), [v, y] = p(t), x = f(e);
|
|
42
|
+
return x.current = e, t !== v && (y(t), u(null), _(null), h(!!t)), d(() => {
|
|
43
|
+
if (!t) return;
|
|
44
|
+
let e = !1, n = new AbortController(), i = !1, o = !1, s = async () => {
|
|
45
|
+
if (!(i || o)) {
|
|
46
|
+
i = !0;
|
|
43
47
|
try {
|
|
44
|
-
let t = await
|
|
48
|
+
let t = await x.current(n.signal);
|
|
45
49
|
if (e) return;
|
|
46
|
-
|
|
50
|
+
u(t ?? null), _(null);
|
|
47
51
|
} catch (t) {
|
|
48
52
|
if (e) return;
|
|
49
|
-
|
|
53
|
+
_(t instanceof Error ? t : /* @__PURE__ */ Error("Failed to load preview content")), a && (o = !0);
|
|
50
54
|
} finally {
|
|
51
|
-
|
|
55
|
+
i = !1, e || h(!1);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
|
-
|
|
56
|
-
let
|
|
57
|
-
r && (typeof document < "u" && document.visibilityState !== "visible" ||
|
|
58
|
-
},
|
|
59
|
+
s();
|
|
60
|
+
let c = window.setInterval(() => {
|
|
61
|
+
r && (typeof document < "u" && document.visibilityState !== "visible" || s());
|
|
62
|
+
}, b);
|
|
59
63
|
return () => {
|
|
60
|
-
e = !0, window.clearInterval(
|
|
64
|
+
e = !0, n.abort(), window.clearInterval(c);
|
|
61
65
|
};
|
|
62
66
|
}, [
|
|
63
|
-
|
|
67
|
+
t,
|
|
64
68
|
r,
|
|
65
|
-
|
|
69
|
+
o,
|
|
70
|
+
i,
|
|
71
|
+
s,
|
|
72
|
+
a
|
|
66
73
|
]), {
|
|
67
|
-
data:
|
|
68
|
-
loading:
|
|
69
|
-
error:
|
|
74
|
+
data: l,
|
|
75
|
+
loading: m,
|
|
76
|
+
error: g,
|
|
77
|
+
reload: () => c((e) => e + 1)
|
|
70
78
|
};
|
|
71
79
|
}
|
|
72
|
-
function
|
|
73
|
-
let { getDataSinkData:
|
|
74
|
-
let t = await
|
|
80
|
+
function E({ id: e, live: t }) {
|
|
81
|
+
let { getDataSinkData: n } = o({ skipFetch: !0 }), { data: r, loading: a, error: s } = T(async () => {
|
|
82
|
+
let t = await n({ id: e }, { limit: 50 });
|
|
75
83
|
return t ? t.raw : null;
|
|
76
84
|
}, e, t);
|
|
77
|
-
return e ? s ? /* @__PURE__ */
|
|
85
|
+
return e ? s ? /* @__PURE__ */ v(w, {
|
|
78
86
|
text: "Could not load the data sink's rows.",
|
|
79
87
|
testId: "ai-preview-datasink-error"
|
|
80
|
-
}) :
|
|
88
|
+
}) : a ? /* @__PURE__ */ v(S, {
|
|
81
89
|
label: "Loading the data sink’s data…",
|
|
82
90
|
testId: "ai-preview-datasink-loading"
|
|
83
|
-
}) : /* @__PURE__ */
|
|
91
|
+
}) : /* @__PURE__ */ v("div", {
|
|
84
92
|
"data-testid": "ai-preview-content-datasink",
|
|
85
93
|
className: "min-w-0",
|
|
86
|
-
children: /* @__PURE__ */
|
|
87
|
-
data:
|
|
94
|
+
children: /* @__PURE__ */ v(i, {
|
|
95
|
+
data: r,
|
|
88
96
|
maxHeight: "300px"
|
|
89
97
|
})
|
|
90
|
-
}) : /* @__PURE__ */
|
|
98
|
+
}) : /* @__PURE__ */ v(C, {
|
|
91
99
|
text: "Waiting for the data sink to be created…",
|
|
92
100
|
testId: "ai-preview-datasink-waiting"
|
|
93
101
|
});
|
|
94
102
|
}
|
|
95
|
-
function
|
|
96
|
-
let
|
|
97
|
-
return e ? /* @__PURE__ */
|
|
103
|
+
function D({ dashboardId: e, live: r = !1, expectedWidgetId: i }) {
|
|
104
|
+
let a = n((e) => e.contentRevision), { workspaceId: o, currentUser: s } = t();
|
|
105
|
+
return e ? !o || !s?.id ? /* @__PURE__ */ v(S, { label: "Loading dashboard…" }) : /* @__PURE__ */ v("div", {
|
|
98
106
|
"data-testid": "ai-preview-content-dashboard",
|
|
99
107
|
className: "min-w-0",
|
|
100
|
-
children: /* @__PURE__ */
|
|
108
|
+
children: /* @__PURE__ */ v(c, {
|
|
101
109
|
dashboardId: e,
|
|
102
110
|
params: {},
|
|
103
|
-
live:
|
|
104
|
-
refreshRevision:
|
|
105
|
-
|
|
106
|
-
|
|
111
|
+
live: r,
|
|
112
|
+
refreshRevision: a,
|
|
113
|
+
expectedWidgetId: i,
|
|
114
|
+
requestWorkspaceId: o
|
|
115
|
+
}, `${o}|${s.id}|${e}`)
|
|
116
|
+
}) : /* @__PURE__ */ v(C, {
|
|
107
117
|
text: "Waiting for the dashboard to be created…",
|
|
108
118
|
testId: "ai-preview-dashboard-waiting"
|
|
109
119
|
});
|
|
110
120
|
}
|
|
111
|
-
function
|
|
112
|
-
let
|
|
113
|
-
return e ? o ? /* @__PURE__ */
|
|
121
|
+
function O({ parserId: e, live: t }) {
|
|
122
|
+
let n = _(), { data: r, loading: a, error: o } = T(() => e ? l(n, e) : Promise.resolve(null), e, t), s = u(r);
|
|
123
|
+
return e ? o ? /* @__PURE__ */ v(w, {
|
|
114
124
|
text: "Could not read the parser's output.",
|
|
115
125
|
testId: "ai-preview-parser-error"
|
|
116
|
-
}) : a ? /* @__PURE__ */
|
|
126
|
+
}) : a ? /* @__PURE__ */ v(S, {
|
|
117
127
|
label: "Loading the parser’s output…",
|
|
118
128
|
testId: "ai-preview-parser-loading"
|
|
119
|
-
}) : /* @__PURE__ */
|
|
129
|
+
}) : /* @__PURE__ */ y("div", {
|
|
120
130
|
"data-testid": "ai-preview-content-parser",
|
|
121
131
|
className: "min-w-0",
|
|
122
|
-
children: [
|
|
132
|
+
children: [s && /* @__PURE__ */ v("p", {
|
|
123
133
|
"data-testid": "ai-preview-parser-sample",
|
|
124
134
|
className: "mb-2 text-xs text-text-muted",
|
|
125
|
-
children:
|
|
126
|
-
}), /* @__PURE__ */
|
|
127
|
-
data:
|
|
135
|
+
children: s
|
|
136
|
+
}), /* @__PURE__ */ v(i, {
|
|
137
|
+
data: r?.output ?? null,
|
|
128
138
|
maxHeight: "280px"
|
|
129
139
|
})]
|
|
130
|
-
}) : /* @__PURE__ */
|
|
140
|
+
}) : /* @__PURE__ */ v(C, {
|
|
131
141
|
text: "Waiting for the parser to be created…",
|
|
132
142
|
testId: "ai-preview-parser-waiting"
|
|
133
143
|
});
|
|
134
144
|
}
|
|
135
|
-
function
|
|
145
|
+
function k(e) {
|
|
136
146
|
let t = e.toUpperCase();
|
|
137
147
|
return t.includes("METRIC") || t.includes("KPI") || t.includes("CARD") || t.includes("STAT") ? "min(160px, 40vh)" : t.includes("TABLE") || t.includes("LIST") ? "min(280px, 50vh)" : "min(320px, 50vh)";
|
|
138
148
|
}
|
|
139
|
-
function
|
|
140
|
-
let
|
|
149
|
+
function A(n, i, o) {
|
|
150
|
+
let s = _(), { workspaceId: c, currentUser: l } = t(), u = n && c && l?.id ? `${c}|${l.id}|${n}` : void 0, { data: d, loading: f, error: p, reload: m } = T(async (t) => !n || !c || !l?.id ? null : r(async () => ((await s.query({
|
|
141
151
|
query: e,
|
|
142
|
-
variables: { dashboardId:
|
|
143
|
-
fetchPolicy: "
|
|
144
|
-
|
|
152
|
+
variables: { dashboardId: n },
|
|
153
|
+
fetchPolicy: "no-cache",
|
|
154
|
+
context: {
|
|
155
|
+
requiredWorkspaceAuth: !0,
|
|
156
|
+
requiredWorkspaceId: c,
|
|
157
|
+
queryDeduplication: !1,
|
|
158
|
+
fetchOptions: { signal: t }
|
|
159
|
+
}
|
|
160
|
+
})).data?.listWidgetsByDashboard || []).map(a), o, t), u, i, o, !0);
|
|
145
161
|
return {
|
|
146
|
-
widgets:
|
|
147
|
-
loading:
|
|
148
|
-
error:
|
|
162
|
+
widgets: d ?? [],
|
|
163
|
+
loading: !!(n && !u) || f,
|
|
164
|
+
error: p,
|
|
165
|
+
reload: m
|
|
149
166
|
};
|
|
150
167
|
}
|
|
151
|
-
function
|
|
152
|
-
let { widgets:
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
168
|
+
function j({ dashboardId: e, live: t, expectedWidgetId: n }) {
|
|
169
|
+
let { t: r } = g(), { widgets: i, loading: a, error: o, reload: c } = A(e, t, n), l = !!(n && !i.some((e) => e.id === n)), u = o ? /* @__PURE__ */ y("div", {
|
|
170
|
+
role: "alert",
|
|
171
|
+
children: [/* @__PURE__ */ v(w, {
|
|
172
|
+
text: "Could not load this dashboard's widgets.",
|
|
173
|
+
testId: "ai-preview-widget-error"
|
|
174
|
+
}), /* @__PURE__ */ v(m, {
|
|
175
|
+
onClick: c,
|
|
176
|
+
variant: "outline",
|
|
177
|
+
size: "sm",
|
|
178
|
+
children: r("bigconsole.widget.customWidget.action.retry", "Retry")
|
|
179
|
+
})]
|
|
180
|
+
}) : null;
|
|
181
|
+
return e ? u && i.length === 0 ? u : (a || l) && i.length === 0 ? /* @__PURE__ */ v(S, {
|
|
157
182
|
label: "Loading widgets…",
|
|
158
183
|
testId: "ai-preview-widget-loading"
|
|
159
|
-
}) :
|
|
184
|
+
}) : i.length === 0 ? /* @__PURE__ */ v(C, {
|
|
160
185
|
text: "No widgets on this dashboard yet.",
|
|
161
186
|
testId: "ai-preview-widget-empty"
|
|
162
|
-
}) : /* @__PURE__ */
|
|
187
|
+
}) : /* @__PURE__ */ y("div", {
|
|
163
188
|
"data-testid": "ai-preview-content-widget",
|
|
164
189
|
className: "flex min-w-0 flex-col gap-list-gap",
|
|
165
|
-
children:
|
|
190
|
+
children: [u ?? (l ? /* @__PURE__ */ v(S, {
|
|
191
|
+
label: "Loading widgets…",
|
|
192
|
+
testId: "ai-preview-widget-loading"
|
|
193
|
+
}) : null), i.map((e) => /* @__PURE__ */ v("div", {
|
|
166
194
|
className: "min-w-0 overflow-hidden rounded-card border border-[var(--color-border-subtle)] bg-bg-canvas",
|
|
167
|
-
style: { height:
|
|
168
|
-
children: /* @__PURE__ */
|
|
195
|
+
style: { height: k(e.type) },
|
|
196
|
+
children: /* @__PURE__ */ v(s, {
|
|
169
197
|
widget: e,
|
|
170
198
|
error: null,
|
|
171
199
|
filterValues: {}
|
|
172
200
|
})
|
|
173
|
-
}, e.id))
|
|
174
|
-
}) : /* @__PURE__ */
|
|
201
|
+
}, e.id))]
|
|
202
|
+
}) : /* @__PURE__ */ v(C, {
|
|
175
203
|
text: "Waiting for the dashboard — widgets live on it.",
|
|
176
204
|
testId: "ai-preview-widget-waiting"
|
|
177
205
|
});
|
|
178
206
|
}
|
|
179
207
|
//#endregion
|
|
180
|
-
export {
|
|
208
|
+
export { D as DashboardContent, E as DataSinkContent, O as ParserContent, j as WidgetsContent };
|
|
@@ -4,182 +4,185 @@ import { PREVIEW_STEPS as t, useAssistantRunStore as n } from "../../assistant/a
|
|
|
4
4
|
import { useBigConsolePreviewControl as r } from "../../assistant/usePreviewControl.js";
|
|
5
5
|
import { useAssistantRunWorkspace as i } from "../../assistant/useAssistantRunWorkspace.js";
|
|
6
6
|
import { usePreviewWidgetDashboard as a } from "../../assistant/usePreviewWidgetDashboard.js";
|
|
7
|
-
import {
|
|
7
|
+
import { expectedPreviewWidgetId as o } from "./confirmedPreviewWidgets.js";
|
|
8
|
+
import { Section as s } from "../common/Section.js";
|
|
8
9
|
import "../common/index.js";
|
|
9
|
-
import { DOCK_CLEARANCE as
|
|
10
|
-
import { DashboardContent as
|
|
11
|
-
import { useEffect as
|
|
12
|
-
import { ArrowUpRight as
|
|
13
|
-
import { Button as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { jsx as
|
|
16
|
-
import { AssistantEntityPreview as
|
|
10
|
+
import { DOCK_CLEARANCE as c, PreviewMeta as l, STEP_LABEL as u, formatAgo as d, previewLabels as f } from "./previewShared.js";
|
|
11
|
+
import { DashboardContent as p, DataSinkContent as m, ParserContent as h, WidgetsContent as g } from "./AiPreviewContent.js";
|
|
12
|
+
import { useEffect as _, useRef as v, useState as y } from "react";
|
|
13
|
+
import { ArrowUpRight as b, Loader2 as x, Sparkles as S, X as C } from "lucide-react";
|
|
14
|
+
import { Button as w } from "@burdenoff/fe-libs/ui";
|
|
15
|
+
import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
16
|
+
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
17
|
+
import { AssistantEntityPreview as O } from "@burdenoff/fe-libs/shared/assistant";
|
|
17
18
|
//#region src/bigconsole/components/preview/AiPreviewPanel.tsx
|
|
18
|
-
function
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
function k({ children: e }) {
|
|
20
|
+
return /* @__PURE__ */ E("div", {
|
|
20
21
|
className: "min-w-0 overflow-y-auto p-3",
|
|
21
22
|
style: { maxHeight: "min(440px, 60vh)" },
|
|
22
23
|
children: e
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
let { t } =
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
function A({ onOpen: e }) {
|
|
27
|
+
let { t } = T();
|
|
28
|
+
return /* @__PURE__ */ D(w, {
|
|
28
29
|
size: "sm",
|
|
29
30
|
variant: "outline",
|
|
30
31
|
onClick: e,
|
|
31
32
|
"data-testid": "ai-preview-open-entity",
|
|
32
|
-
children: [t("bigconsole.widget.aiPreview.open", "Open"), /* @__PURE__ */
|
|
33
|
+
children: [t("bigconsole.widget.aiPreview.open", "Open"), /* @__PURE__ */ E(b, { className: "ml-1 size-3.5" })]
|
|
33
34
|
});
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
-
let { t:
|
|
36
|
+
function j() {
|
|
37
|
+
let { t: b } = T();
|
|
37
38
|
i();
|
|
38
|
-
let
|
|
39
|
+
let j = a();
|
|
39
40
|
r();
|
|
40
|
-
let
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}), [
|
|
44
|
-
let [
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
if (!
|
|
41
|
+
let M = e(), N = n((e) => e.isRunning), P = n((e) => e.previewOpen), F = n((e) => e.hasRun), I = n((e) => e.steps), L = n((e) => e.entityIds), R = n((e) => e.entityResultOrder), z = n((e) => e.caption), B = n((e) => e.error), V = n((e) => e.updatedAt), H = n((e) => e.openPreview), U = n((e) => e.closePreview), W = n((e) => e.setRichMounted);
|
|
42
|
+
_(() => (W(!0), () => {
|
|
43
|
+
W(!1);
|
|
44
|
+
}), [W]);
|
|
45
|
+
let [G, K] = y(0), q = v(!1);
|
|
46
|
+
if (_(() => {
|
|
47
|
+
N && !q.current && K((e) => e + 1), q.current = N;
|
|
48
|
+
}, [N]), !F) return null;
|
|
49
|
+
if (!P) return /* @__PURE__ */ D("div", {
|
|
49
50
|
className: "flex flex-wrap items-center justify-end gap-control-gap px-4 pt-3 md:px-6",
|
|
50
|
-
style: { marginRight:
|
|
51
|
-
children: [/* @__PURE__ */
|
|
51
|
+
style: { marginRight: c },
|
|
52
|
+
children: [/* @__PURE__ */ E("span", {
|
|
52
53
|
className: "text-xs text-text-muted",
|
|
53
|
-
children:
|
|
54
|
-
}), /* @__PURE__ */
|
|
54
|
+
children: N ? b("bigconsole.widget.aiPreview.buildRunning", "AI build running") : b("bigconsole.widget.aiPreview.buildFinished", "AI build finished")
|
|
55
|
+
}), /* @__PURE__ */ D(w, {
|
|
55
56
|
size: "sm",
|
|
56
57
|
variant: "outline",
|
|
57
|
-
onClick:
|
|
58
|
+
onClick: H,
|
|
58
59
|
"data-testid": "ai-preview-open",
|
|
59
60
|
children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
/* @__PURE__ */ E(S, { className: "mr-1.5 size-4" }),
|
|
62
|
+
b("bigconsole.widget.aiPreview.previewButton", "Preview"),
|
|
63
|
+
N ? /* @__PURE__ */ E(x, { className: "ml-1.5 size-3.5 animate-spin" }) : null
|
|
63
64
|
]
|
|
64
65
|
})]
|
|
65
66
|
});
|
|
66
|
-
let
|
|
67
|
+
let J = L.dashboard, Y = o(L.widget, R.widget, R.dashboard), X = j.error ? /* @__PURE__ */ D("div", {
|
|
67
68
|
role: "alert",
|
|
68
69
|
"data-testid": "ai-preview-widget-parent-error",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ E("p", { children: b("bigconsole.widget.aiPreview.widgetParentError", "Could not load this widget’s dashboard. It may be unavailable or you may no longer have access.") }), /* @__PURE__ */ E(w, {
|
|
70
71
|
variant: "outline",
|
|
71
72
|
size: "sm",
|
|
72
|
-
onClick:
|
|
73
|
-
children:
|
|
73
|
+
onClick: j.retry,
|
|
74
|
+
children: b("bigconsole.widget.customWidget.action.retry", "Retry")
|
|
74
75
|
})]
|
|
75
|
-
}) :
|
|
76
|
+
}) : j.loading && !J ? /* @__PURE__ */ D("div", {
|
|
76
77
|
role: "status",
|
|
77
78
|
"data-testid": "ai-preview-widget-parent-loading",
|
|
78
79
|
className: "flex items-center gap-2",
|
|
79
|
-
children: [/* @__PURE__ */
|
|
80
|
-
}) : null,
|
|
80
|
+
children: [/* @__PURE__ */ E(x, { className: "size-4 animate-spin" }), b("bigconsole.widget.aiPreview.widgetParentLoading", "Loading this widget’s dashboard…")]
|
|
81
|
+
}) : null, Z = t.map((e) => ({
|
|
81
82
|
id: e,
|
|
82
|
-
label:
|
|
83
|
-
status:
|
|
84
|
-
})),
|
|
83
|
+
label: b(u[e].key, u[e].fallback),
|
|
84
|
+
status: I[e]
|
|
85
|
+
})), Q = [
|
|
85
86
|
{
|
|
86
87
|
id: "datasink",
|
|
87
|
-
label:
|
|
88
|
-
render: () => /* @__PURE__ */
|
|
88
|
+
label: b("bigconsole.widget.aiPreview.tab.dataSink", "Data Sink"),
|
|
89
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
89
90
|
emphasis: "standard",
|
|
90
91
|
padding: "compact",
|
|
91
92
|
headingLevel: 3,
|
|
92
|
-
title:
|
|
93
|
-
description:
|
|
94
|
-
actions:
|
|
95
|
-
children: /* @__PURE__ */
|
|
96
|
-
id:
|
|
97
|
-
live:
|
|
93
|
+
title: b("bigconsole.widget.aiPreview.dataSinkRows", "Data sink rows"),
|
|
94
|
+
description: b("bigconsole.widget.aiPreview.dataSinkRowsHint", "The rows the assistant just landed, straight from the sink."),
|
|
95
|
+
actions: L.datasink ? /* @__PURE__ */ E(A, { onOpen: () => M(`/datasinks/${L.datasink}`) }) : void 0,
|
|
96
|
+
children: /* @__PURE__ */ E(m, {
|
|
97
|
+
id: L.datasink,
|
|
98
|
+
live: N
|
|
98
99
|
})
|
|
99
100
|
}) })
|
|
100
101
|
},
|
|
101
102
|
{
|
|
102
103
|
id: "dashboard",
|
|
103
|
-
label:
|
|
104
|
-
render: () => /* @__PURE__ */
|
|
104
|
+
label: b("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
|
|
105
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
105
106
|
emphasis: "standard",
|
|
106
107
|
padding: "compact",
|
|
107
108
|
headingLevel: 3,
|
|
108
|
-
title:
|
|
109
|
-
description:
|
|
110
|
-
actions:
|
|
111
|
-
children:
|
|
112
|
-
dashboardId:
|
|
113
|
-
live:
|
|
109
|
+
title: b("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
|
|
110
|
+
description: b("bigconsole.widget.aiPreview.dashboardHint", "The live board, rendered exactly as the real page renders it."),
|
|
111
|
+
actions: J ? /* @__PURE__ */ E(A, { onOpen: () => M(`/dashboards/${J}`) }) : void 0,
|
|
112
|
+
children: X ?? /* @__PURE__ */ E(p, {
|
|
113
|
+
dashboardId: J,
|
|
114
|
+
live: N,
|
|
115
|
+
expectedWidgetId: Y
|
|
114
116
|
})
|
|
115
117
|
}) })
|
|
116
118
|
},
|
|
117
119
|
{
|
|
118
120
|
id: "parser",
|
|
119
|
-
label:
|
|
120
|
-
render: () => /* @__PURE__ */
|
|
121
|
+
label: b("bigconsole.widget.aiPreview.tab.parser", "Parser"),
|
|
122
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
121
123
|
emphasis: "standard",
|
|
122
124
|
padding: "compact",
|
|
123
125
|
headingLevel: 3,
|
|
124
|
-
title:
|
|
125
|
-
description:
|
|
126
|
-
actions:
|
|
127
|
-
children: /* @__PURE__ */
|
|
128
|
-
parserId:
|
|
129
|
-
live:
|
|
126
|
+
title: b("bigconsole.widget.aiPreview.parserOutput", "Parser output"),
|
|
127
|
+
description: b("bigconsole.widget.aiPreview.parserOutputHint", "The rows after the parser's transform, so you can check the shape."),
|
|
128
|
+
actions: L.parser ? /* @__PURE__ */ E(A, { onOpen: () => M(`/parsers/${L.parser}`) }) : void 0,
|
|
129
|
+
children: /* @__PURE__ */ E(h, {
|
|
130
|
+
parserId: L.parser,
|
|
131
|
+
live: N
|
|
130
132
|
})
|
|
131
133
|
}) })
|
|
132
134
|
},
|
|
133
135
|
{
|
|
134
136
|
id: "widget",
|
|
135
|
-
label:
|
|
136
|
-
render: () => /* @__PURE__ */
|
|
137
|
+
label: b("bigconsole.widget.aiPreview.tab.widget", "Widget"),
|
|
138
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
137
139
|
emphasis: "standard",
|
|
138
140
|
padding: "compact",
|
|
139
141
|
headingLevel: 3,
|
|
140
|
-
title:
|
|
141
|
-
description:
|
|
142
|
-
actions:
|
|
143
|
-
children:
|
|
144
|
-
dashboardId:
|
|
145
|
-
live:
|
|
142
|
+
title: b("bigconsole.widget.aiPreview.widgets", "Widgets"),
|
|
143
|
+
description: b("bigconsole.widget.aiPreview.widgetsHint", "Every widget on the new dashboard, rendered live."),
|
|
144
|
+
actions: J ? /* @__PURE__ */ E(A, { onOpen: () => M(`/dashboards/${J}`) }) : void 0,
|
|
145
|
+
children: X ?? /* @__PURE__ */ E(g, {
|
|
146
|
+
dashboardId: J,
|
|
147
|
+
live: N,
|
|
148
|
+
expectedWidgetId: Y
|
|
146
149
|
})
|
|
147
150
|
}) })
|
|
148
151
|
}
|
|
149
152
|
];
|
|
150
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ D("div", {
|
|
151
154
|
"data-testid": "ai-preview-panel",
|
|
152
|
-
style: { paddingRight:
|
|
155
|
+
style: { paddingRight: c },
|
|
153
156
|
className: "mx-4 mt-3 min-w-0 md:mx-6",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ E("h2", {
|
|
155
158
|
className: "sr-only",
|
|
156
|
-
children:
|
|
157
|
-
}), /* @__PURE__ */
|
|
158
|
-
title:
|
|
159
|
-
runKey: String(
|
|
160
|
-
steps:
|
|
161
|
-
tabs:
|
|
159
|
+
children: b("bigconsole.widget.aiPreview.title", "AI Preview")
|
|
160
|
+
}), /* @__PURE__ */ E(O, {
|
|
161
|
+
title: b("bigconsole.widget.aiPreview.title", "AI Preview"),
|
|
162
|
+
runKey: String(G),
|
|
163
|
+
steps: Z,
|
|
164
|
+
tabs: Q,
|
|
162
165
|
follow: "produced",
|
|
163
|
-
caption:
|
|
164
|
-
error:
|
|
165
|
-
meta: /* @__PURE__ */
|
|
166
|
-
state:
|
|
167
|
-
stateLabel:
|
|
168
|
-
updatedLabel:
|
|
169
|
-
updatedAt:
|
|
170
|
-
ago: (e) =>
|
|
166
|
+
caption: N ? z || b("bigconsole.widget.aiPreview.working", "Working…") : b("bigconsole.widget.aiPreview.done", "Done"),
|
|
167
|
+
error: B,
|
|
168
|
+
meta: /* @__PURE__ */ E(l, {
|
|
169
|
+
state: N ? "running" : B ? "stopped" : "idle",
|
|
170
|
+
stateLabel: N ? b("bigconsole.widget.aiPreview.live", "Live") : B ? b("bigconsole.widget.aiPreview.stopped", "Stopped") : null,
|
|
171
|
+
updatedLabel: b("bigconsole.widget.aiPreview.updated", "updated"),
|
|
172
|
+
updatedAt: V,
|
|
173
|
+
ago: (e) => d(e, b)
|
|
171
174
|
}),
|
|
172
|
-
headerActions: /* @__PURE__ */
|
|
175
|
+
headerActions: /* @__PURE__ */ E(w, {
|
|
173
176
|
size: "sm",
|
|
174
177
|
variant: "ghost",
|
|
175
|
-
onClick:
|
|
176
|
-
"aria-label":
|
|
178
|
+
onClick: U,
|
|
179
|
+
"aria-label": b("bigconsole.widget.aiPreview.closeAriaLabel", "Close preview"),
|
|
177
180
|
"data-testid": "ai-preview-close",
|
|
178
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ E(C, { className: "size-4" })
|
|
179
182
|
}),
|
|
180
|
-
labels:
|
|
183
|
+
labels: f(b)
|
|
181
184
|
})]
|
|
182
185
|
});
|
|
183
186
|
}
|
|
184
187
|
//#endregion
|
|
185
|
-
export {
|
|
188
|
+
export { j as AiPreviewPanel };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function loadConfirmedPreviewWidgets<T extends {
|
|
2
|
+
id: string;
|
|
3
|
+
}>(load: () => Promise<T[]>, expectedId: string | undefined, signal: AbortSignal, wait?: (ms: number, signal: AbortSignal) => Promise<void>): Promise<T[]>;
|
|
4
|
+
/** A newer dashboard starts a separate target; do not await its predecessor's widget. */
|
|
5
|
+
export declare function expectedPreviewWidgetId(widgetId: string | undefined, widgetOrder: number | undefined, dashboardOrder: number | undefined): string | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region src/bigconsole/components/preview/confirmedPreviewWidgets.ts
|
|
2
|
+
var e = 6, t = 1e3;
|
|
3
|
+
function n(e, t) {
|
|
4
|
+
return new Promise((n, r) => {
|
|
5
|
+
let i = () => {
|
|
6
|
+
clearTimeout(a), r(/* @__PURE__ */ Error("Preview read cancelled"));
|
|
7
|
+
}, a = setTimeout(() => {
|
|
8
|
+
t.removeEventListener("abort", i), n();
|
|
9
|
+
}, e);
|
|
10
|
+
t.addEventListener("abort", i, { once: !0 }), t.aborted && i();
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async function r(r, i, a, o = n) {
|
|
14
|
+
for (let n = 0; n < e; n += 1) {
|
|
15
|
+
if (a.aborted) throw Error("Preview read cancelled");
|
|
16
|
+
let s = await r();
|
|
17
|
+
if (a.aborted) throw Error("Preview read cancelled");
|
|
18
|
+
if (!i || s.some((e) => e.id === i)) return s;
|
|
19
|
+
n < e - 1 && await o(t, a);
|
|
20
|
+
}
|
|
21
|
+
throw Error("Confirmed widget is not available on this dashboard");
|
|
22
|
+
}
|
|
23
|
+
function i(e, t, n) {
|
|
24
|
+
return t !== void 0 && n !== void 0 && t < n ? void 0 : e;
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as expectedPreviewWidgetId, r as loadConfirmedPreviewWidgets };
|