@burdenoff/microfe-bigconsole 2026.1119.3 → 2026.1119.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/parser/ParserSelector.js +150 -145
- package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
- package/dist/bigconsole/customWidget/index.d.ts +2 -1
- package/dist/bigconsole/customWidget/index.js +1 -0
- package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
- package/dist/bigconsole/customWidget/proposalContract.js +37 -14
- package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
- package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
- package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
- package/dist/bigconsole/customWidget/proposalSource.js +197 -51
- package/dist/bigconsole/hooks/useParserOperations.js +80 -74
- package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
- package/dist/bigconsole/store/parserScope.d.ts +24 -0
- package/dist/bigconsole/store/parserScope.js +17 -0
- package/dist/bigconsole/store/parserStore.d.ts +3 -0
- package/dist/bigconsole/store/parserStore.js +70 -68
- package/dist/generated/wspace-operations.d.ts +10 -0
- package/dist/generated/wspace-operations.js +180 -110
- package/package.json +1 -1
|
@@ -5,50 +5,50 @@ import "../../contexts/index.js";
|
|
|
5
5
|
import { ParserTypeBadge as r } from "./ParserTypeBadge.js";
|
|
6
6
|
import { ParserStatusBadge as i } from "./ParserStatusBadge.js";
|
|
7
7
|
import "../common/index.js";
|
|
8
|
-
import { Fragment as a, memo as o, useCallback as s, useEffect as c,
|
|
9
|
-
import { Plus as
|
|
10
|
-
import { useI18n as
|
|
11
|
-
import { jsx as
|
|
8
|
+
import { Fragment as a, memo as o, useCallback as s, useEffect as c, useId as l, useMemo as u, useState as d } from "react";
|
|
9
|
+
import { Plus as f } from "lucide-react";
|
|
10
|
+
import { useI18n as p } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
12
|
// src/bigconsole/components/parser/ParserSelector.tsx
|
|
13
|
-
var
|
|
13
|
+
var g = "default", _ = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y border-[var(--color-border-default)]", v = "text-xs font-semibold uppercase tracking-wide text-text-secondary", y = ({ className: e }) => /* @__PURE__ */ m("svg", {
|
|
14
14
|
className: e,
|
|
15
15
|
fill: "none",
|
|
16
16
|
stroke: "currentColor",
|
|
17
17
|
viewBox: "0 0 24 24",
|
|
18
|
-
children: /* @__PURE__ */
|
|
18
|
+
children: /* @__PURE__ */ m("path", {
|
|
19
19
|
strokeLinecap: "round",
|
|
20
20
|
strokeLinejoin: "round",
|
|
21
21
|
strokeWidth: 2,
|
|
22
22
|
d: "M19 9l-7 7-7-7"
|
|
23
23
|
})
|
|
24
|
-
}),
|
|
24
|
+
}), b = ({ className: e }) => /* @__PURE__ */ h("svg", {
|
|
25
25
|
className: e,
|
|
26
26
|
fill: "none",
|
|
27
27
|
stroke: "currentColor",
|
|
28
28
|
viewBox: "0 0 24 24",
|
|
29
29
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ m("path", {
|
|
31
31
|
strokeLinecap: "round",
|
|
32
32
|
strokeLinejoin: "round",
|
|
33
33
|
strokeWidth: 2,
|
|
34
34
|
d: "M12 21a9 9 0 100-18 9 9 0 000 18z"
|
|
35
35
|
}),
|
|
36
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ m("path", {
|
|
37
37
|
strokeLinecap: "round",
|
|
38
38
|
strokeLinejoin: "round",
|
|
39
39
|
strokeWidth: 2,
|
|
40
40
|
d: "M3.6 9h16.8M3.6 15h16.8"
|
|
41
41
|
}),
|
|
42
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ m("path", {
|
|
43
43
|
strokeLinecap: "round",
|
|
44
44
|
strokeLinejoin: "round",
|
|
45
45
|
strokeWidth: 2,
|
|
46
46
|
d: "M12 3a15 15 0 014 9 15 15 0 01-4 9 15 15 0 01-4-9 15 15 0 014-9z"
|
|
47
47
|
})
|
|
48
48
|
]
|
|
49
|
-
}),
|
|
50
|
-
let { t: s } =
|
|
51
|
-
return /* @__PURE__ */
|
|
49
|
+
}), x = o(function({ parser: e, isSelected: t, onSelect: a, isGlobal: o = !1 }) {
|
|
50
|
+
let { t: s } = p();
|
|
51
|
+
return /* @__PURE__ */ m("button", {
|
|
52
52
|
type: "button",
|
|
53
53
|
onClick: () => a(e.id),
|
|
54
54
|
className: `
|
|
@@ -60,35 +60,35 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
|
|
|
60
60
|
${n}
|
|
61
61
|
${t ? "bg-action-primary-bg/10" : ""}
|
|
62
62
|
`,
|
|
63
|
-
children: /* @__PURE__ */
|
|
63
|
+
children: /* @__PURE__ */ h("div", {
|
|
64
64
|
className: "flex items-start justify-between gap-2",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ h("div", {
|
|
66
66
|
className: "flex-1 min-w-0",
|
|
67
67
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ h("div", {
|
|
69
69
|
className: "flex items-center gap-2 mb-1",
|
|
70
70
|
children: [
|
|
71
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ m(r, {
|
|
72
72
|
type: e.type,
|
|
73
73
|
size: "sm"
|
|
74
74
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ m("span", {
|
|
76
76
|
className: "text-sm font-medium text-text-primary truncate",
|
|
77
77
|
children: e.name
|
|
78
78
|
}),
|
|
79
|
-
o && /* @__PURE__ */
|
|
79
|
+
o && /* @__PURE__ */ h("span", {
|
|
80
80
|
className: "inline-flex items-center gap-1 px-1.5 py-0.5 text-xs bg-bg-sunken text-text-secondary rounded",
|
|
81
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ m(b, { className: "w-3 h-3" }), s("bigconsole.parsers.selector.globalBadge", "Global")]
|
|
82
82
|
})
|
|
83
83
|
]
|
|
84
84
|
}),
|
|
85
|
-
e.description && /* @__PURE__ */
|
|
85
|
+
e.description && /* @__PURE__ */ m("p", {
|
|
86
86
|
className: "text-xs text-text-secondary line-clamp-1 mb-1",
|
|
87
87
|
children: e.description
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ m("div", {
|
|
90
90
|
className: "flex min-w-0 items-center gap-2 text-xs text-text-muted",
|
|
91
|
-
children: /* @__PURE__ */
|
|
91
|
+
children: /* @__PURE__ */ h("span", {
|
|
92
92
|
className: "truncate font-mono",
|
|
93
93
|
children: [
|
|
94
94
|
e.inputSinkKey,
|
|
@@ -98,9 +98,9 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
|
|
|
98
98
|
})
|
|
99
99
|
})
|
|
100
100
|
]
|
|
101
|
-
}), /* @__PURE__ */
|
|
101
|
+
}), /* @__PURE__ */ m("div", {
|
|
102
102
|
className: "shrink-0",
|
|
103
|
-
children: /* @__PURE__ */
|
|
103
|
+
children: /* @__PURE__ */ m(i, {
|
|
104
104
|
status: e.status,
|
|
105
105
|
size: "sm",
|
|
106
106
|
showIcon: !1
|
|
@@ -108,95 +108,95 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
|
|
|
108
108
|
})]
|
|
109
109
|
})
|
|
110
110
|
});
|
|
111
|
-
}),
|
|
112
|
-
let { t:
|
|
111
|
+
}), S = o(function({ consoleId: i, value: o, resolvedParser: b, onChange: S, filterType: C, filterStatus: w = "active", filterInputSinkKey: T, placeholder: E, disabled: D = !1, error: O = !1, errorMessage: k }) {
|
|
112
|
+
let { t: A } = p(), [j, M] = d(!1), [N, P] = d(""), F = E ?? A("bigconsole.parsers.selector.placeholder", "Select a parser..."), I = e(), L = l(), R = i === g, { parsers: z, loading: B, fetchParsers: V } = t({
|
|
113
113
|
consoleId: i,
|
|
114
|
-
skipFetch:
|
|
115
|
-
}), { parsers:
|
|
116
|
-
consoleId:
|
|
117
|
-
skipFetch:
|
|
118
|
-
}),
|
|
119
|
-
if (
|
|
120
|
-
let e = new Set(
|
|
121
|
-
return [...
|
|
114
|
+
skipFetch: R
|
|
115
|
+
}), { parsers: H, loading: U, fetchParsers: W } = t({
|
|
116
|
+
consoleId: g,
|
|
117
|
+
skipFetch: R
|
|
118
|
+
}), G = u(() => {
|
|
119
|
+
if (R) return z;
|
|
120
|
+
let e = new Set(z.map((e) => e.id)), t = H.filter((t) => !e.has(t.id));
|
|
121
|
+
return [...z, ...t];
|
|
122
122
|
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
]),
|
|
127
|
-
if (
|
|
128
|
-
if (
|
|
129
|
-
let t =
|
|
123
|
+
z,
|
|
124
|
+
H,
|
|
125
|
+
R
|
|
126
|
+
]), K = B || U, q = u(() => G.filter((e) => {
|
|
127
|
+
if (C && e.type !== C || w && e.status !== w || T && e.inputSinkKey !== T) return !1;
|
|
128
|
+
if (N) {
|
|
129
|
+
let t = N.toLowerCase();
|
|
130
130
|
return e.name.toLowerCase().includes(t) || e.description?.toLowerCase().includes(t) || e.inputSinkKey.toLowerCase().includes(t) || e.outputKey.toLowerCase().includes(t);
|
|
131
131
|
}
|
|
132
132
|
return !0;
|
|
133
133
|
}), [
|
|
134
|
-
|
|
135
|
-
S,
|
|
134
|
+
G,
|
|
136
135
|
C,
|
|
137
136
|
w,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
137
|
+
T,
|
|
138
|
+
N
|
|
139
|
+
]), { dashboardScopedParsers: J, globalScopedParsers: Y } = u(() => ({
|
|
140
|
+
dashboardScopedParsers: q.filter((e) => e.consoleId !== g),
|
|
141
|
+
globalScopedParsers: q.filter((e) => e.consoleId === g)
|
|
142
|
+
}), [q]), X = G.find((e) => e.id === o) ?? (b?.id === o ? b : void 0);
|
|
143
143
|
c(() => {
|
|
144
|
-
i && (
|
|
145
|
-
type:
|
|
146
|
-
status:
|
|
147
|
-
}),
|
|
148
|
-
type:
|
|
149
|
-
status:
|
|
144
|
+
i && (V({
|
|
145
|
+
type: C,
|
|
146
|
+
status: w ?? void 0
|
|
147
|
+
}), R || W({
|
|
148
|
+
type: C,
|
|
149
|
+
status: w ?? void 0
|
|
150
150
|
}));
|
|
151
151
|
}, [
|
|
152
152
|
i,
|
|
153
|
-
S,
|
|
154
153
|
C,
|
|
155
154
|
w,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
T,
|
|
156
|
+
V,
|
|
157
|
+
W,
|
|
158
|
+
R
|
|
159
159
|
]);
|
|
160
|
-
let
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
if (
|
|
164
|
-
let e = !
|
|
165
|
-
e && (
|
|
166
|
-
type:
|
|
167
|
-
status:
|
|
168
|
-
}),
|
|
169
|
-
type:
|
|
170
|
-
status:
|
|
171
|
-
})),
|
|
160
|
+
let Z = s((e) => {
|
|
161
|
+
S(e), M(!1), P("");
|
|
162
|
+
}, [S]), Q = s(() => {
|
|
163
|
+
if (D) return;
|
|
164
|
+
let e = !j;
|
|
165
|
+
e && (V({
|
|
166
|
+
type: C,
|
|
167
|
+
status: w ?? void 0
|
|
168
|
+
}), R || W({
|
|
169
|
+
type: C,
|
|
170
|
+
status: w ?? void 0
|
|
171
|
+
})), M(e);
|
|
172
172
|
}, [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
S,
|
|
173
|
+
D,
|
|
174
|
+
j,
|
|
175
|
+
V,
|
|
176
|
+
W,
|
|
178
177
|
C,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
178
|
+
w,
|
|
179
|
+
R
|
|
180
|
+
]), $ = s(() => {
|
|
181
|
+
M(!1);
|
|
182
|
+
}, []), ee = s(() => {
|
|
183
|
+
M(!1);
|
|
184
|
+
let e = R ? "/parsers/new" : `/dashboards/${i}/parsers/new`;
|
|
185
|
+
window.open(I(e), "_blank", "noopener,noreferrer");
|
|
186
186
|
}, [
|
|
187
|
-
|
|
187
|
+
I,
|
|
188
188
|
i,
|
|
189
|
-
|
|
189
|
+
R
|
|
190
190
|
]);
|
|
191
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ h("div", {
|
|
192
192
|
className: "relative",
|
|
193
193
|
children: [
|
|
194
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ h("button", {
|
|
195
195
|
type: "button",
|
|
196
|
-
onClick:
|
|
197
|
-
disabled:
|
|
196
|
+
onClick: Q,
|
|
197
|
+
disabled: D,
|
|
198
198
|
"aria-haspopup": "listbox",
|
|
199
|
-
"aria-expanded":
|
|
199
|
+
"aria-expanded": j,
|
|
200
200
|
className: `
|
|
201
201
|
w-full min-w-0 min-h-control-md
|
|
202
202
|
px-3 py-2
|
|
@@ -206,63 +206,63 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
|
|
|
206
206
|
flex items-center justify-between gap-2
|
|
207
207
|
motion-safe:transition-colors
|
|
208
208
|
${n}
|
|
209
|
-
${
|
|
210
|
-
${
|
|
211
|
-
${
|
|
209
|
+
${D ? "opacity-50 cursor-not-allowed" : "hover:border-action-primary-bg cursor-pointer"}
|
|
210
|
+
${O ? "border-status-error-border" : "border-[var(--color-border-default)]"}
|
|
211
|
+
${j ? "border-action-primary-bg ring-2 ring-action-primary-bg/20" : ""}
|
|
212
212
|
`,
|
|
213
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ m("div", {
|
|
214
214
|
className: "flex-1 min-w-0",
|
|
215
|
-
children:
|
|
215
|
+
children: X ? /* @__PURE__ */ h("div", {
|
|
216
216
|
className: "flex min-w-0 items-center gap-2",
|
|
217
|
-
children: [/* @__PURE__ */
|
|
218
|
-
type:
|
|
217
|
+
children: [/* @__PURE__ */ m(r, {
|
|
218
|
+
type: X.type,
|
|
219
219
|
size: "sm"
|
|
220
|
-
}), /* @__PURE__ */
|
|
220
|
+
}), /* @__PURE__ */ m("span", {
|
|
221
221
|
className: "text-sm text-text-primary truncate",
|
|
222
|
-
children:
|
|
222
|
+
children: X.name
|
|
223
223
|
})]
|
|
224
|
-
}) : /* @__PURE__ */
|
|
224
|
+
}) : /* @__PURE__ */ m("span", {
|
|
225
225
|
className: "text-sm text-text-muted",
|
|
226
|
-
children:
|
|
226
|
+
children: F
|
|
227
227
|
})
|
|
228
|
-
}), /* @__PURE__ */
|
|
228
|
+
}), /* @__PURE__ */ m(y, {
|
|
229
229
|
"aria-hidden": "true",
|
|
230
|
-
className: `w-4 h-4 shrink-0 text-text-secondary motion-safe:transition-transform ${
|
|
230
|
+
className: `w-4 h-4 shrink-0 text-text-secondary motion-safe:transition-transform ${j ? "transform rotate-180" : ""}`
|
|
231
231
|
})]
|
|
232
232
|
}),
|
|
233
|
-
|
|
233
|
+
O && k && /* @__PURE__ */ m("p", {
|
|
234
234
|
className: "mt-1 text-xs text-status-error-text",
|
|
235
|
-
children:
|
|
235
|
+
children: k
|
|
236
236
|
}),
|
|
237
|
-
|
|
237
|
+
j && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
|
|
238
238
|
className: "fixed inset-0 z-10",
|
|
239
|
-
onClick:
|
|
240
|
-
}), /* @__PURE__ */
|
|
241
|
-
className:
|
|
239
|
+
onClick: $
|
|
240
|
+
}), /* @__PURE__ */ h("div", {
|
|
241
|
+
className: `absolute left-0 right-0 top-full mt-1 z-20 bg-bg-surface border border-[var(--color-border-default)] rounded-md shadow-lg ${R ? "max-h-80" : "max-h-[21rem]"} flex flex-col overflow-hidden`,
|
|
242
242
|
children: [
|
|
243
|
-
/* @__PURE__ */
|
|
243
|
+
/* @__PURE__ */ m("div", {
|
|
244
244
|
className: "p-2 border-b border-[var(--color-border-default)]",
|
|
245
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ m("input", {
|
|
246
246
|
type: "text",
|
|
247
|
-
"aria-label":
|
|
248
|
-
placeholder:
|
|
249
|
-
value:
|
|
250
|
-
onChange: (e) =>
|
|
247
|
+
"aria-label": A("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
|
|
248
|
+
placeholder: A("bigconsole.parsers.selector.searchPlaceholder", "Search parsers..."),
|
|
249
|
+
value: N,
|
|
250
|
+
onChange: (e) => P(e.target.value),
|
|
251
251
|
className: "\n w-full min-w-0 min-h-control-md px-3 py-2\n bg-bg-sunken\n border border-[var(--color-border-default)]\n rounded-md\n text-sm text-text-primary\n placeholder:text-text-muted\n focus:outline-none\n focus:border-action-primary-bg\n focus:ring-2\n focus:ring-action-primary-bg/20\n "
|
|
252
252
|
})
|
|
253
253
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ m("div", {
|
|
255
255
|
className: "overflow-y-auto flex-1",
|
|
256
|
-
children:
|
|
256
|
+
children: K ? /* @__PURE__ */ m("div", {
|
|
257
257
|
className: "p-4 text-center text-sm text-text-secondary",
|
|
258
|
-
children:
|
|
259
|
-
}) :
|
|
258
|
+
children: A("bigconsole.parsers.selector.loading", "Loading parsers...")
|
|
259
|
+
}) : q.length === 0 ? /* @__PURE__ */ m("div", {
|
|
260
260
|
className: "p-4 text-center text-sm text-text-secondary",
|
|
261
|
-
children:
|
|
262
|
-
}) : /* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
261
|
+
children: A("bigconsole.parsers.selector.empty", "No parsers found")
|
|
262
|
+
}) : /* @__PURE__ */ h(a, { children: [
|
|
263
|
+
/* @__PURE__ */ m("button", {
|
|
264
264
|
type: "button",
|
|
265
|
-
onClick: () =>
|
|
265
|
+
onClick: () => Z(null),
|
|
266
266
|
className: `
|
|
267
267
|
w-full min-h-control-md px-3 py-2
|
|
268
268
|
text-left text-sm
|
|
@@ -271,48 +271,53 @@ var h = "default", g = "sticky top-0 z-[1] bg-bg-sunken px-3 py-1.5 border-y bor
|
|
|
271
271
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-bg-surface
|
|
272
272
|
${o === null ? "bg-action-primary-bg/10 text-action-primary-bg" : "text-text-secondary"}
|
|
273
273
|
`,
|
|
274
|
-
children: /* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ m("span", {
|
|
275
275
|
className: "italic",
|
|
276
|
-
children:
|
|
276
|
+
children: A("bigconsole.parsers.selector.none", "None")
|
|
277
277
|
})
|
|
278
278
|
}),
|
|
279
|
-
|
|
280
|
-
className:
|
|
281
|
-
children: /* @__PURE__ */
|
|
282
|
-
className:
|
|
283
|
-
children:
|
|
279
|
+
J.length > 0 && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
|
|
280
|
+
className: _,
|
|
281
|
+
children: /* @__PURE__ */ m("span", {
|
|
282
|
+
className: v,
|
|
283
|
+
children: A("bigconsole.parsers.selector.dashboardParsers", "Dashboard Parsers")
|
|
284
284
|
})
|
|
285
|
-
}),
|
|
285
|
+
}), J.map((e) => /* @__PURE__ */ m(x, {
|
|
286
286
|
parser: e,
|
|
287
287
|
isSelected: o === e.id,
|
|
288
|
-
onSelect:
|
|
288
|
+
onSelect: Z
|
|
289
289
|
}, e.id))] }),
|
|
290
|
-
|
|
291
|
-
className:
|
|
292
|
-
children: /* @__PURE__ */
|
|
293
|
-
className:
|
|
294
|
-
children:
|
|
290
|
+
Y.length > 0 && /* @__PURE__ */ h(a, { children: [/* @__PURE__ */ m("div", {
|
|
291
|
+
className: _,
|
|
292
|
+
children: /* @__PURE__ */ m("span", {
|
|
293
|
+
className: v,
|
|
294
|
+
children: A("bigconsole.parsers.selector.globalParsers", "Global Parsers")
|
|
295
295
|
})
|
|
296
|
-
}),
|
|
296
|
+
}), Y.map((e) => /* @__PURE__ */ m(x, {
|
|
297
297
|
parser: e,
|
|
298
298
|
isSelected: o === e.id,
|
|
299
|
-
onSelect:
|
|
299
|
+
onSelect: Z,
|
|
300
300
|
isGlobal: !0
|
|
301
301
|
}, e.id))] })
|
|
302
302
|
] })
|
|
303
303
|
}),
|
|
304
|
-
/* @__PURE__ */
|
|
304
|
+
/* @__PURE__ */ h("div", {
|
|
305
305
|
className: "p-2 border-t border-border-default",
|
|
306
|
-
children: /* @__PURE__ */
|
|
306
|
+
children: [/* @__PURE__ */ h("button", {
|
|
307
307
|
type: "button",
|
|
308
|
-
onClick:
|
|
308
|
+
onClick: ee,
|
|
309
|
+
"aria-describedby": R ? void 0 : L,
|
|
309
310
|
className: "\n w-full flex items-center gap-2\n px-3 py-2\n text-sm font-medium text-action-primary-bg\n rounded-md\n hover:bg-action-primary-bg/10\n transition-colors\n ",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
311
|
-
})
|
|
311
|
+
children: [/* @__PURE__ */ m(f, { className: "w-4 h-4" }), R ? A("bigconsole.parsers.selector.createNew", "Create new parser") : A("bigconsole.parsers.selector.createNewForDashboard", "Create new parser for this dashboard")]
|
|
312
|
+
}), !R && /* @__PURE__ */ m("p", {
|
|
313
|
+
id: L,
|
|
314
|
+
className: "m-0 px-3 text-xs leading-4 text-text-muted",
|
|
315
|
+
children: A("bigconsole.parsers.selector.createNewDashboardHint", "Only this dashboard can use it.")
|
|
316
|
+
})]
|
|
312
317
|
})
|
|
313
318
|
]
|
|
314
319
|
})] })
|
|
315
320
|
]
|
|
316
321
|
});
|
|
317
322
|
});
|
|
318
|
-
export {
|
|
323
|
+
export { S as ParserSelector, S as default };
|
|
@@ -6,46 +6,47 @@ import r from "../hooks/useParserOperations.js";
|
|
|
6
6
|
import "../hooks/index.js";
|
|
7
7
|
import { CustomWidgetProposalPanel as i } from "./CustomWidgetProposalPanel.js";
|
|
8
8
|
import { loadDirectProposalPreview as a } from "./proposalPreview.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
9
|
+
import { mappedFields as o } from "./proposalContract.js";
|
|
10
|
+
import { selectActiveProposalSinks as s } from "./proposalSource.js";
|
|
11
|
+
import { memo as c, useCallback as l, useMemo as u } from "react";
|
|
12
|
+
import { Sheet as d, SheetContent as f, SheetDescription as p, SheetHeader as m, SheetTitle as h } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
14
|
+
import { useApolloClient as _ } from "@apollo/client/react";
|
|
15
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
16
|
// src/bigconsole/customWidget/CustomWidgetBuilderSheet.tsx
|
|
16
|
-
var
|
|
17
|
+
var b = {
|
|
17
18
|
x: 0,
|
|
18
19
|
y: 0,
|
|
19
20
|
width: 6,
|
|
20
21
|
height: 4
|
|
21
|
-
},
|
|
22
|
-
let { t:
|
|
23
|
-
consoleId:
|
|
24
|
-
skipFetch: !
|
|
25
|
-
}), { parsers:
|
|
26
|
-
consoleId:
|
|
27
|
-
skipFetch: !
|
|
28
|
-
}),
|
|
29
|
-
let e = new Set(
|
|
30
|
-
return [...
|
|
22
|
+
}, x = "default", S = c(function({ isOpen: c, onClose: S, dashboardId: C, pageId: w, source: T }) {
|
|
23
|
+
let { t: E } = g(), D = _(), { workspaceId: O } = e(), { dataSinks: k } = n({ skipFetch: !c }), { createWidget: A } = t(w, C, { skipFetch: !0 }), j = C === x, { parsers: M, executeParser: N } = r({
|
|
24
|
+
consoleId: C,
|
|
25
|
+
skipFetch: !c
|
|
26
|
+
}), { parsers: P } = r({
|
|
27
|
+
consoleId: x,
|
|
28
|
+
skipFetch: !c || j
|
|
29
|
+
}), F = u(() => s(k), [k]), I = u(() => {
|
|
30
|
+
let e = new Set(M.map((e) => e.id));
|
|
31
|
+
return [...M, ...P.filter((t) => !e.has(t.id))].map((e) => ({
|
|
31
32
|
id: e.id,
|
|
32
33
|
name: e.name,
|
|
33
34
|
inputSinkKey: e.inputSinkKey
|
|
34
35
|
}));
|
|
35
|
-
}, [
|
|
36
|
-
if (!e.binding.parserId) return a(
|
|
37
|
-
let t = await
|
|
38
|
-
if (!t || !t.success) throw Error(t?.error ||
|
|
36
|
+
}, [M, P]), L = l(async (e) => {
|
|
37
|
+
if (!e.binding.parserId) return a(D, e.binding, O);
|
|
38
|
+
let t = await N(e.binding.parserId);
|
|
39
|
+
if (!t || !t.success) throw Error(t?.error || E("bigconsole.widget.customWidget.error.couldNotResolveBinding", "Could not resolve the binding."));
|
|
39
40
|
return t.output;
|
|
40
41
|
}, [
|
|
42
|
+
D,
|
|
43
|
+
N,
|
|
41
44
|
E,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
pageId: C,
|
|
48
|
-
dashboardId: S,
|
|
45
|
+
O
|
|
46
|
+
]), R = l(async (e) => {
|
|
47
|
+
if (!await A({
|
|
48
|
+
pageId: w,
|
|
49
|
+
dashboardId: C,
|
|
49
50
|
type: e.widgetType,
|
|
50
51
|
title: e.presentation.title,
|
|
51
52
|
description: e.presentation.description,
|
|
@@ -53,23 +54,23 @@ var y = {
|
|
|
53
54
|
parserId: e.binding.parserId,
|
|
54
55
|
config: {
|
|
55
56
|
...e.presentation.config,
|
|
56
|
-
...e.fieldMapping,
|
|
57
|
+
...o(e.fieldMapping),
|
|
57
58
|
generatedBy: e.generatedBy,
|
|
58
59
|
sourcePrompt: e.sourcePrompt,
|
|
59
60
|
proposalVersion: e.version
|
|
60
61
|
},
|
|
61
|
-
position: { ...
|
|
62
|
-
})) throw Error(
|
|
62
|
+
position: { ...b }
|
|
63
|
+
})) throw Error(E("bigconsole.widget.customWidget.error.widgetNotCreated", "The widget could not be created."));
|
|
63
64
|
}, [
|
|
64
|
-
|
|
65
|
+
A,
|
|
66
|
+
w,
|
|
65
67
|
C,
|
|
66
|
-
|
|
67
|
-
T
|
|
68
|
+
E
|
|
68
69
|
]);
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
open:
|
|
71
|
-
onOpenChange: (e) => !e &&
|
|
72
|
-
children: /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ v(d, {
|
|
71
|
+
open: c,
|
|
72
|
+
onOpenChange: (e) => !e && S(),
|
|
73
|
+
children: /* @__PURE__ */ y(f, {
|
|
73
74
|
style: {
|
|
74
75
|
width: "min(480px, 100vw)",
|
|
75
76
|
maxWidth: "100vw",
|
|
@@ -77,29 +78,29 @@ var y = {
|
|
|
77
78
|
display: "flex",
|
|
78
79
|
flexDirection: "column"
|
|
79
80
|
},
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
+
children: [/* @__PURE__ */ y(m, {
|
|
81
82
|
style: {
|
|
82
83
|
padding: "var(--space-cardPadding)",
|
|
83
84
|
borderBottom: "1px solid var(--color-border-subtle)",
|
|
84
85
|
backgroundColor: "var(--color-bg-surface)",
|
|
85
86
|
flexShrink: 0
|
|
86
87
|
},
|
|
87
|
-
children: [/* @__PURE__ */
|
|
88
|
-
}), /* @__PURE__ */
|
|
88
|
+
children: [/* @__PURE__ */ v(h, { children: E("bigconsole.widget.customWidget.sheet.title", "AI custom widget") }), /* @__PURE__ */ v(p, { children: E("bigconsole.widget.customWidget.sheet.description", "Describe a widget, review the proposal, then approve it onto the dashboard.") })]
|
|
89
|
+
}), /* @__PURE__ */ v("div", {
|
|
89
90
|
style: {
|
|
90
91
|
flex: 1,
|
|
91
92
|
minHeight: 0
|
|
92
93
|
},
|
|
93
|
-
children: /* @__PURE__ */
|
|
94
|
-
sinks:
|
|
95
|
-
parsers:
|
|
96
|
-
resolvePreviewData:
|
|
97
|
-
onApprove:
|
|
98
|
-
onClose:
|
|
99
|
-
source:
|
|
94
|
+
children: /* @__PURE__ */ v(i, {
|
|
95
|
+
sinks: F,
|
|
96
|
+
parsers: I,
|
|
97
|
+
resolvePreviewData: L,
|
|
98
|
+
onApprove: R,
|
|
99
|
+
onClose: S,
|
|
100
|
+
source: T
|
|
100
101
|
})
|
|
101
102
|
})]
|
|
102
103
|
})
|
|
103
104
|
});
|
|
104
105
|
});
|
|
105
|
-
export {
|
|
106
|
+
export { S as CustomWidgetBuilderSheet, S as default };
|