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