@burdenoff/microfe-bigconsole 2026.712.1 → 2026.713.2

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.
Files changed (38) hide show
  1. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js +144 -69
  2. package/dist/bigconsole/assistant/createSandboxAssistantTransport.js.map +1 -1
  3. package/dist/bigconsole/components/builder/BuilderCanvas.js +21 -0
  4. package/dist/bigconsole/components/builder/BuilderCanvas.js.map +1 -0
  5. package/dist/bigconsole/components/builder/BuilderTopbar.js +33 -0
  6. package/dist/bigconsole/components/builder/BuilderTopbar.js.map +1 -0
  7. package/dist/bigconsole/components/builder/DashboardEditorShell.js +20 -0
  8. package/dist/bigconsole/components/builder/DashboardEditorShell.js.map +1 -0
  9. package/dist/bigconsole/components/builder/WidgetInspector.js +14 -0
  10. package/dist/bigconsole/components/builder/WidgetInspector.js.map +1 -0
  11. package/dist/bigconsole/components/builder/index.js +4 -0
  12. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js +45 -0
  13. package/dist/bigconsole/components/builder/inspector/AdvancedSection.js.map +1 -0
  14. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js +43 -0
  15. package/dist/bigconsole/components/builder/inspector/AppearanceSection.js.map +1 -0
  16. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js +124 -0
  17. package/dist/bigconsole/components/builder/inspector/DataBindingSection.js.map +1 -0
  18. package/dist/bigconsole/components/builder/inspector/GeneralSection.js +50 -0
  19. package/dist/bigconsole/components/builder/inspector/GeneralSection.js.map +1 -0
  20. package/dist/bigconsole/components/builder/inspector/index.js +4 -0
  21. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +221 -199
  22. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  23. package/dist/bigconsole/components/dashboard/WidgetPalette.js +145 -102
  24. package/dist/bigconsole/components/dashboard/WidgetPalette.js.map +1 -1
  25. package/dist/bigconsole/components/dashboard/index.js +4 -0
  26. package/dist/bigconsole/components/widgets/PropertiesPanel.js +529 -742
  27. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  28. package/dist/bigconsole/components/widgets/WidgetWrapper.js +227 -226
  29. package/dist/bigconsole/components/widgets/WidgetWrapper.js.map +1 -1
  30. package/dist/bigconsole/pages/DashboardBuilderPage.js +221 -316
  31. package/dist/bigconsole/pages/DashboardBuilderPage.js.map +1 -1
  32. package/dist/bigconsole/utils/widgetBinding.js +115 -0
  33. package/dist/bigconsole/utils/widgetBinding.js.map +1 -0
  34. package/package.json +2 -2
  35. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js +0 -883
  36. package/dist/bigconsole/components/widgets/WidgetConfigDialog.js.map +0 -1
  37. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js +0 -311
  38. package/dist/bigconsole/components/widgets/WidgetTypeSelector.js.map +0 -1
@@ -1,883 +0,0 @@
1
- import { useDataSinkStore as e } from "../../store/dataSinkStore.js";
2
- import "../../store/index.js";
3
- import { getWidgetDefinition as t } from "./WidgetRegistry.js";
4
- import n from "./chart/ChartConfig.js";
5
- import r from "./gauge/GaugeConfig.js";
6
- import i from "./list/ListConfig.js";
7
- import a from "./metric-card/MetricCardConfig.js";
8
- import o from "./progress/ProgressConfig.js";
9
- import s from "./table/TableConfig.js";
10
- import ee from "./WidgetTypeSelector.js";
11
- import te from "../parser/DataSinkSelector.js";
12
- import ne from "../parser/ParserSelector.js";
13
- import { memo as c, useCallback as l, useEffect as re, useMemo as ie, useState as u } from "react";
14
- import { Code as ae, CreditCard as oe, ExternalLink as d, Layout as f, MessageSquare as p } from "lucide-react";
15
- import { Button as m, Card as se, CardDescription as ce, CardHeader as le, CardTitle as ue, Dialog as de, DialogContent as fe, DialogDescription as pe, DialogFooter as me, DialogHeader as he, DialogTitle as ge, Input as h, Label as g, Tabs as _e, TabsContent as _, TabsList as ve, TabsTrigger as ye, Textarea as v } from "@burdenoff/fe-libs/ui";
16
- import { Fragment as be, jsx as y, jsxs as b } from "react/jsx-runtime";
17
- //#region src/bigconsole/components/widgets/WidgetConfigDialog.tsx
18
- var x = [
19
- "kpi_card_comparison",
20
- "metric_card",
21
- "chart",
22
- "funnel_chart",
23
- "table",
24
- "pivot_table",
25
- "gauge",
26
- "progress",
27
- "list",
28
- "form",
29
- "text",
30
- "iframe",
31
- "map",
32
- "heatmap",
33
- "calendar",
34
- "kanban",
35
- "timeline",
36
- "custom"
37
- ], xe = [
38
- {
39
- type: "BIGCONSOLE",
40
- name: "BigConsole Native",
41
- description: "Full-featured native widgets with all configuration options",
42
- icon: f,
43
- supportedTypes: x
44
- },
45
- {
46
- type: "ADAPTIVE_CARD",
47
- name: "Microsoft Adaptive Cards",
48
- description: "Use Microsoft Adaptive Cards format for Teams/Outlook integration",
49
- icon: oe,
50
- supportedTypes: x
51
- },
52
- {
53
- type: "BLOCKKIT",
54
- name: "Slack Block Kit",
55
- description: "Use Slack Block Kit format for Slack integration",
56
- icon: p,
57
- supportedTypes: x
58
- },
59
- {
60
- type: "CUSTOM",
61
- name: "Custom Component",
62
- description: "Use a custom React component registered in the frontend",
63
- icon: ae,
64
- supportedTypes: x
65
- }
66
- ], Se = [
67
- {
68
- id: "ac-simple-text",
69
- name: "Simple Text Card",
70
- description: "Basic text display",
71
- renderer: "ADAPTIVE_CARD",
72
- template: {
73
- type: "AdaptiveCard",
74
- version: "1.4",
75
- body: [{
76
- type: "TextBlock",
77
- text: "Hello World!",
78
- size: "Large",
79
- weight: "Bolder"
80
- }]
81
- }
82
- },
83
- {
84
- id: "ac-metric-card",
85
- name: "Metric Display",
86
- description: "Show a key metric with comparison",
87
- renderer: "ADAPTIVE_CARD",
88
- template: {
89
- type: "AdaptiveCard",
90
- version: "1.4",
91
- body: [
92
- {
93
- type: "TextBlock",
94
- text: "${title}",
95
- size: "Medium",
96
- weight: "Bolder"
97
- },
98
- {
99
- type: "TextBlock",
100
- text: "${value}",
101
- size: "ExtraLarge",
102
- weight: "Bolder",
103
- color: "Accent"
104
- },
105
- {
106
- type: "TextBlock",
107
- text: "${change} from last period",
108
- size: "Small",
109
- color: "Good"
110
- }
111
- ]
112
- }
113
- },
114
- {
115
- id: "bk-status-update",
116
- name: "Status Update",
117
- description: "System status display",
118
- renderer: "BLOCKKIT",
119
- template: { blocks: [
120
- {
121
- type: "header",
122
- text: {
123
- type: "plain_text",
124
- text: "System Status"
125
- }
126
- },
127
- {
128
- type: "section",
129
- text: {
130
- type: "mrkdwn",
131
- text: "*Status:* All systems operational"
132
- }
133
- },
134
- { type: "divider" },
135
- {
136
- type: "section",
137
- fields: [{
138
- type: "mrkdwn",
139
- text: "*API:* Online"
140
- }, {
141
- type: "mrkdwn",
142
- text: "*Database:* Online"
143
- }]
144
- }
145
- ] }
146
- },
147
- {
148
- id: "custom-placeholder",
149
- name: "Custom Component",
150
- description: "Placeholder for custom React component",
151
- renderer: "CUSTOM",
152
- template: {
153
- componentName: "MyCustomWidget",
154
- props: {
155
- color: "blue",
156
- size: "medium"
157
- }
158
- }
159
- }
160
- ];
161
- function Ce(e) {
162
- switch (e) {
163
- case "metric_card":
164
- case "kpi_card_comparison": return a;
165
- case "chart":
166
- case "funnel_chart": return n;
167
- case "table":
168
- case "pivot_table": return s;
169
- case "gauge": return r;
170
- case "progress": return o;
171
- case "list": return i;
172
- default: return null;
173
- }
174
- }
175
- var we = c(function({ renderer: e, template: t, onChange: n }) {
176
- let [r, i] = u(null), [a, o] = u(() => {
177
- try {
178
- return t && typeof t == "object" ? JSON.stringify(t, null, 2) : "";
179
- } catch {
180
- return "";
181
- }
182
- }), s = ie(() => Se.filter((t) => t.renderer === e), [e]), ee = l((e) => {
183
- o(e);
184
- try {
185
- e.trim() && n(JSON.parse(e)), i(null);
186
- } catch (e) {
187
- i(e.message);
188
- }
189
- }, [n]), te = l((e) => {
190
- o(JSON.stringify(e.template, null, 2)), n(e.template), i(null);
191
- }, [n]);
192
- return re(() => {
193
- if (t && typeof t == "object") try {
194
- o(JSON.stringify(t, null, 2)), i(null);
195
- } catch {}
196
- else t || o("");
197
- }, [t]), /* @__PURE__ */ b("div", {
198
- className: "space-y-4",
199
- children: [
200
- s.length > 0 && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y(g, {
201
- className: "mb-2",
202
- children: "Quick Start Templates"
203
- }), /* @__PURE__ */ y("div", {
204
- className: "grid grid-cols-2 gap-2",
205
- children: s.map((e) => /* @__PURE__ */ y(se, {
206
- className: "cursor-pointer hover:border-primary transition-colors",
207
- onClick: () => te(e),
208
- children: /* @__PURE__ */ b(le, {
209
- className: "p-3",
210
- children: [/* @__PURE__ */ y(ue, {
211
- className: "text-sm",
212
- children: e.name
213
- }), /* @__PURE__ */ y(ce, {
214
- className: "text-xs",
215
- children: e.description
216
- })]
217
- })
218
- }, e.id))
219
- })] }),
220
- /* @__PURE__ */ b("div", { children: [
221
- /* @__PURE__ */ y(g, {
222
- className: "mb-2",
223
- children: "Template JSON"
224
- }),
225
- /* @__PURE__ */ y(v, {
226
- value: a,
227
- onChange: (e) => ee(e.target.value),
228
- placeholder: `Enter ${e} template JSON...`,
229
- rows: 12,
230
- spellCheck: !1,
231
- className: `font-mono text-sm ${r ? "border-status-error-border focus-visible:ring-destructive" : ""}`
232
- }),
233
- r && /* @__PURE__ */ b("p", {
234
- className: "mt-1 text-xs text-status-error-text",
235
- children: ["Invalid JSON: ", r]
236
- })
237
- ] }),
238
- /* @__PURE__ */ b("div", {
239
- className: "flex items-center justify-between rounded-lg bg-bg-sunken p-3",
240
- children: [
241
- /* @__PURE__ */ b("p", {
242
- className: "text-xs text-text-secondary",
243
- children: [
244
- e === "ADAPTIVE_CARD" && "Use Microsoft Adaptive Cards format with data binding.",
245
- e === "BLOCKKIT" && "Use Slack Block Kit format for Slack integration.",
246
- e === "CUSTOM" && "Specify componentName and props for your custom React component."
247
- ]
248
- }),
249
- e === "ADAPTIVE_CARD" && /* @__PURE__ */ y(m, {
250
- variant: "ghost",
251
- size: "sm",
252
- asChild: !0,
253
- children: /* @__PURE__ */ b("a", {
254
- href: "https://adaptivecards.io/designer/",
255
- target: "_blank",
256
- rel: "noopener noreferrer",
257
- children: [/* @__PURE__ */ y(d, { className: "size-3.5" }), "Designer"]
258
- })
259
- }),
260
- e === "BLOCKKIT" && /* @__PURE__ */ y(m, {
261
- variant: "ghost",
262
- size: "sm",
263
- asChild: !0,
264
- children: /* @__PURE__ */ b("a", {
265
- href: "https://app.slack.com/block-kit-builder",
266
- target: "_blank",
267
- rel: "noopener noreferrer",
268
- children: [/* @__PURE__ */ y(d, { className: "size-3.5" }), "Builder"]
269
- })
270
- })
271
- ]
272
- })
273
- ]
274
- });
275
- }), S = c(function({ isOpen: n, widget: r, preselectedType: i, preselectedDefinition: a, onClose: o, onSave: s, dashboardId: c, installedWidgets: ae, definitions: oe }) {
276
- let d = !r, [f, p] = u(d ? i ? "general" : "type" : "general"), x = e((e) => e.dataSinks), [S, C] = u(r?.type || i), [w, T] = u(r?.title || ""), [Te, E] = u(r?.description || ""), [Ee, D] = u(r?.refreshInterval ?? void 0), [O, k] = u(r?.config || {}), [A, j] = u(r?.renderer || "BIGCONSOLE"), [M, N] = u(r?.template || null), [P, F] = u(r?.config?.dataSourceType || "MOCK"), [I, L] = u(r?.config?.dataSinkKey || ""), [De, R] = u(r?.parserId || ""), [Oe, z] = u(r?.config?.endpointUrl || ""), [B, V] = u(r?.config?.httpMethod || "GET"), [H, U] = u(r?.config?.headers || ""), [W, G] = u(r?.config?.authType || "none"), [ke, K] = u(r?.config?.authValue || ""), [Ae, q] = u(r?.config?.requestBody || ""), [J, Y] = u(r?.config?.dataPath || ""), [je, X] = u(r?.config?.graphqlEndpoint || ""), [Me, Z] = u(r?.config?.graphqlQuery || ""), [Ne, Q] = u(r?.config?.graphqlVariables || ""), Pe = ie(() => S ? xe.filter((e) => e.supportedTypes.includes(S)) : xe, [S]);
277
- re(() => {
278
- S && !Pe.find((e) => e.type === A) && (j("BIGCONSOLE"), N(null));
279
- }, [
280
- S,
281
- Pe,
282
- A
283
- ]), re(() => {
284
- if (r) {
285
- C(r.type), T(r.title), E(r.description || ""), D(r.refreshInterval ?? void 0), k(r.config || {}), j(r.renderer || "BIGCONSOLE"), N(r.template || null);
286
- let e = r.config || {};
287
- F(e.dataSourceType || "MOCK"), L(e.dataSinkKey || ""), R(r.parserId || ""), z(e.endpointUrl || ""), V(e.httpMethod || "GET"), U(e.headers || ""), G(e.authType || "none"), K(e.authValue || ""), q(e.requestBody || ""), Y(e.dataPath || ""), X(e.graphqlEndpoint || ""), Z(e.graphqlQuery || ""), Q(e.graphqlVariables || ""), p("general");
288
- } else if (i) {
289
- let e = a || t(i);
290
- C(i), T(e.name), E(""), D(void 0), k(e.defaultConfig || {}), j(e.category === "Installed" ? "CUSTOM" : "BIGCONSOLE"), N(null), F("MOCK"), L(""), R(""), z(""), V("GET"), U(""), G("none"), K(""), q(""), Y(""), X(""), Z(""), Q(""), p("general");
291
- } else C(void 0), T(""), E(""), D(void 0), k({}), j("BIGCONSOLE"), N(null), F("MOCK"), L(""), R(""), z(""), V("GET"), U(""), G("none"), K(""), q(""), Y(""), X(""), Z(""), Q(""), p("type");
292
- }, [
293
- r,
294
- i,
295
- a,
296
- n
297
- ]);
298
- let Fe = l((e, n) => {
299
- C(e);
300
- let r = n || t(e);
301
- r && (T(r.name), k(r.defaultConfig || {}), r.category === "Installed" && j("CUSTOM"));
302
- }, []), Ie = l((e) => {
303
- if (j(e), e === "BIGCONSOLE") N(null);
304
- else {
305
- let t = Se.find((t) => t.renderer === e);
306
- N(t ? t.template : {});
307
- }
308
- }, []), Le = l(() => {
309
- if (!S) return;
310
- let e;
311
- if (I) {
312
- for (let t of x.values()) if (t.key === I) {
313
- e = t.id;
314
- break;
315
- }
316
- }
317
- s({
318
- type: S,
319
- title: w,
320
- description: Te || void 0,
321
- refreshInterval: Ee,
322
- config: {
323
- ...O,
324
- dataSourceType: P,
325
- dataSinkKey: I || void 0,
326
- ...P === "REST_API" ? {
327
- endpointUrl: Oe || void 0,
328
- httpMethod: B || "GET",
329
- headers: H || void 0,
330
- authType: W || "none",
331
- authValue: ke || void 0,
332
- requestBody: Ae || void 0,
333
- dataPath: J || void 0
334
- } : {},
335
- ...P === "GRAPHQL" ? {
336
- graphqlEndpoint: je || void 0,
337
- graphqlQuery: Me || void 0,
338
- graphqlVariables: Ne || void 0,
339
- headers: H || void 0,
340
- dataPath: J || void 0
341
- } : {}
342
- },
343
- renderer: A,
344
- template: A === "BIGCONSOLE" ? void 0 : M,
345
- dataSinkId: e || void 0,
346
- parserId: De || void 0
347
- }), o();
348
- }, [
349
- S,
350
- w,
351
- Te,
352
- Ee,
353
- O,
354
- A,
355
- M,
356
- P,
357
- I,
358
- x,
359
- De,
360
- Oe,
361
- B,
362
- H,
363
- W,
364
- ke,
365
- Ae,
366
- J,
367
- je,
368
- Me,
369
- Ne,
370
- s,
371
- o
372
- ]), Re = S ? t(S) : null, ze = S ? Ce(S) : null, Be = A !== "BIGCONSOLE", Ve = A === "BIGCONSOLE" && ze, $ = ie(() => [
373
- {
374
- id: "type",
375
- label: "Type",
376
- show: d
377
- },
378
- {
379
- id: "general",
380
- label: "General",
381
- show: !0
382
- },
383
- {
384
- id: "renderer",
385
- label: "Template",
386
- show: Be
387
- },
388
- {
389
- id: "config",
390
- label: "Data Source",
391
- show: !0
392
- }
393
- ].filter((e) => e.show), [
394
- d,
395
- Be,
396
- !0
397
- ]);
398
- return /* @__PURE__ */ y(de, {
399
- open: n,
400
- onOpenChange: (e) => !e && o(),
401
- children: /* @__PURE__ */ b(fe, {
402
- style: {
403
- maxWidth: "520px",
404
- width: "95vw",
405
- maxHeight: "85vh",
406
- display: "flex",
407
- flexDirection: "column",
408
- padding: 0,
409
- overflow: "hidden"
410
- },
411
- children: [
412
- /* @__PURE__ */ b(he, {
413
- style: {
414
- padding: "16px 16px 8px 16px",
415
- flexShrink: 0
416
- },
417
- children: [/* @__PURE__ */ y(ge, {
418
- style: { fontSize: "16px" },
419
- children: d ? "Add Widget" : "Edit Widget"
420
- }), /* @__PURE__ */ y(pe, {
421
- className: "text-xs",
422
- children: Re ? /* @__PURE__ */ b(be, { children: [Re.name, A !== "BIGCONSOLE" && /* @__PURE__ */ y("span", {
423
- className: "ml-2 px-1.5 py-0.5 text-xs bg-action-primary-bg/10 text-primary rounded",
424
- children: xe.find((e) => e.type === A)?.name
425
- })] }) : "Configure the widget data source, appearance, and actions."
426
- })]
427
- }),
428
- /* @__PURE__ */ b(_e, {
429
- value: f,
430
- onValueChange: (e) => p(e),
431
- style: {
432
- flex: 1,
433
- display: "flex",
434
- flexDirection: "column",
435
- minHeight: 0,
436
- overflow: "hidden"
437
- },
438
- children: [/* @__PURE__ */ y(ve, {
439
- style: {
440
- margin: "0 16px",
441
- width: "auto",
442
- justifyContent: "flex-start",
443
- height: "32px",
444
- flexShrink: 0
445
- },
446
- children: $.map((e) => /* @__PURE__ */ y(ye, {
447
- value: e.id,
448
- disabled: e.id !== "type" && !S,
449
- style: {
450
- fontSize: "12px",
451
- padding: "4px 12px"
452
- },
453
- children: e.label
454
- }, e.id))
455
- }), /* @__PURE__ */ b("div", {
456
- style: {
457
- flex: 1,
458
- minHeight: 0,
459
- marginTop: "8px",
460
- overflow: "auto",
461
- display: "flex",
462
- flexDirection: "column"
463
- },
464
- children: [
465
- /* @__PURE__ */ y(_, {
466
- value: "type",
467
- style: {
468
- marginTop: 0,
469
- height: "100%",
470
- overflow: "hidden"
471
- },
472
- children: /* @__PURE__ */ y(ee, {
473
- selectedType: S,
474
- selectedRenderer: A,
475
- onSelect: (e, t) => {
476
- Fe(e, t), p("general");
477
- },
478
- onRendererSelect: Ie,
479
- installedWidgets: ae,
480
- definitions: oe
481
- })
482
- }),
483
- /* @__PURE__ */ y(_, {
484
- value: "general",
485
- style: {
486
- marginTop: 0,
487
- flex: 1,
488
- overflowY: "auto",
489
- padding: "12px 16px",
490
- minHeight: "300px"
491
- },
492
- children: /* @__PURE__ */ b("div", {
493
- className: "space-y-4",
494
- children: [
495
- /* @__PURE__ */ b("div", {
496
- className: "space-y-2",
497
- children: [/* @__PURE__ */ y(g, {
498
- htmlFor: "title",
499
- children: "Title"
500
- }), /* @__PURE__ */ y(h, {
501
- id: "title",
502
- value: w,
503
- onChange: (e) => T(e.target.value),
504
- placeholder: "Widget title"
505
- })]
506
- }),
507
- /* @__PURE__ */ b("div", {
508
- className: "space-y-2",
509
- children: [/* @__PURE__ */ y(g, {
510
- htmlFor: "description",
511
- children: "Description (optional)"
512
- }), /* @__PURE__ */ y(v, {
513
- id: "description",
514
- value: Te,
515
- onChange: (e) => E(e.target.value),
516
- placeholder: "Brief description of this widget",
517
- rows: 2
518
- })]
519
- }),
520
- /* @__PURE__ */ b("div", {
521
- className: "space-y-2",
522
- children: [/* @__PURE__ */ y(g, { children: "Renderer" }), /* @__PURE__ */ y("div", {
523
- className: "grid grid-cols-2 gap-2",
524
- children: Pe.map((e) => {
525
- let t = e.icon;
526
- return /* @__PURE__ */ y(se, {
527
- className: `cursor-pointer transition-colors ${A === e.type ? "border-primary bg-action-primary-bg/5" : "hover:border-primary/50"}`,
528
- onClick: () => Ie(e.type),
529
- children: /* @__PURE__ */ y(le, {
530
- className: "p-3",
531
- children: /* @__PURE__ */ b("div", {
532
- className: "flex items-start gap-3",
533
- children: [/* @__PURE__ */ y("div", {
534
- className: `p-2 rounded-md ${A === e.type ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken"}`,
535
- children: /* @__PURE__ */ y(t, { className: "size-4" })
536
- }), /* @__PURE__ */ b("div", {
537
- className: "flex-1 min-w-0",
538
- children: [/* @__PURE__ */ y(ue, {
539
- className: "text-sm",
540
- children: e.name
541
- }), /* @__PURE__ */ y(ce, {
542
- className: "text-xs line-clamp-2",
543
- children: e.description
544
- })]
545
- })]
546
- })
547
- })
548
- }, e.type);
549
- })
550
- })]
551
- }),
552
- /* @__PURE__ */ b("div", {
553
- className: "space-y-2",
554
- children: [/* @__PURE__ */ y(g, {
555
- htmlFor: "refresh",
556
- children: "Auto-Refresh Interval (seconds)"
557
- }), /* @__PURE__ */ y(h, {
558
- id: "refresh",
559
- type: "number",
560
- value: Ee || "",
561
- onChange: (e) => D(e.target.value ? Number(e.target.value) : void 0),
562
- min: 0,
563
- placeholder: "No auto-refresh"
564
- })]
565
- })
566
- ]
567
- })
568
- }),
569
- /* @__PURE__ */ y(_, {
570
- value: "renderer",
571
- style: {
572
- marginTop: 0,
573
- flex: 1,
574
- overflowY: "auto",
575
- padding: "12px 16px",
576
- minHeight: "300px"
577
- },
578
- children: /* @__PURE__ */ y(we, {
579
- renderer: A,
580
- template: M,
581
- onChange: N
582
- })
583
- }),
584
- /* @__PURE__ */ y(_, {
585
- value: "config",
586
- style: {
587
- marginTop: 0,
588
- flex: 1,
589
- overflowY: "auto",
590
- padding: "12px 16px",
591
- minHeight: "300px"
592
- },
593
- children: /* @__PURE__ */ b("div", {
594
- className: "space-y-4",
595
- children: [/* @__PURE__ */ b("div", {
596
- className: "space-y-3 p-3 border border-border-subtle rounded-lg bg-bg-sunken/30",
597
- children: [
598
- /* @__PURE__ */ y("h4", {
599
- className: "text-sm font-medium",
600
- children: "Data Source"
601
- }),
602
- /* @__PURE__ */ b("div", {
603
- className: "space-y-2",
604
- children: [/* @__PURE__ */ y(g, {
605
- htmlFor: "dataSourceType",
606
- children: "Source Type"
607
- }), /* @__PURE__ */ b("select", {
608
- id: "dataSourceType",
609
- value: P,
610
- onChange: (e) => F(e.target.value),
611
- className: "w-full h-9 px-3 rounded-md border border-border-default bg-bg-surface text-sm",
612
- children: [
613
- /* @__PURE__ */ y("option", {
614
- value: "MOCK",
615
- children: "Sample JSON"
616
- }),
617
- /* @__PURE__ */ y("option", {
618
- value: "DATASINK",
619
- children: "DataSink"
620
- }),
621
- /* @__PURE__ */ y("option", {
622
- value: "REST_API",
623
- children: "REST API"
624
- }),
625
- /* @__PURE__ */ y("option", {
626
- value: "GRAPHQL",
627
- children: "GraphQL"
628
- })
629
- ]
630
- })]
631
- }),
632
- P === "DATASINK" && /* @__PURE__ */ b("div", {
633
- className: "space-y-2",
634
- children: [/* @__PURE__ */ y(g, {
635
- htmlFor: "dataSinkKey",
636
- children: "DataSink"
637
- }), /* @__PURE__ */ y(te, {
638
- value: I || null,
639
- onChange: (e) => L(e || ""),
640
- placeholder: "Select a DataSink..."
641
- })]
642
- }),
643
- P === "REST_API" && /* @__PURE__ */ b("div", {
644
- className: "space-y-3",
645
- children: [
646
- /* @__PURE__ */ b("div", {
647
- className: "space-y-2",
648
- children: [/* @__PURE__ */ y(g, { children: "Endpoint URL *" }), /* @__PURE__ */ y(h, {
649
- value: Oe,
650
- onChange: (e) => z(e.target.value),
651
- placeholder: "https://api.example.com/data"
652
- })]
653
- }),
654
- /* @__PURE__ */ b("div", {
655
- className: "space-y-2",
656
- children: [/* @__PURE__ */ y(g, { children: "HTTP Method" }), /* @__PURE__ */ b("select", {
657
- value: B,
658
- onChange: (e) => V(e.target.value),
659
- className: "w-full h-9 px-3 rounded-md border border-border-default bg-bg-surface text-sm",
660
- children: [
661
- /* @__PURE__ */ y("option", {
662
- value: "GET",
663
- children: "GET"
664
- }),
665
- /* @__PURE__ */ y("option", {
666
- value: "POST",
667
- children: "POST"
668
- }),
669
- /* @__PURE__ */ y("option", {
670
- value: "PUT",
671
- children: "PUT"
672
- }),
673
- /* @__PURE__ */ y("option", {
674
- value: "DELETE",
675
- children: "DELETE"
676
- })
677
- ]
678
- })]
679
- }),
680
- /* @__PURE__ */ b("div", {
681
- className: "space-y-2",
682
- children: [/* @__PURE__ */ y(g, { children: "Headers (JSON)" }), /* @__PURE__ */ y(v, {
683
- value: H,
684
- onChange: (e) => U(e.target.value),
685
- rows: 2,
686
- placeholder: "{\"Content-Type\": \"application/json\"}",
687
- className: "font-mono text-xs"
688
- })]
689
- }),
690
- /* @__PURE__ */ b("div", {
691
- className: "space-y-2",
692
- children: [/* @__PURE__ */ y(g, { children: "Authentication" }), /* @__PURE__ */ b("select", {
693
- value: W,
694
- onChange: (e) => G(e.target.value),
695
- className: "w-full h-9 px-3 rounded-md border border-border-default bg-bg-surface text-sm",
696
- children: [
697
- /* @__PURE__ */ y("option", {
698
- value: "none",
699
- children: "None"
700
- }),
701
- /* @__PURE__ */ y("option", {
702
- value: "api_key",
703
- children: "API Key"
704
- }),
705
- /* @__PURE__ */ y("option", {
706
- value: "bearer",
707
- children: "Bearer Token"
708
- }),
709
- /* @__PURE__ */ y("option", {
710
- value: "basic",
711
- children: "Basic Auth"
712
- })
713
- ]
714
- })]
715
- }),
716
- W !== "none" && /* @__PURE__ */ b("div", {
717
- className: "space-y-2",
718
- children: [/* @__PURE__ */ y(g, { children: W === "basic" ? "Credentials (user:pass)" : "Token/Key" }), /* @__PURE__ */ y(h, {
719
- type: "password",
720
- value: ke,
721
- onChange: (e) => K(e.target.value),
722
- placeholder: W === "basic" ? "username:password" : "Enter token or API key"
723
- })]
724
- }),
725
- (B === "POST" || B === "PUT") && /* @__PURE__ */ b("div", {
726
- className: "space-y-2",
727
- children: [/* @__PURE__ */ y(g, { children: "Request Body (JSON)" }), /* @__PURE__ */ y(v, {
728
- value: Ae,
729
- onChange: (e) => q(e.target.value),
730
- rows: 3,
731
- placeholder: "{\"key\": \"value\"}",
732
- className: "font-mono text-xs"
733
- })]
734
- }),
735
- /* @__PURE__ */ b("div", {
736
- className: "space-y-2",
737
- children: [
738
- /* @__PURE__ */ y(g, { children: "Data Path (optional)" }),
739
- /* @__PURE__ */ y(h, {
740
- value: J,
741
- onChange: (e) => Y(e.target.value),
742
- placeholder: "$.data.items or .data.items"
743
- }),
744
- /* @__PURE__ */ y("p", {
745
- className: "text-xs text-text-secondary",
746
- children: "Extract data from response using JSONPath"
747
- })
748
- ]
749
- })
750
- ]
751
- }),
752
- P === "GRAPHQL" && /* @__PURE__ */ b("div", {
753
- className: "space-y-3",
754
- children: [
755
- /* @__PURE__ */ b("div", {
756
- className: "space-y-2",
757
- children: [/* @__PURE__ */ y(g, { children: "GraphQL Endpoint *" }), /* @__PURE__ */ y(h, {
758
- value: je,
759
- onChange: (e) => X(e.target.value),
760
- placeholder: "https://api.example.com/graphql"
761
- })]
762
- }),
763
- /* @__PURE__ */ b("div", {
764
- className: "space-y-2",
765
- children: [/* @__PURE__ */ y(g, { children: "Query *" }), /* @__PURE__ */ y(v, {
766
- value: Me,
767
- onChange: (e) => Z(e.target.value),
768
- rows: 5,
769
- placeholder: "query GetData($limit: Int) {\n items(limit: $limit) {\n id\n name\n }\n}",
770
- className: "font-mono text-xs"
771
- })]
772
- }),
773
- /* @__PURE__ */ b("div", {
774
- className: "space-y-2",
775
- children: [/* @__PURE__ */ y(g, { children: "Variables (JSON, optional)" }), /* @__PURE__ */ y(v, {
776
- value: Ne,
777
- onChange: (e) => Q(e.target.value),
778
- rows: 2,
779
- placeholder: "{\"limit\": 10}",
780
- className: "font-mono text-xs"
781
- })]
782
- }),
783
- /* @__PURE__ */ b("div", {
784
- className: "space-y-2",
785
- children: [/* @__PURE__ */ y(g, { children: "Headers (JSON, optional)" }), /* @__PURE__ */ y(v, {
786
- value: H,
787
- onChange: (e) => U(e.target.value),
788
- rows: 2,
789
- placeholder: "{\"Authorization\": \"Bearer token\"}",
790
- className: "font-mono text-xs"
791
- })]
792
- }),
793
- /* @__PURE__ */ b("div", {
794
- className: "space-y-2",
795
- children: [
796
- /* @__PURE__ */ y(g, { children: "Data Path (optional)" }),
797
- /* @__PURE__ */ y(h, {
798
- value: J,
799
- onChange: (e) => Y(e.target.value),
800
- placeholder: ".data.items"
801
- }),
802
- /* @__PURE__ */ y("p", {
803
- className: "text-xs text-text-secondary",
804
- children: "Extract data from GraphQL response"
805
- })
806
- ]
807
- })
808
- ]
809
- }),
810
- c && /* @__PURE__ */ b("div", {
811
- className: "space-y-2",
812
- children: [
813
- /* @__PURE__ */ y(g, {
814
- htmlFor: "parserId",
815
- children: "Parser (optional)"
816
- }),
817
- /* @__PURE__ */ y(ne, {
818
- consoleId: c,
819
- value: De || null,
820
- onChange: (e) => R(e || ""),
821
- filterInputSinkKey: P === "DATASINK" ? I : void 0,
822
- filterStatus: void 0,
823
- placeholder: "Select a parser..."
824
- }),
825
- /* @__PURE__ */ y("p", {
826
- className: "text-xs text-text-secondary",
827
- children: "Transform data using a parser before display"
828
- })
829
- ]
830
- })
831
- ]
832
- }), Ve && ze && /* @__PURE__ */ y(ze, {
833
- config: O,
834
- onChange: k
835
- })]
836
- })
837
- })
838
- ]
839
- })]
840
- }),
841
- /* @__PURE__ */ b(me, {
842
- style: {
843
- display: "flex",
844
- flexDirection: "row",
845
- justifyContent: "space-between",
846
- padding: "12px 16px",
847
- borderTop: "1px solid var(--border)",
848
- flexShrink: 0
849
- },
850
- children: [/* @__PURE__ */ y(m, {
851
- variant: "ghost",
852
- size: "sm",
853
- onClick: () => {
854
- let e = $.findIndex((e) => e.id === f);
855
- e > 0 ? p($[e - 1].id) : o();
856
- },
857
- children: f === $[0]?.id ? "Cancel" : "Back"
858
- }), /* @__PURE__ */ b("div", {
859
- className: "flex gap-2",
860
- children: [f !== $[$.length - 1]?.id && S && /* @__PURE__ */ y(m, {
861
- variant: "outline",
862
- size: "sm",
863
- onClick: () => {
864
- let e = $.findIndex((e) => e.id === f);
865
- e < $.length - 1 && p($[e + 1].id);
866
- },
867
- children: "Next"
868
- }), /* @__PURE__ */ y(m, {
869
- size: "sm",
870
- onClick: Le,
871
- disabled: !S || !w.trim() || A !== "BIGCONSOLE" && !M,
872
- children: d ? "Add Widget" : "Save"
873
- })]
874
- })]
875
- })
876
- ]
877
- })
878
- });
879
- });
880
- //#endregion
881
- export { S as default };
882
-
883
- //# sourceMappingURL=WidgetConfigDialog.js.map