@burdenoff/microfe-bigconsole 2026.1012.2 → 2026.1012.4
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/assistantApi.js +5 -5
- package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +33 -18
- package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +123 -121
- package/dist/bigconsole/components/dashboard/ImportDashboardDialog.js +241 -267
- package/dist/bigconsole/components/dashboard/WidgetPalette.js +154 -150
- package/dist/bigconsole/components/embed/renderer-manifest.js +12 -0
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +122 -1
- package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -224
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgetConfig.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/AdvancedWidgets.js +186 -0
- package/dist/bigconsole/components/widgets/advanced/data.d.ts +36 -0
- package/dist/bigconsole/components/widgets/advanced/data.js +113 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.d.ts +10 -0
- package/dist/bigconsole/components/widgets/advanced/mapData.js +22 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.d.ts +15 -0
- package/dist/bigconsole/components/widgets/advanced/waterfallData.js +28 -0
- package/dist/bigconsole/components/widgets/chart/charts/WaterfallChart.js +34 -37
- package/dist/bigconsole/components/widgets/index.js +1 -1
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.d.ts +2 -0
- package/dist/bigconsole/components/widgets/map-widget/MapWidget.js +64 -63
- package/dist/bigconsole/graphql/widgetCapabilities.d.ts +7 -0
- package/dist/bigconsole/graphql/widgetCapabilities.js +37 -0
- package/dist/bigconsole/hooks/useExportDashboard.js +62 -38
- package/dist/bigconsole/hooks/useImportDashboard.d.ts +2 -12
- package/dist/bigconsole/hooks/useImportDashboard.js +95 -126
- package/dist/bigconsole/hooks/useWidgetCatalog.js +46 -41
- package/dist/bigconsole/hooks/useWidgetOperations.js +113 -88
- package/dist/bigconsole/renderers/adapters/BigConsoleRenderer.js +8 -5
- package/dist/bigconsole/types/index.d.ts +1 -1
- package/dist/bigconsole/utils/advancedWidgetCapabilities.d.ts +14 -0
- package/dist/bigconsole/utils/advancedWidgetCapabilities.js +36 -0
- package/dist/bigconsole/utils/widgetTypeMapping.d.ts +1 -1
- package/dist/bigconsole/utils/widgetTypeMapping.js +13 -2
- package/dist/generated/wspace-operations.d.ts +61 -2
- package/dist/generated/wspace-operations.js +44 -18
- package/dist/generated/wspace-types.d.ts +34 -3
- package/package.json +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useWidgetStore as e } from "../store/widgetStore.js";
|
|
2
2
|
import "../store/index.js";
|
|
3
3
|
import { BatchUpdateWidgetPositionsDocument as t, CreateWidgetDocument as n, DeleteWidgetDocument as r, DuplicateWidgetDocument as i, ListWidgetsByDashboardDocument as a, ListWidgetsForPageDocument as o, RefreshWidgetDataDocument as s, UpdateWidgetDocument as c } from "../../generated/wspace-operations.js";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
4
|
+
import { useBigConsole as l } from "../context/BigConsoleContext.js";
|
|
5
|
+
import "../context/index.js";
|
|
6
|
+
import { loadNativeWidgetCatalog as u } from "../graphql/widgetCapabilities.js";
|
|
7
|
+
import { mapFromFederationWidgetType as d } from "../utils/widgetTypeMapping.js";
|
|
8
|
+
import { nativeFederationTypes as f, widgetTypeForCapabilities as p } from "../utils/advancedWidgetCapabilities.js";
|
|
9
|
+
import m from "./useBigConsoleAnalytics.js";
|
|
10
|
+
import { useCallback as h, useEffect as g, useLayoutEffect as _, useMemo as v, useRef as y, useState as b } from "react";
|
|
11
|
+
import { useApolloClient as x } from "@apollo/client/react";
|
|
8
12
|
//#region src/bigconsole/hooks/useWidgetOperations.ts
|
|
9
|
-
function
|
|
13
|
+
function S(e) {
|
|
10
14
|
let t = e.actions, n = e.metadata, r = e.positionResponsive, i = e.position || {
|
|
11
15
|
x: e.positionX ?? 0,
|
|
12
16
|
y: e.positionY ?? 0,
|
|
@@ -23,7 +27,7 @@ function _(e) {
|
|
|
23
27
|
id: e.id,
|
|
24
28
|
pageId: e.pageId || "local",
|
|
25
29
|
dashboardId: e.dashboardId,
|
|
26
|
-
type: c ||
|
|
30
|
+
type: c || d(e.type || "KPI"),
|
|
27
31
|
title: e.title || "Untitled Widget",
|
|
28
32
|
description: o,
|
|
29
33
|
renderer: e.renderer || "BIGCONSOLE",
|
|
@@ -53,44 +57,59 @@ function _(e) {
|
|
|
53
57
|
updatedAt: e.updatedAt || (/* @__PURE__ */ new Date()).toISOString()
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
|
-
function
|
|
57
|
-
let { skipFetch:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
+
function C(d, C, w = {}) {
|
|
61
|
+
let { skipFetch: T = !1 } = w, [E, D] = b(!1), [O, k] = b(null), A = x(), { workspaceId: j } = l(), M = y(j);
|
|
62
|
+
_(() => (M.current = j, () => {
|
|
63
|
+
M.current = void 0;
|
|
64
|
+
}), [j]);
|
|
65
|
+
let N = m(), P = e((e) => e.widgets), F = e((e) => e.setWidgets), I = e((e) => e.addWidget), L = e((e) => e.updateWidget), R = e((e) => e.removeWidget), z = v(() => Array.from(P.values()), [P]), B = h(async () => {
|
|
66
|
+
if (!(!d && !C)) try {
|
|
67
|
+
D(!0), k(null), C ? F(((await A.query({
|
|
60
68
|
query: a,
|
|
61
|
-
variables: { dashboardId:
|
|
69
|
+
variables: { dashboardId: C },
|
|
62
70
|
fetchPolicy: "network-only"
|
|
63
|
-
})).data?.listWidgetsByDashboard || []).map(
|
|
71
|
+
})).data?.listWidgetsByDashboard || []).map(S)) : d && F(((await A.query({
|
|
64
72
|
query: o,
|
|
65
|
-
variables: { pageId:
|
|
73
|
+
variables: { pageId: d },
|
|
66
74
|
fetchPolicy: "network-only"
|
|
67
|
-
})).data?.listWidgets?.edges || []).map((e) => e.node).map(
|
|
75
|
+
})).data?.listWidgets?.edges || []).map((e) => e.node).map(S));
|
|
68
76
|
} catch (e) {
|
|
69
|
-
|
|
77
|
+
k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to fetch widgets"));
|
|
70
78
|
} finally {
|
|
71
|
-
|
|
79
|
+
D(!1);
|
|
72
80
|
}
|
|
73
81
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
A,
|
|
83
|
+
d,
|
|
84
|
+
C,
|
|
85
|
+
F
|
|
78
86
|
]);
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
}, [
|
|
82
|
-
loading:
|
|
83
|
-
error:
|
|
84
|
-
widgets:
|
|
85
|
-
createWidget:
|
|
87
|
+
return g(() => {
|
|
88
|
+
T || B();
|
|
89
|
+
}, [B, T]), {
|
|
90
|
+
loading: E,
|
|
91
|
+
error: O,
|
|
92
|
+
widgets: z,
|
|
93
|
+
createWidget: h(async (e) => {
|
|
86
94
|
try {
|
|
87
|
-
|
|
88
|
-
let t =
|
|
95
|
+
D(!0), k(null);
|
|
96
|
+
let t = [];
|
|
97
|
+
if ([
|
|
98
|
+
"map",
|
|
99
|
+
"waterfall",
|
|
100
|
+
"sankey",
|
|
101
|
+
"box_plot"
|
|
102
|
+
].includes(e.type)) {
|
|
103
|
+
if (!j || M.current !== j) throw Error("Widget workspace changed.");
|
|
104
|
+
t = f((await u(A, j)).getWidgetTypes);
|
|
105
|
+
}
|
|
106
|
+
if (!j || M.current !== j) throw Error("Widget workspace changed.");
|
|
107
|
+
let r = p(e.type, t), i = {
|
|
89
108
|
...e.config || {},
|
|
90
109
|
_internalWidgetType: e.type
|
|
91
|
-
},
|
|
110
|
+
}, a = {
|
|
92
111
|
pageId: e.pageId,
|
|
93
|
-
type:
|
|
112
|
+
type: r,
|
|
94
113
|
title: e.title,
|
|
95
114
|
renderer: e.renderer || "BIGCONSOLE",
|
|
96
115
|
template: e.template || null,
|
|
@@ -98,7 +117,7 @@ function v(l, v, y = {}) {
|
|
|
98
117
|
datasetId: e.datasetId,
|
|
99
118
|
parserId: e.parserId,
|
|
100
119
|
parserRules: e.parserRules,
|
|
101
|
-
config:
|
|
120
|
+
config: i,
|
|
102
121
|
position: {
|
|
103
122
|
x: e.position.x,
|
|
104
123
|
y: e.position.y,
|
|
@@ -108,24 +127,29 @@ function v(l, v, y = {}) {
|
|
|
108
127
|
refreshInterval: e.refreshInterval,
|
|
109
128
|
metadata: e.metadata
|
|
110
129
|
};
|
|
111
|
-
e.positionResponsive && (
|
|
130
|
+
e.positionResponsive && (a.positionResponsive = {
|
|
112
131
|
xs: e.positionResponsive.xs ?? 12,
|
|
113
132
|
sm: e.positionResponsive.sm ?? 6,
|
|
114
133
|
md: e.positionResponsive.md ?? 4,
|
|
115
134
|
lg: e.positionResponsive.lg ?? 3
|
|
116
|
-
}), e.rowOrder !== void 0 && (
|
|
117
|
-
dashboardId: e.dashboardId ||
|
|
135
|
+
}), e.rowOrder !== void 0 && (a.rowOrder = e.rowOrder), N("bigconsole.widget.create_clicked", {
|
|
136
|
+
dashboardId: e.dashboardId || C,
|
|
118
137
|
pageId: e.pageId,
|
|
119
138
|
widgetType: e.type
|
|
120
139
|
});
|
|
121
|
-
let
|
|
140
|
+
let o = (await A.mutate({
|
|
122
141
|
mutation: n,
|
|
123
|
-
variables: { input:
|
|
142
|
+
variables: { input: a },
|
|
143
|
+
context: {
|
|
144
|
+
requiredWorkspaceAuth: !0,
|
|
145
|
+
requiredWorkspaceId: j,
|
|
146
|
+
queryDeduplication: !1
|
|
147
|
+
}
|
|
124
148
|
})).data?.createBigConsoleWidget;
|
|
125
|
-
if (
|
|
126
|
-
let t =
|
|
127
|
-
return
|
|
128
|
-
dashboardId: t.dashboardId || e.dashboardId ||
|
|
149
|
+
if (o) {
|
|
150
|
+
let t = S(o);
|
|
151
|
+
return I(t), N("bigconsole.widget.created", {
|
|
152
|
+
dashboardId: t.dashboardId || e.dashboardId || C,
|
|
129
153
|
pageId: t.pageId,
|
|
130
154
|
widgetId: t.id,
|
|
131
155
|
widgetType: t.type
|
|
@@ -133,19 +157,20 @@ function v(l, v, y = {}) {
|
|
|
133
157
|
}
|
|
134
158
|
return null;
|
|
135
159
|
} catch (e) {
|
|
136
|
-
return
|
|
160
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to create widget")), null;
|
|
137
161
|
} finally {
|
|
138
|
-
|
|
162
|
+
D(!1);
|
|
139
163
|
}
|
|
140
164
|
}, [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
A,
|
|
166
|
+
I,
|
|
167
|
+
C,
|
|
168
|
+
N,
|
|
169
|
+
j
|
|
145
170
|
]),
|
|
146
|
-
updateWidget:
|
|
171
|
+
updateWidget: h(async (t) => {
|
|
147
172
|
try {
|
|
148
|
-
if (
|
|
173
|
+
if (D(!0), k(null), !e.getState().widgets.get(t.id)) throw Error(`Widget not found: ${t.id}`);
|
|
149
174
|
let n = { id: t.id };
|
|
150
175
|
t.title !== void 0 && (n.title = t.title), t.renderer !== void 0 && (n.renderer = t.renderer), t.template !== void 0 && (n.template = t.template), t.dataSinkId !== void 0 && (n.dataSinkId = t.dataSinkId), t.datasetId !== void 0 && (n.datasetId = t.datasetId), t.parserId !== void 0 && (n.parserId = t.parserId), t.parserRules !== void 0 && (n.parserRules = t.parserRules), t.config !== void 0 && (n.config = t.config), t.refreshInterval !== void 0 && (n.refreshInterval = t.refreshInterval), t.metadata !== void 0 && (n.metadata = t.metadata), t.position && (n.position = {
|
|
151
176
|
x: t.position.x,
|
|
@@ -158,47 +183,47 @@ function v(l, v, y = {}) {
|
|
|
158
183
|
md: t.positionResponsive.md,
|
|
159
184
|
lg: t.positionResponsive.lg
|
|
160
185
|
}), t.rowOrder !== void 0 && (n.rowOrder = t.rowOrder);
|
|
161
|
-
let r = await
|
|
186
|
+
let r = await A.mutate({
|
|
162
187
|
mutation: c,
|
|
163
188
|
variables: { input: n }
|
|
164
189
|
});
|
|
165
190
|
if (r.error) throw r.error;
|
|
166
191
|
let i = r.data?.updateBigConsoleWidget;
|
|
167
192
|
if (i) {
|
|
168
|
-
let e =
|
|
169
|
-
return
|
|
193
|
+
let e = S(i);
|
|
194
|
+
return L(t.id, e), e;
|
|
170
195
|
}
|
|
171
196
|
return null;
|
|
172
197
|
} catch (e) {
|
|
173
|
-
return
|
|
198
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to update widget")), null;
|
|
174
199
|
} finally {
|
|
175
|
-
|
|
200
|
+
D(!1);
|
|
176
201
|
}
|
|
177
|
-
}, [
|
|
178
|
-
deleteWidget:
|
|
202
|
+
}, [A, L]),
|
|
203
|
+
deleteWidget: h(async (e) => {
|
|
179
204
|
try {
|
|
180
|
-
return
|
|
205
|
+
return D(!0), k(null), (await A.mutate({
|
|
181
206
|
mutation: r,
|
|
182
207
|
variables: { id: e }
|
|
183
|
-
})).data?.deleteBigConsoleWidget ? (
|
|
208
|
+
})).data?.deleteBigConsoleWidget ? (R(e), !0) : !1;
|
|
184
209
|
} catch (e) {
|
|
185
|
-
return
|
|
210
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to delete widget")), !1;
|
|
186
211
|
} finally {
|
|
187
|
-
|
|
212
|
+
D(!1);
|
|
188
213
|
}
|
|
189
|
-
}, [
|
|
190
|
-
duplicateWidget:
|
|
214
|
+
}, [A, R]),
|
|
215
|
+
duplicateWidget: h(async (t, n, r) => {
|
|
191
216
|
try {
|
|
192
|
-
|
|
217
|
+
D(!0), k(null);
|
|
193
218
|
let a = e.getState().widgets.get(t);
|
|
194
219
|
if (!a) throw Error(`Widget not found: ${t}`);
|
|
195
|
-
|
|
196
|
-
dashboardId: a.dashboardId ||
|
|
220
|
+
N("bigconsole.widget.duplicate_clicked", {
|
|
221
|
+
dashboardId: a.dashboardId || C,
|
|
197
222
|
pageId: a.pageId,
|
|
198
223
|
sourceWidgetId: t,
|
|
199
224
|
widgetType: a.type
|
|
200
225
|
});
|
|
201
|
-
let o = await
|
|
226
|
+
let o = await A.mutate({
|
|
202
227
|
mutation: i,
|
|
203
228
|
variables: {
|
|
204
229
|
id: t,
|
|
@@ -214,9 +239,9 @@ function v(l, v, y = {}) {
|
|
|
214
239
|
if (o.error) throw o.error;
|
|
215
240
|
let s = o.data?.duplicateWidget;
|
|
216
241
|
if (s) {
|
|
217
|
-
let e =
|
|
218
|
-
return
|
|
219
|
-
dashboardId: e.dashboardId || a.dashboardId ||
|
|
242
|
+
let e = S(s);
|
|
243
|
+
return I(e), N("bigconsole.widget.duplicated", {
|
|
244
|
+
dashboardId: e.dashboardId || a.dashboardId || C,
|
|
220
245
|
pageId: e.pageId,
|
|
221
246
|
widgetId: e.id,
|
|
222
247
|
sourceWidgetId: t,
|
|
@@ -225,19 +250,19 @@ function v(l, v, y = {}) {
|
|
|
225
250
|
}
|
|
226
251
|
return null;
|
|
227
252
|
} catch (e) {
|
|
228
|
-
return
|
|
253
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to duplicate widget")), null;
|
|
229
254
|
} finally {
|
|
230
|
-
|
|
255
|
+
D(!1);
|
|
231
256
|
}
|
|
232
257
|
}, [
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
258
|
+
A,
|
|
259
|
+
I,
|
|
260
|
+
C,
|
|
261
|
+
N
|
|
237
262
|
]),
|
|
238
|
-
batchUpdatePositions:
|
|
263
|
+
batchUpdatePositions: h(async (e) => {
|
|
239
264
|
try {
|
|
240
|
-
return
|
|
265
|
+
return D(!0), k(null), (await A.mutate({
|
|
241
266
|
mutation: t,
|
|
242
267
|
variables: { updates: e.map((e) => ({
|
|
243
268
|
id: e.id,
|
|
@@ -249,7 +274,7 @@ function v(l, v, y = {}) {
|
|
|
249
274
|
}
|
|
250
275
|
})) }
|
|
251
276
|
})).data?.batchUpdateWidgetPositions ? (e.forEach((e) => {
|
|
252
|
-
|
|
277
|
+
L(e.id, {
|
|
253
278
|
position: e.position,
|
|
254
279
|
positionX: e.position.x,
|
|
255
280
|
positionY: e.position.y,
|
|
@@ -259,23 +284,23 @@ function v(l, v, y = {}) {
|
|
|
259
284
|
});
|
|
260
285
|
}), !0) : !1;
|
|
261
286
|
} catch (e) {
|
|
262
|
-
return
|
|
287
|
+
return k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to batch update positions")), !1;
|
|
263
288
|
} finally {
|
|
264
|
-
|
|
289
|
+
D(!1);
|
|
265
290
|
}
|
|
266
|
-
}, [
|
|
267
|
-
refreshWidgetData:
|
|
291
|
+
}, [A, L]),
|
|
292
|
+
refreshWidgetData: h(async (e) => {
|
|
268
293
|
try {
|
|
269
|
-
await
|
|
294
|
+
await A.mutate({
|
|
270
295
|
mutation: s,
|
|
271
296
|
variables: { widgetId: e }
|
|
272
297
|
});
|
|
273
298
|
} catch {}
|
|
274
|
-
}, [
|
|
275
|
-
refetch:
|
|
276
|
-
await
|
|
277
|
-
}, [
|
|
299
|
+
}, [A]),
|
|
300
|
+
refetch: h(async () => {
|
|
301
|
+
await B();
|
|
302
|
+
}, [B])
|
|
278
303
|
};
|
|
279
304
|
}
|
|
280
305
|
//#endregion
|
|
281
|
-
export {
|
|
306
|
+
export { C as default, S as normalizeWidget };
|
|
@@ -5,9 +5,12 @@ function r(e, ...t) {
|
|
|
5
5
|
for (let n of t) if (e[n]) return { default: e[n] };
|
|
6
6
|
return { default: e.default };
|
|
7
7
|
}
|
|
8
|
-
var i = e.lazy(() => import("../../components/widgets/metric-card/index.js").then((e) => r(e, "MetricCardWidget"))), a = e.lazy(() => import("../../components/widgets/chart/index.js").then((e) => r(e, "ChartWidget"))), o = e.lazy(() => import("../../components/widgets/table/index.js").then((e) => r(e, "TableWidget"))), s = e.lazy(() => import("../../components/widgets/gauge/index.js").then((e) => r(e, "GaugeWidget"))), c = e.lazy(() => import("../../components/widgets/progress/index.js").then((e) => r(e, "ProgressWidget"))), l = e.lazy(() => import("../../components/widgets/list/index.js").then((e) => r(e, "ListWidget"))), u = e.lazy(() => import("../../components/widgets/text-widget/index.js").then((e) => r(e, "TextWidget"))), d = e.lazy(() => import("../../components/widgets/kanban/index.js").then((e) => r(e, "KanbanWidget"))), f = e.lazy(() => import("../../components/widgets/timeline/index.js").then((e) => r(e, "TimelineWidget"))), p = e.lazy(() => import("../../components/widgets/calendar/index.js").then((e) => r(e, "CalendarWidget"))), m = e.lazy(() => import("../../components/widgets/map-widget/index.js").then((e) => r(e, "MapWidget"))), h = e.lazy(() => import("../../components/widgets/heatmap/index.js").then((e) => r(e, "HeatmapWidget"))), g = e.lazy(() => import("../../components/widgets/funnel/index.js").then((e) => r(e, "FunnelWidget", "FunnelChartWidget"))), _ = e.lazy(() => import("../../components/widgets/retention/index.js").then((e) => r(e, "RetentionWidget"))), v = e.lazy(() => import("../../components/widgets/iframe-widget/index.js").then((e) => r(e, "IframeWidget"))), y = e.lazy(() => import("../../components/widgets/custom/index.js").then((e) => r(e, "CustomWidget"))), b = e.lazy(() => import("../../components/widgets/kpi-comparison/index.js").then((e) => r(e, "KpiComparisonWidget"))), x = e.lazy(() => import("../../components/widgets/pivot-table/index.js").then((e) => r(e, "PivotTableWidget"))), S = {
|
|
8
|
+
var i = e.lazy(() => import("../../components/widgets/metric-card/index.js").then((e) => r(e, "MetricCardWidget"))), a = e.lazy(() => import("../../components/widgets/chart/index.js").then((e) => r(e, "ChartWidget"))), o = e.lazy(() => import("../../components/widgets/table/index.js").then((e) => r(e, "TableWidget"))), s = e.lazy(() => import("../../components/widgets/gauge/index.js").then((e) => r(e, "GaugeWidget"))), c = e.lazy(() => import("../../components/widgets/progress/index.js").then((e) => r(e, "ProgressWidget"))), l = e.lazy(() => import("../../components/widgets/list/index.js").then((e) => r(e, "ListWidget"))), u = e.lazy(() => import("../../components/widgets/text-widget/index.js").then((e) => r(e, "TextWidget"))), d = e.lazy(() => import("../../components/widgets/kanban/index.js").then((e) => r(e, "KanbanWidget"))), f = e.lazy(() => import("../../components/widgets/timeline/index.js").then((e) => r(e, "TimelineWidget"))), p = e.lazy(() => import("../../components/widgets/calendar/index.js").then((e) => r(e, "CalendarWidget"))), m = e.lazy(() => import("../../components/widgets/map-widget/index.js").then((e) => r(e, "MapWidget"))), h = e.lazy(() => import("../../components/widgets/heatmap/index.js").then((e) => r(e, "HeatmapWidget"))), g = e.lazy(() => import("../../components/widgets/funnel/index.js").then((e) => r(e, "FunnelWidget", "FunnelChartWidget"))), _ = e.lazy(() => import("../../components/widgets/retention/index.js").then((e) => r(e, "RetentionWidget"))), v = e.lazy(() => import("../../components/widgets/iframe-widget/index.js").then((e) => r(e, "IframeWidget"))), y = e.lazy(() => import("../../components/widgets/custom/index.js").then((e) => r(e, "CustomWidget"))), b = e.lazy(() => import("../../components/widgets/kpi-comparison/index.js").then((e) => r(e, "KpiComparisonWidget"))), x = e.lazy(() => import("../../components/widgets/pivot-table/index.js").then((e) => r(e, "PivotTableWidget"))), S = e.lazy(() => import("../../components/widgets/form/index.js").then((e) => r(e, "FormWidget"))), C = e.lazy(() => import("../../components/widgets/advanced/AdvancedWidgets.js").then((e) => ({ default: e.SankeyWidget }))), w = e.lazy(() => import("../../components/widgets/advanced/AdvancedWidgets.js").then((e) => ({ default: e.BoxPlotWidget }))), T = {
|
|
9
9
|
metric_card: i,
|
|
10
10
|
chart: a,
|
|
11
|
+
waterfall: e.lazy(() => import("../../components/widgets/advanced/AdvancedWidgets.js").then((e) => ({ default: e.WaterfallWidget }))),
|
|
12
|
+
sankey: C,
|
|
13
|
+
box_plot: w,
|
|
11
14
|
table: o,
|
|
12
15
|
gauge: s,
|
|
13
16
|
progress: c,
|
|
@@ -20,7 +23,7 @@ var i = e.lazy(() => import("../../components/widgets/metric-card/index.js").the
|
|
|
20
23
|
heatmap: h,
|
|
21
24
|
funnel_chart: g,
|
|
22
25
|
retention: _,
|
|
23
|
-
form:
|
|
26
|
+
form: S,
|
|
24
27
|
iframe: v,
|
|
25
28
|
custom: y,
|
|
26
29
|
kpi_card_comparison: b,
|
|
@@ -30,8 +33,8 @@ var i = e.lazy(() => import("../../components/widgets/metric-card/index.js").the
|
|
|
30
33
|
metric: i,
|
|
31
34
|
funnel: g,
|
|
32
35
|
pivot: x
|
|
33
|
-
},
|
|
34
|
-
let d =
|
|
36
|
+
}, E = ({ widget: r, data: i, isEditMode: a, isSelected: o, isLoading: s, error: c, onDrilldown: l, onAction: u }) => {
|
|
37
|
+
let d = T[r.type?.toLowerCase() || ""];
|
|
35
38
|
return d ? /* @__PURE__ */ t(e.Suspense, {
|
|
36
39
|
fallback: /* @__PURE__ */ t("div", {
|
|
37
40
|
className: "flex items-center justify-center h-full animate-in fade-in duration-200",
|
|
@@ -61,4 +64,4 @@ var i = e.lazy(() => import("../../components/widgets/metric-card/index.js").the
|
|
|
61
64
|
});
|
|
62
65
|
};
|
|
63
66
|
//#endregion
|
|
64
|
-
export {
|
|
67
|
+
export { E as default };
|
|
@@ -83,7 +83,7 @@ export interface BigConsoleRootProps extends MicrofrontendRootProps {
|
|
|
83
83
|
* Inherits the same host-shell contract as the main BigConsole root.
|
|
84
84
|
*/
|
|
85
85
|
export type AdminRootProps = BigConsoleRootProps;
|
|
86
|
-
export type WidgetType = 'kpi_card_comparison' | 'metric_card' | 'chart' | 'funnel_chart' | 'table' | 'pivot_table' | 'gauge' | 'progress' | 'list' | 'form' | 'text' | 'iframe' | 'map' | 'heatmap' | 'calendar' | 'kanban' | 'timeline' | 'retention' | 'custom';
|
|
86
|
+
export type WidgetType = 'kpi_card_comparison' | 'metric_card' | 'chart' | 'waterfall' | 'sankey' | 'box_plot' | 'funnel_chart' | 'table' | 'pivot_table' | 'gauge' | 'progress' | 'list' | 'form' | 'text' | 'iframe' | 'map' | 'heatmap' | 'calendar' | 'kanban' | 'timeline' | 'retention' | 'custom';
|
|
87
87
|
export type NavigationMode = 'SAME_WINDOW' | 'NEW_TAB' | 'MODAL' | 'IN_PLACE';
|
|
88
88
|
export interface WidgetPosition {
|
|
89
89
|
x: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WidgetDefinition } from '../components/widgets/WidgetRegistry';
|
|
2
|
+
import { FederationWidgetType } from './widgetTypeMapping';
|
|
3
|
+
|
|
4
|
+
/** Do not advertise a new native type while a gateway still serves the old enum. */
|
|
5
|
+
export declare function filterAdvancedWidgetDefinitions(definitions: WidgetDefinition[], visibleTypes: readonly string[]): WidgetDefinition[];
|
|
6
|
+
/** Existing Map creation stays compatible with an older gateway during rollout. */
|
|
7
|
+
export declare function widgetTypeForCapabilities(type: string, visibleTypes: readonly string[]): FederationWidgetType;
|
|
8
|
+
export interface NativeWidgetCapability {
|
|
9
|
+
type: string;
|
|
10
|
+
federationType?: string | null;
|
|
11
|
+
source?: string | null;
|
|
12
|
+
}
|
|
13
|
+
/** Server-owned catalog metadata, not schema introspection or user configuration. */
|
|
14
|
+
export declare function nativeFederationTypes(entries: readonly NativeWidgetCapability[]): string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { normalizeWidgetTypeForApi as e } from "./widgetTypeMapping.js";
|
|
2
|
+
//#region src/bigconsole/utils/advancedWidgetCapabilities.ts
|
|
3
|
+
var t = {
|
|
4
|
+
waterfall: "WATERFALL",
|
|
5
|
+
sankey: "SANKEY",
|
|
6
|
+
box_plot: "BOX_PLOT"
|
|
7
|
+
};
|
|
8
|
+
function n(e, n) {
|
|
9
|
+
let r = new Set(n);
|
|
10
|
+
return e.filter((e) => {
|
|
11
|
+
let n = t[e.type];
|
|
12
|
+
return !n || r.has(n);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function r(n, r) {
|
|
16
|
+
let i = n.toLowerCase();
|
|
17
|
+
if (i === "map" && !r.includes("MAP")) return "HEATMAP";
|
|
18
|
+
let a = t[i];
|
|
19
|
+
if (a && !r.includes(a)) throw Error("This widget type is not available through the current gateway yet. Refresh after the update finishes.");
|
|
20
|
+
return e(n);
|
|
21
|
+
}
|
|
22
|
+
function i(e) {
|
|
23
|
+
let n = new Set([
|
|
24
|
+
"MAP",
|
|
25
|
+
"WATERFALL",
|
|
26
|
+
"SANKEY",
|
|
27
|
+
"BOX_PLOT"
|
|
28
|
+
]);
|
|
29
|
+
return [...new Set(e.flatMap((e) => {
|
|
30
|
+
if (e.source && e.source !== "BUILTIN") return [];
|
|
31
|
+
let r = e.type === "map" ? "MAP" : t[e.type];
|
|
32
|
+
return r && e.federationType === r && n.has(r) ? [r] : [];
|
|
33
|
+
}))];
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { n as filterAdvancedWidgetDefinitions, i as nativeFederationTypes, r as widgetTypeForCapabilities };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WidgetType as InternalWidgetType } from '../types';
|
|
2
2
|
|
|
3
|
-
export type FederationWidgetType = 'AREA_CHART' | 'BAR_CHART' | 'FUNNEL' | 'HEATMAP' | 'KPI' | 'LINE_CHART' | 'PIE_CHART' | 'RETENTION' | 'TABLE';
|
|
3
|
+
export type FederationWidgetType = 'AREA_CHART' | 'BAR_CHART' | 'FUNNEL' | 'HEATMAP' | 'KPI' | 'LINE_CHART' | 'PIE_CHART' | 'RETENTION' | 'TABLE' | 'MAP' | 'WATERFALL' | 'SANKEY' | 'BOX_PLOT';
|
|
4
4
|
/**
|
|
5
5
|
* Maps internal UI widget types to federation-accessible GraphQL enum values.
|
|
6
6
|
*
|
|
@@ -4,6 +4,9 @@ function e(e) {
|
|
|
4
4
|
kpi_card_comparison: "KPI",
|
|
5
5
|
metric_card: "KPI",
|
|
6
6
|
chart: "LINE_CHART",
|
|
7
|
+
waterfall: "WATERFALL",
|
|
8
|
+
sankey: "SANKEY",
|
|
9
|
+
box_plot: "BOX_PLOT",
|
|
7
10
|
funnel_chart: "FUNNEL",
|
|
8
11
|
table: "TABLE",
|
|
9
12
|
pivot_table: "TABLE",
|
|
@@ -13,7 +16,7 @@ function e(e) {
|
|
|
13
16
|
form: "TABLE",
|
|
14
17
|
text: "KPI",
|
|
15
18
|
iframe: "KPI",
|
|
16
|
-
map: "
|
|
19
|
+
map: "MAP",
|
|
17
20
|
heatmap: "HEATMAP",
|
|
18
21
|
calendar: "TABLE",
|
|
19
22
|
kanban: "TABLE",
|
|
@@ -32,6 +35,10 @@ function t(e) {
|
|
|
32
35
|
TABLE: "table",
|
|
33
36
|
FUNNEL: "funnel_chart",
|
|
34
37
|
HEATMAP: "heatmap",
|
|
38
|
+
MAP: "map",
|
|
39
|
+
WATERFALL: "waterfall",
|
|
40
|
+
SANKEY: "sankey",
|
|
41
|
+
BOX_PLOT: "box_plot",
|
|
35
42
|
RETENTION: "table"
|
|
36
43
|
}[e.toUpperCase()] || "metric_card";
|
|
37
44
|
}
|
|
@@ -45,7 +52,11 @@ function n(e) {
|
|
|
45
52
|
"LINE_CHART",
|
|
46
53
|
"PIE_CHART",
|
|
47
54
|
"RETENTION",
|
|
48
|
-
"TABLE"
|
|
55
|
+
"TABLE",
|
|
56
|
+
"MAP",
|
|
57
|
+
"WATERFALL",
|
|
58
|
+
"SANKEY",
|
|
59
|
+
"BOX_PLOT"
|
|
49
60
|
]).has(e.toUpperCase());
|
|
50
61
|
}
|
|
51
62
|
function r(t) {
|
|
@@ -5049,7 +5049,9 @@ export type WidgetTranslationFieldsFragment = {
|
|
|
5049
5049
|
};
|
|
5050
5050
|
export type WidgetTypeInfoFieldsFragment = {
|
|
5051
5051
|
__typename?: 'WidgetTypeInfo';
|
|
5052
|
-
type:
|
|
5052
|
+
type: string;
|
|
5053
|
+
federationType?: string | null;
|
|
5054
|
+
source?: string | null;
|
|
5053
5055
|
label: string;
|
|
5054
5056
|
description: string;
|
|
5055
5057
|
icon: string;
|
|
@@ -5842,6 +5844,37 @@ export type GetEventWebhookMappingQuery = {
|
|
|
5842
5844
|
} | null;
|
|
5843
5845
|
} | null;
|
|
5844
5846
|
};
|
|
5847
|
+
export type GetLegacyWidgetTypesQueryVariables = Types.Exact<{
|
|
5848
|
+
[key: string]: never;
|
|
5849
|
+
}>;
|
|
5850
|
+
export type GetLegacyWidgetTypesQuery = {
|
|
5851
|
+
__typename?: 'Query';
|
|
5852
|
+
getWidgetTypes: Array<{
|
|
5853
|
+
__typename?: 'WidgetTypeInfo';
|
|
5854
|
+
type: string;
|
|
5855
|
+
source?: string | null;
|
|
5856
|
+
label: string;
|
|
5857
|
+
description: string;
|
|
5858
|
+
icon: string;
|
|
5859
|
+
category: string;
|
|
5860
|
+
defaultConfig: Record<string, unknown>;
|
|
5861
|
+
defaultSize: {
|
|
5862
|
+
__typename?: 'WidgetSizeInfo';
|
|
5863
|
+
width: number;
|
|
5864
|
+
height: number;
|
|
5865
|
+
};
|
|
5866
|
+
minSize: {
|
|
5867
|
+
__typename?: 'WidgetSizeInfo';
|
|
5868
|
+
width: number;
|
|
5869
|
+
height: number;
|
|
5870
|
+
};
|
|
5871
|
+
maxSize: {
|
|
5872
|
+
__typename?: 'WidgetSizeInfo';
|
|
5873
|
+
width: number;
|
|
5874
|
+
height: number;
|
|
5875
|
+
};
|
|
5876
|
+
}>;
|
|
5877
|
+
};
|
|
5845
5878
|
export type GetWidgetQueryVariables = Types.Exact<{
|
|
5846
5879
|
id: Types.Scalars['ID']['input'];
|
|
5847
5880
|
}>;
|
|
@@ -5995,7 +6028,9 @@ export type GetWidgetTypesQuery = {
|
|
|
5995
6028
|
__typename?: 'Query';
|
|
5996
6029
|
getWidgetTypes: Array<{
|
|
5997
6030
|
__typename?: 'WidgetTypeInfo';
|
|
5998
|
-
type:
|
|
6031
|
+
type: string;
|
|
6032
|
+
federationType?: string | null;
|
|
6033
|
+
source?: string | null;
|
|
5999
6034
|
label: string;
|
|
6000
6035
|
description: string;
|
|
6001
6036
|
icon: string;
|
|
@@ -10704,6 +10739,30 @@ export type GetEventWebhookMappingQueryHookResult = ReturnType<typeof useGetEven
|
|
|
10704
10739
|
export type GetEventWebhookMappingLazyQueryHookResult = ReturnType<typeof useGetEventWebhookMappingLazyQuery>;
|
|
10705
10740
|
export type GetEventWebhookMappingSuspenseQueryHookResult = ReturnType<typeof useGetEventWebhookMappingSuspenseQuery>;
|
|
10706
10741
|
export type GetEventWebhookMappingQueryResult = Apollo.QueryResult<Types.GetEventWebhookMappingQuery, Types.GetEventWebhookMappingQueryVariables>;
|
|
10742
|
+
export declare const GetLegacyWidgetTypesDocument: Apollo.DocumentNode;
|
|
10743
|
+
/**
|
|
10744
|
+
* __useGetLegacyWidgetTypesQuery__
|
|
10745
|
+
*
|
|
10746
|
+
* To run a query within a React component, call `useGetLegacyWidgetTypesQuery` and pass it any options that fit your needs.
|
|
10747
|
+
* When your component renders, `useGetLegacyWidgetTypesQuery` returns an object from Apollo Client that contains loading, error, and data properties
|
|
10748
|
+
* you can use to render your UI.
|
|
10749
|
+
*
|
|
10750
|
+
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
|
|
10751
|
+
*
|
|
10752
|
+
* @example
|
|
10753
|
+
* const { data, loading, error } = useGetLegacyWidgetTypesQuery({
|
|
10754
|
+
* variables: {
|
|
10755
|
+
* },
|
|
10756
|
+
* });
|
|
10757
|
+
*/
|
|
10758
|
+
export declare function useGetLegacyWidgetTypesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>): ApolloReactHooks.useQuery.Result<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables, "empty" | "complete" | "streaming", Types.GetLegacyWidgetTypesQueryVariables>;
|
|
10759
|
+
export declare function useGetLegacyWidgetTypesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables, "empty" | "complete" | "streaming">;
|
|
10760
|
+
export declare function useGetLegacyWidgetTypesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>;
|
|
10761
|
+
export declare function useGetLegacyWidgetTypesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.GetLegacyWidgetTypesQuery | undefined, Types.GetLegacyWidgetTypesQueryVariables>;
|
|
10762
|
+
export type GetLegacyWidgetTypesQueryHookResult = ReturnType<typeof useGetLegacyWidgetTypesQuery>;
|
|
10763
|
+
export type GetLegacyWidgetTypesLazyQueryHookResult = ReturnType<typeof useGetLegacyWidgetTypesLazyQuery>;
|
|
10764
|
+
export type GetLegacyWidgetTypesSuspenseQueryHookResult = ReturnType<typeof useGetLegacyWidgetTypesSuspenseQuery>;
|
|
10765
|
+
export type GetLegacyWidgetTypesQueryResult = Apollo.QueryResult<Types.GetLegacyWidgetTypesQuery, Types.GetLegacyWidgetTypesQueryVariables>;
|
|
10707
10766
|
export declare const GetWidgetDocument: Apollo.DocumentNode;
|
|
10708
10767
|
/**
|
|
10709
10768
|
* __useGetWidgetQuery__
|