@locusgraph/loop 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/pulse/gradient-label.js +12 -62
- package/dist/agent/pulse/marks/bars-mark.js +15 -37
- package/dist/agent/pulse/marks/glyph-mark.js +15 -54
- package/dist/agent/pulse/marks/locus-mark.js +12 -36
- package/dist/agent/pulse/marks/orb-mark.js +9 -19
- package/dist/agent/pulse/marks/spinner-mark.js +20 -29
- package/dist/agent/pulse/pulse.js +36 -123
- package/dist/agent/pulse/use-loop-animation.js +12 -33
- package/dist/agent/steps/step-icon.js +26 -96
- package/dist/agent/steps/steps.js +47 -210
- package/dist/agent/tool/json-block.js +11 -31
- package/dist/agent/tool/tool-status.js +12 -35
- package/dist/approval/inbox/inbox-row.js +76 -301
- package/dist/approval/inbox/inbox.js +39 -190
- package/dist/approval/inbox/virtual-inbox-list.js +26 -102
- package/dist/approval/memory/memory-review.js +36 -170
- package/dist/approval/memory/memory-row.js +50 -185
- package/dist/approval/plan/plan-review.js +73 -223
- package/dist/approval/plan/plan-step-row.js +76 -180
- package/dist/approval/plan/question-choices.js +44 -130
- package/dist/approval/plan/question.js +38 -154
- package/dist/approval/run/run-bar.js +39 -123
- package/dist/approval/shared/risk-badge.js +9 -24
- package/dist/approval/shared/use-focus-on-mount.js +5 -21
- package/dist/approval/spend/raise-cap-form.js +48 -221
- package/dist/approval/spend/spend-gate.js +40 -155
- package/dist/approval/spend/spend-meter.js +85 -312
- package/dist/approval/tool/approval.js +35 -194
- package/dist/approval/tool/args/args-editor.js +46 -204
- package/dist/approval/tool/args/args-field.js +55 -238
- package/dist/approval/tool/deny-form.js +36 -123
- package/dist/approval/tool/tool-inputs.js +23 -88
- package/dist/chat/chat/use-stick-to-bottom.js +60 -113
- package/dist/chat/chat/virtual-chat-items.js +34 -127
- package/dist/chat/composer/composer-actions.js +46 -129
- package/dist/chat/composer/use-auto-grow.js +8 -23
- package/dist/chat/files/files.js +66 -291
- package/dist/chat/reply/fenced-code.js +10 -32
- package/dist/chat/reply/reply.js +24 -99
- package/dist/chat/turn/turn.js +46 -197
- package/dist/cost/context.js +65 -282
- package/dist/cost/cost-steps.js +42 -195
- package/dist/cost/cost.js +108 -497
- package/dist/cost/model-picker.js +42 -172
- package/dist/cost/shared/context-breakdown.js +64 -280
- package/dist/cost/shared/meter-marks.js +34 -92
- package/dist/cost/shared/model-option-row.js +35 -158
- package/dist/cost/shared/step-cost-row.js +37 -222
- package/dist/memory/cite.js +58 -179
- package/dist/memory/memorized.js +42 -194
- package/dist/memory/recall.js +68 -263
- package/dist/memory/shared/source-mark.js +10 -38
- package/dist/memory/sources.js +52 -230
- package/dist/shared/decision-summary.js +35 -117
- package/dist/shared/panel-empty.js +15 -73
- package/dist/shared/panel.js +65 -239
- package/dist/shared/status-dot.js +10 -32
- package/dist/thread/actions/action-button.js +10 -53
- package/dist/thread/actions/branch-switcher.js +21 -95
- package/dist/thread/canvas/version-switcher.js +31 -126
- package/dist/thread/code/copy-code-button.js +24 -56
- package/dist/thread/history/row/history-row.js +18 -97
- package/dist/thread/history/row/thread-item-menu.js +19 -72
- package/dist/thread/history/row/thread-title-editor.js +29 -72
- package/dist/thread/history/virtual-history-list.js +46 -82
- package/dist/thread/starters/starters.js +27 -87
- package/dist/thread/use-copied.js +10 -38
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { ArrowUp as ArrowUpIcon, Attachment as PaperclipIcon, StopFilledAlt as SquareIcon } from "@carbon/icons-react";
|
|
3
2
|
import { Button } from "@locusgraph/components";
|
|
4
3
|
import { useRef } from "react";
|
|
@@ -6,97 +5,45 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
6
5
|
export function isComposerBusy(status) {
|
|
7
6
|
return status === "submitting" || status === "streaming";
|
|
8
7
|
}
|
|
9
|
-
export function ComposerSubmit(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
onStop
|
|
15
|
-
} = t0;
|
|
8
|
+
export function ComposerSubmit({
|
|
9
|
+
status,
|
|
10
|
+
canSend,
|
|
11
|
+
onStop
|
|
12
|
+
}) {
|
|
16
13
|
if (isComposerBusy(status)) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
return /*#__PURE__*/_jsxs(Button, {
|
|
15
|
+
type: "button",
|
|
16
|
+
size: "sm",
|
|
17
|
+
variant: "outline",
|
|
18
|
+
"data-slot": "composer-stop",
|
|
19
|
+
"aria-label": "Stop",
|
|
20
|
+
disabled: !onStop,
|
|
21
|
+
onClick: onStop,
|
|
22
|
+
children: [/*#__PURE__*/_jsx(SquareIcon, {
|
|
21
23
|
"aria-hidden": "true",
|
|
22
24
|
className: "size-2.5 fill-current"
|
|
23
|
-
})
|
|
24
|
-
$[0] = t2;
|
|
25
|
-
} else {
|
|
26
|
-
t2 = $[0];
|
|
27
|
-
}
|
|
28
|
-
let t3;
|
|
29
|
-
if ($[1] !== onStop || $[2] !== t1) {
|
|
30
|
-
t3 = /*#__PURE__*/_jsxs(Button, {
|
|
31
|
-
type: "button",
|
|
32
|
-
size: "sm",
|
|
33
|
-
variant: "outline",
|
|
34
|
-
"data-slot": "composer-stop",
|
|
35
|
-
"aria-label": "Stop",
|
|
36
|
-
disabled: t1,
|
|
37
|
-
onClick: onStop,
|
|
38
|
-
children: [t2, "Stop"]
|
|
39
|
-
});
|
|
40
|
-
$[1] = onStop;
|
|
41
|
-
$[2] = t1;
|
|
42
|
-
$[3] = t3;
|
|
43
|
-
} else {
|
|
44
|
-
t3 = $[3];
|
|
45
|
-
}
|
|
46
|
-
return t3;
|
|
47
|
-
}
|
|
48
|
-
const t1 = !canSend;
|
|
49
|
-
let t2;
|
|
50
|
-
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
51
|
-
t2 = /*#__PURE__*/_jsx(ArrowUpIcon, {
|
|
52
|
-
"aria-hidden": "true"
|
|
53
|
-
});
|
|
54
|
-
$[4] = t2;
|
|
55
|
-
} else {
|
|
56
|
-
t2 = $[4];
|
|
57
|
-
}
|
|
58
|
-
let t3;
|
|
59
|
-
if ($[5] !== t1) {
|
|
60
|
-
t3 = /*#__PURE__*/_jsx(Button, {
|
|
61
|
-
type: "submit",
|
|
62
|
-
size: "icon-sm",
|
|
63
|
-
"data-slot": "composer-send",
|
|
64
|
-
"aria-label": "Send",
|
|
65
|
-
disabled: t1,
|
|
66
|
-
children: t2
|
|
25
|
+
}), "Stop"]
|
|
67
26
|
});
|
|
68
|
-
$[5] = t1;
|
|
69
|
-
$[6] = t3;
|
|
70
|
-
} else {
|
|
71
|
-
t3 = $[6];
|
|
72
27
|
}
|
|
73
|
-
return
|
|
28
|
+
return /*#__PURE__*/_jsx(Button, {
|
|
29
|
+
type: "submit",
|
|
30
|
+
size: "icon-sm",
|
|
31
|
+
"data-slot": "composer-send",
|
|
32
|
+
"aria-label": "Send",
|
|
33
|
+
disabled: !canSend,
|
|
34
|
+
children: /*#__PURE__*/_jsx(ArrowUpIcon, {
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
})
|
|
37
|
+
});
|
|
74
38
|
}
|
|
75
|
-
export function ComposerAttachButton(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
onAttachFiles
|
|
81
|
-
} = t0;
|
|
39
|
+
export function ComposerAttachButton({
|
|
40
|
+
accept,
|
|
41
|
+
disabled,
|
|
42
|
+
onAttachFiles
|
|
43
|
+
}) {
|
|
82
44
|
const inputRef = useRef(null);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
t1 = event => {
|
|
86
|
-
const picked = Array.from(event.currentTarget.files ?? []);
|
|
87
|
-
event.currentTarget.value = "";
|
|
88
|
-
if (picked.length > 0) {
|
|
89
|
-
onAttachFiles(picked);
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
$[0] = onAttachFiles;
|
|
93
|
-
$[1] = t1;
|
|
94
|
-
} else {
|
|
95
|
-
t1 = $[1];
|
|
96
|
-
}
|
|
97
|
-
let t2;
|
|
98
|
-
if ($[2] !== accept || $[3] !== t1) {
|
|
99
|
-
t2 = /*#__PURE__*/_jsx("input", {
|
|
45
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
46
|
+
children: [/*#__PURE__*/_jsx("input", {
|
|
100
47
|
ref: inputRef,
|
|
101
48
|
type: "file",
|
|
102
49
|
multiple: true,
|
|
@@ -104,30 +51,14 @@ export function ComposerAttachButton(t0) {
|
|
|
104
51
|
accept: accept,
|
|
105
52
|
tabIndex: -1,
|
|
106
53
|
"aria-hidden": "true",
|
|
107
|
-
onChange:
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
let t3;
|
|
116
|
-
let t4;
|
|
117
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t3 = () => inputRef.current?.click();
|
|
119
|
-
t4 = /*#__PURE__*/_jsx(PaperclipIcon, {
|
|
120
|
-
"aria-hidden": "true"
|
|
121
|
-
});
|
|
122
|
-
$[5] = t3;
|
|
123
|
-
$[6] = t4;
|
|
124
|
-
} else {
|
|
125
|
-
t3 = $[5];
|
|
126
|
-
t4 = $[6];
|
|
127
|
-
}
|
|
128
|
-
let t5;
|
|
129
|
-
if ($[7] !== disabled) {
|
|
130
|
-
t5 = /*#__PURE__*/_jsx(Button, {
|
|
54
|
+
onChange: event => {
|
|
55
|
+
const picked = Array.from(event.currentTarget.files ?? []);
|
|
56
|
+
event.currentTarget.value = "";
|
|
57
|
+
if (picked.length > 0) {
|
|
58
|
+
onAttachFiles(picked);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
131
62
|
type: "button",
|
|
132
63
|
size: "icon-sm",
|
|
133
64
|
variant: "ghost",
|
|
@@ -135,24 +66,10 @@ export function ComposerAttachButton(t0) {
|
|
|
135
66
|
"aria-label": "Attach files",
|
|
136
67
|
className: "text-muted-foreground hover:text-foreground",
|
|
137
68
|
disabled: disabled,
|
|
138
|
-
onClick:
|
|
139
|
-
children:
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
t5 = $[8];
|
|
145
|
-
}
|
|
146
|
-
let t6;
|
|
147
|
-
if ($[9] !== t2 || $[10] !== t5) {
|
|
148
|
-
t6 = /*#__PURE__*/_jsxs(_Fragment, {
|
|
149
|
-
children: [t2, t5]
|
|
150
|
-
});
|
|
151
|
-
$[9] = t2;
|
|
152
|
-
$[10] = t5;
|
|
153
|
-
$[11] = t6;
|
|
154
|
-
} else {
|
|
155
|
-
t6 = $[11];
|
|
156
|
-
}
|
|
157
|
-
return t6;
|
|
69
|
+
onClick: () => inputRef.current?.click(),
|
|
70
|
+
children: /*#__PURE__*/_jsx(PaperclipIcon, {
|
|
71
|
+
"aria-hidden": "true"
|
|
72
|
+
})
|
|
73
|
+
})]
|
|
74
|
+
});
|
|
158
75
|
}
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { useLayoutEffect } from "react";
|
|
3
2
|
function supportsFieldSizing() {
|
|
4
3
|
return typeof CSS !== "undefined" && CSS.supports?.("field-sizing", "content") === true;
|
|
5
4
|
}
|
|
6
5
|
export function useAutoGrow(textareaRef, text) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
textarea.style.height = "auto";
|
|
17
|
-
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
18
|
-
};
|
|
19
|
-
t1 = [textareaRef, text];
|
|
20
|
-
$[0] = text;
|
|
21
|
-
$[1] = textareaRef;
|
|
22
|
-
$[2] = t0;
|
|
23
|
-
$[3] = t1;
|
|
24
|
-
} else {
|
|
25
|
-
t0 = $[2];
|
|
26
|
-
t1 = $[3];
|
|
27
|
-
}
|
|
28
|
-
useLayoutEffect(t0, t1);
|
|
6
|
+
useLayoutEffect(() => {
|
|
7
|
+
const textarea = textareaRef.current;
|
|
8
|
+
if (!textarea || supportsFieldSizing() || text === undefined) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
textarea.style.height = "auto";
|
|
12
|
+
textarea.style.height = `${textarea.scrollHeight}px`;
|
|
13
|
+
}, [textareaRef, text]);
|
|
29
14
|
}
|
package/dist/chat/files/files.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { Code as FileCodeIcon, DocumentBlank as FileIcon, DataTable as FileSpreadsheetIcon, Document as FileTextIcon, Close as XIcon } from "@carbon/icons-react";
|
|
3
2
|
import { cn } from "@locusgraph/components";
|
|
4
3
|
import { fileExtensionLabel, formatBytes, isImageFile } from "./file-meta.js";
|
|
@@ -13,33 +12,15 @@ function describeFile(item) {
|
|
|
13
12
|
const description = parts.filter(Boolean).join(" · ");
|
|
14
13
|
return description || undefined;
|
|
15
14
|
}
|
|
16
|
-
function FilePreview(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
$[0] = item.mediaType;
|
|
26
|
-
$[1] = t1;
|
|
27
|
-
} else {
|
|
28
|
-
t1 = $[1];
|
|
29
|
-
}
|
|
30
|
-
const Icon = t1;
|
|
31
|
-
const t2 = isGrid ? "aspect-[16/10] w-full" : "size-10";
|
|
32
|
-
let t3;
|
|
33
|
-
if ($[2] !== t2) {
|
|
34
|
-
t3 = cn("grid shrink-0 place-items-center overflow-hidden bg-muted text-muted-foreground", t2);
|
|
35
|
-
$[2] = t2;
|
|
36
|
-
$[3] = t3;
|
|
37
|
-
} else {
|
|
38
|
-
t3 = $[3];
|
|
39
|
-
}
|
|
40
|
-
let t4;
|
|
41
|
-
if ($[4] !== Icon || $[5] !== isGrid || $[6] !== item) {
|
|
42
|
-
t4 = isImageFile(item) ? /*#__PURE__*/_jsx("img", {
|
|
15
|
+
function FilePreview({
|
|
16
|
+
item,
|
|
17
|
+
isGrid
|
|
18
|
+
}) {
|
|
19
|
+
const Icon = iconForMediaType(item.mediaType);
|
|
20
|
+
return /*#__PURE__*/_jsx("span", {
|
|
21
|
+
"data-slot": "files-preview",
|
|
22
|
+
className: cn("grid shrink-0 place-items-center overflow-hidden bg-muted text-muted-foreground", isGrid ? "aspect-[16/10] w-full" : "size-10"),
|
|
23
|
+
children: isImageFile(item) ? /*#__PURE__*/_jsx("img", {
|
|
43
24
|
src: item.url,
|
|
44
25
|
alt: "",
|
|
45
26
|
loading: "lazy",
|
|
@@ -47,281 +28,75 @@ function FilePreview(t0) {
|
|
|
47
28
|
}) : /*#__PURE__*/_jsx(Icon, {
|
|
48
29
|
"aria-hidden": "true",
|
|
49
30
|
className: isGrid ? "size-6" : "size-4"
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
$[5] = isGrid;
|
|
53
|
-
$[6] = item;
|
|
54
|
-
$[7] = t4;
|
|
55
|
-
} else {
|
|
56
|
-
t4 = $[7];
|
|
57
|
-
}
|
|
58
|
-
let t5;
|
|
59
|
-
if ($[8] !== t3 || $[9] !== t4) {
|
|
60
|
-
t5 = /*#__PURE__*/_jsx("span", {
|
|
61
|
-
"data-slot": "files-preview",
|
|
62
|
-
className: t3,
|
|
63
|
-
children: t4
|
|
64
|
-
});
|
|
65
|
-
$[8] = t3;
|
|
66
|
-
$[9] = t4;
|
|
67
|
-
$[10] = t5;
|
|
68
|
-
} else {
|
|
69
|
-
t5 = $[10];
|
|
70
|
-
}
|
|
71
|
-
return t5;
|
|
31
|
+
})
|
|
32
|
+
});
|
|
72
33
|
}
|
|
73
|
-
function RemoveButton(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
$[0] = item.id;
|
|
85
|
-
$[1] = onRemove;
|
|
86
|
-
$[2] = t2;
|
|
87
|
-
} else {
|
|
88
|
-
t2 = $[2];
|
|
89
|
-
}
|
|
90
|
-
const t3 = isGrid && "absolute top-1 right-1 bg-card/90";
|
|
91
|
-
let t4;
|
|
92
|
-
if ($[3] !== t3) {
|
|
93
|
-
t4 = cn("grid size-6 shrink-0 place-items-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring", t3);
|
|
94
|
-
$[3] = t3;
|
|
95
|
-
$[4] = t4;
|
|
96
|
-
} else {
|
|
97
|
-
t4 = $[4];
|
|
98
|
-
}
|
|
99
|
-
let t5;
|
|
100
|
-
if ($[5] === Symbol.for("react.memo_cache_sentinel")) {
|
|
101
|
-
t5 = /*#__PURE__*/_jsx(XIcon, {
|
|
34
|
+
function RemoveButton({
|
|
35
|
+
item,
|
|
36
|
+
isGrid,
|
|
37
|
+
onRemove
|
|
38
|
+
}) {
|
|
39
|
+
return /*#__PURE__*/_jsx("button", {
|
|
40
|
+
type: "button",
|
|
41
|
+
"aria-label": `Remove ${item.name}`,
|
|
42
|
+
onClick: () => onRemove(item.id),
|
|
43
|
+
className: cn("grid size-6 shrink-0 place-items-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring", isGrid && "absolute top-1 right-1 bg-card/90"),
|
|
44
|
+
children: /*#__PURE__*/_jsx(XIcon, {
|
|
102
45
|
"aria-hidden": "true",
|
|
103
46
|
className: "size-3.5"
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
} else {
|
|
107
|
-
t5 = $[5];
|
|
108
|
-
}
|
|
109
|
-
let t6;
|
|
110
|
-
if ($[6] !== t1 || $[7] !== t2 || $[8] !== t4) {
|
|
111
|
-
t6 = /*#__PURE__*/_jsx("button", {
|
|
112
|
-
type: "button",
|
|
113
|
-
"aria-label": t1,
|
|
114
|
-
onClick: t2,
|
|
115
|
-
className: t4,
|
|
116
|
-
children: t5
|
|
117
|
-
});
|
|
118
|
-
$[6] = t1;
|
|
119
|
-
$[7] = t2;
|
|
120
|
-
$[8] = t4;
|
|
121
|
-
$[9] = t6;
|
|
122
|
-
} else {
|
|
123
|
-
t6 = $[9];
|
|
124
|
-
}
|
|
125
|
-
return t6;
|
|
47
|
+
})
|
|
48
|
+
});
|
|
126
49
|
}
|
|
127
|
-
function FileChip(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
$[0] = item;
|
|
138
|
-
$[1] = t1;
|
|
139
|
-
} else {
|
|
140
|
-
t1 = $[1];
|
|
141
|
-
}
|
|
142
|
-
const description = t1;
|
|
143
|
-
const t2 = isGrid ? "flex-col" : "w-60 max-w-full items-center gap-2.5 pr-1";
|
|
144
|
-
const t3 = !isGrid && !onRemove && "pr-3";
|
|
145
|
-
let t4;
|
|
146
|
-
if ($[2] !== t2 || $[3] !== t3) {
|
|
147
|
-
t4 = cn("relative flex min-w-0 bg-card text-card-foreground ring-1 ring-border", t2, t3);
|
|
148
|
-
$[2] = t2;
|
|
149
|
-
$[3] = t3;
|
|
150
|
-
$[4] = t4;
|
|
151
|
-
} else {
|
|
152
|
-
t4 = $[4];
|
|
153
|
-
}
|
|
154
|
-
let t5;
|
|
155
|
-
if ($[5] !== isGrid || $[6] !== item) {
|
|
156
|
-
t5 = /*#__PURE__*/_jsx(FilePreview, {
|
|
50
|
+
function FileChip({
|
|
51
|
+
item,
|
|
52
|
+
isGrid,
|
|
53
|
+
onRemove
|
|
54
|
+
}) {
|
|
55
|
+
const description = describeFile(item);
|
|
56
|
+
return /*#__PURE__*/_jsxs("li", {
|
|
57
|
+
"data-slot": "files-item",
|
|
58
|
+
className: cn("relative flex min-w-0 bg-card text-card-foreground ring-1 ring-border", isGrid ? "flex-col" : "w-60 max-w-full items-center gap-2.5 pr-1", !isGrid && !onRemove && "pr-3"),
|
|
59
|
+
children: [/*#__PURE__*/_jsx(FilePreview, {
|
|
157
60
|
item: item,
|
|
158
61
|
isGrid: isGrid
|
|
159
|
-
})
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
$[8] = t6;
|
|
171
|
-
$[9] = t7;
|
|
172
|
-
} else {
|
|
173
|
-
t7 = $[9];
|
|
174
|
-
}
|
|
175
|
-
let t8;
|
|
176
|
-
if ($[10] !== item.name) {
|
|
177
|
-
t8 = /*#__PURE__*/_jsx("span", {
|
|
178
|
-
title: item.name,
|
|
179
|
-
className: "truncate text-xs leading-tight font-medium",
|
|
180
|
-
children: item.name
|
|
181
|
-
});
|
|
182
|
-
$[10] = item.name;
|
|
183
|
-
$[11] = t8;
|
|
184
|
-
} else {
|
|
185
|
-
t8 = $[11];
|
|
186
|
-
}
|
|
187
|
-
let t9;
|
|
188
|
-
if ($[12] !== description) {
|
|
189
|
-
t9 = description && /*#__PURE__*/_jsx("span", {
|
|
190
|
-
className: "truncate font-mono text-xs leading-tight text-muted-foreground tabular-nums",
|
|
191
|
-
children: description
|
|
192
|
-
});
|
|
193
|
-
$[12] = description;
|
|
194
|
-
$[13] = t9;
|
|
195
|
-
} else {
|
|
196
|
-
t9 = $[13];
|
|
197
|
-
}
|
|
198
|
-
let t10;
|
|
199
|
-
if ($[14] !== t7 || $[15] !== t8 || $[16] !== t9) {
|
|
200
|
-
t10 = /*#__PURE__*/_jsxs("span", {
|
|
201
|
-
className: t7,
|
|
202
|
-
children: [t8, t9]
|
|
203
|
-
});
|
|
204
|
-
$[14] = t7;
|
|
205
|
-
$[15] = t8;
|
|
206
|
-
$[16] = t9;
|
|
207
|
-
$[17] = t10;
|
|
208
|
-
} else {
|
|
209
|
-
t10 = $[17];
|
|
210
|
-
}
|
|
211
|
-
let t11;
|
|
212
|
-
if ($[18] !== isGrid || $[19] !== item || $[20] !== onRemove) {
|
|
213
|
-
t11 = onRemove && /*#__PURE__*/_jsx(RemoveButton, {
|
|
62
|
+
}), /*#__PURE__*/_jsxs("span", {
|
|
63
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-0.5", isGrid && "px-2.5 py-2"),
|
|
64
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
65
|
+
title: item.name,
|
|
66
|
+
className: "truncate text-xs leading-tight font-medium",
|
|
67
|
+
children: item.name
|
|
68
|
+
}), description && /*#__PURE__*/_jsx("span", {
|
|
69
|
+
className: "truncate font-mono text-xs leading-tight text-muted-foreground tabular-nums",
|
|
70
|
+
children: description
|
|
71
|
+
})]
|
|
72
|
+
}), onRemove && /*#__PURE__*/_jsx(RemoveButton, {
|
|
214
73
|
item: item,
|
|
215
74
|
isGrid: isGrid,
|
|
216
75
|
onRemove: onRemove
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
$[19] = item;
|
|
220
|
-
$[20] = onRemove;
|
|
221
|
-
$[21] = t11;
|
|
222
|
-
} else {
|
|
223
|
-
t11 = $[21];
|
|
224
|
-
}
|
|
225
|
-
let t12;
|
|
226
|
-
if ($[22] !== t10 || $[23] !== t11 || $[24] !== t4 || $[25] !== t5) {
|
|
227
|
-
t12 = /*#__PURE__*/_jsxs("li", {
|
|
228
|
-
"data-slot": "files-item",
|
|
229
|
-
className: t4,
|
|
230
|
-
children: [t5, t10, t11]
|
|
231
|
-
});
|
|
232
|
-
$[22] = t10;
|
|
233
|
-
$[23] = t11;
|
|
234
|
-
$[24] = t4;
|
|
235
|
-
$[25] = t5;
|
|
236
|
-
$[26] = t12;
|
|
237
|
-
} else {
|
|
238
|
-
t12 = $[26];
|
|
239
|
-
}
|
|
240
|
-
return t12;
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
241
78
|
}
|
|
242
|
-
export function Files(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if ($[0] !== t0) {
|
|
250
|
-
({
|
|
251
|
-
items,
|
|
252
|
-
layout: t1,
|
|
253
|
-
onRemove,
|
|
254
|
-
className,
|
|
255
|
-
...props
|
|
256
|
-
} = t0);
|
|
257
|
-
$[0] = t0;
|
|
258
|
-
$[1] = className;
|
|
259
|
-
$[2] = items;
|
|
260
|
-
$[3] = onRemove;
|
|
261
|
-
$[4] = props;
|
|
262
|
-
$[5] = t1;
|
|
263
|
-
} else {
|
|
264
|
-
className = $[1];
|
|
265
|
-
items = $[2];
|
|
266
|
-
onRemove = $[3];
|
|
267
|
-
props = $[4];
|
|
268
|
-
t1 = $[5];
|
|
269
|
-
}
|
|
270
|
-
const layout = t1 === undefined ? "inline" : t1;
|
|
79
|
+
export function Files({
|
|
80
|
+
items,
|
|
81
|
+
layout = "inline",
|
|
82
|
+
onRemove,
|
|
83
|
+
className,
|
|
84
|
+
...props
|
|
85
|
+
}) {
|
|
271
86
|
if (items.length === 0) {
|
|
272
87
|
return null;
|
|
273
88
|
}
|
|
274
89
|
const isGrid = layout === "grid";
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
let t5;
|
|
288
|
-
if ($[13] !== isGrid || $[14] !== onRemove) {
|
|
289
|
-
t5 = item => /*#__PURE__*/_jsx(FileChip, {
|
|
290
|
-
item: item,
|
|
291
|
-
isGrid: isGrid,
|
|
292
|
-
onRemove: onRemove
|
|
293
|
-
}, item.id);
|
|
294
|
-
$[13] = isGrid;
|
|
295
|
-
$[14] = onRemove;
|
|
296
|
-
$[15] = t5;
|
|
297
|
-
} else {
|
|
298
|
-
t5 = $[15];
|
|
299
|
-
}
|
|
300
|
-
t4 = items.map(t5);
|
|
301
|
-
$[9] = isGrid;
|
|
302
|
-
$[10] = items;
|
|
303
|
-
$[11] = onRemove;
|
|
304
|
-
$[12] = t4;
|
|
305
|
-
} else {
|
|
306
|
-
t4 = $[12];
|
|
307
|
-
}
|
|
308
|
-
let t5;
|
|
309
|
-
if ($[16] !== layout || $[17] !== props || $[18] !== t3 || $[19] !== t4) {
|
|
310
|
-
t5 = /*#__PURE__*/_jsx("ul", {
|
|
311
|
-
"data-slot": "files",
|
|
312
|
-
"data-layout": layout,
|
|
313
|
-
"aria-label": "Files",
|
|
314
|
-
className: t3,
|
|
315
|
-
...props,
|
|
316
|
-
children: t4
|
|
317
|
-
});
|
|
318
|
-
$[16] = layout;
|
|
319
|
-
$[17] = props;
|
|
320
|
-
$[18] = t3;
|
|
321
|
-
$[19] = t4;
|
|
322
|
-
$[20] = t5;
|
|
323
|
-
} else {
|
|
324
|
-
t5 = $[20];
|
|
325
|
-
}
|
|
326
|
-
return t5;
|
|
90
|
+
return /*#__PURE__*/_jsx("ul", {
|
|
91
|
+
"data-slot": "files",
|
|
92
|
+
"data-layout": layout,
|
|
93
|
+
"aria-label": "Files",
|
|
94
|
+
className: cn(isGrid ? "grid grid-cols-2 gap-2 sm:grid-cols-3" : "flex flex-wrap gap-2", className),
|
|
95
|
+
...props,
|
|
96
|
+
children: items.map(item => /*#__PURE__*/_jsx(FileChip, {
|
|
97
|
+
item: item,
|
|
98
|
+
isGrid: isGrid,
|
|
99
|
+
onRemove: onRemove
|
|
100
|
+
}, item.id))
|
|
101
|
+
});
|
|
327
102
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
1
|
import { Code } from "../../thread/code/code.js";
|
|
3
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
3
|
function textOf(child) {
|
|
@@ -19,35 +18,14 @@ export function fencedCode(node) {
|
|
|
19
18
|
language: languageOf(code.properties.className)
|
|
20
19
|
};
|
|
21
20
|
}
|
|
22
|
-
export function FencedCode(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} else {
|
|
33
|
-
t1 = $[1];
|
|
34
|
-
}
|
|
35
|
-
const fenced = t1;
|
|
36
|
-
if (!fenced) {
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
let t2;
|
|
40
|
-
if ($[2] !== fenced.code || $[3] !== fenced.language) {
|
|
41
|
-
t2 = /*#__PURE__*/_jsx(Code, {
|
|
42
|
-
code: fenced.code,
|
|
43
|
-
language: fenced.language,
|
|
44
|
-
className: "mt-4 first:mt-0"
|
|
45
|
-
});
|
|
46
|
-
$[2] = fenced.code;
|
|
47
|
-
$[3] = fenced.language;
|
|
48
|
-
$[4] = t2;
|
|
49
|
-
} else {
|
|
50
|
-
t2 = $[4];
|
|
51
|
-
}
|
|
52
|
-
return t2;
|
|
21
|
+
export function FencedCode({
|
|
22
|
+
node
|
|
23
|
+
}) {
|
|
24
|
+
const fenced = fencedCode(node);
|
|
25
|
+
if (!fenced) return null;
|
|
26
|
+
return /*#__PURE__*/_jsx(Code, {
|
|
27
|
+
code: fenced.code,
|
|
28
|
+
language: fenced.language,
|
|
29
|
+
className: "mt-4 first:mt-0"
|
|
30
|
+
});
|
|
53
31
|
}
|