@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 { ArrowRight as ArrowRightIcon, ListChecked as ListChecksIcon } from "@carbon/icons-react";
|
|
3
2
|
import { Button } from "@locusgraph/components";
|
|
4
3
|
import { pluralize } from "@locusgraph/utils";
|
|
@@ -9,174 +8,75 @@ import { useFocusOnMount } from "../shared/use-focus-on-mount.js";
|
|
|
9
8
|
import { PlanStepRow, stepControlId } from "./plan-step-row.js";
|
|
10
9
|
import { applyStepAction, describeStepAction, focusAfterAction } from "./plan-steps.js";
|
|
11
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
12
|
-
function DecidedSteps(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
className: "flex flex-col gap-1 pl-6.5 text-sm text-muted-foreground",
|
|
29
|
-
children: t1
|
|
30
|
-
});
|
|
31
|
-
$[2] = t1;
|
|
32
|
-
$[3] = t2;
|
|
33
|
-
} else {
|
|
34
|
-
t2 = $[3];
|
|
35
|
-
}
|
|
36
|
-
return t2;
|
|
37
|
-
}
|
|
38
|
-
function _temp(step, position) {
|
|
39
|
-
return /*#__PURE__*/_jsxs("li", {
|
|
40
|
-
className: "flex gap-3",
|
|
41
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
42
|
-
className: "w-4 shrink-0 font-mono text-xs leading-5 tabular-nums",
|
|
43
|
-
children: position + 1
|
|
44
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
45
|
-
className: "min-w-0",
|
|
46
|
-
children: step.title
|
|
47
|
-
})]
|
|
48
|
-
}, step.id);
|
|
11
|
+
function DecidedSteps({
|
|
12
|
+
steps
|
|
13
|
+
}) {
|
|
14
|
+
return /*#__PURE__*/_jsx("ol", {
|
|
15
|
+
className: "flex flex-col gap-1 pl-6.5 text-sm text-muted-foreground",
|
|
16
|
+
children: steps.map((step, position) => /*#__PURE__*/_jsxs("li", {
|
|
17
|
+
className: "flex gap-3",
|
|
18
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
19
|
+
className: "w-4 shrink-0 font-mono text-xs leading-5 tabular-nums",
|
|
20
|
+
children: position + 1
|
|
21
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
22
|
+
className: "min-w-0",
|
|
23
|
+
children: step.title
|
|
24
|
+
})]
|
|
25
|
+
}, step.id))
|
|
26
|
+
});
|
|
49
27
|
}
|
|
50
|
-
export function PlanReview(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
className
|
|
62
|
-
} = t0;
|
|
63
|
-
const title = t1 === undefined ? "Review the plan" : t1;
|
|
64
|
-
const description = t2 === undefined ? "The agent will run these steps in order. Edit, reorder or remove steps before it starts." : t2;
|
|
65
|
-
const autoFocus = t3 === undefined ? true : t3;
|
|
28
|
+
export function PlanReview({
|
|
29
|
+
steps: initialSteps,
|
|
30
|
+
title = "Review the plan",
|
|
31
|
+
description = "The agent will run these steps in order. Edit, reorder or remove steps before it starts.",
|
|
32
|
+
actionLabel,
|
|
33
|
+
decision,
|
|
34
|
+
onApprove,
|
|
35
|
+
onCancel,
|
|
36
|
+
autoFocus = true,
|
|
37
|
+
className
|
|
38
|
+
}) {
|
|
66
39
|
const idPrefix = useId();
|
|
67
40
|
const [steps, setSteps] = useState(initialSteps);
|
|
68
41
|
const [announcement, setAnnouncement] = useState("");
|
|
69
42
|
const [pendingFocus, setPendingFocus] = useState(null);
|
|
70
43
|
const approveRef = useFocusOnMount(autoFocus && !decision);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
t5 = () => {
|
|
84
|
-
if (pendingFocus) {
|
|
85
|
-
document.getElementById(pendingFocus.id)?.focus();
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
t6 = [pendingFocus];
|
|
89
|
-
$[2] = pendingFocus;
|
|
90
|
-
$[3] = t5;
|
|
91
|
-
$[4] = t6;
|
|
92
|
-
} else {
|
|
93
|
-
t5 = $[3];
|
|
94
|
-
t6 = $[4];
|
|
95
|
-
}
|
|
96
|
-
useEffect(t5, t6);
|
|
97
|
-
let t7;
|
|
98
|
-
if ($[5] !== idPrefix || $[6] !== steps) {
|
|
99
|
-
t7 = function handleAction(stepId, position, action) {
|
|
100
|
-
const next = applyStepAction(steps, stepId, action);
|
|
101
|
-
const focus = focusAfterAction(next, stepId, action);
|
|
102
|
-
setSteps(next);
|
|
103
|
-
setAnnouncement(describeStepAction(position, action));
|
|
104
|
-
setPendingFocus(focus ? {
|
|
105
|
-
id: stepControlId(idPrefix, focus.stepId, focus.control)
|
|
106
|
-
} : null);
|
|
107
|
-
};
|
|
108
|
-
$[5] = idPrefix;
|
|
109
|
-
$[6] = steps;
|
|
110
|
-
$[7] = t7;
|
|
111
|
-
} else {
|
|
112
|
-
t7 = $[7];
|
|
113
|
-
}
|
|
114
|
-
const handleAction = t7;
|
|
115
|
-
let t8;
|
|
116
|
-
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
117
|
-
t8 = function renameStep(stepId_0, nextTitle) {
|
|
118
|
-
setSteps(current => current.map(item => item.id === stepId_0 ? {
|
|
119
|
-
...item,
|
|
120
|
-
title: nextTitle
|
|
121
|
-
} : item));
|
|
122
|
-
};
|
|
123
|
-
$[8] = t8;
|
|
124
|
-
} else {
|
|
125
|
-
t8 = $[8];
|
|
126
|
-
}
|
|
127
|
-
const renameStep = t8;
|
|
128
|
-
const t9 = decision ? true : undefined;
|
|
129
|
-
let t10;
|
|
130
|
-
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
131
|
-
t10 = /*#__PURE__*/_jsx(ListChecksIcon, {
|
|
132
|
-
"aria-hidden": true
|
|
133
|
-
});
|
|
134
|
-
$[9] = t10;
|
|
135
|
-
} else {
|
|
136
|
-
t10 = $[9];
|
|
44
|
+
const hasBlankTitle = steps.some(step => step.title.trim() === "");
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (pendingFocus) document.getElementById(pendingFocus.id)?.focus();
|
|
47
|
+
}, [pendingFocus]);
|
|
48
|
+
function handleAction(stepId, position, action) {
|
|
49
|
+
const next = applyStepAction(steps, stepId, action);
|
|
50
|
+
const focus = focusAfterAction(next, stepId, action);
|
|
51
|
+
setSteps(next);
|
|
52
|
+
setAnnouncement(describeStepAction(position, action));
|
|
53
|
+
setPendingFocus(focus ? {
|
|
54
|
+
id: stepControlId(idPrefix, focus.stepId, focus.control)
|
|
55
|
+
} : null);
|
|
137
56
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
$[10] = steps.length;
|
|
144
|
-
$[11] = t13;
|
|
145
|
-
} else {
|
|
146
|
-
t13 = $[11];
|
|
57
|
+
function renameStep(stepId, nextTitle) {
|
|
58
|
+
setSteps(current => current.map(item => item.id === stepId ? {
|
|
59
|
+
...item,
|
|
60
|
+
title: nextTitle
|
|
61
|
+
} : item));
|
|
147
62
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
63
|
+
return /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
64
|
+
"data-slot": "plan-review",
|
|
65
|
+
"data-decided": decision ? true : undefined,
|
|
66
|
+
"aria-label": title,
|
|
67
|
+
className: className,
|
|
68
|
+
children: [/*#__PURE__*/_jsx(PanelHeader, {
|
|
69
|
+
icon: /*#__PURE__*/_jsx(ListChecksIcon, {
|
|
70
|
+
"aria-hidden": true
|
|
71
|
+
}),
|
|
152
72
|
eyebrow: "Plan",
|
|
153
|
-
status:
|
|
154
|
-
tone:
|
|
155
|
-
aside:
|
|
156
|
-
})
|
|
157
|
-
|
|
158
|
-
$[13] = t12;
|
|
159
|
-
$[14] = t13;
|
|
160
|
-
$[15] = t14;
|
|
161
|
-
} else {
|
|
162
|
-
t14 = $[15];
|
|
163
|
-
}
|
|
164
|
-
const t15 = decision ? "text-muted-foreground" : undefined;
|
|
165
|
-
let t16;
|
|
166
|
-
if ($[16] !== t15 || $[17] !== title) {
|
|
167
|
-
t16 = /*#__PURE__*/_jsx(PanelTitle, {
|
|
168
|
-
className: t15,
|
|
73
|
+
status: decision ? decision.approved ? "Approved" : "Cancelled" : "Waiting for you",
|
|
74
|
+
tone: decision ? decision.approved ? "done" : "danger" : "waiting",
|
|
75
|
+
aside: pluralize(steps.length, "step")
|
|
76
|
+
}), /*#__PURE__*/_jsx(PanelTitle, {
|
|
77
|
+
className: decision ? "text-muted-foreground" : undefined,
|
|
169
78
|
children: title
|
|
170
|
-
})
|
|
171
|
-
$[16] = t15;
|
|
172
|
-
$[17] = title;
|
|
173
|
-
$[18] = t16;
|
|
174
|
-
} else {
|
|
175
|
-
t16 = $[18];
|
|
176
|
-
}
|
|
177
|
-
let t17;
|
|
178
|
-
if ($[19] !== actionLabel || $[20] !== approveRef || $[21] !== decision || $[22] !== description || $[23] !== handleAction || $[24] !== hasBlankTitle || $[25] !== idPrefix || $[26] !== initialSteps || $[27] !== onApprove || $[28] !== onCancel || $[29] !== steps) {
|
|
179
|
-
t17 = decision ? /*#__PURE__*/_jsxs(PanelBody, {
|
|
79
|
+
}), decision ? /*#__PURE__*/_jsxs(PanelBody, {
|
|
180
80
|
children: [/*#__PURE__*/_jsx(DecisionSummary, {
|
|
181
81
|
decision: decision,
|
|
182
82
|
deniedVerb: "Cancelled",
|
|
@@ -192,14 +92,14 @@ export function PlanReview(t0) {
|
|
|
192
92
|
className: "pb-0",
|
|
193
93
|
children: /*#__PURE__*/_jsx("ol", {
|
|
194
94
|
className: "-mx-5 flex flex-col divide-y border-t",
|
|
195
|
-
children: steps.map((
|
|
95
|
+
children: steps.map((step, position) => /*#__PURE__*/_jsx(PlanStepRow, {
|
|
196
96
|
idPrefix: idPrefix,
|
|
197
|
-
step:
|
|
198
|
-
position:
|
|
97
|
+
step: step,
|
|
98
|
+
position: position,
|
|
199
99
|
count: steps.length,
|
|
200
|
-
onRename:
|
|
201
|
-
onAction:
|
|
202
|
-
},
|
|
100
|
+
onRename: nextTitle => renameStep(step.id, nextTitle),
|
|
101
|
+
onAction: action => handleAction(step.id, position, action)
|
|
102
|
+
}, step.id))
|
|
203
103
|
})
|
|
204
104
|
}), /*#__PURE__*/_jsxs(PanelFooter, {
|
|
205
105
|
className: "justify-between",
|
|
@@ -222,68 +122,18 @@ export function PlanReview(t0) {
|
|
|
222
122
|
type: "button",
|
|
223
123
|
size: "sm",
|
|
224
124
|
disabled: hasBlankTitle || steps.length === 0,
|
|
225
|
-
onClick: () => onApprove(steps.map(
|
|
125
|
+
onClick: () => onApprove(steps.map(step => ({
|
|
126
|
+
...step,
|
|
127
|
+
title: step.title.trim()
|
|
128
|
+
}))),
|
|
226
129
|
children: [actionLabel ?? `Run ${pluralize(steps.length, "step")}`, /*#__PURE__*/_jsx(ArrowRightIcon, {
|
|
227
130
|
"aria-hidden": true
|
|
228
131
|
})]
|
|
229
132
|
})]
|
|
230
133
|
})]
|
|
231
134
|
})]
|
|
232
|
-
})
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
$[22] = description;
|
|
237
|
-
$[23] = handleAction;
|
|
238
|
-
$[24] = hasBlankTitle;
|
|
239
|
-
$[25] = idPrefix;
|
|
240
|
-
$[26] = initialSteps;
|
|
241
|
-
$[27] = onApprove;
|
|
242
|
-
$[28] = onCancel;
|
|
243
|
-
$[29] = steps;
|
|
244
|
-
$[30] = t17;
|
|
245
|
-
} else {
|
|
246
|
-
t17 = $[30];
|
|
247
|
-
}
|
|
248
|
-
const t18 = decision ? decision.approved ? "Plan approved" : "Plan cancelled" : announcement;
|
|
249
|
-
let t19;
|
|
250
|
-
if ($[31] !== t18) {
|
|
251
|
-
t19 = /*#__PURE__*/_jsx(LiveStatus, {
|
|
252
|
-
message: t18
|
|
253
|
-
});
|
|
254
|
-
$[31] = t18;
|
|
255
|
-
$[32] = t19;
|
|
256
|
-
} else {
|
|
257
|
-
t19 = $[32];
|
|
258
|
-
}
|
|
259
|
-
let t20;
|
|
260
|
-
if ($[33] !== className || $[34] !== t14 || $[35] !== t16 || $[36] !== t17 || $[37] !== t19 || $[38] !== t9 || $[39] !== title) {
|
|
261
|
-
t20 = /*#__PURE__*/_jsxs(ApprovalPanel, {
|
|
262
|
-
"data-slot": "plan-review",
|
|
263
|
-
"data-decided": t9,
|
|
264
|
-
"aria-label": title,
|
|
265
|
-
className: className,
|
|
266
|
-
children: [t14, t16, t17, t19]
|
|
267
|
-
});
|
|
268
|
-
$[33] = className;
|
|
269
|
-
$[34] = t14;
|
|
270
|
-
$[35] = t16;
|
|
271
|
-
$[36] = t17;
|
|
272
|
-
$[37] = t19;
|
|
273
|
-
$[38] = t9;
|
|
274
|
-
$[39] = title;
|
|
275
|
-
$[40] = t20;
|
|
276
|
-
} else {
|
|
277
|
-
t20 = $[40];
|
|
278
|
-
}
|
|
279
|
-
return t20;
|
|
280
|
-
}
|
|
281
|
-
function _temp3(step_1) {
|
|
282
|
-
return {
|
|
283
|
-
...step_1,
|
|
284
|
-
title: step_1.title.trim()
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
function _temp2(step) {
|
|
288
|
-
return step.title.trim() === "";
|
|
135
|
+
}), /*#__PURE__*/_jsx(LiveStatus, {
|
|
136
|
+
message: decision ? decision.approved ? "Plan approved" : "Plan cancelled" : announcement
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
289
139
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { ArrowDown as ArrowDownIcon, ArrowUp as ArrowUpIcon, Edit as PencilIcon, TrashCan as Trash2Icon } from "@carbon/icons-react";
|
|
3
2
|
import { Button, cn } from "@locusgraph/components";
|
|
4
3
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -12,190 +11,87 @@ function selectInputById(id) {
|
|
|
12
11
|
element.select();
|
|
13
12
|
}
|
|
14
13
|
}
|
|
15
|
-
export function PlanStepRow(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
onAction
|
|
24
|
-
} = t0;
|
|
14
|
+
export function PlanStepRow({
|
|
15
|
+
idPrefix,
|
|
16
|
+
step,
|
|
17
|
+
position,
|
|
18
|
+
count,
|
|
19
|
+
onRename,
|
|
20
|
+
onAction
|
|
21
|
+
}) {
|
|
25
22
|
const number = position + 1;
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
id: stepControlId(idPrefix, step.id, "remove"),
|
|
63
|
-
label: `Remove step ${number}`,
|
|
64
|
-
icon: Trash2Icon,
|
|
65
|
-
disabled: count === 1,
|
|
66
|
-
onClick: () => onAction("remove"),
|
|
67
|
-
danger: true
|
|
68
|
-
}];
|
|
69
|
-
t3 = "plan-step";
|
|
70
|
-
t4 = "group flex items-start gap-3 px-5 py-2.5 focus-within:bg-accent/50 hover:bg-accent/50 motion-safe:transition-colors";
|
|
71
|
-
if ($[17] !== number) {
|
|
72
|
-
t5 = /*#__PURE__*/_jsx("span", {
|
|
73
|
-
"aria-hidden": true,
|
|
74
|
-
className: "mt-0.5 flex size-5 shrink-0 items-center justify-center font-mono text-[11px] text-muted-foreground tabular-nums ring-1 ring-input",
|
|
75
|
-
children: number
|
|
76
|
-
});
|
|
77
|
-
$[17] = number;
|
|
78
|
-
$[18] = t5;
|
|
79
|
-
} else {
|
|
80
|
-
t5 = $[18];
|
|
81
|
-
}
|
|
82
|
-
const t8 = step.title;
|
|
83
|
-
let t9;
|
|
84
|
-
if ($[19] !== onRename) {
|
|
85
|
-
t9 = event => onRename(event.target.value);
|
|
86
|
-
$[19] = onRename;
|
|
87
|
-
$[20] = t9;
|
|
88
|
-
} else {
|
|
89
|
-
t9 = $[20];
|
|
90
|
-
}
|
|
91
|
-
const t10 = blank && "ring-1 ring-destructive/70";
|
|
92
|
-
let t11;
|
|
93
|
-
if ($[21] !== t10) {
|
|
94
|
-
t11 = cn("-mx-1.5 h-6 min-w-0 bg-transparent px-1.5 text-sm font-medium outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring", t10);
|
|
95
|
-
$[21] = t10;
|
|
96
|
-
$[22] = t11;
|
|
97
|
-
} else {
|
|
98
|
-
t11 = $[22];
|
|
99
|
-
}
|
|
100
|
-
let t12;
|
|
101
|
-
if ($[23] !== step.detail) {
|
|
102
|
-
t12 = step.detail && /*#__PURE__*/_jsx("p", {
|
|
103
|
-
className: "text-xs text-muted-foreground",
|
|
104
|
-
children: step.detail
|
|
105
|
-
});
|
|
106
|
-
$[23] = step.detail;
|
|
107
|
-
$[24] = t12;
|
|
108
|
-
} else {
|
|
109
|
-
t12 = $[24];
|
|
110
|
-
}
|
|
111
|
-
t6 = /*#__PURE__*/_jsxs("div", {
|
|
23
|
+
const titleId = stepControlId(idPrefix, step.id, "title");
|
|
24
|
+
const blank = step.title.trim() === "";
|
|
25
|
+
const controls = [{
|
|
26
|
+
id: `${idPrefix}-${step.id}-edit`,
|
|
27
|
+
label: `Edit step ${number}`,
|
|
28
|
+
icon: PencilIcon,
|
|
29
|
+
disabled: false,
|
|
30
|
+
onClick: () => selectInputById(titleId)
|
|
31
|
+
}, {
|
|
32
|
+
id: stepControlId(idPrefix, step.id, "up"),
|
|
33
|
+
label: `Move step ${number} up`,
|
|
34
|
+
icon: ArrowUpIcon,
|
|
35
|
+
disabled: position === 0,
|
|
36
|
+
onClick: () => onAction("up")
|
|
37
|
+
}, {
|
|
38
|
+
id: stepControlId(idPrefix, step.id, "down"),
|
|
39
|
+
label: `Move step ${number} down`,
|
|
40
|
+
icon: ArrowDownIcon,
|
|
41
|
+
disabled: position === count - 1,
|
|
42
|
+
onClick: () => onAction("down")
|
|
43
|
+
}, {
|
|
44
|
+
id: stepControlId(idPrefix, step.id, "remove"),
|
|
45
|
+
label: `Remove step ${number}`,
|
|
46
|
+
icon: Trash2Icon,
|
|
47
|
+
disabled: count === 1,
|
|
48
|
+
onClick: () => onAction("remove"),
|
|
49
|
+
danger: true
|
|
50
|
+
}];
|
|
51
|
+
return /*#__PURE__*/_jsxs("li", {
|
|
52
|
+
"data-slot": "plan-step",
|
|
53
|
+
className: "group flex items-start gap-3 px-5 py-2.5 focus-within:bg-accent/50 hover:bg-accent/50 motion-safe:transition-colors",
|
|
54
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
55
|
+
"aria-hidden": true,
|
|
56
|
+
className: "mt-0.5 flex size-5 shrink-0 items-center justify-center font-mono text-[11px] text-muted-foreground tabular-nums ring-1 ring-input",
|
|
57
|
+
children: number
|
|
58
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
112
59
|
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
113
60
|
children: [/*#__PURE__*/_jsx("input", {
|
|
114
61
|
id: titleId,
|
|
115
62
|
"aria-label": `Step ${number} title`,
|
|
116
|
-
value:
|
|
63
|
+
value: step.title,
|
|
117
64
|
placeholder: "Name this step",
|
|
118
65
|
"aria-invalid": blank || undefined,
|
|
119
|
-
onChange:
|
|
120
|
-
className:
|
|
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
|
-
t7 = /*#__PURE__*/_jsx("div", {
|
|
151
|
-
className: t1,
|
|
152
|
-
children: t2
|
|
153
|
-
});
|
|
154
|
-
$[25] = t1;
|
|
155
|
-
$[26] = t2;
|
|
156
|
-
$[27] = t7;
|
|
157
|
-
} else {
|
|
158
|
-
t7 = $[27];
|
|
159
|
-
}
|
|
160
|
-
let t8;
|
|
161
|
-
if ($[28] !== t3 || $[29] !== t4 || $[30] !== t5 || $[31] !== t6 || $[32] !== t7) {
|
|
162
|
-
t8 = /*#__PURE__*/_jsxs("li", {
|
|
163
|
-
"data-slot": t3,
|
|
164
|
-
className: t4,
|
|
165
|
-
children: [t5, t6, t7]
|
|
166
|
-
});
|
|
167
|
-
$[28] = t3;
|
|
168
|
-
$[29] = t4;
|
|
169
|
-
$[30] = t5;
|
|
170
|
-
$[31] = t6;
|
|
171
|
-
$[32] = t7;
|
|
172
|
-
$[33] = t8;
|
|
173
|
-
} else {
|
|
174
|
-
t8 = $[33];
|
|
175
|
-
}
|
|
176
|
-
return t8;
|
|
177
|
-
}
|
|
178
|
-
function _temp(t0) {
|
|
179
|
-
const {
|
|
180
|
-
id,
|
|
181
|
-
label,
|
|
182
|
-
icon: Icon,
|
|
183
|
-
disabled,
|
|
184
|
-
onClick,
|
|
185
|
-
danger
|
|
186
|
-
} = t0;
|
|
187
|
-
return /*#__PURE__*/_jsx(Button, {
|
|
188
|
-
id: id,
|
|
189
|
-
type: "button",
|
|
190
|
-
variant: "ghost",
|
|
191
|
-
size: "icon-xs",
|
|
192
|
-
"aria-label": label,
|
|
193
|
-
title: label,
|
|
194
|
-
disabled: disabled,
|
|
195
|
-
onClick: onClick,
|
|
196
|
-
className: cn("text-muted-foreground hover:text-foreground", danger && "hover:text-destructive"),
|
|
197
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
198
|
-
"aria-hidden": true
|
|
199
|
-
})
|
|
200
|
-
}, id);
|
|
66
|
+
onChange: event => onRename(event.target.value),
|
|
67
|
+
className: cn("-mx-1.5 h-6 min-w-0 bg-transparent px-1.5 text-sm font-medium outline-none placeholder:font-normal placeholder:text-muted-foreground focus-visible:bg-background focus-visible:ring-1 focus-visible:ring-ring", blank && "ring-1 ring-destructive/70")
|
|
68
|
+
}), step.detail && /*#__PURE__*/_jsx("p", {
|
|
69
|
+
className: "text-xs text-muted-foreground",
|
|
70
|
+
children: step.detail
|
|
71
|
+
})]
|
|
72
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
73
|
+
className: "flex shrink-0 gap-0.5 sm:opacity-0 sm:group-focus-within:opacity-100 sm:group-hover:opacity-100 sm:motion-safe:transition-opacity",
|
|
74
|
+
children: controls.map(({
|
|
75
|
+
id,
|
|
76
|
+
label,
|
|
77
|
+
icon: Icon,
|
|
78
|
+
disabled,
|
|
79
|
+
onClick,
|
|
80
|
+
danger
|
|
81
|
+
}) => /*#__PURE__*/_jsx(Button, {
|
|
82
|
+
id: id,
|
|
83
|
+
type: "button",
|
|
84
|
+
variant: "ghost",
|
|
85
|
+
size: "icon-xs",
|
|
86
|
+
"aria-label": label,
|
|
87
|
+
title: label,
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
onClick: onClick,
|
|
90
|
+
className: cn("text-muted-foreground hover:text-foreground", danger && "hover:text-destructive"),
|
|
91
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
92
|
+
"aria-hidden": true
|
|
93
|
+
})
|
|
94
|
+
}, id))
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
201
97
|
}
|