@seed-ship/mcp-ui-solid 2.9.0 → 2.10.0
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/components/ScratchpadPanel.cjs +426 -175
- package/dist/components/ScratchpadPanel.cjs.map +1 -1
- package/dist/components/ScratchpadPanel.d.ts.map +1 -1
- package/dist/components/ScratchpadPanel.js +426 -175
- package/dist/components/ScratchpadPanel.js.map +1 -1
- package/dist/types/chat-bus.d.ts +12 -1
- package/dist/types/chat-bus.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/ScratchpadPanel.tsx +174 -0
- package/src/types/chat-bus.ts +12 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { delegateEvents, getNextElement, template, getNextMarker, insert, createComponent, effect, setAttribute, runHydrationEvents, memo, className, setStyleProperty, setProperty } from "solid-js/web";
|
|
2
2
|
import { createSignal, createEffect, onCleanup, Show, For, Switch, Match } from "solid-js";
|
|
3
3
|
import { FormFieldRenderer } from "./FormFieldRenderer.js";
|
|
4
|
-
var _tmpl$ = /* @__PURE__ */ template(`<svg fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M19 9l-7 7-7-7">`), _tmpl$2 = /* @__PURE__ */ template(`<button class="p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"aria-label=Close><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M6 18L18 6M6 6l12 12">`), _tmpl$3 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700 space-y-2">`), _tmpl$
|
|
4
|
+
var _tmpl$ = /* @__PURE__ */ template(`<svg fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M19 9l-7 7-7-7">`), _tmpl$2 = /* @__PURE__ */ template(`<button class="p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 rounded-full hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors"aria-label=Close><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M6 18L18 6M6 6l12 12">`), _tmpl$3 = /* @__PURE__ */ template(`<div class="px-4 py-2 border-b border-gray-100 dark:border-gray-700 flex flex-wrap items-center gap-1.5">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700 space-y-2">`), _tmpl$5 = /* @__PURE__ */ template(`<div class="flex flex-col items-center gap-2 py-4 text-center"><span class=text-2xl>🔍</span><p class="text-sm text-gray-500 dark:text-gray-400">No results for these filters</p><button type=button class="px-3 py-1.5 text-xs font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors">Modify filters`), _tmpl$6 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700">`), _tmpl$7 = /* @__PURE__ */ template(`<div class="px-4 py-3 border-t border-gray-100 dark:border-gray-700"><button type=button class="w-full px-4 py-2.5 text-sm font-semibold rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors flex items-center justify-center gap-2"><svg class="w-4 h-4"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg>Search`), _tmpl$8 = /* @__PURE__ */ template(`<div style=overflow-y:auto><!$><!/><div class="divide-y divide-gray-100 dark:divide-gray-700"></div><!$><!/><!$><!/><!$><!/>`), _tmpl$9 = /* @__PURE__ */ template(`<div style="animation:scratchpad-slide-down 0.2s ease-out"><div><div class="flex items-center gap-2"><span class=text-base>📝</span><h3 class="text-sm font-semibold text-gray-900 dark:text-white"></h3><!$><!/></div><div class="flex items-center gap-2"><span></span><!$><!/></div></div><!$><!/><style>
|
|
5
5
|
@keyframes scratchpad-slide-down { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
|
|
6
|
-
`), _tmpl$
|
|
6
|
+
`), _tmpl$0 = /* @__PURE__ */ template(`<svg class="w-3 h-3 text-gray-300 dark:text-gray-600 flex-shrink-0"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$1 = /* @__PURE__ */ template(`<span class="ml-1 font-normal opacity-75">— <!$><!/>`), _tmpl$10 = /* @__PURE__ */ template(`<span><!$><!/> <!$><!/><!$><!/>`), _tmpl$11 = /* @__PURE__ */ template(`<div><span class="flex-shrink-0 mt-0.5"></span><p>`), _tmpl$12 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 mb-2"><span class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide">Preview</span><span class="px-1.5 py-0.5 text-xs font-bold bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded">`), _tmpl$13 = /* @__PURE__ */ template(`<p class="text-sm text-gray-700 dark:text-gray-300">`), _tmpl$14 = /* @__PURE__ */ template(`<div class="mt-2 overflow-x-auto"><table class="min-w-full text-xs"><thead><tr></tr></thead><tbody>`), _tmpl$15 = /* @__PURE__ */ template(`<th class="px-2 py-1 text-left font-medium text-gray-500 dark:text-gray-400">`), _tmpl$16 = /* @__PURE__ */ template(`<tr class="border-t border-gray-100 dark:border-gray-700">`), _tmpl$17 = /* @__PURE__ */ template(`<td class="px-2 py-1 text-gray-700 dark:text-gray-300">`), _tmpl$18 = /* @__PURE__ */ template(`<pre class="text-xs text-gray-500 overflow-auto">`), _tmpl$19 = /* @__PURE__ */ template(`<div class="px-4 py-3"><h4 class="text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wide mb-2"></h4><!$><!/>`), _tmpl$20 = /* @__PURE__ */ template(`<div class=space-y-1>`), _tmpl$21 = /* @__PURE__ */ template(`<div class="flex gap-2 text-xs"><span class="text-gray-500 dark:text-gray-400 font-mono min-w-[120px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`), _tmpl$22 = /* @__PURE__ */ template(`<p class="text-xs text-gray-400 italic">No filters`), _tmpl$23 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-1.5"><!$><!/><!$><!/>`), _tmpl$24 = /* @__PURE__ */ template(`<button type=button class="ml-0.5 hover:text-blue-900 dark:hover:text-blue-100">×`), _tmpl$25 = /* @__PURE__ */ template(`<span class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded-full"><button type=button class=hover:underline><span class="text-blue-500 dark:text-blue-400"><!$><!/>:</span> <!$><!/></button><!$><!/>`), _tmpl$26 = /* @__PURE__ */ template(`<div class="max-h-48 overflow-y-auto">`), _tmpl$27 = /* @__PURE__ */ template(`<button type=button class="mt-1 w-full px-2 py-1 text-xs text-gray-500 hover:text-gray-700 text-center">Cancel`), _tmpl$28 = /* @__PURE__ */ template(`<div class="absolute z-50 mt-1 left-0 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 rounded-lg shadow-lg p-2 min-w-[200px]">`), _tmpl$29 = /* @__PURE__ */ template(`<div class=relative><!$><!/><!$><!/>`), _tmpl$30 = /* @__PURE__ */ template(`<button type=button class="inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium border border-dashed border-gray-300 dark:border-gray-600 text-gray-500 dark:text-gray-400 rounded-full hover:border-blue-400 hover:text-blue-500 transition-colors">+ <!$><!/>`), _tmpl$31 = /* @__PURE__ */ template(`<form class="flex gap-1"><input type=text autofocus class="flex-1 px-2 py-1 text-sm border border-gray-200 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none"><button type=submit class="px-2 py-1 text-xs bg-blue-600 text-white rounded hover:bg-blue-700">OK</button><button type=button class="px-2 py-1 text-xs text-gray-500 hover:text-gray-700">Cancel`), _tmpl$32 = /* @__PURE__ */ template(`<span class=ml-1>✓`), _tmpl$33 = /* @__PURE__ */ template(`<button type=button><!$><!/><!$><!/>`), _tmpl$34 = /* @__PURE__ */ template(`<form class="flex flex-col gap-3"><!$><!/><div class="flex justify-end"><button type=submit class="px-4 py-2 text-sm font-medium rounded-lg text-white bg-blue-600 hover:bg-blue-700 transition-colors">`), _tmpl$35 = /* @__PURE__ */ template(`<div class="flex justify-end"><button type=button class="px-3 py-1.5 text-sm font-medium text-blue-600 dark:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 rounded-lg transition-colors flex items-center gap-1">Next <svg class="w-3.5 h-3.5"fill=none viewBox="0 0 24 24"stroke=currentColor><path stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M9 5l7 7-7 7">`), _tmpl$36 = /* @__PURE__ */ template(`<div class=space-y-3><!$><!/><!$><!/>`), _tmpl$37 = /* @__PURE__ */ template(`<span class="text-xs font-normal text-gray-500 dark:text-gray-400">— <!$><!/>`), _tmpl$38 = /* @__PURE__ */ template(`<div class="mt-2 ml-6">`), _tmpl$39 = /* @__PURE__ */ template(`<div><div><span></span><!$><!/><!$><!/></div><!$><!/>`), _tmpl$40 = /* @__PURE__ */ template(`<div class="flex flex-wrap gap-2">`), _tmpl$41 = /* @__PURE__ */ template(`<span class=mr-1>`), _tmpl$42 = /* @__PURE__ */ template(`<div class=space-y-2><div class=space-y-1.5></div><!$><!/>`), _tmpl$43 = /* @__PURE__ */ template(`<div class="flex items-center gap-2 text-sm"><span></span><span class="text-gray-900 dark:text-white">`), _tmpl$44 = /* @__PURE__ */ template(`<div class="flex items-start gap-1.5 text-xs text-amber-600 dark:text-amber-400"><span class=flex-shrink-0>⚠️</span><span>`), _tmpl$45 = /* @__PURE__ */ template(`<input type=text class="w-full px-3 py-2 text-sm border border-gray-200 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white focus:border-blue-400 outline-none">`), _tmpl$46 = /* @__PURE__ */ template(`<div class=space-y-3><p class="text-sm text-gray-700 dark:text-gray-300"></p><div class="flex gap-2"><button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg bg-green-600 text-white hover:bg-green-700 transition-colors flex items-center gap-1">👍 <!$><!/></button><button type=button class="px-3 py-1.5 text-sm font-medium rounded-lg border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors flex items-center gap-1">👎 <!$><!/></button></div><!$><!/>`), _tmpl$47 = /* @__PURE__ */ template(`<p class="text-xs text-gray-500 dark:text-gray-400 italic">"<!$><!/>"`), _tmpl$48 = /* @__PURE__ */ template(`<div class="mt-2 px-3 py-2 bg-blue-50 dark:bg-blue-900/10 rounded-lg text-sm text-blue-700 dark:text-blue-300"><span class=font-medium>Plan:</span> <!$><!/>`), _tmpl$49 = /* @__PURE__ */ template(`<button type=button class="text-xs text-blue-600 dark:text-blue-400 hover:underline flex items-center gap-1">✎ Modify`), _tmpl$50 = /* @__PURE__ */ template(`<div class=space-y-2><!$><!/><div class=space-y-1></div><!$><!/><!$><!/>`), _tmpl$51 = /* @__PURE__ */ template(`<div class="flex gap-2 text-sm"><span class="text-gray-500 dark:text-gray-400 font-medium min-w-[80px]"><!$><!/>:</span><span class="text-gray-900 dark:text-white">`);
|
|
7
7
|
const STATUS_BADGES = {
|
|
8
8
|
loading: {
|
|
9
9
|
label: "Loading...",
|
|
@@ -71,8 +71,8 @@ const ScratchpadPanel = (props) => {
|
|
|
71
71
|
if (previewTimer) clearTimeout(previewTimer);
|
|
72
72
|
});
|
|
73
73
|
return (() => {
|
|
74
|
-
var _el$ = getNextElement(_tmpl$
|
|
75
|
-
_el$
|
|
74
|
+
var _el$ = getNextElement(_tmpl$9), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$7 = _el$5.nextSibling, [_el$8, _co$] = getNextMarker(_el$7.nextSibling), _el$9 = _el$3.nextSibling, _el$0 = _el$9.firstChild, _el$10 = _el$0.nextSibling, [_el$11, _co$2] = getNextMarker(_el$10.nextSibling), _el$32 = _el$2.nextSibling, [_el$33, _co$7] = getNextMarker(_el$32.nextSibling);
|
|
75
|
+
_el$33.nextSibling;
|
|
76
76
|
_el$2.$$click = () => isCollapsible() && setCollapsed(!collapsed());
|
|
77
77
|
insert(_el$5, () => props.state.title);
|
|
78
78
|
insert(_el$3, createComponent(Show, {
|
|
@@ -106,8 +106,49 @@ const ScratchpadPanel = (props) => {
|
|
|
106
106
|
return !collapsed();
|
|
107
107
|
},
|
|
108
108
|
get children() {
|
|
109
|
-
var _el$12 = getNextElement(_tmpl$
|
|
110
|
-
insert(_el$
|
|
109
|
+
var _el$12 = getNextElement(_tmpl$8), _el$23 = _el$12.firstChild, [_el$24, _co$3] = getNextMarker(_el$23.nextSibling), _el$14 = _el$24.nextSibling, _el$25 = _el$14.nextSibling, [_el$26, _co$4] = getNextMarker(_el$25.nextSibling), _el$27 = _el$26.nextSibling, [_el$28, _co$5] = getNextMarker(_el$27.nextSibling), _el$29 = _el$28.nextSibling, [_el$30, _co$6] = getNextMarker(_el$29.nextSibling);
|
|
110
|
+
insert(_el$12, createComponent(Show, {
|
|
111
|
+
get when() {
|
|
112
|
+
return memo(() => !!props.state.turnHistory)() && props.state.turnHistory.length > 0;
|
|
113
|
+
},
|
|
114
|
+
get children() {
|
|
115
|
+
var _el$13 = getNextElement(_tmpl$3);
|
|
116
|
+
insert(_el$13, createComponent(For, {
|
|
117
|
+
get each() {
|
|
118
|
+
return props.state.turnHistory;
|
|
119
|
+
},
|
|
120
|
+
children: (turn, i) => [createComponent(Show, {
|
|
121
|
+
get when() {
|
|
122
|
+
return i() > 0;
|
|
123
|
+
},
|
|
124
|
+
get children() {
|
|
125
|
+
return getNextElement(_tmpl$0);
|
|
126
|
+
}
|
|
127
|
+
}), (() => {
|
|
128
|
+
var _el$35 = getNextElement(_tmpl$10), _el$41 = _el$35.firstChild, [_el$42, _co$9] = getNextMarker(_el$41.nextSibling), _el$36 = _el$42.nextSibling, _el$43 = _el$36.nextSibling, [_el$44, _co$0] = getNextMarker(_el$43.nextSibling), _el$45 = _el$44.nextSibling, [_el$46, _co$1] = getNextMarker(_el$45.nextSibling);
|
|
129
|
+
insert(_el$35, (() => {
|
|
130
|
+
var _c$ = memo(() => turn.status === "done");
|
|
131
|
+
return () => _c$() ? "✅" : turn.status === "active" ? "●" : "○";
|
|
132
|
+
})(), _el$42, _co$9);
|
|
133
|
+
insert(_el$35, () => turn.label, _el$44, _co$0);
|
|
134
|
+
insert(_el$35, createComponent(Show, {
|
|
135
|
+
get when() {
|
|
136
|
+
return turn.summary;
|
|
137
|
+
},
|
|
138
|
+
get children() {
|
|
139
|
+
var _el$37 = getNextElement(_tmpl$1), _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, [_el$40, _co$8] = getNextMarker(_el$39.nextSibling);
|
|
140
|
+
insert(_el$37, () => turn.summary, _el$40, _co$8);
|
|
141
|
+
return _el$37;
|
|
142
|
+
}
|
|
143
|
+
}), _el$46, _co$1);
|
|
144
|
+
effect(() => className(_el$35, `text-xs font-medium px-2 py-0.5 rounded-full ${turn.status === "done" ? "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400" : turn.status === "active" ? "bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400" : turn.status === "skipped" ? "bg-gray-100 dark:bg-gray-700 text-gray-400 line-through" : "bg-gray-100 dark:bg-gray-700 text-gray-400"}`));
|
|
145
|
+
return _el$35;
|
|
146
|
+
})()]
|
|
147
|
+
}));
|
|
148
|
+
return _el$13;
|
|
149
|
+
}
|
|
150
|
+
}), _el$24, _co$3);
|
|
151
|
+
insert(_el$14, createComponent(For, {
|
|
111
152
|
get each() {
|
|
112
153
|
return props.state.sections;
|
|
113
154
|
},
|
|
@@ -132,116 +173,116 @@ const ScratchpadPanel = (props) => {
|
|
|
132
173
|
return props.state.agentMessages.length > 0;
|
|
133
174
|
},
|
|
134
175
|
get children() {
|
|
135
|
-
var _el$
|
|
136
|
-
insert(_el$
|
|
176
|
+
var _el$15 = getNextElement(_tmpl$4);
|
|
177
|
+
insert(_el$15, createComponent(For, {
|
|
137
178
|
get each() {
|
|
138
179
|
return props.state.agentMessages;
|
|
139
180
|
},
|
|
140
181
|
children: (msg) => (() => {
|
|
141
|
-
var _el$
|
|
142
|
-
insert(_el$
|
|
143
|
-
var _c$ = memo(() => msg.type === "warning");
|
|
144
|
-
return () => _c$() ? "⚠️" : msg.type === "question" ? "❓" : "ℹ️";
|
|
182
|
+
var _el$47 = getNextElement(_tmpl$11), _el$48 = _el$47.firstChild, _el$49 = _el$48.nextSibling;
|
|
183
|
+
insert(_el$48, (() => {
|
|
184
|
+
var _c$2 = memo(() => msg.type === "warning");
|
|
185
|
+
return () => _c$2() ? "⚠️" : msg.type === "question" ? "❓" : "ℹ️";
|
|
145
186
|
})());
|
|
146
|
-
insert(_el$
|
|
147
|
-
effect(() => className(_el$
|
|
148
|
-
return _el$
|
|
187
|
+
insert(_el$49, () => msg.text);
|
|
188
|
+
effect(() => className(_el$47, `flex items-start gap-2 text-sm rounded-lg px-3 py-2 ${msg.type === "warning" ? "bg-amber-50 dark:bg-amber-900/10 text-amber-700 dark:text-amber-400" : msg.type === "question" ? "bg-blue-50 dark:bg-blue-900/10 text-blue-700 dark:text-blue-400 border border-blue-200 dark:border-blue-800" : "bg-gray-50 dark:bg-gray-700/50 text-gray-600 dark:text-gray-400"}`));
|
|
189
|
+
return _el$47;
|
|
149
190
|
})()
|
|
150
191
|
}));
|
|
151
|
-
return _el$
|
|
192
|
+
return _el$15;
|
|
152
193
|
}
|
|
153
|
-
}), _el$
|
|
194
|
+
}), _el$26, _co$4);
|
|
154
195
|
insert(_el$12, createComponent(Show, {
|
|
155
196
|
get when() {
|
|
156
197
|
return preview();
|
|
157
198
|
},
|
|
158
199
|
get children() {
|
|
159
|
-
var _el$
|
|
160
|
-
insert(_el$
|
|
200
|
+
var _el$16 = getNextElement(_tmpl$6);
|
|
201
|
+
insert(_el$16, createComponent(Show, {
|
|
161
202
|
get when() {
|
|
162
203
|
return preview().count === 0;
|
|
163
204
|
},
|
|
164
205
|
get fallback() {
|
|
165
206
|
return [(() => {
|
|
166
|
-
var _el$
|
|
167
|
-
insert(_el$
|
|
168
|
-
return _el$
|
|
207
|
+
var _el$50 = getNextElement(_tmpl$12), _el$51 = _el$50.firstChild, _el$52 = _el$51.nextSibling;
|
|
208
|
+
insert(_el$52, () => preview().count.toLocaleString());
|
|
209
|
+
return _el$50;
|
|
169
210
|
})(), (() => {
|
|
170
|
-
var _el$
|
|
171
|
-
insert(_el$
|
|
172
|
-
return _el$
|
|
211
|
+
var _el$53 = getNextElement(_tmpl$13);
|
|
212
|
+
insert(_el$53, () => preview().summary);
|
|
213
|
+
return _el$53;
|
|
173
214
|
})(), createComponent(Show, {
|
|
174
215
|
get when() {
|
|
175
216
|
return memo(() => !!preview().rows)() && preview().rows.length > 0;
|
|
176
217
|
},
|
|
177
218
|
get children() {
|
|
178
|
-
var _el$
|
|
179
|
-
insert(_el$
|
|
219
|
+
var _el$54 = getNextElement(_tmpl$14), _el$55 = _el$54.firstChild, _el$56 = _el$55.firstChild, _el$57 = _el$56.firstChild, _el$58 = _el$56.nextSibling;
|
|
220
|
+
insert(_el$57, createComponent(For, {
|
|
180
221
|
get each() {
|
|
181
222
|
return Object.keys(preview().rows[0]);
|
|
182
223
|
},
|
|
183
224
|
children: (k) => (() => {
|
|
184
|
-
var _el$
|
|
185
|
-
insert(_el$
|
|
186
|
-
return _el$
|
|
225
|
+
var _el$59 = getNextElement(_tmpl$15);
|
|
226
|
+
insert(_el$59, k);
|
|
227
|
+
return _el$59;
|
|
187
228
|
})()
|
|
188
229
|
}));
|
|
189
|
-
insert(_el$
|
|
230
|
+
insert(_el$58, createComponent(For, {
|
|
190
231
|
get each() {
|
|
191
232
|
return preview().rows.slice(0, 5);
|
|
192
233
|
},
|
|
193
234
|
children: (row) => (() => {
|
|
194
|
-
var _el$
|
|
195
|
-
insert(_el$
|
|
235
|
+
var _el$60 = getNextElement(_tmpl$16);
|
|
236
|
+
insert(_el$60, createComponent(For, {
|
|
196
237
|
get each() {
|
|
197
238
|
return Object.values(row);
|
|
198
239
|
},
|
|
199
240
|
children: (v) => (() => {
|
|
200
|
-
var _el$
|
|
201
|
-
insert(_el$
|
|
202
|
-
return _el$
|
|
241
|
+
var _el$61 = getNextElement(_tmpl$17);
|
|
242
|
+
insert(_el$61, () => String(v));
|
|
243
|
+
return _el$61;
|
|
203
244
|
})()
|
|
204
245
|
}));
|
|
205
|
-
return _el$
|
|
246
|
+
return _el$60;
|
|
206
247
|
})()
|
|
207
248
|
}));
|
|
208
|
-
return _el$
|
|
249
|
+
return _el$54;
|
|
209
250
|
}
|
|
210
251
|
})];
|
|
211
252
|
},
|
|
212
253
|
get children() {
|
|
213
|
-
var _el$
|
|
214
|
-
_el$
|
|
254
|
+
var _el$17 = getNextElement(_tmpl$5), _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$19.nextSibling;
|
|
255
|
+
_el$20.$$click = () => {
|
|
215
256
|
var _a;
|
|
216
257
|
return (_a = props.onAction) == null ? void 0 : _a.call(props, "refine_filters");
|
|
217
258
|
};
|
|
218
259
|
runHydrationEvents();
|
|
219
|
-
return _el$
|
|
260
|
+
return _el$17;
|
|
220
261
|
}
|
|
221
262
|
}));
|
|
222
|
-
return _el$
|
|
263
|
+
return _el$16;
|
|
223
264
|
}
|
|
224
|
-
}), _el$
|
|
265
|
+
}), _el$28, _co$5);
|
|
225
266
|
insert(_el$12, createComponent(Show, {
|
|
226
267
|
get when() {
|
|
227
268
|
return memo(() => props.state.status === "waiting_human")() && hasFilters();
|
|
228
269
|
},
|
|
229
270
|
get children() {
|
|
230
|
-
var _el$
|
|
231
|
-
_el$
|
|
271
|
+
var _el$21 = getNextElement(_tmpl$7), _el$22 = _el$21.firstChild;
|
|
272
|
+
_el$22.$$click = () => {
|
|
232
273
|
var _a;
|
|
233
274
|
return (_a = props.onAction) == null ? void 0 : _a.call(props, "search", {
|
|
234
275
|
filters: props.state.filters
|
|
235
276
|
});
|
|
236
277
|
};
|
|
237
278
|
runHydrationEvents();
|
|
238
|
-
return _el$
|
|
279
|
+
return _el$21;
|
|
239
280
|
}
|
|
240
|
-
}), _el$
|
|
281
|
+
}), _el$30, _co$6);
|
|
241
282
|
effect((_$p) => setStyleProperty(_el$12, "max-height", props.maxHeight || "500px"));
|
|
242
283
|
return _el$12;
|
|
243
284
|
}
|
|
244
|
-
}), _el$
|
|
285
|
+
}), _el$33, _co$7);
|
|
245
286
|
effect((_p$) => {
|
|
246
287
|
var _v$ = `w-full bg-white dark:bg-gray-800 rounded-xl border shadow-lg overflow-visible ${props.state.status === "waiting_human" ? "border-blue-300 dark:border-blue-600" : "border-gray-200 dark:border-gray-700"}`, _v$2 = `flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-700 ${isCollapsible() ? "cursor-pointer select-none hover:bg-gray-50 dark:hover:bg-gray-750" : ""}`, _v$3 = `px-2 py-0.5 text-xs font-medium rounded-full ${badge().class}`;
|
|
247
288
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
@@ -259,9 +300,9 @@ const ScratchpadPanel = (props) => {
|
|
|
259
300
|
};
|
|
260
301
|
const SectionRenderer = (props) => {
|
|
261
302
|
return (() => {
|
|
262
|
-
var _el$
|
|
263
|
-
insert(_el$
|
|
264
|
-
insert(_el$
|
|
303
|
+
var _el$62 = getNextElement(_tmpl$19), _el$63 = _el$62.firstChild, _el$66 = _el$63.nextSibling, [_el$67, _co$10] = getNextMarker(_el$66.nextSibling);
|
|
304
|
+
insert(_el$63, () => props.section.title);
|
|
305
|
+
insert(_el$62, createComponent(Switch, {
|
|
265
306
|
get children() {
|
|
266
307
|
return [createComponent(Match, {
|
|
267
308
|
get when() {
|
|
@@ -296,9 +337,9 @@ const SectionRenderer = (props) => {
|
|
|
296
337
|
return props.section.type === "message";
|
|
297
338
|
},
|
|
298
339
|
get children() {
|
|
299
|
-
var _el$
|
|
300
|
-
insert(_el$
|
|
301
|
-
return _el$
|
|
340
|
+
var _el$64 = getNextElement(_tmpl$13);
|
|
341
|
+
insert(_el$64, () => String(props.section.content));
|
|
342
|
+
return _el$64;
|
|
302
343
|
}
|
|
303
344
|
}), createComponent(Match, {
|
|
304
345
|
get when() {
|
|
@@ -348,40 +389,79 @@ const SectionRenderer = (props) => {
|
|
|
348
389
|
}
|
|
349
390
|
});
|
|
350
391
|
}
|
|
392
|
+
}), createComponent(Match, {
|
|
393
|
+
get when() {
|
|
394
|
+
return props.section.type === "understanding";
|
|
395
|
+
},
|
|
396
|
+
get children() {
|
|
397
|
+
return createComponent(UnderstandingSection, {
|
|
398
|
+
get content() {
|
|
399
|
+
return props.section.content;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
}), createComponent(Match, {
|
|
404
|
+
get when() {
|
|
405
|
+
return props.section.type === "feedback";
|
|
406
|
+
},
|
|
407
|
+
get children() {
|
|
408
|
+
return createComponent(FeedbackSection, {
|
|
409
|
+
get content() {
|
|
410
|
+
return props.section.content;
|
|
411
|
+
},
|
|
412
|
+
get onAction() {
|
|
413
|
+
return props.onAction;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
}), createComponent(Match, {
|
|
418
|
+
get when() {
|
|
419
|
+
return props.section.type === "prompt";
|
|
420
|
+
},
|
|
421
|
+
get children() {
|
|
422
|
+
return createComponent(PromptSection, {
|
|
423
|
+
get content() {
|
|
424
|
+
return props.section.content;
|
|
425
|
+
},
|
|
426
|
+
get onAction() {
|
|
427
|
+
return props.onAction;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}
|
|
351
431
|
}), createComponent(Match, {
|
|
352
432
|
when: true,
|
|
353
433
|
get children() {
|
|
354
|
-
var _el$
|
|
355
|
-
insert(_el$
|
|
356
|
-
return _el$
|
|
434
|
+
var _el$65 = getNextElement(_tmpl$18);
|
|
435
|
+
insert(_el$65, () => JSON.stringify(props.section.content, null, 2));
|
|
436
|
+
return _el$65;
|
|
357
437
|
}
|
|
358
438
|
})];
|
|
359
439
|
}
|
|
360
|
-
}), _el$
|
|
361
|
-
return _el$
|
|
440
|
+
}), _el$67, _co$10);
|
|
441
|
+
return _el$62;
|
|
362
442
|
})();
|
|
363
443
|
};
|
|
364
444
|
const DataSection = (props) => {
|
|
365
445
|
const entries = () => typeof props.content === "object" && props.content ? Object.entries(props.content) : [];
|
|
366
446
|
return (() => {
|
|
367
|
-
var _el$
|
|
368
|
-
insert(_el$
|
|
447
|
+
var _el$68 = getNextElement(_tmpl$20);
|
|
448
|
+
insert(_el$68, createComponent(For, {
|
|
369
449
|
get each() {
|
|
370
450
|
return entries();
|
|
371
451
|
},
|
|
372
452
|
children: ([k, v]) => (() => {
|
|
373
|
-
var _el$
|
|
374
|
-
_el$
|
|
375
|
-
var _el$
|
|
376
|
-
insert(_el$
|
|
377
|
-
insert(_el$
|
|
378
|
-
var _c$
|
|
379
|
-
return () => _c$
|
|
453
|
+
var _el$69 = getNextElement(_tmpl$21), _el$70 = _el$69.firstChild, _el$72 = _el$70.firstChild, [_el$73, _co$11] = getNextMarker(_el$72.nextSibling);
|
|
454
|
+
_el$73.nextSibling;
|
|
455
|
+
var _el$74 = _el$70.nextSibling;
|
|
456
|
+
insert(_el$70, k, _el$73, _co$11);
|
|
457
|
+
insert(_el$74, (() => {
|
|
458
|
+
var _c$3 = memo(() => !!Array.isArray(v));
|
|
459
|
+
return () => _c$3() ? v.join(", ") : String(v);
|
|
380
460
|
})());
|
|
381
|
-
return _el$
|
|
461
|
+
return _el$69;
|
|
382
462
|
})()
|
|
383
463
|
}));
|
|
384
|
-
return _el$
|
|
464
|
+
return _el$68;
|
|
385
465
|
})();
|
|
386
466
|
};
|
|
387
467
|
const InteractiveFilterSection = (props) => {
|
|
@@ -415,8 +495,8 @@ const InteractiveFilterSection = (props) => {
|
|
|
415
495
|
};
|
|
416
496
|
const getDef = (key) => filterDefs()[key] || {};
|
|
417
497
|
return (() => {
|
|
418
|
-
var _el$
|
|
419
|
-
insert(_el$
|
|
498
|
+
var _el$75 = getNextElement(_tmpl$23), _el$77 = _el$75.firstChild, [_el$78, _co$12] = getNextMarker(_el$77.nextSibling), _el$79 = _el$78.nextSibling, [_el$80, _co$13] = getNextMarker(_el$79.nextSibling);
|
|
499
|
+
insert(_el$75, createComponent(For, {
|
|
420
500
|
get each() {
|
|
421
501
|
return allKeys();
|
|
422
502
|
},
|
|
@@ -425,136 +505,136 @@ const InteractiveFilterSection = (props) => {
|
|
|
425
505
|
const value = () => props.filters[key];
|
|
426
506
|
const hasValue = () => value() !== void 0 && value() !== "";
|
|
427
507
|
return (() => {
|
|
428
|
-
var _el$
|
|
429
|
-
insert(_el$
|
|
508
|
+
var _el$81 = getNextElement(_tmpl$29), _el$97 = _el$81.firstChild, [_el$98, _co$17] = getNextMarker(_el$97.nextSibling), _el$99 = _el$98.nextSibling, [_el$100, _co$18] = getNextMarker(_el$99.nextSibling);
|
|
509
|
+
insert(_el$81, createComponent(Show, {
|
|
430
510
|
get when() {
|
|
431
511
|
return hasValue();
|
|
432
512
|
},
|
|
433
513
|
get fallback() {
|
|
434
514
|
return (() => {
|
|
435
|
-
var _el$
|
|
436
|
-
_el$
|
|
515
|
+
var _el$101 = getNextElement(_tmpl$30), _el$102 = _el$101.firstChild, _el$103 = _el$102.nextSibling, [_el$104, _co$19] = getNextMarker(_el$103.nextSibling);
|
|
516
|
+
_el$101.$$click = () => {
|
|
437
517
|
setEditingKey(key);
|
|
438
518
|
setEditValue("");
|
|
439
519
|
};
|
|
440
|
-
insert(_el$
|
|
520
|
+
insert(_el$101, () => {
|
|
441
521
|
var _a;
|
|
442
522
|
return ((_a = def()) == null ? void 0 : _a.label) || key;
|
|
443
|
-
}, _el$
|
|
523
|
+
}, _el$104, _co$19);
|
|
444
524
|
runHydrationEvents();
|
|
445
|
-
return _el$
|
|
525
|
+
return _el$101;
|
|
446
526
|
})();
|
|
447
527
|
},
|
|
448
528
|
get children() {
|
|
449
|
-
var _el$
|
|
450
|
-
_el$
|
|
451
|
-
var _el$
|
|
452
|
-
_el$
|
|
529
|
+
var _el$82 = getNextElement(_tmpl$25), _el$83 = _el$82.firstChild, _el$84 = _el$83.firstChild, _el$86 = _el$84.firstChild, [_el$87, _co$14] = getNextMarker(_el$86.nextSibling);
|
|
530
|
+
_el$87.nextSibling;
|
|
531
|
+
var _el$88 = _el$84.nextSibling, _el$89 = _el$88.nextSibling, [_el$90, _co$15] = getNextMarker(_el$89.nextSibling), _el$92 = _el$83.nextSibling, [_el$93, _co$16] = getNextMarker(_el$92.nextSibling);
|
|
532
|
+
_el$83.$$click = () => {
|
|
453
533
|
setEditingKey(key);
|
|
454
534
|
setEditValue(String(value() || ""));
|
|
455
535
|
};
|
|
456
|
-
insert(_el$
|
|
536
|
+
insert(_el$84, () => {
|
|
457
537
|
var _a;
|
|
458
538
|
return ((_a = def()) == null ? void 0 : _a.label) || key;
|
|
459
|
-
}, _el$
|
|
460
|
-
insert(_el$
|
|
461
|
-
var _c$
|
|
462
|
-
return () => _c$
|
|
463
|
-
})(), _el$
|
|
464
|
-
insert(_el$
|
|
539
|
+
}, _el$87, _co$14);
|
|
540
|
+
insert(_el$83, (() => {
|
|
541
|
+
var _c$4 = memo(() => !!Array.isArray(value()));
|
|
542
|
+
return () => _c$4() ? value().join(", ") : String(value());
|
|
543
|
+
})(), _el$90, _co$15);
|
|
544
|
+
insert(_el$82, createComponent(Show, {
|
|
465
545
|
get when() {
|
|
466
546
|
return props.onFilterChange;
|
|
467
547
|
},
|
|
468
548
|
get children() {
|
|
469
|
-
var _el$
|
|
470
|
-
_el$
|
|
471
|
-
setAttribute(_el$
|
|
549
|
+
var _el$91 = getNextElement(_tmpl$24);
|
|
550
|
+
_el$91.$$click = () => removeFilter(key);
|
|
551
|
+
setAttribute(_el$91, "aria-label", `Remove ${key}`);
|
|
472
552
|
runHydrationEvents();
|
|
473
|
-
return _el$
|
|
553
|
+
return _el$91;
|
|
474
554
|
}
|
|
475
|
-
}), _el$
|
|
555
|
+
}), _el$93, _co$16);
|
|
476
556
|
runHydrationEvents();
|
|
477
|
-
return _el$
|
|
557
|
+
return _el$82;
|
|
478
558
|
}
|
|
479
|
-
}), _el$
|
|
480
|
-
insert(_el$
|
|
559
|
+
}), _el$98, _co$17);
|
|
560
|
+
insert(_el$81, createComponent(Show, {
|
|
481
561
|
get when() {
|
|
482
562
|
return editingKey() === key;
|
|
483
563
|
},
|
|
484
564
|
get children() {
|
|
485
|
-
var _el$
|
|
486
|
-
insert(_el$
|
|
565
|
+
var _el$94 = getNextElement(_tmpl$28);
|
|
566
|
+
insert(_el$94, createComponent(Show, {
|
|
487
567
|
get when() {
|
|
488
568
|
var _a;
|
|
489
569
|
return (_a = def()) == null ? void 0 : _a.options;
|
|
490
570
|
},
|
|
491
571
|
get fallback() {
|
|
492
572
|
return (() => {
|
|
493
|
-
var _el$
|
|
494
|
-
_el$
|
|
573
|
+
var _el$105 = getNextElement(_tmpl$31), _el$106 = _el$105.firstChild, _el$107 = _el$106.nextSibling, _el$108 = _el$107.nextSibling;
|
|
574
|
+
_el$105.addEventListener("submit", (e) => {
|
|
495
575
|
e.preventDefault();
|
|
496
576
|
setFilter(key, editValue());
|
|
497
577
|
});
|
|
498
|
-
_el$
|
|
499
|
-
_el$
|
|
578
|
+
_el$106.$$input = (e) => setEditValue(e.currentTarget.value);
|
|
579
|
+
_el$108.$$click = () => setEditingKey(null);
|
|
500
580
|
effect(() => {
|
|
501
581
|
var _a;
|
|
502
|
-
return setAttribute(_el$
|
|
582
|
+
return setAttribute(_el$106, "placeholder", ((_a = def()) == null ? void 0 : _a.placeholder) || key);
|
|
503
583
|
});
|
|
504
|
-
effect(() => setProperty(_el$
|
|
584
|
+
effect(() => setProperty(_el$106, "value", editValue()));
|
|
505
585
|
runHydrationEvents();
|
|
506
|
-
return _el$
|
|
586
|
+
return _el$105;
|
|
507
587
|
})();
|
|
508
588
|
},
|
|
509
589
|
get children() {
|
|
510
590
|
return [(() => {
|
|
511
|
-
var _el$
|
|
512
|
-
insert(_el$
|
|
591
|
+
var _el$95 = getNextElement(_tmpl$26);
|
|
592
|
+
insert(_el$95, createComponent(For, {
|
|
513
593
|
get each() {
|
|
514
594
|
return def().options;
|
|
515
595
|
},
|
|
516
596
|
children: (opt) => (() => {
|
|
517
|
-
var _el$
|
|
518
|
-
_el$
|
|
519
|
-
insert(_el$
|
|
520
|
-
insert(_el$
|
|
597
|
+
var _el$109 = getNextElement(_tmpl$33), _el$111 = _el$109.firstChild, [_el$112, _co$20] = getNextMarker(_el$111.nextSibling), _el$113 = _el$112.nextSibling, [_el$114, _co$21] = getNextMarker(_el$113.nextSibling);
|
|
598
|
+
_el$109.$$click = () => setFilter(key, opt.value);
|
|
599
|
+
insert(_el$109, () => opt.label, _el$112, _co$20);
|
|
600
|
+
insert(_el$109, createComponent(Show, {
|
|
521
601
|
get when() {
|
|
522
602
|
return String(value()) === opt.value;
|
|
523
603
|
},
|
|
524
604
|
get children() {
|
|
525
|
-
return getNextElement(_tmpl$
|
|
605
|
+
return getNextElement(_tmpl$32);
|
|
526
606
|
}
|
|
527
|
-
}), _el$
|
|
528
|
-
effect(() => className(_el$
|
|
607
|
+
}), _el$114, _co$21);
|
|
608
|
+
effect(() => className(_el$109, `w-full text-left px-2 py-1.5 text-sm rounded hover:bg-blue-50 dark:hover:bg-blue-900/20 ${String(value()) === opt.value ? "text-blue-600 dark:text-blue-400 bg-blue-50/50 dark:bg-blue-900/10" : "text-gray-900 dark:text-white"}`));
|
|
529
609
|
runHydrationEvents();
|
|
530
|
-
return _el$
|
|
610
|
+
return _el$109;
|
|
531
611
|
})()
|
|
532
612
|
}));
|
|
533
|
-
return _el$
|
|
613
|
+
return _el$95;
|
|
534
614
|
})(), (() => {
|
|
535
|
-
var _el$
|
|
536
|
-
_el$
|
|
615
|
+
var _el$96 = getNextElement(_tmpl$27);
|
|
616
|
+
_el$96.$$click = () => setEditingKey(null);
|
|
537
617
|
runHydrationEvents();
|
|
538
|
-
return _el$
|
|
618
|
+
return _el$96;
|
|
539
619
|
})()];
|
|
540
620
|
}
|
|
541
621
|
}));
|
|
542
|
-
return _el$
|
|
622
|
+
return _el$94;
|
|
543
623
|
}
|
|
544
|
-
}), _el$
|
|
545
|
-
return _el$
|
|
624
|
+
}), _el$100, _co$18);
|
|
625
|
+
return _el$81;
|
|
546
626
|
})();
|
|
547
627
|
}
|
|
548
|
-
}), _el$
|
|
549
|
-
insert(_el$
|
|
628
|
+
}), _el$78, _co$12);
|
|
629
|
+
insert(_el$75, createComponent(Show, {
|
|
550
630
|
get when() {
|
|
551
631
|
return allKeys().length === 0;
|
|
552
632
|
},
|
|
553
633
|
get children() {
|
|
554
|
-
return getNextElement(_tmpl$
|
|
634
|
+
return getNextElement(_tmpl$22);
|
|
555
635
|
}
|
|
556
|
-
}), _el$
|
|
557
|
-
return _el$
|
|
636
|
+
}), _el$80, _co$13);
|
|
637
|
+
return _el$75;
|
|
558
638
|
})();
|
|
559
639
|
};
|
|
560
640
|
const EmbeddedFormSection = (props) => {
|
|
@@ -612,9 +692,9 @@ const EmbeddedFormSection = (props) => {
|
|
|
612
692
|
});
|
|
613
693
|
};
|
|
614
694
|
return (() => {
|
|
615
|
-
var _el$
|
|
616
|
-
_el$
|
|
617
|
-
insert(_el$
|
|
695
|
+
var _el$115 = getNextElement(_tmpl$34), _el$118 = _el$115.firstChild, [_el$119, _co$22] = getNextMarker(_el$118.nextSibling), _el$116 = _el$119.nextSibling, _el$117 = _el$116.firstChild;
|
|
696
|
+
_el$115.addEventListener("submit", handleSubmit);
|
|
697
|
+
insert(_el$115, createComponent(For, {
|
|
618
698
|
get each() {
|
|
619
699
|
return config().fields;
|
|
620
700
|
},
|
|
@@ -628,9 +708,9 @@ const EmbeddedFormSection = (props) => {
|
|
|
628
708
|
onChange: (val) => updateField(field.name, val),
|
|
629
709
|
formData
|
|
630
710
|
})
|
|
631
|
-
}), _el$
|
|
632
|
-
insert(_el$
|
|
633
|
-
return _el$
|
|
711
|
+
}), _el$119, _co$22);
|
|
712
|
+
insert(_el$117, () => config().submitLabel);
|
|
713
|
+
return _el$115;
|
|
634
714
|
})();
|
|
635
715
|
};
|
|
636
716
|
const EnrichedStepsSection = (props) => {
|
|
@@ -642,35 +722,35 @@ const EnrichedStepsSection = (props) => {
|
|
|
642
722
|
};
|
|
643
723
|
};
|
|
644
724
|
return (() => {
|
|
645
|
-
var _el$
|
|
646
|
-
insert(_el$
|
|
725
|
+
var _el$120 = getNextElement(_tmpl$36), _el$123 = _el$120.firstChild, [_el$124, _co$23] = getNextMarker(_el$123.nextSibling), _el$125 = _el$124.nextSibling, [_el$126, _co$24] = getNextMarker(_el$125.nextSibling);
|
|
726
|
+
insert(_el$120, createComponent(For, {
|
|
647
727
|
get each() {
|
|
648
728
|
return stepsData().steps;
|
|
649
729
|
},
|
|
650
730
|
children: (step) => (() => {
|
|
651
|
-
var _el$
|
|
652
|
-
insert(_el$
|
|
653
|
-
var _c$
|
|
654
|
-
return () => _c$
|
|
731
|
+
var _el$127 = getNextElement(_tmpl$39), _el$128 = _el$127.firstChild, _el$129 = _el$128.firstChild, _el$134 = _el$129.nextSibling, [_el$135, _co$26] = getNextMarker(_el$134.nextSibling), _el$136 = _el$135.nextSibling, [_el$137, _co$27] = getNextMarker(_el$136.nextSibling), _el$139 = _el$128.nextSibling, [_el$140, _co$28] = getNextMarker(_el$139.nextSibling);
|
|
732
|
+
insert(_el$129, (() => {
|
|
733
|
+
var _c$5 = memo(() => step.status === "done");
|
|
734
|
+
return () => _c$5() ? "✅" : step.status === "active" ? "●" : "○";
|
|
655
735
|
})());
|
|
656
|
-
insert(_el$
|
|
657
|
-
insert(_el$
|
|
736
|
+
insert(_el$128, () => step.label, _el$135, _co$26);
|
|
737
|
+
insert(_el$128, createComponent(Show, {
|
|
658
738
|
get when() {
|
|
659
739
|
return memo(() => !!step.description)() && step.status === "active";
|
|
660
740
|
},
|
|
661
741
|
get children() {
|
|
662
|
-
var _el$
|
|
663
|
-
insert(_el$
|
|
664
|
-
return _el$
|
|
742
|
+
var _el$130 = getNextElement(_tmpl$37), _el$131 = _el$130.firstChild, _el$132 = _el$131.nextSibling, [_el$133, _co$25] = getNextMarker(_el$132.nextSibling);
|
|
743
|
+
insert(_el$130, () => step.description, _el$133, _co$25);
|
|
744
|
+
return _el$130;
|
|
665
745
|
}
|
|
666
|
-
}), _el$
|
|
667
|
-
insert(_el$
|
|
746
|
+
}), _el$137, _co$27);
|
|
747
|
+
insert(_el$127, createComponent(Show, {
|
|
668
748
|
get when() {
|
|
669
749
|
return memo(() => step.status === "active")() && step.content;
|
|
670
750
|
},
|
|
671
751
|
get children() {
|
|
672
|
-
var _el$
|
|
673
|
-
insert(_el$
|
|
752
|
+
var _el$138 = getNextElement(_tmpl$38);
|
|
753
|
+
insert(_el$138, createComponent(SectionRenderer, {
|
|
674
754
|
get section() {
|
|
675
755
|
return step.content;
|
|
676
756
|
},
|
|
@@ -682,71 +762,242 @@ const EnrichedStepsSection = (props) => {
|
|
|
682
762
|
return props.onAction;
|
|
683
763
|
}
|
|
684
764
|
}));
|
|
685
|
-
return _el$
|
|
765
|
+
return _el$138;
|
|
686
766
|
}
|
|
687
|
-
}), _el$
|
|
767
|
+
}), _el$140, _co$28);
|
|
688
768
|
effect((_p$) => {
|
|
689
769
|
var _v$4 = `rounded-lg ${step.status === "active" ? "bg-blue-50/50 dark:bg-blue-900/10 border border-blue-200 dark:border-blue-800 p-3" : "px-1"}`, _v$5 = `flex items-center gap-2 text-sm font-medium ${step.status === "done" ? "text-green-600 dark:text-green-400" : step.status === "active" ? "text-blue-600 dark:text-blue-400" : "text-gray-400"}`;
|
|
690
|
-
_v$4 !== _p$.e && className(_el$
|
|
691
|
-
_v$5 !== _p$.t && className(_el$
|
|
770
|
+
_v$4 !== _p$.e && className(_el$127, _p$.e = _v$4);
|
|
771
|
+
_v$5 !== _p$.t && className(_el$128, _p$.t = _v$5);
|
|
692
772
|
return _p$;
|
|
693
773
|
}, {
|
|
694
774
|
e: void 0,
|
|
695
775
|
t: void 0
|
|
696
776
|
});
|
|
697
|
-
return _el$
|
|
777
|
+
return _el$127;
|
|
698
778
|
})()
|
|
699
|
-
}), _el$
|
|
700
|
-
insert(_el$
|
|
779
|
+
}), _el$124, _co$23);
|
|
780
|
+
insert(_el$120, createComponent(Show, {
|
|
701
781
|
get when() {
|
|
702
782
|
return stepsData().steps.some((s) => s.status === "active");
|
|
703
783
|
},
|
|
704
784
|
get children() {
|
|
705
|
-
var _el$
|
|
706
|
-
_el$
|
|
785
|
+
var _el$121 = getNextElement(_tmpl$35), _el$122 = _el$121.firstChild;
|
|
786
|
+
_el$122.$$click = () => {
|
|
707
787
|
var _a;
|
|
708
788
|
return (_a = props.onAction) == null ? void 0 : _a.call(props, "next_step", {
|
|
709
789
|
step: stepsData().currentStep
|
|
710
790
|
});
|
|
711
791
|
};
|
|
712
792
|
runHydrationEvents();
|
|
713
|
-
return _el$
|
|
793
|
+
return _el$121;
|
|
714
794
|
}
|
|
715
|
-
}), _el$
|
|
716
|
-
return _el$
|
|
795
|
+
}), _el$126, _co$24);
|
|
796
|
+
return _el$120;
|
|
717
797
|
})();
|
|
718
798
|
};
|
|
719
799
|
const ActionSection = (props) => {
|
|
720
800
|
const actions = () => Array.isArray(props.content) ? props.content : [];
|
|
721
801
|
return (() => {
|
|
722
|
-
var _el$
|
|
723
|
-
insert(_el$
|
|
802
|
+
var _el$141 = getNextElement(_tmpl$40);
|
|
803
|
+
insert(_el$141, createComponent(For, {
|
|
724
804
|
get each() {
|
|
725
805
|
return actions();
|
|
726
806
|
},
|
|
727
807
|
children: (item) => (() => {
|
|
728
|
-
var _el$
|
|
729
|
-
_el$
|
|
808
|
+
var _el$142 = getNextElement(_tmpl$33), _el$144 = _el$142.firstChild, [_el$145, _co$29] = getNextMarker(_el$144.nextSibling), _el$146 = _el$145.nextSibling, [_el$147, _co$30] = getNextMarker(_el$146.nextSibling);
|
|
809
|
+
_el$142.$$click = () => {
|
|
730
810
|
var _a;
|
|
731
811
|
return (_a = props.onAction) == null ? void 0 : _a.call(props, item.value || item.action || item.label, item);
|
|
732
812
|
};
|
|
733
|
-
insert(_el$
|
|
813
|
+
insert(_el$142, createComponent(Show, {
|
|
734
814
|
get when() {
|
|
735
815
|
return item.icon;
|
|
736
816
|
},
|
|
737
817
|
get children() {
|
|
738
|
-
var _el$
|
|
739
|
-
insert(_el$
|
|
740
|
-
return _el$
|
|
818
|
+
var _el$143 = getNextElement(_tmpl$41);
|
|
819
|
+
insert(_el$143, () => item.icon);
|
|
820
|
+
return _el$143;
|
|
741
821
|
}
|
|
742
|
-
}), _el$
|
|
743
|
-
insert(_el$
|
|
744
|
-
effect(() => className(_el$
|
|
822
|
+
}), _el$145, _co$29);
|
|
823
|
+
insert(_el$142, () => item.label, _el$147, _co$30);
|
|
824
|
+
effect(() => className(_el$142, `px-3 py-1.5 text-sm font-medium rounded-lg transition-colors ${item.variant === "primary" ? "bg-blue-600 text-white hover:bg-blue-700" : item.variant === "danger" ? "bg-red-600 text-white hover:bg-red-700" : "border border-gray-200 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`));
|
|
745
825
|
runHydrationEvents();
|
|
746
|
-
return _el$
|
|
826
|
+
return _el$142;
|
|
747
827
|
})()
|
|
748
828
|
}));
|
|
749
|
-
return _el$
|
|
829
|
+
return _el$141;
|
|
830
|
+
})();
|
|
831
|
+
};
|
|
832
|
+
const UnderstandingSection = (props) => {
|
|
833
|
+
const data = () => {
|
|
834
|
+
const c = props.content;
|
|
835
|
+
return {
|
|
836
|
+
detections: (c == null ? void 0 : c.detections) || [],
|
|
837
|
+
warnings: (c == null ? void 0 : c.warnings) || []
|
|
838
|
+
};
|
|
839
|
+
};
|
|
840
|
+
const confidenceClass = (conf) => {
|
|
841
|
+
switch (conf) {
|
|
842
|
+
case "high":
|
|
843
|
+
return "bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400";
|
|
844
|
+
case "medium":
|
|
845
|
+
return "bg-yellow-100 dark:bg-yellow-900/30 text-yellow-700 dark:text-yellow-400";
|
|
846
|
+
case "low":
|
|
847
|
+
return "bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400";
|
|
848
|
+
default:
|
|
849
|
+
return "bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400";
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
return (() => {
|
|
853
|
+
var _el$148 = getNextElement(_tmpl$42), _el$149 = _el$148.firstChild, _el$151 = _el$149.nextSibling, [_el$152, _co$31] = getNextMarker(_el$151.nextSibling);
|
|
854
|
+
insert(_el$149, createComponent(For, {
|
|
855
|
+
get each() {
|
|
856
|
+
return data().detections;
|
|
857
|
+
},
|
|
858
|
+
children: (det) => (() => {
|
|
859
|
+
var _el$153 = getNextElement(_tmpl$43), _el$154 = _el$153.firstChild, _el$155 = _el$154.nextSibling;
|
|
860
|
+
insert(_el$154, () => det.label);
|
|
861
|
+
insert(_el$155, () => det.value);
|
|
862
|
+
effect(() => className(_el$154, `px-1.5 py-0.5 text-xs font-medium rounded ${confidenceClass(det.confidence)}`));
|
|
863
|
+
return _el$153;
|
|
864
|
+
})()
|
|
865
|
+
}));
|
|
866
|
+
insert(_el$148, createComponent(Show, {
|
|
867
|
+
get when() {
|
|
868
|
+
return data().warnings.length > 0;
|
|
869
|
+
},
|
|
870
|
+
get children() {
|
|
871
|
+
var _el$150 = getNextElement(_tmpl$20);
|
|
872
|
+
insert(_el$150, createComponent(For, {
|
|
873
|
+
get each() {
|
|
874
|
+
return data().warnings;
|
|
875
|
+
},
|
|
876
|
+
children: (w) => (() => {
|
|
877
|
+
var _el$156 = getNextElement(_tmpl$44), _el$157 = _el$156.firstChild, _el$158 = _el$157.nextSibling;
|
|
878
|
+
insert(_el$158, w);
|
|
879
|
+
return _el$156;
|
|
880
|
+
})()
|
|
881
|
+
}));
|
|
882
|
+
return _el$150;
|
|
883
|
+
}
|
|
884
|
+
}), _el$152, _co$31);
|
|
885
|
+
return _el$148;
|
|
886
|
+
})();
|
|
887
|
+
};
|
|
888
|
+
const FeedbackSection = (props) => {
|
|
889
|
+
const [comment, setComment] = createSignal("");
|
|
890
|
+
const data = () => {
|
|
891
|
+
const c = props.content;
|
|
892
|
+
return {
|
|
893
|
+
question: (c == null ? void 0 : c.question) || "",
|
|
894
|
+
approve: (c == null ? void 0 : c.approve) || {
|
|
895
|
+
label: "Yes",
|
|
896
|
+
value: "approve"
|
|
897
|
+
},
|
|
898
|
+
reject: (c == null ? void 0 : c.reject) || {
|
|
899
|
+
label: "No",
|
|
900
|
+
value: "reject"
|
|
901
|
+
},
|
|
902
|
+
allowComment: (c == null ? void 0 : c.allowComment) ?? false,
|
|
903
|
+
commentPlaceholder: (c == null ? void 0 : c.commentPlaceholder) || "Add a comment..."
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
const handleFeedback = (approved) => {
|
|
907
|
+
var _a;
|
|
908
|
+
const d = data();
|
|
909
|
+
(_a = props.onAction) == null ? void 0 : _a.call(props, "feedback", {
|
|
910
|
+
approved,
|
|
911
|
+
value: approved ? d.approve.value : d.reject.value,
|
|
912
|
+
comment: comment()
|
|
913
|
+
});
|
|
914
|
+
};
|
|
915
|
+
return (() => {
|
|
916
|
+
var _el$159 = getNextElement(_tmpl$46), _el$160 = _el$159.firstChild, _el$161 = _el$160.nextSibling, _el$162 = _el$161.firstChild, _el$163 = _el$162.firstChild, _el$164 = _el$163.nextSibling, [_el$165, _co$32] = getNextMarker(_el$164.nextSibling), _el$166 = _el$162.nextSibling, _el$167 = _el$166.firstChild, _el$168 = _el$167.nextSibling, [_el$169, _co$33] = getNextMarker(_el$168.nextSibling), _el$171 = _el$161.nextSibling, [_el$172, _co$34] = getNextMarker(_el$171.nextSibling);
|
|
917
|
+
insert(_el$160, () => data().question);
|
|
918
|
+
_el$162.$$click = () => handleFeedback(true);
|
|
919
|
+
insert(_el$162, () => data().approve.label, _el$165, _co$32);
|
|
920
|
+
_el$166.$$click = () => handleFeedback(false);
|
|
921
|
+
insert(_el$166, () => data().reject.label, _el$169, _co$33);
|
|
922
|
+
insert(_el$159, createComponent(Show, {
|
|
923
|
+
get when() {
|
|
924
|
+
return data().allowComment;
|
|
925
|
+
},
|
|
926
|
+
get children() {
|
|
927
|
+
var _el$170 = getNextElement(_tmpl$45);
|
|
928
|
+
_el$170.$$input = (e) => setComment(e.currentTarget.value);
|
|
929
|
+
effect(() => setAttribute(_el$170, "placeholder", data().commentPlaceholder));
|
|
930
|
+
effect(() => setProperty(_el$170, "value", comment()));
|
|
931
|
+
runHydrationEvents();
|
|
932
|
+
return _el$170;
|
|
933
|
+
}
|
|
934
|
+
}), _el$172, _co$34);
|
|
935
|
+
runHydrationEvents();
|
|
936
|
+
return _el$159;
|
|
937
|
+
})();
|
|
938
|
+
};
|
|
939
|
+
const PromptSection = (props) => {
|
|
940
|
+
const data = () => {
|
|
941
|
+
const c = props.content;
|
|
942
|
+
return {
|
|
943
|
+
originalQuery: (c == null ? void 0 : c.originalQuery) || "",
|
|
944
|
+
interpretation: (c == null ? void 0 : c.interpretation) || "",
|
|
945
|
+
extracted: (c == null ? void 0 : c.extracted) || {},
|
|
946
|
+
plan: (c == null ? void 0 : c.plan) || "",
|
|
947
|
+
editable: (c == null ? void 0 : c.editable) ?? false
|
|
948
|
+
};
|
|
949
|
+
};
|
|
950
|
+
return (() => {
|
|
951
|
+
var _el$173 = getNextElement(_tmpl$50), _el$186 = _el$173.firstChild, [_el$187, _co$37] = getNextMarker(_el$186.nextSibling), _el$179 = _el$187.nextSibling, _el$188 = _el$179.nextSibling, [_el$189, _co$38] = getNextMarker(_el$188.nextSibling), _el$190 = _el$189.nextSibling, [_el$191, _co$39] = getNextMarker(_el$190.nextSibling);
|
|
952
|
+
insert(_el$173, createComponent(Show, {
|
|
953
|
+
get when() {
|
|
954
|
+
return data().originalQuery;
|
|
955
|
+
},
|
|
956
|
+
get children() {
|
|
957
|
+
var _el$174 = getNextElement(_tmpl$47), _el$175 = _el$174.firstChild, _el$177 = _el$175.nextSibling, [_el$178, _co$35] = getNextMarker(_el$177.nextSibling);
|
|
958
|
+
_el$178.nextSibling;
|
|
959
|
+
insert(_el$174, () => data().originalQuery, _el$178, _co$35);
|
|
960
|
+
return _el$174;
|
|
961
|
+
}
|
|
962
|
+
}), _el$187, _co$37);
|
|
963
|
+
insert(_el$179, createComponent(For, {
|
|
964
|
+
get each() {
|
|
965
|
+
return Object.entries(data().extracted);
|
|
966
|
+
},
|
|
967
|
+
children: ([key, value]) => (() => {
|
|
968
|
+
var _el$192 = getNextElement(_tmpl$51), _el$193 = _el$192.firstChild, _el$195 = _el$193.firstChild, [_el$196, _co$40] = getNextMarker(_el$195.nextSibling);
|
|
969
|
+
_el$196.nextSibling;
|
|
970
|
+
var _el$197 = _el$193.nextSibling;
|
|
971
|
+
insert(_el$193, key, _el$196, _co$40);
|
|
972
|
+
insert(_el$197, () => String(value));
|
|
973
|
+
return _el$192;
|
|
974
|
+
})()
|
|
975
|
+
}));
|
|
976
|
+
insert(_el$173, createComponent(Show, {
|
|
977
|
+
get when() {
|
|
978
|
+
return data().plan;
|
|
979
|
+
},
|
|
980
|
+
get children() {
|
|
981
|
+
var _el$180 = getNextElement(_tmpl$48), _el$181 = _el$180.firstChild, _el$182 = _el$181.nextSibling, _el$183 = _el$182.nextSibling, [_el$184, _co$36] = getNextMarker(_el$183.nextSibling);
|
|
982
|
+
insert(_el$180, () => data().plan, _el$184, _co$36);
|
|
983
|
+
return _el$180;
|
|
984
|
+
}
|
|
985
|
+
}), _el$189, _co$38);
|
|
986
|
+
insert(_el$173, createComponent(Show, {
|
|
987
|
+
get when() {
|
|
988
|
+
return data().editable;
|
|
989
|
+
},
|
|
990
|
+
get children() {
|
|
991
|
+
var _el$185 = getNextElement(_tmpl$49);
|
|
992
|
+
_el$185.$$click = () => {
|
|
993
|
+
var _a;
|
|
994
|
+
return (_a = props.onAction) == null ? void 0 : _a.call(props, "edit_prompt", data());
|
|
995
|
+
};
|
|
996
|
+
runHydrationEvents();
|
|
997
|
+
return _el$185;
|
|
998
|
+
}
|
|
999
|
+
}), _el$191, _co$39);
|
|
1000
|
+
return _el$173;
|
|
750
1001
|
})();
|
|
751
1002
|
};
|
|
752
1003
|
delegateEvents(["click", "input"]);
|