@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
|
@@ -8,11 +8,7 @@ export interface PersistedRun {
|
|
|
8
8
|
conversationId?: string;
|
|
9
9
|
previewOpen: boolean;
|
|
10
10
|
steps: Record<PreviewStepKey, PreviewStepStatus>;
|
|
11
|
-
entityIds:
|
|
12
|
-
datasink?: string;
|
|
13
|
-
dashboard?: string;
|
|
14
|
-
parser?: string;
|
|
15
|
-
};
|
|
11
|
+
entityIds: Partial<Record<PreviewStepKey, string>>;
|
|
16
12
|
updatedAt: number | null;
|
|
17
13
|
}
|
|
18
14
|
export declare function runStorageKey(workspaceId: string): string;
|
|
@@ -18,12 +18,8 @@ interface AssistantRunState {
|
|
|
18
18
|
richMounted: boolean;
|
|
19
19
|
prompt: string;
|
|
20
20
|
steps: Record<PreviewStepKey, PreviewStepStatus>;
|
|
21
|
-
/**
|
|
22
|
-
entityIds:
|
|
23
|
-
datasink?: string;
|
|
24
|
-
dashboard?: string;
|
|
25
|
-
parser?: string;
|
|
26
|
-
};
|
|
21
|
+
/** Confirmed resource ids, including widgets whose parent may need resolving. */
|
|
22
|
+
entityIds: Partial<Record<PreviewStepKey, string>>;
|
|
27
23
|
/** Newest "⏳ …" line — what the agent says it is doing this second. */
|
|
28
24
|
caption: string;
|
|
29
25
|
/** Set when the turn fails, so the panel can stop pretending to be live. */
|
|
@@ -43,6 +39,13 @@ interface AssistantRunState {
|
|
|
43
39
|
entityResultOrder: Partial<Record<PreviewStepKey, number>>;
|
|
44
40
|
startRun: (prompt: string, conversationId?: string) => void;
|
|
45
41
|
applyResult: (id: string, output: unknown, messageOrder?: number) => void;
|
|
42
|
+
resolveWidgetDashboard: (scope: {
|
|
43
|
+
widgetId: string;
|
|
44
|
+
dashboardId: string;
|
|
45
|
+
workspaceId: string;
|
|
46
|
+
actorId: string;
|
|
47
|
+
conversationId: string | null;
|
|
48
|
+
}) => void;
|
|
46
49
|
applyProgress: (content: string) => void;
|
|
47
50
|
finishRun: (error: string | null) => void;
|
|
48
51
|
openPreview: () => void;
|
|
@@ -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,
|
|
@@ -125,6 +125,22 @@ var _ = i()((r, i) => ({
|
|
|
125
125
|
updatedAt: Date.now()
|
|
126
126
|
} : { completedResultIds: d };
|
|
127
127
|
}),
|
|
128
|
+
resolveWidgetDashboard: (e) => r((t) => {
|
|
129
|
+
if (t.workspaceId !== e.workspaceId || t.actorId !== e.actorId || t.conversationId !== e.conversationId || t.entityIds.widget !== e.widgetId || !/^[A-Za-z0-9_-]{1,128}$/.test(e.dashboardId) || t.entityIds.dashboard) return t;
|
|
130
|
+
let n = t.entityResultOrder.dashboard, r = t.entityResultOrder.widget;
|
|
131
|
+
return n !== void 0 && r !== void 0 && n > r ? t : {
|
|
132
|
+
entityIds: {
|
|
133
|
+
...t.entityIds,
|
|
134
|
+
dashboard: e.dashboardId
|
|
135
|
+
},
|
|
136
|
+
steps: {
|
|
137
|
+
...t.steps,
|
|
138
|
+
dashboard: t.steps.dashboard === "done" ? "done" : "skipped"
|
|
139
|
+
},
|
|
140
|
+
contentRevision: t.contentRevision + 1,
|
|
141
|
+
updatedAt: Date.now()
|
|
142
|
+
};
|
|
143
|
+
}),
|
|
128
144
|
finishRun: (e) => r((t) => {
|
|
129
145
|
let n = { ...t.steps };
|
|
130
146
|
for (let e of o) n[e] === "running" && (n[e] = "pending");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Resolve relationships omitted from a successful mutation's response selection.
|
|
2
|
+
* Never infer a dashboard from narration or a page id. The gateway authorizes
|
|
3
|
+
* the read in the active workspace; the store rejects late owner/run results.
|
|
4
|
+
*/
|
|
5
|
+
export declare function usePreviewWidgetDashboard(): {
|
|
6
|
+
loading: boolean;
|
|
7
|
+
error: boolean;
|
|
8
|
+
retry: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { GetWidgetDocument as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useBigConsole as t } from "../context/BigConsoleContext.js";
|
|
3
|
+
import "../context/index.js";
|
|
4
|
+
import { useAssistantRunStore as n } from "./assistantRunStore.js";
|
|
5
|
+
import { useEffect as r, useState as i } from "react";
|
|
6
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
7
|
+
//#region src/bigconsole/assistant/usePreviewWidgetDashboard.ts
|
|
8
|
+
function o() {
|
|
9
|
+
let o = a(), { workspaceId: s, currentUser: c } = t(), l = n((e) => e.entityIds.widget), u = n((e) => e.entityIds.dashboard), d = n((e) => e.actorId), f = n((e) => e.workspaceId), p = n((e) => e.conversationId), m = n((e) => e.resolveWidgetDashboard), h = `${s ?? ""}|${d ?? ""}|${p ?? ""}|${l ?? ""}`, [g, _] = i({
|
|
10
|
+
owner: "",
|
|
11
|
+
loading: !1,
|
|
12
|
+
error: !1
|
|
13
|
+
}), [v, y] = i(0), b = !!(l && !u && s && d && f === s && c?.id === d);
|
|
14
|
+
return r(() => {
|
|
15
|
+
if (!b || !l || !s || !d) return;
|
|
16
|
+
let t = !1;
|
|
17
|
+
return (async () => {
|
|
18
|
+
_({
|
|
19
|
+
owner: h,
|
|
20
|
+
loading: !0,
|
|
21
|
+
error: !1
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
let n = await o.query({
|
|
25
|
+
query: e,
|
|
26
|
+
variables: { id: l },
|
|
27
|
+
fetchPolicy: "no-cache",
|
|
28
|
+
context: {
|
|
29
|
+
requiredWorkspaceAuth: !0,
|
|
30
|
+
requiredWorkspaceId: s,
|
|
31
|
+
queryDeduplication: !1
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (t) return;
|
|
35
|
+
let r = n.data?.getWidget;
|
|
36
|
+
if (r?.id !== l || !r.dashboardId) throw Error("Widget dashboard is unavailable");
|
|
37
|
+
m({
|
|
38
|
+
widgetId: l,
|
|
39
|
+
dashboardId: r.dashboardId,
|
|
40
|
+
workspaceId: s,
|
|
41
|
+
actorId: d,
|
|
42
|
+
conversationId: p
|
|
43
|
+
}), _({
|
|
44
|
+
owner: h,
|
|
45
|
+
loading: !1,
|
|
46
|
+
error: !1
|
|
47
|
+
});
|
|
48
|
+
} catch {
|
|
49
|
+
t || _({
|
|
50
|
+
owner: h,
|
|
51
|
+
loading: !1,
|
|
52
|
+
error: !0
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
})(), () => {
|
|
56
|
+
t = !0;
|
|
57
|
+
};
|
|
58
|
+
}, [
|
|
59
|
+
o,
|
|
60
|
+
b,
|
|
61
|
+
l,
|
|
62
|
+
s,
|
|
63
|
+
d,
|
|
64
|
+
p,
|
|
65
|
+
h,
|
|
66
|
+
m,
|
|
67
|
+
v
|
|
68
|
+
]), {
|
|
69
|
+
loading: b && (g.owner !== h || g.loading),
|
|
70
|
+
error: b && g.owner === h && g.error,
|
|
71
|
+
retry: () => y((e) => e + 1)
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { o as usePreviewWidgetDashboard };
|
|
@@ -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 };
|
|
@@ -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;
|