@burdenoff/microfe-bigconsole 2026.729.2 → 2026.729.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/components/widgets/ActionConfigDialog.js +412 -305
- package/dist/bigconsole/components/widgets/ActionConfigDialog.js.map +1 -1
- package/dist/bigconsole/components/widgets/PropertiesPanel.js +481 -420
- package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
- package/dist/bigconsole/hooks/useEventWebhooks.js +6 -2
- package/dist/bigconsole/hooks/useEventWebhooks.js.map +1 -1
- package/package.json +3 -3
|
@@ -4,27 +4,28 @@ import { getWidgetDefinition as t } from "./WidgetRegistry.js";
|
|
|
4
4
|
import n from "../../hooks/useWidgetOperations.js";
|
|
5
5
|
import r from "../../hooks/useDrilldownOperations.js";
|
|
6
6
|
import i from "../../hooks/useWidgetActions.js";
|
|
7
|
-
import a from "../../hooks/
|
|
8
|
-
import o from "../../hooks/
|
|
7
|
+
import a from "../../hooks/useEventWebhooks.js";
|
|
8
|
+
import o from "../../hooks/useDataSinkOperations.js";
|
|
9
|
+
import s from "../../hooks/useParserOperations.js";
|
|
9
10
|
import "../../hooks/index.js";
|
|
10
|
-
import { getWidgetBinding as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
11
|
+
import { getWidgetBinding as c, getWidgetBindingStatus as ee, reconcilePanelConfig as te, serializeWidgetBinding as ne } from "../../utils/widgetBinding.js";
|
|
12
|
+
import re from "./ActionConfigDialog.js";
|
|
13
|
+
import ie from "./webhook-config/WebhookConfigPanel.js";
|
|
13
14
|
import "./webhook-config/index.js";
|
|
14
|
-
import
|
|
15
|
+
import ae from "./event-logs/EventLogViewer.js";
|
|
15
16
|
import "./event-logs/index.js";
|
|
16
|
-
import
|
|
17
|
-
import { AdvancedSection as
|
|
18
|
-
import { AppearanceSection as
|
|
19
|
-
import { GeneralSection as
|
|
20
|
-
import { DataBindingSection as
|
|
17
|
+
import oe from "./DrilldownConfigPanel.js";
|
|
18
|
+
import { AdvancedSection as se } from "../builder/inspector/AdvancedSection.js";
|
|
19
|
+
import { AppearanceSection as ce } from "../builder/inspector/AppearanceSection.js";
|
|
20
|
+
import { GeneralSection as le } from "../builder/inspector/GeneralSection.js";
|
|
21
|
+
import { DataBindingSection as ue } from "../builder/inspector/DataBindingSection.js";
|
|
21
22
|
import "../builder/inspector/index.js";
|
|
22
|
-
import { memo as l, useCallback as u, useEffect as d, useRef as
|
|
23
|
-
import { Check as
|
|
24
|
-
import { Button as
|
|
25
|
-
import { Fragment as
|
|
23
|
+
import { memo as l, useCallback as u, useEffect as d, useMemo as de, useRef as fe, useState as f } from "react";
|
|
24
|
+
import { Check as p, ChevronDown as pe, ChevronUp as me, ExternalLink as m, Info as h, Pencil as he, Plus as ge, Trash2 as _e, X as ve } from "lucide-react";
|
|
25
|
+
import { Button as g, Card as ye, CardContent as be, Input as _, Label as v, Select as xe, SelectContent as Se, SelectItem as y, SelectTrigger as b, SelectValue as x, Sheet as Ce, SheetContent as we, SheetDescription as Te, SheetHeader as Ee, SheetTitle as De, Spinner as Oe, Tabs as ke, TabsContent as S, TabsList as Ae, TabsTrigger as C, Textarea as w } from "@burdenoff/fe-libs/ui";
|
|
26
|
+
import { Fragment as je, jsx as T, jsxs as E } from "react/jsx-runtime";
|
|
26
27
|
//#region src/bigconsole/components/widgets/PropertiesPanel.tsx
|
|
27
|
-
var
|
|
28
|
+
var Me = [
|
|
28
29
|
{
|
|
29
30
|
value: "BIGCONSOLE",
|
|
30
31
|
label: "BigConsole Native",
|
|
@@ -45,7 +46,7 @@ var Ee = [
|
|
|
45
46
|
label: "Custom",
|
|
46
47
|
description: "Custom React component"
|
|
47
48
|
}
|
|
48
|
-
],
|
|
49
|
+
], Ne = [
|
|
49
50
|
{
|
|
50
51
|
value: "DATASINK",
|
|
51
52
|
label: "DataSink",
|
|
@@ -76,14 +77,18 @@ var Ee = [
|
|
|
76
77
|
label: "Sample JSON",
|
|
77
78
|
description: "Manually enter sample JSON data"
|
|
78
79
|
}
|
|
79
|
-
]
|
|
80
|
+
];
|
|
81
|
+
function Pe(e) {
|
|
82
|
+
return `widget:${e.toLowerCase().replace(/\s+/g, "_")}:clicked`;
|
|
83
|
+
}
|
|
84
|
+
var Fe = {
|
|
80
85
|
PRIMARY: "bg-action-primary",
|
|
81
86
|
SECONDARY: "bg-muted-foreground",
|
|
82
87
|
SUCCESS: "bg-status-success-bg",
|
|
83
88
|
WARNING: "bg-status-warning-bg",
|
|
84
89
|
DANGER: "bg-status-error-bg"
|
|
85
90
|
};
|
|
86
|
-
function
|
|
91
|
+
function Ie(e) {
|
|
87
92
|
if (!e) return {};
|
|
88
93
|
let t = Array.isArray(e) ? e[0] : e;
|
|
89
94
|
if (!t || typeof t != "object") return {};
|
|
@@ -127,8 +132,8 @@ function ke(e) {
|
|
|
127
132
|
xAxisField: a
|
|
128
133
|
};
|
|
129
134
|
}
|
|
130
|
-
var
|
|
131
|
-
let [n, r] =
|
|
135
|
+
var Le = l(function({ widget: e, onSave: t }) {
|
|
136
|
+
let [n, r] = f(""), [i, a] = f(null), o = fe(!1);
|
|
132
137
|
d(() => {
|
|
133
138
|
try {
|
|
134
139
|
r(e.template && typeof e.template == "object" ? JSON.stringify(e.template, null, 2) : ""), a(null), o.current = !0;
|
|
@@ -153,27 +158,27 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
153
158
|
a(e.message);
|
|
154
159
|
}
|
|
155
160
|
}, [n, t]);
|
|
156
|
-
return /* @__PURE__ */
|
|
161
|
+
return /* @__PURE__ */ E("div", {
|
|
157
162
|
style: {
|
|
158
163
|
paddingTop: "var(--space-formGap)",
|
|
159
164
|
borderTop: "1px solid var(--color-border)"
|
|
160
165
|
},
|
|
161
166
|
children: [
|
|
162
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ E("div", {
|
|
163
168
|
style: {
|
|
164
169
|
display: "flex",
|
|
165
170
|
alignItems: "center",
|
|
166
171
|
justifyContent: "space-between",
|
|
167
172
|
marginBottom: "var(--space-controlGap)"
|
|
168
173
|
},
|
|
169
|
-
children: [/* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ T("label", {
|
|
170
175
|
style: {
|
|
171
176
|
fontSize: "var(--font-size-body-sm)",
|
|
172
177
|
fontWeight: "var(--font-weight-semibold)",
|
|
173
178
|
color: "var(--color-text-primary)"
|
|
174
179
|
},
|
|
175
180
|
children: "Template (JSON)"
|
|
176
|
-
}), i && /* @__PURE__ */
|
|
181
|
+
}), i && /* @__PURE__ */ T("span", {
|
|
177
182
|
style: {
|
|
178
183
|
fontSize: "var(--font-size-body-sm)",
|
|
179
184
|
color: "var(--color-status-error-text)",
|
|
@@ -182,7 +187,7 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
182
187
|
children: "Invalid JSON"
|
|
183
188
|
})]
|
|
184
189
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ T(w, {
|
|
186
191
|
value: n,
|
|
187
192
|
onChange: s,
|
|
188
193
|
spellCheck: !1,
|
|
@@ -195,7 +200,7 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
195
200
|
resize: "vertical"
|
|
196
201
|
}
|
|
197
202
|
}),
|
|
198
|
-
i && /* @__PURE__ */
|
|
203
|
+
i && /* @__PURE__ */ T("p", {
|
|
199
204
|
style: {
|
|
200
205
|
fontSize: "var(--font-size-body-sm)",
|
|
201
206
|
color: "var(--color-status-error-text)",
|
|
@@ -206,14 +211,14 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
206
211
|
},
|
|
207
212
|
children: i
|
|
208
213
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ E("div", {
|
|
210
215
|
style: {
|
|
211
216
|
display: "flex",
|
|
212
217
|
alignItems: "center",
|
|
213
218
|
gap: "var(--space-controlGap)",
|
|
214
219
|
marginTop: "var(--space-controlGap)"
|
|
215
220
|
},
|
|
216
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ T(g, {
|
|
217
222
|
variant: "outline",
|
|
218
223
|
size: "sm",
|
|
219
224
|
onClick: c,
|
|
@@ -223,7 +228,7 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
223
228
|
fontWeight: "var(--font-weight-semibold)"
|
|
224
229
|
},
|
|
225
230
|
children: "Format"
|
|
226
|
-
}), !i && n.trim() !== "" && /* @__PURE__ */
|
|
231
|
+
}), !i && n.trim() !== "" && /* @__PURE__ */ E("span", {
|
|
227
232
|
style: {
|
|
228
233
|
fontSize: "var(--font-size-body-sm)",
|
|
229
234
|
color: "var(--color-status-success-text)",
|
|
@@ -231,13 +236,13 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
231
236
|
alignItems: "center",
|
|
232
237
|
gap: "4px"
|
|
233
238
|
},
|
|
234
|
-
children: [/* @__PURE__ */
|
|
239
|
+
children: [/* @__PURE__ */ T(p, { style: {
|
|
235
240
|
width: "12px",
|
|
236
241
|
height: "12px"
|
|
237
242
|
} }), "Valid JSON"]
|
|
238
243
|
})]
|
|
239
244
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ E("div", {
|
|
241
246
|
style: {
|
|
242
247
|
display: "flex",
|
|
243
248
|
alignItems: "center",
|
|
@@ -249,11 +254,11 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
249
254
|
borderTop: "1px solid var(--color-border)"
|
|
250
255
|
},
|
|
251
256
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ T("span", {
|
|
253
258
|
style: { fontWeight: "var(--font-weight-medium)" },
|
|
254
259
|
children: "Ctrl+S to save"
|
|
255
260
|
}),
|
|
256
|
-
e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */
|
|
261
|
+
e.renderer === "ADAPTIVE_CARD" && /* @__PURE__ */ E("a", {
|
|
257
262
|
href: "https://adaptivecards.io/designer/",
|
|
258
263
|
target: "_blank",
|
|
259
264
|
rel: "noopener noreferrer",
|
|
@@ -266,12 +271,12 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
266
271
|
fontWeight: "var(--font-weight-medium)",
|
|
267
272
|
textDecoration: "none"
|
|
268
273
|
},
|
|
269
|
-
children: ["Designer", /* @__PURE__ */
|
|
274
|
+
children: ["Designer", /* @__PURE__ */ T(m, { style: {
|
|
270
275
|
height: "var(--size-icon-sm)",
|
|
271
276
|
width: "var(--size-icon-sm)"
|
|
272
277
|
} })]
|
|
273
278
|
}),
|
|
274
|
-
e.renderer === "BLOCKKIT" && /* @__PURE__ */
|
|
279
|
+
e.renderer === "BLOCKKIT" && /* @__PURE__ */ E("a", {
|
|
275
280
|
href: "https://app.slack.com/block-kit-builder",
|
|
276
281
|
target: "_blank",
|
|
277
282
|
rel: "noopener noreferrer",
|
|
@@ -284,7 +289,7 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
284
289
|
fontWeight: "var(--font-weight-medium)",
|
|
285
290
|
textDecoration: "none"
|
|
286
291
|
},
|
|
287
|
-
children: ["Block Kit Builder", /* @__PURE__ */
|
|
292
|
+
children: ["Block Kit Builder", /* @__PURE__ */ T(m, { style: {
|
|
288
293
|
height: "var(--size-icon-sm)",
|
|
289
294
|
width: "var(--size-icon-sm)"
|
|
290
295
|
} })]
|
|
@@ -294,8 +299,8 @@ var Ae = l(function({ widget: e, onSave: t }) {
|
|
|
294
299
|
]
|
|
295
300
|
});
|
|
296
301
|
});
|
|
297
|
-
function
|
|
298
|
-
let t = e, n =
|
|
302
|
+
function Re(e) {
|
|
303
|
+
let t = e, n = c({
|
|
299
304
|
dataSinkId: t.dataSinkId,
|
|
300
305
|
parserId: t.parserId,
|
|
301
306
|
config: e.config || {}
|
|
@@ -322,194 +327,252 @@ function je(e) {
|
|
|
322
327
|
} : void 0
|
|
323
328
|
};
|
|
324
329
|
}
|
|
325
|
-
var
|
|
326
|
-
let [
|
|
330
|
+
var ze = l(function({ isOpen: l, onClose: m }) {
|
|
331
|
+
let [ze, Be] = f("general"), [D, O] = f("idle"), [k, A] = f(null), [j, M] = f(!1), N = e((e) => e.selectedWidgetId), Ve = e((e) => e.widgets), P = e((e) => e.updateWidget), F = N ? Ve.get(N) : void 0, I = fe(null), He = fe({});
|
|
327
332
|
d(() => {
|
|
328
|
-
if (!
|
|
329
|
-
|
|
333
|
+
if (!N) {
|
|
334
|
+
I.current = null, A(null), M(!1), O("idle");
|
|
330
335
|
return;
|
|
331
336
|
}
|
|
332
|
-
let e =
|
|
333
|
-
if (
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
} else
|
|
337
|
+
let e = I.current !== N;
|
|
338
|
+
if (I.current = N, F) {
|
|
339
|
+
if (j && !e) return;
|
|
340
|
+
A(Re(F)), He.current = F.config || {}, M(!1), O("idle");
|
|
341
|
+
} else A(null), M(!1), O("idle");
|
|
337
342
|
}, [
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
343
|
+
N,
|
|
344
|
+
F,
|
|
345
|
+
j
|
|
341
346
|
]);
|
|
342
|
-
let { updateWidget:
|
|
343
|
-
consoleId:
|
|
347
|
+
let { updateWidget: Ue } = n(F?.pageId, F?.dashboardId, { skipFetch: !0 }), { createDrilldown: We, updateDrilldown: Ge, deleteDrilldown: Ke } = r(), { dataSinks: L } = o({ skipFetch: !1 }), [qe, Je] = f(null), { executeParser: Ye } = s({
|
|
348
|
+
consoleId: F?.dashboardId,
|
|
344
349
|
skipFetch: !0
|
|
345
|
-
}), [
|
|
350
|
+
}), [Xe, Ze] = f(!1), [Qe, R] = f(void 0), [$e, z] = f(!1), [et, B] = f(null);
|
|
346
351
|
d(() => {
|
|
347
|
-
|
|
348
|
-
}, [
|
|
349
|
-
let { actions:
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
352
|
+
R(void 0), z(!1), B(null), Ze(!1);
|
|
353
|
+
}, [N]);
|
|
354
|
+
let { actions: V, loading: H, createAction: tt, updateAction: nt, deleteAction: rt, reorderActions: U } = i(N || void 0), { webhooks: it, loading: at, createWebhook: ot, updateWebhook: st, deleteWebhook: W, refetch: ct } = a({
|
|
355
|
+
widgetId: N || void 0,
|
|
356
|
+
skipFetch: !N
|
|
357
|
+
}), G = u((e, t) => {
|
|
358
|
+
let n = Pe(t);
|
|
359
|
+
return e.find((e) => e.widgetId === N && e.eventPattern === n) ?? null;
|
|
360
|
+
}, [N]), K = u((e) => G(it, e), [G, it]), lt = u(async (e, t) => {
|
|
361
|
+
if (!N || t === void 0) return !0;
|
|
362
|
+
let n = Pe(e), r = K(e);
|
|
363
|
+
return !r && at && (r = G((await ct())?.data?.listEventWebhookMappings ?? [], e)), t && t.url ? r ? await st({
|
|
364
|
+
id: r.id,
|
|
365
|
+
eventPattern: n,
|
|
366
|
+
webhookUrl: t.url,
|
|
367
|
+
method: t.method,
|
|
368
|
+
isActive: !0
|
|
369
|
+
}) !== null : await ot({
|
|
370
|
+
widgetId: N,
|
|
371
|
+
eventPattern: n,
|
|
372
|
+
webhookUrl: t.url,
|
|
373
|
+
method: t.method
|
|
374
|
+
}) !== null : t === null && r ? W(r.id) : !0;
|
|
375
|
+
}, [
|
|
376
|
+
N,
|
|
377
|
+
K,
|
|
378
|
+
at,
|
|
379
|
+
ct,
|
|
380
|
+
G,
|
|
381
|
+
ot,
|
|
382
|
+
st,
|
|
383
|
+
W
|
|
384
|
+
]), [ut, q] = f(!1), [J, Y] = f(void 0), [dt, ft] = f(!1), [pt, X] = f(void 0), [mt, Z] = f(null), ht = de(() => {
|
|
385
|
+
if (!J) return null;
|
|
386
|
+
let e = K(J.name);
|
|
387
|
+
return e ? {
|
|
388
|
+
url: e.webhookUrl,
|
|
389
|
+
method: e.method
|
|
390
|
+
} : null;
|
|
391
|
+
}, [J, K]), gt = pt === void 0 ? ht : pt, _t = de(() => {
|
|
392
|
+
let e = /* @__PURE__ */ new Map();
|
|
393
|
+
for (let t of V) {
|
|
394
|
+
let n = K(t.name);
|
|
395
|
+
n && e.set(t.name, n);
|
|
396
|
+
}
|
|
397
|
+
return e;
|
|
398
|
+
}, [V, K]), vt = u(() => {
|
|
399
|
+
X(void 0), Z(null), Y(void 0), q(!0);
|
|
400
|
+
}, []), yt = u((e) => {
|
|
401
|
+
X(void 0), Z(null), Y(e), q(!0);
|
|
402
|
+
}, []), bt = u(async (e, t) => {
|
|
403
|
+
if (N) {
|
|
404
|
+
ft(!0), Z(null);
|
|
356
405
|
try {
|
|
357
|
-
let
|
|
358
|
-
if (
|
|
359
|
-
let
|
|
360
|
-
if (
|
|
361
|
-
let
|
|
362
|
-
|
|
363
|
-
} else
|
|
364
|
-
|
|
406
|
+
let n = "id" in e && !!e.id, r = null;
|
|
407
|
+
if (r = n ? await nt(e) : await tt(e), r) {
|
|
408
|
+
let e = [...V];
|
|
409
|
+
if (n) {
|
|
410
|
+
let t = e.findIndex((e) => e.id === r?.id);
|
|
411
|
+
t >= 0 && (e[t] = r);
|
|
412
|
+
} else e.push(r);
|
|
413
|
+
if (P(N, { actions: e.sort((e, t) => e.order - t.order) }), !await lt(r.name, t)) {
|
|
414
|
+
X(t), Z(t ? "The button was saved, but its webhook could not be saved. Check the URL and try again." : "The button was saved, but its old webhook could not be removed. Try again."), Y(r);
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
X(void 0), Z(null), q(!1), Y(void 0);
|
|
365
418
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
419
|
+
} catch (e) {
|
|
420
|
+
console.warn("Failed to save widget action:", e), Z(e instanceof Error ? e.message : "Could not save the button. Please try again.");
|
|
421
|
+
} finally {
|
|
422
|
+
ft(!1);
|
|
369
423
|
}
|
|
370
424
|
}
|
|
371
425
|
}, [
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
426
|
+
N,
|
|
427
|
+
V,
|
|
428
|
+
tt,
|
|
429
|
+
nt,
|
|
430
|
+
P,
|
|
431
|
+
lt
|
|
432
|
+
]), xt = u(async (e) => {
|
|
433
|
+
if (N && window.confirm("Are you sure you want to delete this action?")) {
|
|
434
|
+
let t = V.find((t) => t.id === e);
|
|
435
|
+
if (await rt(e) && (P(N, { actions: V.filter((t) => t.id !== e) }), t)) {
|
|
436
|
+
let e = K(t.name);
|
|
437
|
+
e && await W(e.id);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
379
440
|
}, [
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
441
|
+
N,
|
|
442
|
+
V,
|
|
443
|
+
rt,
|
|
444
|
+
P,
|
|
445
|
+
K,
|
|
446
|
+
W
|
|
447
|
+
]), St = u(async (e) => {
|
|
448
|
+
if (!N || e === 0) return;
|
|
449
|
+
let t = [...V].sort((e, t) => e.order - t.order), n = t.map((e) => e.id);
|
|
450
|
+
[n[e - 1], n[e]] = [n[e], n[e - 1]], await U(n) && P(N, { actions: t.map((e, t) => ({
|
|
388
451
|
...e,
|
|
389
452
|
order: n.indexOf(e.id)
|
|
390
453
|
})).sort((e, t) => e.order - t.order) });
|
|
391
454
|
}, [
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
]),
|
|
397
|
-
if (!
|
|
398
|
-
let t = [...
|
|
455
|
+
N,
|
|
456
|
+
V,
|
|
457
|
+
U,
|
|
458
|
+
P
|
|
459
|
+
]), Ct = u(async (e) => {
|
|
460
|
+
if (!N) return;
|
|
461
|
+
let t = [...V].sort((e, t) => e.order - t.order);
|
|
399
462
|
if (e === t.length - 1) return;
|
|
400
463
|
let n = t.map((e) => e.id);
|
|
401
|
-
[n[e], n[e + 1]] = [n[e + 1], n[e]], await
|
|
464
|
+
[n[e], n[e + 1]] = [n[e + 1], n[e]], await U(n) && P(N, { actions: t.map((e, t) => ({
|
|
402
465
|
...e,
|
|
403
466
|
order: n.indexOf(e.id)
|
|
404
467
|
})).sort((e, t) => e.order - t.order) });
|
|
405
468
|
}, [
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
469
|
+
N,
|
|
470
|
+
V,
|
|
471
|
+
U,
|
|
472
|
+
P
|
|
410
473
|
]);
|
|
411
474
|
d(() => {
|
|
412
|
-
|
|
475
|
+
N && V.length >= 0 && !H && P(N, { actions: V });
|
|
413
476
|
}, [
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
477
|
+
N,
|
|
478
|
+
V,
|
|
479
|
+
H,
|
|
480
|
+
P
|
|
418
481
|
]);
|
|
419
482
|
let Q = u((e, t) => {
|
|
420
|
-
|
|
483
|
+
A((n) => n && {
|
|
421
484
|
...n,
|
|
422
485
|
[e]: t
|
|
423
|
-
}),
|
|
486
|
+
}), M(!0);
|
|
424
487
|
}, []), $ = u((e) => {
|
|
425
|
-
|
|
488
|
+
A((t) => t && {
|
|
426
489
|
...t,
|
|
427
490
|
config: e
|
|
428
|
-
}),
|
|
491
|
+
}), M(!0);
|
|
429
492
|
}, []);
|
|
430
493
|
d(() => {
|
|
431
|
-
if (
|
|
432
|
-
let e =
|
|
433
|
-
e &&
|
|
434
|
-
} else
|
|
435
|
-
}, [
|
|
436
|
-
let
|
|
437
|
-
if (
|
|
438
|
-
let t =
|
|
439
|
-
t && (Q("dataSinkId", t.id),
|
|
494
|
+
if (k?.dataSinkId && L.length > 0) {
|
|
495
|
+
let e = L.find((e) => e.id === k.dataSinkId);
|
|
496
|
+
e && Je(e.key);
|
|
497
|
+
} else Je(null);
|
|
498
|
+
}, [k?.dataSinkId, L]);
|
|
499
|
+
let wt = u((e) => {
|
|
500
|
+
if (R(void 0), z(!1), B(null), Je(e), e) {
|
|
501
|
+
let t = L.find((t) => t.key === e);
|
|
502
|
+
t && (Q("dataSinkId", t.id), A((t) => t && {
|
|
440
503
|
...t,
|
|
441
504
|
config: {
|
|
442
505
|
...t.config,
|
|
443
506
|
dataSinkKey: e
|
|
444
507
|
}
|
|
445
|
-
}),
|
|
446
|
-
} else Q("dataSinkId", void 0),
|
|
508
|
+
}), M(!0));
|
|
509
|
+
} else Q("dataSinkId", void 0), A((e) => e && {
|
|
447
510
|
...e,
|
|
448
511
|
config: {
|
|
449
512
|
...e.config,
|
|
450
513
|
dataSinkKey: void 0
|
|
451
514
|
},
|
|
452
515
|
parserId: void 0
|
|
453
|
-
}),
|
|
454
|
-
}, [
|
|
455
|
-
if (Q("parserId", e || void 0),
|
|
456
|
-
|
|
516
|
+
}), M(!0);
|
|
517
|
+
}, [L, Q]), Tt = u(async (e) => {
|
|
518
|
+
if (Q("parserId", e || void 0), R(void 0), z(!1), B(null), e && F) {
|
|
519
|
+
Ze(!0);
|
|
457
520
|
try {
|
|
458
|
-
let t = await
|
|
521
|
+
let t = await Ye(e);
|
|
459
522
|
if (t?.success) {
|
|
460
|
-
|
|
461
|
-
let e =
|
|
462
|
-
(e.labelField || e.valueField) && (
|
|
523
|
+
R(t.output), z(!0);
|
|
524
|
+
let e = Ie(t.output);
|
|
525
|
+
(e.labelField || e.valueField) && (A((t) => {
|
|
463
526
|
if (!t) return t;
|
|
464
527
|
let n = t.config || {}, r = { ...n };
|
|
465
528
|
return e.labelField && !n.labelField && (r.labelField = e.labelField), e.valueField && !n.valueField && (r.valueField = e.valueField), e.xAxisField && !n.xAxisField && (r.xAxisField = e.xAxisField), {
|
|
466
529
|
...t,
|
|
467
530
|
config: r
|
|
468
531
|
};
|
|
469
|
-
}),
|
|
470
|
-
} else
|
|
532
|
+
}), M(!0));
|
|
533
|
+
} else z(!0), B(t?.error || "The parser could not produce a preview.");
|
|
471
534
|
} catch (e) {
|
|
472
|
-
|
|
535
|
+
z(!0), B(e instanceof Error ? e.message : "The parser could not produce a preview."), console.warn("Failed to auto-detect parser fields:", e);
|
|
473
536
|
} finally {
|
|
474
|
-
|
|
537
|
+
Ze(!1);
|
|
475
538
|
}
|
|
476
539
|
}
|
|
477
540
|
}, [
|
|
478
541
|
Q,
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
]),
|
|
482
|
-
if (!(!
|
|
483
|
-
|
|
542
|
+
Ye,
|
|
543
|
+
F
|
|
544
|
+
]), Et = u(async () => {
|
|
545
|
+
if (!(!F || !k)) {
|
|
546
|
+
O("saving");
|
|
484
547
|
try {
|
|
485
548
|
let t = {
|
|
486
|
-
...
|
|
487
|
-
description:
|
|
488
|
-
}, n =
|
|
489
|
-
dataSinkId:
|
|
490
|
-
parserId:
|
|
549
|
+
...F.metadata || {},
|
|
550
|
+
description: k.description || ""
|
|
551
|
+
}, n = te(e.getState().widgets.get(F.id)?.config ?? {}, He.current, k.config), r = ne(c({
|
|
552
|
+
dataSinkId: k.dataSinkId,
|
|
553
|
+
parserId: k.parserId,
|
|
491
554
|
config: {
|
|
492
555
|
...n,
|
|
493
556
|
binding: void 0
|
|
494
557
|
}
|
|
495
|
-
}), n), i = await
|
|
496
|
-
id:
|
|
497
|
-
title:
|
|
498
|
-
renderer:
|
|
499
|
-
template:
|
|
558
|
+
}), n), i = await Ue({
|
|
559
|
+
id: F.id,
|
|
560
|
+
title: k.title,
|
|
561
|
+
renderer: k.renderer,
|
|
562
|
+
template: k.template,
|
|
500
563
|
config: r.config,
|
|
501
|
-
refreshInterval:
|
|
564
|
+
refreshInterval: k.refreshInterval,
|
|
502
565
|
dataSinkId: r.dataSinkId,
|
|
503
|
-
datasetId:
|
|
566
|
+
datasetId: k.datasetId,
|
|
504
567
|
parserId: r.parserId,
|
|
505
|
-
parserRules:
|
|
568
|
+
parserRules: k.parserRules,
|
|
506
569
|
metadata: t
|
|
507
|
-
}), a =
|
|
508
|
-
if (
|
|
509
|
-
let { enabled: e, targetDashboardId: t, navigationMode: n, parameterMapping: r, passGlobalFilters: i, maxDepth: o, openIn: s } =
|
|
510
|
-
if (
|
|
511
|
-
let c = await
|
|
512
|
-
id:
|
|
570
|
+
}), a = F.drilldown;
|
|
571
|
+
if (k.drilldownConfig) {
|
|
572
|
+
let { enabled: e, targetDashboardId: t, navigationMode: n, parameterMapping: r, passGlobalFilters: i, maxDepth: o, openIn: s } = k.drilldownConfig;
|
|
573
|
+
if (F.drilldown?.id) {
|
|
574
|
+
let c = await Ge({
|
|
575
|
+
id: F.drilldown.id,
|
|
513
576
|
targetDashboardId: t,
|
|
514
577
|
parameterMapping: r,
|
|
515
578
|
navigationMode: n,
|
|
@@ -520,8 +583,8 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
520
583
|
});
|
|
521
584
|
c && (a = c);
|
|
522
585
|
} else if (t) {
|
|
523
|
-
let c = await
|
|
524
|
-
sourceWidgetId:
|
|
586
|
+
let c = await We({
|
|
587
|
+
sourceWidgetId: F.id,
|
|
525
588
|
targetDashboardId: t,
|
|
526
589
|
parameterMapping: r || {},
|
|
527
590
|
navigationMode: n,
|
|
@@ -534,48 +597,48 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
534
597
|
enabled: e
|
|
535
598
|
});
|
|
536
599
|
}
|
|
537
|
-
} else
|
|
538
|
-
i ? (
|
|
539
|
-
title:
|
|
540
|
-
description:
|
|
541
|
-
renderer:
|
|
542
|
-
template:
|
|
600
|
+
} else F.drilldown?.id && !k.drilldownConfig && (await Ke(F.drilldown.id), a = void 0);
|
|
601
|
+
i ? (P(F.id, {
|
|
602
|
+
title: k.title,
|
|
603
|
+
description: k.description,
|
|
604
|
+
renderer: k.renderer,
|
|
605
|
+
template: k.template,
|
|
543
606
|
config: r.config,
|
|
544
|
-
refreshInterval:
|
|
607
|
+
refreshInterval: k.refreshInterval,
|
|
545
608
|
dataSinkId: r.dataSinkId,
|
|
546
|
-
datasetId:
|
|
609
|
+
datasetId: k.datasetId,
|
|
547
610
|
parserId: r.parserId,
|
|
548
|
-
parserRules:
|
|
611
|
+
parserRules: k.parserRules,
|
|
549
612
|
drilldown: a,
|
|
550
613
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
551
|
-
}),
|
|
614
|
+
}), O("saved"), M(!1), setTimeout(() => O("idle"), 2e3)) : O("error");
|
|
552
615
|
} catch {
|
|
553
|
-
|
|
616
|
+
O("error");
|
|
554
617
|
}
|
|
555
618
|
}
|
|
556
619
|
}, [
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
]),
|
|
565
|
-
|
|
566
|
-
}, [
|
|
620
|
+
F,
|
|
621
|
+
k,
|
|
622
|
+
Ue,
|
|
623
|
+
P,
|
|
624
|
+
We,
|
|
625
|
+
Ge,
|
|
626
|
+
Ke
|
|
627
|
+
]), Dt = u(() => {
|
|
628
|
+
F && (A(Re(F)), He.current = F.config || {}, M(!1), O("idle"));
|
|
629
|
+
}, [F]), Ot = u((e) => {
|
|
567
630
|
$(e);
|
|
568
|
-
}, [$]),
|
|
569
|
-
|
|
631
|
+
}, [$]), kt = u((e) => {
|
|
632
|
+
A((t) => t && {
|
|
570
633
|
...t,
|
|
571
634
|
drilldownConfig: e
|
|
572
|
-
}),
|
|
573
|
-
}, []),
|
|
574
|
-
return /* @__PURE__ */
|
|
635
|
+
}), M(!0);
|
|
636
|
+
}, []), At = F ? t(F.type) : null;
|
|
637
|
+
return /* @__PURE__ */ T(Ce, {
|
|
575
638
|
open: l,
|
|
576
|
-
onOpenChange: (e) => !e &&
|
|
639
|
+
onOpenChange: (e) => !e && m(),
|
|
577
640
|
modal: !1,
|
|
578
|
-
children: /* @__PURE__ */
|
|
641
|
+
children: /* @__PURE__ */ E(we, {
|
|
579
642
|
style: {
|
|
580
643
|
width: "420px",
|
|
581
644
|
maxWidth: "90vw",
|
|
@@ -586,20 +649,20 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
586
649
|
overflow: "hidden"
|
|
587
650
|
},
|
|
588
651
|
children: [
|
|
589
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ T(Ee, {
|
|
590
653
|
style: {
|
|
591
654
|
padding: "var(--space-cardPadding)",
|
|
592
655
|
borderBottom: "1px solid var(--color-border)",
|
|
593
656
|
backgroundColor: "var(--color-bg-surface)",
|
|
594
657
|
flexShrink: 0
|
|
595
658
|
},
|
|
596
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ E("div", {
|
|
597
660
|
style: {
|
|
598
661
|
display: "flex",
|
|
599
662
|
alignItems: "center",
|
|
600
663
|
gap: "var(--space-controlGap)"
|
|
601
664
|
},
|
|
602
|
-
children: [/* @__PURE__ */
|
|
665
|
+
children: [/* @__PURE__ */ T("div", {
|
|
603
666
|
style: {
|
|
604
667
|
display: "flex",
|
|
605
668
|
height: "var(--size-controlHeight-lg)",
|
|
@@ -611,62 +674,62 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
611
674
|
boxShadow: "var(--shadow-elevation-2)",
|
|
612
675
|
flexShrink: 0
|
|
613
676
|
},
|
|
614
|
-
children: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ T(h, { style: {
|
|
615
678
|
height: "var(--size-icon-md)",
|
|
616
679
|
width: "var(--size-icon-md)",
|
|
617
680
|
color: "var(--color-action-primary-text)"
|
|
618
681
|
} })
|
|
619
|
-
}), /* @__PURE__ */
|
|
682
|
+
}), /* @__PURE__ */ E("div", {
|
|
620
683
|
style: {
|
|
621
684
|
flex: 1,
|
|
622
685
|
minWidth: 0
|
|
623
686
|
},
|
|
624
|
-
children: [/* @__PURE__ */
|
|
687
|
+
children: [/* @__PURE__ */ E("div", {
|
|
625
688
|
style: {
|
|
626
689
|
display: "flex",
|
|
627
690
|
alignItems: "center",
|
|
628
691
|
gap: "var(--space-iconGap)"
|
|
629
692
|
},
|
|
630
693
|
children: [
|
|
631
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ T(De, {
|
|
632
695
|
style: {
|
|
633
696
|
fontSize: "var(--font-size-body-md)",
|
|
634
697
|
fontWeight: "var(--font-weight-bold)",
|
|
635
698
|
color: "var(--color-text-primary)",
|
|
636
699
|
margin: 0
|
|
637
700
|
},
|
|
638
|
-
children:
|
|
701
|
+
children: F ? "Widget Properties" : "Properties"
|
|
639
702
|
}),
|
|
640
|
-
|
|
703
|
+
D === "saving" && /* @__PURE__ */ T(Oe, { style: {
|
|
641
704
|
height: "var(--size-icon-sm)",
|
|
642
705
|
width: "var(--size-icon-sm)"
|
|
643
706
|
} }),
|
|
644
|
-
|
|
707
|
+
D === "saved" && /* @__PURE__ */ T(p, { style: {
|
|
645
708
|
height: "var(--size-icon-sm)",
|
|
646
709
|
width: "var(--size-icon-sm)",
|
|
647
710
|
color: "var(--color-status-success-bg)"
|
|
648
711
|
} }),
|
|
649
|
-
|
|
712
|
+
D === "error" && /* @__PURE__ */ T(ve, { style: {
|
|
650
713
|
height: "var(--size-icon-sm)",
|
|
651
714
|
width: "var(--size-icon-sm)",
|
|
652
715
|
color: "var(--color-status-error-bg)"
|
|
653
716
|
} })
|
|
654
717
|
]
|
|
655
|
-
}),
|
|
718
|
+
}), At && /* @__PURE__ */ T(Te, {
|
|
656
719
|
style: {
|
|
657
720
|
fontSize: "var(--font-size-body-sm)",
|
|
658
721
|
color: "var(--color-text-secondary)",
|
|
659
722
|
margin: "var(--space-controlGap) 0 0 0",
|
|
660
723
|
fontWeight: "var(--font-weight-medium)"
|
|
661
724
|
},
|
|
662
|
-
children:
|
|
725
|
+
children: At.name
|
|
663
726
|
})]
|
|
664
727
|
})]
|
|
665
728
|
})
|
|
666
729
|
}),
|
|
667
|
-
|
|
668
|
-
value:
|
|
669
|
-
onValueChange: (e) =>
|
|
730
|
+
F ? /* @__PURE__ */ E(ke, {
|
|
731
|
+
value: ze,
|
|
732
|
+
onValueChange: (e) => Be(e),
|
|
670
733
|
style: {
|
|
671
734
|
flex: 1,
|
|
672
735
|
display: "flex",
|
|
@@ -674,7 +737,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
674
737
|
minHeight: 0,
|
|
675
738
|
overflow: "hidden"
|
|
676
739
|
},
|
|
677
|
-
children: [/* @__PURE__ */
|
|
740
|
+
children: [/* @__PURE__ */ E(Ae, {
|
|
678
741
|
style: {
|
|
679
742
|
width: "100%",
|
|
680
743
|
display: "flex",
|
|
@@ -689,7 +752,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
689
752
|
overflowX: "auto"
|
|
690
753
|
},
|
|
691
754
|
children: [
|
|
692
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ T(C, {
|
|
693
756
|
value: "general",
|
|
694
757
|
style: {
|
|
695
758
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -699,7 +762,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
699
762
|
},
|
|
700
763
|
children: "General"
|
|
701
764
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
765
|
+
/* @__PURE__ */ T(C, {
|
|
703
766
|
value: "data",
|
|
704
767
|
style: {
|
|
705
768
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -709,7 +772,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
709
772
|
},
|
|
710
773
|
children: "Data"
|
|
711
774
|
}),
|
|
712
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ T(C, {
|
|
713
776
|
value: "advanced",
|
|
714
777
|
style: {
|
|
715
778
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -719,7 +782,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
719
782
|
},
|
|
720
783
|
children: "Advanced"
|
|
721
784
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
785
|
+
/* @__PURE__ */ T(C, {
|
|
723
786
|
value: "appearance",
|
|
724
787
|
style: {
|
|
725
788
|
fontWeight: "var(--font-weight-semibold)",
|
|
@@ -730,7 +793,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
730
793
|
children: "Style"
|
|
731
794
|
})
|
|
732
795
|
]
|
|
733
|
-
}), /* @__PURE__ */
|
|
796
|
+
}), /* @__PURE__ */ E("div", {
|
|
734
797
|
style: {
|
|
735
798
|
flex: 1,
|
|
736
799
|
overflow: "auto",
|
|
@@ -738,83 +801,83 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
738
801
|
minHeight: 0
|
|
739
802
|
},
|
|
740
803
|
children: [
|
|
741
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ T(S, {
|
|
742
805
|
value: "general",
|
|
743
806
|
className: "mt-0",
|
|
744
|
-
children:
|
|
807
|
+
children: k && /* @__PURE__ */ T("div", {
|
|
745
808
|
style: {
|
|
746
809
|
display: "flex",
|
|
747
810
|
flexDirection: "column",
|
|
748
811
|
gap: "var(--space-formGap)"
|
|
749
812
|
},
|
|
750
|
-
children: /* @__PURE__ */
|
|
751
|
-
title:
|
|
752
|
-
description:
|
|
753
|
-
refreshInterval:
|
|
813
|
+
children: /* @__PURE__ */ T(le, {
|
|
814
|
+
title: k.title,
|
|
815
|
+
description: k.description,
|
|
816
|
+
refreshInterval: k.refreshInterval,
|
|
754
817
|
onTitleChange: (e) => Q("title", e),
|
|
755
818
|
onDescriptionChange: (e) => Q("description", e),
|
|
756
819
|
onRefreshIntervalChange: (e) => Q("refreshInterval", e)
|
|
757
820
|
})
|
|
758
821
|
})
|
|
759
822
|
}),
|
|
760
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ T(S, {
|
|
761
824
|
value: "data",
|
|
762
825
|
className: "mt-0 space-y-4",
|
|
763
|
-
children:
|
|
826
|
+
children: k && /* @__PURE__ */ E(je, { children: [
|
|
764
827
|
(() => {
|
|
765
|
-
let e =
|
|
766
|
-
dataSinkId:
|
|
767
|
-
parserId:
|
|
828
|
+
let e = c({
|
|
829
|
+
dataSinkId: k.dataSinkId,
|
|
830
|
+
parserId: k.parserId,
|
|
768
831
|
config: {
|
|
769
|
-
...
|
|
832
|
+
...k.config,
|
|
770
833
|
binding: void 0
|
|
771
834
|
}
|
|
772
|
-
}), t =
|
|
835
|
+
}), t = ee({
|
|
773
836
|
binding: e,
|
|
774
|
-
loading:
|
|
775
|
-
error:
|
|
776
|
-
preview:
|
|
777
|
-
previewComplete:
|
|
837
|
+
loading: Xe,
|
|
838
|
+
error: et,
|
|
839
|
+
preview: Qe,
|
|
840
|
+
previewComplete: $e
|
|
778
841
|
});
|
|
779
|
-
return /* @__PURE__ */
|
|
780
|
-
consoleId:
|
|
842
|
+
return /* @__PURE__ */ T(ue, {
|
|
843
|
+
consoleId: F?.dashboardId || "",
|
|
781
844
|
binding: e,
|
|
782
|
-
dataSinkKey:
|
|
783
|
-
dataPath: typeof
|
|
845
|
+
dataSinkKey: qe,
|
|
846
|
+
dataPath: typeof k.config.dataPath == "string" ? k.config.dataPath : void 0,
|
|
784
847
|
status: t.status,
|
|
785
848
|
missingFields: t.missingFields,
|
|
786
|
-
preview:
|
|
787
|
-
error:
|
|
788
|
-
onDataSinkChange:
|
|
789
|
-
onParserChange:
|
|
849
|
+
preview: Qe,
|
|
850
|
+
error: et,
|
|
851
|
+
onDataSinkChange: wt,
|
|
852
|
+
onParserChange: Tt,
|
|
790
853
|
onDataPathChange: (e) => $({
|
|
791
|
-
...
|
|
854
|
+
...k.config,
|
|
792
855
|
dataPath: e
|
|
793
856
|
})
|
|
794
857
|
});
|
|
795
858
|
})(),
|
|
796
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ T("div", {
|
|
797
860
|
className: "border-t border-border-subtle pt-4",
|
|
798
|
-
children: /* @__PURE__ */
|
|
861
|
+
children: /* @__PURE__ */ T(v, {
|
|
799
862
|
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
800
863
|
children: "Alternative Data Sources"
|
|
801
864
|
})
|
|
802
865
|
}),
|
|
803
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ E("div", {
|
|
804
867
|
className: "space-y-2",
|
|
805
|
-
children: [/* @__PURE__ */
|
|
806
|
-
value:
|
|
868
|
+
children: [/* @__PURE__ */ T(v, { children: "Data Source Type" }), /* @__PURE__ */ E(xe, {
|
|
869
|
+
value: k.config?.dataSourceType || "",
|
|
807
870
|
onValueChange: (e) => $({
|
|
808
|
-
...
|
|
871
|
+
...k.config,
|
|
809
872
|
dataSourceType: e || void 0
|
|
810
873
|
}),
|
|
811
|
-
children: [/* @__PURE__ */
|
|
874
|
+
children: [/* @__PURE__ */ T(b, {
|
|
812
875
|
style: {
|
|
813
876
|
height: "var(--size-controlHeight-md)",
|
|
814
877
|
fontSize: "var(--font-size-body-sm)"
|
|
815
878
|
},
|
|
816
|
-
children: /* @__PURE__ */
|
|
817
|
-
}), /* @__PURE__ */
|
|
879
|
+
children: /* @__PURE__ */ T(x, { placeholder: "Select type..." })
|
|
880
|
+
}), /* @__PURE__ */ T(Se, {
|
|
818
881
|
position: "popper",
|
|
819
882
|
side: "bottom",
|
|
820
883
|
sideOffset: 4,
|
|
@@ -827,56 +890,56 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
827
890
|
boxShadow: "var(--shadow-elevation-3)",
|
|
828
891
|
borderRadius: "var(--radius-button)"
|
|
829
892
|
},
|
|
830
|
-
children:
|
|
893
|
+
children: Ne.map((e) => /* @__PURE__ */ T(y, {
|
|
831
894
|
value: e.value,
|
|
832
895
|
children: e.label
|
|
833
896
|
}, e.value))
|
|
834
897
|
})]
|
|
835
898
|
})]
|
|
836
899
|
}),
|
|
837
|
-
|
|
900
|
+
k.config?.dataSourceType === "REST_API" && /* @__PURE__ */ E("div", {
|
|
838
901
|
className: "space-y-3",
|
|
839
902
|
children: [
|
|
840
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ E("div", {
|
|
841
904
|
className: "space-y-2",
|
|
842
|
-
children: [/* @__PURE__ */
|
|
843
|
-
value:
|
|
905
|
+
children: [/* @__PURE__ */ T(v, { children: "Endpoint URL *" }), /* @__PURE__ */ T(_, {
|
|
906
|
+
value: k.config?.endpointUrl || "",
|
|
844
907
|
onChange: (e) => $({
|
|
845
|
-
...
|
|
908
|
+
...k.config,
|
|
846
909
|
endpointUrl: e.target.value || void 0
|
|
847
910
|
}),
|
|
848
911
|
placeholder: "https://api.example.com/data"
|
|
849
912
|
})]
|
|
850
913
|
}),
|
|
851
|
-
/* @__PURE__ */
|
|
914
|
+
/* @__PURE__ */ E("div", {
|
|
852
915
|
className: "space-y-2",
|
|
853
|
-
children: [/* @__PURE__ */
|
|
854
|
-
value:
|
|
916
|
+
children: [/* @__PURE__ */ T(v, { children: "HTTP Method" }), /* @__PURE__ */ E(xe, {
|
|
917
|
+
value: k.config?.httpMethod || "GET",
|
|
855
918
|
onValueChange: (e) => $({
|
|
856
|
-
...
|
|
919
|
+
...k.config,
|
|
857
920
|
httpMethod: e
|
|
858
921
|
}),
|
|
859
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ T(b, {
|
|
860
923
|
style: { height: "var(--size-controlHeight-md)" },
|
|
861
|
-
children: /* @__PURE__ */
|
|
862
|
-
}), /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ T(x, {})
|
|
925
|
+
}), /* @__PURE__ */ E(Se, {
|
|
863
926
|
position: "popper",
|
|
864
927
|
side: "bottom",
|
|
865
928
|
sideOffset: 4,
|
|
866
929
|
children: [
|
|
867
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ T(y, {
|
|
868
931
|
value: "GET",
|
|
869
932
|
children: "GET"
|
|
870
933
|
}),
|
|
871
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ T(y, {
|
|
872
935
|
value: "POST",
|
|
873
936
|
children: "POST"
|
|
874
937
|
}),
|
|
875
|
-
/* @__PURE__ */
|
|
938
|
+
/* @__PURE__ */ T(y, {
|
|
876
939
|
value: "PUT",
|
|
877
940
|
children: "PUT"
|
|
878
941
|
}),
|
|
879
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ T(y, {
|
|
880
943
|
value: "DELETE",
|
|
881
944
|
children: "DELETE"
|
|
882
945
|
})
|
|
@@ -884,12 +947,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
884
947
|
})]
|
|
885
948
|
})]
|
|
886
949
|
}),
|
|
887
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ E("div", {
|
|
888
951
|
className: "space-y-2",
|
|
889
|
-
children: [/* @__PURE__ */
|
|
890
|
-
value:
|
|
952
|
+
children: [/* @__PURE__ */ T(v, { children: "Headers (JSON)" }), /* @__PURE__ */ T(w, {
|
|
953
|
+
value: k.config?.headers || "",
|
|
891
954
|
onChange: (e) => $({
|
|
892
|
-
...
|
|
955
|
+
...k.config,
|
|
893
956
|
headers: e.target.value || void 0
|
|
894
957
|
}),
|
|
895
958
|
rows: 3,
|
|
@@ -897,35 +960,35 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
897
960
|
className: "font-mono text-xs"
|
|
898
961
|
})]
|
|
899
962
|
}),
|
|
900
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ E("div", {
|
|
901
964
|
className: "space-y-2",
|
|
902
|
-
children: [/* @__PURE__ */
|
|
903
|
-
value:
|
|
965
|
+
children: [/* @__PURE__ */ T(v, { children: "Authentication" }), /* @__PURE__ */ E(xe, {
|
|
966
|
+
value: k.config?.authType || "none",
|
|
904
967
|
onValueChange: (e) => $({
|
|
905
|
-
...
|
|
968
|
+
...k.config,
|
|
906
969
|
authType: e
|
|
907
970
|
}),
|
|
908
|
-
children: [/* @__PURE__ */
|
|
971
|
+
children: [/* @__PURE__ */ T(b, {
|
|
909
972
|
style: { height: "var(--size-controlHeight-md)" },
|
|
910
|
-
children: /* @__PURE__ */
|
|
911
|
-
}), /* @__PURE__ */
|
|
973
|
+
children: /* @__PURE__ */ T(x, {})
|
|
974
|
+
}), /* @__PURE__ */ E(Se, {
|
|
912
975
|
position: "popper",
|
|
913
976
|
side: "bottom",
|
|
914
977
|
sideOffset: 4,
|
|
915
978
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
979
|
+
/* @__PURE__ */ T(y, {
|
|
917
980
|
value: "none",
|
|
918
981
|
children: "None"
|
|
919
982
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
983
|
+
/* @__PURE__ */ T(y, {
|
|
921
984
|
value: "api_key",
|
|
922
985
|
children: "API Key"
|
|
923
986
|
}),
|
|
924
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ T(y, {
|
|
925
988
|
value: "bearer",
|
|
926
989
|
children: "Bearer Token"
|
|
927
990
|
}),
|
|
928
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ T(y, {
|
|
929
992
|
value: "basic",
|
|
930
993
|
children: "Basic Auth"
|
|
931
994
|
})
|
|
@@ -933,24 +996,24 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
933
996
|
})]
|
|
934
997
|
})]
|
|
935
998
|
}),
|
|
936
|
-
!!(
|
|
999
|
+
!!(k.config?.authType && k.config.authType !== "none") && /* @__PURE__ */ E("div", {
|
|
937
1000
|
className: "space-y-2",
|
|
938
|
-
children: [/* @__PURE__ */
|
|
1001
|
+
children: [/* @__PURE__ */ T(v, { children: String(k.config.authType) === "basic" ? "Credentials (user:pass)" : "Token/Key" }), /* @__PURE__ */ T(_, {
|
|
939
1002
|
type: "password",
|
|
940
|
-
value:
|
|
1003
|
+
value: k.config?.authValue || "",
|
|
941
1004
|
onChange: (e) => $({
|
|
942
|
-
...
|
|
1005
|
+
...k.config,
|
|
943
1006
|
authValue: e.target.value || void 0
|
|
944
1007
|
}),
|
|
945
|
-
placeholder:
|
|
1008
|
+
placeholder: k.config.authType === "basic" ? "username:password" : "Enter token or API key"
|
|
946
1009
|
})]
|
|
947
1010
|
}),
|
|
948
|
-
(
|
|
1011
|
+
(k.config?.httpMethod === "POST" || k.config?.httpMethod === "PUT") && /* @__PURE__ */ E("div", {
|
|
949
1012
|
className: "space-y-2",
|
|
950
|
-
children: [/* @__PURE__ */
|
|
951
|
-
value:
|
|
1013
|
+
children: [/* @__PURE__ */ T(v, { children: "Request Body (JSON)" }), /* @__PURE__ */ T(w, {
|
|
1014
|
+
value: k.config?.requestBody || "",
|
|
952
1015
|
onChange: (e) => $({
|
|
953
|
-
...
|
|
1016
|
+
...k.config,
|
|
954
1017
|
requestBody: e.target.value || void 0
|
|
955
1018
|
}),
|
|
956
1019
|
rows: 4,
|
|
@@ -958,19 +1021,19 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
958
1021
|
className: "font-mono text-xs"
|
|
959
1022
|
})]
|
|
960
1023
|
}),
|
|
961
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ E("div", {
|
|
962
1025
|
className: "space-y-2",
|
|
963
1026
|
children: [
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
/* @__PURE__ */
|
|
966
|
-
value:
|
|
1027
|
+
/* @__PURE__ */ T(v, { children: "Data Path (optional)" }),
|
|
1028
|
+
/* @__PURE__ */ T(_, {
|
|
1029
|
+
value: k.config?.dataPath || "",
|
|
967
1030
|
onChange: (e) => $({
|
|
968
|
-
...
|
|
1031
|
+
...k.config,
|
|
969
1032
|
dataPath: e.target.value || void 0
|
|
970
1033
|
}),
|
|
971
1034
|
placeholder: "$.data.items or .data.items"
|
|
972
1035
|
}),
|
|
973
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ T("p", {
|
|
974
1037
|
className: "text-xs text-text-secondary",
|
|
975
1038
|
children: "JSONPath or dot notation to extract data from response"
|
|
976
1039
|
})
|
|
@@ -978,26 +1041,26 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
978
1041
|
})
|
|
979
1042
|
]
|
|
980
1043
|
}),
|
|
981
|
-
|
|
1044
|
+
k.config?.dataSourceType === "GRAPHQL" && /* @__PURE__ */ E("div", {
|
|
982
1045
|
className: "space-y-3",
|
|
983
1046
|
children: [
|
|
984
|
-
/* @__PURE__ */
|
|
1047
|
+
/* @__PURE__ */ E("div", {
|
|
985
1048
|
className: "space-y-2",
|
|
986
|
-
children: [/* @__PURE__ */
|
|
987
|
-
value:
|
|
1049
|
+
children: [/* @__PURE__ */ T(v, { children: "GraphQL Endpoint *" }), /* @__PURE__ */ T(_, {
|
|
1050
|
+
value: k.config?.graphqlEndpoint || "",
|
|
988
1051
|
onChange: (e) => $({
|
|
989
|
-
...
|
|
1052
|
+
...k.config,
|
|
990
1053
|
graphqlEndpoint: e.target.value || void 0
|
|
991
1054
|
}),
|
|
992
1055
|
placeholder: "https://api.example.com/graphql"
|
|
993
1056
|
})]
|
|
994
1057
|
}),
|
|
995
|
-
/* @__PURE__ */
|
|
1058
|
+
/* @__PURE__ */ E("div", {
|
|
996
1059
|
className: "space-y-2",
|
|
997
|
-
children: [/* @__PURE__ */
|
|
998
|
-
value:
|
|
1060
|
+
children: [/* @__PURE__ */ T(v, { children: "Query *" }), /* @__PURE__ */ T(w, {
|
|
1061
|
+
value: k.config?.graphqlQuery || "",
|
|
999
1062
|
onChange: (e) => $({
|
|
1000
|
-
...
|
|
1063
|
+
...k.config,
|
|
1001
1064
|
graphqlQuery: e.target.value || void 0
|
|
1002
1065
|
}),
|
|
1003
1066
|
rows: 6,
|
|
@@ -1005,12 +1068,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1005
1068
|
className: "font-mono text-xs"
|
|
1006
1069
|
})]
|
|
1007
1070
|
}),
|
|
1008
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ E("div", {
|
|
1009
1072
|
className: "space-y-2",
|
|
1010
|
-
children: [/* @__PURE__ */
|
|
1011
|
-
value:
|
|
1073
|
+
children: [/* @__PURE__ */ T(v, { children: "Variables (JSON, optional)" }), /* @__PURE__ */ T(w, {
|
|
1074
|
+
value: k.config?.graphqlVariables || "",
|
|
1012
1075
|
onChange: (e) => $({
|
|
1013
|
-
...
|
|
1076
|
+
...k.config,
|
|
1014
1077
|
graphqlVariables: e.target.value || void 0
|
|
1015
1078
|
}),
|
|
1016
1079
|
rows: 3,
|
|
@@ -1018,12 +1081,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1018
1081
|
className: "font-mono text-xs"
|
|
1019
1082
|
})]
|
|
1020
1083
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ E("div", {
|
|
1022
1085
|
className: "space-y-2",
|
|
1023
|
-
children: [/* @__PURE__ */
|
|
1024
|
-
value:
|
|
1086
|
+
children: [/* @__PURE__ */ T(v, { children: "Headers (JSON, optional)" }), /* @__PURE__ */ T(w, {
|
|
1087
|
+
value: k.config?.headers || "",
|
|
1025
1088
|
onChange: (e) => $({
|
|
1026
|
-
...
|
|
1089
|
+
...k.config,
|
|
1027
1090
|
headers: e.target.value || void 0
|
|
1028
1091
|
}),
|
|
1029
1092
|
rows: 2,
|
|
@@ -1031,19 +1094,19 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1031
1094
|
className: "font-mono text-xs"
|
|
1032
1095
|
})]
|
|
1033
1096
|
}),
|
|
1034
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ E("div", {
|
|
1035
1098
|
className: "space-y-2",
|
|
1036
1099
|
children: [
|
|
1037
|
-
/* @__PURE__ */
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
value:
|
|
1100
|
+
/* @__PURE__ */ T(v, { children: "Data Path (optional)" }),
|
|
1101
|
+
/* @__PURE__ */ T(_, {
|
|
1102
|
+
value: k.config?.dataPath || "",
|
|
1040
1103
|
onChange: (e) => $({
|
|
1041
|
-
...
|
|
1104
|
+
...k.config,
|
|
1042
1105
|
dataPath: e.target.value || void 0
|
|
1043
1106
|
}),
|
|
1044
1107
|
placeholder: ".data.items"
|
|
1045
1108
|
}),
|
|
1046
|
-
/* @__PURE__ */
|
|
1109
|
+
/* @__PURE__ */ T("p", {
|
|
1047
1110
|
className: "text-xs text-text-secondary",
|
|
1048
1111
|
children: "Path to extract data from GraphQL response"
|
|
1049
1112
|
})
|
|
@@ -1051,12 +1114,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1051
1114
|
})
|
|
1052
1115
|
]
|
|
1053
1116
|
}),
|
|
1054
|
-
|
|
1117
|
+
k.config?.dataSourceType === "MOCK" && /* @__PURE__ */ E("div", {
|
|
1055
1118
|
className: "space-y-2",
|
|
1056
|
-
children: [/* @__PURE__ */
|
|
1057
|
-
value:
|
|
1119
|
+
children: [/* @__PURE__ */ T(v, { children: "Sample Data (JSON)" }), /* @__PURE__ */ T(w, {
|
|
1120
|
+
value: k.config?.mockData || "",
|
|
1058
1121
|
onChange: (e) => $({
|
|
1059
|
-
...
|
|
1122
|
+
...k.config,
|
|
1060
1123
|
mockData: e.target.value || void 0
|
|
1061
1124
|
}),
|
|
1062
1125
|
rows: 5,
|
|
@@ -1066,103 +1129,99 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1066
1129
|
})
|
|
1067
1130
|
] })
|
|
1068
1131
|
}),
|
|
1069
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ E(S, {
|
|
1070
1133
|
value: "advanced",
|
|
1071
1134
|
className: "mt-0 space-y-6",
|
|
1072
1135
|
children: [
|
|
1073
|
-
|
|
1074
|
-
renderer:
|
|
1075
|
-
rendererOptions:
|
|
1136
|
+
k && /* @__PURE__ */ T(se, {
|
|
1137
|
+
renderer: k.renderer,
|
|
1138
|
+
rendererOptions: Me,
|
|
1076
1139
|
onRendererChange: (e) => {
|
|
1077
1140
|
Q("renderer", e), e === "BIGCONSOLE" && Q("template", void 0);
|
|
1078
1141
|
},
|
|
1079
|
-
templateEditor:
|
|
1142
|
+
templateEditor: k.renderer === "BIGCONSOLE" ? void 0 : /* @__PURE__ */ T(Le, {
|
|
1080
1143
|
widget: {
|
|
1081
|
-
...
|
|
1082
|
-
template:
|
|
1083
|
-
renderer:
|
|
1144
|
+
...F,
|
|
1145
|
+
template: k.template,
|
|
1146
|
+
renderer: k.renderer
|
|
1084
1147
|
},
|
|
1085
1148
|
onSave: (e) => Q("template", e)
|
|
1086
1149
|
})
|
|
1087
1150
|
}),
|
|
1088
|
-
/* @__PURE__ */
|
|
1151
|
+
/* @__PURE__ */ E("section", {
|
|
1089
1152
|
className: "space-y-4 border-t border-border-default pt-4",
|
|
1090
|
-
children: [/* @__PURE__ */
|
|
1153
|
+
children: [/* @__PURE__ */ E("div", {
|
|
1091
1154
|
className: "flex items-center justify-between",
|
|
1092
|
-
children: [/* @__PURE__ */
|
|
1155
|
+
children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h3", {
|
|
1093
1156
|
className: "text-sm font-medium",
|
|
1094
1157
|
children: "Widget Actions"
|
|
1095
|
-
}), /* @__PURE__ */
|
|
1158
|
+
}), /* @__PURE__ */ T("p", {
|
|
1096
1159
|
className: "text-xs text-text-secondary",
|
|
1097
1160
|
children: "Configure buttons on this widget"
|
|
1098
|
-
})] }), /* @__PURE__ */
|
|
1161
|
+
})] }), /* @__PURE__ */ E(g, {
|
|
1099
1162
|
size: "sm",
|
|
1100
|
-
onClick:
|
|
1101
|
-
children: [/* @__PURE__ */
|
|
1163
|
+
onClick: vt,
|
|
1164
|
+
children: [/* @__PURE__ */ T(ge, { className: "size-4" }), "Add"]
|
|
1102
1165
|
})]
|
|
1103
|
-
}),
|
|
1166
|
+
}), H ? /* @__PURE__ */ T("div", {
|
|
1104
1167
|
className: "flex justify-center py-8",
|
|
1105
|
-
children: /* @__PURE__ */
|
|
1106
|
-
}) :
|
|
1168
|
+
children: /* @__PURE__ */ T(Oe, { className: "size-6" })
|
|
1169
|
+
}) : V.length === 0 ? /* @__PURE__ */ E("div", {
|
|
1107
1170
|
className: "py-8 text-center",
|
|
1108
|
-
children: [/* @__PURE__ */
|
|
1171
|
+
children: [/* @__PURE__ */ T(h, { className: "size-10 mx-auto mb-2 text-text-secondary/50" }), /* @__PURE__ */ T("p", {
|
|
1109
1172
|
className: "text-sm text-text-secondary",
|
|
1110
1173
|
children: "No actions configured"
|
|
1111
1174
|
})]
|
|
1112
|
-
}) : /* @__PURE__ */
|
|
1175
|
+
}) : /* @__PURE__ */ T("div", {
|
|
1113
1176
|
className: "space-y-2",
|
|
1114
|
-
children: [...
|
|
1177
|
+
children: [...V].sort((e, t) => e.order - t.order).map((e, t) => /* @__PURE__ */ T(ye, {
|
|
1115
1178
|
className: e.disabled ? "opacity-60" : "",
|
|
1116
|
-
children: /* @__PURE__ */
|
|
1179
|
+
children: /* @__PURE__ */ E(be, {
|
|
1117
1180
|
className: "p-3 flex items-center gap-2",
|
|
1118
1181
|
children: [
|
|
1119
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ E("div", {
|
|
1120
1183
|
className: "flex flex-col gap-0.5",
|
|
1121
|
-
children: [/* @__PURE__ */
|
|
1184
|
+
children: [/* @__PURE__ */ T(g, {
|
|
1122
1185
|
variant: "ghost",
|
|
1123
1186
|
size: "icon-sm",
|
|
1124
|
-
onClick: () =>
|
|
1187
|
+
onClick: () => St(t),
|
|
1125
1188
|
disabled: t === 0,
|
|
1126
1189
|
className: "h-5 w-5",
|
|
1127
|
-
children: /* @__PURE__ */
|
|
1128
|
-
}), /* @__PURE__ */
|
|
1190
|
+
children: /* @__PURE__ */ T(me, { className: "size-3" })
|
|
1191
|
+
}), /* @__PURE__ */ T(g, {
|
|
1129
1192
|
variant: "ghost",
|
|
1130
1193
|
size: "icon-sm",
|
|
1131
|
-
onClick: () =>
|
|
1132
|
-
disabled: t ===
|
|
1194
|
+
onClick: () => Ct(t),
|
|
1195
|
+
disabled: t === V.length - 1,
|
|
1133
1196
|
className: "h-5 w-5",
|
|
1134
|
-
children: /* @__PURE__ */
|
|
1197
|
+
children: /* @__PURE__ */ T(pe, { className: "size-3" })
|
|
1135
1198
|
})]
|
|
1136
1199
|
}),
|
|
1137
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ E("div", {
|
|
1138
1201
|
className: "flex-1 min-w-0",
|
|
1139
|
-
children: [/* @__PURE__ */
|
|
1202
|
+
children: [/* @__PURE__ */ E("div", {
|
|
1140
1203
|
className: "flex items-center gap-2",
|
|
1141
|
-
children: [/* @__PURE__ */
|
|
1204
|
+
children: [/* @__PURE__ */ T("span", { className: `size-2 rounded-full ${Fe[e.style] || "bg-muted-foreground"}` }), /* @__PURE__ */ T("span", {
|
|
1142
1205
|
className: "text-sm font-medium truncate",
|
|
1143
1206
|
children: e.label
|
|
1144
1207
|
})]
|
|
1145
|
-
}), /* @__PURE__ */
|
|
1146
|
-
className: "text-xs text-text-secondary",
|
|
1147
|
-
children:
|
|
1148
|
-
e.name,
|
|
1149
|
-
" • ",
|
|
1150
|
-
e.type
|
|
1151
|
-
]
|
|
1208
|
+
}), /* @__PURE__ */ T("p", {
|
|
1209
|
+
className: "text-xs text-text-secondary truncate",
|
|
1210
|
+
children: _t.has(e.name) ? `→ ${_t.get(e.name)?.method} ${_t.get(e.name)?.webhookUrl}` : "Emits an event"
|
|
1152
1211
|
})]
|
|
1153
1212
|
}),
|
|
1154
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ E("div", {
|
|
1155
1214
|
className: "flex gap-1",
|
|
1156
|
-
children: [/* @__PURE__ */
|
|
1215
|
+
children: [/* @__PURE__ */ T(g, {
|
|
1157
1216
|
variant: "ghost",
|
|
1158
1217
|
size: "icon-sm",
|
|
1159
|
-
onClick: () =>
|
|
1160
|
-
children: /* @__PURE__ */
|
|
1161
|
-
}), /* @__PURE__ */
|
|
1218
|
+
onClick: () => yt(e),
|
|
1219
|
+
children: /* @__PURE__ */ T(he, { className: "size-4" })
|
|
1220
|
+
}), /* @__PURE__ */ T(g, {
|
|
1162
1221
|
variant: "ghost",
|
|
1163
1222
|
size: "icon-sm",
|
|
1164
|
-
onClick: () =>
|
|
1165
|
-
children: /* @__PURE__ */
|
|
1223
|
+
onClick: () => xt(e.id),
|
|
1224
|
+
children: /* @__PURE__ */ T(_e, { className: "size-4" })
|
|
1166
1225
|
})]
|
|
1167
1226
|
})
|
|
1168
1227
|
]
|
|
@@ -1170,61 +1229,61 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1170
1229
|
}, e.id))
|
|
1171
1230
|
})]
|
|
1172
1231
|
}),
|
|
1173
|
-
/* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ E("section", {
|
|
1174
1233
|
className: "space-y-3 border-t border-border-default pt-4",
|
|
1175
|
-
children: [/* @__PURE__ */
|
|
1234
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
1176
1235
|
className: "text-sm font-semibold text-text-primary",
|
|
1177
1236
|
children: "Drilldown"
|
|
1178
|
-
}), /* @__PURE__ */
|
|
1179
|
-
widget:
|
|
1180
|
-
onChange:
|
|
1237
|
+
}), /* @__PURE__ */ T(oe, {
|
|
1238
|
+
widget: F,
|
|
1239
|
+
onChange: kt
|
|
1181
1240
|
})]
|
|
1182
1241
|
}),
|
|
1183
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ E("section", {
|
|
1184
1243
|
className: "space-y-3 border-t border-border-default pt-4",
|
|
1185
|
-
children: [/* @__PURE__ */
|
|
1244
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
1186
1245
|
className: "text-sm font-semibold text-text-primary",
|
|
1187
1246
|
children: "Webhooks"
|
|
1188
|
-
}), /* @__PURE__ */
|
|
1189
|
-
dashboardId:
|
|
1190
|
-
widgetId:
|
|
1247
|
+
}), /* @__PURE__ */ T(ie, {
|
|
1248
|
+
dashboardId: F.dashboardId,
|
|
1249
|
+
widgetId: F.id
|
|
1191
1250
|
})]
|
|
1192
1251
|
}),
|
|
1193
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ E("section", {
|
|
1194
1253
|
className: "space-y-3 border-t border-border-default pt-4",
|
|
1195
|
-
children: [/* @__PURE__ */
|
|
1254
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
1196
1255
|
className: "text-sm font-semibold text-text-primary",
|
|
1197
1256
|
children: "Events"
|
|
1198
|
-
}), /* @__PURE__ */
|
|
1199
|
-
dashboardId:
|
|
1200
|
-
widgetId:
|
|
1257
|
+
}), /* @__PURE__ */ T(ae, {
|
|
1258
|
+
dashboardId: F.dashboardId,
|
|
1259
|
+
widgetId: F.id,
|
|
1201
1260
|
maxHeight: "calc(100vh - 350px)"
|
|
1202
1261
|
})]
|
|
1203
1262
|
})
|
|
1204
1263
|
]
|
|
1205
1264
|
}),
|
|
1206
|
-
/* @__PURE__ */
|
|
1265
|
+
/* @__PURE__ */ T(S, {
|
|
1207
1266
|
value: "appearance",
|
|
1208
1267
|
className: "mt-0",
|
|
1209
|
-
children:
|
|
1210
|
-
widgetType:
|
|
1211
|
-
config:
|
|
1212
|
-
onChange:
|
|
1268
|
+
children: k && /* @__PURE__ */ T(ce, {
|
|
1269
|
+
widgetType: F.type,
|
|
1270
|
+
config: k.config || {},
|
|
1271
|
+
onChange: Ot
|
|
1213
1272
|
})
|
|
1214
1273
|
})
|
|
1215
1274
|
]
|
|
1216
1275
|
})]
|
|
1217
|
-
}) : /* @__PURE__ */
|
|
1276
|
+
}) : /* @__PURE__ */ T("div", {
|
|
1218
1277
|
className: "flex-1 flex items-center justify-center p-4",
|
|
1219
|
-
children: /* @__PURE__ */
|
|
1278
|
+
children: /* @__PURE__ */ E("div", {
|
|
1220
1279
|
className: "text-center",
|
|
1221
|
-
children: [/* @__PURE__ */
|
|
1280
|
+
children: [/* @__PURE__ */ T(h, { className: "size-12 mx-auto mb-3 text-text-secondary" }), /* @__PURE__ */ T("p", {
|
|
1222
1281
|
className: "text-sm text-text-secondary",
|
|
1223
1282
|
children: "Select a widget to edit"
|
|
1224
1283
|
})]
|
|
1225
1284
|
})
|
|
1226
1285
|
}),
|
|
1227
|
-
|
|
1286
|
+
F && /* @__PURE__ */ E("div", {
|
|
1228
1287
|
style: {
|
|
1229
1288
|
padding: "var(--space-cardPadding)",
|
|
1230
1289
|
borderTop: "1px solid var(--color-border)",
|
|
@@ -1232,7 +1291,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1232
1291
|
flexShrink: 0
|
|
1233
1292
|
},
|
|
1234
1293
|
children: [
|
|
1235
|
-
|
|
1294
|
+
j && /* @__PURE__ */ E("div", {
|
|
1236
1295
|
style: {
|
|
1237
1296
|
display: "flex",
|
|
1238
1297
|
alignItems: "center",
|
|
@@ -1243,13 +1302,13 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1243
1302
|
borderRadius: "var(--radius-button)",
|
|
1244
1303
|
border: "1px solid var(--color-status-warning-border, rgba(251, 191, 36, 0.3))"
|
|
1245
1304
|
},
|
|
1246
|
-
children: [/* @__PURE__ */
|
|
1305
|
+
children: [/* @__PURE__ */ T("div", { style: {
|
|
1247
1306
|
width: "8px",
|
|
1248
1307
|
height: "8px",
|
|
1249
1308
|
borderRadius: "50%",
|
|
1250
1309
|
backgroundColor: "var(--color-status-warning-bg)",
|
|
1251
1310
|
flexShrink: 0
|
|
1252
|
-
} }), /* @__PURE__ */
|
|
1311
|
+
} }), /* @__PURE__ */ T("span", {
|
|
1253
1312
|
style: {
|
|
1254
1313
|
fontSize: "var(--font-size-body-sm)",
|
|
1255
1314
|
color: "var(--color-status-warning-text, #92400e)",
|
|
@@ -1258,7 +1317,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1258
1317
|
children: "You have unsaved changes"
|
|
1259
1318
|
})]
|
|
1260
1319
|
}),
|
|
1261
|
-
|
|
1320
|
+
D === "saved" && !j && /* @__PURE__ */ E("div", {
|
|
1262
1321
|
style: {
|
|
1263
1322
|
display: "flex",
|
|
1264
1323
|
alignItems: "center",
|
|
@@ -1269,12 +1328,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1269
1328
|
borderRadius: "var(--radius-button)",
|
|
1270
1329
|
border: "1px solid var(--color-status-success-border, rgba(34, 197, 94, 0.3))"
|
|
1271
1330
|
},
|
|
1272
|
-
children: [/* @__PURE__ */
|
|
1331
|
+
children: [/* @__PURE__ */ T(p, { style: {
|
|
1273
1332
|
width: "var(--size-icon-sm)",
|
|
1274
1333
|
height: "var(--size-icon-sm)",
|
|
1275
1334
|
color: "var(--color-status-success-text)",
|
|
1276
1335
|
flexShrink: 0
|
|
1277
|
-
} }), /* @__PURE__ */
|
|
1336
|
+
} }), /* @__PURE__ */ T("span", {
|
|
1278
1337
|
style: {
|
|
1279
1338
|
fontSize: "var(--font-size-body-sm)",
|
|
1280
1339
|
color: "var(--color-status-success-text)",
|
|
@@ -1283,7 +1342,7 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1283
1342
|
children: "All changes saved"
|
|
1284
1343
|
})]
|
|
1285
1344
|
}),
|
|
1286
|
-
|
|
1345
|
+
D === "error" && /* @__PURE__ */ E("div", {
|
|
1287
1346
|
style: {
|
|
1288
1347
|
display: "flex",
|
|
1289
1348
|
alignItems: "center",
|
|
@@ -1294,12 +1353,12 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1294
1353
|
borderRadius: "var(--radius-button)",
|
|
1295
1354
|
border: "1px solid var(--color-status-error-border)"
|
|
1296
1355
|
},
|
|
1297
|
-
children: [/* @__PURE__ */
|
|
1356
|
+
children: [/* @__PURE__ */ T(ve, { style: {
|
|
1298
1357
|
width: "var(--size-icon-sm)",
|
|
1299
1358
|
height: "var(--size-icon-sm)",
|
|
1300
1359
|
color: "var(--color-status-error-text)",
|
|
1301
1360
|
flexShrink: 0
|
|
1302
|
-
} }), /* @__PURE__ */
|
|
1361
|
+
} }), /* @__PURE__ */ T("span", {
|
|
1303
1362
|
style: {
|
|
1304
1363
|
fontSize: "var(--font-size-body-sm)",
|
|
1305
1364
|
color: "var(--color-status-error-text)",
|
|
@@ -1308,50 +1367,50 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1308
1367
|
children: "Failed to save changes"
|
|
1309
1368
|
})]
|
|
1310
1369
|
}),
|
|
1311
|
-
/* @__PURE__ */
|
|
1370
|
+
/* @__PURE__ */ E("div", {
|
|
1312
1371
|
style: {
|
|
1313
1372
|
display: "flex",
|
|
1314
1373
|
gap: "var(--space-controlGap)"
|
|
1315
1374
|
},
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1317
|
-
onClick:
|
|
1318
|
-
disabled:
|
|
1375
|
+
children: [/* @__PURE__ */ T(g, {
|
|
1376
|
+
onClick: Et,
|
|
1377
|
+
disabled: D === "saving" || !j,
|
|
1319
1378
|
style: {
|
|
1320
1379
|
flex: 1,
|
|
1321
1380
|
height: "var(--size-controlHeight-md)",
|
|
1322
|
-
backgroundColor:
|
|
1323
|
-
opacity:
|
|
1381
|
+
backgroundColor: j ? "var(--color-action-primary-bg)" : void 0,
|
|
1382
|
+
opacity: j ? 1 : .5
|
|
1324
1383
|
},
|
|
1325
|
-
children:
|
|
1384
|
+
children: D === "saving" ? /* @__PURE__ */ E("span", {
|
|
1326
1385
|
style: {
|
|
1327
1386
|
display: "flex",
|
|
1328
1387
|
alignItems: "center",
|
|
1329
1388
|
gap: "var(--space-iconGap)"
|
|
1330
1389
|
},
|
|
1331
|
-
children: [/* @__PURE__ */
|
|
1390
|
+
children: [/* @__PURE__ */ T(Oe, { style: {
|
|
1332
1391
|
width: "var(--size-icon-sm)",
|
|
1333
1392
|
height: "var(--size-icon-sm)"
|
|
1334
1393
|
} }), "Saving..."]
|
|
1335
|
-
}) : /* @__PURE__ */
|
|
1394
|
+
}) : /* @__PURE__ */ E("span", {
|
|
1336
1395
|
style: {
|
|
1337
1396
|
display: "flex",
|
|
1338
1397
|
alignItems: "center",
|
|
1339
1398
|
gap: "var(--space-iconGap)"
|
|
1340
1399
|
},
|
|
1341
|
-
children: [/* @__PURE__ */
|
|
1400
|
+
children: [/* @__PURE__ */ T(p, { style: {
|
|
1342
1401
|
width: "var(--size-icon-sm)",
|
|
1343
1402
|
height: "var(--size-icon-sm)"
|
|
1344
1403
|
} }), "Save Changes"]
|
|
1345
1404
|
})
|
|
1346
|
-
}), /* @__PURE__ */
|
|
1405
|
+
}), /* @__PURE__ */ E(g, {
|
|
1347
1406
|
variant: "outline",
|
|
1348
|
-
onClick:
|
|
1349
|
-
disabled:
|
|
1407
|
+
onClick: Dt,
|
|
1408
|
+
disabled: D === "saving" || !j,
|
|
1350
1409
|
style: {
|
|
1351
1410
|
height: "var(--size-controlHeight-md)",
|
|
1352
|
-
opacity:
|
|
1411
|
+
opacity: j ? 1 : .5
|
|
1353
1412
|
},
|
|
1354
|
-
children: [/* @__PURE__ */
|
|
1413
|
+
children: [/* @__PURE__ */ T(ve, { style: {
|
|
1355
1414
|
width: "var(--size-icon-sm)",
|
|
1356
1415
|
height: "var(--size-icon-sm)"
|
|
1357
1416
|
} }), "Discard"]
|
|
@@ -1359,20 +1418,22 @@ var Me = l(function({ isOpen: l, onClose: h }) {
|
|
|
1359
1418
|
})
|
|
1360
1419
|
]
|
|
1361
1420
|
}),
|
|
1362
|
-
/* @__PURE__ */
|
|
1363
|
-
isOpen:
|
|
1364
|
-
action:
|
|
1365
|
-
|
|
1421
|
+
/* @__PURE__ */ T(re, {
|
|
1422
|
+
isOpen: ut,
|
|
1423
|
+
action: J,
|
|
1424
|
+
initialWebhook: gt,
|
|
1425
|
+
isLoading: dt,
|
|
1426
|
+
saveError: mt,
|
|
1366
1427
|
onClose: () => {
|
|
1367
|
-
|
|
1428
|
+
q(!1), Y(void 0), X(void 0), Z(null);
|
|
1368
1429
|
},
|
|
1369
|
-
onSave:
|
|
1430
|
+
onSave: bt
|
|
1370
1431
|
})
|
|
1371
1432
|
]
|
|
1372
1433
|
})
|
|
1373
1434
|
});
|
|
1374
1435
|
});
|
|
1375
1436
|
//#endregion
|
|
1376
|
-
export {
|
|
1437
|
+
export { ze as default };
|
|
1377
1438
|
|
|
1378
1439
|
//# sourceMappingURL=PropertiesPanel.js.map
|