devnonla-ui 0.13.0 → 0.15.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/package.json +2 -2
- package/src/app/App.tsx +2 -2
- package/src/app/context.ts +1 -12
- package/src/avatar/avatar.css +107 -0
- package/src/blob-shape/BlobShape.tsx +337 -0
- package/src/button/Button.tsx +4 -4
- package/src/button/ButtonCopy.tsx +3 -3
- package/src/calendar/Calendar.tsx +1 -1
- package/src/card/Card.tsx +1 -1
- package/src/chat/AgentChatbox.tsx +1 -1
- package/src/chat/AgentPanel.tsx +1 -1
- package/src/chat/chatMessageList.tsx +5 -3
- package/src/chat/chatRhythm.ts +8 -0
- package/src/chat/common/createAgentSseSession.ts +9 -3
- package/src/chat/common/sse.ts +290 -122
- package/src/chat/common/useAgentStream.ts +1 -1
- package/src/chat/index.ts +2 -2
- package/src/chat/message-ui/ChatAgentMessage.tsx +4 -3
- package/src/chat/message-ui/ChatError.tsx +5 -4
- package/src/chat/message-ui/ChatInput.tsx +9 -8
- package/src/chat/message-ui/ChatMarkdown.tsx +36 -2
- package/src/chat/message-ui/ChatThinking.tsx +8 -7
- package/src/chat/message-ui/ChatUserMessage.tsx +5 -5
- package/src/chat/tool-ui/BackgroundTaskToolUI.tsx +7 -6
- package/src/chat/tool-ui/BackgroundTasksBar.tsx +9 -9
- package/src/chat/tool-ui/CallAgentToolUI.tsx +16 -15
- package/src/chat/tool-ui/ChatToolCall.tsx +13 -12
- package/src/chat/tool-ui/GetCurrentTimeToolUI.tsx +7 -6
- package/src/chat/tool-ui/ReadSkillToolUI.tsx +10 -9
- package/src/chat/tool-ui/RunJsToolUI.tsx +9 -8
- package/src/chat/tool-ui/ToolUiBadge.tsx +1 -1
- package/src/chat/tool-ui/ToolUiTrailing.tsx +3 -3
- package/src/chat/tool-ui/WebFetchToolUI.tsx +10 -9
- package/src/checkbox/Checkbox.tsx +2 -2
- package/src/codeblock/CodeBlock.tsx +1 -1
- package/src/colorpicker/ColorPicker.tsx +10 -8
- package/src/datepicker/DatePicker.tsx +3 -3
- package/src/desktop/DesktopHeader.tsx +2 -2
- package/src/desktop/DesktopIcon.tsx +3 -4
- package/src/desktop/DesktopStage.tsx +1 -1
- package/src/desktop/DesktopWindow.tsx +3 -3
- package/src/desktop/MeadowDesktop.tsx +2 -2
- package/src/drawer/Drawer.tsx +6 -2
- package/src/dropdown/menuClasses.ts +1 -1
- package/src/empty/Empty.tsx +1 -1
- package/src/form/variants/FieldRadio.tsx +1 -1
- package/src/form/variants/FieldRepeaterItem.tsx +1 -1
- package/src/icon/Icon.tsx +21 -0
- package/src/icon/glyphs.ts +35 -0
- package/src/index.ts +9 -23
- package/src/input/EditableInput.tsx +5 -4
- package/src/input/Input.tsx +15 -7
- package/src/lib/sizes.ts +6 -6
- package/src/lib/surface.ts +14 -4
- package/src/markdown-editor/MarkdownDiff.tsx +4 -4
- package/src/markdown-editor/MarkdownEditor.tsx +4 -4
- package/src/markdown-editor/MarkdownPreview.tsx +6 -6
- package/src/markdown-editor/MarkdownSource.tsx +1 -1
- package/src/markdown-editor/MarkdownTable.tsx +48 -11
- package/src/markdown-editor/MarkdownViewer.tsx +28 -31
- package/src/markdown-editor/MermaidBlock.tsx +5 -5
- package/src/markdown-editor/ReactCodeFrame.tsx +10 -6
- package/src/markdown-editor/ReactCodeSandbox.tsx +2 -2
- package/src/markdown-editor/markdownScale.ts +66 -127
- package/src/menu/Menu.tsx +3 -3
- package/src/message/message.tsx +18 -8
- package/src/modal/Modal.tsx +13 -7
- package/src/pagination/Pagination.tsx +7 -7
- package/src/popover/Popover.tsx +1 -1
- package/src/scroll/OverlayScroll.tsx +13 -5
- package/src/segmented/Segmented.tsx +1 -1
- package/src/select/Select.tsx +4 -4
- package/src/sidebar/Sidebar.tsx +39 -36
- package/src/skeleton/Skeleton.tsx +4 -4
- package/src/spin/Spin.tsx +14 -2
- package/src/splitter/Splitter.tsx +1 -1
- package/src/styles.css +188 -844
- package/src/table/Table.tsx +12 -12
- package/src/tabs/Tabs.tsx +76 -14
- package/src/tag/Tag.tsx +3 -3
- package/src/theme-switcher/ThemeSwitcher.tsx +6 -6
- package/src/theme.ts +53 -147
- package/src/timepicker/TimePicker.tsx +2 -2
- package/src/typography/Typography.tsx +8 -8
- package/src/icon/SolarIcon.tsx +0 -39
- package/src/icon/solar.ts +0 -172
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
1
2
|
import { MarkdownViewer } from "../../markdown-editor/MarkdownViewer";
|
|
2
3
|
|
|
3
4
|
export type ChatMarkdownProps = {
|
|
@@ -5,7 +6,40 @@ export type ChatMarkdownProps = {
|
|
|
5
6
|
streaming?: boolean;
|
|
6
7
|
};
|
|
7
8
|
|
|
8
|
-
/**
|
|
9
|
+
/** Reply headings match the body: `text-md`, weight 400. Strong is 500. Tables stay `text-base`. */
|
|
10
|
+
const chatHeadingScale = {
|
|
11
|
+
"--md-h1-size": "var(--nonla-md-text-size)",
|
|
12
|
+
"--md-h2-size": "var(--nonla-md-text-size)",
|
|
13
|
+
"--md-h3-size": "var(--nonla-md-text-size)",
|
|
14
|
+
"--md-h4-size": "var(--nonla-md-text-size)",
|
|
15
|
+
"--md-h5-size": "var(--nonla-md-text-size)",
|
|
16
|
+
"--md-h6-size": "var(--nonla-md-text-size)",
|
|
17
|
+
"--md-h1-leading": "var(--md-body-leading)",
|
|
18
|
+
"--md-h2-leading": "var(--md-body-leading)",
|
|
19
|
+
"--md-h3-leading": "var(--md-body-leading)",
|
|
20
|
+
"--md-h4-leading": "var(--md-body-leading)",
|
|
21
|
+
"--md-h5-leading": "var(--md-body-leading)",
|
|
22
|
+
"--md-h6-leading": "var(--md-body-leading)",
|
|
23
|
+
"--md-h1-weight": "400",
|
|
24
|
+
"--md-h2-weight": "400",
|
|
25
|
+
"--md-h3-weight": "400",
|
|
26
|
+
"--md-h4-weight": "400",
|
|
27
|
+
"--md-h5-weight": "400",
|
|
28
|
+
"--md-h6-weight": "400",
|
|
29
|
+
"--md-strong-weight": "500",
|
|
30
|
+
} as CSSProperties;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Headings use the paragraph box, so `#` does not keep the article margin.
|
|
34
|
+
* The first and last line drop that padding so the row padding is the only gap.
|
|
35
|
+
*/
|
|
36
|
+
const chatEdgeClass = [
|
|
37
|
+
"[&_:is(h1,h2,h3,h4,h5,h6)]:my-(--md-p-my,1px)! [&_:is(h1,h2,h3,h4,h5,h6)]:py-(--md-p-py,4px)!",
|
|
38
|
+
"[&_[data-md-block]:not(:first-child)_p:first-child]:mt-(--md-p-my,1px)! [&_[data-md-block]:not(:first-child)_p:first-child]:pt-(--md-p-py,4px)!",
|
|
39
|
+
"[&_[data-md-block]:first-child_:is(p,h1,h2,h3,h4,h5,h6,ul,ol)]:mt-0! [&_[data-md-block]:first-child_:is(p,h1,h2,h3,h4,h5,h6)]:pt-0! [&_[data-md-block]:last-child_:is(p,h1,h2,h3,h4,h5,h6,ul,ol)]:mb-0! [&_[data-md-block]:last-child_:is(p,h1,h2,h3,h4,h5,h6)]:pb-0!",
|
|
40
|
+
].join(" ");
|
|
41
|
+
|
|
42
|
+
/** Agent markdown. Headings use the body size at weight 400. */
|
|
9
43
|
export function ChatMarkdown({ content, streaming = false }: ChatMarkdownProps) {
|
|
10
|
-
return <MarkdownViewer value={content} streaming={streaming}
|
|
44
|
+
return <MarkdownViewer value={content} streaming={streaming} className={chatEdgeClass} style={chatHeadingScale} />;
|
|
11
45
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
5
|
+
import { chatToolLineClass } from "../chatRhythm";
|
|
5
6
|
|
|
6
7
|
export type ChatThinkingProps = {
|
|
7
8
|
thinking: string;
|
|
@@ -40,7 +41,7 @@ export function ChatThinking({ thinking, duration = 0, streaming = false, classN
|
|
|
40
41
|
|
|
41
42
|
return (
|
|
42
43
|
<details
|
|
43
|
-
className={cn("nonla-chat-thinking px-4
|
|
44
|
+
className={cn("nonla-chat-thinking px-4 group/thinking", className)}
|
|
44
45
|
style={{ overflowAnchor: "none" }}
|
|
45
46
|
onToggle={(e) => {
|
|
46
47
|
if (!streaming || !e.currentTarget.open) return;
|
|
@@ -48,13 +49,13 @@ export function ChatThinking({ thinking, duration = 0, streaming = false, classN
|
|
|
48
49
|
if (el) el.scrollTop = el.scrollHeight;
|
|
49
50
|
}}
|
|
50
51
|
>
|
|
51
|
-
<summary className="cursor-pointer
|
|
52
|
-
<Shimmer active={streaming} className="text-
|
|
53
|
-
<
|
|
52
|
+
<summary className={cn(chatToolLineClass, "cursor-pointer list-none font-medium select-none [&::-webkit-details-marker]:hidden")}>
|
|
53
|
+
<Shimmer active={streaming} className="text-muted-foreground">{label}</Shimmer>
|
|
54
|
+
<Icon name="arrow-right" size={12} className="shrink-0 opacity-0 text-muted-foreground transition-[opacity,transform] duration-150 group-hover/thinking:opacity-100 group-open/thinking:opacity-100 group-open/thinking:rotate-90" />
|
|
54
55
|
</summary>
|
|
55
56
|
|
|
56
|
-
<div ref={bodyRef} className="pt-2 max-h-40 min-w-0 overflow-y-auto overflow-x-hidden mb-2 text-
|
|
57
|
-
<p className="
|
|
57
|
+
<div ref={bodyRef} className="pt-2 max-h-40 min-w-0 overflow-y-auto overflow-x-hidden mb-2 text-sm">
|
|
58
|
+
<p className="m-0 text-sm text-tertiary-foreground whitespace-pre-wrap wrap-break-word">{thinking}</p>
|
|
58
59
|
</div>
|
|
59
60
|
</details>
|
|
60
61
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
|
|
5
5
|
const MAX_HEIGHT = 150;
|
|
@@ -29,15 +29,15 @@ export function ChatUserMessage({ content, className }: ChatUserMessageProps) {
|
|
|
29
29
|
return (
|
|
30
30
|
<div
|
|
31
31
|
className={cn(
|
|
32
|
-
"nonla-chat-user relative isolate mt-
|
|
33
|
-
"
|
|
32
|
+
"nonla-chat-user relative isolate mx-4 mt-8 mb-3 overflow-hidden rounded-xl border border-solid border-(--nonla-input) bg-muted-strong px-3 py-1.5",
|
|
33
|
+
"[.light:not(.dark)_&]:bg-sidebar [.light_.nonla-ui:not(.dark)_&]:bg-sidebar",
|
|
34
34
|
className,
|
|
35
35
|
)}
|
|
36
36
|
>
|
|
37
37
|
<div
|
|
38
38
|
ref={contentRef}
|
|
39
39
|
className={cn(
|
|
40
|
-
"overflow-hidden text-
|
|
40
|
+
"overflow-hidden text-base text-foreground whitespace-pre-wrap wrap-break-word",
|
|
41
41
|
collapsed && "mask-[linear-gradient(to_bottom,#000_calc(100%-1.75rem),transparent)]",
|
|
42
42
|
)}
|
|
43
43
|
style={{ maxHeight: collapsed ? MAX_HEIGHT : undefined }}
|
|
@@ -55,7 +55,7 @@ export function ChatUserMessage({ content, className }: ChatUserMessageProps) {
|
|
|
55
55
|
}}
|
|
56
56
|
className="flex w-full cursor-pointer items-center justify-center border-0 bg-transparent pt-1 text-muted-foreground hover:text-foreground"
|
|
57
57
|
>
|
|
58
|
-
<
|
|
58
|
+
<Icon name="arrow-down" size={12} className={cn("transition-transform duration-200", isExpanded && "rotate-180")} />
|
|
59
59
|
</button>
|
|
60
60
|
) : null}
|
|
61
61
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
3
3
|
import { Spin } from "../../spin/Spin";
|
|
4
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
4
5
|
import { formatBgElapsed, parseBgTaskRef } from "../common/bgTasks";
|
|
5
6
|
import { formatToolName, timestampMs } from "../common/utils";
|
|
6
7
|
import { ToolUiBadge } from "./ToolUiBadge";
|
|
@@ -17,16 +18,16 @@ export function BackgroundTaskToolUI({ msg, assistantLabel = "Assistant", assist
|
|
|
17
18
|
}, []);
|
|
18
19
|
|
|
19
20
|
return (
|
|
20
|
-
<div className=
|
|
21
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
21
22
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
22
|
-
<div className="px-4
|
|
23
|
-
<div className=
|
|
23
|
+
<div className="px-4">
|
|
24
|
+
<div className={chatToolLineClass}>
|
|
24
25
|
<Spin variant="agent" size="small" className="shrink-0" />
|
|
25
|
-
<Shimmer className="min-w-0 truncate
|
|
26
|
+
<Shimmer className="min-w-0 truncate font-medium text-muted-foreground">
|
|
26
27
|
{label}
|
|
27
|
-
<span className="
|
|
28
|
+
<span className="text-muted-foreground [-webkit-text-fill-color:currentcolor]"> in background</span>
|
|
28
29
|
</Shimmer>
|
|
29
|
-
<span className="shrink-0
|
|
30
|
+
<span className="shrink-0 tabular-nums text-tertiary-foreground">{formatBgElapsed(timestampMs(msg.timestamp), now)}</span>
|
|
30
31
|
</div>
|
|
31
32
|
</div>
|
|
32
33
|
</div>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
import { Modal } from "../../modal/Modal";
|
|
5
5
|
import { Popconfirm } from "../../popconfirm/Popconfirm";
|
|
@@ -27,7 +27,7 @@ function TaskLogsModal({
|
|
|
27
27
|
|
|
28
28
|
return (
|
|
29
29
|
<Modal open={open} onCancel={onClose} footer={null} title={task ? formatToolName(task.toolName) : "Logs"} width={560}>
|
|
30
|
-
<pre ref={preRef} className="m-0 max-h-[50vh] overflow-auto rounded-md border border-border-
|
|
30
|
+
<pre ref={preRef} className="m-0 max-h-[50vh] overflow-auto rounded-md border border-border-secondary bg-muted px-3 py-2 font-mono text-sm leading-relaxed whitespace-pre-wrap break-all text-foreground">
|
|
31
31
|
{logs || "Waiting for output…"}
|
|
32
32
|
</pre>
|
|
33
33
|
</Modal>
|
|
@@ -49,14 +49,14 @@ function TaskRow({
|
|
|
49
49
|
}) {
|
|
50
50
|
return (
|
|
51
51
|
<div className="flex items-center gap-1 px-1.5 py-0.5">
|
|
52
|
-
<button type="button" onClick={onLogs} title="Logs" aria-label={`Logs ${formatToolName(task.toolName)}`} className="flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-1 py-[3px] text-left transition-colors hover:bg-
|
|
52
|
+
<button type="button" onClick={onLogs} title="Logs" aria-label={`Logs ${formatToolName(task.toolName)}`} className="flex min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-md px-1 py-[3px] text-left transition-colors hover:bg-muted">
|
|
53
53
|
<Spin variant="agent" size="small" className="shrink-0" />
|
|
54
|
-
<span className="min-w-0 flex-1 truncate text-
|
|
55
|
-
<span className="shrink-0 text-
|
|
54
|
+
<span className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">{formatToolName(task.toolName)}</span>
|
|
55
|
+
<span className="shrink-0 text-sm tabular-nums text-tertiary-foreground">{formatBgElapsed(task.startedAt, now)}</span>
|
|
56
56
|
</button>
|
|
57
57
|
<Popconfirm title={`Stop ${formatToolName(task.toolName)}?`} okText="Stop" okType="danger" onConfirm={onCancel} getPopupContainer={() => document.body}>
|
|
58
58
|
<button type="button" disabled={cancelling} title="Stop" aria-label={`Stop ${formatToolName(task.toolName)}`} className="inline-flex size-5 shrink-0 items-center justify-center rounded cursor-pointer text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-40">
|
|
59
|
-
<
|
|
59
|
+
<Icon name="stop" size={10} />
|
|
60
60
|
</button>
|
|
61
61
|
</Popconfirm>
|
|
62
62
|
</div>
|
|
@@ -118,9 +118,9 @@ export function BackgroundTasksBar({ children, tasks = [], cancellingIds, onCanc
|
|
|
118
118
|
|
|
119
119
|
{tasks.length > 0 ? (
|
|
120
120
|
<div className="absolute inset-x-6 bottom-[calc(100%)] z-20 overflow-hidden rounded-t-lg border-x border-t border-border">
|
|
121
|
-
<div className={cn("flex h-7.5 items-center gap-1 px-1", open && "border-b border-border-
|
|
122
|
-
<button type="button" onClick={() => setOpen((v) => !v)} className="flex min-w-0 flex-1 cursor-pointer font-medium items-center gap-1 rounded-md px-1.5 py-1 text-
|
|
123
|
-
<
|
|
121
|
+
<div className={cn("flex h-7.5 items-center gap-1 px-1", open && "border-b border-border-secondary")}>
|
|
122
|
+
<button type="button" onClick={() => setOpen((v) => !v)} className="flex min-w-0 flex-1 cursor-pointer font-medium items-center gap-1 rounded-md px-1.5 py-1 text-sm text-muted-foreground/90 transition-colors hover:text-foreground" aria-expanded={open} aria-label={label}>
|
|
123
|
+
<Icon name="arrow-down" size={13} className={cn("shrink-0 transition-transform duration-150", !open && "-rotate-90")} />
|
|
124
124
|
<span className="truncate">{label}</span>
|
|
125
125
|
</button>
|
|
126
126
|
</div>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
5
5
|
import { Spin } from "../../spin/Spin";
|
|
6
|
+
import { chatRowBoxClass, chatRowClass } from "../chatRhythm";
|
|
6
7
|
import { formatBgElapsed, parseBgTaskRef } from "../common/bgTasks";
|
|
7
8
|
import { parseJsonObject, prettyJson, timestampMs } from "../common/utils";
|
|
8
9
|
import { ChatMarkdown } from "../message-ui/ChatMarkdown";
|
|
@@ -62,7 +63,7 @@ function AgentTurn({
|
|
|
62
63
|
<div className={cn("flex items-start gap-2", align === "end" && "flex-row-reverse")}>
|
|
63
64
|
<AgentAvatar name={name} className="mt-0.5 shrink-0" />
|
|
64
65
|
<div className={cn("flex min-w-0 flex-1 flex-col gap-0.5", align === "end" ? "items-end" : "items-start")}>
|
|
65
|
-
<span className="select-none text-
|
|
66
|
+
<span className="select-none text-sm font-medium text-tertiary-foreground">{name}</span>
|
|
66
67
|
<div className="w-fit max-w-[92%]">{children}</div>
|
|
67
68
|
</div>
|
|
68
69
|
</div>
|
|
@@ -85,7 +86,7 @@ function ExpandableBody({ children, className }: { children: ReactNode; classNam
|
|
|
85
86
|
{children}
|
|
86
87
|
</div>
|
|
87
88
|
{overflows ? (
|
|
88
|
-
<button type="button" onClick={() => setExpanded((v) => !v)} className="mt-1 cursor-pointer border-0 bg-transparent p-0 text-
|
|
89
|
+
<button type="button" onClick={() => setExpanded((v) => !v)} className="mt-1 cursor-pointer border-0 bg-transparent p-0 text-sm text-tertiary-foreground hover:text-foreground">
|
|
89
90
|
{expanded ? "Show less" : "Show more"}
|
|
90
91
|
</button>
|
|
91
92
|
) : null}
|
|
@@ -118,19 +119,19 @@ export function CallAgentToolUI({ msg, assistantLabel = "Assistant", assistantCo
|
|
|
118
119
|
const statusLabel = failed && !awaitingReply ? (parsed?.error ?? "Call failed") : null;
|
|
119
120
|
|
|
120
121
|
return (
|
|
121
|
-
<div className=
|
|
122
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
122
123
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
123
|
-
<div className=
|
|
124
|
+
<div className={chatRowBoxClass}>
|
|
124
125
|
<div className={cn("overflow-hidden rounded-xl border bg-card", failed ? "border-destructive/35" : "border-border")}>
|
|
125
|
-
<div className="flex items-center gap-2 border-b border-border-
|
|
126
|
+
<div className="flex items-center gap-2 border-b border-border-secondary px-3 py-2">
|
|
126
127
|
{calling ? (
|
|
127
128
|
<Spin variant="agent" size="small" className="shrink-0" />
|
|
128
129
|
) : (
|
|
129
|
-
<
|
|
130
|
+
<Icon name="dialog" size={13} className="shrink-0 text-muted-foreground" />
|
|
130
131
|
)}
|
|
131
|
-
<Shimmer active={calling} className="min-w-0 flex-1 truncate text-
|
|
132
|
-
{bgRunning ? <span className="text-
|
|
133
|
-
{statusLabel ? <span className="max-w-40 truncate text-
|
|
132
|
+
<Shimmer active={calling} className="min-w-0 flex-1 truncate text-sm font-medium text-foreground">Calling {calleeName}</Shimmer>
|
|
133
|
+
{bgRunning ? <span className="text-sm tabular-nums text-muted-foreground">{formatBgElapsed(timestampMs(msg.timestamp), now)}</span> : null}
|
|
134
|
+
{statusLabel ? <span className="max-w-40 truncate text-sm italic text-destructive">{statusLabel}</span> : null}
|
|
134
135
|
<ToolUiTrailing failed={failed && !awaitingReply} />
|
|
135
136
|
</div>
|
|
136
137
|
|
|
@@ -138,8 +139,8 @@ export function CallAgentToolUI({ msg, assistantLabel = "Assistant", assistantCo
|
|
|
138
139
|
<div className="flex flex-col gap-3 px-3 py-3">
|
|
139
140
|
{composing || hasRequest ? (
|
|
140
141
|
<AgentTurn name={assistantLabel} align="end">
|
|
141
|
-
<div className="nonla-chat-user rounded-2xl rounded-tr-sm border border-solid border-(--nonla-input) bg-
|
|
142
|
-
{composing ? <TypingDots /> : <p className="m-0 text-
|
|
142
|
+
<div className="nonla-chat-user rounded-2xl rounded-tr-sm border border-solid border-(--nonla-input) bg-muted-strong px-3 py-2 text-left [.light:not(.dark)_&]:bg-sidebar [.light_.nonla-ui:not(.dark)_&]:bg-sidebar">
|
|
143
|
+
{composing ? <TypingDots /> : <p className="m-0 text-sm leading-[1.55] whitespace-pre-wrap text-foreground">{requestMessage}</p>}
|
|
143
144
|
</div>
|
|
144
145
|
</AgentTurn>
|
|
145
146
|
) : null}
|
|
@@ -150,17 +151,17 @@ export function CallAgentToolUI({ msg, assistantLabel = "Assistant", assistantCo
|
|
|
150
151
|
{awaitingReply ? (
|
|
151
152
|
<div className="flex items-center gap-1.5 py-0.5">
|
|
152
153
|
<ChatSpinner />
|
|
153
|
-
<span className="text-
|
|
154
|
+
<span className="text-sm italic text-muted-foreground">Replying…</span>
|
|
154
155
|
</div>
|
|
155
156
|
) : failed ? (
|
|
156
|
-
<p className="m-0 text-
|
|
157
|
+
<p className="m-0 text-sm leading-[1.55] text-destructive">{parsed?.error ?? "Agent call failed"}</p>
|
|
157
158
|
) : parsed ? (
|
|
158
159
|
<ExpandableBody>
|
|
159
160
|
<ChatMarkdown content={parsed.response ?? "(no response)"} />
|
|
160
161
|
</ExpandableBody>
|
|
161
162
|
) : (
|
|
162
163
|
<ExpandableBody>
|
|
163
|
-
<pre className="m-0 font-mono text-
|
|
164
|
+
<pre className="m-0 font-mono text-sm leading-normal break-all whitespace-pre-wrap text-muted-foreground">{prettyJson(msg.toolOutput)}</pre>
|
|
164
165
|
</ExpandableBody>
|
|
165
166
|
)}
|
|
166
167
|
</div>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type ReactNode, useState } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
5
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
5
6
|
import { formatToolName, hasMeaningfulInput, prettyJson } from "../common/utils";
|
|
6
7
|
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
7
8
|
|
|
@@ -28,39 +29,39 @@ export function ChatToolCall({ toolName = "Tool", label, toolInput, toolOutput,
|
|
|
28
29
|
const [open, setOpen] = useState(defaultOpen);
|
|
29
30
|
const displayLabel = label ?? formatToolName(toolName);
|
|
30
31
|
|
|
31
|
-
const identityIcon = icon ?? <
|
|
32
|
+
const identityIcon = icon ?? <Icon name="code" size={13} className="shrink-0 text-muted-foreground" />;
|
|
32
33
|
|
|
33
34
|
const header = (
|
|
34
35
|
<>
|
|
35
36
|
{identityIcon}
|
|
36
37
|
<span className="flex min-w-0 items-center gap-1">
|
|
37
|
-
<Shimmer active={running} className={cn("min-w-0 truncate text-left
|
|
38
|
-
<ToolUiTrailing failed={hasError} chevron={expandable} chevronClassName={cn("group-hover:opacity-100", open && "opacity-100 rotate-90")} />
|
|
38
|
+
<Shimmer active={running} className={cn("min-w-0 truncate text-left font-medium", !running && "text-muted-foreground")}>{displayLabel}</Shimmer>
|
|
39
|
+
<ToolUiTrailing failed={hasError} chevron={expandable} chevronClassName={cn("text-muted-foreground group-hover:opacity-100", open && "opacity-100 rotate-90")} />
|
|
39
40
|
</span>
|
|
40
41
|
</>
|
|
41
42
|
);
|
|
42
43
|
|
|
43
44
|
return (
|
|
44
|
-
<div className={cn("nonla-chat-tool
|
|
45
|
-
<div className="px-4
|
|
45
|
+
<div className={cn("nonla-chat-tool", chatRowClass, className)}>
|
|
46
|
+
<div className="px-4">
|
|
46
47
|
{expandable ? (
|
|
47
|
-
<button type="button" onClick={() => setOpen((v) => !v)} className="group
|
|
48
|
+
<button type="button" onClick={() => setOpen((v) => !v)} className={cn(chatToolLineClass, "group w-full cursor-pointer border-0 bg-transparent outline-none")}>
|
|
48
49
|
{header}
|
|
49
50
|
</button>
|
|
50
51
|
) : (
|
|
51
|
-
<div className="
|
|
52
|
+
<div className={cn(chatToolLineClass, "w-full")}>{header}</div>
|
|
52
53
|
)}
|
|
53
54
|
|
|
54
55
|
{open && expandable ? (
|
|
55
|
-
<div className="mt-1.5 mb-1 overflow-hidden rounded-lg border border-
|
|
56
|
-
{hasInput ? <pre className="m-0 max-h-27.5 overflow-y-auto
|
|
56
|
+
<div className={cn("mt-1.5 mb-1 overflow-hidden rounded-lg border font-mono text-sm", hasError ? "border-destructive/35 bg-destructive/6" : "border-border bg-card")}>
|
|
57
|
+
{hasInput ? <pre className="m-0 max-h-27.5 overflow-y-auto px-3 py-1.5 break-all whitespace-pre-wrap font-normal leading-[1.65] text-muted-foreground">{prettyJson(toolInput)}</pre> : null}
|
|
57
58
|
{running ? (
|
|
58
|
-
<div className="
|
|
59
|
+
<div className={cn("px-3 py-1.5 text-muted-foreground", hasInput && "border-t border-border")}>
|
|
59
60
|
<Shimmer className="italic">Running…</Shimmer>
|
|
60
61
|
</div>
|
|
61
62
|
) : null}
|
|
62
63
|
{!isPending ? (
|
|
63
|
-
<pre className={cn("m-0 max-h-75 overflow-y-auto
|
|
64
|
+
<pre className={cn("m-0 max-h-75 overflow-y-auto px-3 py-1.5 break-all whitespace-pre-wrap font-normal leading-[1.65]", hasInput && "border-t", hasError ? "border-destructive/35 text-destructive" : "border-border text-muted-foreground")}>
|
|
64
65
|
{hasOutput ? prettyJson(toolOutput) : typeof toolError === "string" ? toolError : "Tool execution failed"}
|
|
65
66
|
</pre>
|
|
66
67
|
) : null}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from "../../icon/Icon";
|
|
2
2
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
3
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
3
4
|
import { parseJsonObject } from "../common/utils";
|
|
4
5
|
import { ToolUiBadge } from "./ToolUiBadge";
|
|
5
6
|
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
@@ -36,12 +37,12 @@ export function GetCurrentTimeToolUI({ msg, assistantLabel = "Assistant", assist
|
|
|
36
37
|
const label = formatLabel(output?.iso, output?.timezone, output?.time);
|
|
37
38
|
|
|
38
39
|
return (
|
|
39
|
-
<div className=
|
|
40
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
40
41
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
41
|
-
<div className="px-4
|
|
42
|
-
<div className=
|
|
43
|
-
<
|
|
44
|
-
<Shimmer active={running} className="truncate
|
|
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-medium tabular-nums text-muted-foreground">{hasError ? "Failed to get time" : running ? "Getting time…" : label}</Shimmer>
|
|
45
46
|
<ToolUiTrailing failed={hasError} />
|
|
46
47
|
</div>
|
|
47
48
|
</div>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from "../../icon/Icon";
|
|
2
2
|
import { cn } from "../../lib/cn";
|
|
3
3
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
4
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
4
5
|
import { parseJsonObject } from "../common/utils";
|
|
5
6
|
import { ToolUiBadge } from "./ToolUiBadge";
|
|
6
7
|
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
@@ -51,25 +52,25 @@ export function ReadSkillToolUI({ msg, assistantLabel = "Assistant", assistantCo
|
|
|
51
52
|
})();
|
|
52
53
|
|
|
53
54
|
return (
|
|
54
|
-
<div className=
|
|
55
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
55
56
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
56
|
-
<details className="group/readskill px-4
|
|
57
|
-
<summary className="
|
|
58
|
-
<
|
|
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" />
|
|
59
60
|
<Shimmer active={running} className="min-w-0 truncate font-medium text-muted-foreground">
|
|
60
61
|
{verb}
|
|
61
|
-
{targetLabel ? <span className="
|
|
62
|
+
{targetLabel ? <span className="text-tertiary-foreground"> {targetLabel}</span> : null}
|
|
62
63
|
</Shimmer>
|
|
63
64
|
<ToolUiTrailing failed={failed} chevron chevronClassName="group-hover/readskill:opacity-100 group-open/readskill:opacity-100 group-open/readskill:rotate-90" />
|
|
64
65
|
</summary>
|
|
65
66
|
{body ? (
|
|
66
|
-
<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-
|
|
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>
|
|
67
68
|
) : null}
|
|
68
69
|
{!running && !reference && available.length > 0 ? (
|
|
69
70
|
<div className="mt-0.5 mb-1 flex flex-wrap items-center gap-1">
|
|
70
|
-
<span className="text-
|
|
71
|
+
<span className="text-sm font-medium tracking-wide text-quaternary-foreground uppercase">Refs</span>
|
|
71
72
|
{available.map((name) => (
|
|
72
|
-
<span key={name} className="inline-flex max-w-full items-center rounded-md border border-border-
|
|
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">
|
|
73
74
|
{skillName ? `${skillName} / ${name}` : name}
|
|
74
75
|
</span>
|
|
75
76
|
))}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CodeBlock } from "../../codeblock/CodeBlock";
|
|
2
|
-
import {
|
|
2
|
+
import { Icon } from "../../icon/Icon";
|
|
3
3
|
import { cn } from "../../lib/cn";
|
|
4
4
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
5
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
5
6
|
import { parseBgTaskRef } from "../common/bgTasks";
|
|
6
7
|
import { parseJsonObject, prettyJson } from "../common/utils";
|
|
7
8
|
import { ChatSpinner } from "../message-ui/ChatSpinner";
|
|
@@ -45,7 +46,7 @@ function SandboxOutput({
|
|
|
45
46
|
}) {
|
|
46
47
|
if (running) {
|
|
47
48
|
return (
|
|
48
|
-
<div className="flex items-center gap-2 border-t border-border px-3 py-2 text-
|
|
49
|
+
<div className="flex items-center gap-2 border-t border-border px-3 py-2 text-sm text-muted-foreground">
|
|
49
50
|
<ChatSpinner />
|
|
50
51
|
<Shimmer>Running…</Shimmer>
|
|
51
52
|
</div>
|
|
@@ -53,7 +54,7 @@ function SandboxOutput({
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
return (
|
|
56
|
-
<div className={cn("max-h-40 overflow-y-auto border-t px-3 py-2 font-mono text-
|
|
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")}>
|
|
57
58
|
{consoleOut ? <pre className="m-0 whitespace-pre-wrap break-all text-tertiary-foreground">{consoleOut}</pre> : null}
|
|
58
59
|
{failed ? (
|
|
59
60
|
<pre className={cn("m-0 whitespace-pre-wrap break-all text-destructive", consoleOut && "mt-1")}>{resultText(result)}</pre>
|
|
@@ -83,11 +84,11 @@ export function RunJsToolUI({ msg, assistantLabel = "Assistant", assistantColor,
|
|
|
83
84
|
const verb = failed ? "JS failed" : running ? "Running JS" : "Ran JS";
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
|
-
<div className=
|
|
87
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
87
88
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
88
|
-
<details className="group/runjs px-4
|
|
89
|
-
<summary className="
|
|
90
|
-
<
|
|
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" />
|
|
91
92
|
<Shimmer active={running} className="min-w-0 truncate font-medium text-muted-foreground">{verb}</Shimmer>
|
|
92
93
|
<ToolUiTrailing running={running} failed={failed} chevron chevronClassName="group-hover/runjs:opacity-100 group-open/runjs:opacity-100 group-open/runjs:rotate-90" />
|
|
93
94
|
</summary>
|
|
@@ -97,7 +98,7 @@ export function RunJsToolUI({ msg, assistantLabel = "Assistant", assistantColor,
|
|
|
97
98
|
{showOutput ? <SandboxOutput running={running} failed={failed} consoleOut={consoleOut} result={resultBody} /> : null}
|
|
98
99
|
</CodeBlock>
|
|
99
100
|
) : showOutput ? (
|
|
100
|
-
<div className={cn("mt-1.5 mb-1 overflow-hidden rounded-lg border", failed ? "border-destructive/35" : "border-
|
|
101
|
+
<div className={cn("mt-1.5 mb-1 overflow-hidden rounded-lg border", failed ? "border-destructive/35" : "border-border")}>
|
|
101
102
|
<SandboxOutput running={running} failed={failed} consoleOut={consoleOut} result={resultBody} />
|
|
102
103
|
</div>
|
|
103
104
|
) : null}
|
|
@@ -2,7 +2,7 @@ export function ToolUiBadge({ show = false, label, color }: { show?: boolean; la
|
|
|
2
2
|
if (!show) return null;
|
|
3
3
|
return (
|
|
4
4
|
<div className="flex items-center gap-2.5 px-4 pt-3 pb-1">
|
|
5
|
-
<span className="inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-bold tracking-wider uppercase select-none" style={{ background: color ?? "var(--
|
|
5
|
+
<span className="inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-bold tracking-wider uppercase select-none" style={{ background: color ?? "var(--nonla-text-main)", color: "var(--nonla-bg)", letterSpacing: "0.08em" }}>
|
|
6
6
|
{label}
|
|
7
7
|
</span>
|
|
8
8
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from "../../icon/Icon";
|
|
2
2
|
import { cn } from "../../lib/cn";
|
|
3
3
|
import { ChatSpinner } from "../message-ui/ChatSpinner";
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export function ToolUiTrailing({
|
|
|
14
14
|
chevronClassName?: string;
|
|
15
15
|
}) {
|
|
16
16
|
if (running) return <ChatSpinner />;
|
|
17
|
-
if (failed) return <
|
|
17
|
+
if (failed) return <Icon name="error" size={13} className="shrink-0 text-destructive" />;
|
|
18
18
|
if (!chevron) return null;
|
|
19
|
-
return <
|
|
19
|
+
return <Icon name="arrow-right" size={12} className={cn("shrink-0 opacity-0 transition-[opacity,transform] duration-150", chevronClassName)} />;
|
|
20
20
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Icon } from "../../icon/Icon";
|
|
2
2
|
import { cn } from "../../lib/cn";
|
|
3
3
|
import { Shimmer } from "../../shimmer/Shimmer";
|
|
4
|
+
import { chatRowClass, chatToolLineClass } from "../chatRhythm";
|
|
4
5
|
import { parseJsonObject } from "../common/utils";
|
|
5
6
|
import { ToolUiBadge } from "./ToolUiBadge";
|
|
6
7
|
import { ToolUiTrailing } from "./ToolUiTrailing";
|
|
@@ -37,25 +38,25 @@ export function WebFetchToolUI({ msg, assistantLabel = "Assistant", assistantCol
|
|
|
37
38
|
|
|
38
39
|
const header = (
|
|
39
40
|
<>
|
|
40
|
-
<
|
|
41
|
+
<Icon name="globe" size={13} className="shrink-0 text-muted-foreground" />
|
|
41
42
|
<Shimmer active={running} className="min-w-0 truncate font-medium text-muted-foreground">
|
|
42
|
-
{verb} <span className="
|
|
43
|
+
{verb} <span className="text-tertiary-foreground">{url}</span>
|
|
43
44
|
</Shimmer>
|
|
44
45
|
<ToolUiTrailing failed={failed} chevron={expandable} chevronClassName="group-hover/webfetch:opacity-100 group-open/webfetch:opacity-100 group-open/webfetch:rotate-90" />
|
|
45
46
|
</>
|
|
46
47
|
);
|
|
47
48
|
|
|
48
49
|
return (
|
|
49
|
-
<div className=
|
|
50
|
+
<div className={`${chatRowClass} animate-fadeIn`}>
|
|
50
51
|
<ToolUiBadge show={showAvatar} label={assistantLabel} color={assistantColor} />
|
|
51
52
|
{expandable ? (
|
|
52
|
-
<details className="group/webfetch px-4
|
|
53
|
-
<summary className="
|
|
54
|
-
<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-
|
|
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>
|
|
55
56
|
</details>
|
|
56
57
|
) : (
|
|
57
|
-
<div className="px-4
|
|
58
|
-
<div className=
|
|
58
|
+
<div className="px-4">
|
|
59
|
+
<div className={chatToolLineClass}>{header}</div>
|
|
59
60
|
</div>
|
|
60
61
|
)}
|
|
61
62
|
</div>
|
|
@@ -17,9 +17,9 @@ export type CheckboxProps = Omit<ComponentPropsWithoutRef<typeof CheckboxPrimiti
|
|
|
17
17
|
|
|
18
18
|
const CHECKED_FILL: Record<CheckboxColor, string> = {
|
|
19
19
|
brand:
|
|
20
|
-
"data-[state=checked]:bg-brand data-[state=checked]:border-brand data-[state=checked]:text-(--nonla-solid
|
|
20
|
+
"data-[state=checked]:bg-brand data-[state=checked]:border-brand data-[state=checked]:text-(--nonla-text-on-solid) data-[state=indeterminate]:bg-brand data-[state=indeterminate]:border-brand data-[state=indeterminate]:text-(--nonla-text-on-solid)",
|
|
21
21
|
success:
|
|
22
|
-
"data-[state=checked]:bg-success data-[state=checked]:border-success data-[state=checked]:text-(--nonla-solid
|
|
22
|
+
"data-[state=checked]:bg-success data-[state=checked]:border-success data-[state=checked]:text-(--nonla-text-on-solid) data-[state=indeterminate]:bg-success data-[state=indeterminate]:border-success data-[state=indeterminate]:text-(--nonla-text-on-solid)",
|
|
23
23
|
white:
|
|
24
24
|
"data-[state=checked]:bg-white data-[state=checked]:border-white data-[state=checked]:text-[#141414] data-[state=indeterminate]:bg-white data-[state=indeterminate]:border-white data-[state=indeterminate]:text-[#141414]",
|
|
25
25
|
};
|
|
@@ -54,7 +54,7 @@ export function CodeBlock({ code, language, title, lineNumbers = false, wordWrap
|
|
|
54
54
|
|
|
55
55
|
<OverlayScroll
|
|
56
56
|
autoHeight
|
|
57
|
-
className="nonla-codeblock-body nonla-codeblock-well min-w-0 bg-card font-mono text-
|
|
57
|
+
className="nonla-codeblock-body nonla-codeblock-well min-w-0 bg-card font-mono text-(length:--md-code-size,var(--nonla-mono-text-size)) leading-(--md-code-leading,calc(var(--nonla-mono-text-size)*1.6)) max-h-96"
|
|
58
58
|
innerClassName={wordWrap ? undefined : "overflow-x-auto"}
|
|
59
59
|
>
|
|
60
60
|
<pre className={cn("nonla-codeblock-pre m-0 whitespace-pre break-normal", lineNumbers && "nonla-codeblock-lines", wordWrap && "whitespace-pre-wrap wrap-break-word")}>
|