@locusgraph/loop 0.2.1 → 0.3.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 +64 -12
- package/dist/agent/pulse/marks/bars-mark.js +39 -15
- package/dist/agent/pulse/marks/glyph-mark.js +56 -15
- package/dist/agent/pulse/marks/locus-mark.js +38 -12
- 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.js +35 -12
- package/dist/agent/thinking/thinking.js +2 -2
- package/dist/agent/tool/tool-status.js +1 -1
- package/dist/approval/inbox/inbox-row.js +303 -76
- package/dist/approval/inbox/inbox.js +192 -39
- package/dist/approval/inbox/virtual-inbox-list.js +104 -26
- package/dist/approval/memory/memory-review.js +172 -36
- package/dist/approval/memory/memory-row.js +187 -50
- package/dist/approval/plan/plan-review.js +225 -73
- package/dist/approval/plan/plan-step-row.js +182 -76
- package/dist/approval/plan/question-choices.js +132 -44
- package/dist/approval/plan/question.js +156 -38
- package/dist/approval/run/run-bar.js +125 -39
- package/dist/approval/shared/use-focus-on-mount.js +23 -5
- package/dist/approval/spend/raise-cap-form.js +223 -48
- package/dist/approval/spend/spend-gate.js +157 -40
- package/dist/approval/spend/spend-meter.js +1 -1
- package/dist/approval/tool/approval.js +196 -35
- package/dist/approval/tool/args/args-editor.js +206 -46
- package/dist/approval/tool/args/args-field.js +240 -55
- package/dist/approval/tool/deny-form.js +125 -36
- package/dist/approval/tool/tool-inputs.js +91 -24
- package/dist/chat/chat/use-stick-to-bottom.js +115 -60
- 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 +132 -49
- 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 +2 -1
- package/dist/chat/composer/use-auto-grow.js +25 -8
- package/dist/chat/files/files.js +293 -66
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/chat/reply/markdown-components.js +2 -2
- package/dist/cost/context.js +1 -1
- package/dist/cost/cost.js +1 -1
- package/dist/cost/model-picker.js +174 -42
- package/dist/cost/shared/context-breakdown.js +1 -1
- package/dist/memory/cite.js +181 -58
- package/dist/memory/memorized.js +197 -43
- package/dist/memory/recall.js +265 -68
- package/dist/memory/shared/disclosure.d.ts +2 -2
- package/dist/memory/shared/disclosure.js +1 -1
- package/dist/memory/sources.js +232 -52
- package/dist/shared/panel.js +1 -1
- package/dist/shared/virtual/use-list-virtualizer.js +2 -0
- package/dist/thread/actions/branch-switcher.js +97 -21
- package/dist/thread/canvas/canvas.js +1 -1
- package/dist/thread/canvas/version-switcher.js +128 -31
- package/dist/thread/code/code.js +2 -2
- package/dist/thread/code/copy-code-button.js +58 -24
- package/dist/thread/history/history.js +1 -1
- package/dist/thread/history/row/history-row.js +99 -18
- package/dist/thread/history/row/thread-item-menu.js +74 -19
- package/dist/thread/history/row/thread-title-editor.js +74 -29
- package/dist/thread/history/virtual-history-list.js +84 -46
- package/dist/thread/starters/starters.js +89 -27
- package/dist/thread/use-copied.js +40 -10
- package/package.json +3 -3
package/dist/memory/sources.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ChevronRight as ChevronRightIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger, cn } from "@locusgraph/components";
|
|
3
6
|
import { pluralize } from "@locusgraph/utils";
|
|
@@ -6,81 +9,258 @@ import { hostLabel, sourceKey, toCitation } from "./shared/host-label.js";
|
|
|
6
9
|
import { SourceMark } from "./shared/source-mark.js";
|
|
7
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
11
|
const stackedMarkLimit = 3;
|
|
9
|
-
export function Sources({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export function Sources(t0) {
|
|
13
|
+
const $ = _c(35);
|
|
14
|
+
const {
|
|
15
|
+
sources,
|
|
16
|
+
onOpen,
|
|
17
|
+
defaultOpen: t1,
|
|
18
|
+
className
|
|
19
|
+
} = t0;
|
|
20
|
+
const defaultOpen = t1 === undefined ? false : t1;
|
|
21
|
+
if (sources.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
let T0;
|
|
25
|
+
let T1;
|
|
26
|
+
let t2;
|
|
27
|
+
let t3;
|
|
28
|
+
let t4;
|
|
29
|
+
let t5;
|
|
30
|
+
let t6;
|
|
31
|
+
let t7;
|
|
32
|
+
if ($[0] !== className || $[1] !== defaultOpen || $[2] !== onOpen || $[3] !== sources) {
|
|
33
|
+
const citations = sources.map(toCitation);
|
|
34
|
+
T1 = Collapsible;
|
|
35
|
+
t4 = "sources";
|
|
36
|
+
t5 = defaultOpen;
|
|
37
|
+
if ($[12] !== className) {
|
|
38
|
+
t6 = cn("flex min-w-0 flex-col gap-2", className);
|
|
39
|
+
$[12] = className;
|
|
40
|
+
$[13] = t6;
|
|
41
|
+
} else {
|
|
42
|
+
t6 = $[13];
|
|
43
|
+
}
|
|
44
|
+
let t8;
|
|
45
|
+
if ($[14] !== sources) {
|
|
46
|
+
t8 = (citation, position) => /*#__PURE__*/_jsx(SourceMark, {
|
|
47
|
+
citation: citation,
|
|
48
|
+
className: "ring-card"
|
|
49
|
+
}, sourceKey(sources[position], position));
|
|
50
|
+
$[14] = sources;
|
|
51
|
+
$[15] = t8;
|
|
52
|
+
} else {
|
|
53
|
+
t8 = $[15];
|
|
54
|
+
}
|
|
55
|
+
let t9;
|
|
56
|
+
if ($[16] !== sources.length) {
|
|
57
|
+
t9 = pluralize(sources.length, "source");
|
|
58
|
+
$[16] = sources.length;
|
|
59
|
+
$[17] = t9;
|
|
60
|
+
} else {
|
|
61
|
+
t9 = $[17];
|
|
62
|
+
}
|
|
63
|
+
let t10;
|
|
64
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
65
|
+
t10 = /*#__PURE__*/_jsx(ChevronRightIcon, {
|
|
66
|
+
"aria-hidden": true,
|
|
67
|
+
className: chevronClass
|
|
68
|
+
});
|
|
69
|
+
$[18] = t10;
|
|
70
|
+
} else {
|
|
71
|
+
t10 = $[18];
|
|
72
|
+
}
|
|
73
|
+
t7 = /*#__PURE__*/_jsxs(CollapsibleTrigger, {
|
|
22
74
|
className: collapsibleTriggerClass,
|
|
23
75
|
children: [/*#__PURE__*/_jsx("span", {
|
|
24
76
|
"aria-hidden": true,
|
|
25
77
|
className: "flex -space-x-1",
|
|
26
|
-
children: citations.slice(0, stackedMarkLimit).map(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
78
|
+
children: citations.slice(0, stackedMarkLimit).map(t8)
|
|
79
|
+
}), "Used ", t9, t10]
|
|
80
|
+
});
|
|
81
|
+
T0 = CollapsibleContent;
|
|
82
|
+
t2 = ruledListClass;
|
|
83
|
+
let t11;
|
|
84
|
+
if ($[19] !== onOpen || $[20] !== sources) {
|
|
85
|
+
t11 = (citation_0, position_0) => /*#__PURE__*/_jsx(SourceRow, {
|
|
86
|
+
citation: citation_0,
|
|
87
|
+
onOpen: onOpen
|
|
88
|
+
}, sourceKey(sources[position_0], position_0));
|
|
89
|
+
$[19] = onOpen;
|
|
90
|
+
$[20] = sources;
|
|
91
|
+
$[21] = t11;
|
|
92
|
+
} else {
|
|
93
|
+
t11 = $[21];
|
|
94
|
+
}
|
|
95
|
+
t3 = citations.map(t11);
|
|
96
|
+
$[0] = className;
|
|
97
|
+
$[1] = defaultOpen;
|
|
98
|
+
$[2] = onOpen;
|
|
99
|
+
$[3] = sources;
|
|
100
|
+
$[4] = T0;
|
|
101
|
+
$[5] = T1;
|
|
102
|
+
$[6] = t2;
|
|
103
|
+
$[7] = t3;
|
|
104
|
+
$[8] = t4;
|
|
105
|
+
$[9] = t5;
|
|
106
|
+
$[10] = t6;
|
|
107
|
+
$[11] = t7;
|
|
108
|
+
} else {
|
|
109
|
+
T0 = $[4];
|
|
110
|
+
T1 = $[5];
|
|
111
|
+
t2 = $[6];
|
|
112
|
+
t3 = $[7];
|
|
113
|
+
t4 = $[8];
|
|
114
|
+
t5 = $[9];
|
|
115
|
+
t6 = $[10];
|
|
116
|
+
t7 = $[11];
|
|
117
|
+
}
|
|
118
|
+
let t8;
|
|
119
|
+
if ($[22] !== t2 || $[23] !== t3) {
|
|
120
|
+
t8 = /*#__PURE__*/_jsx("ol", {
|
|
121
|
+
className: t2,
|
|
122
|
+
children: t3
|
|
123
|
+
});
|
|
124
|
+
$[22] = t2;
|
|
125
|
+
$[23] = t3;
|
|
126
|
+
$[24] = t8;
|
|
127
|
+
} else {
|
|
128
|
+
t8 = $[24];
|
|
129
|
+
}
|
|
130
|
+
let t9;
|
|
131
|
+
if ($[25] !== T0 || $[26] !== t8) {
|
|
132
|
+
t9 = /*#__PURE__*/_jsx(T0, {
|
|
133
|
+
children: t8
|
|
134
|
+
});
|
|
135
|
+
$[25] = T0;
|
|
136
|
+
$[26] = t8;
|
|
137
|
+
$[27] = t9;
|
|
138
|
+
} else {
|
|
139
|
+
t9 = $[27];
|
|
140
|
+
}
|
|
141
|
+
let t10;
|
|
142
|
+
if ($[28] !== T1 || $[29] !== t4 || $[30] !== t5 || $[31] !== t6 || $[32] !== t7 || $[33] !== t9) {
|
|
143
|
+
t10 = /*#__PURE__*/_jsxs(T1, {
|
|
144
|
+
"data-slot": t4,
|
|
145
|
+
defaultOpen: t5,
|
|
146
|
+
className: t6,
|
|
147
|
+
children: [t7, t9]
|
|
148
|
+
});
|
|
149
|
+
$[28] = T1;
|
|
150
|
+
$[29] = t4;
|
|
151
|
+
$[30] = t5;
|
|
152
|
+
$[31] = t6;
|
|
153
|
+
$[32] = t7;
|
|
154
|
+
$[33] = t9;
|
|
155
|
+
$[34] = t10;
|
|
156
|
+
} else {
|
|
157
|
+
t10 = $[34];
|
|
158
|
+
}
|
|
159
|
+
return t10;
|
|
44
160
|
}
|
|
45
|
-
function SourceRow({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
161
|
+
function SourceRow(t0) {
|
|
162
|
+
const $ = _c(21);
|
|
163
|
+
const {
|
|
164
|
+
citation,
|
|
165
|
+
onOpen
|
|
166
|
+
} = t0;
|
|
167
|
+
let t1;
|
|
168
|
+
if ($[0] !== citation.url) {
|
|
169
|
+
t1 = hostLabel(citation.url);
|
|
170
|
+
$[0] = citation.url;
|
|
171
|
+
$[1] = t1;
|
|
172
|
+
} else {
|
|
173
|
+
t1 = $[1];
|
|
174
|
+
}
|
|
175
|
+
const host = t1;
|
|
50
176
|
const showHost = host !== undefined && host !== citation.title;
|
|
51
|
-
|
|
52
|
-
|
|
177
|
+
let t2;
|
|
178
|
+
if ($[2] !== citation.index) {
|
|
179
|
+
t2 = /*#__PURE__*/_jsx("span", {
|
|
53
180
|
className: "w-4 shrink-0 font-mono text-xs text-muted-foreground tabular-nums",
|
|
54
181
|
children: citation.index
|
|
55
|
-
})
|
|
182
|
+
});
|
|
183
|
+
$[2] = citation.index;
|
|
184
|
+
$[3] = t2;
|
|
185
|
+
} else {
|
|
186
|
+
t2 = $[3];
|
|
187
|
+
}
|
|
188
|
+
let t3;
|
|
189
|
+
if ($[4] !== citation.title) {
|
|
190
|
+
t3 = /*#__PURE__*/_jsx("span", {
|
|
56
191
|
className: "min-w-0 flex-1 truncate",
|
|
57
192
|
children: citation.title
|
|
58
|
-
})
|
|
193
|
+
});
|
|
194
|
+
$[4] = citation.title;
|
|
195
|
+
$[5] = t3;
|
|
196
|
+
} else {
|
|
197
|
+
t3 = $[5];
|
|
198
|
+
}
|
|
199
|
+
let t4;
|
|
200
|
+
if ($[6] !== host || $[7] !== showHost) {
|
|
201
|
+
t4 = showHost && /*#__PURE__*/_jsx("span", {
|
|
59
202
|
className: "max-w-[40%] shrink-0 truncate text-xs text-muted-foreground",
|
|
60
203
|
children: host
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
204
|
+
});
|
|
205
|
+
$[6] = host;
|
|
206
|
+
$[7] = showHost;
|
|
207
|
+
$[8] = t4;
|
|
208
|
+
} else {
|
|
209
|
+
t4 = $[8];
|
|
210
|
+
}
|
|
211
|
+
let t5;
|
|
212
|
+
if ($[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
213
|
+
t5 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
214
|
+
children: [t2, t3, t4]
|
|
215
|
+
});
|
|
216
|
+
$[9] = t2;
|
|
217
|
+
$[10] = t3;
|
|
218
|
+
$[11] = t4;
|
|
219
|
+
$[12] = t5;
|
|
220
|
+
} else {
|
|
221
|
+
t5 = $[12];
|
|
222
|
+
}
|
|
223
|
+
const content = t5;
|
|
64
224
|
const label = `Open source ${citation.index}: ${citation.title}`;
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
children: onOpen ? /*#__PURE__*/_jsx("button", {
|
|
225
|
+
let t6;
|
|
226
|
+
if ($[13] !== citation || $[14] !== content || $[15] !== label || $[16] !== onOpen) {
|
|
227
|
+
t6 = onOpen ? /*#__PURE__*/_jsx("button", {
|
|
69
228
|
type: "button",
|
|
70
229
|
"aria-label": label,
|
|
71
230
|
onClick: () => onOpen(citation),
|
|
72
|
-
className: cn(
|
|
231
|
+
className: cn(ruledRowClass, interactiveRowClass),
|
|
73
232
|
children: content
|
|
74
233
|
}) : citation.url ? /*#__PURE__*/_jsx("a", {
|
|
75
234
|
href: citation.url,
|
|
76
235
|
target: "_blank",
|
|
77
236
|
rel: "noreferrer",
|
|
78
237
|
"aria-label": label,
|
|
79
|
-
className: cn(
|
|
238
|
+
className: cn(ruledRowClass, interactiveRowClass),
|
|
80
239
|
children: content
|
|
81
240
|
}) : /*#__PURE__*/_jsx("div", {
|
|
82
|
-
className:
|
|
241
|
+
className: ruledRowClass,
|
|
83
242
|
children: content
|
|
84
|
-
})
|
|
85
|
-
|
|
243
|
+
});
|
|
244
|
+
$[13] = citation;
|
|
245
|
+
$[14] = content;
|
|
246
|
+
$[15] = label;
|
|
247
|
+
$[16] = onOpen;
|
|
248
|
+
$[17] = t6;
|
|
249
|
+
} else {
|
|
250
|
+
t6 = $[17];
|
|
251
|
+
}
|
|
252
|
+
let t7;
|
|
253
|
+
if ($[18] !== citation.index || $[19] !== t6) {
|
|
254
|
+
t7 = /*#__PURE__*/_jsx("li", {
|
|
255
|
+
"data-slot": "sources-item",
|
|
256
|
+
"data-index": citation.index,
|
|
257
|
+
children: t6
|
|
258
|
+
});
|
|
259
|
+
$[18] = citation.index;
|
|
260
|
+
$[19] = t6;
|
|
261
|
+
$[20] = t7;
|
|
262
|
+
} else {
|
|
263
|
+
t7 = $[20];
|
|
264
|
+
}
|
|
265
|
+
return t7;
|
|
86
266
|
}
|
package/dist/shared/panel.js
CHANGED
|
@@ -19,7 +19,7 @@ export function PanelHeader({
|
|
|
19
19
|
}) {
|
|
20
20
|
return /*#__PURE__*/_jsxs("header", {
|
|
21
21
|
"data-slot": "panel-header",
|
|
22
|
-
className: "eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
22
|
+
className: "locus-eyebrow flex items-center gap-2 px-5 pt-4 [&_svg]:size-3.5 [&_svg]:shrink-0",
|
|
23
23
|
children: [icon, /*#__PURE__*/_jsx("span", {
|
|
24
24
|
className: "min-w-0 truncate",
|
|
25
25
|
children: eyebrow
|
|
@@ -1,30 +1,106 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon } from "@carbon/icons-react";
|
|
2
5
|
import { ActionButton } from "./action-button.js";
|
|
3
6
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
-
export function BranchSwitcher({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
export function BranchSwitcher(t0) {
|
|
8
|
+
const $ = _c(20);
|
|
9
|
+
const {
|
|
10
|
+
branch,
|
|
11
|
+
onBranchChange
|
|
12
|
+
} = t0;
|
|
8
13
|
const position = branch.index + 1;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
const t1 = branch.index <= 0;
|
|
15
|
+
let t2;
|
|
16
|
+
if ($[0] !== branch.index || $[1] !== onBranchChange) {
|
|
17
|
+
t2 = () => onBranchChange(branch.index - 1);
|
|
18
|
+
$[0] = branch.index;
|
|
19
|
+
$[1] = onBranchChange;
|
|
20
|
+
$[2] = t2;
|
|
21
|
+
} else {
|
|
22
|
+
t2 = $[2];
|
|
23
|
+
}
|
|
24
|
+
let t3;
|
|
25
|
+
if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
|
|
26
|
+
t3 = /*#__PURE__*/_jsx(ChevronLeftIcon, {});
|
|
27
|
+
$[3] = t3;
|
|
28
|
+
} else {
|
|
29
|
+
t3 = $[3];
|
|
30
|
+
}
|
|
31
|
+
let t4;
|
|
32
|
+
if ($[4] !== t1 || $[5] !== t2) {
|
|
33
|
+
t4 = /*#__PURE__*/_jsx(ActionButton, {
|
|
15
34
|
label: "Previous version",
|
|
16
|
-
disabled:
|
|
17
|
-
onClick:
|
|
18
|
-
children:
|
|
19
|
-
})
|
|
35
|
+
disabled: t1,
|
|
36
|
+
onClick: t2,
|
|
37
|
+
children: t3
|
|
38
|
+
});
|
|
39
|
+
$[4] = t1;
|
|
40
|
+
$[5] = t2;
|
|
41
|
+
$[6] = t4;
|
|
42
|
+
} else {
|
|
43
|
+
t4 = $[6];
|
|
44
|
+
}
|
|
45
|
+
const t5 = `${position} / ${branch.count}`;
|
|
46
|
+
let t6;
|
|
47
|
+
if ($[7] !== t5) {
|
|
48
|
+
t6 = /*#__PURE__*/_jsx("span", {
|
|
20
49
|
"aria-live": "polite",
|
|
21
50
|
className: "min-w-9 text-center font-mono text-xs text-muted-foreground tabular-nums",
|
|
22
|
-
children:
|
|
23
|
-
})
|
|
51
|
+
children: t5
|
|
52
|
+
});
|
|
53
|
+
$[7] = t5;
|
|
54
|
+
$[8] = t6;
|
|
55
|
+
} else {
|
|
56
|
+
t6 = $[8];
|
|
57
|
+
}
|
|
58
|
+
const t7 = position >= branch.count;
|
|
59
|
+
let t8;
|
|
60
|
+
if ($[9] !== branch.index || $[10] !== onBranchChange) {
|
|
61
|
+
t8 = () => onBranchChange(branch.index + 1);
|
|
62
|
+
$[9] = branch.index;
|
|
63
|
+
$[10] = onBranchChange;
|
|
64
|
+
$[11] = t8;
|
|
65
|
+
} else {
|
|
66
|
+
t8 = $[11];
|
|
67
|
+
}
|
|
68
|
+
let t9;
|
|
69
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
70
|
+
t9 = /*#__PURE__*/_jsx(ChevronRightIcon, {});
|
|
71
|
+
$[12] = t9;
|
|
72
|
+
} else {
|
|
73
|
+
t9 = $[12];
|
|
74
|
+
}
|
|
75
|
+
let t10;
|
|
76
|
+
if ($[13] !== t7 || $[14] !== t8) {
|
|
77
|
+
t10 = /*#__PURE__*/_jsx(ActionButton, {
|
|
24
78
|
label: "Next version",
|
|
25
|
-
disabled:
|
|
26
|
-
onClick:
|
|
27
|
-
children:
|
|
28
|
-
})
|
|
29
|
-
|
|
79
|
+
disabled: t7,
|
|
80
|
+
onClick: t8,
|
|
81
|
+
children: t9
|
|
82
|
+
});
|
|
83
|
+
$[13] = t7;
|
|
84
|
+
$[14] = t8;
|
|
85
|
+
$[15] = t10;
|
|
86
|
+
} else {
|
|
87
|
+
t10 = $[15];
|
|
88
|
+
}
|
|
89
|
+
let t11;
|
|
90
|
+
if ($[16] !== t10 || $[17] !== t4 || $[18] !== t6) {
|
|
91
|
+
t11 = /*#__PURE__*/_jsxs("div", {
|
|
92
|
+
"data-slot": "branch-switcher",
|
|
93
|
+
role: "group",
|
|
94
|
+
"aria-label": "Reply versions",
|
|
95
|
+
className: "flex items-center",
|
|
96
|
+
children: [t4, t6, t10]
|
|
97
|
+
});
|
|
98
|
+
$[16] = t10;
|
|
99
|
+
$[17] = t4;
|
|
100
|
+
$[18] = t6;
|
|
101
|
+
$[19] = t11;
|
|
102
|
+
} else {
|
|
103
|
+
t11 = $[19];
|
|
104
|
+
}
|
|
105
|
+
return t11;
|
|
30
106
|
}
|
|
@@ -1,57 +1,154 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { c as _c } from "react/compiler-runtime";
|
|
1
4
|
import { ChevronDown as ChevronDownIcon } from "@carbon/icons-react";
|
|
2
5
|
import { Button, DropdownMenu, DropdownMenuContent, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuTrigger } from "@locusgraph/components";
|
|
3
6
|
import { formatDate } from "@locusgraph/utils";
|
|
4
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
-
export function VersionSwitcher({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
export function VersionSwitcher(t0) {
|
|
9
|
+
const $ = _c(26);
|
|
10
|
+
const {
|
|
11
|
+
versions,
|
|
12
|
+
current,
|
|
13
|
+
onVersionChange
|
|
14
|
+
} = t0;
|
|
15
|
+
let t1;
|
|
16
|
+
if ($[0] !== current.label) {
|
|
17
|
+
t1 = /*#__PURE__*/_jsx("span", {
|
|
13
18
|
"data-slot": "canvas-current-version",
|
|
14
19
|
children: current.label
|
|
15
|
-
})
|
|
20
|
+
});
|
|
21
|
+
$[0] = current.label;
|
|
22
|
+
$[1] = t1;
|
|
23
|
+
} else {
|
|
24
|
+
t1 = $[1];
|
|
25
|
+
}
|
|
26
|
+
let t2;
|
|
27
|
+
if ($[2] !== versions.length) {
|
|
28
|
+
t2 = versions.length > 1 && /*#__PURE__*/_jsxs("span", {
|
|
16
29
|
className: "text-muted-foreground",
|
|
17
30
|
children: ["of ", versions.length]
|
|
18
|
-
})
|
|
19
|
-
|
|
31
|
+
});
|
|
32
|
+
$[2] = versions.length;
|
|
33
|
+
$[3] = t2;
|
|
34
|
+
} else {
|
|
35
|
+
t2 = $[3];
|
|
36
|
+
}
|
|
37
|
+
const t3 = current.createdAt;
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[4] !== current.createdAt) {
|
|
40
|
+
t4 = formatDate(current.createdAt);
|
|
41
|
+
$[4] = current.createdAt;
|
|
42
|
+
$[5] = t4;
|
|
43
|
+
} else {
|
|
44
|
+
t4 = $[5];
|
|
45
|
+
}
|
|
46
|
+
let t5;
|
|
47
|
+
if ($[6] !== current.createdAt || $[7] !== t4) {
|
|
48
|
+
t5 = /*#__PURE__*/_jsx("time", {
|
|
49
|
+
dateTime: t3,
|
|
20
50
|
className: "text-muted-foreground",
|
|
21
|
-
children:
|
|
22
|
-
})
|
|
23
|
-
|
|
51
|
+
children: t4
|
|
52
|
+
});
|
|
53
|
+
$[6] = current.createdAt;
|
|
54
|
+
$[7] = t4;
|
|
55
|
+
$[8] = t5;
|
|
56
|
+
} else {
|
|
57
|
+
t5 = $[8];
|
|
58
|
+
}
|
|
59
|
+
let t6;
|
|
60
|
+
if ($[9] !== t1 || $[10] !== t2 || $[11] !== t5) {
|
|
61
|
+
t6 = /*#__PURE__*/_jsxs("span", {
|
|
62
|
+
className: "flex items-center gap-2 font-mono text-[11px] tabular-nums",
|
|
63
|
+
children: [t1, t2, t5]
|
|
64
|
+
});
|
|
65
|
+
$[9] = t1;
|
|
66
|
+
$[10] = t2;
|
|
67
|
+
$[11] = t5;
|
|
68
|
+
$[12] = t6;
|
|
69
|
+
} else {
|
|
70
|
+
t6 = $[12];
|
|
71
|
+
}
|
|
72
|
+
const label = t6;
|
|
24
73
|
if (versions.length < 2 || !onVersionChange) {
|
|
25
74
|
return label;
|
|
26
75
|
}
|
|
27
|
-
|
|
28
|
-
|
|
76
|
+
const t7 = `Version ${current.label}, choose another version`;
|
|
77
|
+
let t8;
|
|
78
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
79
|
+
t8 = /*#__PURE__*/_jsx(ChevronDownIcon, {});
|
|
80
|
+
$[13] = t8;
|
|
81
|
+
} else {
|
|
82
|
+
t8 = $[13];
|
|
83
|
+
}
|
|
84
|
+
let t9;
|
|
85
|
+
if ($[14] !== label || $[15] !== t7) {
|
|
86
|
+
t9 = /*#__PURE__*/_jsx(DropdownMenuTrigger, {
|
|
29
87
|
asChild: true,
|
|
30
88
|
children: /*#__PURE__*/_jsxs(Button, {
|
|
31
89
|
type: "button",
|
|
32
90
|
variant: "ghost",
|
|
33
91
|
size: "xs",
|
|
34
92
|
className: "-ml-2 font-normal",
|
|
35
|
-
"aria-label":
|
|
36
|
-
children: [label,
|
|
93
|
+
"aria-label": t7,
|
|
94
|
+
children: [label, t8]
|
|
37
95
|
})
|
|
38
|
-
})
|
|
96
|
+
});
|
|
97
|
+
$[14] = label;
|
|
98
|
+
$[15] = t7;
|
|
99
|
+
$[16] = t9;
|
|
100
|
+
} else {
|
|
101
|
+
t9 = $[16];
|
|
102
|
+
}
|
|
103
|
+
const t10 = current.id;
|
|
104
|
+
let t11;
|
|
105
|
+
if ($[17] !== versions) {
|
|
106
|
+
t11 = versions.map(_temp);
|
|
107
|
+
$[17] = versions;
|
|
108
|
+
$[18] = t11;
|
|
109
|
+
} else {
|
|
110
|
+
t11 = $[18];
|
|
111
|
+
}
|
|
112
|
+
let t12;
|
|
113
|
+
if ($[19] !== current.id || $[20] !== onVersionChange || $[21] !== t11) {
|
|
114
|
+
t12 = /*#__PURE__*/_jsx(DropdownMenuContent, {
|
|
39
115
|
align: "start",
|
|
40
116
|
sideOffset: 6,
|
|
41
117
|
children: /*#__PURE__*/_jsx(DropdownMenuRadioGroup, {
|
|
42
|
-
value:
|
|
118
|
+
value: t10,
|
|
43
119
|
onValueChange: onVersionChange,
|
|
44
|
-
children:
|
|
45
|
-
value: version.id,
|
|
46
|
-
children: [/*#__PURE__*/_jsx("span", {
|
|
47
|
-
className: "font-mono text-xs",
|
|
48
|
-
children: version.label
|
|
49
|
-
}), /*#__PURE__*/_jsx("span", {
|
|
50
|
-
className: "ml-auto pl-4 text-xs text-muted-foreground",
|
|
51
|
-
children: formatDate(version.createdAt)
|
|
52
|
-
})]
|
|
53
|
-
}, version.id))
|
|
120
|
+
children: t11
|
|
54
121
|
})
|
|
122
|
+
});
|
|
123
|
+
$[19] = current.id;
|
|
124
|
+
$[20] = onVersionChange;
|
|
125
|
+
$[21] = t11;
|
|
126
|
+
$[22] = t12;
|
|
127
|
+
} else {
|
|
128
|
+
t12 = $[22];
|
|
129
|
+
}
|
|
130
|
+
let t13;
|
|
131
|
+
if ($[23] !== t12 || $[24] !== t9) {
|
|
132
|
+
t13 = /*#__PURE__*/_jsxs(DropdownMenu, {
|
|
133
|
+
children: [t9, t12]
|
|
134
|
+
});
|
|
135
|
+
$[23] = t12;
|
|
136
|
+
$[24] = t9;
|
|
137
|
+
$[25] = t13;
|
|
138
|
+
} else {
|
|
139
|
+
t13 = $[25];
|
|
140
|
+
}
|
|
141
|
+
return t13;
|
|
142
|
+
}
|
|
143
|
+
function _temp(version) {
|
|
144
|
+
return /*#__PURE__*/_jsxs(DropdownMenuRadioItem, {
|
|
145
|
+
value: version.id,
|
|
146
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
147
|
+
className: "font-mono text-xs",
|
|
148
|
+
children: version.label
|
|
149
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
150
|
+
className: "ml-auto pl-4 text-xs text-muted-foreground",
|
|
151
|
+
children: formatDate(version.createdAt)
|
|
55
152
|
})]
|
|
56
|
-
});
|
|
153
|
+
}, version.id);
|
|
57
154
|
}
|
package/dist/thread/code/code.js
CHANGED
|
@@ -94,7 +94,7 @@ export function Code(t0) {
|
|
|
94
94
|
className: "min-w-0 truncate font-mono text-xs text-foreground",
|
|
95
95
|
children: filename
|
|
96
96
|
}) : /*#__PURE__*/_jsx("span", {
|
|
97
|
-
className: "eyebrow",
|
|
97
|
+
className: "locus-eyebrow",
|
|
98
98
|
children: language
|
|
99
99
|
});
|
|
100
100
|
$[10] = filename;
|
|
@@ -106,7 +106,7 @@ export function Code(t0) {
|
|
|
106
106
|
let t5;
|
|
107
107
|
if ($[13] !== filename || $[14] !== language) {
|
|
108
108
|
t5 = filename && /*#__PURE__*/_jsx("span", {
|
|
109
|
-
className: "eyebrow",
|
|
109
|
+
className: "locus-eyebrow",
|
|
110
110
|
children: language
|
|
111
111
|
});
|
|
112
112
|
$[13] = filename;
|