devnonla-ui 0.19.1 → 0.20.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/README.md +11 -0
- package/package.json +1 -1
- package/src/alert/Alert.tsx +7 -7
- package/src/app/App.tsx +11 -7
- package/src/breadcrumb/Breadcrumb.tsx +80 -0
- package/src/button/Button.tsx +48 -33
- package/src/button/ButtonCopy.tsx +2 -2
- package/src/calendar/Calendar.tsx +12 -12
- package/src/card/Card.tsx +15 -10
- package/src/chat/AgentPanel.tsx +1 -1
- package/src/chat/index.ts +1 -5
- package/src/chat/message-ui/ChatError.tsx +1 -1
- package/src/chat/message-ui/ChatInput.tsx +4 -4
- package/src/chat/message-ui/ChatThinking.tsx +1 -1
- package/src/chat/message-ui/ChatUserMessage.tsx +3 -3
- package/src/chat/message-ui/ChatWelcome.tsx +2 -2
- package/src/chat/tool-ui/BackgroundTasksBar.tsx +6 -6
- package/src/chat/tool-ui/ChatToolCall.tsx +4 -4
- package/src/chat/tool-ui/ToolUiBadge.tsx +1 -1
- package/src/chat/tool-ui/ToolUiTrailing.tsx +1 -1
- package/src/chat/tool-ui/registry.ts +5 -19
- package/src/checkbox/Checkbox.tsx +12 -10
- package/src/colorpicker/ColorPicker.tsx +2 -2
- package/src/command-palette/CommandPalette.tsx +223 -0
- package/src/drawer/Drawer.tsx +1 -1
- package/src/dropdown/Dropdown.tsx +4 -3
- package/src/dropdown/menuClasses.ts +2 -2
- package/src/empty/Empty.tsx +23 -9
- package/src/form/FormItem.tsx +1 -1
- package/src/form/variants/FieldRadio.tsx +2 -2
- package/src/form/variants/FieldRepeaterItem.tsx +1 -1
- package/src/icon/Icon.tsx +14 -4
- package/src/icon/glyphs.ts +47 -38
- package/src/index.ts +8 -2
- package/src/input/EditableInput.tsx +3 -3
- package/src/input/Input.tsx +30 -13
- package/src/kbd/Kbd.tsx +32 -0
- package/src/lib/cn.ts +7 -0
- package/src/lib/markdownScale.ts +18 -7
- package/src/lib/sizes.ts +1 -1
- package/src/lib/surface.ts +2 -2
- package/src/markdown-editor/MarkdownDiff.tsx +4 -4
- package/src/markdown-editor/MarkdownPreview.tsx +1 -1
- package/src/markdown-editor/MarkdownSource.tsx +2 -2
- package/src/markdown-editor/MarkdownTable.tsx +2 -2
- package/src/markdown-editor/MarkdownViewer.tsx +8 -8
- package/src/markdown-editor/MermaidBlock.tsx +5 -5
- package/src/markdown-editor/ReactCodeFrame.tsx +1 -1
- package/src/menu/Menu.tsx +2 -2
- package/src/message/message.tsx +8 -8
- package/src/modal/Modal.tsx +2 -2
- package/src/page-header/PageHeader.tsx +33 -0
- package/src/pagination/Pagination.tsx +3 -3
- package/src/popconfirm/Popconfirm.tsx +3 -3
- package/src/scroll/OverlayScroll.tsx +1 -1
- package/src/segmented/Segmented.tsx +16 -7
- package/src/select/Select.tsx +76 -47
- package/src/sidebar/Sidebar.tsx +15 -4
- package/src/sortable-tree/SortableTree.tsx +1 -1
- package/src/splitter/Splitter.tsx +1 -1
- package/src/styles.css +262 -49
- package/src/switch/Switch.tsx +21 -20
- package/src/table/Table.tsx +32 -18
- package/src/tabs/Tabs.tsx +16 -13
- package/src/tag/Tag.tsx +16 -7
- package/src/theme-switcher/ThemeSwitcher.tsx +1 -1
- package/src/timepicker/TimePicker.tsx +2 -2
- package/src/tooltip/Tooltip.tsx +25 -3
- package/src/typography/Typography.tsx +3 -5
- package/src/blob-shape/BlobShape.tsx +0 -337
- package/src/chat/tool-ui/GetCurrentTimeToolUI.tsx +0 -51
- package/src/chat/tool-ui/ReadSkillToolUI.tsx +0 -82
- package/src/chat/tool-ui/RunJsToolUI.tsx +0 -108
- package/src/chat/tool-ui/WebFetchToolUI.tsx +0 -64
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { type CSSProperties, type ReactNode, useId } from "react";
|
|
2
|
-
import { cn } from "../lib/cn";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* `blob`, `blob-alt`, `ring`, `orb`, `square`, `star`, `circle`, `cursor` are background decorations.
|
|
6
|
-
* `horizontal`, `fade`, `dashed`, `double`, `ornament`, `zigzag`, `wave`, `waves`, `mountain`, `vertical` are thin line dividers.
|
|
7
|
-
*/
|
|
8
|
-
export type BlobShapeVariant =
|
|
9
|
-
| "blob"
|
|
10
|
-
| "blob-alt"
|
|
11
|
-
| "ring"
|
|
12
|
-
| "orb"
|
|
13
|
-
| "square"
|
|
14
|
-
| "star"
|
|
15
|
-
| "circle"
|
|
16
|
-
| "cursor"
|
|
17
|
-
| "horizontal"
|
|
18
|
-
| "fade"
|
|
19
|
-
| "dashed"
|
|
20
|
-
| "double"
|
|
21
|
-
| "ornament"
|
|
22
|
-
| "zigzag"
|
|
23
|
-
| "wave"
|
|
24
|
-
| "waves"
|
|
25
|
-
| "mountain"
|
|
26
|
-
| "vertical";
|
|
27
|
-
|
|
28
|
-
type DividerVariant = Extract<BlobShapeVariant, "horizontal" | "fade" | "dashed" | "double" | "ornament" | "zigzag" | "wave" | "waves" | "mountain" | "vertical">;
|
|
29
|
-
|
|
30
|
-
/** How a closed shape is painted. Dividers are lines, so they ignore it. */
|
|
31
|
-
export type BlobShapeAppearance = "solid" | "outline" | "sticker";
|
|
32
|
-
|
|
33
|
-
export type BlobShapeProps = {
|
|
34
|
-
variant?: BlobShapeVariant;
|
|
35
|
-
/** Fill color, or stroke for `outline` and dividers. Any CSS color works, including `var(--nonla-*)`. Defaults to brand. */
|
|
36
|
-
color?: string;
|
|
37
|
-
/** Width in px or any CSS length. Decorations default to 320. Dividers default to `100%`, and `vertical` defaults to `1`. */
|
|
38
|
-
width?: number | string;
|
|
39
|
-
/** Explicit height. Usually omit it so the aspect ratio holds. */
|
|
40
|
-
height?: number | string;
|
|
41
|
-
/** Opacity from 0 to 1. */
|
|
42
|
-
opacity?: number;
|
|
43
|
-
/** Gaussian blur in px. Softens edges for glow-style backgrounds. */
|
|
44
|
-
blur?: number;
|
|
45
|
-
/** Mirror horizontally. */
|
|
46
|
-
flipX?: boolean;
|
|
47
|
-
/** Mirror vertically. Use it to put a divider on the top edge of a section. */
|
|
48
|
-
flipY?: boolean;
|
|
49
|
-
/** `solid` fills the shape. `outline` strokes its edge. `sticker` adds a white border and a drop shadow. Dividers ignore it. */
|
|
50
|
-
appearance?: BlobShapeAppearance;
|
|
51
|
-
className?: string;
|
|
52
|
-
style?: CSSProperties;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const DIVIDER_VARIANTS: ReadonlySet<BlobShapeVariant> = new Set<BlobShapeVariant>([
|
|
56
|
-
"horizontal",
|
|
57
|
-
"fade",
|
|
58
|
-
"dashed",
|
|
59
|
-
"double",
|
|
60
|
-
"ornament",
|
|
61
|
-
"zigzag",
|
|
62
|
-
"wave",
|
|
63
|
-
"waves",
|
|
64
|
-
"mountain",
|
|
65
|
-
"vertical",
|
|
66
|
-
]);
|
|
67
|
-
|
|
68
|
-
/** Box and default size for each divider. Lines keep their stroke in screen pixels, so they stay thin when stretched. */
|
|
69
|
-
const DIVIDER_BOX: Record<DividerVariant, { viewBox: string; width: number | string; height?: number | string }> = {
|
|
70
|
-
horizontal: { viewBox: "0 0 1440 1", width: "100%", height: 1 },
|
|
71
|
-
fade: { viewBox: "0 0 1440 1", width: "100%", height: 1 },
|
|
72
|
-
dashed: { viewBox: "0 0 1440 1", width: "100%", height: 1 },
|
|
73
|
-
double: { viewBox: "0 0 1440 5", width: "100%", height: 5 },
|
|
74
|
-
ornament: { viewBox: "0 0 1440 12", width: "100%", height: 12 },
|
|
75
|
-
zigzag: { viewBox: "0 0 1440 8", width: "100%", height: 8 },
|
|
76
|
-
wave: { viewBox: "0 0 1440 40", width: "100%" },
|
|
77
|
-
waves: { viewBox: "0 0 1440 40", width: "100%" },
|
|
78
|
-
mountain: { viewBox: "0 0 1440 40", width: "100%" },
|
|
79
|
-
vertical: { viewBox: "0 0 1 1440", width: 1, height: "100%" },
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
/** Stroke width in screen pixels. */
|
|
83
|
-
const LINE_STROKE = 1;
|
|
84
|
-
const WAVE_STROKE = 2;
|
|
85
|
-
|
|
86
|
-
/** One smooth wave: four bumps across the 1440 box, centered on y = 20. */
|
|
87
|
-
const WAVE_PATH = "M0,20 C120,0 240,0 360,20 C480,40 600,40 720,20 C840,0 960,0 1080,20 C1200,40 1320,40 1440,20";
|
|
88
|
-
|
|
89
|
-
/** Front and back ridges of a mountain range, drawn as open lines in the 40-unit box. */
|
|
90
|
-
const MOUNTAIN_FRONT = "M0,36 L240,10 L400,26 L600,2 L820,28 L980,8 L1200,30 L1440,18";
|
|
91
|
-
const MOUNTAIN_BACK = "M0,26 L160,12 L300,24 L470,6 L640,22 L820,10 L1000,24 L1200,8 L1440,20";
|
|
92
|
-
|
|
93
|
-
/** Diamond ornament at the center of the `ornament` divider. */
|
|
94
|
-
const ORNAMENT_DIAMOND = "M720,1 L726,6 L720,11 L714,6 Z";
|
|
95
|
-
|
|
96
|
-
const BLOB_PATH =
|
|
97
|
-
"M44.7,-76.4C58.8,-69.2,71.8,-59.1,79.6,-45.8C87.4,-32.6,90,-16.3,88.5,-0.9C87,14.5,81.4,29,73.1,41.1C64.8,53.2,53.8,62.9,41.2,70.3C28.6,77.7,14.3,82.8,-0.5,83.7C-15.3,84.6,-30.6,81.3,-43.4,74.2C-56.2,67.1,-66.5,56,-74.8,43.2C-83.1,30.4,-89.4,15.2,-89.4,0C-89.4,-15.2,-83.1,-30.4,-74.3,-42.9C-65.5,-55.4,-54.2,-65.2,-41.4,-72.6C-28.6,-80,-14.3,-85,0.9,-86.3C16.1,-87.6,30.6,-83.6,44.7,-76.4Z";
|
|
98
|
-
|
|
99
|
-
const BLOB_ALT_PATH = "M-6,-88C48,-92,90,-40,84,8C78,54,36,90,-12,84C-58,78,-90,40,-84,-6C-78,-52,-52,-86,-6,-88Z";
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Windows-style arrow pointer: vertical left edge, 45-degree right edge, horizontal wing, slanted tail.
|
|
103
|
-
* Sharp corners, drawn on an 11 x 18 grid, scaled 8x and centered in the -100..100 box.
|
|
104
|
-
*/
|
|
105
|
-
const CURSOR_PATH = "M0,0 L0,16 L4.2,12.2 L6.9,18 L8.6,17.2 L5.9,11.2 L11,11.2 Z";
|
|
106
|
-
const CURSOR_SCALE = 8;
|
|
107
|
-
const CURSOR_TRANSFORM = "translate(-44 -72) scale(8)";
|
|
108
|
-
/** Sticker stroke width in viewBox units. */
|
|
109
|
-
const STICKER_STROKE = 8;
|
|
110
|
-
|
|
111
|
-
const STAR_PATH = "M0.0,-90.0 L23.5,-32.4 L85.6,-27.8 L38.0,12.4 L52.9,72.8 L0.0,40.0 L-52.9,72.8 L-38.0,12.4 L-85.6,-27.8 L-23.5,-32.4 Z";
|
|
112
|
-
|
|
113
|
-
const f2 = (n: number) => n.toFixed(2);
|
|
114
|
-
|
|
115
|
-
/** Open smooth line through sampled points, using Catmull-Rom curves converted to cubic Béziers. */
|
|
116
|
-
function smoothLine(points: [number, number][]): string {
|
|
117
|
-
let d = `M${f2(points[0][0])},${f2(points[0][1])}`;
|
|
118
|
-
for (let i = 0; i < points.length - 1; i++) {
|
|
119
|
-
const p0 = points[Math.max(i - 1, 0)];
|
|
120
|
-
const p1 = points[i];
|
|
121
|
-
const p2 = points[i + 1];
|
|
122
|
-
const p3 = points[Math.min(i + 2, points.length - 1)];
|
|
123
|
-
const c1x = p1[0] + (p2[0] - p0[0]) / 6;
|
|
124
|
-
const c1y = p1[1] + (p2[1] - p0[1]) / 6;
|
|
125
|
-
const c2x = p2[0] - (p3[0] - p1[0]) / 6;
|
|
126
|
-
const c2y = p2[1] - (p3[1] - p1[1]) / 6;
|
|
127
|
-
d += ` C${f2(c1x)},${f2(c1y)} ${f2(c2x)},${f2(c2y)} ${f2(p2[0])},${f2(p2[1])}`;
|
|
128
|
-
}
|
|
129
|
-
return d;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/** Sine wave across the 1440 box, centered on `base`: one crest every 360 units. */
|
|
133
|
-
function sineWave(base: number, amp: number, phase: number): string {
|
|
134
|
-
const points: [number, number][] = [];
|
|
135
|
-
for (let x = 0; x <= 1440; x += 90) {
|
|
136
|
-
points.push([x, base + amp * Math.sin((2 * Math.PI * x) / 360 + phase)]);
|
|
137
|
-
}
|
|
138
|
-
return smoothLine(points);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** Zigzag across the 8-unit box: alternating top and bottom points every 24 units. */
|
|
142
|
-
function zigzagPath(): string {
|
|
143
|
-
let d = "M0,7";
|
|
144
|
-
for (let x = 24, i = 0; x <= 1440; x += 24, i++) {
|
|
145
|
-
d += ` L${x},${i % 2 === 0 ? 1 : 7}`;
|
|
146
|
-
}
|
|
147
|
-
return d;
|
|
148
|
-
}
|
|
149
|
-
const ZIGZAG_PATH = zigzagPath();
|
|
150
|
-
|
|
151
|
-
/** Three sine waves, out of phase, at decreasing opacity. */
|
|
152
|
-
const WAVES_LAYERS: { d: string; opacity: number }[] = [
|
|
153
|
-
{ d: sineWave(20, 10, 0), opacity: 1 },
|
|
154
|
-
{ d: sineWave(20, 10, 0.9), opacity: 0.55 },
|
|
155
|
-
{ d: sineWave(20, 10, 1.8), opacity: 0.25 },
|
|
156
|
-
];
|
|
157
|
-
|
|
158
|
-
/** Edge width of an `outline` shape, in viewBox units. Same as the `ring` stroke. */
|
|
159
|
-
const OUTLINE_STROKE = 3;
|
|
160
|
-
|
|
161
|
-
/** Radius of the disc used for `circle` and `orb` outline and sticker forms. */
|
|
162
|
-
const DISC_RADIUS = 88;
|
|
163
|
-
|
|
164
|
-
type ClosedVariant = Extract<BlobShapeVariant, "blob" | "blob-alt" | "ring" | "orb" | "square" | "star" | "circle" | "cursor">;
|
|
165
|
-
|
|
166
|
-
const CLOSED_VARIANTS: ReadonlySet<BlobShapeVariant> = new Set<BlobShapeVariant>(["blob", "blob-alt", "ring", "orb", "square", "star", "circle", "cursor"]);
|
|
167
|
-
|
|
168
|
-
function isClosedVariant(variant: BlobShapeVariant): variant is ClosedVariant {
|
|
169
|
-
return CLOSED_VARIANTS.has(variant);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/** Fill and stroke for a closed shape. `strokeWidth` is in viewBox units. */
|
|
173
|
-
type Paint = { fill: string; stroke: string; strokeWidth: number };
|
|
174
|
-
|
|
175
|
-
const solidPaint = (color: string): Paint => ({ fill: color, stroke: "none", strokeWidth: 0 });
|
|
176
|
-
const outlinePaint = (color: string): Paint => ({ fill: "none", stroke: color, strokeWidth: OUTLINE_STROKE });
|
|
177
|
-
|
|
178
|
-
/** Draws one closed shape with the given paint. Used for the shape itself and for its sticker border. */
|
|
179
|
-
function closedShape(variant: ClosedVariant, paint: Paint): ReactNode {
|
|
180
|
-
const paintStyle: CSSProperties = { fill: paint.fill, stroke: paint.stroke };
|
|
181
|
-
switch (variant) {
|
|
182
|
-
case "blob":
|
|
183
|
-
return <path d={BLOB_PATH} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
184
|
-
case "blob-alt":
|
|
185
|
-
return <path d={BLOB_ALT_PATH} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
186
|
-
case "ring":
|
|
187
|
-
return <path d={BLOB_PATH} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
188
|
-
case "square":
|
|
189
|
-
return <rect x={-80} y={-80} width={160} height={160} rx={24} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
190
|
-
case "star":
|
|
191
|
-
return <path d={STAR_PATH} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
192
|
-
case "circle":
|
|
193
|
-
case "orb":
|
|
194
|
-
return <circle cx={0} cy={0} r={DISC_RADIUS} style={paintStyle} strokeWidth={paint.strokeWidth} />;
|
|
195
|
-
case "cursor":
|
|
196
|
-
// The transform scales the stroke too, so the stroke width is divided by the scale here.
|
|
197
|
-
return <path d={CURSOR_PATH} transform={CURSOR_TRANSFORM} style={paintStyle} strokeWidth={paint.strokeWidth / CURSOR_SCALE} />;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* Decorative SVG shapes for landing pages.
|
|
203
|
-
* Decorations sit in a `-100 -100 200 200` box. Dividers are thin lines that span the full width or height.
|
|
204
|
-
* Position it with `className` (e.g. `absolute -z-10`). The shape ignores pointer events.
|
|
205
|
-
*/
|
|
206
|
-
export function BlobShape({ variant = "blob", color = "var(--nonla-brand)", width, height, opacity, blur, flipX, flipY, appearance = "solid", className, style }: BlobShapeProps) {
|
|
207
|
-
const rawId = useId();
|
|
208
|
-
const idKey = rawId.replace(/:/g, "");
|
|
209
|
-
const gradientId = `nonla-blob-${idKey}`;
|
|
210
|
-
const fadeId = `nonla-fade-${idKey}`;
|
|
211
|
-
const divider = DIVIDER_VARIANTS.has(variant);
|
|
212
|
-
const box = divider ? DIVIDER_BOX[variant as DividerVariant] : undefined;
|
|
213
|
-
const fill: CSSProperties = { fill: color };
|
|
214
|
-
const stroke: CSSProperties = { stroke: color };
|
|
215
|
-
const line: CSSProperties = { ...stroke, fill: "none" };
|
|
216
|
-
|
|
217
|
-
const transform = [flipX && "scaleX(-1)", flipY && "scaleY(-1)"].filter(Boolean).join(" ");
|
|
218
|
-
|
|
219
|
-
// Ring is an outline by nature. The orb glow is a gradient, so only its solid form uses it.
|
|
220
|
-
const paint = appearance === "outline" || variant === "ring" ? outlinePaint(color) : solidPaint(color);
|
|
221
|
-
let shape: ReactNode = null;
|
|
222
|
-
if (variant === "orb" && appearance === "solid") {
|
|
223
|
-
shape = (
|
|
224
|
-
<>
|
|
225
|
-
<defs>
|
|
226
|
-
<radialGradient id={gradientId}>
|
|
227
|
-
<stop offset="0%" stopOpacity={1} style={{ stopColor: color }} />
|
|
228
|
-
<stop offset="100%" stopOpacity={0} style={{ stopColor: color }} />
|
|
229
|
-
</radialGradient>
|
|
230
|
-
</defs>
|
|
231
|
-
<circle cx={0} cy={0} r={100} fill={`url(#${gradientId})`} />
|
|
232
|
-
</>
|
|
233
|
-
);
|
|
234
|
-
} else if (isClosedVariant(variant)) {
|
|
235
|
-
shape = closedShape(variant, paint);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
switch (variant) {
|
|
239
|
-
case "horizontal":
|
|
240
|
-
shape = <line x1={0} y1={0.5} x2={1440} y2={0.5} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" style={line} />;
|
|
241
|
-
break;
|
|
242
|
-
case "fade":
|
|
243
|
-
shape = (
|
|
244
|
-
<>
|
|
245
|
-
<defs>
|
|
246
|
-
<linearGradient id={fadeId} gradientUnits="userSpaceOnUse" x1={0} y1={0} x2={1440} y2={0}>
|
|
247
|
-
<stop offset="0" stopOpacity={0} style={{ stopColor: color }} />
|
|
248
|
-
<stop offset="0.5" stopOpacity={1} style={{ stopColor: color }} />
|
|
249
|
-
<stop offset="1" stopOpacity={0} style={{ stopColor: color }} />
|
|
250
|
-
</linearGradient>
|
|
251
|
-
</defs>
|
|
252
|
-
<line x1={0} y1={0.5} x2={1440} y2={0.5} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" stroke={`url(#${fadeId})`} fill="none" />
|
|
253
|
-
</>
|
|
254
|
-
);
|
|
255
|
-
break;
|
|
256
|
-
case "dashed":
|
|
257
|
-
shape = <line x1={0} y1={0.5} x2={1440} y2={0.5} strokeWidth={LINE_STROKE} strokeDasharray="6 4" vectorEffect="non-scaling-stroke" style={line} />;
|
|
258
|
-
break;
|
|
259
|
-
case "double":
|
|
260
|
-
shape = (
|
|
261
|
-
<>
|
|
262
|
-
<line x1={0} y1={0.5} x2={1440} y2={0.5} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" style={line} />
|
|
263
|
-
<line x1={0} y1={4.5} x2={1440} y2={4.5} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" style={line} />
|
|
264
|
-
</>
|
|
265
|
-
);
|
|
266
|
-
break;
|
|
267
|
-
case "ornament":
|
|
268
|
-
shape = (
|
|
269
|
-
<>
|
|
270
|
-
<line x1={0} y1={6} x2={1440} y2={6} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" style={line} />
|
|
271
|
-
<path d={ORNAMENT_DIAMOND} style={fill} />
|
|
272
|
-
</>
|
|
273
|
-
);
|
|
274
|
-
break;
|
|
275
|
-
case "zigzag":
|
|
276
|
-
shape = <path d={ZIGZAG_PATH} strokeWidth={LINE_STROKE} strokeLinejoin="round" vectorEffect="non-scaling-stroke" style={line} />;
|
|
277
|
-
break;
|
|
278
|
-
case "wave":
|
|
279
|
-
shape = <path d={WAVE_PATH} strokeWidth={WAVE_STROKE} strokeLinecap="round" vectorEffect="non-scaling-stroke" style={line} />;
|
|
280
|
-
break;
|
|
281
|
-
case "waves":
|
|
282
|
-
shape = WAVES_LAYERS.map((layer) => (
|
|
283
|
-
<path key={layer.d} d={layer.d} strokeWidth={LINE_STROKE} strokeLinecap="round" vectorEffect="non-scaling-stroke" style={{ ...line, opacity: layer.opacity }} />
|
|
284
|
-
));
|
|
285
|
-
break;
|
|
286
|
-
case "mountain":
|
|
287
|
-
shape = (
|
|
288
|
-
<>
|
|
289
|
-
<path d={MOUNTAIN_BACK} strokeWidth={LINE_STROKE} strokeLinejoin="round" vectorEffect="non-scaling-stroke" style={{ ...line, opacity: 0.4 }} />
|
|
290
|
-
<path d={MOUNTAIN_FRONT} strokeWidth={WAVE_STROKE} strokeLinejoin="round" vectorEffect="non-scaling-stroke" style={line} />
|
|
291
|
-
</>
|
|
292
|
-
);
|
|
293
|
-
break;
|
|
294
|
-
case "vertical":
|
|
295
|
-
shape = <line x1={0.5} y1={0} x2={0.5} y2={1440} strokeWidth={LINE_STROKE} vectorEffect="non-scaling-stroke" style={line} />;
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
// Sticker: a white border under the shape, so only the outer edge shows, plus a soft drop shadow.
|
|
300
|
-
// Dividers have no sticker form.
|
|
301
|
-
if (appearance === "sticker" && isClosedVariant(variant)) {
|
|
302
|
-
const stickerId = `nonla-sticker-${idKey}`;
|
|
303
|
-
const border: Paint = { fill: "#ffffff", stroke: "#ffffff", strokeWidth: paint.strokeWidth + STICKER_STROKE };
|
|
304
|
-
shape = (
|
|
305
|
-
<>
|
|
306
|
-
<defs>
|
|
307
|
-
<filter id={stickerId} x="-30%" y="-30%" width="160%" height="160%">
|
|
308
|
-
<feDropShadow dx={0} dy={2} stdDeviation={2} floodColor="#000000" floodOpacity={0.2} />
|
|
309
|
-
</filter>
|
|
310
|
-
</defs>
|
|
311
|
-
<g filter={`url(#${stickerId})`}>{closedShape(variant, border)}</g>
|
|
312
|
-
{shape}
|
|
313
|
-
</>
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
return (
|
|
318
|
-
<svg
|
|
319
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
320
|
-
viewBox={box?.viewBox ?? "-100 -100 200 200"}
|
|
321
|
-
preserveAspectRatio={divider ? "none" : undefined}
|
|
322
|
-
width={width ?? box?.width ?? 320}
|
|
323
|
-
height={height ?? box?.height}
|
|
324
|
-
aria-hidden
|
|
325
|
-
focusable="false"
|
|
326
|
-
className={cn("pointer-events-none block shrink-0", className)}
|
|
327
|
-
style={{
|
|
328
|
-
opacity,
|
|
329
|
-
filter: blur ? `blur(${blur}px)` : undefined,
|
|
330
|
-
transform: transform || undefined,
|
|
331
|
-
...style,
|
|
332
|
-
}}
|
|
333
|
-
>
|
|
334
|
-
{shape}
|
|
335
|
-
</svg>
|
|
336
|
-
);
|
|
337
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Icon } from "../../icon/Icon";
|
|
2
|
-
import { Shimmer } from "../../shimmer/Shimmer";
|
|
3
|
-
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
4
|
-
import { parseJsonObject } from "../common/utils";
|
|
5
|
-
import { ToolUiBadge } from "./ToolUiBadge";
|
|
6
|
-
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
7
|
-
import { isToolRunning, type ToolUIProps } from "./types";
|
|
8
|
-
|
|
9
|
-
type TimeResult = {
|
|
10
|
-
time?: string;
|
|
11
|
-
timezone?: string;
|
|
12
|
-
iso?: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
function formatLabel(iso: string | undefined, timezone: string | undefined, fallback: string | undefined): string {
|
|
16
|
-
if (iso) {
|
|
17
|
-
try {
|
|
18
|
-
const d = new Date(iso);
|
|
19
|
-
if (!Number.isNaN(d.getTime())) {
|
|
20
|
-
const tz = timezone || "UTC";
|
|
21
|
-
const clock = d.toLocaleTimeString("en-US", { timeZone: tz, hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false });
|
|
22
|
-
const date = d.toLocaleDateString("en-US", { timeZone: tz, weekday: "short", month: "short", day: "numeric" });
|
|
23
|
-
return `${clock} · ${date} · ${tz}`;
|
|
24
|
-
}
|
|
25
|
-
} catch {
|
|
26
|
-
/* fall through */
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (fallback && timezone) return `${fallback} · ${timezone}`;
|
|
30
|
-
return fallback ?? timezone ?? "—";
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function GetCurrentTimeToolUI({ msg, assistantLabel = "Assistant", assistantColor, showAvatar = false, generating = false }: ToolUIProps) {
|
|
34
|
-
const hasError = Boolean(msg.toolError);
|
|
35
|
-
const output = parseJsonObject<TimeResult>(msg.toolOutput);
|
|
36
|
-
const running = isToolRunning(msg, generating);
|
|
37
|
-
const label = formatLabel(output?.iso, output?.timezone, output?.time);
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
41
|
-
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
42
|
-
<div className="px-4">
|
|
43
|
-
<div className={chatToolLineClass}>
|
|
44
|
-
<Icon name="clock" size={13} className="shrink-0 text-muted-foreground" />
|
|
45
|
-
<Shimmer active={running} className="truncate font-normal tabular-nums text-muted-foreground">{hasError ? "Failed to get time" : running ? "Getting time…" : label}</Shimmer>
|
|
46
|
-
<ToolUiTrailing failed={hasError} />
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Icon } from "../../icon/Icon";
|
|
2
|
-
import { cn } from "../../lib/cn";
|
|
3
|
-
import { Shimmer } from "../../shimmer/Shimmer";
|
|
4
|
-
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
5
|
-
import { parseJsonObject } from "../common/utils";
|
|
6
|
-
import { ToolUiBadge } from "./ToolUiBadge";
|
|
7
|
-
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
8
|
-
import { isToolRunning, type ToolUIProps } from "./types";
|
|
9
|
-
|
|
10
|
-
type ReadSkillInput = { name?: string; reference?: string };
|
|
11
|
-
type SkillRef = { name?: string; title?: string };
|
|
12
|
-
type ReadSkillOutput = {
|
|
13
|
-
ok?: boolean;
|
|
14
|
-
error?: string;
|
|
15
|
-
skill?: string;
|
|
16
|
-
reference?: string;
|
|
17
|
-
title?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
content?: string;
|
|
20
|
-
references?: SkillRef[];
|
|
21
|
-
available_references?: SkillRef[];
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
function refNames(list?: SkillRef[]): string[] {
|
|
25
|
-
if (!Array.isArray(list)) return [];
|
|
26
|
-
return list.map((r) => (typeof r.name === "string" ? r.name.trim() : "")).filter(Boolean);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function ReadSkillToolUI({ msg, assistantLabel = "Assistant", assistantColor, showAvatar = false, generating = false }: ToolUIProps) {
|
|
30
|
-
const hasError = Boolean(msg.toolError);
|
|
31
|
-
const input = parseJsonObject<ReadSkillInput>(msg.toolInput) ?? {};
|
|
32
|
-
const output = parseJsonObject<ReadSkillOutput>(msg.toolOutput);
|
|
33
|
-
const failed = hasError || output?.ok === false;
|
|
34
|
-
const running = isToolRunning(msg, generating);
|
|
35
|
-
|
|
36
|
-
const skillName = (output?.skill || input.name || "").trim();
|
|
37
|
-
const reference = (output?.reference || input.reference || "").trim();
|
|
38
|
-
const available = refNames(output?.references ?? output?.available_references);
|
|
39
|
-
const content = output?.content?.trim() || "";
|
|
40
|
-
const body = failed ? (output?.error ?? (typeof msg.toolError === "string" ? msg.toolError : null) ?? "Failed to read skill") : content;
|
|
41
|
-
|
|
42
|
-
const verb = (() => {
|
|
43
|
-
if (failed) return "Failed to read skill";
|
|
44
|
-
if (running) return reference ? "Reading ref" : "Reading skill";
|
|
45
|
-
return reference ? "Read skill ref" : "Read skill";
|
|
46
|
-
})();
|
|
47
|
-
|
|
48
|
-
const targetLabel = (() => {
|
|
49
|
-
if (!skillName && !reference) return null;
|
|
50
|
-
if (reference) return skillName ? `${skillName} / ${reference}` : reference;
|
|
51
|
-
return skillName || null;
|
|
52
|
-
})();
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
56
|
-
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
57
|
-
<details className="group/readskill px-4" style={{ overflowAnchor: "none" }}>
|
|
58
|
-
<summary className={cn(chatToolLineClass, "cursor-pointer list-none select-none [&::-webkit-details-marker]:hidden")}>
|
|
59
|
-
<Icon name={reference ? "document" : "book"} size={13} className="shrink-0 text-muted-foreground" />
|
|
60
|
-
<Shimmer active={running} className="min-w-0 truncate font-normal text-muted-foreground">
|
|
61
|
-
{verb}
|
|
62
|
-
{targetLabel ? <span className="text-tertiary-foreground"> {targetLabel}</span> : null}
|
|
63
|
-
</Shimmer>
|
|
64
|
-
<ToolUiTrailing failed={failed} chevron chevronClassName="group-hover/readskill:opacity-100 group-open/readskill:opacity-100 group-open/readskill:rotate-90" />
|
|
65
|
-
</summary>
|
|
66
|
-
{body ? (
|
|
67
|
-
<pre className={cn("m-0 mt-1.5 mb-1 max-h-40 overflow-y-auto rounded-lg border px-3 py-2 font-mono text-sm font-normal leading-[1.65] break-all whitespace-pre-wrap", failed ? "border-destructive/35 bg-destructive/6 text-destructive" : "border-border bg-card text-muted-foreground")}>{body}</pre>
|
|
68
|
-
) : null}
|
|
69
|
-
{!running && !reference && available.length > 0 ? (
|
|
70
|
-
<div className="mt-0.5 mb-1 flex flex-wrap items-center gap-1">
|
|
71
|
-
<span className="text-sm font-medium tracking-wide text-quaternary-foreground uppercase">Refs</span>
|
|
72
|
-
{available.map((name) => (
|
|
73
|
-
<span key={name} className="inline-flex max-w-full items-center rounded-md border border-border-secondary bg-muted/40 px-1.5 py-0.5 font-mono text-sm leading-[1.4] text-tertiary-foreground">
|
|
74
|
-
{skillName ? `${skillName} / ${name}` : name}
|
|
75
|
-
</span>
|
|
76
|
-
))}
|
|
77
|
-
</div>
|
|
78
|
-
) : null}
|
|
79
|
-
</details>
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { CodeBlock } from "../../codeblock/CodeBlock";
|
|
2
|
-
import { Icon } from "../../icon/Icon";
|
|
3
|
-
import { cn } from "../../lib/cn";
|
|
4
|
-
import { Shimmer } from "../../shimmer/Shimmer";
|
|
5
|
-
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
6
|
-
import { parseBgTaskRef } from "../common/bgTasks";
|
|
7
|
-
import { parseJsonObject, prettyJson } from "../common/utils";
|
|
8
|
-
import { ChatSpinner } from "../message-ui/ChatSpinner";
|
|
9
|
-
import { BackgroundTaskToolUI } from "./BackgroundTaskToolUI";
|
|
10
|
-
import { ToolUiBadge } from "./ToolUiBadge";
|
|
11
|
-
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
12
|
-
import { isToolRunning, type ToolUIProps } from "./types";
|
|
13
|
-
|
|
14
|
-
type JsInput = { code?: string };
|
|
15
|
-
type JsOutput = {
|
|
16
|
-
ok?: boolean;
|
|
17
|
-
result?: unknown;
|
|
18
|
-
error?: string;
|
|
19
|
-
console?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
function extractCode(input: unknown): string {
|
|
23
|
-
const parsed = parseJsonObject<JsInput>(input);
|
|
24
|
-
if (parsed?.code && typeof parsed.code === "string") return parsed.code;
|
|
25
|
-
if (typeof input === "string") return input;
|
|
26
|
-
return "";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function resultText(value: unknown): string {
|
|
30
|
-
if (typeof value === "string") return value;
|
|
31
|
-
if (value === undefined) return "undefined";
|
|
32
|
-
if (typeof value === "number" || typeof value === "boolean" || value === null) return String(value);
|
|
33
|
-
return prettyJson(value);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function SandboxOutput({
|
|
37
|
-
running,
|
|
38
|
-
failed,
|
|
39
|
-
consoleOut,
|
|
40
|
-
result,
|
|
41
|
-
}: {
|
|
42
|
-
running: boolean;
|
|
43
|
-
failed: boolean;
|
|
44
|
-
consoleOut: string | null;
|
|
45
|
-
result: unknown;
|
|
46
|
-
}) {
|
|
47
|
-
if (running) {
|
|
48
|
-
return (
|
|
49
|
-
<div className="flex items-center gap-2 border-t border-border px-3 py-2 text-sm text-muted-foreground">
|
|
50
|
-
<ChatSpinner />
|
|
51
|
-
<Shimmer>Running…</Shimmer>
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div className={cn("max-h-40 overflow-y-auto border-t px-3 py-2 font-mono text-sm leading-[1.65]", failed ? "border-destructive/35 bg-destructive/6" : "border-border")}>
|
|
58
|
-
{consoleOut ? <pre className="m-0 whitespace-pre-wrap break-all text-tertiary-foreground">{consoleOut}</pre> : null}
|
|
59
|
-
{failed ? (
|
|
60
|
-
<pre className={cn("m-0 whitespace-pre-wrap break-all text-destructive", consoleOut && "mt-1")}>{resultText(result)}</pre>
|
|
61
|
-
) : (
|
|
62
|
-
<div className={cn("flex gap-1.5 whitespace-pre-wrap break-all text-foreground", consoleOut && "mt-1")}>
|
|
63
|
-
<span className="shrink-0 select-none text-quaternary-foreground">{"=>"}</span>
|
|
64
|
-
<span>{resultText(result)}</span>
|
|
65
|
-
</div>
|
|
66
|
-
)}
|
|
67
|
-
</div>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export function RunJsToolUI({ msg, assistantLabel = "Assistant", assistantColor, showAvatar = false, generating = false }: ToolUIProps) {
|
|
72
|
-
if (parseBgTaskRef(msg.toolOutput)) {
|
|
73
|
-
return <BackgroundTaskToolUI msg={msg} assistantLabel={assistantLabel} assistantColor={assistantColor} showAvatar={showAvatar} />;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const hasError = Boolean(msg.toolError);
|
|
77
|
-
const code = extractCode(msg.toolInput);
|
|
78
|
-
const output = parseJsonObject<JsOutput>(msg.toolOutput);
|
|
79
|
-
const running = isToolRunning(msg, generating);
|
|
80
|
-
const failed = hasError || output?.ok === false;
|
|
81
|
-
const consoleOut = output?.console?.trim() || null;
|
|
82
|
-
const resultBody = failed ? (output?.error ?? (typeof msg.toolError === "string" ? msg.toolError : null) ?? "Execution failed") : output && "result" in output ? output.result : undefined;
|
|
83
|
-
const showOutput = running || failed || consoleOut != null || (output != null && "result" in output);
|
|
84
|
-
const verb = failed ? "JS failed" : running ? "Running JS" : "Ran JS";
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
88
|
-
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
89
|
-
<details className="group/runjs px-4" style={{ overflowAnchor: "none" }}>
|
|
90
|
-
<summary className={cn(chatToolLineClass, "cursor-pointer list-none select-none [&::-webkit-details-marker]:hidden")}>
|
|
91
|
-
<Icon name="code" size={13} className="shrink-0 text-muted-foreground" />
|
|
92
|
-
<Shimmer active={running} className="min-w-0 truncate font-normal text-muted-foreground">{verb}</Shimmer>
|
|
93
|
-
<ToolUiTrailing running={running} failed={failed} chevron chevronClassName="group-hover/runjs:opacity-100 group-open/runjs:opacity-100 group-open/runjs:rotate-90" />
|
|
94
|
-
</summary>
|
|
95
|
-
|
|
96
|
-
{code ? (
|
|
97
|
-
<CodeBlock code={code} language="javascript" title="JS" className={cn("mt-1.5 mb-1", failed && "border-destructive/35")}>
|
|
98
|
-
{showOutput ? <SandboxOutput running={running} failed={failed} consoleOut={consoleOut} result={resultBody} /> : null}
|
|
99
|
-
</CodeBlock>
|
|
100
|
-
) : showOutput ? (
|
|
101
|
-
<div className={cn("mt-1.5 mb-1 overflow-hidden rounded-lg border", failed ? "border-destructive/35" : "border-border")}>
|
|
102
|
-
<SandboxOutput running={running} failed={failed} consoleOut={consoleOut} result={resultBody} />
|
|
103
|
-
</div>
|
|
104
|
-
) : null}
|
|
105
|
-
</details>
|
|
106
|
-
</div>
|
|
107
|
-
);
|
|
108
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Icon } from "../../icon/Icon";
|
|
2
|
-
import { cn } from "../../lib/cn";
|
|
3
|
-
import { Shimmer } from "../../shimmer/Shimmer";
|
|
4
|
-
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
5
|
-
import { parseJsonObject } from "../common/utils";
|
|
6
|
-
import { ToolUiBadge } from "./ToolUiBadge";
|
|
7
|
-
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
8
|
-
import { isToolRunning, type ToolUIProps } from "./types";
|
|
9
|
-
|
|
10
|
-
type FetchInput = {
|
|
11
|
-
url?: string;
|
|
12
|
-
actions?: { action?: string; url?: string }[];
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type FetchOutput = {
|
|
16
|
-
ok?: boolean;
|
|
17
|
-
url?: string;
|
|
18
|
-
text?: string;
|
|
19
|
-
error?: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
function inputUrl(input: unknown): string {
|
|
23
|
-
const rec = parseJsonObject<FetchInput>(input);
|
|
24
|
-
if (rec?.url) return rec.url;
|
|
25
|
-
const nav = rec?.actions?.find((a) => a.action === "navigate" && a.url);
|
|
26
|
-
return nav?.url || "";
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function WebFetchToolUI({ msg, assistantLabel = "Assistant", assistantColor, showAvatar = false, generating = false }: ToolUIProps) {
|
|
30
|
-
const hasError = Boolean(msg.toolError);
|
|
31
|
-
const output = parseJsonObject<FetchOutput>(msg.toolOutput);
|
|
32
|
-
const failed = hasError || output?.ok === false;
|
|
33
|
-
const running = isToolRunning(msg, generating);
|
|
34
|
-
const url = output?.url || inputUrl(msg.toolInput) || "—";
|
|
35
|
-
const body = failed ? (output?.error ?? (typeof msg.toolError === "string" ? msg.toolError : null) ?? "Tool execution failed") : output?.text?.trim() || "";
|
|
36
|
-
const expandable = Boolean(body);
|
|
37
|
-
const verb = running ? "Fetching page" : failed ? "Fetch page" : "Fetched page";
|
|
38
|
-
|
|
39
|
-
const header = (
|
|
40
|
-
<>
|
|
41
|
-
<Icon name="globe" size={13} className="shrink-0 text-muted-foreground" />
|
|
42
|
-
<Shimmer active={running} className="min-w-0 truncate font-normal text-muted-foreground">
|
|
43
|
-
{verb} <span className="text-tertiary-foreground">{url}</span>
|
|
44
|
-
</Shimmer>
|
|
45
|
-
<ToolUiTrailing failed={failed} chevron={expandable} chevronClassName="group-hover/webfetch:opacity-100 group-open/webfetch:opacity-100 group-open/webfetch:rotate-90" />
|
|
46
|
-
</>
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
51
|
-
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
52
|
-
{expandable ? (
|
|
53
|
-
<details className="group/webfetch px-4" style={{ overflowAnchor: "none" }}>
|
|
54
|
-
<summary className={cn(chatToolLineClass, "cursor-pointer list-none select-none [&::-webkit-details-marker]:hidden")}>{header}</summary>
|
|
55
|
-
<pre className={cn("m-0 mt-1.5 mb-1 max-h-40 overflow-y-auto rounded-lg border px-3 py-2 font-mono text-sm font-normal leading-[1.65] break-all whitespace-pre-wrap", failed ? "border-destructive/35 bg-destructive/6 text-destructive" : "border-border bg-card text-muted-foreground")}>{body}</pre>
|
|
56
|
-
</details>
|
|
57
|
-
) : (
|
|
58
|
-
<div className="px-4">
|
|
59
|
-
<div className={chatToolLineClass}>{header}</div>
|
|
60
|
-
</div>
|
|
61
|
-
)}
|
|
62
|
-
</div>
|
|
63
|
-
);
|
|
64
|
-
}
|