@locusgraph/loop 0.2.0 → 0.2.1
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/agent/pulse/gradient-label.js +12 -62
- package/dist/agent/pulse/marks/bars-mark.js +15 -37
- package/dist/agent/pulse/marks/glyph-mark.js +15 -54
- package/dist/agent/pulse/marks/locus-mark.js +12 -36
- package/dist/agent/pulse/marks/orb-mark.js +9 -19
- package/dist/agent/pulse/marks/spinner-mark.js +20 -29
- package/dist/agent/pulse/pulse.js +36 -123
- package/dist/agent/pulse/use-loop-animation.js +12 -33
- package/dist/agent/steps/step-icon.js +26 -96
- package/dist/agent/steps/steps.js +47 -210
- package/dist/agent/tool/json-block.js +11 -31
- package/dist/agent/tool/tool-status.js +12 -35
- package/dist/approval/inbox/inbox-row.js +76 -301
- package/dist/approval/inbox/inbox.js +39 -190
- package/dist/approval/inbox/virtual-inbox-list.js +26 -102
- package/dist/approval/memory/memory-review.js +36 -170
- package/dist/approval/memory/memory-row.js +50 -185
- package/dist/approval/plan/plan-review.js +73 -223
- package/dist/approval/plan/plan-step-row.js +76 -180
- package/dist/approval/plan/question-choices.js +44 -130
- package/dist/approval/plan/question.js +38 -154
- package/dist/approval/run/run-bar.js +39 -123
- package/dist/approval/shared/risk-badge.js +9 -24
- package/dist/approval/shared/use-focus-on-mount.js +5 -21
- package/dist/approval/spend/raise-cap-form.js +48 -221
- package/dist/approval/spend/spend-gate.js +40 -155
- package/dist/approval/spend/spend-meter.js +85 -312
- package/dist/approval/tool/approval.js +35 -194
- package/dist/approval/tool/args/args-editor.js +46 -204
- package/dist/approval/tool/args/args-field.js +55 -238
- package/dist/approval/tool/deny-form.js +36 -123
- package/dist/approval/tool/tool-inputs.js +23 -88
- package/dist/chat/chat/use-stick-to-bottom.js +60 -113
- package/dist/chat/chat/virtual-chat-items.js +34 -127
- package/dist/chat/composer/composer-actions.js +46 -129
- package/dist/chat/composer/use-auto-grow.js +8 -23
- package/dist/chat/files/files.js +66 -291
- package/dist/chat/reply/fenced-code.js +10 -32
- package/dist/chat/reply/reply.js +24 -99
- package/dist/chat/turn/turn.js +46 -197
- package/dist/cost/context.js +65 -282
- package/dist/cost/cost-steps.js +42 -195
- package/dist/cost/cost.js +108 -497
- package/dist/cost/model-picker.js +42 -172
- package/dist/cost/shared/context-breakdown.js +64 -280
- package/dist/cost/shared/meter-marks.js +34 -92
- package/dist/cost/shared/model-option-row.js +35 -158
- package/dist/cost/shared/step-cost-row.js +37 -222
- package/dist/memory/cite.js +58 -179
- package/dist/memory/memorized.js +42 -194
- package/dist/memory/recall.js +68 -263
- package/dist/memory/shared/source-mark.js +10 -38
- package/dist/memory/sources.js +52 -230
- package/dist/shared/decision-summary.js +35 -117
- package/dist/shared/panel-empty.js +15 -73
- package/dist/shared/panel.js +65 -239
- package/dist/shared/status-dot.js +10 -32
- package/dist/thread/actions/action-button.js +10 -53
- package/dist/thread/actions/branch-switcher.js +21 -95
- package/dist/thread/canvas/version-switcher.js +31 -126
- package/dist/thread/code/copy-code-button.js +24 -56
- package/dist/thread/history/row/history-row.js +18 -97
- package/dist/thread/history/row/thread-item-menu.js +19 -72
- package/dist/thread/history/row/thread-title-editor.js +29 -72
- package/dist/thread/history/virtual-history-list.js +46 -82
- package/dist/thread/starters/starters.js +27 -87
- package/dist/thread/use-copied.js +10 -38
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { Edit as SquarePenIcon } from "@carbon/icons-react";
|
|
3
2
|
import { Button, cn } from "@locusgraph/components";
|
|
4
3
|
import { useId, useMemo, useState } from "react";
|
|
@@ -12,141 +11,45 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
12
11
|
function errorSummary(count) {
|
|
13
12
|
return count === 1 ? "1 field needs a fix." : `${count} fields need a fix.`;
|
|
14
13
|
}
|
|
15
|
-
export function ArgsEditor(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className
|
|
29
|
-
} = t0;
|
|
30
|
-
let t4;
|
|
31
|
-
if ($[0] !== t1) {
|
|
32
|
-
t4 = t1 === undefined ? {} : t1;
|
|
33
|
-
$[0] = t1;
|
|
34
|
-
$[1] = t4;
|
|
35
|
-
} else {
|
|
36
|
-
t4 = $[1];
|
|
37
|
-
}
|
|
38
|
-
const initialValues = t4;
|
|
39
|
-
const risk = t2 === undefined ? "write" : t2;
|
|
40
|
-
const autoFocus = t3 === undefined ? false : t3;
|
|
14
|
+
export function ArgsEditor({
|
|
15
|
+
toolName,
|
|
16
|
+
fields,
|
|
17
|
+
initialValues = {},
|
|
18
|
+
risk = "write",
|
|
19
|
+
actionLabel,
|
|
20
|
+
description,
|
|
21
|
+
decision,
|
|
22
|
+
onApprove,
|
|
23
|
+
onCancel,
|
|
24
|
+
autoFocus = false,
|
|
25
|
+
className
|
|
26
|
+
}) {
|
|
41
27
|
const baseId = useId();
|
|
42
|
-
|
|
43
|
-
if ($[2] !== fields || $[3] !== initialValues) {
|
|
44
|
-
t5 = () => draftsFrom(fields, initialValues);
|
|
45
|
-
$[2] = fields;
|
|
46
|
-
$[3] = initialValues;
|
|
47
|
-
$[4] = t5;
|
|
48
|
-
} else {
|
|
49
|
-
t5 = $[4];
|
|
50
|
-
}
|
|
51
|
-
const [drafts, setDrafts] = useState(t5);
|
|
28
|
+
const [drafts, setDrafts] = useState(() => draftsFrom(fields, initialValues));
|
|
52
29
|
const [showErrors, setShowErrors] = useState(false);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$[5] = drafts;
|
|
57
|
-
$[6] = fields;
|
|
58
|
-
$[7] = t6;
|
|
59
|
-
} else {
|
|
60
|
-
t6 = $[7];
|
|
61
|
-
}
|
|
62
|
-
const errors = t6;
|
|
63
|
-
let t7;
|
|
64
|
-
if ($[8] !== errors) {
|
|
65
|
-
t7 = Object.keys(errors);
|
|
66
|
-
$[8] = errors;
|
|
67
|
-
$[9] = t7;
|
|
68
|
-
} else {
|
|
69
|
-
t7 = $[9];
|
|
70
|
-
}
|
|
71
|
-
const errorCount = t7.length;
|
|
72
|
-
let t8;
|
|
73
|
-
if ($[10] !== errors || $[11] !== showErrors) {
|
|
74
|
-
t8 = showErrors ? errors : {};
|
|
75
|
-
$[10] = errors;
|
|
76
|
-
$[11] = showErrors;
|
|
77
|
-
$[12] = t8;
|
|
78
|
-
} else {
|
|
79
|
-
t8 = $[12];
|
|
80
|
-
}
|
|
81
|
-
const visibleErrors = t8;
|
|
30
|
+
const errors = useMemo(() => validateDrafts(fields, drafts), [fields, drafts]);
|
|
31
|
+
const errorCount = Object.keys(errors).length;
|
|
32
|
+
const visibleErrors = showErrors ? errors : {};
|
|
82
33
|
const destructive = risk === "destructive";
|
|
83
34
|
const submitRef = useFocusOnMount(autoFocus && !decision);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"
|
|
100
|
-
});
|
|
101
|
-
$[16] = t13;
|
|
102
|
-
} else {
|
|
103
|
-
t13 = $[16];
|
|
104
|
-
}
|
|
105
|
-
const t14 = decision ? "Tool call" : "Edit before approving";
|
|
106
|
-
const t15 = riskLabels[risk];
|
|
107
|
-
const t16 = decision ? decision.approved ? "Approved" : "Cancelled" : "Waiting for you";
|
|
108
|
-
const t17 = decision ? decision.approved ? "done" : "danger" : "waiting";
|
|
109
|
-
let t18;
|
|
110
|
-
if ($[17] !== t14 || $[18] !== t15 || $[19] !== t16 || $[20] !== t17) {
|
|
111
|
-
t18 = /*#__PURE__*/_jsx(PanelHeader, {
|
|
112
|
-
icon: t13,
|
|
113
|
-
eyebrow: t14,
|
|
114
|
-
aside: t15,
|
|
115
|
-
status: t16,
|
|
116
|
-
tone: t17
|
|
117
|
-
});
|
|
118
|
-
$[17] = t14;
|
|
119
|
-
$[18] = t15;
|
|
120
|
-
$[19] = t16;
|
|
121
|
-
$[20] = t17;
|
|
122
|
-
$[21] = t18;
|
|
123
|
-
} else {
|
|
124
|
-
t18 = $[21];
|
|
125
|
-
}
|
|
126
|
-
const t19 = decision && "text-muted-foreground";
|
|
127
|
-
let t20;
|
|
128
|
-
if ($[22] !== t19) {
|
|
129
|
-
t20 = cn("truncate font-mono", t19);
|
|
130
|
-
$[22] = t19;
|
|
131
|
-
$[23] = t20;
|
|
132
|
-
} else {
|
|
133
|
-
t20 = $[23];
|
|
134
|
-
}
|
|
135
|
-
let t21;
|
|
136
|
-
if ($[24] !== t20 || $[25] !== toolName) {
|
|
137
|
-
t21 = /*#__PURE__*/_jsx(PanelTitle, {
|
|
138
|
-
className: t20,
|
|
35
|
+
return /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
36
|
+
"data-slot": "args-editor",
|
|
37
|
+
"data-risk": risk,
|
|
38
|
+
"aria-label": `Edit ${toolName} inputs`,
|
|
39
|
+
"data-state": decision ? decision.approved ? "approved" : "denied" : "editing",
|
|
40
|
+
className: cn(!decision && riskRing[risk], className),
|
|
41
|
+
children: [/*#__PURE__*/_jsx(PanelHeader, {
|
|
42
|
+
icon: /*#__PURE__*/_jsx(SquarePenIcon, {
|
|
43
|
+
"aria-hidden": true
|
|
44
|
+
}),
|
|
45
|
+
eyebrow: decision ? "Tool call" : "Edit before approving",
|
|
46
|
+
aside: riskLabels[risk],
|
|
47
|
+
status: decision ? decision.approved ? "Approved" : "Cancelled" : "Waiting for you",
|
|
48
|
+
tone: decision ? decision.approved ? "done" : "danger" : "waiting"
|
|
49
|
+
}), /*#__PURE__*/_jsx(PanelTitle, {
|
|
50
|
+
className: cn("truncate font-mono", decision && "text-muted-foreground"),
|
|
139
51
|
children: toolName
|
|
140
|
-
})
|
|
141
|
-
$[24] = t20;
|
|
142
|
-
$[25] = toolName;
|
|
143
|
-
$[26] = t21;
|
|
144
|
-
} else {
|
|
145
|
-
t21 = $[26];
|
|
146
|
-
}
|
|
147
|
-
let t22;
|
|
148
|
-
if ($[27] !== actionLabel || $[28] !== baseId || $[29] !== decision || $[30] !== description || $[31] !== destructive || $[32] !== drafts || $[33] !== errorCount || $[34] !== errors || $[35] !== fields || $[36] !== onApprove || $[37] !== onCancel || $[38] !== risk || $[39] !== showErrors || $[40] !== submitRef || $[41] !== toolName || $[42] !== visibleErrors) {
|
|
149
|
-
t22 = decision ? /*#__PURE__*/_jsx(PanelBody, {
|
|
52
|
+
}), decision ? /*#__PURE__*/_jsx(PanelBody, {
|
|
150
53
|
className: "pt-3",
|
|
151
54
|
children: /*#__PURE__*/_jsx(DecisionSummary, {
|
|
152
55
|
decision: decision,
|
|
@@ -165,25 +68,23 @@ export function ArgsEditor(t0) {
|
|
|
165
68
|
if (firstInvalid) {
|
|
166
69
|
setShowErrors(true);
|
|
167
70
|
const control = event.currentTarget.elements.namedItem(firstInvalid.name);
|
|
168
|
-
if (control instanceof HTMLElement)
|
|
169
|
-
control.focus();
|
|
170
|
-
}
|
|
71
|
+
if (control instanceof HTMLElement) control.focus();
|
|
171
72
|
return;
|
|
172
73
|
}
|
|
173
74
|
onApprove(valuesFromDrafts(fields, drafts));
|
|
174
75
|
},
|
|
175
76
|
children: [/*#__PURE__*/_jsx(PanelBody, {
|
|
176
77
|
className: "gap-5 pt-5",
|
|
177
|
-
children: fields.map(
|
|
178
|
-
id: `${baseId}-${
|
|
179
|
-
field:
|
|
180
|
-
draft: drafts[
|
|
181
|
-
error: visibleErrors[
|
|
78
|
+
children: fields.map(field => /*#__PURE__*/_jsx(ArgsField, {
|
|
79
|
+
id: `${baseId}-${field.name}`,
|
|
80
|
+
field: field,
|
|
81
|
+
draft: drafts[field.name],
|
|
82
|
+
error: visibleErrors[field.name],
|
|
182
83
|
onChange: draft => setDrafts(current => ({
|
|
183
84
|
...current,
|
|
184
|
-
[
|
|
85
|
+
[field.name]: draft
|
|
185
86
|
}))
|
|
186
|
-
},
|
|
87
|
+
}, field.name))
|
|
187
88
|
}), /*#__PURE__*/_jsxs(PanelFooter, {
|
|
188
89
|
className: "justify-between",
|
|
189
90
|
children: [/*#__PURE__*/_jsx("span", {
|
|
@@ -207,67 +108,8 @@ export function ArgsEditor(t0) {
|
|
|
207
108
|
})]
|
|
208
109
|
})]
|
|
209
110
|
})]
|
|
210
|
-
})
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
$[30] = description;
|
|
215
|
-
$[31] = destructive;
|
|
216
|
-
$[32] = drafts;
|
|
217
|
-
$[33] = errorCount;
|
|
218
|
-
$[34] = errors;
|
|
219
|
-
$[35] = fields;
|
|
220
|
-
$[36] = onApprove;
|
|
221
|
-
$[37] = onCancel;
|
|
222
|
-
$[38] = risk;
|
|
223
|
-
$[39] = showErrors;
|
|
224
|
-
$[40] = submitRef;
|
|
225
|
-
$[41] = toolName;
|
|
226
|
-
$[42] = visibleErrors;
|
|
227
|
-
$[43] = t22;
|
|
228
|
-
} else {
|
|
229
|
-
t22 = $[43];
|
|
230
|
-
}
|
|
231
|
-
let t23;
|
|
232
|
-
if ($[44] !== errorCount || $[45] !== showErrors) {
|
|
233
|
-
t23 = showErrors && errorCount > 0 ? errorSummary(errorCount) : "";
|
|
234
|
-
$[44] = errorCount;
|
|
235
|
-
$[45] = showErrors;
|
|
236
|
-
$[46] = t23;
|
|
237
|
-
} else {
|
|
238
|
-
t23 = $[46];
|
|
239
|
-
}
|
|
240
|
-
let t24;
|
|
241
|
-
if ($[47] !== t23) {
|
|
242
|
-
t24 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
243
|
-
message: t23
|
|
244
|
-
});
|
|
245
|
-
$[47] = t23;
|
|
246
|
-
$[48] = t24;
|
|
247
|
-
} else {
|
|
248
|
-
t24 = $[48];
|
|
249
|
-
}
|
|
250
|
-
let t25;
|
|
251
|
-
if ($[49] !== risk || $[50] !== t10 || $[51] !== t12 || $[52] !== t18 || $[53] !== t21 || $[54] !== t22 || $[55] !== t24 || $[56] !== t9) {
|
|
252
|
-
t25 = /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
253
|
-
"data-slot": "args-editor",
|
|
254
|
-
"data-risk": risk,
|
|
255
|
-
"aria-label": t9,
|
|
256
|
-
"data-state": t10,
|
|
257
|
-
className: t12,
|
|
258
|
-
children: [t18, t21, t22, t24]
|
|
259
|
-
});
|
|
260
|
-
$[49] = risk;
|
|
261
|
-
$[50] = t10;
|
|
262
|
-
$[51] = t12;
|
|
263
|
-
$[52] = t18;
|
|
264
|
-
$[53] = t21;
|
|
265
|
-
$[54] = t22;
|
|
266
|
-
$[55] = t24;
|
|
267
|
-
$[56] = t9;
|
|
268
|
-
$[57] = t25;
|
|
269
|
-
} else {
|
|
270
|
-
t25 = $[57];
|
|
271
|
-
}
|
|
272
|
-
return t25;
|
|
111
|
+
}), /*#__PURE__*/_jsx(LiveStatus, {
|
|
112
|
+
message: showErrors && errorCount > 0 ? errorSummary(errorCount) : ""
|
|
113
|
+
})]
|
|
114
|
+
});
|
|
273
115
|
}
|
|
@@ -1,268 +1,85 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { Checkbox, Input, Label, NativeSelect, NativeSelectOption } from "@locusgraph/components";
|
|
3
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
function describedBy(id, field, error) {
|
|
5
4
|
const ids = [field.description && `${id}-hint`, error && `${id}-error`].filter(Boolean);
|
|
6
5
|
return ids.length > 0 ? ids.join(" ") : undefined;
|
|
7
6
|
}
|
|
8
|
-
function FieldControl(
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function FieldControl({
|
|
8
|
+
id,
|
|
9
|
+
field,
|
|
10
|
+
draft,
|
|
11
|
+
error,
|
|
12
|
+
onChange
|
|
13
|
+
}) {
|
|
14
|
+
const shared = {
|
|
11
15
|
id,
|
|
12
|
-
field,
|
|
13
|
-
|
|
14
|
-
error,
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
const t1 = field.name;
|
|
18
|
-
const t2 = error ? true : undefined;
|
|
19
|
-
let t3;
|
|
20
|
-
if ($[0] !== error || $[1] !== field || $[2] !== id) {
|
|
21
|
-
t3 = describedBy(id, field, error);
|
|
22
|
-
$[0] = error;
|
|
23
|
-
$[1] = field;
|
|
24
|
-
$[2] = id;
|
|
25
|
-
$[3] = t3;
|
|
26
|
-
} else {
|
|
27
|
-
t3 = $[3];
|
|
28
|
-
}
|
|
29
|
-
const t4 = field.required || undefined;
|
|
30
|
-
let t5;
|
|
31
|
-
if ($[4] !== field.name || $[5] !== id || $[6] !== t2 || $[7] !== t3 || $[8] !== t4) {
|
|
32
|
-
t5 = {
|
|
33
|
-
id,
|
|
34
|
-
name: t1,
|
|
35
|
-
"aria-invalid": t2,
|
|
36
|
-
"aria-describedby": t3,
|
|
37
|
-
"aria-required": t4
|
|
38
|
-
};
|
|
39
|
-
$[4] = field.name;
|
|
40
|
-
$[5] = id;
|
|
41
|
-
$[6] = t2;
|
|
42
|
-
$[7] = t3;
|
|
43
|
-
$[8] = t4;
|
|
44
|
-
$[9] = t5;
|
|
45
|
-
} else {
|
|
46
|
-
t5 = $[9];
|
|
47
|
-
}
|
|
48
|
-
const shared = t5;
|
|
16
|
+
name: field.name,
|
|
17
|
+
"aria-invalid": error ? true : undefined,
|
|
18
|
+
"aria-describedby": describedBy(id, field, error),
|
|
19
|
+
"aria-required": field.required || undefined
|
|
20
|
+
};
|
|
49
21
|
if (field.type === "boolean") {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
$[11] = t7;
|
|
56
|
-
} else {
|
|
57
|
-
t7 = $[11];
|
|
58
|
-
}
|
|
59
|
-
let t8;
|
|
60
|
-
if ($[12] !== shared || $[13] !== t6 || $[14] !== t7) {
|
|
61
|
-
t8 = /*#__PURE__*/_jsx(Checkbox, {
|
|
62
|
-
...shared,
|
|
63
|
-
checked: t6,
|
|
64
|
-
onCheckedChange: t7
|
|
65
|
-
});
|
|
66
|
-
$[12] = shared;
|
|
67
|
-
$[13] = t6;
|
|
68
|
-
$[14] = t7;
|
|
69
|
-
$[15] = t8;
|
|
70
|
-
} else {
|
|
71
|
-
t8 = $[15];
|
|
72
|
-
}
|
|
73
|
-
return t8;
|
|
22
|
+
return /*#__PURE__*/_jsx(Checkbox, {
|
|
23
|
+
...shared,
|
|
24
|
+
checked: draft === true,
|
|
25
|
+
onCheckedChange: checked => onChange(checked === true)
|
|
26
|
+
});
|
|
74
27
|
}
|
|
75
28
|
const text = typeof draft === "string" ? draft : "";
|
|
76
29
|
if (field.type === "select") {
|
|
77
|
-
|
|
78
|
-
if ($[16] !== onChange) {
|
|
79
|
-
t6 = event => onChange(event.target.value);
|
|
80
|
-
$[16] = onChange;
|
|
81
|
-
$[17] = t6;
|
|
82
|
-
} else {
|
|
83
|
-
t6 = $[17];
|
|
84
|
-
}
|
|
85
|
-
let t7;
|
|
86
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
87
|
-
t7 = /*#__PURE__*/_jsx(NativeSelectOption, {
|
|
88
|
-
value: "",
|
|
89
|
-
children: "Choose\u2026"
|
|
90
|
-
});
|
|
91
|
-
$[18] = t7;
|
|
92
|
-
} else {
|
|
93
|
-
t7 = $[18];
|
|
94
|
-
}
|
|
95
|
-
let t8;
|
|
96
|
-
if ($[19] !== field.options) {
|
|
97
|
-
t8 = field.options ?? [];
|
|
98
|
-
$[19] = field.options;
|
|
99
|
-
$[20] = t8;
|
|
100
|
-
} else {
|
|
101
|
-
t8 = $[20];
|
|
102
|
-
}
|
|
103
|
-
let t9;
|
|
104
|
-
if ($[21] !== t8) {
|
|
105
|
-
t9 = t8.map(_temp);
|
|
106
|
-
$[21] = t8;
|
|
107
|
-
$[22] = t9;
|
|
108
|
-
} else {
|
|
109
|
-
t9 = $[22];
|
|
110
|
-
}
|
|
111
|
-
let t10;
|
|
112
|
-
if ($[23] !== shared || $[24] !== t6 || $[25] !== t9 || $[26] !== text) {
|
|
113
|
-
t10 = /*#__PURE__*/_jsxs(NativeSelect, {
|
|
114
|
-
...shared,
|
|
115
|
-
value: text,
|
|
116
|
-
onChange: t6,
|
|
117
|
-
children: [t7, t9]
|
|
118
|
-
});
|
|
119
|
-
$[23] = shared;
|
|
120
|
-
$[24] = t6;
|
|
121
|
-
$[25] = t9;
|
|
122
|
-
$[26] = text;
|
|
123
|
-
$[27] = t10;
|
|
124
|
-
} else {
|
|
125
|
-
t10 = $[27];
|
|
126
|
-
}
|
|
127
|
-
return t10;
|
|
128
|
-
}
|
|
129
|
-
const t6 = field.type === "number" ? "number" : "text";
|
|
130
|
-
const t7 = field.type === "number" ? "decimal" : undefined;
|
|
131
|
-
let t8;
|
|
132
|
-
if ($[28] !== onChange) {
|
|
133
|
-
t8 = event_0 => onChange(event_0.target.value);
|
|
134
|
-
$[28] = onChange;
|
|
135
|
-
$[29] = t8;
|
|
136
|
-
} else {
|
|
137
|
-
t8 = $[29];
|
|
138
|
-
}
|
|
139
|
-
let t9;
|
|
140
|
-
if ($[30] !== field.max || $[31] !== field.min || $[32] !== shared || $[33] !== t6 || $[34] !== t7 || $[35] !== t8 || $[36] !== text) {
|
|
141
|
-
t9 = /*#__PURE__*/_jsx(Input, {
|
|
30
|
+
return /*#__PURE__*/_jsxs(NativeSelect, {
|
|
142
31
|
...shared,
|
|
143
|
-
type: t6,
|
|
144
|
-
inputMode: t7,
|
|
145
|
-
min: field.min,
|
|
146
|
-
max: field.max,
|
|
147
32
|
value: text,
|
|
148
|
-
onChange:
|
|
33
|
+
onChange: event => onChange(event.target.value),
|
|
34
|
+
children: [/*#__PURE__*/_jsx(NativeSelectOption, {
|
|
35
|
+
value: "",
|
|
36
|
+
children: "Choose\u2026"
|
|
37
|
+
}), (field.options ?? []).map(option => /*#__PURE__*/_jsx(NativeSelectOption, {
|
|
38
|
+
value: option.value,
|
|
39
|
+
children: option.label
|
|
40
|
+
}, option.value))]
|
|
149
41
|
});
|
|
150
|
-
$[30] = field.max;
|
|
151
|
-
$[31] = field.min;
|
|
152
|
-
$[32] = shared;
|
|
153
|
-
$[33] = t6;
|
|
154
|
-
$[34] = t7;
|
|
155
|
-
$[35] = t8;
|
|
156
|
-
$[36] = text;
|
|
157
|
-
$[37] = t9;
|
|
158
|
-
} else {
|
|
159
|
-
t9 = $[37];
|
|
160
42
|
}
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
43
|
+
return /*#__PURE__*/_jsx(Input, {
|
|
44
|
+
...shared,
|
|
45
|
+
type: field.type === "number" ? "number" : "text",
|
|
46
|
+
inputMode: field.type === "number" ? "decimal" : undefined,
|
|
47
|
+
min: field.min,
|
|
48
|
+
max: field.max,
|
|
49
|
+
value: text,
|
|
50
|
+
onChange: event => onChange(event.target.value)
|
|
51
|
+
});
|
|
168
52
|
}
|
|
169
53
|
export function ArgsField(props) {
|
|
170
|
-
const $ = _c(23);
|
|
171
54
|
const {
|
|
172
55
|
id,
|
|
173
56
|
field,
|
|
174
57
|
error
|
|
175
58
|
} = props;
|
|
176
59
|
const inline = field.type === "boolean";
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
children: [field.label, t1]
|
|
194
|
-
});
|
|
195
|
-
$[2] = field.label;
|
|
196
|
-
$[3] = id;
|
|
197
|
-
$[4] = t1;
|
|
198
|
-
$[5] = t2;
|
|
199
|
-
} else {
|
|
200
|
-
t2 = $[5];
|
|
201
|
-
}
|
|
202
|
-
let t3;
|
|
203
|
-
if ($[6] !== props) {
|
|
204
|
-
t3 = /*#__PURE__*/_jsx(FieldControl, {
|
|
205
|
-
...props
|
|
206
|
-
});
|
|
207
|
-
$[6] = props;
|
|
208
|
-
$[7] = t3;
|
|
209
|
-
} else {
|
|
210
|
-
t3 = $[7];
|
|
211
|
-
}
|
|
212
|
-
let t4;
|
|
213
|
-
if ($[8] !== t0 || $[9] !== t2 || $[10] !== t3) {
|
|
214
|
-
t4 = /*#__PURE__*/_jsxs("div", {
|
|
215
|
-
className: t0,
|
|
216
|
-
children: [t2, t3]
|
|
217
|
-
});
|
|
218
|
-
$[8] = t0;
|
|
219
|
-
$[9] = t2;
|
|
220
|
-
$[10] = t3;
|
|
221
|
-
$[11] = t4;
|
|
222
|
-
} else {
|
|
223
|
-
t4 = $[11];
|
|
224
|
-
}
|
|
225
|
-
let t5;
|
|
226
|
-
if ($[12] !== field.description || $[13] !== id) {
|
|
227
|
-
t5 = field.description && /*#__PURE__*/_jsx("p", {
|
|
60
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
61
|
+
"data-slot": "args-field",
|
|
62
|
+
"data-type": field.type,
|
|
63
|
+
className: "flex flex-col gap-1.5 [&_[data-slot=native-select-wrapper]]:w-full",
|
|
64
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
65
|
+
className: inline ? "flex flex-row-reverse items-center justify-end gap-2" : "contents",
|
|
66
|
+
children: [/*#__PURE__*/_jsxs(Label, {
|
|
67
|
+
htmlFor: id,
|
|
68
|
+
children: [field.label, field.required && /*#__PURE__*/_jsx("span", {
|
|
69
|
+
className: "text-xs font-normal text-muted-foreground",
|
|
70
|
+
children: "required"
|
|
71
|
+
})]
|
|
72
|
+
}), /*#__PURE__*/_jsx(FieldControl, {
|
|
73
|
+
...props
|
|
74
|
+
})]
|
|
75
|
+
}), field.description && /*#__PURE__*/_jsx("p", {
|
|
228
76
|
id: `${id}-hint`,
|
|
229
77
|
className: "text-xs text-muted-foreground",
|
|
230
78
|
children: field.description
|
|
231
|
-
})
|
|
232
|
-
$[12] = field.description;
|
|
233
|
-
$[13] = id;
|
|
234
|
-
$[14] = t5;
|
|
235
|
-
} else {
|
|
236
|
-
t5 = $[14];
|
|
237
|
-
}
|
|
238
|
-
let t6;
|
|
239
|
-
if ($[15] !== error || $[16] !== id) {
|
|
240
|
-
t6 = error && /*#__PURE__*/_jsx("p", {
|
|
79
|
+
}), error && /*#__PURE__*/_jsx("p", {
|
|
241
80
|
id: `${id}-error`,
|
|
242
81
|
className: "text-xs text-destructive",
|
|
243
82
|
children: error
|
|
244
|
-
})
|
|
245
|
-
|
|
246
|
-
$[16] = id;
|
|
247
|
-
$[17] = t6;
|
|
248
|
-
} else {
|
|
249
|
-
t6 = $[17];
|
|
250
|
-
}
|
|
251
|
-
let t7;
|
|
252
|
-
if ($[18] !== field.type || $[19] !== t4 || $[20] !== t5 || $[21] !== t6) {
|
|
253
|
-
t7 = /*#__PURE__*/_jsxs("div", {
|
|
254
|
-
"data-slot": "args-field",
|
|
255
|
-
"data-type": field.type,
|
|
256
|
-
className: "flex flex-col gap-1.5 [&_[data-slot=native-select-wrapper]]:w-full",
|
|
257
|
-
children: [t4, t5, t6]
|
|
258
|
-
});
|
|
259
|
-
$[18] = field.type;
|
|
260
|
-
$[19] = t4;
|
|
261
|
-
$[20] = t5;
|
|
262
|
-
$[21] = t6;
|
|
263
|
-
$[22] = t7;
|
|
264
|
-
} else {
|
|
265
|
-
t7 = $[22];
|
|
266
|
-
}
|
|
267
|
-
return t7;
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
268
85
|
}
|