@burdenoff/microfe-bigconsole 2026.1012.7 → 2026.1012.9
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/assistantRunPersistence.d.ts +1 -5
- package/dist/bigconsole/assistant/assistantRunPersistence.js +2 -1
- package/dist/bigconsole/assistant/assistantRunStore.d.ts +9 -6
- package/dist/bigconsole/assistant/assistantRunStore.js +21 -5
- package/dist/bigconsole/assistant/usePreviewWidgetDashboard.d.ts +9 -0
- package/dist/bigconsole/assistant/usePreviewWidgetDashboard.js +75 -0
- package/dist/bigconsole/components/DrilldownDashboardRenderer.d.ts +3 -0
- package/dist/bigconsole/components/DrilldownDashboardRenderer.js +106 -88
- 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 +114 -94
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.d.ts +5 -0
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.js +27 -0
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +198 -196
- package/dist/bigconsole/customWidget/proposalSource.d.ts +3 -1
- package/dist/bigconsole/customWidget/proposalSource.js +42 -28
- package/package.json +1 -1
|
@@ -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 };
|
|
@@ -3,166 +3,186 @@ import "../../context/index.js";
|
|
|
3
3
|
import { PREVIEW_STEPS as t, useAssistantRunStore as n } from "../../assistant/assistantRunStore.js";
|
|
4
4
|
import { useBigConsolePreviewControl as r } from "../../assistant/usePreviewControl.js";
|
|
5
5
|
import { useAssistantRunWorkspace as i } from "../../assistant/useAssistantRunWorkspace.js";
|
|
6
|
-
import {
|
|
6
|
+
import { usePreviewWidgetDashboard as a } from "../../assistant/usePreviewWidgetDashboard.js";
|
|
7
|
+
import { expectedPreviewWidgetId as o } from "./confirmedPreviewWidgets.js";
|
|
8
|
+
import { Section as s } from "../common/Section.js";
|
|
7
9
|
import "../common/index.js";
|
|
8
|
-
import { DOCK_CLEARANCE as
|
|
9
|
-
import { DashboardContent as
|
|
10
|
-
import { useEffect as
|
|
11
|
-
import { ArrowUpRight as
|
|
12
|
-
import { Button as
|
|
13
|
-
import { useI18n as
|
|
14
|
-
import { jsx as
|
|
15
|
-
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";
|
|
16
18
|
//#region src/bigconsole/components/preview/AiPreviewPanel.tsx
|
|
17
|
-
function
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
+
function k({ children: e }) {
|
|
20
|
+
return /* @__PURE__ */ E("div", {
|
|
19
21
|
className: "min-w-0 overflow-y-auto p-3",
|
|
20
22
|
style: { maxHeight: "min(440px, 60vh)" },
|
|
21
23
|
children: e
|
|
22
24
|
});
|
|
23
25
|
}
|
|
24
|
-
function
|
|
25
|
-
let { t } =
|
|
26
|
-
return /* @__PURE__ */
|
|
26
|
+
function A({ onOpen: e }) {
|
|
27
|
+
let { t } = T();
|
|
28
|
+
return /* @__PURE__ */ D(w, {
|
|
27
29
|
size: "sm",
|
|
28
30
|
variant: "outline",
|
|
29
31
|
onClick: e,
|
|
30
32
|
"data-testid": "ai-preview-open-entity",
|
|
31
|
-
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" })]
|
|
32
34
|
});
|
|
33
35
|
}
|
|
34
|
-
function
|
|
35
|
-
let { t:
|
|
36
|
-
i()
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
function j() {
|
|
37
|
+
let { t: b } = T();
|
|
38
|
+
i();
|
|
39
|
+
let j = a();
|
|
40
|
+
r();
|
|
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", {
|
|
46
50
|
className: "flex flex-wrap items-center justify-end gap-control-gap px-4 pt-3 md:px-6",
|
|
47
|
-
style: { marginRight:
|
|
48
|
-
children: [/* @__PURE__ */
|
|
51
|
+
style: { marginRight: c },
|
|
52
|
+
children: [/* @__PURE__ */ E("span", {
|
|
49
53
|
className: "text-xs text-text-muted",
|
|
50
|
-
children:
|
|
51
|
-
}), /* @__PURE__ */
|
|
54
|
+
children: N ? b("bigconsole.widget.aiPreview.buildRunning", "AI build running") : b("bigconsole.widget.aiPreview.buildFinished", "AI build finished")
|
|
55
|
+
}), /* @__PURE__ */ D(w, {
|
|
52
56
|
size: "sm",
|
|
53
57
|
variant: "outline",
|
|
54
|
-
onClick:
|
|
58
|
+
onClick: H,
|
|
55
59
|
"data-testid": "ai-preview-open",
|
|
56
60
|
children: [
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
|
|
59
|
-
|
|
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
|
|
60
64
|
]
|
|
61
65
|
})]
|
|
62
66
|
});
|
|
63
|
-
let
|
|
67
|
+
let J = L.dashboard, Y = o(L.widget, R.widget, R.dashboard), X = j.error ? /* @__PURE__ */ D("div", {
|
|
68
|
+
role: "alert",
|
|
69
|
+
"data-testid": "ai-preview-widget-parent-error",
|
|
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, {
|
|
71
|
+
variant: "outline",
|
|
72
|
+
size: "sm",
|
|
73
|
+
onClick: j.retry,
|
|
74
|
+
children: b("bigconsole.widget.customWidget.action.retry", "Retry")
|
|
75
|
+
})]
|
|
76
|
+
}) : j.loading && !J ? /* @__PURE__ */ D("div", {
|
|
77
|
+
role: "status",
|
|
78
|
+
"data-testid": "ai-preview-widget-parent-loading",
|
|
79
|
+
className: "flex items-center gap-2",
|
|
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) => ({
|
|
64
82
|
id: e,
|
|
65
|
-
label:
|
|
66
|
-
status:
|
|
67
|
-
})),
|
|
83
|
+
label: b(u[e].key, u[e].fallback),
|
|
84
|
+
status: I[e]
|
|
85
|
+
})), Q = [
|
|
68
86
|
{
|
|
69
87
|
id: "datasink",
|
|
70
|
-
label:
|
|
71
|
-
render: () => /* @__PURE__ */
|
|
88
|
+
label: b("bigconsole.widget.aiPreview.tab.dataSink", "Data Sink"),
|
|
89
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
72
90
|
emphasis: "standard",
|
|
73
91
|
padding: "compact",
|
|
74
92
|
headingLevel: 3,
|
|
75
|
-
title:
|
|
76
|
-
description:
|
|
77
|
-
actions:
|
|
78
|
-
children: /* @__PURE__ */
|
|
79
|
-
id:
|
|
80
|
-
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
|
|
81
99
|
})
|
|
82
100
|
}) })
|
|
83
101
|
},
|
|
84
102
|
{
|
|
85
103
|
id: "dashboard",
|
|
86
|
-
label:
|
|
87
|
-
render: () => /* @__PURE__ */
|
|
104
|
+
label: b("bigconsole.widget.aiPreview.tab.dashboard", "Dashboard"),
|
|
105
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
88
106
|
emphasis: "standard",
|
|
89
107
|
padding: "compact",
|
|
90
108
|
headingLevel: 3,
|
|
91
|
-
title:
|
|
92
|
-
description:
|
|
93
|
-
actions:
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
dashboardId:
|
|
96
|
-
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
|
|
97
116
|
})
|
|
98
117
|
}) })
|
|
99
118
|
},
|
|
100
119
|
{
|
|
101
120
|
id: "parser",
|
|
102
|
-
label:
|
|
103
|
-
render: () => /* @__PURE__ */
|
|
121
|
+
label: b("bigconsole.widget.aiPreview.tab.parser", "Parser"),
|
|
122
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
104
123
|
emphasis: "standard",
|
|
105
124
|
padding: "compact",
|
|
106
125
|
headingLevel: 3,
|
|
107
|
-
title:
|
|
108
|
-
description:
|
|
109
|
-
actions:
|
|
110
|
-
children: /* @__PURE__ */
|
|
111
|
-
parserId:
|
|
112
|
-
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
|
|
113
132
|
})
|
|
114
133
|
}) })
|
|
115
134
|
},
|
|
116
135
|
{
|
|
117
136
|
id: "widget",
|
|
118
|
-
label:
|
|
119
|
-
render: () => /* @__PURE__ */
|
|
137
|
+
label: b("bigconsole.widget.aiPreview.tab.widget", "Widget"),
|
|
138
|
+
render: () => /* @__PURE__ */ E(k, { children: /* @__PURE__ */ E(s, {
|
|
120
139
|
emphasis: "standard",
|
|
121
140
|
padding: "compact",
|
|
122
141
|
headingLevel: 3,
|
|
123
|
-
title:
|
|
124
|
-
description:
|
|
125
|
-
actions:
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
dashboardId:
|
|
128
|
-
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
|
|
129
149
|
})
|
|
130
150
|
}) })
|
|
131
151
|
}
|
|
132
152
|
];
|
|
133
|
-
return /* @__PURE__ */
|
|
153
|
+
return /* @__PURE__ */ D("div", {
|
|
134
154
|
"data-testid": "ai-preview-panel",
|
|
135
|
-
style: { paddingRight:
|
|
155
|
+
style: { paddingRight: c },
|
|
136
156
|
className: "mx-4 mt-3 min-w-0 md:mx-6",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
157
|
+
children: [/* @__PURE__ */ E("h2", {
|
|
138
158
|
className: "sr-only",
|
|
139
|
-
children:
|
|
140
|
-
}), /* @__PURE__ */
|
|
141
|
-
title:
|
|
142
|
-
runKey: String(
|
|
143
|
-
steps:
|
|
144
|
-
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,
|
|
145
165
|
follow: "produced",
|
|
146
|
-
caption:
|
|
147
|
-
error:
|
|
148
|
-
meta: /* @__PURE__ */
|
|
149
|
-
state:
|
|
150
|
-
stateLabel:
|
|
151
|
-
updatedLabel:
|
|
152
|
-
updatedAt:
|
|
153
|
-
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)
|
|
154
174
|
}),
|
|
155
|
-
headerActions: /* @__PURE__ */ w
|
|
175
|
+
headerActions: /* @__PURE__ */ E(w, {
|
|
156
176
|
size: "sm",
|
|
157
177
|
variant: "ghost",
|
|
158
|
-
onClick:
|
|
159
|
-
"aria-label":
|
|
178
|
+
onClick: U,
|
|
179
|
+
"aria-label": b("bigconsole.widget.aiPreview.closeAriaLabel", "Close preview"),
|
|
160
180
|
"data-testid": "ai-preview-close",
|
|
161
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ E(C, { className: "size-4" })
|
|
162
182
|
}),
|
|
163
|
-
labels:
|
|
183
|
+
labels: f(b)
|
|
164
184
|
})]
|
|
165
185
|
});
|
|
166
186
|
}
|
|
167
187
|
//#endregion
|
|
168
|
-
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 };
|