@locusgraph/loop 0.3.1 → 0.4.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/agent/index.d.ts +1 -1
- package/dist/agent/pulse/gradient-label.js +6 -5
- package/dist/agent/pulse/marks/bars-mark.js +1 -1
- package/dist/agent/pulse/marks/glyph-mark.js +2 -2
- package/dist/agent/pulse/marks/locus-mark.js +1 -1
- package/dist/agent/pulse/pulse.js +1 -1
- package/dist/agent/pulse/use-loop-animation.d.ts +0 -1
- package/dist/agent/pulse/use-loop-animation.js +1 -3
- package/dist/agent/steps/step-icon.js +20 -13
- package/dist/agent/steps/steps.js +39 -37
- package/dist/agent/thinking/thinking.js +65 -62
- package/dist/agent/tool/json-block.js +10 -7
- package/dist/agent/tool/tool-status.d.ts +2 -0
- package/dist/agent/tool/tool-status.js +16 -13
- package/dist/agent/tool/tool.d.ts +8 -1
- package/dist/agent/tool/tool.js +238 -119
- package/dist/approval/inbox/inbox-row.d.ts +3 -3
- package/dist/approval/inbox/inbox-row.js +135 -200
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +180 -139
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +20 -21
- package/dist/approval/memory/memory-review.js +155 -154
- package/dist/approval/memory/memory-row.js +86 -87
- package/dist/approval/plan/plan-review.js +110 -129
- package/dist/approval/plan/plan-step-row.js +7 -6
- package/dist/approval/plan/plan-steps.d.ts +1 -1
- package/dist/approval/plan/plan-steps.js +2 -2
- package/dist/approval/plan/question-choices.js +10 -7
- package/dist/approval/plan/question.js +116 -112
- package/dist/approval/run/run-bar.js +43 -40
- package/dist/approval/shared/approval-line.d.ts +27 -0
- package/dist/approval/shared/approval-line.js +85 -0
- package/dist/approval/shared/risk-badge.d.ts +3 -5
- package/dist/approval/shared/risk-badge.js +11 -19
- package/dist/approval/shared/time.d.ts +0 -1
- package/dist/approval/shared/time.js +0 -1
- package/dist/approval/shared/use-focus-when-settled.d.ts +2 -0
- package/dist/approval/shared/use-focus-when-settled.js +18 -0
- package/dist/approval/spend/raise-cap-form.d.ts +2 -2
- package/dist/approval/spend/raise-cap-form.js +134 -126
- package/dist/approval/spend/spend-gate.js +133 -156
- package/dist/approval/spend/spend-math.d.ts +1 -0
- package/dist/approval/spend/spend-math.js +5 -2
- package/dist/approval/spend/spend-meter.js +5 -5
- package/dist/approval/tool/approval.js +114 -214
- package/dist/approval/tool/args/args-editor.js +147 -156
- package/dist/approval/tool/args/args-field.js +197 -109
- package/dist/approval/tool/deny-form.js +59 -66
- package/dist/approval/tool/tool-inputs.js +38 -45
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +1 -3
- package/dist/chat/composer/composer-actions.js +4 -1
- package/dist/chat/composer/composer.js +4 -3
- package/dist/chat/composer/use-auto-grow.js +14 -10
- package/dist/chat/files/files.js +12 -10
- package/dist/chat/reply/fenced-code.js +1 -1
- package/dist/chat/reply/markdown-components.js +9 -116
- package/dist/chat/reply/reply.js +2 -2
- package/dist/chat/turn/group-parts.d.ts +1 -0
- package/dist/chat/turn/group-parts.js +6 -3
- package/dist/chat/turn/turn.js +13 -4
- package/dist/cost/context.js +3 -3
- package/dist/cost/cost-steps.js +31 -30
- package/dist/cost/cost.js +39 -39
- package/dist/cost/model-picker.js +5 -4
- package/dist/cost/shared/context-breakdown.js +10 -11
- package/dist/cost/shared/model-option-row.js +4 -3
- package/dist/cost/shared/step-cost-row.js +11 -12
- package/dist/cost/shared/usage-totals.d.ts +1 -0
- package/dist/cost/shared/usage-totals.js +19 -1
- package/dist/memory/cite.js +55 -47
- package/dist/memory/memorized.js +123 -108
- package/dist/memory/recall.js +136 -146
- package/dist/memory/shared/host-label.d.ts +1 -1
- package/dist/memory/shared/host-label.js +2 -2
- package/dist/memory/shared/source-mark.js +1 -1
- package/dist/memory/sources.d.ts +2 -1
- package/dist/memory/sources.js +135 -100
- package/dist/shared/decision-summary.js +2 -1
- package/dist/shared/line.d.ts +10 -0
- package/dist/shared/line.js +11 -0
- package/dist/shared/live-status.d.ts +3 -0
- package/dist/shared/live-status.js +11 -0
- package/dist/shared/reduced-motion.d.ts +1 -0
- package/dist/shared/reduced-motion.js +3 -0
- package/dist/thread/actions/action-button.js +1 -1
- package/dist/thread/actions/actions.d.ts +3 -1
- package/dist/thread/actions/actions.js +100 -81
- package/dist/thread/actions/branch-switcher.js +67 -37
- package/dist/thread/canvas/canvas-meta.d.ts +9 -0
- package/dist/thread/canvas/canvas-meta.js +35 -0
- package/dist/thread/canvas/canvas.d.ts +1 -1
- package/dist/thread/canvas/canvas.js +64 -74
- package/dist/thread/canvas/version-switcher.d.ts +1 -0
- package/dist/thread/canvas/version-switcher.js +106 -87
- package/dist/thread/code/code.js +4 -6
- package/dist/thread/code/copy-code-button.d.ts +2 -1
- package/dist/thread/code/copy-code-button.js +56 -25
- package/dist/thread/history/history.d.ts +1 -1
- package/dist/thread/history/history.js +104 -104
- package/dist/thread/history/row/history-row.js +8 -5
- package/dist/thread/history/row/thread-item-menu.js +13 -4
- package/dist/thread/history/row/thread-title-editor.js +1 -1
- package/dist/thread/history/virtual-history-list.js +1 -2
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +5 -4
- package/package.json +6 -6
- package/dist/agent/shared/status-dot.d.ts +0 -1
- package/dist/agent/shared/status-dot.js +0 -1
- package/dist/approval/shared/decision-line.d.ts +0 -1
- package/dist/approval/shared/decision-line.js +0 -1
- package/dist/memory/shared/disclosure.d.ts +0 -6
- package/dist/memory/shared/disclosure.js +0 -6
- package/dist/shared/panel.d.ts +0 -19
- package/dist/shared/panel.js +0 -77
- package/dist/shared/status-dot.d.ts +0 -6
- package/dist/shared/status-dot.js +0 -20
package/dist/memory/cite.js
CHANGED
|
@@ -5,12 +5,12 @@ import { cn, HoverCard, HoverCardContent, HoverCardTrigger } from "@locusgraph/c
|
|
|
5
5
|
import { hostLabel } from "./shared/host-label.js";
|
|
6
6
|
import { SourceMark } from "./shared/source-mark.js";
|
|
7
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const pillClass = "inline-flex h-4 min-w-4 items-center justify-center bg-muted px-1
|
|
8
|
+
const pillClass = "inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-muted px-1 text-2xs leading-none font-medium text-muted-foreground tabular-nums no-underline transition-colors duration-150 locus-focus-ring hover:bg-interactive/15 hover:text-interactive data-[state=open]:bg-interactive/15 data-[state=open]:text-interactive motion-reduce:transition-none";
|
|
9
9
|
export function citationLabel(citation) {
|
|
10
10
|
return `Source ${citation.index}: ${citation.title}`;
|
|
11
11
|
}
|
|
12
12
|
export function Cite(t0) {
|
|
13
|
-
const $ = _c(
|
|
13
|
+
const $ = _c(37);
|
|
14
14
|
const {
|
|
15
15
|
citation,
|
|
16
16
|
onOpen,
|
|
@@ -60,133 +60,141 @@ export function Cite(t0) {
|
|
|
60
60
|
t5 = $[8];
|
|
61
61
|
}
|
|
62
62
|
let t6;
|
|
63
|
-
if ($[9] !== citation.index || $[10] !== citation.url || $[11] !== label || $[12] !== open) {
|
|
63
|
+
if ($[9] !== citation.index || $[10] !== citation.url || $[11] !== label || $[12] !== onOpen || $[13] !== open) {
|
|
64
64
|
t6 = /*#__PURE__*/_jsx(HoverCardTrigger, {
|
|
65
65
|
asChild: true,
|
|
66
66
|
children: citation.url ? /*#__PURE__*/_jsx("a", {
|
|
67
67
|
href: citation.url,
|
|
68
68
|
target: "_blank",
|
|
69
69
|
rel: "noreferrer",
|
|
70
|
-
"aria-label": label,
|
|
70
|
+
"aria-label": onOpen ? label : `${label}, opens in a new tab`,
|
|
71
71
|
onClick: open,
|
|
72
72
|
className: pillClass,
|
|
73
73
|
children: citation.index
|
|
74
|
-
}) : /*#__PURE__*/_jsx("button", {
|
|
74
|
+
}) : onOpen ? /*#__PURE__*/_jsx("button", {
|
|
75
75
|
type: "button",
|
|
76
76
|
"aria-label": label,
|
|
77
77
|
onClick: open,
|
|
78
78
|
className: pillClass,
|
|
79
79
|
children: citation.index
|
|
80
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
81
|
+
role: "note",
|
|
82
|
+
tabIndex: 0,
|
|
83
|
+
"aria-label": label,
|
|
84
|
+
className: pillClass,
|
|
85
|
+
children: citation.index
|
|
80
86
|
})
|
|
81
87
|
});
|
|
82
88
|
$[9] = citation.index;
|
|
83
89
|
$[10] = citation.url;
|
|
84
90
|
$[11] = label;
|
|
85
|
-
$[12] =
|
|
86
|
-
$[13] =
|
|
91
|
+
$[12] = onOpen;
|
|
92
|
+
$[13] = open;
|
|
93
|
+
$[14] = t6;
|
|
87
94
|
} else {
|
|
88
|
-
t6 = $[
|
|
95
|
+
t6 = $[14];
|
|
89
96
|
}
|
|
90
97
|
let t7;
|
|
91
|
-
if ($[
|
|
98
|
+
if ($[15] !== citation) {
|
|
92
99
|
t7 = /*#__PURE__*/_jsx(SourceMark, {
|
|
93
100
|
citation: citation
|
|
94
101
|
});
|
|
95
|
-
$[
|
|
96
|
-
$[
|
|
102
|
+
$[15] = citation;
|
|
103
|
+
$[16] = t7;
|
|
97
104
|
} else {
|
|
98
|
-
t7 = $[
|
|
105
|
+
t7 = $[16];
|
|
99
106
|
}
|
|
100
107
|
const t8 = host ?? "Source";
|
|
101
108
|
let t9;
|
|
102
|
-
if ($[
|
|
109
|
+
if ($[17] !== t8) {
|
|
103
110
|
t9 = /*#__PURE__*/_jsx("span", {
|
|
104
111
|
className: "truncate",
|
|
105
112
|
children: t8
|
|
106
113
|
});
|
|
107
|
-
$[
|
|
108
|
-
$[
|
|
114
|
+
$[17] = t8;
|
|
115
|
+
$[18] = t9;
|
|
109
116
|
} else {
|
|
110
|
-
t9 = $[
|
|
117
|
+
t9 = $[18];
|
|
111
118
|
}
|
|
112
119
|
let t10;
|
|
113
|
-
if ($[
|
|
120
|
+
if ($[19] !== t7 || $[20] !== t9) {
|
|
114
121
|
t10 = /*#__PURE__*/_jsxs("span", {
|
|
115
|
-
className: "
|
|
122
|
+
className: "flex min-w-0 items-center gap-2 text-xs text-faint",
|
|
116
123
|
children: [t7, t9]
|
|
117
124
|
});
|
|
118
|
-
$[
|
|
119
|
-
$[
|
|
120
|
-
$[
|
|
125
|
+
$[19] = t7;
|
|
126
|
+
$[20] = t9;
|
|
127
|
+
$[21] = t10;
|
|
121
128
|
} else {
|
|
122
|
-
t10 = $[
|
|
129
|
+
t10 = $[21];
|
|
123
130
|
}
|
|
124
131
|
let t11;
|
|
125
|
-
if ($[
|
|
132
|
+
if ($[22] !== citation.title) {
|
|
126
133
|
t11 = /*#__PURE__*/_jsx("span", {
|
|
127
134
|
className: "text-sm leading-snug font-medium",
|
|
128
135
|
children: citation.title
|
|
129
136
|
});
|
|
130
|
-
$[
|
|
131
|
-
$[
|
|
137
|
+
$[22] = citation.title;
|
|
138
|
+
$[23] = t11;
|
|
132
139
|
} else {
|
|
133
|
-
t11 = $[
|
|
140
|
+
t11 = $[23];
|
|
134
141
|
}
|
|
135
142
|
let t12;
|
|
136
|
-
if ($[
|
|
143
|
+
if ($[24] !== citation.snippet) {
|
|
137
144
|
t12 = citation.snippet && /*#__PURE__*/_jsx("p", {
|
|
138
145
|
className: "line-clamp-4 text-xs leading-relaxed text-muted-foreground",
|
|
139
146
|
children: citation.snippet
|
|
140
147
|
});
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
148
|
+
$[24] = citation.snippet;
|
|
149
|
+
$[25] = t12;
|
|
143
150
|
} else {
|
|
144
|
-
t12 = $[
|
|
151
|
+
t12 = $[25];
|
|
145
152
|
}
|
|
146
153
|
let t13;
|
|
147
|
-
if ($[
|
|
154
|
+
if ($[26] !== t10 || $[27] !== t11 || $[28] !== t12) {
|
|
148
155
|
t13 = /*#__PURE__*/_jsxs(HoverCardContent, {
|
|
149
156
|
"data-slot": "cite-card",
|
|
150
157
|
side: "bottom",
|
|
151
158
|
align: "start",
|
|
152
159
|
sideOffset: 6,
|
|
160
|
+
collisionPadding: 12,
|
|
153
161
|
className: "flex w-72 flex-col gap-2 rounded-none border-0 p-4 ring-1 ring-border",
|
|
154
162
|
children: [t10, t11, t12]
|
|
155
163
|
});
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
164
|
+
$[26] = t10;
|
|
165
|
+
$[27] = t11;
|
|
166
|
+
$[28] = t12;
|
|
167
|
+
$[29] = t13;
|
|
160
168
|
} else {
|
|
161
|
-
t13 = $[
|
|
169
|
+
t13 = $[29];
|
|
162
170
|
}
|
|
163
171
|
let t14;
|
|
164
|
-
if ($[
|
|
172
|
+
if ($[30] !== t13 || $[31] !== t6) {
|
|
165
173
|
t14 = /*#__PURE__*/_jsxs(HoverCard, {
|
|
166
174
|
openDelay: 150,
|
|
167
175
|
closeDelay: 100,
|
|
168
176
|
children: [t6, t13]
|
|
169
177
|
});
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
178
|
+
$[30] = t13;
|
|
179
|
+
$[31] = t6;
|
|
180
|
+
$[32] = t14;
|
|
173
181
|
} else {
|
|
174
|
-
t14 = $[
|
|
182
|
+
t14 = $[32];
|
|
175
183
|
}
|
|
176
184
|
let t15;
|
|
177
|
-
if ($[
|
|
185
|
+
if ($[33] !== citation.index || $[34] !== t14 || $[35] !== t5) {
|
|
178
186
|
t15 = /*#__PURE__*/_jsx("sup", {
|
|
179
187
|
"data-slot": "cite",
|
|
180
188
|
"data-index": t4,
|
|
181
189
|
className: t5,
|
|
182
190
|
children: t14
|
|
183
191
|
});
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
$[
|
|
192
|
+
$[33] = citation.index;
|
|
193
|
+
$[34] = t14;
|
|
194
|
+
$[35] = t5;
|
|
195
|
+
$[36] = t15;
|
|
188
196
|
} else {
|
|
189
|
-
t15 = $[
|
|
197
|
+
t15 = $[36];
|
|
190
198
|
}
|
|
191
199
|
return t15;
|
|
192
200
|
}
|
package/dist/memory/memorized.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { c as _c } from "react/compiler-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import { Button, cn } from "@locusgraph/components";
|
|
4
|
+
import { cn } from "@locusgraph/components";
|
|
6
5
|
import { pluralize } from "@locusgraph/utils";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { BookmarkSimple as BookmarkPlusIcon } from "@phosphor-icons/react/ssr";
|
|
7
|
+
import { useEffect, useRef } from "react";
|
|
8
|
+
import { lineDetailClass, lineMemoryIconClass, lineMemoryObjectClass, lineRowClass } from "../shared/line.js";
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
function savedCount(items) {
|
|
11
|
+
return items.filter(item => item.status === "saved").length;
|
|
12
|
+
}
|
|
10
13
|
export function memorizedSummary(items) {
|
|
11
|
-
|
|
12
|
-
return `Saved ${pluralize(saved, "memory", "memories")}`;
|
|
14
|
+
return `Saved ${pluralize(savedCount(items), "memory", "memories")}`;
|
|
13
15
|
}
|
|
14
16
|
export function Memorized(t0) {
|
|
15
17
|
const $ = _c(19);
|
|
@@ -23,41 +25,55 @@ export function Memorized(t0) {
|
|
|
23
25
|
}
|
|
24
26
|
let t1;
|
|
25
27
|
if ($[0] !== className) {
|
|
26
|
-
t1 = cn("flex min-w-0 flex-col
|
|
28
|
+
t1 = cn("flex min-w-0 flex-col", className);
|
|
27
29
|
$[0] = className;
|
|
28
30
|
$[1] = t1;
|
|
29
31
|
} else {
|
|
30
32
|
t1 = $[1];
|
|
31
33
|
}
|
|
32
34
|
let t2;
|
|
33
|
-
let t3;
|
|
34
35
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
35
|
-
t2 =
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
37
|
+
"aria-hidden": true,
|
|
38
|
+
className: lineMemoryIconClass,
|
|
39
|
+
children: /*#__PURE__*/_jsx(BookmarkPlusIcon, {
|
|
40
|
+
weight: "bold",
|
|
41
|
+
"aria-hidden": true
|
|
42
|
+
})
|
|
38
43
|
});
|
|
39
44
|
$[2] = t2;
|
|
40
|
-
$[3] = t3;
|
|
41
45
|
} else {
|
|
42
46
|
t2 = $[2];
|
|
43
|
-
t3 = $[3];
|
|
44
47
|
}
|
|
45
|
-
let
|
|
46
|
-
if ($[
|
|
47
|
-
|
|
48
|
-
$[
|
|
49
|
-
$[
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[3] !== items) {
|
|
50
|
+
t3 = pluralize(savedCount(items), "memory", "memories");
|
|
51
|
+
$[3] = items;
|
|
52
|
+
$[4] = t3;
|
|
50
53
|
} else {
|
|
51
|
-
|
|
54
|
+
t3 = $[4];
|
|
52
55
|
}
|
|
53
|
-
let
|
|
54
|
-
if ($[
|
|
55
|
-
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[5] !== t3) {
|
|
58
|
+
t4 = /*#__PURE__*/_jsxs("header", {
|
|
56
59
|
"aria-live": "polite",
|
|
57
|
-
className:
|
|
58
|
-
children: [
|
|
60
|
+
className: lineRowClass,
|
|
61
|
+
children: [t2, /*#__PURE__*/_jsxs("span", {
|
|
62
|
+
className: "truncate",
|
|
63
|
+
children: ["Saved", " ", /*#__PURE__*/_jsx("span", {
|
|
64
|
+
className: lineMemoryObjectClass,
|
|
65
|
+
children: t3
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
59
68
|
});
|
|
69
|
+
$[5] = t3;
|
|
60
70
|
$[6] = t4;
|
|
71
|
+
} else {
|
|
72
|
+
t4 = $[6];
|
|
73
|
+
}
|
|
74
|
+
let t5;
|
|
75
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
76
|
+
t5 = cn(lineDetailClass, "flex flex-col pb-2 text-muted-foreground");
|
|
61
77
|
$[7] = t5;
|
|
62
78
|
} else {
|
|
63
79
|
t5 = $[7];
|
|
@@ -85,7 +101,7 @@ export function Memorized(t0) {
|
|
|
85
101
|
let t7;
|
|
86
102
|
if ($[13] !== t6) {
|
|
87
103
|
t7 = /*#__PURE__*/_jsx("ul", {
|
|
88
|
-
className:
|
|
104
|
+
className: t5,
|
|
89
105
|
children: t6
|
|
90
106
|
});
|
|
91
107
|
$[13] = t6;
|
|
@@ -94,15 +110,15 @@ export function Memorized(t0) {
|
|
|
94
110
|
t7 = $[14];
|
|
95
111
|
}
|
|
96
112
|
let t8;
|
|
97
|
-
if ($[15] !== t1 || $[16] !==
|
|
113
|
+
if ($[15] !== t1 || $[16] !== t4 || $[17] !== t7) {
|
|
98
114
|
t8 = /*#__PURE__*/_jsxs("section", {
|
|
99
115
|
"data-slot": "memorized",
|
|
100
116
|
"aria-label": "Saved to memory",
|
|
101
117
|
className: t1,
|
|
102
|
-
children: [
|
|
118
|
+
children: [t4, t7]
|
|
103
119
|
});
|
|
104
120
|
$[15] = t1;
|
|
105
|
-
$[16] =
|
|
121
|
+
$[16] = t4;
|
|
106
122
|
$[17] = t7;
|
|
107
123
|
$[18] = t8;
|
|
108
124
|
} else {
|
|
@@ -111,117 +127,116 @@ export function Memorized(t0) {
|
|
|
111
127
|
return t8;
|
|
112
128
|
}
|
|
113
129
|
function MemorizedRow(t0) {
|
|
114
|
-
const $ = _c(
|
|
130
|
+
const $ = _c(22);
|
|
115
131
|
const {
|
|
116
132
|
item,
|
|
117
133
|
onUndo
|
|
118
134
|
} = t0;
|
|
119
135
|
const undone = item.status === "undone";
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
136
|
+
const undoneLabel = useRef(null);
|
|
137
|
+
const undoWasPressed = useRef(false);
|
|
138
|
+
let t1;
|
|
139
|
+
let t2;
|
|
140
|
+
if ($[0] !== undone) {
|
|
141
|
+
t1 = () => {
|
|
142
|
+
if (undone && undoWasPressed.current) {
|
|
143
|
+
undoWasPressed.current = false;
|
|
144
|
+
undoneLabel.current?.focus();
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
t2 = [undone];
|
|
148
|
+
$[0] = undone;
|
|
149
|
+
$[1] = t1;
|
|
150
|
+
$[2] = t2;
|
|
127
151
|
} else {
|
|
128
|
-
|
|
152
|
+
t1 = $[1];
|
|
153
|
+
t2 = $[2];
|
|
129
154
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
$[2] = t3;
|
|
155
|
+
useEffect(t1, t2);
|
|
156
|
+
const t3 = item.status;
|
|
157
|
+
const t4 = undone && "text-faint line-through decoration-faint";
|
|
158
|
+
let t5;
|
|
159
|
+
if ($[3] !== t4) {
|
|
160
|
+
t5 = cn(t4);
|
|
137
161
|
$[3] = t4;
|
|
138
|
-
} else {
|
|
139
|
-
t4 = $[3];
|
|
140
|
-
}
|
|
141
|
-
const t5 = undone && "font-normal text-muted-foreground line-through decoration-muted-foreground";
|
|
142
|
-
let t6;
|
|
143
|
-
if ($[4] !== t5) {
|
|
144
|
-
t6 = cn("text-sm font-medium", t5);
|
|
145
162
|
$[4] = t5;
|
|
146
|
-
$[5] = t6;
|
|
147
163
|
} else {
|
|
148
|
-
|
|
164
|
+
t5 = $[4];
|
|
149
165
|
}
|
|
150
|
-
let
|
|
151
|
-
if ($[
|
|
152
|
-
|
|
153
|
-
className:
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[5] !== item.text || $[6] !== t5) {
|
|
168
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
169
|
+
className: t5,
|
|
154
170
|
children: item.text
|
|
155
171
|
});
|
|
156
|
-
$[
|
|
172
|
+
$[5] = item.text;
|
|
173
|
+
$[6] = t5;
|
|
157
174
|
$[7] = t6;
|
|
158
|
-
$[8] = t7;
|
|
159
175
|
} else {
|
|
160
|
-
|
|
176
|
+
t6 = $[7];
|
|
161
177
|
}
|
|
162
|
-
let
|
|
163
|
-
if ($[
|
|
164
|
-
|
|
165
|
-
className: "
|
|
178
|
+
let t7;
|
|
179
|
+
if ($[8] !== item.kind) {
|
|
180
|
+
t7 = item.kind && /*#__PURE__*/_jsx("span", {
|
|
181
|
+
className: "text-xs text-faint",
|
|
166
182
|
children: item.kind
|
|
167
183
|
});
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
184
|
+
$[8] = item.kind;
|
|
185
|
+
$[9] = t7;
|
|
170
186
|
} else {
|
|
171
|
-
|
|
187
|
+
t7 = $[9];
|
|
172
188
|
}
|
|
173
|
-
let
|
|
174
|
-
if ($[
|
|
175
|
-
|
|
176
|
-
className: "flex min-w-0 flex-
|
|
177
|
-
children: [
|
|
189
|
+
let t8;
|
|
190
|
+
if ($[10] !== t6 || $[11] !== t7) {
|
|
191
|
+
t8 = /*#__PURE__*/_jsxs("span", {
|
|
192
|
+
className: "flex min-w-0 flex-wrap items-baseline gap-x-1.5",
|
|
193
|
+
children: [t6, t7]
|
|
178
194
|
});
|
|
195
|
+
$[10] = t6;
|
|
179
196
|
$[11] = t7;
|
|
180
197
|
$[12] = t8;
|
|
181
|
-
$[13] = t9;
|
|
182
198
|
} else {
|
|
183
|
-
|
|
199
|
+
t8 = $[12];
|
|
184
200
|
}
|
|
185
|
-
let
|
|
186
|
-
if ($[
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}) : onUndo && /*#__PURE__*/
|
|
193
|
-
|
|
194
|
-
size: "xs",
|
|
195
|
-
className: "-mr-2 text-muted-foreground hover:text-foreground",
|
|
201
|
+
let t9;
|
|
202
|
+
if ($[13] !== item.id || $[14] !== item.text || $[15] !== onUndo || $[16] !== undone) {
|
|
203
|
+
t9 = undone ? /*#__PURE__*/_jsx("span", {
|
|
204
|
+
ref: undoneLabel,
|
|
205
|
+
tabIndex: -1,
|
|
206
|
+
className: "shrink-0 text-xs text-faint locus-focus-ring",
|
|
207
|
+
children: "Undone"
|
|
208
|
+
}) : onUndo && /*#__PURE__*/_jsx("button", {
|
|
209
|
+
type: "button",
|
|
196
210
|
"aria-label": `Undo saving ${item.text}`,
|
|
197
|
-
onClick: () =>
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
}
|
|
211
|
+
onClick: () => {
|
|
212
|
+
undoWasPressed.current = true;
|
|
213
|
+
onUndo(item.id);
|
|
214
|
+
},
|
|
215
|
+
className: "shrink-0 text-xs text-faint locus-focus-ring transition-colors hover:text-interactive",
|
|
216
|
+
children: "Undo"
|
|
201
217
|
});
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
218
|
+
$[13] = item.id;
|
|
219
|
+
$[14] = item.text;
|
|
220
|
+
$[15] = onUndo;
|
|
221
|
+
$[16] = undone;
|
|
222
|
+
$[17] = t9;
|
|
207
223
|
} else {
|
|
208
|
-
|
|
224
|
+
t9 = $[17];
|
|
209
225
|
}
|
|
210
|
-
let
|
|
211
|
-
if ($[
|
|
212
|
-
|
|
226
|
+
let t10;
|
|
227
|
+
if ($[18] !== item.status || $[19] !== t8 || $[20] !== t9) {
|
|
228
|
+
t10 = /*#__PURE__*/_jsxs("li", {
|
|
213
229
|
"data-slot": "memorized-item",
|
|
214
|
-
"data-status":
|
|
215
|
-
className: "flex min-
|
|
216
|
-
children: [
|
|
230
|
+
"data-status": t3,
|
|
231
|
+
className: "flex min-w-0 items-baseline gap-3 py-1",
|
|
232
|
+
children: [t8, t9]
|
|
217
233
|
});
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[23] = t11;
|
|
234
|
+
$[18] = item.status;
|
|
235
|
+
$[19] = t8;
|
|
236
|
+
$[20] = t9;
|
|
237
|
+
$[21] = t10;
|
|
223
238
|
} else {
|
|
224
|
-
|
|
239
|
+
t10 = $[21];
|
|
225
240
|
}
|
|
226
|
-
return
|
|
241
|
+
return t10;
|
|
227
242
|
}
|