@mcp-b/react-components 0.10.0 → 0.12.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/dist/{AgentChat-B9LD_WF1.d.ts → AgentChat-CRmsKg9B.d.ts} +10 -6
- package/dist/{BrowserLiveView-ZktFZiMD.d.ts → BrowserLiveView-BV5qgFgI.d.ts} +11 -10
- package/dist/{BrowserReplay-6G-mnwcn.d.ts → BrowserReplay-xWvRjRAC.d.ts} +2 -1
- package/dist/{Menu-B5vDqZe_.d.ts → Menu-BLhnNnRK.d.ts} +3 -0
- package/dist/{ModelSelector-DXtpcRmT.js → ModelSelector-BB-xB-Es.js} +16 -13
- package/dist/{PromptInput-D6-G24p7.d.ts → PromptInput-IyM6ZETj.d.ts} +13 -45
- package/dist/ThinkChat-B3wYahor.js +190 -0
- package/dist/{ThinkChatActivity-B2UD95My.d.ts → ThinkChatActivity-F4KFPcJA.d.ts} +4 -4
- package/dist/ThinkChatContext-C3Eb1Xpi.d.ts +16 -0
- package/dist/{ThinkChatToolParts-DnUiZgCC.d.ts → ThinkChatToolParts-Cv4o7j6F.d.ts} +13 -5
- package/dist/components/AgentChat.d.ts +1 -1
- package/dist/components/AgentChat.js +57 -23
- package/dist/components/AgentConnection.d.ts +3 -14
- package/dist/components/AgentConnection.js +7 -111
- package/dist/components/Badge.js +1 -15
- package/dist/components/BrowserLiveView.d.ts +1 -1
- package/dist/components/BrowserLiveView.js +14 -10
- package/dist/components/BrowserReplay.d.ts +1 -1
- package/dist/components/BrowserRunPanel.d.ts +46 -0
- package/dist/components/BrowserRunPanel.js +159 -0
- package/dist/components/ChatGptSignInScreen.js +1 -1
- package/dist/components/CodexModelSelector.d.ts +63 -0
- package/dist/components/CodexModelSelector.js +148 -0
- package/dist/components/Commit.d.ts +2 -2
- package/dist/components/Commit.js +10 -22
- package/dist/components/Conversation.d.ts +2 -6
- package/dist/components/Conversation.js +2 -3
- package/dist/components/EnvironmentVariables.d.ts +2 -7
- package/dist/components/EnvironmentVariables.js +10 -33
- package/dist/components/Marker.js +1 -15
- package/dist/components/McpServerPicker.d.ts +31 -6
- package/dist/components/McpServerPicker.js +129 -67
- package/dist/components/Menu.d.ts +1 -1
- package/dist/components/Menu.js +2 -2
- package/dist/components/Message.d.ts +3 -2
- package/dist/components/Message.js +10 -3
- package/dist/components/ModelSelector.d.ts +11 -8
- package/dist/components/ModelSelector.js +1 -1
- package/dist/components/PromptInput.d.ts +2 -2
- package/dist/components/PromptInput.js +49 -98
- package/dist/components/Queue.d.ts +1 -12
- package/dist/components/Reasoning.js +2 -15
- package/dist/components/Stepper.js +1 -7
- package/dist/components/ThinkChat.d.ts +30 -30
- package/dist/components/ThinkChat.js +1 -152
- package/dist/components/ThinkChatActivity.d.ts +2 -2
- package/dist/components/ThinkChatActivity.js +3 -10
- package/dist/components/ThinkChatContext.d.ts +2 -2
- package/dist/components/ThinkChatContext.js +9 -2
- package/dist/components/ThinkChatToolPanels.d.ts +1 -1
- package/dist/components/ThinkChatToolPanels.js +19 -7
- package/dist/components/ThinkChatToolParts.d.ts +1 -1
- package/dist/components/ThinkExecutionWorkbench.d.ts +10 -7
- package/dist/components/ThinkExecutionWorkbench.js +382 -359
- package/dist/components/ThinkFullApp.d.ts +16 -13
- package/dist/components/ThinkFullApp.js +28 -18
- package/dist/components/ThinkThreadPicker.d.ts +1 -31
- package/dist/components/ThinkThreadPicker.js +32 -171
- package/dist/components/ThinkThreadShell.d.ts +35 -0
- package/dist/components/ThinkThreadShell.js +146 -0
- package/dist/components/WorkspaceExplorer.js +3 -1
- package/dist/merge-refs-DF_7w2x_.js +18 -0
- package/dist/styles/agent-chat.css +4 -1
- package/dist/styles/agent-connection.css +0 -166
- package/dist/styles/browser-run-panel.css +125 -0
- package/dist/styles/codex-model-selector.css +197 -0
- package/dist/styles/index.css +5 -0
- package/dist/styles/mcp-server-picker.css +62 -15
- package/dist/styles/message.css +1 -1
- package/dist/styles/model-selector.css +20 -8
- package/dist/styles/prompt-input.css +5 -0
- package/dist/styles/streamdown.css +2 -48
- package/dist/styles/think-execution-workbench.css +337 -0
- package/dist/styles/think-full-app.css +15 -390
- package/dist/styles/think-resize-handle.css +33 -0
- package/dist/styles/think-thread-picker.css +0 -238
- package/dist/styles/think-thread-shell.css +219 -0
- package/dist/styles/workspace-explorer.css +8 -2
- package/dist/summarize-tool-input-BUJsENSn.js +12 -0
- package/dist/utils/mcp-server-catalog.d.ts +2 -3
- package/package.json +2 -2
- package/dist/ThinkChatContext-BLAAb8J5.d.ts +0 -28
- package/dist/components/useStickToBottom.d.ts +0 -33
- package/dist/components/useStickToBottom.js +0 -107
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
//#region src/components/useStickToBottom.ts
|
|
3
|
-
const DEFAULT_STICK_SLACK_PX = 160;
|
|
4
|
-
/**
|
|
5
|
-
* Pin a scrollable viewport to the bottom as its content grows, unless the
|
|
6
|
-
* user has scrolled up.
|
|
7
|
-
*
|
|
8
|
-
* @deprecated Use MessageScroller for chat transcripts. Keep this only for
|
|
9
|
-
* standalone streaming panes that do not need transcript row anchoring,
|
|
10
|
-
* history prepending, visibility tracking, or jump-to-message behavior.
|
|
11
|
-
*/
|
|
12
|
-
function useStickToBottom(options = {}) {
|
|
13
|
-
const slackPx = options.slackPx ?? DEFAULT_STICK_SLACK_PX;
|
|
14
|
-
const viewportElementRef = React.useRef(null);
|
|
15
|
-
const contentElementRef = React.useRef(null);
|
|
16
|
-
const [viewportElement, setViewportElement] = React.useState(null);
|
|
17
|
-
const [contentElement, setContentElement] = React.useState(null);
|
|
18
|
-
const [isAtBottom, setIsAtBottom] = React.useState(true);
|
|
19
|
-
const isAtBottomRef = React.useRef(true);
|
|
20
|
-
const didInitialScrollRef = React.useRef(false);
|
|
21
|
-
const viewportRef = React.useCallback((element) => {
|
|
22
|
-
viewportElementRef.current = element;
|
|
23
|
-
setViewportElement((prev) => prev === element ? prev : element);
|
|
24
|
-
}, []);
|
|
25
|
-
const contentRef = React.useCallback((element) => {
|
|
26
|
-
contentElementRef.current = element;
|
|
27
|
-
setContentElement((prev) => prev === element ? prev : element);
|
|
28
|
-
}, []);
|
|
29
|
-
React.useLayoutEffect(() => {
|
|
30
|
-
const el = viewportElement;
|
|
31
|
-
const observed = contentElement ?? el?.firstElementChild;
|
|
32
|
-
if (!el || !observed) return;
|
|
33
|
-
if (!didInitialScrollRef.current) {
|
|
34
|
-
el.scrollTo({
|
|
35
|
-
top: el.scrollHeight,
|
|
36
|
-
behavior: "auto"
|
|
37
|
-
});
|
|
38
|
-
didInitialScrollRef.current = true;
|
|
39
|
-
}
|
|
40
|
-
const readIsAtBottom = () => el.scrollHeight - el.scrollTop - el.clientHeight < slackPx;
|
|
41
|
-
let lastInteractionAt = 0;
|
|
42
|
-
const markInteraction = () => {
|
|
43
|
-
lastInteractionAt = Date.now();
|
|
44
|
-
};
|
|
45
|
-
const isUserResize = () => Date.now() - lastInteractionAt < 600;
|
|
46
|
-
const updateIsAtBottom = () => {
|
|
47
|
-
const next = readIsAtBottom();
|
|
48
|
-
if (isAtBottomRef.current === next) return;
|
|
49
|
-
isAtBottomRef.current = next;
|
|
50
|
-
setIsAtBottom(next);
|
|
51
|
-
};
|
|
52
|
-
let resizeFrameId = null;
|
|
53
|
-
const flushResize = () => {
|
|
54
|
-
resizeFrameId = null;
|
|
55
|
-
if (!isAtBottomRef.current || isUserResize()) {
|
|
56
|
-
updateIsAtBottom();
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
el.scrollTo({
|
|
60
|
-
top: el.scrollHeight,
|
|
61
|
-
behavior: "auto"
|
|
62
|
-
});
|
|
63
|
-
updateIsAtBottom();
|
|
64
|
-
};
|
|
65
|
-
const scheduleResize = () => {
|
|
66
|
-
if (resizeFrameId !== null) return;
|
|
67
|
-
resizeFrameId = window.requestAnimationFrame(flushResize);
|
|
68
|
-
};
|
|
69
|
-
const handleScroll = () => {
|
|
70
|
-
updateIsAtBottom();
|
|
71
|
-
};
|
|
72
|
-
handleScroll();
|
|
73
|
-
el.addEventListener("scroll", handleScroll, { passive: true });
|
|
74
|
-
el.addEventListener("pointerdown", markInteraction, { passive: true });
|
|
75
|
-
el.addEventListener("keydown", markInteraction, { passive: true });
|
|
76
|
-
const observer = new ResizeObserver(() => {
|
|
77
|
-
scheduleResize();
|
|
78
|
-
});
|
|
79
|
-
observer.observe(observed);
|
|
80
|
-
return () => {
|
|
81
|
-
if (resizeFrameId !== null) window.cancelAnimationFrame(resizeFrameId);
|
|
82
|
-
el.removeEventListener("scroll", handleScroll);
|
|
83
|
-
el.removeEventListener("pointerdown", markInteraction);
|
|
84
|
-
el.removeEventListener("keydown", markInteraction);
|
|
85
|
-
observer.disconnect();
|
|
86
|
-
};
|
|
87
|
-
}, [
|
|
88
|
-
contentElement,
|
|
89
|
-
viewportElement,
|
|
90
|
-
slackPx
|
|
91
|
-
]);
|
|
92
|
-
return {
|
|
93
|
-
viewportRef,
|
|
94
|
-
contentRef,
|
|
95
|
-
isAtBottom,
|
|
96
|
-
scrollToBottom: React.useCallback((behavior = "smooth") => {
|
|
97
|
-
const el = viewportElementRef.current;
|
|
98
|
-
if (!el) return;
|
|
99
|
-
el.scrollTo({
|
|
100
|
-
top: el.scrollHeight,
|
|
101
|
-
behavior
|
|
102
|
-
});
|
|
103
|
-
}, [])
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
//#endregion
|
|
107
|
-
export { useStickToBottom };
|