@locusgraph/loop 0.3.0 → 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 +70 -17
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +57 -16
- package/dist/agent/pulse/marks/locus-mark.js +39 -13
- package/dist/agent/pulse/marks/orb-mark.js +21 -9
- 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 +36 -15
- 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 +248 -86
- package/dist/approval/inbox/inbox.d.ts +3 -3
- package/dist/approval/inbox/inbox.js +251 -57
- package/dist/approval/inbox/virtual-inbox-list.d.ts +3 -3
- package/dist/approval/inbox/virtual-inbox-list.js +107 -30
- package/dist/approval/memory/memory-review.js +228 -91
- package/dist/approval/memory/memory-row.js +192 -56
- package/dist/approval/plan/plan-review.js +241 -108
- package/dist/approval/plan/plan-step-row.js +184 -77
- 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 +139 -48
- package/dist/approval/plan/question.js +189 -67
- package/dist/approval/run/run-bar.js +138 -49
- 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-on-mount.js +23 -5
- 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 +235 -52
- package/dist/approval/spend/spend-gate.js +200 -106
- 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 +157 -96
- package/dist/approval/tool/args/args-editor.js +232 -81
- package/dist/approval/tool/args/args-field.js +333 -60
- package/dist/approval/tool/deny-form.js +114 -32
- package/dist/approval/tool/tool-inputs.js +93 -33
- package/dist/chat/chat/chat.js +5 -4
- package/dist/chat/chat/use-stick-to-bottom.js +116 -63
- package/dist/chat/chat/virtual-chat-items.js +129 -34
- package/dist/chat/composer/composer-actions.d.ts +1 -2
- package/dist/chat/composer/composer-actions.js +136 -50
- package/dist/chat/composer/composer-status.d.ts +2 -0
- package/dist/chat/composer/composer-status.js +3 -0
- package/dist/chat/composer/composer.d.ts +1 -1
- package/dist/chat/composer/composer.js +6 -4
- package/dist/chat/composer/use-auto-grow.js +29 -8
- package/dist/chat/files/files.js +296 -67
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- 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 +176 -43
- 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 +190 -59
- package/dist/memory/memorized.js +231 -62
- package/dist/memory/recall.js +272 -85
- 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 +277 -62
- 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/shared/virtual/use-list-virtualizer.js +2 -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 +129 -23
- 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 +161 -45
- 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 +91 -26
- 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 +106 -22
- package/dist/thread/history/row/thread-item-menu.js +84 -20
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +83 -46
- package/dist/thread/index.d.ts +1 -0
- package/dist/thread/index.js +1 -0
- package/dist/thread/starters/starters.js +91 -28
- package/dist/thread/use-copied.js +40 -10
- 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
|
@@ -18,7 +18,7 @@ const compactCount = new Intl.NumberFormat("en-US", {
|
|
|
18
18
|
maximumFractionDigits: 1
|
|
19
19
|
});
|
|
20
20
|
export function formatTokensShort(tokens) {
|
|
21
|
-
return compactCount.format(tokens);
|
|
21
|
+
return compactCount.format(tokens).replace("K", "k");
|
|
22
22
|
}
|
|
23
23
|
export function formatDuration(durationMs) {
|
|
24
24
|
if (durationMs < 1000) return `${Math.round(durationMs)}ms`;
|
|
@@ -28,3 +28,21 @@ export function formatDuration(durationMs) {
|
|
|
28
28
|
const remainder = Math.round(seconds % 60);
|
|
29
29
|
return `${minutes}m ${String(remainder).padStart(2, "0")}s`;
|
|
30
30
|
}
|
|
31
|
+
export function wholePercentsOf(parts, whole) {
|
|
32
|
+
if (whole <= 0) return parts.map(() => 0);
|
|
33
|
+
const exact = parts.map(part => part / whole * 100);
|
|
34
|
+
const sum = parts.reduce((total, part) => total + part, 0);
|
|
35
|
+
if (sum !== whole) return exact.map(percent => Math.round(percent));
|
|
36
|
+
const floors = exact.map(percent => Math.floor(percent));
|
|
37
|
+
const missing = 100 - floors.reduce((total, percent) => total + percent, 0);
|
|
38
|
+
const byLargestRemainder = exact.map((percent, index) => ({
|
|
39
|
+
index,
|
|
40
|
+
remainder: percent - Math.floor(percent)
|
|
41
|
+
})).sort((first, second) => second.remainder - first.remainder);
|
|
42
|
+
for (const {
|
|
43
|
+
index
|
|
44
|
+
} of byLargestRemainder.slice(0, missing)) {
|
|
45
|
+
floors[index] = (floors[index] ?? 0) + 1;
|
|
46
|
+
}
|
|
47
|
+
return floors;
|
|
48
|
+
}
|
package/dist/memory/cite.js
CHANGED
|
@@ -1,69 +1,200 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { cn, HoverCard, HoverCardContent, HoverCardTrigger } from "@locusgraph/components";
|
|
2
5
|
import { hostLabel } from "./shared/host-label.js";
|
|
3
6
|
import { SourceMark } from "./shared/source-mark.js";
|
|
4
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
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";
|
|
6
9
|
export function citationLabel(citation) {
|
|
7
10
|
return `Source ${citation.index}: ${citation.title}`;
|
|
8
11
|
}
|
|
9
|
-
export function Cite({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
export function Cite(t0) {
|
|
13
|
+
const $ = _c(37);
|
|
14
|
+
const {
|
|
15
|
+
citation,
|
|
16
|
+
onOpen,
|
|
17
|
+
className
|
|
18
|
+
} = t0;
|
|
19
|
+
let t1;
|
|
20
|
+
if ($[0] !== citation.url) {
|
|
21
|
+
t1 = hostLabel(citation.url);
|
|
22
|
+
$[0] = citation.url;
|
|
23
|
+
$[1] = t1;
|
|
24
|
+
} else {
|
|
25
|
+
t1 = $[1];
|
|
26
|
+
}
|
|
27
|
+
const host = t1;
|
|
28
|
+
let t2;
|
|
29
|
+
if ($[2] !== citation) {
|
|
30
|
+
t2 = citationLabel(citation);
|
|
31
|
+
$[2] = citation;
|
|
32
|
+
$[3] = t2;
|
|
33
|
+
} else {
|
|
34
|
+
t2 = $[3];
|
|
35
|
+
}
|
|
36
|
+
const label = t2;
|
|
37
|
+
let t3;
|
|
38
|
+
if ($[4] !== citation || $[5] !== onOpen) {
|
|
39
|
+
t3 = event => {
|
|
40
|
+
if (!onOpen) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
event.preventDefault();
|
|
44
|
+
onOpen(citation);
|
|
45
|
+
};
|
|
46
|
+
$[4] = citation;
|
|
47
|
+
$[5] = onOpen;
|
|
48
|
+
$[6] = t3;
|
|
49
|
+
} else {
|
|
50
|
+
t3 = $[6];
|
|
51
|
+
}
|
|
52
|
+
const open = t3;
|
|
53
|
+
const t4 = citation.index;
|
|
54
|
+
let t5;
|
|
55
|
+
if ($[7] !== className) {
|
|
56
|
+
t5 = cn("relative -top-1 ml-0.5 align-baseline leading-none", className);
|
|
57
|
+
$[7] = className;
|
|
58
|
+
$[8] = t5;
|
|
59
|
+
} else {
|
|
60
|
+
t5 = $[8];
|
|
61
|
+
}
|
|
62
|
+
let t6;
|
|
63
|
+
if ($[9] !== citation.index || $[10] !== citation.url || $[11] !== label || $[12] !== onOpen || $[13] !== open) {
|
|
64
|
+
t6 = /*#__PURE__*/_jsx(HoverCardTrigger, {
|
|
65
|
+
asChild: true,
|
|
66
|
+
children: citation.url ? /*#__PURE__*/_jsx("a", {
|
|
67
|
+
href: citation.url,
|
|
68
|
+
target: "_blank",
|
|
69
|
+
rel: "noreferrer",
|
|
70
|
+
"aria-label": onOpen ? label : `${label}, opens in a new tab`,
|
|
71
|
+
onClick: open,
|
|
72
|
+
className: pillClass,
|
|
73
|
+
children: citation.index
|
|
74
|
+
}) : onOpen ? /*#__PURE__*/_jsx("button", {
|
|
75
|
+
type: "button",
|
|
76
|
+
"aria-label": label,
|
|
77
|
+
onClick: open,
|
|
78
|
+
className: pillClass,
|
|
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
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
$[9] = citation.index;
|
|
89
|
+
$[10] = citation.url;
|
|
90
|
+
$[11] = label;
|
|
91
|
+
$[12] = onOpen;
|
|
92
|
+
$[13] = open;
|
|
93
|
+
$[14] = t6;
|
|
94
|
+
} else {
|
|
95
|
+
t6 = $[14];
|
|
96
|
+
}
|
|
97
|
+
let t7;
|
|
98
|
+
if ($[15] !== citation) {
|
|
99
|
+
t7 = /*#__PURE__*/_jsx(SourceMark, {
|
|
100
|
+
citation: citation
|
|
101
|
+
});
|
|
102
|
+
$[15] = citation;
|
|
103
|
+
$[16] = t7;
|
|
104
|
+
} else {
|
|
105
|
+
t7 = $[16];
|
|
106
|
+
}
|
|
107
|
+
const t8 = host ?? "Source";
|
|
108
|
+
let t9;
|
|
109
|
+
if ($[17] !== t8) {
|
|
110
|
+
t9 = /*#__PURE__*/_jsx("span", {
|
|
111
|
+
className: "truncate",
|
|
112
|
+
children: t8
|
|
113
|
+
});
|
|
114
|
+
$[17] = t8;
|
|
115
|
+
$[18] = t9;
|
|
116
|
+
} else {
|
|
117
|
+
t9 = $[18];
|
|
118
|
+
}
|
|
119
|
+
let t10;
|
|
120
|
+
if ($[19] !== t7 || $[20] !== t9) {
|
|
121
|
+
t10 = /*#__PURE__*/_jsxs("span", {
|
|
122
|
+
className: "flex min-w-0 items-center gap-2 text-xs text-faint",
|
|
123
|
+
children: [t7, t9]
|
|
124
|
+
});
|
|
125
|
+
$[19] = t7;
|
|
126
|
+
$[20] = t9;
|
|
127
|
+
$[21] = t10;
|
|
128
|
+
} else {
|
|
129
|
+
t10 = $[21];
|
|
130
|
+
}
|
|
131
|
+
let t11;
|
|
132
|
+
if ($[22] !== citation.title) {
|
|
133
|
+
t11 = /*#__PURE__*/_jsx("span", {
|
|
134
|
+
className: "text-sm leading-snug font-medium",
|
|
135
|
+
children: citation.title
|
|
136
|
+
});
|
|
137
|
+
$[22] = citation.title;
|
|
138
|
+
$[23] = t11;
|
|
139
|
+
} else {
|
|
140
|
+
t11 = $[23];
|
|
141
|
+
}
|
|
142
|
+
let t12;
|
|
143
|
+
if ($[24] !== citation.snippet) {
|
|
144
|
+
t12 = citation.snippet && /*#__PURE__*/_jsx("p", {
|
|
145
|
+
className: "line-clamp-4 text-xs leading-relaxed text-muted-foreground",
|
|
146
|
+
children: citation.snippet
|
|
147
|
+
});
|
|
148
|
+
$[24] = citation.snippet;
|
|
149
|
+
$[25] = t12;
|
|
150
|
+
} else {
|
|
151
|
+
t12 = $[25];
|
|
152
|
+
}
|
|
153
|
+
let t13;
|
|
154
|
+
if ($[26] !== t10 || $[27] !== t11 || $[28] !== t12) {
|
|
155
|
+
t13 = /*#__PURE__*/_jsxs(HoverCardContent, {
|
|
156
|
+
"data-slot": "cite-card",
|
|
157
|
+
side: "bottom",
|
|
158
|
+
align: "start",
|
|
159
|
+
sideOffset: 6,
|
|
160
|
+
collisionPadding: 12,
|
|
161
|
+
className: "flex w-72 flex-col gap-2 rounded-none border-0 p-4 ring-1 ring-border",
|
|
162
|
+
children: [t10, t11, t12]
|
|
163
|
+
});
|
|
164
|
+
$[26] = t10;
|
|
165
|
+
$[27] = t11;
|
|
166
|
+
$[28] = t12;
|
|
167
|
+
$[29] = t13;
|
|
168
|
+
} else {
|
|
169
|
+
t13 = $[29];
|
|
170
|
+
}
|
|
171
|
+
let t14;
|
|
172
|
+
if ($[30] !== t13 || $[31] !== t6) {
|
|
173
|
+
t14 = /*#__PURE__*/_jsxs(HoverCard, {
|
|
26
174
|
openDelay: 150,
|
|
27
175
|
closeDelay: 100,
|
|
28
|
-
children: [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
className: "locus-eyebrow flex min-w-0 items-center gap-2",
|
|
53
|
-
children: [/*#__PURE__*/_jsx(SourceMark, {
|
|
54
|
-
citation: citation
|
|
55
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
56
|
-
className: "truncate",
|
|
57
|
-
children: host ?? "Source"
|
|
58
|
-
})]
|
|
59
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
60
|
-
className: "text-sm leading-snug font-medium",
|
|
61
|
-
children: citation.title
|
|
62
|
-
}), citation.snippet && /*#__PURE__*/_jsx("p", {
|
|
63
|
-
className: "line-clamp-4 text-xs leading-relaxed text-muted-foreground",
|
|
64
|
-
children: citation.snippet
|
|
65
|
-
})]
|
|
66
|
-
})]
|
|
67
|
-
})
|
|
68
|
-
});
|
|
176
|
+
children: [t6, t13]
|
|
177
|
+
});
|
|
178
|
+
$[30] = t13;
|
|
179
|
+
$[31] = t6;
|
|
180
|
+
$[32] = t14;
|
|
181
|
+
} else {
|
|
182
|
+
t14 = $[32];
|
|
183
|
+
}
|
|
184
|
+
let t15;
|
|
185
|
+
if ($[33] !== citation.index || $[34] !== t14 || $[35] !== t5) {
|
|
186
|
+
t15 = /*#__PURE__*/_jsx("sup", {
|
|
187
|
+
"data-slot": "cite",
|
|
188
|
+
"data-index": t4,
|
|
189
|
+
className: t5,
|
|
190
|
+
children: t14
|
|
191
|
+
});
|
|
192
|
+
$[33] = citation.index;
|
|
193
|
+
$[34] = t14;
|
|
194
|
+
$[35] = t5;
|
|
195
|
+
$[36] = t15;
|
|
196
|
+
} else {
|
|
197
|
+
t15 = $[36];
|
|
198
|
+
}
|
|
199
|
+
return t15;
|
|
69
200
|
}
|
package/dist/memory/memorized.js
CHANGED
|
@@ -1,73 +1,242 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
4
|
+
import { cn } from "@locusgraph/components";
|
|
3
5
|
import { pluralize } from "@locusgraph/utils";
|
|
4
|
-
import {
|
|
5
|
-
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";
|
|
6
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
|
+
}
|
|
7
13
|
export function memorizedSummary(items) {
|
|
8
|
-
|
|
9
|
-
return `Saved ${pluralize(saved, "memory", "memories")}`;
|
|
14
|
+
return `Saved ${pluralize(savedCount(items), "memory", "memories")}`;
|
|
10
15
|
}
|
|
11
|
-
export function Memorized({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
export function Memorized(t0) {
|
|
17
|
+
const $ = _c(19);
|
|
18
|
+
const {
|
|
19
|
+
items,
|
|
20
|
+
onUndo,
|
|
21
|
+
className
|
|
22
|
+
} = t0;
|
|
23
|
+
if (items.length === 0) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
let t1;
|
|
27
|
+
if ($[0] !== className) {
|
|
28
|
+
t1 = cn("flex min-w-0 flex-col", className);
|
|
29
|
+
$[0] = className;
|
|
30
|
+
$[1] = t1;
|
|
31
|
+
} else {
|
|
32
|
+
t1 = $[1];
|
|
33
|
+
}
|
|
34
|
+
let t2;
|
|
35
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
36
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
37
|
+
"aria-hidden": true,
|
|
38
|
+
className: lineMemoryIconClass,
|
|
39
|
+
children: /*#__PURE__*/_jsx(BookmarkPlusIcon, {
|
|
40
|
+
weight: "bold",
|
|
25
41
|
"aria-hidden": true
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
$[2] = t2;
|
|
45
|
+
} else {
|
|
46
|
+
t2 = $[2];
|
|
47
|
+
}
|
|
48
|
+
let t3;
|
|
49
|
+
if ($[3] !== items) {
|
|
50
|
+
t3 = pluralize(savedCount(items), "memory", "memories");
|
|
51
|
+
$[3] = items;
|
|
52
|
+
$[4] = t3;
|
|
53
|
+
} else {
|
|
54
|
+
t3 = $[4];
|
|
55
|
+
}
|
|
56
|
+
let t4;
|
|
57
|
+
if ($[5] !== t3) {
|
|
58
|
+
t4 = /*#__PURE__*/_jsxs("header", {
|
|
59
|
+
"aria-live": "polite",
|
|
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
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
$[5] = t3;
|
|
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");
|
|
77
|
+
$[7] = t5;
|
|
78
|
+
} else {
|
|
79
|
+
t5 = $[7];
|
|
80
|
+
}
|
|
81
|
+
let t6;
|
|
82
|
+
if ($[8] !== items || $[9] !== onUndo) {
|
|
83
|
+
let t7;
|
|
84
|
+
if ($[11] !== onUndo) {
|
|
85
|
+
t7 = item => /*#__PURE__*/_jsx(MemorizedRow, {
|
|
30
86
|
item: item,
|
|
31
87
|
onUndo: onUndo
|
|
32
|
-
}, item.id)
|
|
33
|
-
|
|
34
|
-
|
|
88
|
+
}, item.id);
|
|
89
|
+
$[11] = onUndo;
|
|
90
|
+
$[12] = t7;
|
|
91
|
+
} else {
|
|
92
|
+
t7 = $[12];
|
|
93
|
+
}
|
|
94
|
+
t6 = items.map(t7);
|
|
95
|
+
$[8] = items;
|
|
96
|
+
$[9] = onUndo;
|
|
97
|
+
$[10] = t6;
|
|
98
|
+
} else {
|
|
99
|
+
t6 = $[10];
|
|
100
|
+
}
|
|
101
|
+
let t7;
|
|
102
|
+
if ($[13] !== t6) {
|
|
103
|
+
t7 = /*#__PURE__*/_jsx("ul", {
|
|
104
|
+
className: t5,
|
|
105
|
+
children: t6
|
|
106
|
+
});
|
|
107
|
+
$[13] = t6;
|
|
108
|
+
$[14] = t7;
|
|
109
|
+
} else {
|
|
110
|
+
t7 = $[14];
|
|
111
|
+
}
|
|
112
|
+
let t8;
|
|
113
|
+
if ($[15] !== t1 || $[16] !== t4 || $[17] !== t7) {
|
|
114
|
+
t8 = /*#__PURE__*/_jsxs("section", {
|
|
115
|
+
"data-slot": "memorized",
|
|
116
|
+
"aria-label": "Saved to memory",
|
|
117
|
+
className: t1,
|
|
118
|
+
children: [t4, t7]
|
|
119
|
+
});
|
|
120
|
+
$[15] = t1;
|
|
121
|
+
$[16] = t4;
|
|
122
|
+
$[17] = t7;
|
|
123
|
+
$[18] = t8;
|
|
124
|
+
} else {
|
|
125
|
+
t8 = $[18];
|
|
126
|
+
}
|
|
127
|
+
return t8;
|
|
35
128
|
}
|
|
36
|
-
function MemorizedRow({
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
129
|
+
function MemorizedRow(t0) {
|
|
130
|
+
const $ = _c(22);
|
|
131
|
+
const {
|
|
132
|
+
item,
|
|
133
|
+
onUndo
|
|
134
|
+
} = t0;
|
|
40
135
|
const undone = item.status === "undone";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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;
|
|
151
|
+
} else {
|
|
152
|
+
t1 = $[1];
|
|
153
|
+
t2 = $[2];
|
|
154
|
+
}
|
|
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);
|
|
161
|
+
$[3] = t4;
|
|
162
|
+
$[4] = t5;
|
|
163
|
+
} else {
|
|
164
|
+
t5 = $[4];
|
|
165
|
+
}
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[5] !== item.text || $[6] !== t5) {
|
|
168
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
169
|
+
className: t5,
|
|
170
|
+
children: item.text
|
|
171
|
+
});
|
|
172
|
+
$[5] = item.text;
|
|
173
|
+
$[6] = t5;
|
|
174
|
+
$[7] = t6;
|
|
175
|
+
} else {
|
|
176
|
+
t6 = $[7];
|
|
177
|
+
}
|
|
178
|
+
let t7;
|
|
179
|
+
if ($[8] !== item.kind) {
|
|
180
|
+
t7 = item.kind && /*#__PURE__*/_jsx("span", {
|
|
181
|
+
className: "text-xs text-faint",
|
|
182
|
+
children: item.kind
|
|
183
|
+
});
|
|
184
|
+
$[8] = item.kind;
|
|
185
|
+
$[9] = t7;
|
|
186
|
+
} else {
|
|
187
|
+
t7 = $[9];
|
|
188
|
+
}
|
|
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]
|
|
194
|
+
});
|
|
195
|
+
$[10] = t6;
|
|
196
|
+
$[11] = t7;
|
|
197
|
+
$[12] = t8;
|
|
198
|
+
} else {
|
|
199
|
+
t8 = $[12];
|
|
200
|
+
}
|
|
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",
|
|
66
210
|
"aria-label": `Undo saving ${item.text}`,
|
|
67
|
-
onClick: () =>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
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"
|
|
217
|
+
});
|
|
218
|
+
$[13] = item.id;
|
|
219
|
+
$[14] = item.text;
|
|
220
|
+
$[15] = onUndo;
|
|
221
|
+
$[16] = undone;
|
|
222
|
+
$[17] = t9;
|
|
223
|
+
} else {
|
|
224
|
+
t9 = $[17];
|
|
225
|
+
}
|
|
226
|
+
let t10;
|
|
227
|
+
if ($[18] !== item.status || $[19] !== t8 || $[20] !== t9) {
|
|
228
|
+
t10 = /*#__PURE__*/_jsxs("li", {
|
|
229
|
+
"data-slot": "memorized-item",
|
|
230
|
+
"data-status": t3,
|
|
231
|
+
className: "flex min-w-0 items-baseline gap-3 py-1",
|
|
232
|
+
children: [t8, t9]
|
|
233
|
+
});
|
|
234
|
+
$[18] = item.status;
|
|
235
|
+
$[19] = t8;
|
|
236
|
+
$[20] = t9;
|
|
237
|
+
$[21] = t10;
|
|
238
|
+
} else {
|
|
239
|
+
t10 = $[21];
|
|
240
|
+
}
|
|
241
|
+
return t10;
|
|
73
242
|
}
|