@burdenoff/microfe-bigconsole 2026.1110.6 → 2026.1110.8
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/dashboard/DashboardCanvas.js +148 -148
- package/dist/bigconsole/components/parser/ExpressionEditor.js +1 -0
- package/dist/bigconsole/components/parser/ParserCard.d.ts +12 -1
- package/dist/bigconsole/components/parser/ParserCard.js +218 -232
- package/dist/bigconsole/components/widgets/WidgetRegistry.js +1 -1
- package/dist/bigconsole/pages/DataParsersPage.js +153 -122
- package/dist/bigconsole/pages/ParserBuilderPage.js +559 -508
- package/dist/bigconsole/pages/ParserViewPage.js +324 -309
- package/dist/bigconsole/utils/widgetPositioning.d.ts +13 -0
- package/dist/bigconsole/utils/widgetPositioning.js +7 -3
- package/dist/generated/wspace-operations.d.ts +2 -0
- package/dist/generated/wspace-operations.js +7 -0
- package/package.json +1 -1
|
@@ -2,11 +2,13 @@ import { SECTION_FOCUS_RING as e } from "../common/sectionStyles.js";
|
|
|
2
2
|
import { ParserStatusBadge as t } from "./ParserStatusBadge.js";
|
|
3
3
|
import { ParserTypeBadge as n } from "./ParserTypeBadge.js";
|
|
4
4
|
import "../common/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { useTr as r } from "../../../shared/hooks/useTr.js";
|
|
6
|
+
import { memo as i, useCallback as a, useMemo as o } from "react";
|
|
7
|
+
import { Database as s, Download as c, FlaskConical as l, Pencil as u, Play as d, Trash2 as f } from "lucide-react";
|
|
8
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
7
9
|
// src/bigconsole/components/parser/ParserCard.tsx
|
|
8
|
-
var
|
|
9
|
-
function
|
|
10
|
+
var h = `inline-flex min-h-11 min-w-11 items-center justify-center rounded-md text-text-secondary motion-safe:transition-colors hover:bg-bg-sunken hover:text-text-primary disabled:cursor-not-allowed disabled:opacity-50 ${e}`, g = 6, _ = 2;
|
|
11
|
+
function v(e) {
|
|
10
12
|
let t = new Date(e);
|
|
11
13
|
return new Intl.DateTimeFormat("en-US", {
|
|
12
14
|
month: "short",
|
|
@@ -16,249 +18,233 @@ function l(e) {
|
|
|
16
18
|
minute: "2-digit"
|
|
17
19
|
}).format(t);
|
|
18
20
|
}
|
|
19
|
-
function
|
|
21
|
+
function y(e) {
|
|
20
22
|
let t = new Date(e), n = Date.now() - t.getTime(), r = Math.floor(n / 6e4);
|
|
21
23
|
if (r < 1) return "just now";
|
|
22
24
|
if (r < 60) return `${r}m ago`;
|
|
23
25
|
let i = Math.floor(r / 60);
|
|
24
26
|
if (i < 24) return `${i}h ago`;
|
|
25
27
|
let a = Math.floor(i / 24);
|
|
26
|
-
return a < 7 ? `${a}d ago` :
|
|
28
|
+
return a < 7 ? `${a}d ago` : v(e);
|
|
27
29
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
})
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
30
|
+
function b(e, t) {
|
|
31
|
+
if (!e) return {
|
|
32
|
+
lines: [],
|
|
33
|
+
truncated: !1
|
|
34
|
+
};
|
|
35
|
+
let n = e.replace(/\s+$/, "");
|
|
36
|
+
if (!n) return {
|
|
37
|
+
lines: [],
|
|
38
|
+
truncated: !1
|
|
39
|
+
};
|
|
40
|
+
let r = n.split("\n");
|
|
41
|
+
return {
|
|
42
|
+
lines: r.slice(0, t),
|
|
43
|
+
truncated: r.length > t
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var x = i(function({ label: e, onClick: t, destructive: n, disabled: r, children: i }) {
|
|
47
|
+
return /* @__PURE__ */ p("button", {
|
|
48
|
+
type: "button",
|
|
49
|
+
onClick: t,
|
|
50
|
+
disabled: r,
|
|
51
|
+
"aria-label": e,
|
|
52
|
+
title: e,
|
|
53
|
+
className: `${h} ${n ? "hover:text-[var(--color-status-error-text)]" : ""}`,
|
|
54
|
+
children: i
|
|
55
|
+
});
|
|
56
|
+
}), S = i(function({ parser: i, onView: h, onEdit: S, onTest: C, onExecute: w, onExport: T, onDelete: E, isDeleting: D = !1, layout: O = "grid" }) {
|
|
57
|
+
let k = r(), A = i.name || k("bigconsole.parsers.view.untitled", "Untitled Parser"), j = a(() => {
|
|
58
|
+
h?.(i.id);
|
|
59
|
+
}, [h, i.id]), M = a((e) => {
|
|
60
|
+
e.stopPropagation(), h?.(i.id);
|
|
61
|
+
}, [h, i.id]), N = a((e) => {
|
|
62
|
+
e.stopPropagation(), C?.(i.id);
|
|
63
|
+
}, [C, i.id]), P = a((e) => {
|
|
64
|
+
e.stopPropagation(), w?.(i.id);
|
|
65
|
+
}, [w, i.id]), F = a((e) => {
|
|
66
|
+
e.stopPropagation(), S?.(i.id);
|
|
67
|
+
}, [S, i.id]), I = a((e) => {
|
|
68
|
+
e.stopPropagation(), T?.(i.id);
|
|
69
|
+
}, [T, i.id]), L = a((e) => {
|
|
70
|
+
e.stopPropagation(), E?.(i.id);
|
|
71
|
+
}, [E, i.id]), { lines: R, truncated: z } = o(() => b(i.expression, O === "list" ? _ : g), [i.expression, O]), B = "h-icon-sm w-icon-sm", V = /* @__PURE__ */ m("div", {
|
|
72
|
+
className: "flex shrink-0 flex-wrap items-center",
|
|
73
|
+
children: [
|
|
74
|
+
C && /* @__PURE__ */ p(x, {
|
|
75
|
+
label: k("bigconsole.parsers.card.test", "Test parser"),
|
|
76
|
+
onClick: N,
|
|
77
|
+
disabled: D,
|
|
78
|
+
children: /* @__PURE__ */ p(l, {
|
|
79
|
+
"aria-hidden": "true",
|
|
80
|
+
className: B
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
w && /* @__PURE__ */ p(x, {
|
|
84
|
+
label: k("bigconsole.parsers.card.execute", "Execute parser"),
|
|
85
|
+
onClick: P,
|
|
86
|
+
disabled: D,
|
|
87
|
+
children: /* @__PURE__ */ p(d, {
|
|
88
|
+
"aria-hidden": "true",
|
|
89
|
+
className: B
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
S && /* @__PURE__ */ p(x, {
|
|
93
|
+
label: k("bigconsole.parsers.card.edit", "Edit parser"),
|
|
94
|
+
onClick: F,
|
|
95
|
+
disabled: D,
|
|
96
|
+
children: /* @__PURE__ */ p(u, {
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
className: B
|
|
99
|
+
})
|
|
100
|
+
}),
|
|
101
|
+
T && /* @__PURE__ */ p(x, {
|
|
102
|
+
label: k("bigconsole.parsers.card.export", "Export parser"),
|
|
103
|
+
onClick: I,
|
|
104
|
+
disabled: D,
|
|
105
|
+
children: /* @__PURE__ */ p(c, {
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
className: B
|
|
108
|
+
})
|
|
109
|
+
}),
|
|
110
|
+
E && /* @__PURE__ */ p(x, {
|
|
111
|
+
label: k("bigconsole.parsers.card.delete", "Delete parser"),
|
|
112
|
+
onClick: L,
|
|
113
|
+
destructive: !0,
|
|
114
|
+
disabled: D,
|
|
115
|
+
children: /* @__PURE__ */ p(f, {
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
className: B
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
]
|
|
121
|
+
}), H = i.inputSinkKey ? /* @__PURE__ */ m("span", {
|
|
122
|
+
className: "inline-flex min-w-0 items-center gap-icon-gap rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-1 text-xs text-text-secondary",
|
|
123
|
+
title: `${i.inputSinkKey} → ${i.outputKey}`,
|
|
124
|
+
children: [/* @__PURE__ */ p(s, {
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
className: "h-3 w-3 shrink-0"
|
|
127
|
+
}), /* @__PURE__ */ p("span", {
|
|
128
|
+
className: "truncate font-mono",
|
|
129
|
+
children: i.inputSinkKey
|
|
130
|
+
})]
|
|
131
|
+
}) : /* @__PURE__ */ p("span", {
|
|
132
|
+
className: "text-xs text-text-muted",
|
|
133
|
+
children: k("bigconsole.parsers.view.noneConfigured", "None configured")
|
|
134
|
+
}), U = /* @__PURE__ */ p("span", {
|
|
135
|
+
className: "whitespace-nowrap tabular-nums",
|
|
136
|
+
title: `Last updated: ${v(i.updatedAt)}`,
|
|
137
|
+
children: y(i.updatedAt)
|
|
138
|
+
}), W = `
|
|
139
|
+
bg-bg-elevated
|
|
140
|
+
border border-[var(--color-border-default)]
|
|
141
|
+
rounded-card
|
|
142
|
+
cursor-pointer
|
|
143
|
+
hover:border-action-primary-bg
|
|
144
|
+
motion-safe:transition-colors
|
|
145
|
+
${D ? "opacity-60 pointer-events-none" : ""}
|
|
146
|
+
`, G = /* @__PURE__ */ p("button", {
|
|
147
|
+
type: "button",
|
|
148
|
+
onClick: M,
|
|
149
|
+
disabled: D,
|
|
150
|
+
className: `block w-full min-w-0 truncate rounded-sm text-left ${e}`,
|
|
151
|
+
children: A
|
|
152
|
+
});
|
|
153
|
+
return O === "list" ? /* @__PURE__ */ m("div", {
|
|
154
|
+
onClick: j,
|
|
155
|
+
className: `${W} flex flex-wrap items-center gap-x-3 gap-y-2 p-3 sm:flex-nowrap`,
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ p(n, {
|
|
158
|
+
type: i.type,
|
|
159
|
+
size: "sm"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ m("div", {
|
|
162
|
+
className: "min-w-0 flex-1",
|
|
163
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
164
|
+
className: "min-w-0 text-sm font-semibold text-text-primary",
|
|
165
|
+
children: G
|
|
166
|
+
}), /* @__PURE__ */ m("p", {
|
|
167
|
+
className: "mt-0.5 truncate font-mono text-xs text-text-secondary",
|
|
168
|
+
children: [
|
|
169
|
+
i.inputSinkKey || "—",
|
|
170
|
+
" → ",
|
|
171
|
+
i.outputKey || "—"
|
|
172
|
+
]
|
|
154
173
|
})]
|
|
155
|
-
}),
|
|
156
|
-
|
|
174
|
+
}),
|
|
175
|
+
R.length > 0 && /* @__PURE__ */ p("pre", {
|
|
176
|
+
"aria-hidden": "true",
|
|
177
|
+
className: "hidden min-w-0 max-w-md flex-1 truncate whitespace-pre rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken px-2 py-1 font-mono text-xs text-text-secondary lg:block",
|
|
178
|
+
children: R.join(" ")
|
|
179
|
+
}),
|
|
180
|
+
/* @__PURE__ */ p(t, {
|
|
181
|
+
status: i.status,
|
|
157
182
|
size: "sm"
|
|
158
|
-
})
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
b && /* @__PURE__ */ s("button", {
|
|
207
|
-
type: "button",
|
|
208
|
-
onClick: k,
|
|
209
|
-
className: c,
|
|
210
|
-
title: "Edit Parser",
|
|
211
|
-
children: [/* @__PURE__ */ o("span", {
|
|
212
|
-
className: "sr-only",
|
|
213
|
-
children: "Edit parser"
|
|
214
|
-
}), /* @__PURE__ */ o(g, { className: "w-icon-sm h-icon-sm" })]
|
|
215
|
-
}),
|
|
216
|
-
C && /* @__PURE__ */ s("button", {
|
|
217
|
-
type: "button",
|
|
218
|
-
onClick: A,
|
|
219
|
-
className: c,
|
|
220
|
-
title: "Export Parser",
|
|
221
|
-
children: [/* @__PURE__ */ o("span", {
|
|
222
|
-
className: "sr-only",
|
|
223
|
-
children: "Export parser"
|
|
224
|
-
}), /* @__PURE__ */ o(v, { className: "w-icon-sm h-icon-sm" })]
|
|
225
|
-
}),
|
|
226
|
-
w && /* @__PURE__ */ s("button", {
|
|
227
|
-
type: "button",
|
|
228
|
-
onClick: j,
|
|
229
|
-
className: `${c} hover:text-[var(--color-status-error-text)]`,
|
|
230
|
-
title: "Delete Parser",
|
|
231
|
-
children: [/* @__PURE__ */ o("span", {
|
|
232
|
-
className: "sr-only",
|
|
233
|
-
children: "Delete parser"
|
|
234
|
-
}), /* @__PURE__ */ o(_, { className: "w-icon-sm h-icon-sm" })]
|
|
235
|
-
})
|
|
236
|
-
]
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ p("span", {
|
|
185
|
+
className: "text-xs text-text-muted",
|
|
186
|
+
children: U
|
|
187
|
+
}),
|
|
188
|
+
V
|
|
189
|
+
]
|
|
190
|
+
}) : /* @__PURE__ */ m("div", {
|
|
191
|
+
onClick: j,
|
|
192
|
+
className: `${W} flex h-full flex-col overflow-hidden`,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ m("div", {
|
|
195
|
+
className: "flex flex-wrap items-start justify-between gap-icon-gap p-4 pb-3",
|
|
196
|
+
children: [/* @__PURE__ */ m("div", {
|
|
197
|
+
className: "flex min-w-0 flex-1 items-center gap-icon-gap pt-2",
|
|
198
|
+
children: [/* @__PURE__ */ p(n, {
|
|
199
|
+
type: i.type,
|
|
200
|
+
size: "sm"
|
|
201
|
+
}), /* @__PURE__ */ p("h3", {
|
|
202
|
+
className: "min-w-0 flex-1 text-sm font-semibold text-text-primary",
|
|
203
|
+
children: G
|
|
204
|
+
})]
|
|
205
|
+
}), V]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ p("div", {
|
|
208
|
+
className: "px-4",
|
|
209
|
+
children: R.length > 0 ? /* @__PURE__ */ m("pre", {
|
|
210
|
+
className: "min-h-28 overflow-x-auto rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken p-3 font-mono text-xs leading-relaxed text-text-secondary",
|
|
211
|
+
children: [R.join("\n"), z && /* @__PURE__ */ p("span", {
|
|
212
|
+
className: "mt-1 block text-text-muted",
|
|
213
|
+
children: "…"
|
|
214
|
+
})]
|
|
215
|
+
}) : /* @__PURE__ */ p("div", {
|
|
216
|
+
className: "flex min-h-28 items-center justify-center rounded-md border border-[var(--color-border-subtle)] bg-bg-sunken text-xs text-text-muted",
|
|
217
|
+
children: k("bigconsole.parsers.card.noExpression", "No expression configured")
|
|
218
|
+
})
|
|
219
|
+
}),
|
|
220
|
+
i.description && /* @__PURE__ */ p("p", {
|
|
221
|
+
className: "line-clamp-2 px-4 pt-3 text-xs text-text-secondary",
|
|
222
|
+
children: i.description
|
|
223
|
+
}),
|
|
224
|
+
/* @__PURE__ */ m("div", {
|
|
225
|
+
className: "mt-auto flex flex-col gap-2 p-4 pt-3",
|
|
226
|
+
children: [/* @__PURE__ */ m("div", {
|
|
227
|
+
className: "flex flex-wrap items-center justify-between gap-icon-gap",
|
|
228
|
+
children: [H, /* @__PURE__ */ p(t, {
|
|
229
|
+
status: i.status,
|
|
230
|
+
size: "sm"
|
|
237
231
|
})]
|
|
238
|
-
}),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
children: r.description
|
|
242
|
-
}),
|
|
243
|
-
/* @__PURE__ */ s("div", {
|
|
244
|
-
className: "mt-auto flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-t border-[var(--color-border-subtle)] pt-2 text-xs text-text-muted",
|
|
245
|
-
children: [/* @__PURE__ */ s("span", {
|
|
232
|
+
}), /* @__PURE__ */ m("div", {
|
|
233
|
+
className: "flex flex-wrap items-center justify-between gap-x-3 gap-y-1 border-t border-[var(--color-border-subtle)] pt-2 text-xs text-text-muted",
|
|
234
|
+
children: [/* @__PURE__ */ m("span", {
|
|
246
235
|
className: "flex flex-wrap items-center gap-3",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
248
|
-
title: `Cache TTL: ${
|
|
236
|
+
children: [i.version == null ? null : /* @__PURE__ */ m("span", { children: ["v", i.version] }), i.ttl ? /* @__PURE__ */ m("span", {
|
|
237
|
+
title: `Cache TTL: ${i.ttl} seconds`,
|
|
249
238
|
children: [
|
|
250
239
|
"TTL: ",
|
|
251
|
-
|
|
240
|
+
i.ttl,
|
|
252
241
|
"s"
|
|
253
242
|
]
|
|
254
243
|
}) : null]
|
|
255
|
-
}),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
})
|
|
260
|
-
]
|
|
261
|
-
})]
|
|
244
|
+
}), U]
|
|
245
|
+
})]
|
|
246
|
+
})
|
|
247
|
+
]
|
|
262
248
|
});
|
|
263
249
|
});
|
|
264
|
-
export {
|
|
250
|
+
export { S as ParserCard, S as default, b as previewExpression };
|