@mcp-b/react-components 0.6.5 → 0.7.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/AgentChat-403mckDG.d.ts +101 -0
- package/dist/BrowserLiveView-ZktFZiMD.d.ts +47 -0
- package/dist/BrowserReplay-6G-mnwcn.d.ts +40 -0
- package/dist/{CodeBlock-BK0sOAbV.js → CodeBlock-D9koxDA7.js} +1 -1
- package/dist/{FileTree-BWQZ0FSi.js → FileTree-BdK93Uuu.js} +1 -1
- package/dist/ModelSelector-MQvK-pNb.js +306 -0
- package/dist/PromptInput-D6-G24p7.d.ts +528 -0
- package/dist/ThinkChatActivity-CeHzk6-K.d.ts +73 -0
- package/dist/ThinkChatContext-CC94HL4u.d.ts +28 -0
- package/dist/ThinkChatToolParts-DnUiZgCC.d.ts +83 -0
- package/dist/components/Activity.js +1 -1
- package/dist/components/AgentChat.d.ts +1 -103
- package/dist/components/AgentChat.js +77 -58
- package/dist/components/AgentConnection.d.ts +43 -2
- package/dist/components/AgentConnection.js +154 -3
- package/dist/components/Artifact.js +1 -1
- package/dist/components/BrowserLiveView.d.ts +1 -46
- package/dist/components/BrowserLiveView.js +1 -1
- package/dist/components/BrowserReplay.d.ts +1 -39
- package/dist/components/BrowserReplay.js +1 -1
- package/dist/components/ChainOfThought.d.ts +1 -1
- package/dist/components/ChainOfThought.js +1 -1
- package/dist/components/ChatGptSignInScreen.d.ts +38 -0
- package/dist/components/ChatGptSignInScreen.js +201 -0
- package/dist/components/CodeBlock.js +1 -1
- package/dist/components/Commit.js +1 -1
- package/dist/components/Context.d.ts +6 -10
- package/dist/components/Context.js +4 -2
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/Conversation.d.ts +28 -28
- package/dist/components/Conversation.js +36 -55
- package/dist/components/Dialog.js +1 -1
- package/dist/components/EnvironmentVariables.js +1 -1
- package/dist/components/FileTree.js +1 -1
- package/dist/components/Marker.d.ts +57 -0
- package/dist/components/Marker.js +89 -0
- package/dist/components/McpServerPicker.js +1 -1
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Message.js +1 -1
- package/dist/components/MessageScroller.d.ts +52 -0
- package/dist/components/MessageScroller.js +62 -0
- package/dist/components/ModelSelector.js +1 -305
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/PromptInput.d.ts +2 -534
- package/dist/components/PromptInput.js +18 -12
- package/dist/components/Queue.js +1 -1
- package/dist/components/Reasoning.js +1 -1
- package/dist/components/Select.js +1 -1
- package/dist/components/Sources.js +1 -1
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Task.js +1 -1
- package/dist/components/Terminal.js +2 -2
- package/dist/components/TestResults.js +1 -1
- package/dist/components/ThinkChat.d.ts +23 -80
- package/dist/components/ThinkChat.js +60 -857
- package/dist/components/ThinkChatActivity.d.ts +3 -0
- package/dist/components/ThinkChatActivity.js +429 -0
- package/dist/components/ThinkChatContext.d.ts +2 -0
- package/dist/components/ThinkChatContext.js +10 -0
- package/dist/components/ThinkChatToolPanels.d.ts +39 -0
- package/dist/components/ThinkChatToolPanels.js +355 -0
- package/dist/components/ThinkChatToolParts.d.ts +2 -0
- package/dist/components/ThinkChatToolParts.js +66 -0
- package/dist/components/ThinkFullApp.d.ts +23 -0
- package/dist/components/ThinkFullApp.js +175 -0
- package/dist/components/WebPreview.js +1 -1
- package/dist/components/WorkspaceExplorer.d.ts +1 -1
- package/dist/components/WorkspaceExplorer.js +3 -3
- package/dist/components/icons.d.ts +2 -2
- package/dist/components/icons.js +2 -2
- package/dist/components/useStickToBottom.d.ts +5 -2
- package/dist/components/useStickToBottom.js +5 -2
- package/dist/{copy-button-CB2MWcau.js → copy-button-TVhDAroI.js} +1 -1
- package/dist/{icons-BCNawx-T.js → icons-BAlTbWWP.js} +27 -1
- package/dist/{icons-BYpJY6L2.d.ts → icons-BRI54ATJ.d.ts} +2 -1
- package/dist/styles/agent-chat.css +15 -3
- package/dist/styles/agent-connection.css +33 -4
- package/dist/styles/chatgpt-sign-in-screen.css +224 -0
- package/dist/styles/code-block.css +6 -4
- package/dist/styles/conversation.css +10 -0
- package/dist/styles/index.css +4 -0
- package/dist/styles/marker.css +95 -0
- package/dist/styles/message-scroller.css +113 -0
- package/dist/styles/message.css +2 -1
- package/dist/styles/prompt-input.css +1 -0
- package/dist/styles/scrollbars.css +10 -2
- package/dist/styles/streamdown.css +2 -0
- package/dist/styles/think-full-app.css +318 -0
- package/dist/utils/mcp-server-catalog.d.ts +23 -1
- package/dist/utils/mcp-server-catalog.js +27 -1
- package/package.json +3 -2
|
@@ -1,27 +1,23 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { d as DownloadIcon, t as ArrowDownIcon } from "../icons-
|
|
2
|
+
import { d as DownloadIcon, t as ArrowDownIcon } from "../icons-BAlTbWWP.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
|
-
import {
|
|
4
|
+
import { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport } from "./MessageScroller.js";
|
|
5
5
|
import * as React from "react";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { isReasoningUIPart, isTextUIPart } from "ai";
|
|
7
8
|
//#region src/components/Conversation.tsx
|
|
8
|
-
const ConversationContext = React.createContext(null);
|
|
9
|
-
function useConversationContext(component) {
|
|
10
|
-
const ctx = React.useContext(ConversationContext);
|
|
11
|
-
if (!ctx) throw new Error(`${component} must be used inside a <Conversation>.`);
|
|
12
|
-
return ctx;
|
|
13
|
-
}
|
|
14
9
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
10
|
+
* Compatibility wrapper around {@link MessageScroller} for existing
|
|
11
|
+
* conversation imports. Prefer MessageScroller directly for new chat
|
|
12
|
+
* transcript surfaces.
|
|
18
13
|
*
|
|
19
14
|
* Use for assistant/user message streams. Do not use for static lists or
|
|
20
15
|
* logs that should not auto-stick to the latest item.
|
|
21
16
|
*
|
|
22
17
|
* Sigvelo changes: removed Tailwind classes, uses a native scroll region with
|
|
23
|
-
* the
|
|
24
|
-
* keeps transcript export in a separate ConversationDownload
|
|
18
|
+
* the shared MessageScroller primitive, emits `role="log"` with polite
|
|
19
|
+
* updates, and keeps transcript export in a separate ConversationDownload
|
|
20
|
+
* action.
|
|
25
21
|
*
|
|
26
22
|
* Styling consumes Sigvelo canvas, surface, border, spacing, radius, shadow,
|
|
27
23
|
* and motion tokens. Add new behavior in this package when multiple apps need
|
|
@@ -35,7 +31,11 @@ function useConversationContext(component) {
|
|
|
35
31
|
* ```tsx
|
|
36
32
|
* <Conversation>
|
|
37
33
|
* <ConversationContent>
|
|
38
|
-
* {messages.map((m) =>
|
|
34
|
+
* {messages.map((m) => (
|
|
35
|
+
* <ConversationItem key={m.id} messageId={m.id} scrollAnchor={m.role === "user"}>
|
|
36
|
+
* <Message {...m} />
|
|
37
|
+
* </ConversationItem>
|
|
38
|
+
* ))}
|
|
39
39
|
* </ConversationContent>
|
|
40
40
|
* <ConversationScrollButton />
|
|
41
41
|
* </Conversation>
|
|
@@ -44,29 +44,19 @@ function useConversationContext(component) {
|
|
|
44
44
|
* @see {@link https://elements.ai-sdk.dev/components/conversation | AI Elements Conversation}
|
|
45
45
|
*/
|
|
46
46
|
function Conversation({ className, children, ref, ...props }) {
|
|
47
|
-
const { viewportRef, contentRef, isAtBottom, scrollToBottom } = useStickToBottom();
|
|
48
47
|
const handleViewportRef = React.useCallback((element) => {
|
|
49
|
-
viewportRef(element);
|
|
50
48
|
if (typeof ref === "function") {
|
|
51
49
|
ref(element);
|
|
52
50
|
return;
|
|
53
51
|
}
|
|
54
52
|
if (ref) ref.current = element;
|
|
55
|
-
}, [ref
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}), [
|
|
61
|
-
contentRef,
|
|
62
|
-
isAtBottom,
|
|
63
|
-
scrollToBottom
|
|
64
|
-
]);
|
|
65
|
-
return /* @__PURE__ */ jsx(ConversationContext.Provider, {
|
|
66
|
-
value: ctx,
|
|
67
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
53
|
+
}, [ref]);
|
|
54
|
+
return /* @__PURE__ */ jsx(MessageScrollerProvider, {
|
|
55
|
+
autoScroll: true,
|
|
56
|
+
defaultScrollPosition: "end",
|
|
57
|
+
children: /* @__PURE__ */ jsx(MessageScroller, {
|
|
68
58
|
className: cx("conversation", className),
|
|
69
|
-
children: /* @__PURE__ */ jsx(
|
|
59
|
+
children: /* @__PURE__ */ jsx(MessageScrollerViewport, {
|
|
70
60
|
ref: handleViewportRef,
|
|
71
61
|
tabIndex: 0,
|
|
72
62
|
className: "conversation__viewport",
|
|
@@ -80,25 +70,24 @@ function Conversation({ className, children, ref, ...props }) {
|
|
|
80
70
|
* Inner layout wrapper for conversation children. Applies vertical stacking
|
|
81
71
|
* and padding; does not scroll (the parent {@link Conversation} does).
|
|
82
72
|
*/
|
|
83
|
-
function ConversationContent({ className, children,
|
|
84
|
-
|
|
85
|
-
return /* @__PURE__ */ jsx("div", {
|
|
86
|
-
ref: React.useCallback((element) => {
|
|
87
|
-
registerContentElement(element);
|
|
88
|
-
if (typeof ref === "function") {
|
|
89
|
-
ref(element);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (ref) ref.current = element;
|
|
93
|
-
}, [registerContentElement, ref]),
|
|
73
|
+
function ConversationContent({ className, children, ...props }) {
|
|
74
|
+
return /* @__PURE__ */ jsx(MessageScrollerContent, {
|
|
94
75
|
role: "log",
|
|
95
76
|
"aria-live": "polite",
|
|
96
|
-
"aria-relevant": "additions
|
|
77
|
+
"aria-relevant": "additions",
|
|
97
78
|
className: cx("conversation__content", className),
|
|
98
79
|
...props,
|
|
99
80
|
children
|
|
100
81
|
});
|
|
101
82
|
}
|
|
83
|
+
/** Optional wrapper for one turn/message. Enables upstream scroll anchoring and visibility tracking. */
|
|
84
|
+
function ConversationItem({ className, scrollAnchor = false, ...props }) {
|
|
85
|
+
return /* @__PURE__ */ jsx(MessageScrollerItem, {
|
|
86
|
+
className: cx("conversation__item", className),
|
|
87
|
+
scrollAnchor,
|
|
88
|
+
...props
|
|
89
|
+
});
|
|
90
|
+
}
|
|
102
91
|
/**
|
|
103
92
|
* Placeholder shown when there are no messages yet. Renders an icon, title,
|
|
104
93
|
* and description stacked vertically; pass `children` to override the
|
|
@@ -128,23 +117,15 @@ function ConversationEmptyState({ className, title = "No messages yet", descript
|
|
|
128
117
|
}
|
|
129
118
|
/**
|
|
130
119
|
* Floating button that scrolls the conversation to the latest message.
|
|
131
|
-
* Hidden while the viewport is already
|
|
120
|
+
* Hidden from view and tab order while the viewport is already at the end.
|
|
132
121
|
*/
|
|
133
|
-
function ConversationScrollButton({ className, variant = "outline", color = "neutral", size = "icon",
|
|
134
|
-
|
|
135
|
-
if (isAtBottom) return null;
|
|
136
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
137
|
-
ref,
|
|
138
|
-
type: "button",
|
|
122
|
+
function ConversationScrollButton({ className, variant = "outline", color = "neutral", size = "icon", label = "Scroll to latest", children, ...props }) {
|
|
123
|
+
return /* @__PURE__ */ jsx(MessageScrollerButton, {
|
|
139
124
|
variant,
|
|
140
125
|
color,
|
|
141
126
|
size,
|
|
142
127
|
className: cx("conversation__scroll-button", className),
|
|
143
128
|
"aria-label": label,
|
|
144
|
-
onClick: (event) => {
|
|
145
|
-
onClick?.(event);
|
|
146
|
-
if (!event.defaultPrevented) scrollToBottom();
|
|
147
|
-
},
|
|
148
129
|
...props,
|
|
149
130
|
children: children ?? /* @__PURE__ */ jsx(ArrowDownIcon, {})
|
|
150
131
|
});
|
|
@@ -156,7 +137,7 @@ const ROLE_HEADING = {
|
|
|
156
137
|
tool: "### Tool"
|
|
157
138
|
};
|
|
158
139
|
function defaultFormatMessage(message) {
|
|
159
|
-
return `${ROLE_HEADING[message.role] ?? `### ${message.role}`}\n\n${(
|
|
140
|
+
return `${ROLE_HEADING[message.role] ?? `### ${message.role}`}\n\n${("parts" in message ? message.parts.filter((part) => isTextUIPart(part) || isReasoningUIPart(part)).map((part) => part.text).join("") : message.content ?? "").trim()}`;
|
|
160
141
|
}
|
|
161
142
|
/**
|
|
162
143
|
* Converts a conversation to a Markdown document with a heading per message.
|
|
@@ -202,4 +183,4 @@ function ConversationDownload({ className, messages, filename = "conversation.md
|
|
|
202
183
|
});
|
|
203
184
|
}
|
|
204
185
|
//#endregion
|
|
205
|
-
export { Conversation, ConversationContent, ConversationDownload, ConversationEmptyState, ConversationScrollButton, messagesToMarkdown };
|
|
186
|
+
export { Conversation, ConversationContent, ConversationDownload, ConversationEmptyState, ConversationItem, ConversationScrollButton, messagesToMarkdown };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import { a as CheckIcon,
|
|
2
|
+
import { a as CheckIcon, l as CopyIcon, m as EyeOffIcon, p as EyeIcon } from "../icons-BAlTbWWP.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { Badge } from "./Badge.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FileTreeIcon, i as FileTreeFolder, n as FileTreeActions, o as FileTreeName, r as FileTreeFile, t as FileTree } from "../FileTree-
|
|
1
|
+
import { a as FileTreeIcon, i as FileTreeFolder, n as FileTreeActions, o as FileTreeName, r as FileTreeFile, t as FileTree } from "../FileTree-BdK93Uuu.js";
|
|
2
2
|
export { FileTree, FileTreeActions, FileTreeFile, FileTreeFolder, FileTreeIcon, FileTreeName };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/components/Marker.d.ts
|
|
4
|
+
type MarkerVariant = "default" | "separator" | "border";
|
|
5
|
+
type MarkerRenderProps = React.HTMLAttributes<HTMLElement> & {
|
|
6
|
+
ref?: React.Ref<HTMLElement>;
|
|
7
|
+
};
|
|
8
|
+
type MarkerRenderState = {
|
|
9
|
+
variant: MarkerVariant;
|
|
10
|
+
};
|
|
11
|
+
type MarkerRenderFunction = (props: MarkerRenderProps, state: MarkerRenderState) => React.ReactElement | null;
|
|
12
|
+
type MarkerRender = React.ReactElement<React.HTMLAttributes<HTMLElement>> | MarkerRenderFunction;
|
|
13
|
+
interface MarkerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
+
/** Visual treatment for status, separator, or bordered marker rows. */
|
|
15
|
+
variant?: MarkerVariant;
|
|
16
|
+
/** Replace the root element while keeping marker classes, refs, and handlers merged. */
|
|
17
|
+
render?: MarkerRender;
|
|
18
|
+
}
|
|
19
|
+
interface MarkerVariantsOptions {
|
|
20
|
+
variant?: MarkerVariant | null;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function markerVariants({
|
|
24
|
+
variant,
|
|
25
|
+
className
|
|
26
|
+
}?: MarkerVariantsOptions): string;
|
|
27
|
+
/**
|
|
28
|
+
* Compact status or separator row for transcript events like compaction,
|
|
29
|
+
* checkpoints, and progress markers.
|
|
30
|
+
*/
|
|
31
|
+
declare function Marker({
|
|
32
|
+
className,
|
|
33
|
+
variant,
|
|
34
|
+
render,
|
|
35
|
+
ref,
|
|
36
|
+
...props
|
|
37
|
+
}: MarkerProps & {
|
|
38
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
39
|
+
}): React.JSX.Element | null;
|
|
40
|
+
interface MarkerIconProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
41
|
+
declare function MarkerIcon({
|
|
42
|
+
className,
|
|
43
|
+
ref,
|
|
44
|
+
...props
|
|
45
|
+
}: MarkerIconProps & {
|
|
46
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
47
|
+
}): React.JSX.Element;
|
|
48
|
+
interface MarkerContentProps extends React.HTMLAttributes<HTMLSpanElement> {}
|
|
49
|
+
declare function MarkerContent({
|
|
50
|
+
className,
|
|
51
|
+
ref,
|
|
52
|
+
...props
|
|
53
|
+
}: MarkerContentProps & {
|
|
54
|
+
ref?: React.Ref<HTMLSpanElement>;
|
|
55
|
+
}): React.JSX.Element;
|
|
56
|
+
//#endregion
|
|
57
|
+
export { Marker, MarkerContent, MarkerContentProps, MarkerIcon, MarkerIconProps, MarkerProps, MarkerVariant, MarkerVariantsOptions, markerVariants };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Marker.tsx
|
|
5
|
+
function markerVariants({ variant = "default", className } = {}) {
|
|
6
|
+
return cx("marker", `marker--${variant ?? "default"}`, className);
|
|
7
|
+
}
|
|
8
|
+
function assignRef(ref, value) {
|
|
9
|
+
if (!ref) return;
|
|
10
|
+
if (typeof ref === "function") {
|
|
11
|
+
ref(value);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
ref.current = value;
|
|
15
|
+
}
|
|
16
|
+
function mergeRefs(...refs) {
|
|
17
|
+
const activeRefs = refs.filter(Boolean);
|
|
18
|
+
if (activeRefs.length === 0) return void 0;
|
|
19
|
+
return (value) => {
|
|
20
|
+
for (const activeRef of activeRefs) assignRef(activeRef, value);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function isEventHandler(propName, value) {
|
|
24
|
+
return /^on[A-Z]/.test(propName) && typeof value === "function";
|
|
25
|
+
}
|
|
26
|
+
function mergeRenderedMarkerProps(renderProps, markerProps) {
|
|
27
|
+
const mergedProps = {
|
|
28
|
+
...renderProps,
|
|
29
|
+
...markerProps
|
|
30
|
+
};
|
|
31
|
+
const markerPropsRecord = markerProps;
|
|
32
|
+
for (const propName of Object.keys(renderProps)) {
|
|
33
|
+
const renderValue = renderProps[propName];
|
|
34
|
+
const markerValue = markerPropsRecord[propName];
|
|
35
|
+
if (isEventHandler(propName, renderValue) && isEventHandler(propName, markerValue)) mergedProps[propName] = (...args) => {
|
|
36
|
+
renderValue(...args);
|
|
37
|
+
markerValue(...args);
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
mergedProps.className = cx(renderProps.className, markerProps.className);
|
|
41
|
+
mergedProps.style = renderProps.style || markerProps.style ? {
|
|
42
|
+
...renderProps.style,
|
|
43
|
+
...markerProps.style
|
|
44
|
+
} : void 0;
|
|
45
|
+
mergedProps.ref = mergeRefs(renderProps.ref, markerProps.ref);
|
|
46
|
+
return mergedProps;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Compact status or separator row for transcript events like compaction,
|
|
50
|
+
* checkpoints, and progress markers.
|
|
51
|
+
*/
|
|
52
|
+
function Marker({ className, variant = "default", render, ref, ...props }) {
|
|
53
|
+
const rootProps = {
|
|
54
|
+
ref,
|
|
55
|
+
"data-slot": "marker",
|
|
56
|
+
"data-variant": variant,
|
|
57
|
+
className: markerVariants({
|
|
58
|
+
variant,
|
|
59
|
+
className
|
|
60
|
+
}),
|
|
61
|
+
...props
|
|
62
|
+
};
|
|
63
|
+
const markerProps = {
|
|
64
|
+
...rootProps,
|
|
65
|
+
ref
|
|
66
|
+
};
|
|
67
|
+
if (typeof render === "function") return render(markerProps, { variant });
|
|
68
|
+
if (React.isValidElement(render)) return React.cloneElement(render, mergeRenderedMarkerProps(render.props, markerProps));
|
|
69
|
+
return /* @__PURE__ */ jsx("div", { ...rootProps });
|
|
70
|
+
}
|
|
71
|
+
function MarkerIcon({ className, ref, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx("span", {
|
|
73
|
+
ref,
|
|
74
|
+
"data-slot": "marker-icon",
|
|
75
|
+
"aria-hidden": "true",
|
|
76
|
+
className: cx("marker__icon", className),
|
|
77
|
+
...props
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function MarkerContent({ className, ref, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx("span", {
|
|
82
|
+
ref,
|
|
83
|
+
"data-slot": "marker-content",
|
|
84
|
+
className: cx("marker__content", className),
|
|
85
|
+
...props
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { Marker, MarkerContent, MarkerIcon, markerVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as PlusIcon, P as WarningIcon, a as CheckIcon, j as SpinnerIcon } from "../icons-BAlTbWWP.js";
|
|
2
2
|
import { Button } from "./Button.js";
|
|
3
3
|
import { MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRoot, MenuShortcut, MenuTrigger } from "./Menu.js";
|
|
4
4
|
import { getMcpServerIconSrc } from "../utils/mcp-server-catalog.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-
|
|
1
|
+
import { a as CheckIcon, c as ChevronRightIcon, u as DotIcon } from "../icons-BAlTbWWP.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { Menu } from "@base-ui/react/menu";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
-
import {
|
|
2
|
+
import { h as FileIcon, n as ArrowLeftIcon, r as ArrowRightIcon } from "../icons-BAlTbWWP.js";
|
|
3
3
|
import { Button } from "./Button.js";
|
|
4
4
|
import { Tooltip, TooltipPopup, TooltipPortal, TooltipPositioner, TooltipTrigger } from "./Tooltip.js";
|
|
5
5
|
import { t as AttachmentPreview } from "../attachment-preview-ChtC3HiU.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { r as ButtonProps } from "../Button-Ct5I6aTu.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { MessageScroller as MessageScroller$1, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "@shadcn/react/message-scroller";
|
|
4
|
+
|
|
5
|
+
//#region src/components/MessageScroller.d.ts
|
|
6
|
+
type MessageScrollerProviderProps = React.ComponentProps<typeof MessageScroller$1.Provider>;
|
|
7
|
+
interface MessageScrollerProps extends React.ComponentProps<typeof MessageScroller$1.Root> {
|
|
8
|
+
/** Extra class names merged onto the scroll container. */
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
type MessageScrollerViewportProps = React.ComponentProps<typeof MessageScroller$1.Viewport>;
|
|
12
|
+
type MessageScrollerContentProps = React.ComponentProps<typeof MessageScroller$1.Content>;
|
|
13
|
+
type MessageScrollerItemProps = React.ComponentProps<typeof MessageScroller$1.Item>;
|
|
14
|
+
declare function MessageScrollerProvider(props: MessageScrollerProviderProps): React.JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Scroll container for chat transcripts, wrapping shadcn's message scroller
|
|
17
|
+
* primitive with design-system classes.
|
|
18
|
+
*/
|
|
19
|
+
declare function MessageScroller({
|
|
20
|
+
className,
|
|
21
|
+
...props
|
|
22
|
+
}: MessageScrollerProps): React.JSX.Element;
|
|
23
|
+
declare function MessageScrollerViewport({
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}: MessageScrollerViewportProps): React.JSX.Element;
|
|
27
|
+
declare function MessageScrollerContent({
|
|
28
|
+
className,
|
|
29
|
+
...props
|
|
30
|
+
}: MessageScrollerContentProps): React.JSX.Element;
|
|
31
|
+
declare function MessageScrollerItem({
|
|
32
|
+
className,
|
|
33
|
+
scrollAnchor,
|
|
34
|
+
...props
|
|
35
|
+
}: MessageScrollerItemProps): React.JSX.Element;
|
|
36
|
+
interface MessageScrollerButtonProps extends Omit<React.ComponentProps<typeof MessageScroller$1.Button>, "children" | "className" | "color" | "render">, Pick<ButtonProps, "color" | "size" | "variant"> {
|
|
37
|
+
className?: string;
|
|
38
|
+
children?: React.ReactNode;
|
|
39
|
+
render?: React.ComponentProps<typeof MessageScroller$1.Button>["render"];
|
|
40
|
+
}
|
|
41
|
+
declare function MessageScrollerButton({
|
|
42
|
+
className,
|
|
43
|
+
children,
|
|
44
|
+
color,
|
|
45
|
+
direction,
|
|
46
|
+
render,
|
|
47
|
+
size,
|
|
48
|
+
variant,
|
|
49
|
+
...props
|
|
50
|
+
}: MessageScrollerButtonProps): React.JSX.Element;
|
|
51
|
+
//#endregion
|
|
52
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerButtonProps, MessageScrollerContent, MessageScrollerContentProps, MessageScrollerItem, MessageScrollerItemProps, MessageScrollerProps, MessageScrollerProvider, MessageScrollerProviderProps, MessageScrollerViewport, MessageScrollerViewportProps, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { t as cx } from "../class-names-9UtZwb0J.js";
|
|
2
|
+
import { t as ArrowDownIcon } from "../icons-BAlTbWWP.js";
|
|
3
|
+
import { Button } from "./Button.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { MessageScroller as MessageScroller$1, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from "@shadcn/react/message-scroller";
|
|
7
|
+
//#region src/components/MessageScroller.tsx
|
|
8
|
+
function MessageScrollerProvider(props) {
|
|
9
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Provider, { ...props });
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Scroll container for chat transcripts, wrapping shadcn's message scroller
|
|
13
|
+
* primitive with design-system classes.
|
|
14
|
+
*/
|
|
15
|
+
function MessageScroller({ className, ...props }) {
|
|
16
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Root, {
|
|
17
|
+
"data-slot": "message-scroller",
|
|
18
|
+
className: cx("message-scroller", className),
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function MessageScrollerViewport({ className, ...props }) {
|
|
23
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Viewport, {
|
|
24
|
+
"data-slot": "message-scroller-viewport",
|
|
25
|
+
className: cx("message-scroller__viewport", className),
|
|
26
|
+
...props
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
function MessageScrollerContent({ className, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Content, {
|
|
31
|
+
"data-slot": "message-scroller-content",
|
|
32
|
+
className: cx("message-scroller__content", className),
|
|
33
|
+
...props
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function MessageScrollerItem({ className, scrollAnchor = false, ...props }) {
|
|
37
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Item, {
|
|
38
|
+
"data-slot": "message-scroller-item",
|
|
39
|
+
scrollAnchor,
|
|
40
|
+
className: cx("message-scroller__item", className),
|
|
41
|
+
...props
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function MessageScrollerButton({ className, children, color = "neutral", direction = "end", render, size = "icon-sm", variant = "normal", ...props }) {
|
|
45
|
+
return /* @__PURE__ */ jsx(MessageScroller$1.Button, {
|
|
46
|
+
"data-slot": "message-scroller-button",
|
|
47
|
+
direction,
|
|
48
|
+
className: cx("message-scroller__button", className),
|
|
49
|
+
render: render ?? /* @__PURE__ */ jsx(Button, {
|
|
50
|
+
color,
|
|
51
|
+
size,
|
|
52
|
+
variant
|
|
53
|
+
}),
|
|
54
|
+
...props,
|
|
55
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ArrowDownIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
56
|
+
className: "message-scroller__button-label",
|
|
57
|
+
children: direction === "end" ? "Scroll to end" : "Scroll to start"
|
|
58
|
+
})] })
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//#endregion
|
|
62
|
+
export { MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility };
|